itemengine-cypress-automation 1.0.204 → 1.0.205

Sign up to get free protection for your applications and to get access to all the features.
Files changed (107) hide show
  1. package/cypress/e2e/ILC/AudioPlayerNew/audioOverviewAndTranscript.js +2 -2
  2. package/cypress/e2e/ILC/ChartsBar/Scoring/addAndDeleteBarAllOrNothingScoring.js +302 -0
  3. package/cypress/e2e/ILC/ChartsBar/Scoring/manuallyAndNonScored.js +282 -0
  4. package/cypress/e2e/ILC/ChartsBar/Scoring/partialDifferentWeightsAlternativePointsGreaterThanCorrectPoints.js +385 -0
  5. package/cypress/e2e/ILC/ChartsBar/Scoring/partialDifferentWeightsCorrectPointsEqualToAlternativePoints.js +386 -0
  6. package/cypress/e2e/ILC/ChartsBar/Scoring/partialDifferentWeightsCorrectPointsGreaterThanAlternativePoints.js +386 -0
  7. package/cypress/e2e/ILC/ChartsBar/Scoring/partialDifferentWeightsMinimumAndPenaltyScoring.js +337 -0
  8. package/cypress/e2e/ILC/ChartsBar/Scoring/partialEqualWeightsCorrectPointsGreaterThanAlternativePoints.js +0 -1
  9. package/cypress/e2e/ILC/ChartsBar/chartFunctionalitySpecifyCorrectAnswerSection.js +258 -0
  10. package/cypress/e2e/ILC/ChartsBar/checkAnswerFunctionalityForAllViews.smoke.js +1 -1
  11. package/cypress/e2e/ILC/ChartsBar/gridSettings.js +439 -0
  12. package/cypress/e2e/ILC/ChartsBar/headerSection.js +105 -0
  13. package/cypress/e2e/ILC/ChartsBar/labelOptionsSection.js +450 -0
  14. package/cypress/e2e/ILC/ChartsBar/specifyCorrectAnswerSection.js +91 -0
  15. package/cypress/e2e/ILC/ChartsBar/toolSettings.js +73 -0
  16. package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/Scoring/manuallyAndNonScoredScoring.js +1 -1
  17. package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/Scoring/perDropzoneAlternativePointsGreaterThanCorrectPoints.js +3 -2
  18. package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/Scoring/perDropzoneCorrectPointsEqualToAlternativePoints.js +1 -1
  19. package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/Scoring/perDropzoneCorrectPointsGreaterThanAlternativePoints.js +1 -1
  20. package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/Scoring/perDropzoneMinimumAndPenaltyScoring.js +6 -6
  21. package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/additionalSettings.js +169 -0
  22. package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/editTabBasicSection.js +1 -1
  23. package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/styleAndLayoutCustomizationDraggableOptionProperties.js +223 -0
  24. package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/styleAndLayoutCustomizationDraggableOptionsPanel.js +119 -0
  25. package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/styleAndLayoutCustomizationDropzoneBorderStyleProperties.js +113 -0
  26. package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/styleAndLayoutCustomizationDropzoneProperties.js +251 -0
  27. package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/styleAndLayoutCustomizationLayoutProperties.js +277 -0
  28. package/cypress/e2e/ILC/EssayResponse/essayResponseCustomizeFormattingOptions1.smoke.js +0 -2
  29. package/cypress/e2e/ILC/EssayResponse/previewHyperlink.js +1 -5
  30. package/cypress/e2e/ILC/FeedbackScaleNew/editTabBasicSection.js +1 -0
  31. package/cypress/e2e/ILC/FillInTheGapsDropdownNew/editTabBasicSection.js +4 -4
  32. package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/dropdownOptionsSection.js +1 -0
  33. package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/editTabBasicSection.js +14 -1
  34. package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/styleAndLayoutCutomization.js +378 -0
  35. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/Scoring/partialDifferentWeightsAlternativePointsGreaterThanCorrectPoints.js +3 -3
  36. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/specifyCorrectAnswerSection.js +3 -1
  37. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/styleAndLayoutCustomization.js +479 -0
  38. package/cypress/e2e/ILC/GridFill/allOrNothingBasicForAllViews.smoke.js +3 -1
  39. package/cypress/e2e/ILC/GridFill/scoring/partialEqualWeightsCellShadeCountBasics.js +7 -7
  40. package/cypress/e2e/ILC/ListOrderingDropdown/Scoring/allOrNothingPenaltyScoring.js +1 -0
  41. package/cypress/e2e/ILC/ListOrderingDropdown/Scoring/manuallyAndNonScored.js +1 -0
  42. package/cypress/e2e/ILC/ListOrderingDropdown/Scoring/partialEqualWeightsAlternativePointsGreaterThanCorrectPoints.js +2 -2
  43. package/cypress/e2e/ILC/ListOrderingDropdown/Scoring/partialEqualWeightsCorrectPointsGreaterThanAlternativePoints.js +2 -3
  44. package/cypress/e2e/ILC/ListOrderingDropdown/minimumScoringPenaltyPointsAndRoundingDropdown.js +7 -7
  45. package/cypress/e2e/ILC/ListOrderingDropdown/studentViewSettings.js +1 -1
  46. package/cypress/e2e/ILC/ListOrderingNew/HorizontalOrientation/partialDifferentWeightsCorrectPointsGreaterThanAlternativePoints.js +3 -4
  47. package/cypress/e2e/ILC/ListOrderingNew/minimumScoringPenaltyPointsAndRoundingDropdown.js +10 -9
  48. package/cypress/e2e/ILC/Matching/toolSettings.js +1 -0
  49. package/cypress/e2e/ILC/MultipleSelection/additionalSettings.js +1 -0
  50. package/cypress/e2e/ILC/MultipleSelection/allOrNothingBasicForAllViews.smoke.js +36 -16
  51. package/cypress/e2e/ILC/MultipleSelection/allOrNothingWithAlternativeAnswer.js +326 -176
  52. package/cypress/e2e/ILC/MultipleSelection/blockCreateItem.js +2 -2
  53. package/cypress/e2e/ILC/MultipleSelection/manuallyAndNonScoredScoring.js +37 -15
  54. package/cypress/e2e/ILC/MultipleSelection/partialDifferentWeightsBasic.js +38 -17
  55. package/cypress/e2e/ILC/MultipleSelection/partialDifferentWeightsWithAlternativeAnswer.js +441 -186
  56. package/cypress/e2e/ILC/MultipleSelection/partialEqualWeightsBasic.js +33 -14
  57. package/cypress/e2e/ILC/MultipleSelection/partialEqualWeightsWithAlternativeAnswer.js +330 -164
  58. package/cypress/e2e/ILC/MultipleSelectionGridNew/Scoring/manuallyAndNonScored.js +1 -1
  59. package/cypress/e2e/ILC/MultipleSelectionGridNew/Scoring/partialDifferentWeightsAlternativePointsGreaterThanCorrectPoints.js +1 -1
  60. package/cypress/e2e/ILC/ShortTextResponseNew/manuallyAndNonScoredScoring.js +4 -4
  61. package/cypress/e2e/ILC/SingleSelection/allOrNothingBasicForAllViews.smoke.js +20 -7
  62. package/cypress/e2e/ILC/SingleSelection/allOrNothingWithAlternativeAnswer.js +83 -66
  63. package/cypress/e2e/ILC/SingleSelection/blockCreateItem.js +2 -2
  64. package/cypress/e2e/ILC/SingleSelection/manuallyAndNonScoredScoring.js +25 -17
  65. package/cypress/e2e/ILC/SingleSelection/trueOrFalseCreateItem.js +2 -2
  66. package/cypress/e2e/ILC/SingleSelectionGridNew/additionalSettings.js +89 -0
  67. package/cypress/e2e/ILC/SingleSelectionGridNew/editTabBasicSection.js +3 -3
  68. package/cypress/e2e/ILC/TextEntryMath/evaluationMethodEquivalentStructures.js +2 -2
  69. package/cypress/e2e/ILC/TextEntryMath/evaluationMethodValueIsEquivalent.js +2 -2
  70. package/cypress/e2e/ILC/TextEntryMathWithImage/backgroundImageAndCanvasProperties.js +2 -2
  71. package/cypress/e2e/ILC/VideoResponseNew/studentViewSettingsCompactRecorderStyle.js +0 -2
  72. package/cypress/e2e/ILC/chartsDotsPlot/allOrNothingForAllViews.smoke.js +2 -2
  73. package/cypress/e2e/ILC/chartsDotsPlot/scoring/allOrNothingPenaltyScoring.js +1 -1
  74. package/cypress/e2e/ILC/chartsDotsPlot/scoring/partialDifferentWeightsBasic.js +15 -15
  75. package/cypress/e2e/ILC/chartsDotsPlot/scoring/partialDifferentWeightsWithAlternativePointsGreaterThanCorrectPoints.js +21 -21
  76. package/cypress/e2e/ILC/chartsDotsPlot/scoring/partialDifferentWeightsWithCorrectPointsEqualToAlternativePoints.js +17 -17
  77. package/cypress/e2e/ILC/chartsDotsPlot/scoring/partialDifferentWeightsWithCorrectPointsGreaterThanAlternativePoints.js +21 -21
  78. package/cypress/e2e/ILC/chartsDotsPlot/scoring/toleranceThresholdScoring.js +1 -1
  79. package/cypress/e2e/ILC/chartsDotsPlot/selectChartTypeSection.js +8 -4
  80. package/cypress/e2e/ILC/chartsDotsPlot/toolSettings.js +0 -1
  81. package/cypress/fixtures/drawingToolbarOptionsAdditionalOptionsAndSpecialAndMathCharacters.js +2 -2
  82. package/cypress/pages/audioResponsePage.js +1 -1
  83. package/cypress/pages/chartsBarPage.js +785 -5
  84. package/cypress/pages/components/autoScoredScoringSectionMultiResponseType.js +1 -0
  85. package/cypress/pages/components/backgroundImageUploadComponent.js +1 -1
  86. package/cypress/pages/components/barAndLineChartComponent.js +180 -9
  87. package/cypress/pages/components/chartsCommonComponent.js +1 -0
  88. package/cypress/pages/components/connectorStyleStyleAndLayoutCustomizationComponent.js +77 -0
  89. package/cypress/pages/components/essayResponseCommonComponents.js +2 -3
  90. package/cypress/pages/components/figCommonStyleAndLayoutComponent.js +1 -1
  91. package/cypress/pages/components/fillInTheGapsDropdownCommonComponent.js +24 -7
  92. package/cypress/pages/components/fillInTheGapsTextCommonComponent.js +8 -4
  93. package/cypress/pages/components/gridQuestionCommonComponent.js +1 -1
  94. package/cypress/pages/components/imageCanvasComponent.js +112 -2
  95. package/cypress/pages/components/index.js +1 -0
  96. package/cypress/pages/components/layoutSectionComponent.js +4 -3
  97. package/cypress/pages/dragAndDropIntoCategoriesPage.js +960 -3
  98. package/cypress/pages/drawingResponsePage.js +2 -2
  99. package/cypress/pages/fillInTheGapsDragAndDropPage.js +4 -3
  100. package/cypress/pages/fillInTheGapsOverImageDropdownPage.js +18 -3
  101. package/cypress/pages/fillInTheGapsOverImageTextPage.js +65 -3
  102. package/cypress/pages/listOrderingPage.js +3 -3
  103. package/cypress/pages/multipleSelectionPage.js +77 -25
  104. package/cypress/pages/rulerPage.js +5 -0
  105. package/cypress/pages/singleSelectionPage.js +40 -1
  106. package/cypress/pages/videoResponsePage.js +1 -1
  107. package/package.json +1 -1
@@ -0,0 +1,439 @@
1
+ import { chartsBarPage } from "../../../pages";
2
+ import abortEarlySetup from "../../../support/helpers/abortEarly";
3
+ import utilities from "../../../support/helpers/utilities";
4
+ const css = Cypress.env('css');
5
+
6
+ describe('Create item: Charts- Bar : Select chart type', () => {
7
+ before(() => {
8
+ cy.loginAs('admin');
9
+ });
10
+
11
+ describe('Select chart type - Grid and Bar options section : Contents', () => {
12
+ abortEarlySetup();
13
+ before(() => {
14
+ chartsBarPage.steps.navigateToCreateQuestion('charts');
15
+ chartsBarPage.steps.addTextInQuestionInstructionsInputField('Bar chart');
16
+ cy.barsPreLoaderWait();
17
+ });
18
+
19
+ it('Grid label should be displayed', () => {
20
+ utilities.verifyInnerText(chartsBarPage.gridLabel(), 'Grid');
21
+ utilities.verifyElementVisibilityState(chartsBarPage.gridLabel(), 'visible');
22
+ });
23
+
24
+ it('Show gridlines label should be displayed', () => {
25
+ utilities.verifyInnerText(chartsBarPage.showGridLinesLabel(), 'Show gridlines');
26
+ utilities.verifyElementVisibilityState(chartsBarPage.showGridLinesLabel(), 'visible');
27
+ });
28
+
29
+ it('Two show gridlines options \'Vertical\' and \'Horizontal\' label and checkbox should be displayed and by default both checkboxes should be checked', () => {
30
+ utilities.verifyInnerText(chartsBarPage.verticalGridlinesLabel(), 'Vertical');
31
+ utilities.verifyElementVisibilityState(chartsBarPage.verticalGridlinesLabel(), 'visible');
32
+ utilities.verifyInnerText(chartsBarPage.horizontalGridlinesLabel(), 'Horizontal');
33
+ utilities.verifyElementVisibilityState(chartsBarPage.horizontalGridlinesLabel(), 'visible');
34
+ chartsBarPage.steps.verifyHorizontalCheckboxChecked();
35
+ chartsBarPage.steps.verifyVerticalCheckboxChecked();
36
+ });
37
+
38
+ it('Interval label and input field should be displayed by default, input field should have \'1\' pre-filled in it', () => {
39
+ utilities.verifyInnerText(chartsBarPage.intervalLabel(), 'Interval');
40
+ utilities.verifyElementVisibilityState(chartsBarPage.intervalLabel(), 'visible');
41
+ utilities.verifyElementVisibilityState(chartsBarPage.intervalInputField(), 'visible');
42
+ chartsBarPage.steps.verifyTextInIntervalInputField(1);
43
+ });
44
+
45
+ it('Annotate every label and input field should be displayed by default, input field should have \'1\' pre-filled in it', () => {
46
+ utilities.verifyInnerText(chartsBarPage.annotateEveryLabel(), 'Annotate every');
47
+ utilities.verifyElementVisibilityState(chartsBarPage.annotateEveryLabel(), 'visible');
48
+ utilities.verifyElementVisibilityState(chartsBarPage.annotateEveryInputField(), 'visible');
49
+ chartsBarPage.steps.verifyTextInAnnotateEveryInputField(1);
50
+ });
51
+
52
+ it('Grid snapping label and input field should be displayed by default, input field should have \'1\' pre-filled in it', () => {
53
+ utilities.verifyInnerText(chartsBarPage.gridSnappingLabel(), 'Grid snapping');
54
+ utilities.verifyElementVisibilityState(chartsBarPage.gridSnappingLabel(), 'visible');
55
+ utilities.verifyElementVisibilityState(chartsBarPage.gridSnappingInputField(), 'visible');
56
+ chartsBarPage.steps.verifyValueInGridSnappingInputField(1);
57
+ });
58
+
59
+ it('Bar options label should be displayed', () => {
60
+ utilities.verifyInnerText(chartsBarPage.barOptionsLabel(), 'Bar options');
61
+ utilities.verifyElementVisibilityState(chartsBarPage.barOptionsLabel(), 'visible');
62
+ });
63
+
64
+ it('Direction label should be displayed', () => {
65
+ utilities.verifyInnerText(chartsBarPage.directionLabel(), 'Direction');
66
+ utilities.verifyElementVisibilityState(chartsBarPage.directionLabel(), 'visible');
67
+ });
68
+
69
+ it('Two direction options \'Vertical\' and \'Horizontal\' labels and radio buttons should be displayed and by default, \'Vertical\' radio button should be selected', () => {
70
+ utilities.verifyInnerText(chartsBarPage.verticalDirectionLabel(), 'Vertical');
71
+ utilities.verifyElementVisibilityState(chartsBarPage.verticalDirectionLabel(), 'visible');
72
+ utilities.verifyInnerText(chartsBarPage.horizontalDirectionLabel(), 'Horizontal');
73
+ utilities.verifyElementVisibilityState(chartsBarPage.horizontalDirectionLabel(), 'visible');
74
+ chartsBarPage.steps.verifyVerticalDirectionRadioButtonSelected();
75
+ });
76
+
77
+ it('Bar spacing label should be displayed', () => {
78
+ utilities.verifyInnerText(chartsBarPage.barSpacingLabel(), 'Bar spacing');
79
+ utilities.verifyElementVisibilityState(chartsBarPage.barSpacingLabel(), 'visible');
80
+ });
81
+
82
+ it('Add gap between bars label and checkbox should be displayed and by default, checkbox should be checked', () => {
83
+ utilities.verifyInnerText(chartsBarPage.addGapBetweenBarsLabel(), 'Add gap between bars');
84
+ utilities.verifyElementVisibilityState(chartsBarPage.addGapBetweenBarsLabel(), 'visible');
85
+ chartsBarPage.steps.verifyAddGapBetweenBarsCheckboxChecked();
86
+ });
87
+
88
+ it('Max bar count label and input field should be displayed and input field should have \'1\' pre-filled in it and it should be in disabled state', () => {
89
+ utilities.verifyInnerText(chartsBarPage.maxBarCountLabel(), 'Max bar count');
90
+ utilities.verifyElementVisibilityState(chartsBarPage.maxBarCountLabel(), 'visible');
91
+ chartsBarPage.steps.verifyMaxBarCountValue(1);
92
+ utilities.verifyElementDisabled(chartsBarPage.selectChartTypeMaxBarCountInputField());
93
+ });
94
+
95
+ it('CSS of grid section', { tags: 'css' }, () => {
96
+ utilities.verifyCSS(chartsBarPage.gridLabel(), {
97
+ 'color': css.color.labels,
98
+ 'font-size': css.fontSize.default,
99
+ 'font-weight': css.fontWeight.semibold
100
+ });
101
+ utilities.verifyCSS(chartsBarPage.showGridLinesLabel(), {
102
+ 'color': css.color.labels,
103
+ 'font-size': css.fontSize.normal,
104
+ 'font-weight': css.fontWeight.semibold
105
+ });
106
+ utilities.verifyCSS(chartsBarPage.verticalGridlinesLabel(), {
107
+ 'color': css.color.labels,
108
+ 'font-size': css.fontSize.normal,
109
+ 'font-weight': css.fontWeight.regular
110
+ });
111
+ utilities.verifyCSS(chartsBarPage.verticalGridlinesCheckbox().parents('span').find('.checkbox-icon-border-rect'), {
112
+ 'fill': css.color.activeButtons
113
+ });
114
+ utilities.verifyCSS(chartsBarPage.horizontalGridlinesCheckbox().parents('span').find('.checkbox-icon-border-rect'), {
115
+ 'fill': css.color.activeButtons
116
+ });
117
+ utilities.verifyCSS(chartsBarPage.horizontalGridlinesLabel(), {
118
+ 'color': css.color.labels,
119
+ 'font-size': css.fontSize.normal,
120
+ 'font-weight': css.fontWeight.regular
121
+ });
122
+ utilities.verifyCSS(chartsBarPage.intervalInputField(), {
123
+ 'color': css.color.text,
124
+ 'font-size': css.fontSize.default,
125
+ 'font-weight': css.fontWeight.regular
126
+ });
127
+ utilities.verifyCSS(chartsBarPage.intervalLabel(), {
128
+ 'color': css.color.labels,
129
+ 'font-size': css.fontSize.normal,
130
+ 'font-weight': css.fontWeight.semibold
131
+ });
132
+ utilities.verifyCSS(chartsBarPage.annotateEveryInputField(), {
133
+ 'color': css.color.text,
134
+ 'font-size': css.fontSize.default,
135
+ 'font-weight': css.fontWeight.regular
136
+ });
137
+ utilities.verifyCSS(chartsBarPage.annotateEveryLabel(), {
138
+ 'color': css.color.labels,
139
+ 'font-size': css.fontSize.normal,
140
+ 'font-weight': css.fontWeight.semibold
141
+ });
142
+ utilities.verifyCSS(chartsBarPage.gridSnappingInputField(), {
143
+ 'color': css.color.text,
144
+ 'font-size': css.fontSize.default,
145
+ 'font-weight': css.fontWeight.regular
146
+ });
147
+ utilities.verifyCSS(chartsBarPage.gridSnappingLabel(), {
148
+ 'color': css.color.labels,
149
+ 'font-size': css.fontSize.normal,
150
+ 'font-weight': css.fontWeight.semibold
151
+ });
152
+ utilities.verifyCSS(chartsBarPage.barOptionsLabel(), {
153
+ 'color': css.color.labels,
154
+ 'font-size': css.fontSize.default,
155
+ 'font-weight': css.fontWeight.semibold
156
+ });
157
+ utilities.verifyCSS(chartsBarPage.directionLabel(), {
158
+ 'color': css.color.labels,
159
+ 'font-size': css.fontSize.normal,
160
+ 'font-weight': css.fontWeight.semibold
161
+ });
162
+ utilities.verifyCSS(chartsBarPage.barSpacingLabel(), {
163
+ 'color': css.color.labels,
164
+ 'font-size': css.fontSize.normal,
165
+ 'font-weight': css.fontWeight.semibold
166
+ });
167
+ utilities.verifyCSS(chartsBarPage.verticalDirectionLabel(), {
168
+ 'color': css.color.labels,
169
+ 'font-size': css.fontSize.normal,
170
+ 'font-weight': css.fontWeight.regular
171
+ });
172
+ utilities.verifyCSS(chartsBarPage.horizontalDirectionLabel(), {
173
+ 'color': css.color.labels,
174
+ 'font-size': css.fontSize.normal,
175
+ 'font-weight': css.fontWeight.regular
176
+ });
177
+ utilities.verifyCSS(chartsBarPage.verticalDirectionRadioButton().parents('span').find('[data-name="Radio button - Selected"]'), {
178
+ 'fill': css.color.activeButtons
179
+ });
180
+ utilities.verifyCSS(chartsBarPage.horizontalDirectionRadioButton().parents('span').find('.radio-btn-deselected'), {
181
+ 'fill': css.color.uncheckedCheckbox
182
+ });
183
+ utilities.verifyCSS(chartsBarPage.addGapBetweenBarsLabel(), {
184
+ 'color': css.color.labels,
185
+ 'font-size': css.fontSize.normal,
186
+ 'font-weight': css.fontWeight.regular
187
+ });
188
+ utilities.verifyCSS(chartsBarPage.addGapBetweenBarsCheckbox().parents('span').find('.checkbox-icon-border-rect'), {
189
+ 'fill': css.color.activeButtons
190
+ });
191
+ utilities.verifyCSS(chartsBarPage.maxBarCountLabel(), {
192
+ 'color': css.color.labels,
193
+ 'font-size': css.fontSize.normal,
194
+ 'font-weight': css.fontWeight.semibold
195
+ });
196
+ });
197
+
198
+ it('Accessibility of grid section', { tags: 'a11y' }, () => {
199
+ cy.checkAccessibility(chartsBarPage.gridLabel().parents('.ngie-charts-authoring'));
200
+ });
201
+ });
202
+
203
+ describe('Select chart type - Grid section : Edit tab functionality', () => {
204
+ abortEarlySetup();
205
+ before(() => {
206
+ chartsBarPage.steps.navigateToCreateQuestion('charts');
207
+ chartsBarPage.steps.addTextInQuestionInstructionsInputField('Bar chart');
208
+ cy.barsPreLoaderWait();
209
+ });
210
+
211
+ it('When both Vertical and Horizontal checkboxes are checked then vertical and horizontal gridlines should be displayed in select chart type and specify correct answer section', () => {
212
+ chartsBarPage.steps.verifyHorizontalCheckboxChecked();
213
+ chartsBarPage.steps.verifyVerticalCheckboxChecked();
214
+ chartsBarPage.steps.verifyVerticalGridlinesVisibleSelectChartType();
215
+ chartsBarPage.steps.verifyHorizontalGridlinesVisibleSelectChartType();
216
+ chartsBarPage.steps.verifyVerticalGridlinesVisibleSpecifyCorrectAnswer();
217
+ chartsBarPage.steps.verifyHorizontalGridlinesVisibleSpecifyCorrectAnswer();
218
+ });
219
+
220
+ it('When user unchecks Vertical checkbox then vertical gridlines should not be displayed and horizontal gridlines should be displayed in select chart type and specify correct answer section', () => {
221
+ chartsBarPage.steps.uncheckVerticalCheckbox();
222
+ chartsBarPage.steps.verifyVerticalGridlinesNotVisibleSelectChartType();
223
+ chartsBarPage.steps.verifyHorizontalGridlinesVisibleSelectChartType();
224
+ chartsBarPage.steps.verifyVerticalGridlinesNotVisibleSpecifyCorrectAnswer();
225
+ chartsBarPage.steps.verifyHorizontalGridlinesVisibleSpecifyCorrectAnswer();
226
+ });
227
+
228
+ it('When user unchecks Horizontal checkbox then horizontal gridlines should not be displayed in select chart type and specify correct answer section', () => {
229
+ chartsBarPage.steps.uncheckHorizontalCheckbox();
230
+ chartsBarPage.steps.verifyVerticalGridlinesNotVisibleSelectChartType();
231
+ chartsBarPage.steps.verifyHorizontalGridlinesNotVisibleSelectChartType();
232
+ chartsBarPage.steps.verifyVerticalGridlinesNotVisibleSpecifyCorrectAnswer();
233
+ chartsBarPage.steps.verifyHorizontalGridlinesNotVisibleSpecifyCorrectAnswer();
234
+ });
235
+
236
+ //Note- Can't check ticks are not annotated so adding it to manual sheet
237
+ it('When user updates value in Interval input field then interval of labels and ticks should be updated in select chart type and specify correct answer section', () => {
238
+ chartsBarPage.steps.enterTextInIntervalInputField(0.25);
239
+ chartsBarPage.steps.verifyTextInIntervalInputField(0.25);
240
+ chartsBarPage.steps.verifyLabelsInSelectChartType(10, 0.25);
241
+ chartsBarPage.steps.verifyLabelsInSpecifyCorrectAnswer(10, 0.25);
242
+ });
243
+
244
+ //Note- Can't check ticks are not annotated so adding it to manual sheet
245
+ it('When user updates value in Annotate every input field then labels should be annotated appropriately and ticks should not get annotated for the number line in the select chart type and the specify correct answer section.', () => {
246
+ cy.log('Changing interval input fields value to its default value');
247
+ chartsBarPage.steps.enterTextInIntervalInputField(1);
248
+ chartsBarPage.steps.enterTextInAnnotateEveryInputField(2);
249
+ chartsBarPage.steps.verifyTextInAnnotateEveryInputField(2);
250
+ chartsBarPage.steps.verifyAnnotatedLabelsSelectChartType(10, 2);
251
+ chartsBarPage.steps.verifyAnnotatedLabelsSpecifyCorrectAnswer(10, 2);
252
+ });
253
+
254
+ it('When user updates value in Grid snapping input field and sets bar on charts then the bar\'s placement should align with the specified grid snapping value in select chart type and the specify correct answer section', () => {
255
+ chartsBarPage.steps.enterValueInGridSnappingInputField(2);
256
+ chartsBarPage.steps.verifyValueInGridSnappingInputField(2);
257
+ chartsBarPage.steps.keyBoardUpBarInSelectChartType(0);
258
+ chartsBarPage.steps.verifyBarHeightInSelectChartType({ barIndex: 0, barValue: 2, range: 10 });
259
+ chartsBarPage.steps.keyBoardUpBarInSpecifyCorrectAnswer(0);
260
+ chartsBarPage.steps.verifyBarHeightInSpecifyCorrectAnswer({ barIndex: 0, barValue: 2, range: 10 });
261
+ });
262
+ });
263
+
264
+ describe('Select chart type - Grid section : Preview tab functionality', () => {
265
+ abortEarlySetup();
266
+ before(() => {
267
+ chartsBarPage.steps.navigateToCreateQuestion('charts');
268
+ chartsBarPage.steps.addTextInQuestionInstructionsInputField('Bar chart');
269
+ cy.barsPreLoaderWait();
270
+ });
271
+
272
+ it('When both Vertical and Horizontal checkboxes are checked then vertical and horizontal gridlines should be displayed in preview tab', () => {
273
+ chartsBarPage.steps.verifyHorizontalCheckboxChecked();
274
+ chartsBarPage.steps.verifyVerticalCheckboxChecked();
275
+ chartsBarPage.steps.switchToPreviewTab();
276
+ chartsBarPage.steps.verifyVerticalGridlinesVisiblePreviewTab();
277
+ chartsBarPage.steps.verifyHorizontalGridlinesVisiblePreviewTab();
278
+ });
279
+
280
+ it('When user unchecks Vertical checkbox then vertical gridlines should not be displayed in preview tab', () => {
281
+ chartsBarPage.steps.switchToEditTab();
282
+ chartsBarPage.steps.uncheckVerticalCheckbox();
283
+ chartsBarPage.steps.switchToPreviewTab();
284
+ chartsBarPage.steps.verifyVerticalGridlinesNotVisiblePreviewTab();
285
+ chartsBarPage.steps.verifyHorizontalGridlinesVisiblePreviewTab();
286
+ });
287
+
288
+ it('When user unchecks Horizontal checkbox then horizontal gridlines should not be displayed in preview tab', () => {
289
+ chartsBarPage.steps.switchToEditTab();
290
+ chartsBarPage.steps.uncheckHorizontalCheckbox();
291
+ chartsBarPage.steps.switchToPreviewTab();
292
+ chartsBarPage.steps.verifyVerticalGridlinesNotVisiblePreviewTab();
293
+ chartsBarPage.steps.verifyHorizontalGridlinesNotVisiblePreviewTab();
294
+ });
295
+
296
+ //Note- Can't check ticks are not annotated so adding it to manual sheet
297
+ it('When user updates value in Interval input field then interval of labels and ticks should be updated in preview tab', () => {
298
+ chartsBarPage.steps.switchToEditTab();
299
+ chartsBarPage.steps.enterTextInIntervalInputField(0.25);
300
+ chartsBarPage.steps.verifyTextInIntervalInputField(0.25);
301
+ chartsBarPage.steps.switchToPreviewTab();
302
+ chartsBarPage.steps.verifyLabelsInPreviewTab(10, 0.25);
303
+ });
304
+
305
+ //Note- Can't check ticks are not annotated so adding it to manual sheet
306
+ it('When user updates value in Annotate every input field then labels should be annotated appropriately and ticks should not get annotated for the number line in the preview tab', () => {
307
+ chartsBarPage.steps.switchToEditTab();
308
+ cy.log('Changing interval input fields value to its default value');
309
+ chartsBarPage.steps.enterTextInIntervalInputField(1);
310
+ chartsBarPage.steps.enterTextInAnnotateEveryInputField(2);
311
+ chartsBarPage.steps.verifyTextInAnnotateEveryInputField(2);
312
+ chartsBarPage.steps.switchToPreviewTab();
313
+ chartsBarPage.steps.verifyAnnotatedLabelsPreviewTab(10, 2);
314
+ });
315
+
316
+ it('When user updates value in Grid snapping input field and sets bar on charts then the bar\'s placement should align with the specified grid snapping value in preview tab', () => {
317
+ chartsBarPage.steps.switchToEditTab();
318
+ chartsBarPage.steps.enterValueInGridSnappingInputField(2);
319
+ chartsBarPage.steps.verifyValueInGridSnappingInputField(2);
320
+ chartsBarPage.steps.switchToPreviewTab();
321
+ chartsBarPage.steps.keyBoardUpBarInPreviewTab(0);
322
+ chartsBarPage.steps.verifyBarHeightInPreviewTab({ barIndex: 0, barValue: 2, range: 10 });
323
+ });
324
+ });
325
+
326
+ describe('Select chart type - Bar options : Edit tab functionality', () => {
327
+ abortEarlySetup();
328
+ before(() => {
329
+ chartsBarPage.steps.navigateToCreateQuestion('charts');
330
+ chartsBarPage.steps.addTextInQuestionInstructionsInputField('Bar chart');
331
+ cy.barsPreLoaderWait();
332
+ chartsBarPage.steps.setBarValueInSelectChartTypeSection({ barIndex: 0, value: 2, range: 10 });
333
+ chartsBarPage.steps.setBarValueInSpecifyCorrectAnswerSection({ barIndex: 0, value: 2, range: 10 });
334
+ });
335
+
336
+ it('When Vertical direction radio button is selected then vertical chart should be displayed in select chart type and specify correct answer section', () => {
337
+ chartsBarPage.steps.verifyVerticalDirectionRadioButtonSelected();
338
+ chartsBarPage.steps.verifyChartOrientationSelectChartType('Vertical');
339
+ chartsBarPage.steps.verifyChartOrientationSpecifyCorrectAnswer('Vertical');
340
+ });
341
+
342
+ it('When user selects Horizontal direction radio button, then horizontal chart should be displayed in select chart type and specify correct answer section', () => {
343
+ chartsBarPage.steps.selectHorizontalDirectionRadioButton();
344
+ chartsBarPage.steps.verifyChartOrientationSelectChartType('Horizontal');
345
+ chartsBarPage.steps.verifyChartOrientationSpecifyCorrectAnswer('Horizontal');
346
+ });
347
+
348
+ it('When Horizontal direction radio button is selected then Graph title, X axis label and Y axis label should not be affected in select chart type and specify correct answer section', () => {
349
+ utilities.verifyInnerText(chartsBarPage.selectChartTypeGraphTitleButton(), 'Bar chart');
350
+ utilities.verifyInnerText(chartsBarPage.selectChartTypeXAxisLabelButton(), 'Days');
351
+ utilities.verifyInnerText(chartsBarPage.selectChartTypeYAxisLabelButton(), 'Profit');
352
+ utilities.verifyInnerText(chartsBarPage.specifyCorrectAnswerGraphTitleButton(), 'Bar chart');
353
+ utilities.verifyInnerText(chartsBarPage.xAxisLabelSpecifyCorrectAnswer(), 'Days');
354
+ utilities.verifyInnerText(chartsBarPage.yAxisLabelSpecifyCorrectAnswer(), 'Profit');
355
+ });
356
+
357
+ it('When Horizontal direction radio button is selected then Max Y label should change to Max X label and value in the input field should remain the same in select chart type and specify correct answer section', () => {
358
+ utilities.verifyInnerText(chartsBarPage.selectChartTypeMaxXAndYLabel(), 'Max X');
359
+ utilities.verifyElementVisibilityState(chartsBarPage.selectChartTypeMaxXAndYLabel(), 'visible');
360
+ chartsBarPage.steps.verifyMaxXAndYValue(10);
361
+ chartsBarPage.steps.verifyBarLabelHorizontalSelectChartType([0, 'Bar 1'], [1, 'Bar 2'], [2, 'Bar 3']);
362
+ chartsBarPage.steps.verifyBarLabelHorizontalSpecifyCorrectAnswer([0, 'Bar 1'], [1, 'Bar 2'], [2, 'Bar 3']);
363
+ chartsBarPage.steps.verifyLabelsInHorizontalSelectChartType(0, 1);
364
+ chartsBarPage.steps.verifyLabelsInHorizontalSpecifyCorrectAnswer(0, 1);
365
+ });
366
+
367
+ it('When user selects Vertical direction again then Vertical chart should be displayed in select chart type and specify correct answer section', () => {
368
+ chartsBarPage.steps.selectVerticalDirectionRadioButton();
369
+ chartsBarPage.steps.verifyChartOrientationPreviewTab('Vertical');
370
+ });
371
+
372
+ it('When Add gap between bars checkbox is checked then space should be present between the bars in select chart type and specify correct answer section', () => {
373
+ chartsBarPage.steps.verifyAddGapBetweenBarsCheckboxChecked();
374
+ chartsBarPage.steps.verifySpaceBetweenBarsSelectChartType();
375
+ chartsBarPage.steps.verifySpaceBetweenBarsSpecifyCorrectAnswer();
376
+ });
377
+
378
+ it('When user unchecks Add gap between bars checkbox then space should not be present between the bars in select chart type and specify correct answer section', () => {
379
+ chartsBarPage.steps.uncheckAddGapBetweenBarsCheckboxCheckbox();
380
+ chartsBarPage.steps.verifyNoSpaceBetweenBarsSelectChartType();
381
+ chartsBarPage.steps.verifyNoSpaceBetweenBarsSpecifyCorrectAnswer();
382
+ });
383
+ });
384
+
385
+ describe('Select chart type - Bar options : Preview tab functionality', () => {
386
+ abortEarlySetup();
387
+ before(() => {
388
+ chartsBarPage.steps.navigateToCreateQuestion('charts');
389
+ chartsBarPage.steps.addTextInQuestionInstructionsInputField('Bar chart');
390
+ cy.barsPreLoaderWait();
391
+ chartsBarPage.steps.setGraphTitle('Bar chart');
392
+ chartsBarPage.steps.setXAxisLabel('Days');
393
+ chartsBarPage.steps.setYAxisLabel('Profit');
394
+ chartsBarPage.steps.setBarValueInSelectChartTypeSection({ barIndex: 0, value: 2, range: 10 });
395
+ });
396
+
397
+ it('When Vertical direction radio button is selected then vertical chart should be displayed in preview tab', () => {
398
+ chartsBarPage.steps.verifyVerticalDirectionRadioButtonSelected();
399
+ chartsBarPage.steps.switchToPreviewTab();
400
+ chartsBarPage.steps.verifyChartOrientationPreviewTab('Vertical');
401
+ });
402
+
403
+ it('When user selects Horizontal direction radio button, then horizontal chart should be displayed in preview tab', () => {
404
+ chartsBarPage.steps.switchToEditTab();
405
+ chartsBarPage.steps.selectHorizontalDirectionRadioButton();
406
+ chartsBarPage.steps.switchToPreviewTab();
407
+ chartsBarPage.steps.verifyChartOrientationPreviewTab('Horizontal');
408
+ });
409
+
410
+ it('When Horizontal direction radio button is selected then Graph title, X axis label and Y axis label should not be affected and X axis and Y axis labels should interchange', () => {
411
+ utilities.verifyInnerText(chartsBarPage.previewTabGraphTitle(), 'Bar chart');
412
+ utilities.verifyInnerText(chartsBarPage.previewTabXAxisLabelButton(), 'Days');
413
+ utilities.verifyInnerText(chartsBarPage.previewTabYAxisLabelButton(), 'Profit');
414
+ chartsBarPage.steps.verifyBarLabelHorizontalPreviewTab([0, 'Bar 1'], [1, 'Bar 2'], [2, 'Bar 3']);
415
+ chartsBarPage.steps.verifyLabelsInHorizontalPreviewTab(0, 1);
416
+ });
417
+
418
+ it('When user selects Vertical direction again then Vertical chart should be displayed in preview tab', () => {
419
+ chartsBarPage.steps.switchToEditTab();
420
+ chartsBarPage.steps.selectVerticalDirectionRadioButton();
421
+ chartsBarPage.steps.switchToPreviewTab();
422
+ chartsBarPage.steps.verifyChartOrientationPreviewTab('Vertical');
423
+ });
424
+
425
+ it('When Add gap between bars checkbox is checked then space should be present between the bars in preview tab', () => {
426
+ chartsBarPage.steps.switchToEditTab();
427
+ chartsBarPage.steps.verifyAddGapBetweenBarsCheckboxChecked();
428
+ chartsBarPage.steps.switchToPreviewTab();
429
+ chartsBarPage.steps.verifySpaceBetweenBarsPreviewTab();
430
+ });
431
+
432
+ it('When user unchecks Add gap between bars checkbox then space should not be present between the bars in preview tab', () => {
433
+ chartsBarPage.steps.switchToEditTab();
434
+ chartsBarPage.steps.uncheckAddGapBetweenBarsCheckboxCheckbox();
435
+ chartsBarPage.steps.switchToPreviewTab();
436
+ chartsBarPage.steps.verifyNoSpaceBetweenBarsPreviewTab();
437
+ });
438
+ });
439
+ });
@@ -0,0 +1,105 @@
1
+ import abortEarlySetup from "../../../support/helpers/abortEarly";
2
+ import { chartsBarPage } from "../../../pages";
3
+ import utilities from "../../../support/helpers/utilities";
4
+ const css = Cypress.env('css');
5
+
6
+ describe('Create item page - Charts - Bar: Header section and saving question', () => {
7
+ before(() => {
8
+ cy.loginAs('admin');
9
+ });
10
+
11
+ describe('Header section contents', () => {
12
+ abortEarlySetup();
13
+ before(() => {
14
+ chartsBarPage.steps.navigateToCreateQuestion('charts');
15
+ cy.barsPreLoaderWait();
16
+ });
17
+
18
+ chartsBarPage.tests.verifyCreateQuestionPageQuestionTypeHeader('Charts');
19
+ });
20
+
21
+ describe('Tabs section', () => {
22
+ abortEarlySetup();
23
+ before(() => {
24
+ chartsBarPage.steps.navigateToCreateQuestion('charts');
25
+ cy.barsPreLoaderWait();
26
+ });
27
+
28
+ chartsBarPage.tests.verifyTabsSection();
29
+ });
30
+
31
+ describe('Cancel button', () => {
32
+ abortEarlySetup();
33
+ before(() => {
34
+ chartsBarPage.steps.navigateToCreateQuestion('charts');
35
+ cy.barsPreLoaderWait();
36
+ });
37
+
38
+ it('When user has made some edits/changes and clicks on cancel button, a popup should be displayed with message \'Are you sure you want to leave this page? Your changes have not been saved.\'', () => {
39
+ chartsBarPage.steps.addTextInQuestionInstructionsInputField('Edited');
40
+ chartsBarPage.steps.allotPoints(20);
41
+ chartsBarPage.steps.clickOnCancelButton();
42
+ utilities.verifyElementVisibilityState(chartsBarPage.dialogBox(), 'visible');
43
+ utilities.verifyInnerText(chartsBarPage.dialogBoxContentText(), 'Are you sure you want to leave this page? Your changes have not been saved.');
44
+ utilities.verifyInnerText(chartsBarPage.buttonAccept(), 'Yes, I want to leave this page');
45
+ utilities.verifyInnerText(chartsBarPage.buttonReject(), 'No, I\'d like to go back');
46
+ });
47
+
48
+ it('CSS of popup', { tags: 'css' }, () => {
49
+ utilities.verifyCSS(chartsBarPage.dialogBox(), {
50
+ 'background-color': css.color.defaultBackground
51
+ })
52
+
53
+ utilities.verifyCSS(chartsBarPage.dialogBoxContent(), {
54
+ 'color': css.color.sectionHeading,
55
+ 'font-size': css.fontSize.default,
56
+ 'font-weight': css.fontWeight.regular
57
+ });
58
+ utilities.verifyCSS(chartsBarPage.buttonAccept(), {
59
+ 'color': css.color.primaryBtn,
60
+ 'font-size': css.fontSize.default,
61
+ 'font-weight': css.fontWeight.semibold,
62
+ 'background-color': css.color.primaryBtnBg
63
+ });
64
+ utilities.verifyCSS(chartsBarPage.buttonReject(), {
65
+ 'color': css.color.secondaryBtn,
66
+ 'font-size': css.fontSize.default,
67
+ 'font-weight': css.fontWeight.semibold,
68
+ 'background-color': css.color.transparent
69
+ });
70
+ });
71
+
72
+ it('Accessibility of popup', { tags: 'a11y' }, () => {
73
+ cy.checkAccessibility(chartsBarPage.dialogBox());
74
+ });
75
+
76
+ it(`Clicking on \'No, I'd like to go back\' button should close the popup and user should remain on the edit interface of the question`, () => {
77
+ chartsBarPage.steps.clickOnRejectButtonInDialogBox();
78
+ chartsBarPage.steps.verifyEditTabSelectedState();
79
+ utilities.verifyTextContent(chartsBarPage.questionInstructionsInputField(), 'Edited');
80
+ });
81
+
82
+ it(`Clicking on \'Yes, I want to leave this page\' button should should discard all changes and direct the user to the \'Select a question\' page.`, () => {
83
+ chartsBarPage.steps.clickOnCancelButton();
84
+ chartsBarPage.steps.clickOnAcceptButtonInDialogBox();
85
+ utilities.verifyElementVisibilityState(chartsBarPage.selectAQuestionHeaderText(), 'visible');
86
+ utilities.verifyElementVisibilityState(chartsBarPage.questionTypeOptionTitle(), 'visible');
87
+ });
88
+ });
89
+
90
+ describe('Save Question button', () => {
91
+ abortEarlySetup();
92
+ before(() => {
93
+ chartsBarPage.steps.navigateToCreateQuestion('charts');
94
+ cy.barsPreLoaderWait();
95
+ });
96
+
97
+ chartsBarPage.tests.verifyCreateItemWrapperContentsA11y();
98
+
99
+ it('When user clicks on "Save question" button, then the question should get saved and a snackbar with text \'Saved successfully!\' should be displayed', () => {
100
+ chartsBarPage.steps.saveAQuestionAndVerifySnackbar();
101
+ });
102
+
103
+ chartsBarPage.tests.verifySavedSuccessfullySnackbarCSSAndA11y();
104
+ });
105
+ });