itemengine-cypress-automation 1.0.174-uploadResponseMigrationScript-45ca862.0 → 1.0.175-15thAprilRepoUpdate-cb0f7d0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (96) hide show
  1. package/cypress/e2e/ILC/DrawingResponse/drawingResponseCustomizeAdditionalOptions.js +0 -18
  2. package/cypress/e2e/ILC/DrawingResponse/drawingResponseEditTabBasicSection.js +1 -1
  3. package/cypress/e2e/ILC/EssayResponse/createCustomCategory.smoke.js +10 -7
  4. package/cypress/e2e/ILC/FeedbackScaleNew/additionalSettings.js +111 -0
  5. package/cypress/e2e/ILC/FeedbackScaleNew/colorPopup.js +206 -0
  6. package/cypress/e2e/ILC/FeedbackScaleNew/editTabBasicSection.js +262 -0
  7. package/cypress/e2e/ILC/FeedbackScaleNew/headerSection.js +51 -0
  8. package/cypress/e2e/ILC/FeedbackScaleNew/numbersFeedbackScaleStyle.js +17 -17
  9. package/cypress/e2e/ILC/FeedbackScaleNew/thumbsFeedbackScaleStyle.js +1 -1
  10. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/additionalSettings.js +2 -2
  11. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/clickAndDrop.js +3 -3
  12. package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/conditionalCheckboxScoring.js +1 -0
  13. package/cypress/e2e/ILC/Graphing/addBackgroundShapesSection.js +6 -7
  14. package/cypress/e2e/ILC/Graphing/additionalSettingsBasic.js +3 -3
  15. package/cypress/e2e/ILC/Graphing/allOrNothingForAllViews.smoke.js +0 -1
  16. package/cypress/e2e/ILC/Graphing/checkAnswerFunctionalityForAllViews.smoke.js +0 -1
  17. package/cypress/e2e/ILC/Graphing/toolsControlsAndBackgroundSection.js +0 -1
  18. package/cypress/e2e/ILC/GridFill/checkAnswerFunctionalityForAllViews.smoke.js +2 -0
  19. package/cypress/e2e/ILC/GridFill/gridLayoutContents.js +3 -4
  20. package/cypress/e2e/ILC/GridFill/gridLayoutEditTabFunctionality.js +2 -2
  21. package/cypress/e2e/ILC/GridFill/previewContentsForAllViews.smoke.js +12 -12
  22. package/cypress/e2e/ILC/NumberLine/Scoring/allOrNothingWithAlternatePointsGreaterThanCorrectPoints.js +91 -90
  23. package/cypress/e2e/ILC/NumberLine/Scoring/allOrNothingWithCorrectPointsEqualToAlternatePoints.js +93 -92
  24. package/cypress/e2e/ILC/NumberLine/Scoring/allOrNothingWithCorrectPointsGreaterThanAlternativePoints.js +97 -95
  25. package/cypress/e2e/ILC/NumberLine/Scoring/manualAndNonScoredScoring.js +62 -62
  26. package/cypress/e2e/ILC/NumberLine/Scoring/partialEqualWeightsBasic.js +118 -117
  27. package/cypress/e2e/ILC/NumberLine/Scoring/partialEqualWeightsWithAlternatePointsGreaterThanCorrectPoints.js +124 -120
  28. package/cypress/e2e/ILC/NumberLine/Scoring/partialEqualWeightsWithCorrectPointsGreaterThanAlternatePoints.js +128 -125
  29. package/cypress/e2e/ILC/NumberLine/Scoring/partialEqualWeigtsWithCorrectPointsEqualToAlternatePoints.js +97 -96
  30. package/cypress/e2e/ILC/NumberLine/allOrNothingScoringForAllViews.smoke.js +222 -196
  31. package/cypress/e2e/ILC/NumberLine/checkAnswerFunctionalityForAllViews.smoke.js +34 -34
  32. package/cypress/e2e/ILC/NumberLine/editTabScoringSection.js +20 -20
  33. package/cypress/e2e/ILC/NumberLine/gradingViewAndCorrectAnswerView.smoke.js +29 -29
  34. package/cypress/e2e/ILC/NumberLine/headerSection.js +3 -2
  35. package/cypress/e2e/ILC/NumberLine/previewTabContentsForAllViews.smoke.js +40 -37
  36. package/cypress/e2e/ILC/NumberLine/specifyCorrectAnswerSection.js +7 -4
  37. package/cypress/e2e/ILC/NumberLine/studentViewSettings.js +14 -12
  38. package/cypress/e2e/ILC/NumberLine/toolsAndControls.js +24 -23
  39. package/cypress/e2e/ILC/ShortTextResponseNew/studentViewSettings.js +2 -2
  40. package/cypress/e2e/ILC/SimpleCalculator/previewContents.smoke.js +1 -1
  41. package/cypress/e2e/ILC/TextEntryMath/evaluationMethodEquivalentStructures.js +2 -0
  42. package/cypress/e2e/ILC/TextEntryMath/evaluationMethodMatchExact.js +1 -0
  43. package/cypress/e2e/ILC/TextEntryMath/evaluationMethodMatchValue.js +1 -0
  44. package/cypress/e2e/ILC/TextEntryMath/evaluationMethodSymbolsAreEquivalent.js +1 -0
  45. package/cypress/e2e/ILC/TextEntryMath/evaluationMethodValueIsEquivalent.js +1 -0
  46. package/cypress/e2e/ILC/TextEntryMath/evaluationMethodsWithoutSetResponse.js +4 -0
  47. package/cypress/e2e/ILC/TextEntryMath/responseEvaluationMethodsAndCustomSettings.js +8 -15
  48. package/cypress/e2e/ILC/TextEntryMath/specifyCorrectAnswerSection.js +1 -0
  49. package/cypress/e2e/ILC/TextEntryMathWithImage/allOrNothingScoringForAllViews.smoke.js +1 -0
  50. package/cypress/e2e/ILC/TextEntryMathWithImage/backgroundImageAndCanvasProperties.js +1 -1
  51. package/cypress/e2e/ILC/TextSelection/Scoring/basicScoringForAllTextSelectionTypes.smoke.js +332 -0
  52. package/cypress/e2e/ILC/TextSelection/Scoring/manuallyAndNonScored.js +149 -0
  53. package/cypress/e2e/ILC/TextSelection/Scoring/partialDifferentWeightsBasic.js +0 -1
  54. package/cypress/e2e/ILC/TextSelection/Scoring/partialEqualWeightsBasic.js +0 -1
  55. package/cypress/e2e/ILC/TextSelection/allOrNothingScoringForAllViews.smoke.js +11 -11
  56. package/cypress/e2e/ILC/TextSelection/checkAnswerFunctionalityForAllViews.smoke.js +3 -3
  57. package/cypress/e2e/ILC/TextSelection/editTabScoringSection.js +337 -0
  58. package/cypress/e2e/ILC/TextSelection/minimumScoringPenaltyPointsAndRoundingDropdown.js +206 -0
  59. package/cypress/e2e/ILC/TextSelection/{previewContentsForAllViews.js → previewContentsForAllViews.smoke.js} +3 -3
  60. package/cypress/e2e/ILC/UploadResponse/uplodResponsePreviewUploadedFileProperties.js +87 -87
  61. package/cypress/fixtures/equationEditorCategoriesAndSymbols .js +5 -5
  62. package/cypress/pages/audioResponsePage.js +1 -0
  63. package/cypress/pages/components/autoScoredScoringSectionMultiResponseType.js +2 -1
  64. package/cypress/pages/components/autoScoredStudentViewSettings.js +1 -1
  65. package/cypress/pages/components/backgroundImageUploadComponent.js +1 -4
  66. package/cypress/pages/components/colorPopupComponent.js +11 -0
  67. package/cypress/pages/components/createCustomCategoryFlyout.js +13 -9
  68. package/cypress/pages/components/draggableOptionContainer.js +1 -0
  69. package/cypress/pages/components/equationEditorFlyout.js +0 -1
  70. package/cypress/pages/components/essayResponseCommonComponents.js +1 -1
  71. package/cypress/pages/components/imageCanvasComponent.js +1 -1
  72. package/cypress/pages/components/index.js +2 -1
  73. package/cypress/pages/components/optionsWrapperComponent.js +2 -1
  74. package/cypress/pages/components/questionInputFieldComponent.js +1 -1
  75. package/cypress/pages/components/questionInstructionsComponent.js +19 -7
  76. package/cypress/pages/components/setPointsPopupBase.js +17 -4
  77. package/cypress/pages/components/studentViewSettingsLabelComponent.js +2 -2
  78. package/cypress/pages/drawingResponsePage.js +2 -3
  79. package/cypress/pages/feedbackScalePage.js +143 -2
  80. package/cypress/pages/fillInTheGapsDragAndDropPage.js +1 -1
  81. package/cypress/pages/fillInTheGapsOverImageDragAndDropPage.js +12 -12
  82. package/cypress/pages/graphingPage.js +6 -6
  83. package/cypress/pages/gridFillPage.js +64 -7
  84. package/cypress/pages/matchingPage.js +3 -3
  85. package/cypress/pages/numberLinePage.js +342 -215
  86. package/cypress/pages/readingRulerPage.js +1 -1
  87. package/cypress/pages/textEntryMathPage.js +9 -0
  88. package/cypress/pages/textEntryMathWithImagePage.js +11 -11
  89. package/cypress/pages/textSelectionPage.js +125 -57
  90. package/package.json +1 -1
  91. package/cypress/e2e/ILC/FeedbackScaleNew/feedbackScaleStylePreviewTab.js +0 -161
  92. package/cypress/e2e/ILC/FillInTheGapsDragAndDrop/fillInTheGapsDragAndDropAdditionalSettings.js +0 -356
  93. package/cypress/e2e/ILC/FillInTheGapsDragAndDrop/fillInTheGapsDragAndDropAdditionalSettingsResponseAccordion.js +0 -299
  94. package/cypress/e2e/ILC/Graphing/Scoring/allOrNothingWithCorrectPointsEqualToCorrectPoints.js +0 -355
  95. package/cypress/e2e/ILC/MultipleSelectionGridNew/test.js +0 -28
  96. package/cypress/pages/feedbackScalePage copy.js +0 -716
@@ -1,356 +0,0 @@
1
- import { fillInTheGapsDragAndDropPage } from "../../../pages";
2
- import abortEarlySetup from "../../../support/helpers/abortEarly";
3
-
4
- describe('Fill In the Gaps Additional settings and Responses accordion', () => {
5
- before(() => {
6
- cy.loginAs('admin');
7
- });
8
-
9
- describe('Additional Settings accordion', () => {
10
- abortEarlySetup();
11
- before(() => {
12
- fillInTheGapsDragAndDropPage.steps.navigateToCreateQuestion('fill in the gaps with drag and drop');
13
- cy.barsPreLoaderWait();
14
- });
15
-
16
- fillInTheGapsDragAndDropPage.tests.verifyAdditionalSettingsAccordionProperties();
17
- });
18
-
19
- describe('Additional Settings: Height and Width', () => {
20
- abortEarlySetup();
21
- before(() => {
22
- fillInTheGapsDragAndDropPage.steps.navigateToCreateQuestion('fill in the gaps with drag and drop');
23
- cy.barsPreLoaderWait();
24
- fillInTheGapsDragAndDropPage.steps.expandAdditionalSettings();
25
- });
26
-
27
- fillInTheGapsDragAndDropPage.tests.verifyHeightAndWidthLabelInputFieldWithCSSAnda11y()
28
-
29
- //Height and width test cases for set correct answer section response fields
30
- //TODO: We will need to revisit below case as it will fail for mobile view
31
- it('When the input field of \'Height\' and \'Width\' is kept empty, the default dimension of the response field should be (197x46)px in the \'Set correct answer\' section response field', () => {
32
- fillInTheGapsDragAndDropPage.heightInputField()
33
- .should('have.value', '');
34
- fillInTheGapsDragAndDropPage.widthInputField()
35
- .should('have.value', '');
36
- for (let index = 0; index < 2; index++) {
37
- fillInTheGapsDragAndDropPage.setCorrectAnswerResponseArea()
38
- .eq(index)
39
- .should('have.attr', 'height', '46.000')
40
- .and('have.attr', 'width', '197.000px');
41
- };
42
- });
43
-
44
- it('When the user adds \'Height\' for the response field then the height of the response field should get updated accordingly in the \'Set correct answer\' section', () => {
45
- fillInTheGapsDragAndDropPage.heightInputField()
46
- .type('100')
47
- .should('have.value', '100')
48
- .blur();
49
- for (let index = 0; index < 2; index++) {
50
- fillInTheGapsDragAndDropPage.setCorrectAnswerResponseArea()
51
- .eq(index)
52
- .should('have.attr', 'height', '100.000')
53
- };
54
- });
55
-
56
- it('When the user adds \'Width\' for the response field then the Width of the response field should get updated accordingly in the \'Set correct answer\' section', () => {
57
- fillInTheGapsDragAndDropPage.heightInputField()
58
- .clear()
59
- .should('have.value', '');
60
- fillInTheGapsDragAndDropPage.widthInputField()
61
- .type('100')
62
- .should('have.value', '100')
63
- .blur();
64
- for (let index = 0; index < 2; index++) {
65
- fillInTheGapsDragAndDropPage.setCorrectAnswerResponseArea()
66
- .eq(index)
67
- .should('have.attr', 'width', '100.000px')
68
- };
69
- });
70
-
71
- it('When the user enters a value below 80px in the \'Width\' input field then the width of the input field should remain 80px in \'Set correct answer\' section', () => {
72
- fillInTheGapsDragAndDropPage.widthInputField()
73
- .clear()
74
- .type('20')
75
- .should('have.value', '20')
76
- .blur();
77
- for (let index = 0; index < 2; index++) {
78
- fillInTheGapsDragAndDropPage.setCorrectAnswerResponseArea()
79
- .eq(index)
80
- .should('have.attr', 'width', '80.000px')
81
- };
82
- });
83
-
84
- it('When the user enters a value above 400px in the \'Width\' input field then the width of the input field should remain 400px in \'Set correct answer\' section', () => {
85
- fillInTheGapsDragAndDropPage.widthInputField()
86
- .clear()
87
- .type('800')
88
- .should('have.value', '800')
89
- .blur();
90
- for (let index = 0; index < 2; index++) {
91
- fillInTheGapsDragAndDropPage.setCorrectAnswerResponseArea()
92
- .eq(index)
93
- .should('have.attr', 'width', '400.000px')
94
- };
95
- });
96
-
97
- //Height and width test cases for preview tab response fields
98
- //TODO: We will need to revisit below case as it will fail for mobile view
99
- it('When the input field of \'Height\' and \'Width\' is kept empty, the default dimension of the response field should be (197x46)px for the preview tab', () => {
100
- fillInTheGapsDragAndDropPage.widthInputField()
101
- .clear()
102
- .should('have.value', '');
103
- fillInTheGapsDragAndDropPage.steps.switchToPreviewTab();
104
- for (let index = 0; index < 2; index++) {
105
- fillInTheGapsDragAndDropPage.previewTabResponseArea()
106
- .eq(index)
107
- .should('have.attr', 'height', '46.000')
108
- .and('have.attr', 'width', '197.000px');
109
- };
110
- });
111
-
112
- it('When the user adds \'Height\' for the response field then the height of the response field should get updated accordingly in the preview tab', () => {
113
- cy.log('Pre step: Switching to Edit tab')
114
- fillInTheGapsDragAndDropPage.steps.switchToEditTab();
115
- fillInTheGapsDragAndDropPage.heightInputField()
116
- .type('100')
117
- .should('have.value', '100');
118
- fillInTheGapsDragAndDropPage.steps.switchToPreviewTab();
119
- for (let index = 0; index < 2; index++) {
120
- fillInTheGapsDragAndDropPage.previewTabResponseArea()
121
- .eq(index)
122
- .should('have.attr', 'height', '100.000');
123
- };
124
- });
125
-
126
- it('When the user adds \'Width\' for the response field then the response fields should get updated accordingly in the preview tab', () => {
127
- cy.log('Pre step: Switching to Edit tab')
128
- fillInTheGapsDragAndDropPage.steps.switchToEditTab();
129
- fillInTheGapsDragAndDropPage.heightInputField()
130
- .clear()
131
- .should('have.value', '');
132
- fillInTheGapsDragAndDropPage.widthInputField()
133
- .type('100')
134
- .should('have.value', '100');
135
- fillInTheGapsDragAndDropPage.steps.switchToPreviewTab();
136
- for (let index = 0; index < 2; index++) {
137
- fillInTheGapsDragAndDropPage.previewTabResponseArea()
138
- .eq(index)
139
- .should('have.attr', 'width', '100.000px');
140
- };
141
- });
142
-
143
- it('When the user enters a value below 80px in the \'Width\' input field then the input field should remain 80px for the preview tab response fields', () => {
144
- cy.log('Pre step: Switching to Edit tab')
145
- fillInTheGapsDragAndDropPage.steps.switchToEditTab();
146
- fillInTheGapsDragAndDropPage.widthInputField()
147
- .clear()
148
- .type('20')
149
- .should('have.value', '20');
150
- fillInTheGapsDragAndDropPage.steps.switchToPreviewTab();
151
- for (let index = 0; index < 2; index++) {
152
- fillInTheGapsDragAndDropPage.previewTabResponseArea()
153
- .eq(index)
154
- .should('have.attr', 'width', '80.000px');
155
- };
156
- });
157
-
158
- it('When the user enters a value above 400px in the \'Width\' input field then the input field should remain 400px for preview tab repsonse field', () => {
159
- cy.log('Pre step: Switching to Edit tab')
160
- fillInTheGapsDragAndDropPage.steps.switchToEditTab();
161
- fillInTheGapsDragAndDropPage.widthInputField()
162
- .clear()
163
- .type('800')
164
- .should('have.value', '800');
165
- fillInTheGapsDragAndDropPage.steps.switchToPreviewTab();
166
- for (let index = 0; index < 2; index++) {
167
- fillInTheGapsDragAndDropPage.previewTabResponseArea()
168
- .eq(index)
169
- .should('have.attr', 'width', '400.000px');
170
- };
171
- });
172
- });
173
-
174
- describe('Additional Settings : Response accordion', () => {
175
- abortEarlySetup();
176
- before(() => {
177
- fillInTheGapsDragAndDropPage.steps.navigateToCreateQuestion('fill in the gaps with drag and drop');
178
- cy.barsPreLoaderWait();
179
- fillInTheGapsDragAndDropPage.steps.expandAdditionalSettings();
180
- });
181
-
182
- fillInTheGapsDragAndDropPage.tests.verifyAdditionalSettingsResponseAccordionLabelCSSAndA11y();
183
- });
184
-
185
- describe('Additional Settings: Check Answer', () => {
186
- abortEarlySetup();
187
- before(() => {
188
- fillInTheGapsDragAndDropPage.steps.navigateToCreateQuestion('fill in the gaps with drag and drop');
189
- cy.barsPreLoaderWait();
190
- fillInTheGapsDragAndDropPage.addOptionButton()
191
- .click();
192
- fillInTheGapsDragAndDropPage.addOptionButton()
193
- .click();
194
- fillInTheGapsDragAndDropPage.steps.addInputToOptionsForDragAndDropFields(['Correct answer for response 1', 'Correct answer for response 2', 'Incorrect answer 1', 'Incorrect answer 2']);
195
- fillInTheGapsDragAndDropPage.pointsInputField()
196
- .type('4');
197
- fillInTheGapsDragAndDropPage.steps.setCorrectAnswerSectionClickAndDropDraggableOptionInResponseArea('Correct answer for response 1', 0);
198
- fillInTheGapsDragAndDropPage.steps.setCorrectAnswerSectionClickAndDropDraggableOptionInResponseArea('Correct answer for response 2', 1);
199
- fillInTheGapsDragAndDropPage.steps.expandAdditionalSettings();
200
- });
201
-
202
- fillInTheGapsDragAndDropPage.tests.verifyCheckAnswerSectionAndPreviewTabCheckAnswerButton();
203
- });
204
-
205
- describe('Additional Settings: Check Answer - Functionality', () => {
206
- abortEarlySetup();
207
- before(() => {
208
- fillInTheGapsDragAndDropPage.steps.navigateToCreateQuestion('fill in the gaps with drag and drop');
209
- cy.barsPreLoaderWait();
210
- fillInTheGapsDragAndDropPage.addOptionButton()
211
- .click();
212
- fillInTheGapsDragAndDropPage.addOptionButton()
213
- .click();
214
- fillInTheGapsDragAndDropPage.steps.addInputToOptionsForDragAndDropFields(['Correct answer for response 1', 'Correct answer for response 2', 'Incorrect answer 1', 'Incorrect answer 2']);
215
- fillInTheGapsDragAndDropPage.pointsInputField()
216
- .type('4');
217
- fillInTheGapsDragAndDropPage.steps.setCorrectAnswerSectionClickAndDropDraggableOptionInResponseArea('Correct answer for response 1', 0);
218
- fillInTheGapsDragAndDropPage.steps.setCorrectAnswerSectionClickAndDropDraggableOptionInResponseArea('Correct answer for response 2', 1);
219
- fillInTheGapsDragAndDropPage.steps.expandAdditionalSettings();
220
- fillInTheGapsDragAndDropPage.steps.setMaximumCheckAnswerAttempts(2);
221
- fillInTheGapsDragAndDropPage.steps.switchToPreviewTab();
222
- });
223
-
224
- it('When the user has not set any responses then on clicking on the Check Answer button icons should not be displayed beside both empty responses, label should not be displayed below the box', () => {
225
- for (let index = 0; index < 2; index++) {
226
- fillInTheGapsDragAndDropPage.previewTabResponseArea()
227
- .eq(index)
228
- .should('have.value', '');
229
- };
230
- fillInTheGapsDragAndDropPage.checkAnswerButton()
231
- .click();
232
- fillInTheGapsDragAndDropPage.correctIcon()
233
- .should('not.exist');
234
- fillInTheGapsDragAndDropPage.incorrectIcon()
235
- .should('not.exist');
236
- fillInTheGapsDragAndDropPage.correctIncorrectAnswerLabel()
237
- .should('not.exist');
238
- fillInTheGapsDragAndDropPage.previewTabCorrectAnswerContainer()
239
- .should('not.exist')
240
- });
241
-
242
- it('When the user has added correct response for one option then on clicking on the Check Answer button, green checkmark icon should be displayed besides the correct response, red crossmark should not be displayed beside empty response and \'Incorrect Answer\' label should be displayed below the box', () => {
243
- fillInTheGapsDragAndDropPage.steps.previewTabClickAndDropDraggableOptionInResponseArea('Correct answer for response 1', 0);
244
- fillInTheGapsDragAndDropPage.checkAnswerButton()
245
- .click();
246
- fillInTheGapsDragAndDropPage.steps.verifyCorrectOptionCheckmarkIcon(0);
247
- fillInTheGapsDragAndDropPage.steps.verifyCorrectIncorrectIconNotVisible(1);
248
- fillInTheGapsDragAndDropPage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect')
249
- fillInTheGapsDragAndDropPage.steps.verifyIncorrectAttemptBorder();
250
- });
251
-
252
- it('When the user has added correct responses then on clicking on the Check Answer button, green checkmark icon should be displayed besides the responses and \'Correct Answer\' label should be displayed below the box', () => {
253
- fillInTheGapsDragAndDropPage.steps.previewTabClickAndDropDraggableOptionInResponseArea('Correct answer for response 2', 1);
254
- fillInTheGapsDragAndDropPage.checkAnswerButton()
255
- .click();
256
- fillInTheGapsDragAndDropPage.steps.verifyCorrectOptionCheckmarkIcon(0);
257
- fillInTheGapsDragAndDropPage.steps.verifyCorrectOptionCheckmarkIcon(1);
258
- fillInTheGapsDragAndDropPage.steps.verifyCorrectIncorrectAnswerLabel('Correct');
259
- fillInTheGapsDragAndDropPage.steps.verifyCorrectAttemptBorder();
260
- });
261
-
262
-
263
- fillInTheGapsDragAndDropPage.tests.verifyDisabledCheckAnswerButtonWithCSSAnda11y()
264
-
265
- it('When the user updates the value of Maximum check answer attempts input field, it should get reflected on the Preview tab', () => {
266
- cy.log('Pre step: Switching to Edit tab')
267
- fillInTheGapsDragAndDropPage.steps.switchToEditTab();
268
- fillInTheGapsDragAndDropPage.maximumCheckAnswerAttemptsInputField()
269
- .clear()
270
- .type(1)
271
- .should('have.value', '1');
272
- cy.log('Switching to Preview tab');
273
- fillInTheGapsDragAndDropPage.steps.switchToPreviewTab();
274
- fillInTheGapsDragAndDropPage.checkAnswerButton()
275
- .should('be.enabled');
276
- fillInTheGapsDragAndDropPage.steps.previewTabClickAndDropDraggableOptionInResponseArea('Correct answer for response 1', 0);
277
- fillInTheGapsDragAndDropPage.steps.previewTabClickAndDropDraggableOptionInResponseArea('Correct answer for response 2', 1);
278
- fillInTheGapsDragAndDropPage.checkAnswerButton()
279
- .click()
280
- .should('be.disabled');
281
- });
282
-
283
- it('When the \'Maximum check answer attempts\' input field has value \'0\' and user switches to Preview tab, then the \'Check Answer\' button should be enabled and user should be able to check answer multiple times', () => {
284
- fillInTheGapsDragAndDropPage.steps.switchToEditTab();
285
- fillInTheGapsDragAndDropPage.steps.clearMaximumCheckAnswerAttemptsInputField();
286
- fillInTheGapsDragAndDropPage.steps.addInputToMaximumCheckAnswerAttemptsInputField(0);
287
- cy.log('Switching to Preview tab');
288
- fillInTheGapsDragAndDropPage.steps.switchToPreviewTab();
289
- fillInTheGapsDragAndDropPage.checkAnswerButton()
290
- .should('be.enabled');
291
- cy.log('Clicking on \'Check Answer\' to check state of \'Check Answer\' to be enabled')
292
- fillInTheGapsDragAndDropPage.steps.previewTabClickAndDropDraggableOptionInResponseArea('Incorrect answer 1', 0);
293
- fillInTheGapsDragAndDropPage.steps.previewTabClickAndDropDraggableOptionInResponseArea('Incorrect answer 2', 1);
294
- fillInTheGapsDragAndDropPage.checkAnswerButton()
295
- .click();
296
- fillInTheGapsDragAndDropPage.steps.verifyIncorrectOptionCrossmarkIcon(0)
297
- fillInTheGapsDragAndDropPage.steps.verifyIncorrectOptionCrossmarkIcon(1)
298
- fillInTheGapsDragAndDropPage.checkAnswerButton()
299
- .should('be.enabled');
300
- fillInTheGapsDragAndDropPage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect')
301
- fillInTheGapsDragAndDropPage.steps.verifyIncorrectAttemptBorder()
302
- cy.log('As the user is able to check answer multiple times, verifying state of \'Check Answer\' to be enabled by adding another response')
303
- fillInTheGapsDragAndDropPage.steps.previewTabClickAndDropDraggableOptionInResponseArea('Correct answer for response 1', 0);
304
- fillInTheGapsDragAndDropPage.steps.previewTabClickAndDropDraggableOptionInResponseArea('Correct answer for response 2', 1);
305
- fillInTheGapsDragAndDropPage.checkAnswerButton()
306
- .click();
307
- fillInTheGapsDragAndDropPage.steps.verifyCorrectIncorrectAnswerLabel('Correct')
308
- fillInTheGapsDragAndDropPage.steps.verifyCorrectAttemptBorder()
309
- fillInTheGapsDragAndDropPage.checkAnswerButton()
310
- .should('be.enabled');
311
- });
312
-
313
- it('When the \'Maximum check answer attempts\' input field is empty and user switches to Preview tab, then the \'Check Answer\' button should be enabled and user should be able to check answer multiple times', () => {
314
- cy.log('Pre step: Switching to Edit tab')
315
- fillInTheGapsDragAndDropPage.steps.switchToEditTab();
316
- fillInTheGapsDragAndDropPage.maximumCheckAnswerAttemptsInputField()
317
- .clear()
318
- .should('have.value', '');
319
- cy.log('Switching to Preview tab');
320
- fillInTheGapsDragAndDropPage.steps.switchToPreviewTab();
321
- fillInTheGapsDragAndDropPage.checkAnswerButton()
322
- .should('be.enabled');
323
- cy.log('Clicking on \'Check Answer\' to check state of \'Check Answer\' to be enabled')
324
- fillInTheGapsDragAndDropPage.steps.previewTabClickAndDropDraggableOptionInResponseArea('Incorrect answer 1', 0);
325
- fillInTheGapsDragAndDropPage.steps.previewTabClickAndDropDraggableOptionInResponseArea('Incorrect answer 2', 1);
326
- fillInTheGapsDragAndDropPage.checkAnswerButton()
327
- .click();
328
- fillInTheGapsDragAndDropPage.steps.verifyIncorrectOptionCrossmarkIcon(0)
329
- fillInTheGapsDragAndDropPage.steps.verifyIncorrectOptionCrossmarkIcon(1)
330
- fillInTheGapsDragAndDropPage.checkAnswerButton()
331
- .should('be.enabled');
332
- fillInTheGapsDragAndDropPage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect')
333
- fillInTheGapsDragAndDropPage.steps.verifyIncorrectAttemptBorder()
334
- cy.log('As the user is able to check answer multiple times, verifying state of \'Check Answer\' to be enabled by adding another response')
335
- fillInTheGapsDragAndDropPage.steps.previewTabClickAndDropDraggableOptionInResponseArea('Correct answer for response 1', 0);
336
- fillInTheGapsDragAndDropPage.steps.previewTabClickAndDropDraggableOptionInResponseArea('Correct answer for response 2', 1);
337
- fillInTheGapsDragAndDropPage.checkAnswerButton()
338
- .click();
339
- fillInTheGapsDragAndDropPage.steps.verifyCorrectIncorrectAnswerLabel('Correct')
340
- fillInTheGapsDragAndDropPage.steps.verifyCorrectAttemptBorder()
341
- fillInTheGapsDragAndDropPage.checkAnswerButton()
342
- .should('be.enabled');
343
- });
344
- });
345
-
346
- describe('Additional Settings: Details section', () => {
347
- abortEarlySetup();
348
- before(() => {
349
- fillInTheGapsDragAndDropPage.steps.navigateToCreateQuestion('fill in the gaps with drag and drop');
350
- cy.barsPreLoaderWait();
351
- fillInTheGapsDragAndDropPage.steps.expandAdditionalSettings();
352
- });
353
-
354
- fillInTheGapsDragAndDropPage.tests.verifyDetailsSection();
355
- });
356
- });
@@ -1,299 +0,0 @@
1
- import { fillInTheGapsDragAndDropPage } from "../../../pages";
2
- import abortEarlySetup from "../../../support/helpers/abortEarly";
3
-
4
- describe('Fill In the Gaps Additional settings and Responses accordion', () => {
5
- before(() => {
6
- cy.loginAs('admin');
7
- });
8
-
9
- describe('Additional Settings: Advanced settings for all Response Areas', () => {
10
- abortEarlySetup();
11
- before(() => {
12
- fillInTheGapsDragAndDropPage.steps.navigateToCreateQuestion('fill in the gaps with drag and drop');
13
- cy.barsPreLoaderWait();
14
- fillInTheGapsDragAndDropPage.steps.expandAdditionalSettings();
15
- });
16
-
17
- fillInTheGapsDragAndDropPage.tests.verifyAdvanceSettingsForAllResponsesLabelAndCSS();
18
- });
19
-
20
- describe('Response Accordions: ARIA label', () => {
21
- abortEarlySetup();
22
- before(() => {
23
- fillInTheGapsDragAndDropPage.steps.navigateToCreateQuestion('fill in the gaps with drag and drop');
24
- cy.barsPreLoaderWait();
25
- fillInTheGapsDragAndDropPage.steps.expandAdditionalSettings();
26
- fillInTheGapsDragAndDropPage.steps.expandResponseAccordion(0);
27
- fillInTheGapsDragAndDropPage.steps.expandResponseAccordion(1);
28
- });
29
-
30
- fillInTheGapsDragAndDropPage.tests.verifyDefaultStateOfAriaLabelInputFieldInResponseAccordionAndCSS();
31
-
32
- //Note: a11y covered in Additional Settings: Response accordion
33
-
34
- //ARIA label test cases for set correct answer section
35
- it('When the user has not set \'ARIA label\' input field then the default \'ARIA label\' should be present for the \'Set correct answer\' section response field', () => {
36
- for (let index = 0; index < 2; index++) {
37
- fillInTheGapsDragAndDropPage.setCorrectAnswerResponseArea()
38
- .eq(index)
39
- .should('have.attr', 'aria-label', 'Response Area');
40
- };
41
- });
42
-
43
- fillInTheGapsDragAndDropPage.tests.verifyCustomLabelNotVisibleOnResponseAccordion('ARIA label');
44
-
45
- it('When the user has set \'ARIA label\' in the response accordion then it should be present for the \'Set correct answer\' section response field and for the other response field, value of the aria-label should remain the same', () => {
46
- fillInTheGapsDragAndDropPage.steps.setAriaLabelInResponseAccordion(0, 'Custom Aria Label');
47
- fillInTheGapsDragAndDropPage.setCorrectAnswerResponseArea()
48
- .eq(0)
49
- .should('have.attr', 'aria-label', 'Custom Aria Label');
50
- fillInTheGapsDragAndDropPage.setCorrectAnswerResponseArea()
51
- .eq(1)
52
- .should('have.attr', 'aria-label', 'Response Area');
53
- });
54
-
55
- fillInTheGapsDragAndDropPage.tests.verifyCustomLabelVisibleOnResponseAccordion('ARIA label');
56
-
57
- fillInTheGapsDragAndDropPage.tests.verifyCustomLabelOnResponseAccordionCSS();
58
-
59
- it('Accessibility of input field in \'Set correct answer\' section when custom \'ARIA label\' is set and Custom label', { tags: 'a11y' }, () => {
60
- cy.checkAccessibility(fillInTheGapsDragAndDropPage.setCorrectAnswerResponseArea())
61
- cy.checkAccessibility(fillInTheGapsDragAndDropPage.responseAccordionCustomLabel())
62
- });
63
-
64
- it('When the user clears the set value in the \'ARIA label\' input field, then the default \'ARIA label\' should be present for the response fields in the \'Set correct answer\' section', () => {
65
- fillInTheGapsDragAndDropPage.responseAccordionWrapper()
66
- .eq(0)
67
- .within(() => {
68
- fillInTheGapsDragAndDropPage.ariaLabelInputField()
69
- .clear()
70
- .should('have.value', '')
71
- .blur();
72
- });
73
- for (let index = 0; index < 2; index++) {
74
- fillInTheGapsDragAndDropPage.setCorrectAnswerResponseArea()
75
- .eq(index)
76
- .should('have.attr', 'aria-label', 'Response Area');
77
- };
78
- });
79
-
80
- //ARIA label test cases for preview tab
81
- it('When the user has not set \'ARIA label\' input field then in the preview tab default \'ARIA label\' should be present for the response field in the preview tab', () => {
82
- cy.log('Pre step: Switch to Preview tab')
83
- fillInTheGapsDragAndDropPage.steps.switchToPreviewTab();
84
- for (let index = 0; index < 2; index++) {
85
- fillInTheGapsDragAndDropPage.previewTabResponseArea()
86
- .eq(index)
87
- .should('have.attr', 'aria-label', 'Response Area');
88
- };
89
- });
90
-
91
- it('When the user has set \'ARIA label\' in the response accordion then it should be present for the response field in the preview tab', () => {
92
- cy.log('Pre step: Switch to Edit tab')
93
- fillInTheGapsDragAndDropPage.steps.switchToEditTab();
94
- fillInTheGapsDragAndDropPage.steps.setAriaLabelInResponseAccordion(0, 'Custom Aria Label');
95
- fillInTheGapsDragAndDropPage.steps.switchToPreviewTab();
96
- fillInTheGapsDragAndDropPage.previewTabResponseArea()
97
- .eq(0)
98
- .should('have.attr', 'aria-label', 'Custom Aria Label');
99
- fillInTheGapsDragAndDropPage.previewTabResponseArea()
100
- .eq(1)
101
- .should('have.attr', 'aria-label', 'Response Area');
102
- });
103
-
104
- it('Accessibility of input field in preview tab when custom \'ARIA label\' is set', { tags: 'a11y' }, () => {
105
- cy.checkAccessibility(fillInTheGapsDragAndDropPage.previewTabResponseArea())
106
- });
107
-
108
- it('When the user clears the set value in the \'ARIA label\' input field, then the default \'ARIA label\' should be present for the response field in the preview tab', () => {
109
- cy.log('Pre step: Switch to Edit tab')
110
- fillInTheGapsDragAndDropPage.steps.switchToEditTab();
111
- fillInTheGapsDragAndDropPage.responseAccordionWrapper()
112
- .eq(0)
113
- .within(() => {
114
- fillInTheGapsDragAndDropPage.ariaLabelInputField()
115
- .clear()
116
- .should('have.value', '');
117
- });
118
- fillInTheGapsDragAndDropPage.steps.switchToPreviewTab();
119
- for (let index = 0; index < 2; index++) {
120
- fillInTheGapsDragAndDropPage.previewTabResponseArea()
121
- .eq(index)
122
- .should('have.attr', 'aria-label', 'Response Area');
123
- };
124
- });
125
- });
126
-
127
- describe('Response Accordions: Height and Width', () => {
128
- abortEarlySetup();
129
- before(() => {
130
- fillInTheGapsDragAndDropPage.steps.navigateToCreateQuestion('fill in the gaps with drag and drop');
131
- cy.barsPreLoaderWait();
132
- fillInTheGapsDragAndDropPage.steps.expandAdditionalSettings();
133
- fillInTheGapsDragAndDropPage.steps.expandResponseAccordion(0);
134
- fillInTheGapsDragAndDropPage.steps.expandResponseAccordion(1);
135
- });
136
-
137
- fillInTheGapsDragAndDropPage.tests.verifyDefaultStateOfHeightAndWidthInputFieldInResponseAccordionAndCSS();
138
-
139
- //Note: a11y covered in Additional Settings: Response accordion
140
-
141
- //TODO: We will need to revisit below case as it will fail for mobile view
142
- it('When the user has not set \'Height\' and \'Width\' for response fields then the default dimension of the response field in the \'Set correct answer\' section response fields should be (197x46)px', () => {
143
- for (let index = 0; index < 2; index++) {
144
- fillInTheGapsDragAndDropPage.setCorrectAnswerResponseArea()
145
- .eq(index)
146
- .should('have.attr', 'height', '46.000')
147
- .and('have.attr', 'width', '197.000px');
148
- };
149
- });
150
-
151
- fillInTheGapsDragAndDropPage.tests.verifyCustomLabelNotVisibleOnResponseAccordion('Height and Width');
152
-
153
- it('When the user has set \'Height\' for the response field then the Height of the response field should get updated accordingly in the \'Set correct answer\' section', () => {
154
- fillInTheGapsDragAndDropPage.steps.setHeightInResponseAccordion(0, '100');
155
- fillInTheGapsDragAndDropPage.setCorrectAnswerResponseArea()
156
- .eq(0)
157
- .should('have.attr', 'height', '100.000');
158
- });
159
-
160
- fillInTheGapsDragAndDropPage.tests.verifyCustomLabelVisibleOnResponseAccordion('Height and Width');
161
-
162
- it('When the user has set \'Width\' for the response field then the Width of the response field should get updated accordingly in the \'Set correct answer\' section', () => {
163
- fillInTheGapsDragAndDropPage.steps.setWidthInResponseAccordion(0, '100');
164
- fillInTheGapsDragAndDropPage.setCorrectAnswerResponseArea()
165
- .eq(0)
166
- .should('have.attr', 'width', '100.000px');
167
- });
168
-
169
- it('When the user has set width below 80px then the width should remain 80px in the \'Set correct answer\' section', () => {
170
- fillInTheGapsDragAndDropPage.steps.setWidthInResponseAccordion(0, '20');
171
- fillInTheGapsDragAndDropPage.setCorrectAnswerResponseArea()
172
- .eq(0)
173
- .should('have.attr', 'width', '80.000px');
174
- });
175
-
176
- it('When the user has set width above 400px then the width should remain 400px in the \'Set correct answer\' section', () => {
177
- fillInTheGapsDragAndDropPage.steps.setWidthInResponseAccordion(0, '800');
178
- fillInTheGapsDragAndDropPage.setCorrectAnswerResponseArea()
179
- .eq(0)
180
- .should('have.attr', 'width', '400.000px');
181
- });
182
-
183
- it('When the user has set \'Height\' and \'Width\' in the individual responses accordion then it should override the \'Height\' and \'Width\'set in the \'Advanced settings for all response areas\' in the \'Set correct answer\' section', () => {
184
- fillInTheGapsDragAndDropPage.widthInputField()
185
- .clear()
186
- .type('250')
187
- .should('have.value', '250');
188
- fillInTheGapsDragAndDropPage.heightInputField()
189
- .clear()
190
- .type('180')
191
- .should('have.value', '180');
192
- fillInTheGapsDragAndDropPage.steps.setWidthInResponseAccordion(0, '175');
193
- fillInTheGapsDragAndDropPage.steps.setHeightInResponseAccordion(0, '120');
194
- fillInTheGapsDragAndDropPage.setCorrectAnswerResponseArea()
195
- .eq(0)
196
- .should('have.attr', 'width', '175.000px')
197
- .and('have.attr', 'height', '120.000');
198
- fillInTheGapsDragAndDropPage.setCorrectAnswerResponseArea()
199
- .eq(1)
200
- .should('have.attr', 'width', '250.000px')
201
- .and('have.attr', 'height', '180.000');
202
- });
203
-
204
- //Height and width test cases for preview tab
205
- //TODO: We will need to revisit below case as it will fail for mobile view
206
- it('When the user has not set \'Height\' and \'Width\' for the response accordion then the default dimension of the response field in the preview tab response field should be (197x46)px', () => {
207
- cy.log('Pre step: clearing the set values of height and width to bring back the dimensions of the response field to default dimensions')
208
- fillInTheGapsDragAndDropPage.widthInputField()
209
- .clear()
210
- .should('have.value', '');
211
- fillInTheGapsDragAndDropPage.heightInputField()
212
- .clear()
213
- .should('have.value', '');
214
- for (let index = 0; index < 2; index++) {
215
- fillInTheGapsDragAndDropPage.responseAccordionWrapper()
216
- .eq(index)
217
- .within(() => {
218
- fillInTheGapsDragAndDropPage.heightInputField()
219
- .clear()
220
- .should('have.value', '');
221
- fillInTheGapsDragAndDropPage.widthInputField()
222
- .clear()
223
- .should('have.value', '');
224
- });
225
- };
226
- fillInTheGapsDragAndDropPage.steps.switchToPreviewTab();
227
- for (let index = 0; index < 2; index++) {
228
- fillInTheGapsDragAndDropPage.previewTabResponseArea()
229
- .eq(index)
230
- .should('have.attr', 'height', '46.000')
231
- .and('have.attr', 'width', '197.000px');
232
- };
233
- });
234
-
235
- it('When the user has set \'Height\' for the response field then the height of the preview tab response field should get updated accordingly in the preview tab', () => {
236
- cy.log('Pre step: Switch to Edit tab')
237
- fillInTheGapsDragAndDropPage.steps.switchToEditTab();
238
- fillInTheGapsDragAndDropPage.steps.setHeightInResponseAccordion(0, '100');
239
- fillInTheGapsDragAndDropPage.steps.switchToPreviewTab();
240
- fillInTheGapsDragAndDropPage.previewTabResponseArea()
241
- .eq(0)
242
- .should('have.attr', 'height', '100.000');
243
- });
244
-
245
- it('When the user has set \'Width\' for the response field then the width of the preview tab response field should get updated accordingly in the preview tab', () => {
246
- cy.log('Pre step: Switch to Edit tab')
247
- fillInTheGapsDragAndDropPage.steps.switchToEditTab();
248
- fillInTheGapsDragAndDropPage.steps.setWidthInResponseAccordion(0, '100');
249
- fillInTheGapsDragAndDropPage.steps.switchToPreviewTab();
250
- fillInTheGapsDragAndDropPage.previewTabResponseArea()
251
- .eq(0)
252
- .should('have.attr', 'width', '100.000px');
253
- });
254
-
255
- it('When the user has set width below 80px then the width should remain 80px in the preview tab', () => {
256
- cy.log('Pre step: Switch to Edit tab')
257
- fillInTheGapsDragAndDropPage.steps.switchToEditTab();
258
- fillInTheGapsDragAndDropPage.steps.setWidthInResponseAccordion(0, '20');
259
- fillInTheGapsDragAndDropPage.steps.switchToPreviewTab();
260
- fillInTheGapsDragAndDropPage.previewTabResponseArea()
261
- .eq(0)
262
- .should('have.attr', 'width', '80.000px');
263
- });
264
-
265
- it('When the user has set width above 400px then the width should remain 400px in the preview tab', () => {
266
- cy.log('Pre step: Switch to Edit tab')
267
- fillInTheGapsDragAndDropPage.steps.switchToEditTab();
268
- fillInTheGapsDragAndDropPage.steps.setWidthInResponseAccordion(0, '800');
269
- fillInTheGapsDragAndDropPage.steps.switchToPreviewTab();
270
- fillInTheGapsDragAndDropPage.previewTabResponseArea()
271
- .eq(0)
272
- .should('have.attr', 'width', '400.000px');
273
- });
274
-
275
- it('When the user has set \'Height\' and \'Width\' in the individual responses accordion then it should override the \'Height\' and \'Width\'set in the \'Advanced settings for all response areas\' in the preview tab', () => {
276
- cy.log('Pre step: Switch to Edit tab')
277
- fillInTheGapsDragAndDropPage.steps.switchToEditTab();
278
- fillInTheGapsDragAndDropPage.widthInputField()
279
- .clear()
280
- .type('250')
281
- .should('have.value', '250');
282
- fillInTheGapsDragAndDropPage.heightInputField()
283
- .clear()
284
- .type('180')
285
- .should('have.value', '180');
286
- fillInTheGapsDragAndDropPage.steps.setWidthInResponseAccordion(0, '175');
287
- fillInTheGapsDragAndDropPage.steps.setHeightInResponseAccordion(0, '120');
288
- fillInTheGapsDragAndDropPage.steps.switchToPreviewTab();
289
- fillInTheGapsDragAndDropPage.previewTabResponseArea()
290
- .eq(0)
291
- .should('have.attr', 'width', '175.000px')
292
- .and('have.attr', 'height', '120.000');
293
- fillInTheGapsDragAndDropPage.previewTabResponseArea()
294
- .eq(1)
295
- .should('have.attr', 'width', '250.000px')
296
- .and('have.attr', 'height', '180.000')
297
- });
298
- });
299
- });