itemengine-cypress-automation 1.0.89 → 1.0.91

Sign up to get free protection for your applications and to get access to all the features.
Files changed (31) hide show
  1. package/cypress/e2e/ILC/Desmos/desmosGeometryToolPreviewContents.smoke.js +1 -1
  2. package/cypress/e2e/ILC/DrawingResponse/drawingResponseGradingViewAndCorrectAnswerViewContents.smoke.js +3 -3
  3. package/cypress/e2e/ILC/EssayResponse/essayResponseEquationEditor.smoke.js +418 -0
  4. package/cypress/e2e/ILC/EssayResponse/previewContentsForAllViews.smoke.js +1 -1
  5. package/cypress/e2e/ILC/EssayResponseBasic/gradingViewAndCorrectAnswerViewContents.smoke.js +1 -1
  6. package/cypress/e2e/ILC/EssayResponseBasic/previewContentsForAllViews.smoke.js +1 -1
  7. package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/previewContentsForAllViews.smoke.js +0 -1
  8. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/HeaderSection.js +79 -0
  9. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/Scoring/conditionalCheckboxScoring.js +335 -0
  10. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/editTabScoringSection.js +64 -1
  11. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/setLimitSection.js +334 -0
  12. package/cypress/e2e/ILC/ReadingRuler/readingRulerEditTabBasicsSection.js +180 -0
  13. package/cypress/e2e/ILC/ReadingRuler/readingRulerHeaderSection.js +55 -0
  14. package/cypress/e2e/ILC/ReadingRuler/readingRulerPreviewTab.js +257 -0
  15. package/cypress/e2e/ILC/ReadingRuler/readingrulerPreviewContents.smoke.js +68 -0
  16. package/cypress/e2e/ILC/TextEntryMath/evaluationMethodsWithoutSetResponse.js +773 -0
  17. package/cypress/e2e/ILC/TextEntryMath/responseEvaluationMethodsAndCustomSettings.js +1 -1
  18. package/cypress/fixtures/equationEditorCategoriesAndSymbols .js +50 -50
  19. package/cypress/fixtures/theme/ilc.json +1 -1
  20. package/cypress/pages/components/commonComponents.js +1 -1
  21. package/cypress/pages/components/desmosToolComponent.js +1 -1
  22. package/cypress/pages/components/equationEditorFlyout.js +118 -7
  23. package/cypress/pages/components/essayResponseCommonComponents.js +26 -1
  24. package/cypress/pages/components/figOverImageCanvasComponent.js +1 -1
  25. package/cypress/pages/drawingResponsePage.js +1 -1
  26. package/cypress/pages/essayResponsePage.js +106 -1
  27. package/cypress/pages/fillInTheGapsOverImageTextPage.js +270 -8
  28. package/cypress/pages/readingRulerPage.js +64 -5
  29. package/cypress/pages/textEntryMathPage.js +112 -8
  30. package/deploy/e2e/deploy.yaml +2 -2
  31. package/package.json +1 -1
@@ -0,0 +1,335 @@
1
+ import { fillInTheGapsOverImageTextPage } from "../../../../pages";
2
+ import abortEarlySetup from "../../../../support/helpers/abortEarly";
3
+
4
+ describe('Fill In the gaps over image - text \'Correct response condition\' checkboxes', () => {
5
+ before(() => {
6
+ cy.loginAs('admin');
7
+ });
8
+
9
+ describe('\'Case sensitive\' checkbox', () => {
10
+ abortEarlySetup();
11
+ before(() => {
12
+ fillInTheGapsOverImageTextPage.steps.navigateToCreateQuestion('fill in the gaps over image with text');
13
+ cy.barsPreLoaderWait();
14
+ fillInTheGapsOverImageTextPage.steps.uploadFile('highlightImage.jpg');
15
+ fillInTheGapsOverImageTextPage.steps.verifyImageIsUploaded();
16
+ fillInTheGapsOverImageTextPage.steps.insertResponseArea(10);
17
+ fillInTheGapsOverImageTextPage.steps.allotPoints(10);
18
+ fillInTheGapsOverImageTextPage.steps.enterTextInAnswerInputFieldsSpecifyCorrectAnswerSection([{ responseIndex: 0, responseText: 'Flower is displayed' }]);
19
+ fillInTheGapsOverImageTextPage.steps.checkAllowStudentToCheckAnswerCheckbox();
20
+ fillInTheGapsOverImageTextPage.steps.switchToPreviewTab();
21
+ });
22
+
23
+ it('When all conditional checkboxes are unchecked and user attempts the question with incorrect casing then full points should be awarded and when user clicks on \'Check answer\' button, green check mark beside the correct response field and a status message with text \'Your answer is correct\' should be displayed', () => {
24
+ fillInTheGapsOverImageTextPage.steps.enterTextInAnswerInputFieldsPreviewTab([{ responseIndex: 0, responseText: 'floWer is diSplayed' }]);
25
+ fillInTheGapsOverImageTextPage.steps.verifyPreviewScore(10, 10);
26
+ fillInTheGapsOverImageTextPage.steps.checkAnswer();
27
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectOptionIcon(0);
28
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectIncorrectAnswerLabel('correct');
29
+ });
30
+
31
+ it('When only \'Case sensitive\' checkbox is checked and user attempts the question with incorrect casing then zero points should be awarded and when user clicks on \'Check answer\' button, red cross mark beside the response field and a status message with text \'Your answer is incorrect\' should be displayed', () => {
32
+ fillInTheGapsOverImageTextPage.steps.switchToEditTab();
33
+ fillInTheGapsOverImageTextPage.steps.checkConditionalCheckbox('Case sensitive');
34
+ fillInTheGapsOverImageTextPage.steps.switchToPreviewTab();
35
+ fillInTheGapsOverImageTextPage.steps.enterTextInAnswerInputFieldsPreviewTab([{ responseIndex: 0, responseText: 'flower is Displayed' }]);
36
+ fillInTheGapsOverImageTextPage.steps.verifyPreviewScore(0, 10);
37
+ fillInTheGapsOverImageTextPage.steps.checkAnswer();
38
+ fillInTheGapsOverImageTextPage.steps.verifyIncorrectOptionIcon(0);
39
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
40
+ });
41
+
42
+ it('When only \'Case sensitive\' checkbox is checked and user attempts the question with correct casing then full points should be awarded and when user clicks on \'Check answer\' button, green check mark beside the correct response field and a status message with text \'Your answer is correct\' should be displayed', () => {
43
+ fillInTheGapsOverImageTextPage.steps.resetQuestionPreview();
44
+ fillInTheGapsOverImageTextPage.steps.enterTextInAnswerInputFieldsPreviewTab([{ responseIndex: 0, responseText: 'Flower is displayed' }]);
45
+ fillInTheGapsOverImageTextPage.steps.verifyPreviewScore(10, 10);
46
+ fillInTheGapsOverImageTextPage.steps.checkAnswer();
47
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectOptionIcon(0);
48
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectIncorrectAnswerLabel('correct');
49
+ });
50
+
51
+ it('When only \'Case sensitive\' and \'Validate if answer is included in the response\' checkboxes are checked and user attempts the question with a sentence which includes the answer with incorrect casing then zero points should be awarded and when user clicks on \'Check answer\' button, red cross mark beside the response field and a status message with text \'Your answer is incorrect\' should be displayed', () => {
52
+ fillInTheGapsOverImageTextPage.steps.switchToEditTab();
53
+ fillInTheGapsOverImageTextPage.steps.checkConditionalCheckbox('Validate if answer is included in the response');
54
+ fillInTheGapsOverImageTextPage.steps.switchToPreviewTab();
55
+ fillInTheGapsOverImageTextPage.steps.enterTextInAnswerInputFieldsPreviewTab([{ responseIndex: 0, responseText: 'flower is Displayed in this image' }]);
56
+ fillInTheGapsOverImageTextPage.steps.verifyPreviewScore(0, 10);
57
+ fillInTheGapsOverImageTextPage.steps.checkAnswer();
58
+ fillInTheGapsOverImageTextPage.steps.verifyIncorrectOptionIcon(0);
59
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
60
+ });
61
+
62
+ it('When only \'Case sensitive\' and \'Validate if answer is included in the response\' checkboxes are checked and user attempts the question with a sentence which does not include the answer but with correct casing then zero points should be awarded and when user clicks on \'Check answer\' button, red cross mark beside the response field and a status message with text \'Your answer is incorrect\' should be displayed', () => {
63
+ fillInTheGapsOverImageTextPage.steps.resetQuestionPreview();
64
+ fillInTheGapsOverImageTextPage.steps.enterTextInAnswerInputFieldsPreviewTab([{ responseIndex: 0, responseText: 'This image has Flower' }]);
65
+ fillInTheGapsOverImageTextPage.steps.verifyPreviewScore(0, 10);
66
+ fillInTheGapsOverImageTextPage.steps.checkAnswer();
67
+ fillInTheGapsOverImageTextPage.steps.verifyIncorrectOptionIcon(0);
68
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
69
+ });
70
+
71
+ it('When only \'Case sensitive\' and \'Validate if answer is included in the response\' checkboxes are checked and user attempts the question with a sentence which includes the answer with correct casing then full points should be awarded and when user clicks on \'Check answer\' button, green check mark beside the correct response field and a status message with text \'Your answer is correct\' should be displayed', () => {
72
+ fillInTheGapsOverImageTextPage.steps.resetQuestionPreview();
73
+ fillInTheGapsOverImageTextPage.steps.enterTextInAnswerInputFieldsPreviewTab([{ responseIndex: 0, responseText: 'Flower is displayed in this image' }]);
74
+ fillInTheGapsOverImageTextPage.steps.verifyPreviewScore(10, 10);
75
+ fillInTheGapsOverImageTextPage.steps.checkAnswer();
76
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectOptionIcon(0);
77
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectIncorrectAnswerLabel('correct');
78
+ });
79
+
80
+ it('When only \'Case sensitive\' and \'Ignore extra spaces\' checkboxes are checked and user attempts the question with answer having extra spaces and incorrect casing then zero points should be awarded and when user clicks on \'Check answer\' button, red cross mark beside the response field and a status message with text \'Your answer is incorrect\' should be displayed', () => {
81
+ fillInTheGapsOverImageTextPage.steps.switchToEditTab();
82
+ fillInTheGapsOverImageTextPage.steps.uncheckConditionalCheckbox('Validate if answer is included in the response');
83
+ fillInTheGapsOverImageTextPage.steps.checkConditionalCheckbox('Ignore extra spaces');
84
+ fillInTheGapsOverImageTextPage.steps.switchToPreviewTab();
85
+ fillInTheGapsOverImageTextPage.steps.enterTextInAnswerInputFieldsPreviewTab([{ responseIndex: 0, responseText: ' flower is Displayed ' }]);
86
+ fillInTheGapsOverImageTextPage.steps.verifyPreviewScore(0, 10);
87
+ fillInTheGapsOverImageTextPage.steps.checkAnswer();
88
+ fillInTheGapsOverImageTextPage.steps.verifyIncorrectOptionIcon(0);
89
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
90
+ });
91
+
92
+ it('When only \'Case sensitive\' and \'Ignore extra spaces\' checkboxes are checked and user attempts the question with answer having extra spaces in between answer and with correct casing then zero points should be awarded and when user clicks on \'Check answer\' button, red cross mark beside the response field and a status message with text \'Your answer is incorrect\' should be displayed', () => {
93
+ fillInTheGapsOverImageTextPage.steps.resetQuestionPreview();
94
+ fillInTheGapsOverImageTextPage.steps.enterTextInAnswerInputFieldsPreviewTab([{ responseIndex: 0, responseText: 'Flo wer is displayed' }]);
95
+ fillInTheGapsOverImageTextPage.steps.verifyPreviewScore(0, 10);
96
+ fillInTheGapsOverImageTextPage.steps.checkAnswer();
97
+ fillInTheGapsOverImageTextPage.steps.verifyIncorrectOptionIcon(0);
98
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
99
+ });
100
+
101
+ it('When only \'Case sensitive\' and \'Ignore extra spaces\' checkboxes are checked and user attempts the question with answer having extra spaces and correct casing then full points should be awarded and when user clicks on \'Check answer\' button, green check mark beside the correct response field and a status message with text \'Your answer is correct\' should be displayed', () => {
102
+ fillInTheGapsOverImageTextPage.steps.resetQuestionPreview();
103
+ fillInTheGapsOverImageTextPage.steps.enterTextInAnswerInputFieldsPreviewTab([{ responseIndex: 0, responseText: ' Flower is displayed ' }]);
104
+ fillInTheGapsOverImageTextPage.steps.verifyPreviewScore(10, 10);
105
+ fillInTheGapsOverImageTextPage.steps.checkAnswer();
106
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectOptionIcon(0);
107
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectIncorrectAnswerLabel('correct');
108
+ });
109
+
110
+ it('When only \'Case sensitive\' and \'Ignore single letter mistake\' checkboxes are checked and user attempts the question with answer having single letter mistake and incorrect casing then zero points should be awarded and when user clicks on \'Check answer\' button, red cross mark beside the response field and a status message with text \'Your answer is incorrect\' should be displayed', () => {
111
+ fillInTheGapsOverImageTextPage.steps.switchToEditTab();
112
+ fillInTheGapsOverImageTextPage.steps.uncheckConditionalCheckbox('Ignore extra spaces');
113
+ fillInTheGapsOverImageTextPage.steps.checkConditionalCheckbox('Ignore single letter mistake');
114
+ fillInTheGapsOverImageTextPage.steps.switchToPreviewTab();
115
+ fillInTheGapsOverImageTextPage.steps.enterTextInAnswerInputFieldsPreviewTab([{ responseIndex: 0, responseText: 'flower is Displayes' }]);
116
+ fillInTheGapsOverImageTextPage.steps.verifyPreviewScore(0, 10);
117
+ fillInTheGapsOverImageTextPage.steps.checkAnswer();
118
+ fillInTheGapsOverImageTextPage.steps.verifyIncorrectOptionIcon(0);
119
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
120
+ });
121
+
122
+ it('When only \'Case sensitive\' and \'Ignore single letter mistake\' checkboxes are checked and user attempts the question with answer having multiple letter mistake and correct casing then zero points should be awarded and when user clicks on \'Check answer\' button, red cross mark beside the response field and a status message with text \'Your answer is incorrect\' should be displayed', () => {
123
+ fillInTheGapsOverImageTextPage.steps.resetQuestionPreview();
124
+ fillInTheGapsOverImageTextPage.steps.enterTextInAnswerInputFieldsPreviewTab([{ responseIndex: 0, responseText: 'Flowrr is displayes' }]);
125
+ fillInTheGapsOverImageTextPage.steps.verifyPreviewScore(0, 10);
126
+ fillInTheGapsOverImageTextPage.steps.checkAnswer();
127
+ fillInTheGapsOverImageTextPage.steps.verifyIncorrectOptionIcon(0);
128
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
129
+ });
130
+
131
+ it('When only \'Case sensitive\' and \'Ignore single letter mistake\' checkboxes are checked and user attempts the question with answer having single letter mistake and correct casing then full points should be awarded and when user clicks on \'Check answer\' button, green check mark beside the correct response field and a status message with text \'Your answer is correct\' should be displayed', () => {
132
+ fillInTheGapsOverImageTextPage.steps.resetQuestionPreview();
133
+ fillInTheGapsOverImageTextPage.steps.enterTextInAnswerInputFieldsPreviewTab([{ responseIndex: 0, responseText: 'Flower is displayes' }]);
134
+ fillInTheGapsOverImageTextPage.steps.verifyPreviewScore(10, 10);
135
+ fillInTheGapsOverImageTextPage.steps.checkAnswer();
136
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectOptionIcon(0);
137
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectIncorrectAnswerLabel('correct');
138
+ });
139
+ });
140
+
141
+ describe('\'Validate if answer is included in the response\' checkbox', () => {
142
+ abortEarlySetup();
143
+ before(() => {
144
+ fillInTheGapsOverImageTextPage.steps.navigateToCreateQuestion('fill in the gaps over image with text');
145
+ cy.barsPreLoaderWait();
146
+ fillInTheGapsOverImageTextPage.steps.uploadFile('highlightImage.jpg');
147
+ fillInTheGapsOverImageTextPage.steps.verifyImageIsUploaded();
148
+ fillInTheGapsOverImageTextPage.steps.insertResponseArea(10);
149
+ fillInTheGapsOverImageTextPage.steps.allotPoints(10);
150
+ fillInTheGapsOverImageTextPage.steps.enterTextInAnswerInputFieldsSpecifyCorrectAnswerSection([{ responseIndex: 0, responseText: 'Flower is displayed' }]);
151
+ fillInTheGapsOverImageTextPage.steps.checkAllowStudentToCheckAnswerCheckbox();
152
+ fillInTheGapsOverImageTextPage.steps.switchToPreviewTab();
153
+ });
154
+
155
+ it('When all conditional checkboxes are unchecked and user attempts the question with a sentence which includes the answer then zero points should be awarded and when user clicks on \'Check answer\' button, red cross mark beside the response field and a status message with text \'Your answer is incorrect\' should be displayed', () => {
156
+ fillInTheGapsOverImageTextPage.steps.enterTextInAnswerInputFieldsPreviewTab([{ responseIndex: 0, responseText: 'Flower is displayed in this image' }]);
157
+ fillInTheGapsOverImageTextPage.steps.verifyPreviewScore(0, 10);
158
+ fillInTheGapsOverImageTextPage.steps.checkAnswer();
159
+ fillInTheGapsOverImageTextPage.steps.verifyIncorrectOptionIcon(0);
160
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
161
+ });
162
+
163
+ it('When only \'Validate if answer is included in the response\' checkbox is checked and user attempts the question with a sentence which does not include the answer then zero points should be awarded and when user clicks on \'Check answer\' button, red cross mark beside the response field and a status message with text \'Your answer is incorrect\' should be displayed', () => {
164
+ fillInTheGapsOverImageTextPage.steps.switchToEditTab();
165
+ fillInTheGapsOverImageTextPage.steps.checkConditionalCheckbox('Validate if answer is included in the response');
166
+ fillInTheGapsOverImageTextPage.steps.switchToPreviewTab();
167
+ fillInTheGapsOverImageTextPage.steps.enterTextInAnswerInputFieldsPreviewTab([{ responseIndex: 0, responseText: 'Image contains fruit' }]);
168
+ fillInTheGapsOverImageTextPage.steps.verifyPreviewScore(0, 10);
169
+ fillInTheGapsOverImageTextPage.steps.checkAnswer();
170
+ fillInTheGapsOverImageTextPage.steps.verifyIncorrectOptionIcon(0);
171
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
172
+ });
173
+
174
+ it('When only \'Validate if answer is included in the response\' checkbox is checked and user attempts the question with a sentence which includes a part of the answer then zero points should be awarded and when user clicks on \'Check answer\' button, red cross mark beside the response field and a status message with text \'Your answer is incorrect\' should be displayed', () => {
175
+ fillInTheGapsOverImageTextPage.steps.resetQuestionPreview();
176
+ fillInTheGapsOverImageTextPage.steps.enterTextInAnswerInputFieldsPreviewTab([{ responseIndex: 0, responseText: 'This image contains flower' }]);
177
+ fillInTheGapsOverImageTextPage.steps.verifyPreviewScore(0, 10);
178
+ fillInTheGapsOverImageTextPage.steps.checkAnswer();
179
+ fillInTheGapsOverImageTextPage.steps.verifyIncorrectOptionIcon(0);
180
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
181
+ });
182
+
183
+ it('When only \'Validate if answer is included in the response\' checkbox is checked and user attempts the question with a sentence which includes the answer then full points should be awarded and when user clicks on \'Check answer\' button, green check mark beside the correct response field and a status message with text \'Your answer is correct\' should be displayed', () => {
184
+ fillInTheGapsOverImageTextPage.steps.resetQuestionPreview();
185
+ fillInTheGapsOverImageTextPage.steps.enterTextInAnswerInputFieldsPreviewTab([{ responseIndex: 0, responseText: 'Flower is displayed in this image' }]);
186
+ fillInTheGapsOverImageTextPage.steps.verifyPreviewScore(10, 10);
187
+ fillInTheGapsOverImageTextPage.steps.checkAnswer();
188
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectOptionIcon(0);
189
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectIncorrectAnswerLabel('correct');
190
+ });
191
+
192
+ it('When only \'Validate if answer is included in the response\' checkbox is checked and user attempts the question with the exact answer then full points should be awarded and when user clicks on \'Check answer\' button, green check mark beside the correct response field and a status message with text \'Your answer is correct\' should be displayed', () => {
193
+ fillInTheGapsOverImageTextPage.steps.resetQuestionPreview();
194
+ fillInTheGapsOverImageTextPage.steps.enterTextInAnswerInputFieldsPreviewTab([{ responseIndex: 0, responseText: 'Flower is displayed' }]);
195
+ fillInTheGapsOverImageTextPage.steps.verifyPreviewScore(10, 10);
196
+ fillInTheGapsOverImageTextPage.steps.checkAnswer();
197
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectOptionIcon(0);
198
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectIncorrectAnswerLabel('correct');
199
+ });
200
+ });
201
+
202
+ describe('\'Ignore extra spaces\' checkbox', () => {
203
+ abortEarlySetup();
204
+ before(() => {
205
+ fillInTheGapsOverImageTextPage.steps.navigateToCreateQuestion('fill in the gaps over image with text');
206
+ cy.barsPreLoaderWait();
207
+ fillInTheGapsOverImageTextPage.steps.uploadFile('highlightImage.jpg');
208
+ fillInTheGapsOverImageTextPage.steps.verifyImageIsUploaded();
209
+ fillInTheGapsOverImageTextPage.steps.insertResponseArea(10);
210
+ fillInTheGapsOverImageTextPage.steps.allotPoints(10);
211
+ fillInTheGapsOverImageTextPage.steps.enterTextInAnswerInputFieldsSpecifyCorrectAnswerSection([{ responseIndex: 0, responseText: 'Flower is displayed' }]);
212
+ fillInTheGapsOverImageTextPage.steps.checkAllowStudentToCheckAnswerCheckbox();
213
+ fillInTheGapsOverImageTextPage.steps.switchToPreviewTab();
214
+ });
215
+
216
+ it('When all conditional checkboxes are unchecked and user attempts the question with extra spaces before and after the correct answer then zero points should be awarded and when user clicks on \'Check answer\' button, red cross mark beside the response field and a status message with text \'Your answer is incorrect\' should be displayed', () => {
217
+ fillInTheGapsOverImageTextPage.steps.enterTextInAnswerInputFieldsPreviewTab([{ responseIndex: 0, responseText: ' Flower is displayed ' }]);
218
+ fillInTheGapsOverImageTextPage.steps.verifyPreviewScore(0, 10);
219
+ fillInTheGapsOverImageTextPage.steps.checkAnswer();
220
+ fillInTheGapsOverImageTextPage.steps.verifyIncorrectOptionIcon(0);
221
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
222
+ });
223
+
224
+ it('When only \'Ignore extra spaces\' checkbox is checked and user attempts the question with extra spaces in between the correct answer then zero points should be awarded and when user clicks on \'Check answer\' button, red cross mark beside the response field and a status message with text \'Your answer is incorrect\' should be displayed', () => {
225
+ fillInTheGapsOverImageTextPage.steps.switchToEditTab();
226
+ fillInTheGapsOverImageTextPage.steps.checkConditionalCheckbox('Ignore extra spaces');
227
+ fillInTheGapsOverImageTextPage.steps.switchToPreviewTab();
228
+ fillInTheGapsOverImageTextPage.steps.enterTextInAnswerInputFieldsPreviewTab([{ responseIndex: 0, responseText: 'Flower is dis played' }]);
229
+ fillInTheGapsOverImageTextPage.steps.verifyPreviewScore(0, 10);
230
+ fillInTheGapsOverImageTextPage.steps.checkAnswer();
231
+ fillInTheGapsOverImageTextPage.steps.verifyIncorrectOptionIcon(0);
232
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
233
+ });
234
+
235
+ it('When only \'Ignore extra spaces\' checkbox is checked and user attempts the question with extra spaces before and after the correct answer then full points should be awarded and when user clicks on \'Check answer\' button, green check mark beside the correct response field and a status message with text \'Your answer is correct\' should be displayed', () => {
236
+ fillInTheGapsOverImageTextPage.steps.resetQuestionPreview();
237
+ fillInTheGapsOverImageTextPage.steps.enterTextInAnswerInputFieldsPreviewTab([{ responseIndex: 0, responseText: ' Flower is displayed ' }]);
238
+ fillInTheGapsOverImageTextPage.steps.verifyPreviewScore(10, 10);
239
+ fillInTheGapsOverImageTextPage.steps.checkAnswer();
240
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectOptionIcon(0);
241
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectIncorrectAnswerLabel('correct');
242
+ });
243
+
244
+ it('When only \'Ignore extra spaces\' checkbox is checked and user attempts the question with the correct answer then full points should be awarded and when user clicks on \'Check answer\' button, green check mark beside the correct response field and a status message with text \'Your answer is correct\' should be displayed', () => {
245
+ fillInTheGapsOverImageTextPage.steps.resetQuestionPreview();
246
+ fillInTheGapsOverImageTextPage.steps.enterTextInAnswerInputFieldsPreviewTab([{ responseIndex: 0, responseText: 'Flower is displayed' }]);
247
+ fillInTheGapsOverImageTextPage.steps.verifyPreviewScore(10, 10);
248
+ fillInTheGapsOverImageTextPage.steps.checkAnswer();
249
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectOptionIcon(0);
250
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectIncorrectAnswerLabel('correct');
251
+ });
252
+
253
+ it('When only \'Ignore extra spaces\' and \'Ignore single letter mistake\' checkboxes are checked and user attempts the question with extra spaces in between the correct answer with single letter mistake then zero points should be awarded and when user clicks on \'Check answer\' button, red cross mark beside the response field and a status message with text \'Your answer is incorrect\' should be displayed', () => {
254
+ fillInTheGapsOverImageTextPage.steps.switchToEditTab();
255
+ fillInTheGapsOverImageTextPage.steps.checkConditionalCheckbox('Ignore single letter mistake');
256
+ fillInTheGapsOverImageTextPage.steps.uncheckConditionalCheckbox('Case sensitive');
257
+ fillInTheGapsOverImageTextPage.steps.switchToPreviewTab();
258
+ fillInTheGapsOverImageTextPage.steps.enterTextInAnswerInputFieldsPreviewTab([{ responseIndex: 0, responseText: 'Flo wer is displayes' }]);
259
+ fillInTheGapsOverImageTextPage.steps.verifyPreviewScore(0, 10);
260
+ fillInTheGapsOverImageTextPage.steps.checkAnswer();
261
+ fillInTheGapsOverImageTextPage.steps.verifyIncorrectOptionIcon(0);
262
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
263
+ });
264
+
265
+ it('When only \'Ignore extra spaces\' and \'Ignore single letter mistake\' checkboxes are checked and user attempts the question with extra spaces and multiple letter mistake then zero points should be awarded and when user clicks on \'Check answer\' button, red cross mark beside the response field and a status message with text \'Your answer is incorrect\' should be displayed', () => {
266
+ fillInTheGapsOverImageTextPage.steps.resetQuestionPreview();
267
+ fillInTheGapsOverImageTextPage.steps.enterTextInAnswerInputFieldsPreviewTab([{ responseIndex: 0, responseText: ' Fkower is dispkayed ' }]);
268
+ fillInTheGapsOverImageTextPage.steps.verifyPreviewScore(0, 10);
269
+ fillInTheGapsOverImageTextPage.steps.checkAnswer();
270
+ fillInTheGapsOverImageTextPage.steps.verifyIncorrectOptionIcon(0);
271
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
272
+ });
273
+
274
+ it('When only \'Ignore extra spaces\' and \'Ignore single letter mistake\' checkboxes are checked and user attempts the question with extra spaces before and after the correct answer with single letter mistake then full points should be awarded and when user clicks on \'Check answer\' button, green check mark beside the correct response field and a status message with text \'Your answer is correct\' should be displayed', () => {
275
+ fillInTheGapsOverImageTextPage.steps.resetQuestionPreview();
276
+ fillInTheGapsOverImageTextPage.steps.enterTextInAnswerInputFieldsPreviewTab([{ responseIndex: 0, responseText: ' Flower is displayes ' }]);
277
+ fillInTheGapsOverImageTextPage.steps.verifyPreviewScore(10, 10);
278
+ fillInTheGapsOverImageTextPage.steps.checkAnswer();
279
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectOptionIcon(0);
280
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectIncorrectAnswerLabel('correct');
281
+ });
282
+ });
283
+
284
+ describe('\'Ignore single letter mistake\' checkbox', () => {
285
+ abortEarlySetup();
286
+ before(() => {
287
+ fillInTheGapsOverImageTextPage.steps.navigateToCreateQuestion('fill in the gaps over image with text');
288
+ cy.barsPreLoaderWait();
289
+ fillInTheGapsOverImageTextPage.steps.uploadFile('highlightImage.jpg');
290
+ fillInTheGapsOverImageTextPage.steps.verifyImageIsUploaded();
291
+ fillInTheGapsOverImageTextPage.steps.insertResponseArea(10);
292
+ fillInTheGapsOverImageTextPage.steps.allotPoints(10);
293
+ fillInTheGapsOverImageTextPage.steps.enterTextInAnswerInputFieldsSpecifyCorrectAnswerSection([{ responseIndex: 0, responseText: 'Flower is displayed' }]);
294
+ fillInTheGapsOverImageTextPage.steps.checkAllowStudentToCheckAnswerCheckbox();
295
+ fillInTheGapsOverImageTextPage.steps.switchToPreviewTab();
296
+ });
297
+
298
+ it('When all conditional checkboxes are unchecked and user attempts the question with single letter mistake then zero points should be awarded and when user clicks on \'Check answer\' button, red cross mark beside the response field and a status message with text \'Your answer is incorrect\' should be displayed', () => {
299
+ fillInTheGapsOverImageTextPage.steps.enterTextInAnswerInputFieldsPreviewTab([{ responseIndex: 0, responseText: 'Flower is displayes' }]);
300
+ fillInTheGapsOverImageTextPage.steps.verifyPreviewScore(0, 10);
301
+ fillInTheGapsOverImageTextPage.steps.checkAnswer();
302
+ fillInTheGapsOverImageTextPage.steps.verifyIncorrectOptionIcon(0);
303
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
304
+ });
305
+
306
+ it('When only \'Ignore single letter mistake\' checkbox is checked and user attempts the question with multiple letter mistakes then zero points should be awarded and when user clicks on \'Check answer\' button, red cross mark beside the response field and a status message with text \'Your answer is incorrect\' should be displayed', () => {
307
+ fillInTheGapsOverImageTextPage.steps.switchToEditTab();
308
+ fillInTheGapsOverImageTextPage.steps.checkConditionalCheckbox('Ignore single letter mistake');
309
+ fillInTheGapsOverImageTextPage.steps.switchToPreviewTab();
310
+ fillInTheGapsOverImageTextPage.steps.enterTextInAnswerInputFieldsPreviewTab([{ responseIndex: 0, responseText: 'Floeer is displayes' }]);
311
+ fillInTheGapsOverImageTextPage.steps.verifyPreviewScore(0, 10);
312
+ fillInTheGapsOverImageTextPage.steps.checkAnswer();
313
+ fillInTheGapsOverImageTextPage.steps.verifyIncorrectOptionIcon(0);
314
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
315
+ });
316
+
317
+ it('When only \'Ignore single letter mistake\' checkbox is checked and user attempts the question with single letter mistake then full points should be awarded and when user clicks on \'Check answer\' button, green check mark beside the correct response field and a status message with text \'Your answer is correct\' should be displayed', () => {
318
+ fillInTheGapsOverImageTextPage.steps.resetQuestionPreview();
319
+ fillInTheGapsOverImageTextPage.steps.enterTextInAnswerInputFieldsPreviewTab([{ responseIndex: 0, responseText: 'Floeer is displayed' }]);
320
+ fillInTheGapsOverImageTextPage.steps.verifyPreviewScore(10, 10);
321
+ fillInTheGapsOverImageTextPage.steps.checkAnswer();
322
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectOptionIcon(0);
323
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectIncorrectAnswerLabel('correct');
324
+ });
325
+
326
+ it('When only \'Ignore single letter mistake\' checkbox is checked and user attempts the question with the correct answer then full points should be awarded and when user clicks on \'Check answer\' button, green check mark beside the correct response field and a status message with text \'Your answer is correct\' should be displayed', () => {
327
+ fillInTheGapsOverImageTextPage.steps.resetQuestionPreview();
328
+ fillInTheGapsOverImageTextPage.steps.enterTextInAnswerInputFieldsPreviewTab([{ responseIndex: 0, responseText: 'Flower is displayed' }]);
329
+ fillInTheGapsOverImageTextPage.steps.verifyPreviewScore(10, 10);
330
+ fillInTheGapsOverImageTextPage.steps.checkAnswer();
331
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectOptionIcon(0);
332
+ fillInTheGapsOverImageTextPage.steps.verifyCorrectIncorrectAnswerLabel('correct');
333
+ });
334
+ });
335
+ });
@@ -3,6 +3,8 @@ import abortEarlySetup from "../../../support/helpers/abortEarly";
3
3
  import utilities from "../../../support/helpers/utilities";
4
4
  const css = Cypress.env('css');
5
5
 
6
+ const conditionalCheckboxes = ['Case sensitive', 'Validate if answer is included in the response', 'Ignore extra spaces', 'Ignore single letter mistake'];
7
+
6
8
  describe('Create item page - Fill in the gaps over image: Scoring section', () => {
7
9
  before(() => {
8
10
  cy.loginAs('admin');
@@ -233,7 +235,7 @@ describe('Create item page - Fill in the gaps over image: Scoring section', () =
233
235
  it('When the user has selected \'Manually scored\' scoring type, then the specify correct answer section should not be displayed', () => {
234
236
  utilities.verifyElementVisibilityState(fillInTheGapsOverImageTextPage.specifyCorrectAnswerLabel(), 'notExist');
235
237
  utilities.verifyElementVisibilityState(fillInTheGapsOverImageTextPage.specifyCorrectAnswerSectionWrapper(), 'notExist');
236
- });
238
+ });
237
239
 
238
240
  fillInTheGapsOverImageTextPage.tests.verifyScoringSectionContentsForManuallyScoredScoringType();
239
241
 
@@ -276,4 +278,65 @@ describe('Create item page - Fill in the gaps over image: Scoring section', () =
276
278
 
277
279
  fillInTheGapsOverImageTextPage.tests.verifyPointsLabelAndInputFieldForNonScoredScoringType();
278
280
  });
281
+
282
+ describe('Conditional checkboxes - Content', () => {
283
+ abortEarlySetup();
284
+ before(() => {
285
+ fillInTheGapsOverImageTextPage.steps.navigateToCreateQuestion('fill in the gaps over image with text');
286
+ cy.barsPreLoaderWait();
287
+ });
288
+
289
+ it(`By default four conditional checkboxes ${conditionalCheckboxes.join(', ')} should be displayed in the scoring section and all of them should be unchecked`, () => {
290
+ utilities.verifyElementVisibilityState(fillInTheGapsOverImageTextPage.caseSensitiveCheckbox(), 'exist');
291
+ utilities.verifyElementVisibilityState(fillInTheGapsOverImageTextPage.caseSensitiveCheckboxLabel(), 'visible');
292
+ utilities.verifyInnerText(fillInTheGapsOverImageTextPage.caseSensitiveCheckboxLabel(), `${conditionalCheckboxes[0]}`);
293
+ utilities.verifyElementVisibilityState(fillInTheGapsOverImageTextPage.validateIfAnswerIsIncludedCheckbox(), 'exist');
294
+ utilities.verifyElementVisibilityState(fillInTheGapsOverImageTextPage.validateIfAnswerIsIncludedCheckboxLabel(), 'visible');
295
+ utilities.verifyInnerText(fillInTheGapsOverImageTextPage.validateIfAnswerIsIncludedCheckboxLabel(), `${conditionalCheckboxes[1]}`);
296
+ utilities.verifyElementVisibilityState(fillInTheGapsOverImageTextPage.ignoreExtraSpacesCheckbox(), 'exist');
297
+ utilities.verifyElementVisibilityState(fillInTheGapsOverImageTextPage.ignoreExtraSpacesCheckboxLabel(), 'visible');
298
+ utilities.verifyInnerText(fillInTheGapsOverImageTextPage.ignoreExtraSpacesCheckboxLabel(), `${conditionalCheckboxes[2]}`);
299
+ utilities.verifyElementVisibilityState(fillInTheGapsOverImageTextPage.ignoreSingleLetterMistakeCheckbox(), 'exist');
300
+ utilities.verifyElementVisibilityState(fillInTheGapsOverImageTextPage.ignoreSingleLetterMistakeCheckboxLabel(), 'visible');
301
+ utilities.verifyInnerText(fillInTheGapsOverImageTextPage.ignoreSingleLetterMistakeCheckboxLabel(), `${conditionalCheckboxes[3]}`);
302
+ fillInTheGapsOverImageTextPage.steps.verifyDefaultUncheckedStateOfConditionalCheckboxes();
303
+ });
304
+
305
+ it('User should be able to check a conditional checkbox', () => {
306
+ fillInTheGapsOverImageTextPage.steps.checkConditionalCheckbox(conditionalCheckboxes[0]);
307
+ });
308
+
309
+ it('When \'Validate if answer is included in the response\' checkbox is checked, then \'Ignore extra spaces\', \'Ignore single letter mistake\' checkboxes should be disabled', () => {
310
+ fillInTheGapsOverImageTextPage.steps.checkConditionalCheckbox(conditionalCheckboxes[1]);
311
+ utilities.verifyElementDisabled(fillInTheGapsOverImageTextPage.ignoreExtraSpacesCheckbox());
312
+ utilities.verifyElementDisabled(fillInTheGapsOverImageTextPage.ignoreSingleLetterMistakeCheckbox());
313
+ });
314
+
315
+ it('CSS of conditional checkboxes', () => {
316
+ utilities.verifyCSS(fillInTheGapsOverImageTextPage.caseSensitiveCheckboxLabel(), {
317
+ 'color': css.color.checkboxLabel,
318
+ 'font-size': css.fontSize.normal,
319
+ 'font-weight': css.fontWeight.regular
320
+ });
321
+ utilities.verifyCSS(fillInTheGapsOverImageTextPage.caseSensitiveCheckbox().parent().find('rect').eq(1), {
322
+ 'fill': css.color.activeButtons,
323
+ });
324
+ //disabled state
325
+ utilities.verifyCSS(fillInTheGapsOverImageTextPage.ignoreExtraSpacesCheckboxLabel(), {
326
+ 'color': css.color.labelText,
327
+ 'font-size': css.fontSize.normal,
328
+ 'font-weight': css.fontWeight.regular
329
+ });
330
+ });
331
+
332
+ it('Accessibility of conditional checkboxes', () => {
333
+ cy.checkAccessibility(fillInTheGapsOverImageTextPage.caseSensitiveCheckboxLabel().parents('.scoring-type-checkbox-wrapper'));
334
+ });
335
+
336
+ it('When \'Validate if answer is included in the response\' checkbox is unchecked, then \'Ignore extra spaces\', \'Ignore single letter mistake\' checkboxes should be enabled', () => {
337
+ fillInTheGapsOverImageTextPage.steps.uncheckConditionalCheckbox(conditionalCheckboxes[1]);
338
+ utilities.verifyElementNotDisabled(fillInTheGapsOverImageTextPage.ignoreExtraSpacesCheckbox());
339
+ utilities.verifyElementNotDisabled(fillInTheGapsOverImageTextPage.ignoreSingleLetterMistakeCheckbox());
340
+ });
341
+ });
279
342
  });