itemengine-cypress-automation 1.0.45 → 1.0.47

Sign up to get free protection for your applications and to get access to all the features.
Files changed (19) hide show
  1. package/cypress/e2e/ILC/DragAndDropIntoCategories/dragAndDropIntoCategoriesScoringFiles/groupedOptionsAllOrNothingAlternatePointsGreaterThanCorrectPoints.js +1 -1
  2. package/cypress/e2e/ILC/DragAndDropIntoCategories/dragAndDropIntoCategoriesScoringFiles/groupedOptionsAllOrNothingCorrectPointsEqualToAlternatePoints.js +1 -1
  3. package/cypress/e2e/ILC/DragAndDropIntoCategories/dragAndDropIntoCategoriesScoringFiles/standardAllOrNothingCorrectPointsEqualToAlternatePoints.js +1 -1
  4. package/cypress/e2e/ILC/DragAndDropIntoCategories/dragAndDropIntoCategoriesScoringFiles/standardAllOrNothingCorrectPointsGreaterThanAlternatePoints.js +1 -1
  5. package/cypress/e2e/ILC/FillInTheGapsOverImageText/fillInTheGapsOverImageTextAddResponseContainer.js +221 -0
  6. package/cypress/e2e/ILC/FillInTheGapsOverImageText/fillInTheGapsOverImageTextAdditionalSettings.js +1588 -0
  7. package/cypress/e2e/ILC/FillInTheGapsOverImageText/fillInTheGapsOverImageTextAllOrNothingScoring.js +950 -0
  8. package/cypress/e2e/ILC/FillInTheGapsOverImageText/fillInTheGapsOverImageTextConditionalCheckboxes.js +357 -0
  9. package/cypress/e2e/ILC/FillInTheGapsOverImageText/fillInTheGapsOverImageTextEditAriaLabelCheckbox.js +134 -0
  10. package/cypress/e2e/ILC/FillInTheGapsOverImageText/fillInTheGapsOverImageTextEditTabBasicSection.js +208 -0
  11. package/cypress/e2e/ILC/FillInTheGapsOverImageText/fillInTheGapsOverImageTextEditTabScoringSection.js +227 -0
  12. package/cypress/e2e/ILC/FillInTheGapsOverImageText/fillInTheGapsOverImageTextHeaderSection.js +109 -0
  13. package/cypress/e2e/ILC/FillInTheGapsOverImageText/fillInTheGapsOverImageTextImageProperties.js +156 -0
  14. package/cypress/e2e/ILC/FillInTheGapsOverImageText/fillInTheGapsOverImageTextManualAndNonScored.js +157 -0
  15. package/cypress/e2e/ILC/FillInTheGapsOverImageText/fillInTheGapsOverImageTextPartialDifferentWeightsScoring.js +1199 -0
  16. package/cypress/e2e/ILC/FillInTheGapsOverImageText/fillInTheGapsOverImageTextPartialEqualWeightsScoring.js +1084 -0
  17. package/cypress/e2e/ILC/FillInTheGapsOverImageText/fillInTheGapsOverImageTextPreviewTab.js +66 -0
  18. package/cypress/e2e/ILC/FillInTheGapsOverImageText/fillInTheGapsOverImageTextSetCorrectAnswerSection.js +113 -0
  19. package/package.json +1 -1
@@ -0,0 +1,357 @@
1
+ import { fillInTheGapsOverImageTextPage } from "../../../pages";
2
+ import abortEarlySetup from "../../../support/helpers/abortEarly";
3
+ const correctTabAnswerArray = ['Flower', 'Leaf'];
4
+ const alternateTab1AnswerArray = ['Petals', 'Leaves'];
5
+ const alternateTab2AnswerArray = ['Branch', 'Roots'];
6
+
7
+ describe('Fill In the gaps over image - text \'Correct response condition\' checkboxes', () => {
8
+ before(() => {
9
+ cy.loginAs('admin');
10
+ });
11
+
12
+ describe('\'Case sensitive\' checkbox is unchecked and \'Ignore spaces before and after\' checkbox is checked', () => {
13
+ abortEarlySetup();
14
+ before(() => {
15
+ cy.log('Navigate to fill in the gaps over image - text question type');
16
+ fillInTheGapsOverImageTextPage.steps.navigateToCreateQuestion('fill in the gaps over image - text');
17
+ cy.barsPreLoaderWait();
18
+ fillInTheGapsOverImageTextPage.steps.uploadFile('highlightImage.jpg');
19
+ fillInTheGapsOverImageTextPage.steps.clickOnImagePopupOkButton();
20
+ fillInTheGapsOverImageTextPage.steps.addResponseContainer();
21
+ fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldSetCorrectAnswerSection(0, 'Marigold flower');
22
+ fillInTheGapsOverImageTextPage.steps.allotPoints(10);
23
+ fillInTheGapsOverImageTextPage.steps.expandAdditonalSettings();
24
+ fillInTheGapsOverImageTextPage.steps.checkAllowStudentsToCheckAnswerCheckbox();
25
+ fillInTheGapsOverImageTextPage.steps.switchToPreviewTab();
26
+ });
27
+
28
+ it('When the user attempts the question with response having different casing, then full points should be awarded and when user clicks on \'Check answer\' button, green check mark should be displayed beside the correct response field and \'Correct answer\' label should be displayed below the question preview', () => {
29
+ fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldPreviewTab(0, 'marigold flower');
30
+ fillInTheGapsOverImageTextPage.steps.verifyPreviewTabScoreText(10, 10);
31
+ fillInTheGapsOverImageTextPage.steps.checkAnswer();
32
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectOptionCheckmarkIcon(0);
33
+ });
34
+
35
+ it('When the user attempts the question with identical casing in the answer input field, then full points should be awarded and when user clicks on \'Check answer\' button, green check mark should be displayed beside the correct response field and \'Correct answer\' label should be displayed below the question preview', () => {
36
+ fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldPreviewTab(0, 'Marigold flower');
37
+ fillInTheGapsOverImageTextPage.steps.verifyPreviewTabScoreText(10, 10);
38
+ fillInTheGapsOverImageTextPage.steps.checkAnswer();
39
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectOptionCheckmarkIcon(0);
40
+ });
41
+
42
+ it('When the user attempts the question with extra spaces in the answer input field, then full points should be awarded and when user clicks on \'Check answer\' button, green check mark should be displayed beside the correct response field and \'Correct answer\' label should be displayed below the question preview', () => {
43
+ fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldPreviewTab(0, 'Marigold flower ');
44
+ fillInTheGapsOverImageTextPage.steps.verifyPreviewTabScoreText(10, 10);
45
+ fillInTheGapsOverImageTextPage.steps.checkAnswer();
46
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectOptionCheckmarkIcon(0);
47
+ });
48
+
49
+ it('When the user attempts the question with incorrect spelling in the answer input field, then 0 points should be awarded and when user clicks on \'Check answer\' button, red cross mark should be displayed beside the incorrect response field and \'Incorrect answer\' label should be displayed below the question preview', () => {
50
+ fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldPreviewTab(0, 'Marigold flowerr');
51
+ fillInTheGapsOverImageTextPage.steps.verifyPreviewTabScoreText(0, 10);
52
+ fillInTheGapsOverImageTextPage.steps.checkAnswer();
53
+ fillInTheGapsOverImageTextPage.steps.verifyIncorrectOptionCrossmarkIcon(0);
54
+ });
55
+
56
+ it('When the user gives an answer having extra spaces in between its words in the answer input field, then 0 points should be awarded and when user clicks on \'Check answer\' button, red cross mark should be displayed beside the incorrect response field and \'Incorrect answer\' label should be displayed below the question preview', () => {
57
+ fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldPreviewTab(0, 'Marigold flower');
58
+ fillInTheGapsOverImageTextPage.steps.verifyPreviewTabScoreText(0, 10);
59
+ fillInTheGapsOverImageTextPage.steps.checkAnswer();
60
+ fillInTheGapsOverImageTextPage.steps.verifyIncorrectOptionCrossmarkIcon(0);
61
+ });
62
+ });
63
+
64
+ describe('\'Case sensitive\' checkbox is checked and \'Ignore spaces before and after\' checkbox is unchecked', () => {
65
+ abortEarlySetup();
66
+ before(() => {
67
+ cy.log('Navigate to fill in the gaps over image - text question type');
68
+ fillInTheGapsOverImageTextPage.steps.navigateToCreateQuestion('fill in the gaps over image - text');
69
+ cy.barsPreLoaderWait();
70
+ fillInTheGapsOverImageTextPage.steps.uploadFile('highlightImage.jpg');
71
+ fillInTheGapsOverImageTextPage.steps.clickOnImagePopupOkButton();
72
+ fillInTheGapsOverImageTextPage.steps.addResponseContainer();
73
+ fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldSetCorrectAnswerSection(0, 'Marigold flower');
74
+ fillInTheGapsOverImageTextPage.steps.allotPoints(10);
75
+ fillInTheGapsOverImageTextPage.steps.expandAdditonalSettings();
76
+ fillInTheGapsOverImageTextPage.steps.checkAllowStudentsToCheckAnswerCheckbox();
77
+ });
78
+
79
+ it('User should be able to check the \'Case sensitive\' checkbox and uncheck the \'Ignore spaces before and after\' checkbox', () => {
80
+ fillInTheGapsOverImageTextPage.steps.checkCaseSensitiveCheckbox();
81
+ fillInTheGapsOverImageTextPage.steps.uncheckIgnoreSpacesBeforeAndAfterCheckbox();
82
+ });
83
+
84
+ it('When the user attempts the question with different casing in the answer input field, then 0 points should be awarded and when user clicks on \'Check answer\' button, red cross mark should be displayed beside the incorrect response field and \'Incorrect answer\' label should be displayed below the question preview', () => {
85
+ cy.log('Pre-step: Switching to preview tab');
86
+ fillInTheGapsOverImageTextPage.steps.switchToPreviewTab();
87
+ fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldPreviewTab(0, 'marigold flower');
88
+ fillInTheGapsOverImageTextPage.steps.verifyPreviewTabScoreText(0, 10);
89
+ fillInTheGapsOverImageTextPage.steps.checkAnswer();
90
+ fillInTheGapsOverImageTextPage.steps.verifyIncorrectOptionCrossmarkIcon(0);
91
+ });
92
+
93
+ it('When the user attempts the question with identical casing in the answer input field, then full points should be awarded and when user clicks on \'Check answer\' button, green check mark should be displayed beside the correct response field and \'Correct answer\' label should be displayed below the question preview', () => {
94
+ fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldPreviewTab(0, 'Marigold flower');
95
+ fillInTheGapsOverImageTextPage.steps.verifyPreviewTabScoreText(10, 10);
96
+ fillInTheGapsOverImageTextPage.steps.checkAnswer();
97
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectOptionCheckmarkIcon(0);
98
+ });
99
+
100
+ it('When the user attempts the question with extra spaces in the answer input field, then 0 points should be awarded and when user clicks on \'Check answer\' button, red cross mark should be displayed beside the incorrect response field and \'Incorrect answer\' label should be displayed below the question preview', () => {
101
+ fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldPreviewTab(0, 'Marigold flower ');
102
+ fillInTheGapsOverImageTextPage.steps.verifyPreviewTabScoreText(0, 10);
103
+ fillInTheGapsOverImageTextPage.steps.checkAnswer();
104
+ fillInTheGapsOverImageTextPage.steps.verifyIncorrectOptionCrossmarkIcon(0);
105
+ });
106
+
107
+ it('When the user attempts the question with incorrect spelling in the answer input field, then 0 points should be awarded and when user clicks on \'Check answer\' button, red cross mark should be displayed beside the incorrect response field and \'Incorrect answer\' label should be displayed below the question preview', () => {
108
+ fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldPreviewTab(0, 'Marigold flowerr');
109
+ fillInTheGapsOverImageTextPage.steps.verifyPreviewTabScoreText(0, 10);
110
+ fillInTheGapsOverImageTextPage.steps.checkAnswer();
111
+ fillInTheGapsOverImageTextPage.steps.verifyIncorrectOptionCrossmarkIcon(0);
112
+ });
113
+ });
114
+
115
+ describe('Both \'Case sensitive\' and \'Ignore spaces before and after\' checkbox is unchecked', () => {
116
+ abortEarlySetup();
117
+ before(() => {
118
+ cy.log('Navigate to fill in the gaps over image - text question type');
119
+ fillInTheGapsOverImageTextPage.steps.navigateToCreateQuestion('fill in the gaps over image - text');
120
+ cy.barsPreLoaderWait();
121
+ fillInTheGapsOverImageTextPage.steps.uploadFile('highlightImage.jpg');
122
+ fillInTheGapsOverImageTextPage.steps.clickOnImagePopupOkButton();
123
+ fillInTheGapsOverImageTextPage.steps.addResponseContainer();
124
+ fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldSetCorrectAnswerSection(0, 'Marigold flower');
125
+ fillInTheGapsOverImageTextPage.steps.allotPoints(10);
126
+ fillInTheGapsOverImageTextPage.steps.expandAdditonalSettings();
127
+ fillInTheGapsOverImageTextPage.steps.checkAllowStudentsToCheckAnswerCheckbox();
128
+ fillInTheGapsOverImageTextPage.steps.uncheckIgnoreSpacesBeforeAndAfterCheckbox()
129
+ fillInTheGapsOverImageTextPage.steps.switchToPreviewTab();
130
+ });
131
+
132
+ it('When the user attempts the question with different casing in the answer input field, then full points should be awarded and when user clicks on \'Check answer\' button, green check mark should be displayed beside the correct response field and \'Correct answer\' label should be displayed below the question preview', () => {
133
+ fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldPreviewTab(0, 'marigold flower');
134
+ fillInTheGapsOverImageTextPage.steps.verifyPreviewTabScoreText(10, 10);
135
+ fillInTheGapsOverImageTextPage.steps.checkAnswer();
136
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectOptionCheckmarkIcon(0);
137
+ });
138
+
139
+ it('When the user attempts the question with identical casing in the answer input field, then full points should be awarded and when user clicks on \'Check answer\' button, green check mark should be displayed beside the correct response field and \'Correct answer\' label should be displayed below the question preview', () => {
140
+ fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldPreviewTab(0, 'Marigold flower');
141
+ fillInTheGapsOverImageTextPage.steps.verifyPreviewTabScoreText(10, 10);
142
+ fillInTheGapsOverImageTextPage.steps.checkAnswer();
143
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectOptionCheckmarkIcon(0);
144
+ });
145
+
146
+ it('When the user attempts the question with extra spaces in the answer input field, then 0 points should be awarded and when user clicks on \'Check answer\' button, red cross mark should be displayed beside the incorrect response field and \'Incorrect answer\' label should be displayed below the question preview', () => {
147
+ fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldPreviewTab(0, 'Marigold flower ');
148
+ fillInTheGapsOverImageTextPage.steps.verifyPreviewTabScoreText(0, 10);
149
+ fillInTheGapsOverImageTextPage.steps.checkAnswer();
150
+ fillInTheGapsOverImageTextPage.steps.verifyIncorrectOptionCrossmarkIcon(0);
151
+ });
152
+
153
+ it('When the user attempts the question with incorrect spelling in the answer input field, then 0 points should be awarded and when user clicks on \'Check answer\' button, red cross mark should be displayed beside the incorrect response field and \'Incorrect answer\' label should be displayed below the question preview', () => {
154
+ fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldPreviewTab(0, 'Marigold flowerr');
155
+ fillInTheGapsOverImageTextPage.steps.verifyPreviewTabScoreText(0, 10);
156
+ fillInTheGapsOverImageTextPage.steps.checkAnswer();
157
+ fillInTheGapsOverImageTextPage.steps.verifyIncorrectOptionCrossmarkIcon(0);
158
+ });
159
+ });
160
+
161
+ describe('Both \'Case sensitive\' and \'Ignore spaces before and after\' checkbox is checked', () => {
162
+ abortEarlySetup();
163
+ before(() => {
164
+ cy.log('Navigate to fill in the gaps over image - text question type');
165
+ fillInTheGapsOverImageTextPage.steps.navigateToCreateQuestion('fill in the gaps over image - text');
166
+ cy.barsPreLoaderWait();
167
+ fillInTheGapsOverImageTextPage.steps.uploadFile('highlightImage.jpg');
168
+ fillInTheGapsOverImageTextPage.steps.clickOnImagePopupOkButton();
169
+ fillInTheGapsOverImageTextPage.steps.addResponseContainer();
170
+ fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldSetCorrectAnswerSection(0, 'Marigold flower');
171
+ fillInTheGapsOverImageTextPage.steps.allotPoints(10);
172
+ fillInTheGapsOverImageTextPage.steps.checkCaseSensitiveCheckbox();
173
+ fillInTheGapsOverImageTextPage.steps.expandAdditonalSettings();
174
+ fillInTheGapsOverImageTextPage.steps.checkAllowStudentsToCheckAnswerCheckbox();
175
+ fillInTheGapsOverImageTextPage.steps.switchToPreviewTab();
176
+ });
177
+
178
+ it('When the user attempts the question with different casing in the answer input field, then 0 points should be awarded and when user clicks on \'Check answer\' button, red cross mark should be displayed beside the incorrect response field and \'Incorrect answer\' label should be displayed below the question preview', () => {
179
+ fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldPreviewTab(0, 'marigold flower');
180
+ fillInTheGapsOverImageTextPage.steps.verifyPreviewTabScoreText(0, 10);
181
+ fillInTheGapsOverImageTextPage.steps.checkAnswer();
182
+ fillInTheGapsOverImageTextPage.steps.verifyIncorrectOptionCrossmarkIcon(0);
183
+ });
184
+
185
+ it('When the user attempts the question with identical casing in the answer input field, then full points should be awarded and when user clicks on \'Check answer\' button, green check mark should be displayed beside the correct response field and \'Correct answer\' label should be displayed below the question preview', () => {
186
+ fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldPreviewTab(0, 'Marigold flower');
187
+ fillInTheGapsOverImageTextPage.steps.verifyPreviewTabScoreText(10, 10);
188
+ fillInTheGapsOverImageTextPage.steps.checkAnswer();
189
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectOptionCheckmarkIcon(0);
190
+ });
191
+
192
+ it('When the user attempts the question with extra spaces in the answer input field, then full points should be awarded and when user clicks on \'Check answer\' button, green check mark should be displayed beside the correct response field and \'Correct answer\' label should be displayed below the question preview', () => {
193
+ fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldPreviewTab(0, 'Marigold flower ');
194
+ fillInTheGapsOverImageTextPage.steps.verifyPreviewTabScoreText(10, 10);
195
+ fillInTheGapsOverImageTextPage.steps.checkAnswer();
196
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectOptionCheckmarkIcon(0);
197
+ });
198
+
199
+ it('When the user attempts the question with incorrect spelling in the answer input field, then 0 points should be awarded and when user clicks on \'Check answer\' button, red cross mark should be displayed beside the incorrect response field and \'Incorrect answer\' label should be displayed below the question preview', () => {
200
+ fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldPreviewTab(0, 'Marigold flowerr');
201
+ fillInTheGapsOverImageTextPage.steps.verifyPreviewTabScoreText(0, 10);
202
+ fillInTheGapsOverImageTextPage.steps.checkAnswer();
203
+ fillInTheGapsOverImageTextPage.steps.verifyIncorrectOptionCrossmarkIcon(0);
204
+ });
205
+ });
206
+
207
+ describe('Match from all responses - Edit tab cases for \'All or Nothing\' scoring type', () => {
208
+ abortEarlySetup();
209
+ before(() => {
210
+ cy.log('Navigate to fill in the gaps over image - text question type');
211
+ fillInTheGapsOverImageTextPage.steps.navigateToCreateQuestion('fill in the gaps over image - text');
212
+ cy.barsPreLoaderWait();
213
+ fillInTheGapsOverImageTextPage.steps.uploadFile('highlightImage.jpg');
214
+ fillInTheGapsOverImageTextPage.steps.clickOnImagePopupOkButton();
215
+ fillInTheGapsOverImageTextPage.steps.addResponseContainer();
216
+ fillInTheGapsOverImageTextPage.steps.addResponseContainer();
217
+ fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldSetCorrectAnswerSection(0, correctTabAnswerArray[0]);
218
+ fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldSetCorrectAnswerSection(1, correctTabAnswerArray[1]);
219
+ fillInTheGapsOverImageTextPage.steps.allotPoints(7);
220
+ });
221
+
222
+ it('When the user adds alternate answer and enables the \'Match from all responses\' functionality, the points field should be in disabled state and should have the value of points same as set in the \'Correct\' tab', () => {
223
+ fillInTheGapsOverImageTextPage.steps.addAlternateTab(1);
224
+ fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldSetCorrectAnswerSection(0, alternateTab1AnswerArray[0]);
225
+ fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldSetCorrectAnswerSection(1, alternateTab1AnswerArray[1]);
226
+ fillInTheGapsOverImageTextPage.steps.allotPoints(10);
227
+ fillInTheGapsOverImageTextPage.steps.checkMatchFromAllResponsesCheckbox();
228
+ fillInTheGapsOverImageTextPage.steps.verifyPointsInAlternateTabWhenMatchFromAllResponsesIsChecked(0, 7);
229
+ });
230
+
231
+ it('When the user adds another tab, the new alternate answer tab should also have the same point value as the \'Correct\' tab', () => {
232
+ fillInTheGapsOverImageTextPage.steps.addAlternateTab(2);
233
+ fillInTheGapsOverImageTextPage.steps.verifyPointsInAlternateTabWhenMatchFromAllResponsesIsChecked(0, 7);
234
+ });
235
+
236
+ it('When the user has already set different points in the alternate answer tab and then enables the \'Match from all responses\' functionality, the points field in the \'Alternate\' tab should get disabled and should have the value of points same as set in the \'Correct\' tab', () => {
237
+ cy.log('Pre:step - unchecking the \'Match from all responses\' checkbox and updating the points')
238
+ fillInTheGapsOverImageTextPage.steps.uncheckMatchFromAllResponsesCheckbox();
239
+ fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldSetCorrectAnswerSection(0, alternateTab2AnswerArray[0]);
240
+ fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldSetCorrectAnswerSection(1, alternateTab2AnswerArray[1]);
241
+ fillInTheGapsOverImageTextPage.steps.allotPoints(20);
242
+ fillInTheGapsOverImageTextPage.steps.checkMatchFromAllResponsesCheckbox();
243
+ fillInTheGapsOverImageTextPage.steps.verifyPointsInAlternateTabWhenMatchFromAllResponsesIsChecked(0, 7);
244
+ });
245
+
246
+ it('When the user disables the \'Match from all responses\' functionality, the score should go back to their previously set values', () => {
247
+ fillInTheGapsOverImageTextPage.steps.uncheckMatchFromAllResponsesCheckbox();
248
+ fillInTheGapsOverImageTextPage.steps.verifyPointsFieldValue(20);
249
+ fillInTheGapsOverImageTextPage.steps.switchToCorrectTab();
250
+ fillInTheGapsOverImageTextPage.steps.verifyPointsFieldValue(7);
251
+ });
252
+ });
253
+
254
+ describe('Match from all responses - Edit tab cases for \'Partial - equal weights\' scoring type', () => {
255
+ abortEarlySetup();
256
+ before(() => {
257
+ cy.log('Navigate to fill in the gaps over image - text question type');
258
+ fillInTheGapsOverImageTextPage.steps.navigateToCreateQuestion('fill in the gaps over image - text');
259
+ cy.barsPreLoaderWait();
260
+ fillInTheGapsOverImageTextPage.steps.uploadFile('highlightImage.jpg');
261
+ fillInTheGapsOverImageTextPage.steps.clickOnImagePopupOkButton();
262
+ fillInTheGapsOverImageTextPage.steps.addResponseContainer();
263
+ fillInTheGapsOverImageTextPage.steps.addResponseContainer();
264
+ fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldSetCorrectAnswerSection(0, correctTabAnswerArray[0]);
265
+ fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldSetCorrectAnswerSection(1, correctTabAnswerArray[1]);
266
+ fillInTheGapsOverImageTextPage.steps.allotPoints(7);
267
+ fillInTheGapsOverImageTextPage.steps.selectPartialEqualWeightsCheckbox();
268
+ });
269
+
270
+ it('When the user adds alternate answer and enables the \'Match from all responses\' functionality, the points field should be in disabled state and should have the value of points same as set in the \'Correct\' tab', () => {
271
+ fillInTheGapsOverImageTextPage.steps.addAlternateTab(1);
272
+ fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldSetCorrectAnswerSection(0, alternateTab1AnswerArray[0]);
273
+ fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldSetCorrectAnswerSection(1, alternateTab1AnswerArray[1]);
274
+ fillInTheGapsOverImageTextPage.steps.allotPoints(10);
275
+ fillInTheGapsOverImageTextPage.steps.checkMatchFromAllResponsesCheckbox();
276
+ fillInTheGapsOverImageTextPage.steps.verifyPointsInAlternateTabWhenMatchFromAllResponsesIsChecked(0, 7);
277
+ fillInTheGapsOverImageTextPage.steps.verifyPartialEqualWeightsPointsPerResponseScore(3.5);
278
+ });
279
+
280
+ it('When the user adds another tab, the new alternate answer tab should also have the same point value as the \'Correct\' tab', () => {
281
+ fillInTheGapsOverImageTextPage.steps.addAlternateTab(2);
282
+ fillInTheGapsOverImageTextPage.steps.verifyPointsInAlternateTabWhenMatchFromAllResponsesIsChecked(0, 7);
283
+ fillInTheGapsOverImageTextPage.steps.verifyPartialEqualWeightsPointsPerResponseScore(3.5);
284
+ });
285
+
286
+ it('When the user has already set different points in the alternate answer tab and then enables the \'Match from all responses\' functionality, the points field in the \'Alternate\' tab should get disabled and should have the value of points same as set in the \'Correct\' tab', () => {
287
+ cy.log('Pre:step - unchecking the \'Match from all responses\' checkbox and updating the points')
288
+ fillInTheGapsOverImageTextPage.steps.uncheckMatchFromAllResponsesCheckbox();
289
+ fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldSetCorrectAnswerSection(0, alternateTab2AnswerArray[0]);
290
+ fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldSetCorrectAnswerSection(1, alternateTab2AnswerArray[1]);
291
+ fillInTheGapsOverImageTextPage.steps.allotPoints(20);
292
+ fillInTheGapsOverImageTextPage.steps.checkMatchFromAllResponsesCheckbox();
293
+ fillInTheGapsOverImageTextPage.steps.verifyPointsInAlternateTabWhenMatchFromAllResponsesIsChecked(0, 7);
294
+ fillInTheGapsOverImageTextPage.steps.verifyPartialEqualWeightsPointsPerResponseScore(3.5);
295
+ });
296
+
297
+ it('When the user disables the \'Match from all responses\' functionality, the score should go back to their previously set values', () => {
298
+ fillInTheGapsOverImageTextPage.steps.uncheckMatchFromAllResponsesCheckbox();
299
+ fillInTheGapsOverImageTextPage.steps.verifyPointsFieldValue(20);
300
+ fillInTheGapsOverImageTextPage.steps.verifyPartialEqualWeightsPointsPerResponseScore(10);
301
+ fillInTheGapsOverImageTextPage.steps.switchToCorrectTab();
302
+ fillInTheGapsOverImageTextPage.steps.verifyPointsFieldValue(7);
303
+ fillInTheGapsOverImageTextPage.steps.verifyPartialEqualWeightsPointsPerResponseScore(3.5);
304
+ });
305
+ });
306
+
307
+ describe('Match from all responses - Edit tab cases for \'Partial - different weights\' scoring type', () => {
308
+ abortEarlySetup();
309
+ before(() => {
310
+ cy.log('Navigate to fill in the gaps over image - text question type');
311
+ fillInTheGapsOverImageTextPage.steps.navigateToCreateQuestion('fill in the gaps over image - text');
312
+ cy.barsPreLoaderWait();
313
+ fillInTheGapsOverImageTextPage.steps.uploadFile('highlightImage.jpg');
314
+ fillInTheGapsOverImageTextPage.steps.clickOnImagePopupOkButton();
315
+ fillInTheGapsOverImageTextPage.steps.addResponseContainer();
316
+ fillInTheGapsOverImageTextPage.steps.addResponseContainer();
317
+ fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldSetCorrectAnswerSection(0, correctTabAnswerArray[0]);
318
+ fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldSetCorrectAnswerSection(1, correctTabAnswerArray[1]);
319
+ fillInTheGapsOverImageTextPage.steps.selectPartialDifferentWeightsCheckbox();
320
+ fillInTheGapsOverImageTextPage.steps.addPartialDifferentWeightsPoints([1, 7]);
321
+ });
322
+
323
+ it('When the user adds alternate answer and enables the \'Match from all responses\' functionality, the points field should be in disabled state and should have the value of points same as set in the \'Correct\' tab', () => {
324
+ fillInTheGapsOverImageTextPage.steps.addAlternateTab(1);
325
+ fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldSetCorrectAnswerSection(0, alternateTab1AnswerArray[0]);
326
+ fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldSetCorrectAnswerSection(1, alternateTab1AnswerArray[1]);
327
+ fillInTheGapsOverImageTextPage.steps.addPartialDifferentWeightsPoints([2, 8]);
328
+ fillInTheGapsOverImageTextPage.steps.checkMatchFromAllResponsesCheckbox();
329
+ fillInTheGapsOverImageTextPage.steps.verifyPointsInAlternateTabWhenMatchFromAllResponsesIsChecked(0, 1);
330
+ fillInTheGapsOverImageTextPage.steps.verifyPointsInAlternateTabWhenMatchFromAllResponsesIsChecked(1, 7);
331
+ });
332
+
333
+ it('When the user adds another tab, the new alternate answer tab should also have the same point value as the \'Correct\' tab', () => {
334
+ fillInTheGapsOverImageTextPage.steps.addAlternateTab(2);
335
+ fillInTheGapsOverImageTextPage.steps.verifyPointsInAlternateTabWhenMatchFromAllResponsesIsChecked(0, 1);
336
+ fillInTheGapsOverImageTextPage.steps.verifyPointsInAlternateTabWhenMatchFromAllResponsesIsChecked(1, 7);
337
+ });
338
+
339
+ it('When the user has already set different points in the alternate answer tab and then enables the \'Match from all responses\' functionality, the points field in the \'Alternate\' tab should get disabled and should have the value of points same as set in the \'Correct\' tab', () => {
340
+ cy.log('Pre:step - unchecking the \'Match from all responses\' checkbox and updating the points')
341
+ fillInTheGapsOverImageTextPage.steps.uncheckMatchFromAllResponsesCheckbox();
342
+ fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldSetCorrectAnswerSection(0, alternateTab2AnswerArray[0]);
343
+ fillInTheGapsOverImageTextPage.steps.enterTextInResponseFieldSetCorrectAnswerSection(1, alternateTab2AnswerArray[1]);
344
+ fillInTheGapsOverImageTextPage.steps.addPartialDifferentWeightsPoints([3, 10]);
345
+ fillInTheGapsOverImageTextPage.steps.checkMatchFromAllResponsesCheckbox();
346
+ fillInTheGapsOverImageTextPage.steps.verifyPointsInAlternateTabWhenMatchFromAllResponsesIsChecked(0, 1);
347
+ fillInTheGapsOverImageTextPage.steps.verifyPointsInAlternateTabWhenMatchFromAllResponsesIsChecked(1, 7);
348
+ });
349
+
350
+ it('When the user disables the \'Match from all responses\' functionality, the score should go back to their previously set values', () => {
351
+ fillInTheGapsOverImageTextPage.steps.uncheckMatchFromAllResponsesCheckbox();
352
+ fillInTheGapsOverImageTextPage.steps.verifyPartialDifferentWeightsPointsInputFieldValue([3, 10]);
353
+ fillInTheGapsOverImageTextPage.steps.switchToCorrectTab();
354
+ fillInTheGapsOverImageTextPage.steps.verifyPartialDifferentWeightsPointsInputFieldValue([1, 7]);
355
+ });
356
+ });
357
+ });
@@ -0,0 +1,134 @@
1
+ import { fillInTheGapsOverImageTextPage } 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 page - Fill in the gaps over image - text: Edit aria-label checkbox', () => {
7
+ before(() => {
8
+ cy.loginAs('admin');
9
+ });
10
+
11
+ describe('Edit aria-label in edit tab', () => {
12
+ abortEarlySetup();
13
+ before(() => {
14
+ cy.log('Navigate to fill in the gaps over image - text question type');
15
+ fillInTheGapsOverImageTextPage.steps.navigateToCreateQuestion('fill in the gaps over image - text');
16
+ cy.barsPreLoaderWait();
17
+ fillInTheGapsOverImageTextPage.steps.addQuestionInstructions();
18
+ fillInTheGapsOverImageTextPage.steps.uploadFile('highlightImage.jpg');
19
+ fillInTheGapsOverImageTextPage.steps.clickOnImagePopupOkButton();
20
+ });
21
+
22
+ it('When the user uploads an image in image section, then \'Edit aria-labels for response containers\' checkbox and label should be displayed in the image properties in disabled state', () => {
23
+ fillInTheGapsOverImageTextPage.steps.verifyDisabledStateOfEditAriaLabelsForResponseContainersCheckbox();
24
+ });
25
+
26
+ it('When the user adds a response container in the image, then \'Edit aria-labels for response containers\' checkbox should be enabled and by default it should be unchecked', () => {
27
+ fillInTheGapsOverImageTextPage.steps.addResponseContainer();
28
+ fillInTheGapsOverImageTextPage.steps.verifyDefaultEnabledStateOfEditAriaLabelsForResponseContainersCheckbox();
29
+ });
30
+
31
+ it('CSS of \'Edit aria-labels for response containers\' label', { tags: 'css' }, () => {
32
+ utilities.verifyCSS(fillInTheGapsOverImageTextPage.editAriaLabelForResponseContainersLabel(), {
33
+ 'color': css.color.labelText,
34
+ 'font-size': css.fontSize.normal,
35
+ 'font-weight': css.fontWeight.regular
36
+ });
37
+ });
38
+
39
+ it('Accessibility of \'Edit aria-labels for response containers\' checkbox', { tags: 'a11y' }, () => {
40
+ cy.checkAccessibility(fillInTheGapsOverImageTextPage.editAriaLabelForResponseContainersCheckbox());
41
+ });
42
+
43
+ it('When the user checks the \'Edit aria-labels for response containers\' checkbox, then a label \'ARIA labels\' and an input field with numeration and placeholder text \'Enter label\' should be displayed', () => {
44
+ fillInTheGapsOverImageTextPage.steps.checkEditAriaLabelCheckbox();
45
+ utilities.verifyElementVisibilityState(fillInTheGapsOverImageTextPage.ariaLabelsLabel(), 'exist');
46
+ utilities.verifyInnerText(fillInTheGapsOverImageTextPage.ariaLabelsLabel(), 'ARIA labels');
47
+ fillInTheGapsOverImageTextPage.steps.verifyEditAriaLabelInputFieldContents(1);
48
+ });
49
+
50
+ //Failing due to https://redmine.zeuslearning.com/issues/547543
51
+ it('CSS of \'ARIA labels\' label and input fields', { tags: 'css' }, () => {
52
+ utilities.verifyCSS(fillInTheGapsOverImageTextPage.ariaLabelsLabel(), {
53
+ 'color': css.color.labels,
54
+ 'font-size': css.fontSize.normal,
55
+ 'font-weight': css.fontWeight.semibold
56
+ });
57
+ utilities.verifyCSS(fillInTheGapsOverImageTextPage.ariaLabelsInputFieldNumeration(), {
58
+ 'color': css.color.labels,
59
+ 'font-size': css.fontSize.default,
60
+ 'font-weight': css.fontWeight.semibold
61
+ });
62
+ utilities.verifyCSS(fillInTheGapsOverImageTextPage.ariaLabelsInputField(), {
63
+ 'color': css.color.text,
64
+ 'font-size': css.fontSize.default,
65
+ 'font-weight': css.fontWeight.regular
66
+ });
67
+ });
68
+
69
+ it('Accessibility of \'ARIA labels\' input fields', { tags: 'a11y' }, () => {
70
+ cy.checkAccessibility(fillInTheGapsOverImageTextPage.ariaLabelsInputField());
71
+ });
72
+
73
+ it('When the user adds another response container to the uploaded image, a input field should be added in the \'Edit aria-labels for response container section\' with the numeration \'2\'', () => {
74
+ fillInTheGapsOverImageTextPage.steps.addResponseContainer();
75
+ fillInTheGapsOverImageTextPage.steps.verifyEditAriaLabelInputFieldContents(2);
76
+ });
77
+
78
+ it('When the user removes a response container from the uploaded image, the edit aria-label response field corresponding to the removed response container should not be displayed and the remaining edit aria-label input field should be displayed with updated numeration', () => {
79
+ fillInTheGapsOverImageTextPage.steps.clickOnResponseContainerCloseButton(0);
80
+ fillInTheGapsOverImageTextPage.steps.verifyEditAriaLabelInputFieldContents(1);
81
+ });
82
+
83
+ //Failing due to - https://redmine.zeuslearning.com/issues/547533
84
+ it('When the user has not given any input to the edit aria-label input field, the aria-label attribute for response container in image section and aria-label attribute for response field in set correct answer section should be \'Add answer for Response #\'', () => {
85
+ fillInTheGapsOverImageTextPage.steps.verifyResponseContainerAriaLabelAttribute(0, 'Add answer for Response 1');
86
+ fillInTheGapsOverImageTextPage.steps.verifyResponseFieldAriaLabelAttributeInSetCorrectAnswerSection(0, 'Add answer for Response 1');
87
+ });
88
+
89
+ it('When the user enters text in the edit aria-label input field, the added text should appear as the aria-label attribute of the response container in the uploaded image and response field in the set correct answer section', () => {
90
+ fillInTheGapsOverImageTextPage.steps.enterTextInEditAriaLabelInputField(0, 'Custom aria-label');
91
+ fillInTheGapsOverImageTextPage.steps.verifyResponseContainerAriaLabelAttribute(0, 'Custom aria-label');
92
+ fillInTheGapsOverImageTextPage.steps.verifyResponseFieldAriaLabelAttributeInSetCorrectAnswerSection(0, 'Custom aria-label');
93
+ });
94
+
95
+ it('When the user clears the text in the edit aria-label input field, the aria-label attribute of the response container in the uploaded image and aria-label attribute of the response field in the set correct answer section should again appear as \'Add answer for Response #\'', () => {
96
+ fillInTheGapsOverImageTextPage.steps.clearEditAriaLabelInputField(0);
97
+ fillInTheGapsOverImageTextPage.steps.verifyResponseContainerAriaLabelAttribute(0, 'Add answer for Response 1');
98
+ fillInTheGapsOverImageTextPage.steps.verifyResponseFieldAriaLabelAttributeInSetCorrectAnswerSection(0, 'Add answer for Response 1');
99
+ });
100
+ });
101
+
102
+ describe('Edit aria-label in preview tab', () => {
103
+ abortEarlySetup();
104
+ before(() => {
105
+ cy.log('Navigate to fill in the gaps over image - text question type');
106
+ fillInTheGapsOverImageTextPage.steps.navigateToCreateQuestion('fill in the gaps over image - text');
107
+ cy.barsPreLoaderWait();
108
+ fillInTheGapsOverImageTextPage.steps.addQuestionInstructions();
109
+ fillInTheGapsOverImageTextPage.steps.uploadFile('highlightImage.jpg');
110
+ fillInTheGapsOverImageTextPage.steps.clickOnImagePopupOkButton();
111
+ fillInTheGapsOverImageTextPage.steps.addResponseContainer();
112
+ fillInTheGapsOverImageTextPage.steps.switchToPreviewTab();
113
+ });
114
+
115
+ it('When the user has not given any input to the edit aria-label input field, the aria-label attribute for response field in preview tab should be \'Add answer for Response #\'', () => {
116
+ fillInTheGapsOverImageTextPage.steps.verifyResponseFieldAriaLabelAttributeInPreviewTab(0, 'Add answer for Response 1');
117
+ });
118
+
119
+ it('When the user enters text in the edit aria-label input field, the added text should appear as the aria-label attribute of the response field in preview tab', () => {
120
+ fillInTheGapsOverImageTextPage.steps.switchToEditTab();
121
+ fillInTheGapsOverImageTextPage.steps.checkEditAriaLabelCheckbox();
122
+ fillInTheGapsOverImageTextPage.steps.enterTextInEditAriaLabelInputField(0, 'Custom aria-label');
123
+ fillInTheGapsOverImageTextPage.steps.switchToPreviewTab();
124
+ fillInTheGapsOverImageTextPage.steps.verifyResponseFieldAriaLabelAttributeInPreviewTab(0, 'Custom aria-label');
125
+ });
126
+
127
+ it('When the user clears the text in the edit aria-label input field, the aria-label attribute of the response field in preview tab should again appear as \'Add answer for Response #\'', () => {
128
+ fillInTheGapsOverImageTextPage.steps.switchToEditTab();
129
+ fillInTheGapsOverImageTextPage.steps.clearEditAriaLabelInputField(0);
130
+ fillInTheGapsOverImageTextPage.steps.switchToPreviewTab();
131
+ fillInTheGapsOverImageTextPage.steps.verifyResponseFieldAriaLabelAttributeInPreviewTab(0, 'Add answer for Response 1');
132
+ });
133
+ });
134
+ });