itemengine-cypress-automation 1.0.24 → 1.0.26

Sign up to get free protection for your applications and to get access to all the features.
Files changed (26) hide show
  1. package/cypress/e2e/ILC/FillInTheGapsText/fillInTheGapsTextAdditionalSettingsAdvanceSettingsForAllResponseAreas.js +511 -0
  2. package/cypress/e2e/ILC/FillInTheGapsText/fillInTheGapsTextAdditionalSettingsBasic.js +263 -0
  3. package/cypress/e2e/ILC/FillInTheGapsText/fillInTheGapsTextAdditionalSettingsResponseAccordions.js +734 -0
  4. package/cypress/e2e/ILC/FillInTheGapsText/fillInTheGapsTextAdditionalSettingsStudentResponseAreaAndLayout.js +603 -0
  5. package/cypress/e2e/ILC/FillInTheGapsText/fillInTheGapsTextAllOrNothingWithAlternateAnswer.js +54 -0
  6. package/cypress/e2e/ILC/FillInTheGapsText/fillInTheGapsTextAutoScoredScoring.js +0 -46
  7. package/cypress/e2e/ILC/FillInTheGapsText/fillInTheGapsTextPartialDifferentWeights.js +47 -0
  8. package/cypress/e2e/ILC/FillInTheGapsText/{fillInTheGapsTextScoringPartialDifferentWeights.js → fillInTheGapsTextPartialDifferentWeightsWithAlternateAnswer.js} +1 -38
  9. package/cypress/e2e/ILC/FillInTheGapsText/fillInTheGapsTextPartialEqualWeights.js +45 -0
  10. package/cypress/e2e/ILC/FillInTheGapsText/{fillInTheGapsTextScoringPartialEqualWeights.js → fillInTheGapsTextPartialEqualWeightsWithAlternateAnswer.js} +0 -37
  11. package/cypress/e2e/ILC/HighlightImage/highlightImageAdditionalSettings.js +447 -0
  12. package/cypress/e2e/ILC/HighlightImage/highlightImageAllOrNothingScoring.js +1029 -0
  13. package/cypress/e2e/ILC/HighlightImage/highlightImageCustomizeHighlightProperties.js +1010 -0
  14. package/cypress/e2e/ILC/HighlightImage/highlightImageEditTabBasic.js +200 -0
  15. package/cypress/e2e/ILC/HighlightImage/highlightImageEditTabHighlightSectionContents.js +318 -0
  16. package/cypress/e2e/ILC/HighlightImage/highlightImageEditTabScoring.js +403 -0
  17. package/cypress/e2e/ILC/HighlightImage/highlightImageHeaderSection.js +86 -0
  18. package/cypress/e2e/ILC/HighlightImage/highlightImageManuallyAndNonScoredScoring.js +176 -0
  19. package/cypress/e2e/ILC/HighlightImage/highlightImagePartialDifferentWeightsScoring.js +1093 -0
  20. package/cypress/e2e/ILC/HighlightImage/highlightImagePartialEqualWeightsScoring.js +1087 -0
  21. package/cypress/e2e/ILC/HighlightImage/highlightImagePreviewTab.js +88 -0
  22. package/cypress/e2e/ILC/HighlightImage/highlightImageSetCorrectAnswerCheckboxes.js +244 -0
  23. package/cypress/e2e/ILC/HighlightImage/highlightImageSetCorrectAnswerSection.js +186 -0
  24. package/cypress/e2e/ILC/HighlightImage/highlightImageToolsFunctionality.js +309 -0
  25. package/package.json +1 -1
  26. package/cypress/e2e/ILC/FillInTheGapsText/fillInTheGapsTextAdditionalSettings.js +0 -2060
@@ -0,0 +1,1029 @@
1
+ import { highlightImagePage } from "../../../pages";
2
+ import { uploadImageSectionComponent } from "../../../pages/components/uploadImageSectionComponent";
3
+ import abortEarlySetup from "../../../support/helpers/abortEarly";
4
+ import utilities from "../../../support/helpers/utilities";
5
+ const css = Cypress.env('css');
6
+
7
+ const flowerHighlightRegion = [[24, 6], [24, 24], [56, 24], [56, 6]];
8
+ const branchesHighlightRegion = [[36, 36], [36, 46], [58, 46], [58, 36]];
9
+ const leafHighlightRegion = [[54, 48], [54, 72], [82, 72], [82, 48]];
10
+ const rootsHighlightRegion = [[28, 84], [28, 98], [74, 98], [74, 84]];
11
+
12
+ describe('Create Item page - Highlight image: Preview tab Scoring Section', () => {
13
+ before(() => {
14
+ cy.loginAs('admin');
15
+ });
16
+
17
+ describe('Show correct answer', () => {
18
+ abortEarlySetup();
19
+ before(() => {
20
+ cy.log('Navigating to highlight image question type');
21
+ highlightImagePage.steps.navigateToCreateQuestion('highlight image');
22
+ cy.barsPreLoaderWait();
23
+ highlightImagePage.steps.addQuestionInstructions();
24
+ uploadImageSectionComponent.steps.uploadFile('highlightImage.jpg');
25
+ uploadImageSectionComponent.steps.verifyUploadedImageInImagePopup();
26
+ uploadImageSectionComponent.steps.clickOnImagePopupOkButton();
27
+ utilities.verifyElementVisibilityState(uploadImageSectionComponent.uploadImagePopup(), 'notExist');
28
+ highlightImagePage.steps.verifyImageUploadedInHighlightRegion();
29
+ highlightImagePage.steps.verifyImageUploadedInSetCorrectAnswerSection();
30
+ });
31
+
32
+ highlightImagePage.tests.verifyShowCorrectAnswerAndPointsInPreviewTabWhenNoCorrectAnswerIsSet();
33
+
34
+ it('When the user has set correct answer options and alloted points \'Show correct answer\' checkbox should be displayed and it should be unchecked by default and points for the question should be displayed beside it', () => {
35
+ highlightImagePage.steps.switchToEditTab();
36
+ highlightImagePage.steps.highlightRegionInImage(flowerHighlightRegion);
37
+ highlightImagePage.steps.highlightRegionInImage(leafHighlightRegion);
38
+ highlightImagePage.steps.highlightRegionInImage(rootsHighlightRegion);
39
+ highlightImagePage.steps.highlightARegionInSetCorrectAnswerSection(0);
40
+ highlightImagePage.steps.allotPoints(10);
41
+ highlightImagePage.steps.switchToPreviewTab();
42
+ highlightImagePage.steps.verifyDefaultShowCorrectAnswerCheckboxAndLabel();
43
+ highlightImagePage.steps.verifyPreviewTabScoreText(0, 10);
44
+ });
45
+
46
+ it('When the user attempts question in preview tab and switches to edit tab, then on re-switching to the preview tab users response should not persist', () => {
47
+ highlightImagePage.steps.highlightARegionInPreviewTab(0);
48
+ highlightImagePage.steps.switchToEditTab();
49
+ highlightImagePage.steps.switchToPreviewTab();
50
+ highlightImagePage.steps.verifyRegionIsNotHighlighted(0);
51
+ highlightImagePage.steps.verifyRegionIsNotHighlighted(1);
52
+ highlightImagePage.steps.verifyRegionIsNotHighlighted(2);
53
+ });
54
+ });
55
+
56
+ describe('Question Preview: AutoScored - All or Nothing', () => {
57
+ abortEarlySetup();
58
+ before(() => {
59
+ cy.log('Navigating to highlight image question type');
60
+ highlightImagePage.steps.navigateToCreateQuestion('highlight image');
61
+ cy.barsPreLoaderWait();
62
+ highlightImagePage.steps.addQuestionInstructions();
63
+ uploadImageSectionComponent.steps.uploadFile('highlightImage.jpg');
64
+ uploadImageSectionComponent.steps.verifyUploadedImageInImagePopup();
65
+ uploadImageSectionComponent.steps.clickOnImagePopupOkButton();
66
+ utilities.verifyElementVisibilityState(uploadImageSectionComponent.uploadImagePopup(), 'notExist');
67
+ highlightImagePage.steps.verifyImageUploadedInHighlightRegion();
68
+ highlightImagePage.steps.verifyImageUploadedInSetCorrectAnswerSection();
69
+ highlightImagePage.steps.highlightRegionInImage(flowerHighlightRegion);
70
+ highlightImagePage.steps.highlightRegionInImage(branchesHighlightRegion);
71
+ highlightImagePage.steps.highlightRegionInImage(leafHighlightRegion);
72
+ highlightImagePage.steps.highlightRegionInImage(rootsHighlightRegion);
73
+ highlightImagePage.steps.checkMultipleSelectionCheckbox();
74
+ highlightImagePage.steps.highlightARegionInSetCorrectAnswerSection(0);
75
+ highlightImagePage.steps.highlightARegionInSetCorrectAnswerSection(3);
76
+ highlightImagePage.steps.allotPoints(20);
77
+ highlightImagePage.steps.expandAdditonalSettings();
78
+ highlightImagePage.steps.checkAllowStudentsToCheckAnswerCheckbox();
79
+ highlightImagePage.steps.switchToPreviewTab();
80
+ });
81
+
82
+ highlightImagePage.tests.verifyCSSOfPreviewAndEditTabAndScoringContents();
83
+
84
+ highlightImagePage.tests.verifya11yOfCreateItemWrapperContents();
85
+
86
+ it('When the user selects \'Show correct answer\' checkbox without attempting the question, correct tab regions should be highlighted with green border and green background, border and label should not be displayed below the question preview, and correct answer container should not be displayed', () => {
87
+ highlightImagePage.steps.checkShowCorrectAnswerCheckbox();
88
+ highlightImagePage.steps.verifyCorrectIncorrectBorderNotExists();
89
+ highlightImagePage.steps.verifyCorrectIncorrectAnswerLabelNotExists();
90
+ highlightImagePage.steps.verifyCorrectHighlightRegion(0);
91
+ highlightImagePage.steps.verifyCorrectHighlightRegion(3);
92
+ highlightImagePage.steps.verifyPreviewTabScoreText(0, 20);
93
+ highlightImagePage.steps.verifyCorrectAnswerContainerDoesNotExist();
94
+ highlightImagePage.steps.uncheckShowCorrectAnswerCheckbox();
95
+ });
96
+
97
+ it('When user selects Check answer button without attempting the question, correct/incorrect answer border for the question and label should not be displayed below the question preview and correct answer container should not be displayed', () => {
98
+ highlightImagePage.steps.checkAnswer();
99
+ highlightImagePage.steps.verifyDefaultHighlightRegion(0);
100
+ highlightImagePage.steps.verifyDefaultHighlightRegion(1);
101
+ highlightImagePage.steps.verifyDefaultHighlightRegion(2);
102
+ highlightImagePage.steps.verifyDefaultHighlightRegion(3);
103
+ highlightImagePage.steps.verifyCorrectIncorrectBorderNotExists();
104
+ highlightImagePage.steps.verifyCorrectIncorrectAnswerLabelNotExists();
105
+ highlightImagePage.steps.verifyCorrectAnswerContainerDoesNotExist();
106
+ highlightImagePage.steps.verifyPreviewTabScoreText(0, 20);
107
+ });
108
+
109
+ it('When user attempts the question incorrectly then on selecting \'Show correct answer\' checkbox, the user should be awarded 0 points and incorrect regions should be displayed with red cross-mark icons and red background, a label \'Incorrect answer\' and border should be displayed below the question preview and the correct answer container with \'Correct answers:\' label and all correct answers along with numeration should be displayed', () => {
110
+ highlightImagePage.steps.highlightARegionInPreviewTab(1);
111
+ highlightImagePage.steps.verifyPreviewTabScoreText(0, 20);
112
+ highlightImagePage.steps.checkShowCorrectAnswerCheckbox();
113
+ highlightImagePage.steps.verifyCorrectHighlightRegion(0);
114
+ highlightImagePage.steps.verifyIncorrectHighlightRegion(1);
115
+ highlightImagePage.steps.verifyDefaultHighlightRegion(2);
116
+ highlightImagePage.steps.verifyCorrectHighlightRegion(3);
117
+ highlightImagePage.steps.verifyCorrectAnswerContainerContents(['Option 1', 'Option 4'], [1, 2]);
118
+ highlightImagePage.steps.verifyHighlightNumerationPreviewTab(0, 1);
119
+ highlightImagePage.steps.verifyHighlightNumerationPreviewTab(3, 4);
120
+ utilities.verifyInnerText(highlightImagePage.correctAnswerContainerLabel(), 'Correct answers:');
121
+ highlightImagePage.steps.verifyIncorrectAttemptBorder();
122
+ highlightImagePage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect');
123
+
124
+ highlightImagePage.steps.verifyQuestionPreviewStateWhenShowCorrectAnswerIsUnchecked();
125
+
126
+ cy.log('When user attempts the question incorrectly and clicks on the \'Check answer\' button, the user should be awarded 0 points and incorrect regions should be displayed with red cross-mark icons and red background, a label \'Incorrect answer\' and border should be displayed below the question preview and the correct answer container should not be displayed')
127
+ highlightImagePage.steps.checkAnswer();
128
+ highlightImagePage.steps.verifyDefaultHighlightRegion(0);
129
+ highlightImagePage.steps.verifyIncorrectHighlightRegion(1);
130
+ highlightImagePage.steps.verifyDefaultHighlightRegion(2);
131
+ highlightImagePage.steps.verifyDefaultHighlightRegion(3);
132
+ highlightImagePage.steps.verifyIncorrectAttemptBorder();
133
+ highlightImagePage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect');
134
+ highlightImagePage.steps.verifyCorrectAnswerContainerDoesNotExist();
135
+ });
136
+
137
+ it('CSS of incorrect answer state', { tags: 'css' }, () => {
138
+ highlightImagePage.steps.checkShowCorrectAnswerCheckbox();
139
+ cy.log('Verifying CSS of incorrect cross-mark icon')
140
+ utilities.verifyCSS(highlightImagePage.correctIncorectAnswerLabel(), {
141
+ 'color': css.color.incorrectAnswer,
142
+ 'font-size': css.fontSize.normal,
143
+ 'font-weight': css.fontWeight.bold
144
+ });
145
+ highlightImagePage.steps.verifyIncorrectAttemptBorder();
146
+ highlightImagePage.steps.uncheckShowCorrectAnswerCheckbox();
147
+ });
148
+
149
+ it('Accessibility of incorrect answer state', { tags: 'a11y' }, () => {
150
+ highlightImagePage.steps.checkShowCorrectAnswerCheckbox();
151
+ cy.checkAccessibility(highlightImagePage.previewTabQuestionWrapper());
152
+ cy.log('Post step: Deselect show answer checkbox')
153
+ highlightImagePage.steps.uncheckShowCorrectAnswerCheckbox();
154
+ });
155
+
156
+ it('When user attempts the question partially correct by selecting some correct regions and incorrect regions then on selecting \'Show correct answer\' checkbox, the user should be awarded 0 points, green check-mark icons and green background should be displayed for the correct regions, red cross-mark icons and red background should be displayed for the incorrect selected regions, a label \'Incorrect answer\' and border should be displayed below the question preview and the correct answer container with the unattempted correct tab answer along with numeration should be displayed', () => {
157
+ highlightImagePage.steps.resetQuestionPreview();
158
+ highlightImagePage.steps.highlightARegionInPreviewTab(0);
159
+ highlightImagePage.steps.highlightARegionInPreviewTab(1);
160
+ highlightImagePage.steps.verifyPreviewTabScoreText(0, 20);
161
+ highlightImagePage.steps.checkShowCorrectAnswerCheckbox();
162
+ highlightImagePage.steps.verifyCorrectHighlightRegion(0);
163
+ highlightImagePage.steps.verifyIncorrectHighlightRegion(1);
164
+ highlightImagePage.steps.verifyDefaultHighlightRegion(2);
165
+ highlightImagePage.steps.verifyCorrectHighlightRegion(3);
166
+ highlightImagePage.steps.verifyCorrectAnswerContainerContents(['Option 4'], [1]);
167
+ highlightImagePage.steps.verifyHighlightNumerationPreviewTab(3, 4);
168
+ highlightImagePage.steps.verifyIncorrectAttemptBorder();
169
+ highlightImagePage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect');
170
+
171
+ highlightImagePage.steps.verifyQuestionPreviewStateWhenShowCorrectAnswerIsUnchecked();
172
+
173
+ cy.log('When user attempts the question partially correct and clicks on the \'Check answer\' button, green check-mark icons and green background should be displayed beside the correct regions, red cross-mark icons and red background should be displayed beside the incorrect selected regions, a label \'Incorrect answer\' and border should be displayed below the question preview and the correct answer container should not be displayed')
174
+ highlightImagePage.steps.checkAnswer();
175
+ highlightImagePage.steps.verifyCorrectHighlightRegion(0);
176
+ highlightImagePage.steps.verifyIncorrectHighlightRegion(1);
177
+ highlightImagePage.steps.verifyDefaultHighlightRegion(2);
178
+ highlightImagePage.steps.verifyDefaultHighlightRegion(3);
179
+ highlightImagePage.steps.verifyIncorrectAttemptBorder();
180
+ highlightImagePage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect');
181
+ highlightImagePage.steps.verifyCorrectAnswerContainerDoesNotExist();
182
+ });
183
+
184
+ it('When user attempts the question correctly then on selecting \'Show correct answer\' checkbox, the user should be awarded full points and green check-mark icons and green background should be displayed in all correct highlight regions, a label \'Correct answer\' and border should be displayed below the question preview and the correct answer container should not be displayed', () => {
185
+ highlightImagePage.steps.resetQuestionPreview();
186
+ highlightImagePage.steps.highlightARegionInPreviewTab(0);
187
+ highlightImagePage.steps.highlightARegionInPreviewTab(3);
188
+ highlightImagePage.steps.verifyPreviewTabScoreText(20, 20);
189
+ highlightImagePage.steps.checkShowCorrectAnswerCheckbox();
190
+ highlightImagePage.steps.verifyCorrectHighlightRegion(0);
191
+ highlightImagePage.steps.verifyDefaultHighlightRegion(1);
192
+ highlightImagePage.steps.verifyDefaultHighlightRegion(2);
193
+ highlightImagePage.steps.verifyCorrectHighlightRegion(3);
194
+ highlightImagePage.steps.verifyCorrectAttemptBorder();
195
+ highlightImagePage.steps.verifyCorrectIncorrectAnswerLabel('Correct');
196
+ highlightImagePage.steps.verifyCorrectAnswerContainerDoesNotExist();
197
+
198
+ highlightImagePage.steps.verifyQuestionPreviewStateWhenShowCorrectAnswerIsUnchecked();
199
+
200
+ cy.log('When user attempts the question correctly and clicks on the \'Check answer\' button, the user should be awarded full points and green check-mark icons and green background should be displayed in all correct highlight regions, a label \'Correct answer\' and border should be displayed below the question preview and the correct answer container should not be displayed')
201
+ highlightImagePage.steps.checkAnswer();
202
+ highlightImagePage.steps.verifyCorrectHighlightRegion(0);
203
+ highlightImagePage.steps.verifyDefaultHighlightRegion(1);
204
+ highlightImagePage.steps.verifyDefaultHighlightRegion(2);
205
+ highlightImagePage.steps.verifyCorrectHighlightRegion(3);
206
+ highlightImagePage.steps.verifyCorrectAttemptBorder();
207
+ highlightImagePage.steps.verifyCorrectIncorrectAnswerLabel('Correct');
208
+ highlightImagePage.steps.verifyCorrectAnswerContainerDoesNotExist();
209
+ });
210
+
211
+ it('CSS of check score text full score state and Correct Answer label', { tags: 'css' }, () => {
212
+ utilities.verifyCSS(highlightImagePage.previewScoreText(), {
213
+ 'color': css.color.primaryBtn,
214
+ 'background-color': css.color.correctAnswer
215
+ });
216
+ utilities.verifyCSS(highlightImagePage.correctIncorectAnswerLabel(), {
217
+ 'color': css.color.correctAnswer,
218
+ 'font-size': css.fontSize.normal,
219
+ 'font-weight': css.fontWeight.bold
220
+ });
221
+ utilities.verifyCSS(highlightImagePage.correctIncorectAnswerLabel(), {
222
+ 'color': css.color.correctAnswer,
223
+ 'font-size': css.fontSize.normal,
224
+ 'font-weight': css.fontWeight.bold
225
+ });
226
+ highlightImagePage.steps.verifyCorrectAttemptBorder();
227
+ });
228
+
229
+ it('Accessibility of check score text full score state and Correct Answer label', { tags: 'a11y' }, () => {
230
+ cy.checkAccessibility(highlightImagePage.previewTabQuestionWrapper());
231
+ });
232
+
233
+ highlightImagePage.tests.verifyMinimumScoreAwardedIfAttemptedFunctionalityForIncorrectAnswer(20);
234
+ });
235
+
236
+ describe('Question Preview: AutoScored - All or Nothing with alternate answer: When correct answer points are more than alternate answer points', () => {
237
+ abortEarlySetup();
238
+ before(() => {
239
+ cy.log('Navigating to highlight image question type');
240
+ highlightImagePage.steps.navigateToCreateQuestion('highlight image');
241
+ cy.barsPreLoaderWait();
242
+ highlightImagePage.steps.addQuestionInstructions();
243
+ uploadImageSectionComponent.steps.uploadFile('highlightImage.jpg');
244
+ uploadImageSectionComponent.steps.verifyUploadedImageInImagePopup();
245
+ uploadImageSectionComponent.steps.clickOnImagePopupOkButton();
246
+ utilities.verifyElementVisibilityState(uploadImageSectionComponent.uploadImagePopup(), 'notExist');
247
+ highlightImagePage.steps.verifyImageUploadedInHighlightRegion();
248
+ highlightImagePage.steps.verifyImageUploadedInSetCorrectAnswerSection();
249
+ highlightImagePage.steps.highlightRegionInImage(flowerHighlightRegion);
250
+ highlightImagePage.steps.highlightRegionInImage(branchesHighlightRegion);
251
+ highlightImagePage.steps.highlightRegionInImage(leafHighlightRegion);
252
+ highlightImagePage.steps.highlightRegionInImage(rootsHighlightRegion);
253
+ highlightImagePage.steps.checkMultipleSelectionCheckbox();
254
+ highlightImagePage.steps.highlightARegionInSetCorrectAnswerSection(0);
255
+ highlightImagePage.steps.highlightARegionInSetCorrectAnswerSection(3);
256
+ highlightImagePage.steps.allotPoints(20);
257
+ highlightImagePage.steps.clickOnAddAlternateAnswerButton();
258
+ highlightImagePage.steps.highlightARegionInSetCorrectAnswerSection(0);
259
+ highlightImagePage.steps.highlightARegionInSetCorrectAnswerSection(1);
260
+ highlightImagePage.steps.allotPoints(12);
261
+ highlightImagePage.steps.expandAdditonalSettings();
262
+ highlightImagePage.steps.checkAllowStudentsToCheckAnswerCheckbox();
263
+ highlightImagePage.steps.switchToPreviewTab();
264
+ });
265
+
266
+ it('When the user selects \'Show correct answer\' checkbox without attempting the question then the correct tab regions should be highlighted, correct/incorrect answer label and border should not be displayed and correct answer container should not be displayed', () => {
267
+ cy.log('Total points displayed besides Show correct answer checkbox should be of alternate answer points')
268
+ highlightImagePage.steps.verifyPreviewTabScoreText(0, 20);
269
+ highlightImagePage.steps.checkShowCorrectAnswerCheckbox();
270
+ highlightImagePage.steps.verifyCorrectIncorrectBorderNotVisible();
271
+ highlightImagePage.steps.verifyCorrectIncorrectIconsDoesNotExist();
272
+ highlightImagePage.steps.verifyCorrectAnswerContainerDoesNotExist();
273
+ highlightImagePage.steps.verifyCorrectHighlightRegion(0);
274
+ highlightImagePage.steps.verifyDefaultHighlightRegion(1);
275
+ highlightImagePage.steps.verifyDefaultHighlightRegion(2);
276
+ highlightImagePage.steps.verifyCorrectHighlightRegion(3);
277
+ cy.log('Post step: Unchecking the show correct answer checkbox')
278
+ highlightImagePage.steps.uncheckShowCorrectAnswerCheckbox();
279
+ });
280
+
281
+ it('When the user attempts the question according to the correct tab then user should be awarded with full points and on selecting \'Show correct answer\' checkbox green check-mark icons and green background should be displayed for all the correct tab highlight regions, \'Correct\' label and border should be displayed and the correct answers container should not be displayed', () => {
282
+ highlightImagePage.steps.highlightARegionInPreviewTab(0);
283
+ highlightImagePage.steps.highlightARegionInPreviewTab(3);
284
+ highlightImagePage.steps.verifyPreviewTabScoreText(20, 20);
285
+ highlightImagePage.steps.checkShowCorrectAnswerCheckbox();
286
+ highlightImagePage.steps.verifyCorrectHighlightRegion(0);
287
+ highlightImagePage.steps.verifyDefaultHighlightRegion(1);
288
+ highlightImagePage.steps.verifyDefaultHighlightRegion(2);
289
+ highlightImagePage.steps.verifyCorrectHighlightRegion(3);
290
+ highlightImagePage.steps.verifyCorrectAnswerContainerDoesNotExist();
291
+ highlightImagePage.steps.verifyCorrectAttemptBorder();
292
+ highlightImagePage.steps.verifyCorrectIncorrectAnswerLabel('Correct');
293
+
294
+ highlightImagePage.steps.verifyQuestionPreviewStateWhenShowCorrectAnswerIsUnchecked();
295
+
296
+ cy.log('When user attempts the question correctly and clicks on the \'Check answer\' button, the user should be awarded full points and green check-mark icons and green background should be displayed in all correct highlight regions, a label \'Correct answer\' and border should be displayed below the question preview and the correct answer container should not be displayed')
297
+ highlightImagePage.steps.checkAnswer();
298
+ highlightImagePage.steps.verifyCorrectHighlightRegion(0);
299
+ highlightImagePage.steps.verifyDefaultHighlightRegion(1);
300
+ highlightImagePage.steps.verifyDefaultHighlightRegion(2);
301
+ highlightImagePage.steps.verifyCorrectHighlightRegion(3);
302
+ highlightImagePage.steps.verifyCorrectAttemptBorder();
303
+ highlightImagePage.steps.verifyCorrectIncorrectAnswerLabel('Correct');
304
+ highlightImagePage.steps.verifyCorrectAnswerContainerDoesNotExist();
305
+ });
306
+
307
+ it('When the user attempts the question according to the alternate tab then user should be awarded with points of the alternate tab(less than full points) and on selecting \'Show correct answer\' checkbox green check-mark icons and green background should be displayed for all the alternate tab highlight regions, \'Correct\' label and border should be displayed and the correct answers container should not be displayed', () => {
308
+ highlightImagePage.steps.resetQuestionPreview();
309
+ highlightImagePage.steps.highlightARegionInPreviewTab(0);
310
+ highlightImagePage.steps.highlightARegionInPreviewTab(1);
311
+ highlightImagePage.steps.verifyPreviewTabScoreText(12, 20);
312
+ highlightImagePage.steps.checkShowCorrectAnswerCheckbox();
313
+ highlightImagePage.steps.verifyCorrectHighlightRegion(0);
314
+ highlightImagePage.steps.verifyCorrectHighlightRegion(1);
315
+ highlightImagePage.steps.verifyDefaultHighlightRegion(2);
316
+ highlightImagePage.steps.verifyCorrectHighlightRegion(3);
317
+ highlightImagePage.steps.verifyCorrectAnswerContainerDoesNotExist();
318
+ highlightImagePage.steps.verifyCorrectAttemptBorder();
319
+ highlightImagePage.steps.verifyCorrectIncorrectAnswerLabel('Correct');
320
+
321
+ highlightImagePage.steps.verifyQuestionPreviewStateWhenShowCorrectAnswerIsUnchecked();
322
+
323
+ cy.log('When user attempts the question correctly and clicks on the \'Check answer\' button, the user should be awarded full points and green check-mark icons and green background should be displayed in all correct highlight regions, a label \'Correct answer\' and border should be displayed below the question preview and the correct answer container should not be displayed')
324
+ highlightImagePage.steps.checkAnswer();
325
+ highlightImagePage.steps.verifyCorrectHighlightRegion(0);
326
+ highlightImagePage.steps.verifyCorrectHighlightRegion(1);
327
+ highlightImagePage.steps.verifyDefaultHighlightRegion(2);
328
+ highlightImagePage.steps.verifyDefaultHighlightRegion(3);
329
+ highlightImagePage.steps.verifyCorrectAttemptBorder();
330
+ highlightImagePage.steps.verifyCorrectIncorrectAnswerLabel('Correct');
331
+ highlightImagePage.steps.verifyCorrectAnswerContainerDoesNotExist();
332
+ });
333
+
334
+ it('When the user attempts the question partially correct exclusively according to the correct tab then 0 points should be awarded and on selecting \'Show correct answer\' checkbox green check-mark icons and green background should be displayed for all the correct tab highlight regions, \'Incorrect\' label and border should be displayed and the correct answers container should contain the correct answers of the unattempted options from the correct tab with numeration', () => {
335
+ highlightImagePage.steps.resetQuestionPreview();
336
+ highlightImagePage.steps.highlightARegionInPreviewTab(3);
337
+ highlightImagePage.steps.verifyPreviewTabScoreText(0, 20);
338
+ highlightImagePage.steps.checkShowCorrectAnswerCheckbox();
339
+ highlightImagePage.steps.verifyCorrectHighlightRegion(0);
340
+ highlightImagePage.steps.verifyDefaultHighlightRegion(1);
341
+ highlightImagePage.steps.verifyDefaultHighlightRegion(2);
342
+ highlightImagePage.steps.verifyCorrectHighlightRegion(3);
343
+ highlightImagePage.steps.verifyCorrectAnswerContainerContents(['Option 1'], [1]);
344
+ highlightImagePage.steps.verifyHighlightNumerationPreviewTab(0, 1);
345
+ highlightImagePage.steps.verifyIncorrectAttemptBorder();
346
+ highlightImagePage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect');
347
+
348
+ highlightImagePage.steps.verifyQuestionPreviewStateWhenShowCorrectAnswerIsUnchecked();
349
+
350
+ cy.log('When the user attempts the question partially correct exclusively according to the correct tab and clicks on the \'Check answer\' button, green check-mark icons and green background should be displayed for attempted correct tab highlight regions, a label \'Incorrect answer\' and border should be displayed below the question preview and the correct answer container should not be displayed')
351
+ highlightImagePage.steps.checkAnswer();
352
+ highlightImagePage.steps.verifyDefaultHighlightRegion(0);
353
+ highlightImagePage.steps.verifyDefaultHighlightRegion(1);
354
+ highlightImagePage.steps.verifyDefaultHighlightRegion(2);
355
+ highlightImagePage.steps.verifyCorrectHighlightRegion(3);
356
+ highlightImagePage.steps.verifyCorrectAnswerContainerDoesNotExist();
357
+ highlightImagePage.steps.verifyIncorrectAttemptBorder();
358
+ highlightImagePage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect');
359
+ });
360
+
361
+ it('When the user attempts the question partially correct exclusively according to the alternate tab then 0 points should be awarded and on selecting \'Show correct answer\' checkbox green check-mark icons and green background should be displayed for all the correct tab highlight regions and alternate tab selected highlight region, \'Incorrect\' label and border should be displayed and the correct answers container should contain the correct answers of the unattempted options from the alternate tab with numeration', () => {
362
+ highlightImagePage.steps.resetQuestionPreview();
363
+ highlightImagePage.steps.highlightARegionInPreviewTab(1);
364
+ highlightImagePage.steps.verifyPreviewTabScoreText(0, 20);
365
+ highlightImagePage.steps.checkShowCorrectAnswerCheckbox();
366
+ highlightImagePage.steps.verifyCorrectHighlightRegion(0);
367
+ highlightImagePage.steps.verifyCorrectHighlightRegion(1);
368
+ highlightImagePage.steps.verifyDefaultHighlightRegion(2);
369
+ highlightImagePage.steps.verifyCorrectHighlightRegion(3);
370
+ highlightImagePage.steps.verifyCorrectAnswerContainerContents(['Option 1'], [1]);
371
+ highlightImagePage.steps.verifyHighlightNumerationPreviewTab(0, 1);
372
+ highlightImagePage.steps.verifyIncorrectAttemptBorder();
373
+ highlightImagePage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect');
374
+
375
+ highlightImagePage.steps.verifyQuestionPreviewStateWhenShowCorrectAnswerIsUnchecked();
376
+
377
+ cy.log('When the user attempts the question partially correct exclusively according to the correct tab and clicks on the \'Check answer\' button, green check-mark icons and green background should be displayed for attempted correct tab highlight regions, a label \'Incorrect answer\' and border should be displayed below the question preview and the correct answer container should not be displayed')
378
+ highlightImagePage.steps.checkAnswer();
379
+ highlightImagePage.steps.verifyDefaultHighlightRegion(0);
380
+ highlightImagePage.steps.verifyCorrectHighlightRegion(1);
381
+ highlightImagePage.steps.verifyDefaultHighlightRegion(2);
382
+ highlightImagePage.steps.verifyDefaultHighlightRegion(3);
383
+ highlightImagePage.steps.verifyCorrectAnswerContainerDoesNotExist();
384
+ highlightImagePage.steps.verifyIncorrectAttemptBorder();
385
+ highlightImagePage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect');
386
+ });
387
+
388
+ it('When the user attempts the question partially correct with equal number of highlight regions from the correct and alternate tab then user should be awarded 0 points and on selecting \'Show correct answer\' checkbox green check-mark icons and green background should be displayed for all the correct tab highlight regions and red cross-mark icon with red background should be displayed for selected alternate tab highlight region, \'Incorrect\' label and border should be displayed and the correct answers container should contain the correct answers of the unattempted options from the correct tab with numeration', () => {
389
+ highlightImagePage.steps.resetQuestionPreview();
390
+ highlightImagePage.steps.highlightARegionInPreviewTab(1);
391
+ highlightImagePage.steps.highlightARegionInPreviewTab(3);
392
+ highlightImagePage.steps.verifyPreviewTabScoreText(0, 20);
393
+ highlightImagePage.steps.checkShowCorrectAnswerCheckbox();
394
+ highlightImagePage.steps.verifyCorrectHighlightRegion(0);
395
+ highlightImagePage.steps.verifyIncorrectHighlightRegion(1);
396
+ highlightImagePage.steps.verifyDefaultHighlightRegion(2);
397
+ highlightImagePage.steps.verifyCorrectHighlightRegion(3);
398
+ highlightImagePage.steps.verifyCorrectAnswerContainerContents(['Option 1'], [1]);
399
+ highlightImagePage.steps.verifyHighlightNumerationPreviewTab(0, 1);
400
+ highlightImagePage.steps.verifyIncorrectAttemptBorder();
401
+ highlightImagePage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect');
402
+
403
+ highlightImagePage.steps.verifyQuestionPreviewStateWhenShowCorrectAnswerIsUnchecked();
404
+
405
+ cy.log('When the user attempts the question partially correct with equal number highlight regions from the correct and alternate tab and clicks on the \'Check answer\' button, green check-mark icons and green background should be displayed for attempted correct tab highlight regions, a label \'Incorrect answer\' and border should be displayed below the question preview and the correct answer container should not be displayed')
406
+ highlightImagePage.steps.checkAnswer();
407
+ highlightImagePage.steps.verifyDefaultHighlightRegion(0);
408
+ highlightImagePage.steps.verifyIncorrectHighlightRegion(1);
409
+ highlightImagePage.steps.verifyDefaultHighlightRegion(2);
410
+ highlightImagePage.steps.verifyCorrectHighlightRegion(3);
411
+ highlightImagePage.steps.verifyCorrectAnswerContainerDoesNotExist();
412
+ highlightImagePage.steps.verifyIncorrectAttemptBorder();
413
+ highlightImagePage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect');
414
+ });
415
+
416
+ it('Race condition 1: When the user attempts the question with the common highlight region between correct tab and alternate tab then user should be awarded 0 points and on selecting \'Show correct answer\' checkbox green check-mark icons and green background should be displayed for all the correct tab highlight regions, \'Incorrect\' label and border should be displayed and the correct answers container should contain the correct answers of the unattempted options from the correct tab with numeration', () => {
417
+ highlightImagePage.steps.resetQuestionPreview();
418
+ highlightImagePage.steps.highlightARegionInPreviewTab(0);
419
+ highlightImagePage.steps.verifyPreviewTabScoreText(0, 20);
420
+ highlightImagePage.steps.checkShowCorrectAnswerCheckbox();
421
+ highlightImagePage.steps.verifyCorrectHighlightRegion(0);
422
+ highlightImagePage.steps.verifyDefaultHighlightRegion(1);
423
+ highlightImagePage.steps.verifyDefaultHighlightRegion(2);
424
+ highlightImagePage.steps.verifyCorrectHighlightRegion(3);
425
+ highlightImagePage.steps.verifyCorrectAnswerContainerContents(['Option 4'], [1]);
426
+ highlightImagePage.steps.verifyHighlightNumerationPreviewTab(3, 4);
427
+ highlightImagePage.steps.verifyIncorrectAttemptBorder();
428
+ highlightImagePage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect');
429
+
430
+ highlightImagePage.steps.verifyQuestionPreviewStateWhenShowCorrectAnswerIsUnchecked();
431
+
432
+ cy.log('When the user attempts the question partially correct with equal number highlight regions from the correct and alternate tab and clicks on the \'Check answer\' button, green check-mark icons and green background should be displayed for attempted correct tab highlight regions, a label \'Incorrect answer\' and border should be displayed below the question preview and the correct answer container should not be displayed')
433
+ highlightImagePage.steps.checkAnswer();
434
+ highlightImagePage.steps.verifyCorrectHighlightRegion(0);
435
+ highlightImagePage.steps.verifyDefaultHighlightRegion(1);
436
+ highlightImagePage.steps.verifyDefaultHighlightRegion(2);
437
+ highlightImagePage.steps.verifyDefaultHighlightRegion(3);
438
+ highlightImagePage.steps.verifyCorrectAnswerContainerDoesNotExist();
439
+ highlightImagePage.steps.verifyIncorrectAttemptBorder();
440
+ highlightImagePage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect');
441
+ });
442
+
443
+ it('Race condition 2: When the user attempts the question with the all highlight regions of correct tab and alternate tab then user should be awarded 0 points and on selecting \'Show correct answer\' checkbox green check-mark icons and green background should be displayed for all the correct tab highlight regions, and red cross-mark icon and red background should be displayed for the alternate tab highlight region, \'Incorrect\' label and border should be displayed and the correct answers container should not be displayed', () => {
444
+ highlightImagePage.steps.resetQuestionPreview();
445
+ highlightImagePage.steps.highlightARegionInPreviewTab(0);
446
+ highlightImagePage.steps.highlightARegionInPreviewTab(1);
447
+ highlightImagePage.steps.highlightARegionInPreviewTab(3);
448
+ highlightImagePage.steps.verifyPreviewTabScoreText(0, 20);
449
+ highlightImagePage.steps.checkShowCorrectAnswerCheckbox();
450
+ highlightImagePage.steps.verifyCorrectHighlightRegion(0);
451
+ highlightImagePage.steps.verifyIncorrectHighlightRegion(1);
452
+ highlightImagePage.steps.verifyDefaultHighlightRegion(2);
453
+ highlightImagePage.steps.verifyCorrectHighlightRegion(3);
454
+ highlightImagePage.steps.verifyCorrectAnswerContainerDoesNotExist();
455
+ highlightImagePage.steps.verifyIncorrectAttemptBorder();
456
+ highlightImagePage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect');
457
+
458
+ highlightImagePage.steps.verifyQuestionPreviewStateWhenShowCorrectAnswerIsUnchecked();
459
+
460
+ cy.log('When the user attempts the question partially correct with equal number highlight regions from the correct and alternate tab and clicks on the \'Check answer\' button, green check-mark icons and green background should be displayed for attempted correct tab highlight regions, a label \'Incorrect answer\' and border should be displayed below the question preview and the correct answer container should not be displayed')
461
+ highlightImagePage.steps.checkAnswer();
462
+ highlightImagePage.steps.verifyCorrectHighlightRegion(0);
463
+ highlightImagePage.steps.verifyIncorrectHighlightRegion(1);
464
+ highlightImagePage.steps.verifyDefaultHighlightRegion(2);
465
+ highlightImagePage.steps.verifyCorrectHighlightRegion(3);
466
+ highlightImagePage.steps.verifyCorrectAnswerContainerDoesNotExist();
467
+ highlightImagePage.steps.verifyIncorrectAttemptBorder();
468
+ highlightImagePage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect');
469
+ });
470
+
471
+ it('When user attempts the question incorrectly then user should be awarded 0 points and on selecting \'Show correct answer\' checkbox green check-mark icons and green background should be displayed for the correct tab highlight regions, and red cross-mark icon and red background should be displayed for the incorrect highlight region, \'Incorrect\' label and border should be displayed and the correct answer container should contain the correct answers of the options from the correct tab with numeration', () => {
472
+ highlightImagePage.steps.resetQuestionPreview();
473
+ highlightImagePage.steps.highlightARegionInPreviewTab(2);
474
+ highlightImagePage.steps.verifyPreviewTabScoreText(0, 20);
475
+ highlightImagePage.steps.checkShowCorrectAnswerCheckbox();
476
+ highlightImagePage.steps.verifyCorrectHighlightRegion(0);
477
+ highlightImagePage.steps.verifyDefaultHighlightRegion(1);
478
+ highlightImagePage.steps.verifyIncorrectHighlightRegion(2);
479
+ highlightImagePage.steps.verifyCorrectHighlightRegion(3);
480
+ highlightImagePage.steps.verifyCorrectAnswerContainerContents(['Option 1', 'Option 4'], [1, 2]);
481
+ highlightImagePage.steps.verifyHighlightNumerationPreviewTab(0, 1);
482
+ highlightImagePage.steps.verifyHighlightNumerationPreviewTab(3, 4);
483
+ highlightImagePage.steps.verifyIncorrectAttemptBorder();
484
+ highlightImagePage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect');
485
+
486
+ highlightImagePage.steps.verifyQuestionPreviewStateWhenShowCorrectAnswerIsUnchecked();
487
+
488
+ cy.log('When the user attempts the question partially correct with equal number highlight regions from the correct and alternate tab and clicks on the \'Check answer\' button, green check-mark icons and green background should be displayed for attempted correct tab highlight regions, a label \'Incorrect answer\' and border should be displayed below the question preview and the correct answer container should not be displayed')
489
+ highlightImagePage.steps.checkAnswer();
490
+ highlightImagePage.steps.verifyDefaultHighlightRegion(0);
491
+ highlightImagePage.steps.verifyDefaultHighlightRegion(1);
492
+ highlightImagePage.steps.verifyIncorrectHighlightRegion(2);
493
+ highlightImagePage.steps.verifyDefaultHighlightRegion(3);
494
+ highlightImagePage.steps.verifyCorrectAnswerContainerDoesNotExist();
495
+ highlightImagePage.steps.verifyIncorrectAttemptBorder();
496
+ highlightImagePage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect');
497
+ });
498
+ });
499
+
500
+ describe('Question Preview: AutoScored - All or Nothing with alternate answer: When alternate answer points are more than correct answer points', () => {
501
+ abortEarlySetup();
502
+ before(() => {
503
+ cy.log('Navigating to highlight image question type');
504
+ highlightImagePage.steps.navigateToCreateQuestion('highlight image');
505
+ cy.barsPreLoaderWait();
506
+ highlightImagePage.steps.addQuestionInstructions();
507
+ uploadImageSectionComponent.steps.uploadFile('highlightImage.jpg');
508
+ uploadImageSectionComponent.steps.verifyUploadedImageInImagePopup();
509
+ uploadImageSectionComponent.steps.clickOnImagePopupOkButton();
510
+ utilities.verifyElementVisibilityState(uploadImageSectionComponent.uploadImagePopup(), 'notExist');
511
+ highlightImagePage.steps.verifyImageUploadedInHighlightRegion();
512
+ highlightImagePage.steps.verifyImageUploadedInSetCorrectAnswerSection();
513
+ highlightImagePage.steps.highlightRegionInImage(flowerHighlightRegion);
514
+ highlightImagePage.steps.highlightRegionInImage(branchesHighlightRegion);
515
+ highlightImagePage.steps.highlightRegionInImage(leafHighlightRegion);
516
+ highlightImagePage.steps.highlightRegionInImage(rootsHighlightRegion);
517
+ highlightImagePage.steps.checkMultipleSelectionCheckbox();
518
+ highlightImagePage.steps.highlightARegionInSetCorrectAnswerSection(0);
519
+ highlightImagePage.steps.highlightARegionInSetCorrectAnswerSection(3);
520
+ highlightImagePage.steps.allotPoints(12);
521
+ highlightImagePage.steps.clickOnAddAlternateAnswerButton();
522
+ highlightImagePage.steps.highlightARegionInSetCorrectAnswerSection(0);
523
+ highlightImagePage.steps.highlightARegionInSetCorrectAnswerSection(1);
524
+ highlightImagePage.steps.allotPoints(20);
525
+ highlightImagePage.steps.expandAdditonalSettings();
526
+ highlightImagePage.steps.checkAllowStudentsToCheckAnswerCheckbox();
527
+ highlightImagePage.steps.switchToPreviewTab();
528
+ });
529
+
530
+ it('When the user selects \'Show correct answer\' checkbox without attempting the question then the alternate tab regions should be highlighted, correct/incorrect answer label and border should not be displayed and correct answer container should not be displayed', () => {
531
+ cy.log('Total points displayed besides Show correct answer checkbox should be of alternate answer points')
532
+ highlightImagePage.steps.verifyPreviewTabScoreText(0, 20);
533
+ highlightImagePage.steps.checkShowCorrectAnswerCheckbox();
534
+ highlightImagePage.steps.verifyCorrectIncorrectBorderNotVisible();
535
+ highlightImagePage.steps.verifyCorrectIncorrectIconsDoesNotExist();
536
+ highlightImagePage.steps.verifyCorrectAnswerContainerDoesNotExist();
537
+ highlightImagePage.steps.verifyCorrectHighlightRegion(0);
538
+ highlightImagePage.steps.verifyCorrectHighlightRegion(1);
539
+ highlightImagePage.steps.verifyDefaultHighlightRegion(2);
540
+ highlightImagePage.steps.verifyDefaultHighlightRegion(3);
541
+ cy.log('Post step: Unchecking the show correct answer checkbox')
542
+ highlightImagePage.steps.uncheckShowCorrectAnswerCheckbox();
543
+ });
544
+
545
+ it('When the user attempts the question according to the correct tab then user should be awarded with points of the correct tab (less than full points) and on selecting \'Show correct answer\' checkbox green check-mark icons and green background should be displayed for all the correct tab highlight regions, \'Correct\' label and border should be displayed and the correct answers container should not be displayed', () => {
546
+ highlightImagePage.steps.highlightARegionInPreviewTab(0);
547
+ highlightImagePage.steps.highlightARegionInPreviewTab(3);
548
+ highlightImagePage.steps.verifyPreviewTabScoreText(12, 20);
549
+ highlightImagePage.steps.checkShowCorrectAnswerCheckbox();
550
+ highlightImagePage.steps.verifyCorrectHighlightRegion(0);
551
+ highlightImagePage.steps.verifyCorrectHighlightRegion(1);
552
+ highlightImagePage.steps.verifyDefaultHighlightRegion(2);
553
+ highlightImagePage.steps.verifyCorrectHighlightRegion(3);
554
+ highlightImagePage.steps.verifyCorrectAnswerContainerDoesNotExist();
555
+ highlightImagePage.steps.verifyCorrectAttemptBorder();
556
+ highlightImagePage.steps.verifyCorrectIncorrectAnswerLabel('Correct');
557
+
558
+ highlightImagePage.steps.verifyQuestionPreviewStateWhenShowCorrectAnswerIsUnchecked();
559
+
560
+ cy.log('When user attempts the question correctly and clicks on the \'Check answer\' button, green check-mark icons and green background should be displayed in all correct highlight regions, a label \'Correct answer\' and border should be displayed below the question preview and the correct answer container should not be displayed')
561
+ highlightImagePage.steps.checkAnswer();
562
+ highlightImagePage.steps.verifyCorrectHighlightRegion(0);
563
+ highlightImagePage.steps.verifyDefaultHighlightRegion(1);
564
+ highlightImagePage.steps.verifyDefaultHighlightRegion(2);
565
+ highlightImagePage.steps.verifyCorrectHighlightRegion(3);
566
+ highlightImagePage.steps.verifyCorrectAttemptBorder();
567
+ highlightImagePage.steps.verifyCorrectIncorrectAnswerLabel('Correct');
568
+ highlightImagePage.steps.verifyCorrectAnswerContainerDoesNotExist();
569
+ });
570
+
571
+ it('When the user attempts the question according to the alternate tab then user should be awarded with full points and on selecting \'Show correct answer\' checkbox green check-mark icons and green background should be displayed for all the alternate tab highlight regions, \'Correct\' label and border should be displayed and the correct answers container should not be displayed', () => {
572
+ highlightImagePage.steps.resetQuestionPreview();
573
+ highlightImagePage.steps.highlightARegionInPreviewTab(0);
574
+ highlightImagePage.steps.highlightARegionInPreviewTab(1);
575
+ highlightImagePage.steps.verifyPreviewTabScoreText(20, 20);
576
+ highlightImagePage.steps.checkShowCorrectAnswerCheckbox();
577
+ highlightImagePage.steps.verifyCorrectHighlightRegion(0);
578
+ highlightImagePage.steps.verifyCorrectHighlightRegion(1);
579
+ highlightImagePage.steps.verifyDefaultHighlightRegion(2);
580
+ highlightImagePage.steps.verifyDefaultHighlightRegion(3);
581
+ highlightImagePage.steps.verifyCorrectAnswerContainerDoesNotExist();
582
+ highlightImagePage.steps.verifyCorrectAttemptBorder();
583
+ highlightImagePage.steps.verifyCorrectIncorrectAnswerLabel('Correct');
584
+
585
+ highlightImagePage.steps.verifyQuestionPreviewStateWhenShowCorrectAnswerIsUnchecked();
586
+
587
+ cy.log('When user attempts the question correctly and clicks on the \'Check answer\' button green check-mark icons and green background should be displayed in all correct highlight regions, a label \'Correct answer\' and border should be displayed below the question preview and the correct answer container should not be displayed')
588
+ highlightImagePage.steps.checkAnswer();
589
+ highlightImagePage.steps.verifyCorrectHighlightRegion(0);
590
+ highlightImagePage.steps.verifyCorrectHighlightRegion(1);
591
+ highlightImagePage.steps.verifyDefaultHighlightRegion(2);
592
+ highlightImagePage.steps.verifyDefaultHighlightRegion(3);
593
+ highlightImagePage.steps.verifyCorrectAttemptBorder();
594
+ highlightImagePage.steps.verifyCorrectIncorrectAnswerLabel('Correct');
595
+ highlightImagePage.steps.verifyCorrectAnswerContainerDoesNotExist();
596
+ });
597
+
598
+ it('When the user attempts the question partially correct exclusively according to the correct tab then 0 points should be awarded and on selecting \'Show correct answer\' checkbox green check-mark icons and green background should be displayed for all the alternate tab highlight regions and for the selected correct tab highlight region, \'Incorrect\' label and border should be displayed and the correct answers container should contain the correct answers of the unattempted options from the correct tab with numeration', () => {
599
+ highlightImagePage.steps.resetQuestionPreview();
600
+ highlightImagePage.steps.highlightARegionInPreviewTab(3);
601
+ highlightImagePage.steps.verifyPreviewTabScoreText(0, 20);
602
+ highlightImagePage.steps.checkShowCorrectAnswerCheckbox();
603
+ highlightImagePage.steps.verifyCorrectHighlightRegion(0);
604
+ highlightImagePage.steps.verifyCorrectHighlightRegion(1);
605
+ highlightImagePage.steps.verifyDefaultHighlightRegion(2);
606
+ highlightImagePage.steps.verifyCorrectHighlightRegion(3);
607
+ highlightImagePage.steps.verifyCorrectAnswerContainerContents(['Option 1'], [1]);
608
+ highlightImagePage.steps.verifyHighlightNumerationPreviewTab(0, 1);
609
+ highlightImagePage.steps.verifyIncorrectAttemptBorder();
610
+ highlightImagePage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect');
611
+
612
+ highlightImagePage.steps.verifyQuestionPreviewStateWhenShowCorrectAnswerIsUnchecked();
613
+
614
+ cy.log('When the user attempts the question partially correct exclusively according to the correct tab and clicks on the \'Check answer\' button, green check-mark icons and green background should be displayed for attempted correct tab highlight regions, a label \'Incorrect answer\' and border should be displayed below the question preview and the correct answer container should not be displayed')
615
+ highlightImagePage.steps.checkAnswer();
616
+ highlightImagePage.steps.verifyDefaultHighlightRegion(0);
617
+ highlightImagePage.steps.verifyDefaultHighlightRegion(1);
618
+ highlightImagePage.steps.verifyDefaultHighlightRegion(2);
619
+ highlightImagePage.steps.verifyCorrectHighlightRegion(3);
620
+ highlightImagePage.steps.verifyCorrectAnswerContainerDoesNotExist();
621
+ highlightImagePage.steps.verifyIncorrectAttemptBorder();
622
+ highlightImagePage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect');
623
+ });
624
+
625
+ it('When the user attempts the question partially correct exclusively according to the alternate tab then 0 points should be awarded and on selecting \'Show correct answer\' checkbox green check-mark icons and green background should be displayed for all the alternate tab highlight regions \'Incorrect\' label and border should be displayed and the correct answers container should contain the correct answers of the unattempted options from the alternate tab with numeration', () => {
626
+ highlightImagePage.steps.resetQuestionPreview();
627
+ highlightImagePage.steps.highlightARegionInPreviewTab(1);
628
+ highlightImagePage.steps.verifyPreviewTabScoreText(0, 20);
629
+ highlightImagePage.steps.checkShowCorrectAnswerCheckbox();
630
+ highlightImagePage.steps.verifyCorrectHighlightRegion(0);
631
+ highlightImagePage.steps.verifyCorrectHighlightRegion(1);
632
+ highlightImagePage.steps.verifyDefaultHighlightRegion(2);
633
+ highlightImagePage.steps.verifyDefaultHighlightRegion(3);
634
+ highlightImagePage.steps.verifyCorrectAnswerContainerContents(['Option 1'], [1]);
635
+ highlightImagePage.steps.verifyHighlightNumerationPreviewTab(0, 1);
636
+ highlightImagePage.steps.verifyIncorrectAttemptBorder();
637
+ highlightImagePage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect');
638
+
639
+ highlightImagePage.steps.verifyQuestionPreviewStateWhenShowCorrectAnswerIsUnchecked();
640
+
641
+ cy.log('When the user attempts the question partially correct exclusively according to the correct tab and clicks on the \'Check answer\' button, green check-mark icons and green background should be displayed for attempted correct tab highlight regions, a label \'Incorrect answer\' and border should be displayed below the question preview and the correct answer container should not be displayed')
642
+ highlightImagePage.steps.checkAnswer();
643
+ highlightImagePage.steps.verifyDefaultHighlightRegion(0);
644
+ highlightImagePage.steps.verifyCorrectHighlightRegion(1);
645
+ highlightImagePage.steps.verifyDefaultHighlightRegion(2);
646
+ highlightImagePage.steps.verifyDefaultHighlightRegion(3);
647
+ highlightImagePage.steps.verifyCorrectAnswerContainerDoesNotExist();
648
+ highlightImagePage.steps.verifyIncorrectAttemptBorder();
649
+ highlightImagePage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect');
650
+ });
651
+
652
+ it('When the user attempts the question partially correct with equal number of highlight regions from the correct and alternate tab then user should be awarded 0 points and on selecting \'Show correct answer\' checkbox green check-mark icons and green background should be displayed for all the alternate tab highlight regions and selected correct tab highlight region, \'Incorrect\' label and border should be displayed and the correct answers container should contain the correct answers of the unattempted options from the alternate tab with numeration', () => {
653
+ highlightImagePage.steps.resetQuestionPreview();
654
+ highlightImagePage.steps.highlightARegionInPreviewTab(1);
655
+ highlightImagePage.steps.highlightARegionInPreviewTab(3);
656
+ highlightImagePage.steps.verifyPreviewTabScoreText(0, 20);
657
+ highlightImagePage.steps.checkShowCorrectAnswerCheckbox();
658
+ highlightImagePage.steps.verifyCorrectHighlightRegion(0);
659
+ highlightImagePage.steps.verifyCorrectHighlightRegion(1);
660
+ highlightImagePage.steps.verifyDefaultHighlightRegion(2);
661
+ highlightImagePage.steps.verifyIncorrectHighlightRegion(3);
662
+ highlightImagePage.steps.verifyCorrectAnswerContainerContents(['Option 1'], [1]);
663
+ highlightImagePage.steps.verifyHighlightNumerationPreviewTab(0, 1);
664
+ highlightImagePage.steps.verifyIncorrectAttemptBorder();
665
+ highlightImagePage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect');
666
+
667
+ highlightImagePage.steps.verifyQuestionPreviewStateWhenShowCorrectAnswerIsUnchecked();
668
+
669
+ cy.log('When the user attempts the question partially correct with equal number highlight regions from the correct and alternate tab and clicks on the \'Check answer\' button, green check-mark icons and green background should be displayed for attempted correct tab highlight regions, a label \'Incorrect answer\' and border should be displayed below the question preview and the correct answer container should not be displayed')
670
+ highlightImagePage.steps.checkAnswer();
671
+ highlightImagePage.steps.verifyDefaultHighlightRegion(0);
672
+ highlightImagePage.steps.verifyCorrectHighlightRegion(1);
673
+ highlightImagePage.steps.verifyDefaultHighlightRegion(2);
674
+ highlightImagePage.steps.verifyIncorrectHighlightRegion(3);
675
+ highlightImagePage.steps.verifyCorrectAnswerContainerDoesNotExist();
676
+ highlightImagePage.steps.verifyIncorrectAttemptBorder();
677
+ highlightImagePage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect');
678
+ });
679
+
680
+ it('Race condition 1: When the user attempts the question with the common highlight region between correct tab and alternate tab then user should be awarded 0 points and on selecting \'Show correct answer\' checkbox green check-mark icons and green background should be displayed for all the alternate tab highlight regions, \'Incorrect\' label and border should be displayed and the correct answers container should contain the correct answers of the unattempted options from the alternate tab with numeration', () => {
681
+ highlightImagePage.steps.resetQuestionPreview();
682
+ highlightImagePage.steps.highlightARegionInPreviewTab(0);
683
+ highlightImagePage.steps.verifyPreviewTabScoreText(0, 20);
684
+ highlightImagePage.steps.checkShowCorrectAnswerCheckbox();
685
+ highlightImagePage.steps.verifyCorrectHighlightRegion(0);
686
+ highlightImagePage.steps.verifyCorrectHighlightRegion(1);
687
+ highlightImagePage.steps.verifyDefaultHighlightRegion(2);
688
+ highlightImagePage.steps.verifyDefaultHighlightRegion(3);
689
+ highlightImagePage.steps.verifyCorrectAnswerContainerContents(['Option 2'], [1]);
690
+ highlightImagePage.steps.verifyHighlightNumerationPreviewTab(1, 2);
691
+ highlightImagePage.steps.verifyIncorrectAttemptBorder();
692
+ highlightImagePage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect');
693
+
694
+ highlightImagePage.steps.verifyQuestionPreviewStateWhenShowCorrectAnswerIsUnchecked();
695
+
696
+ cy.log('When the user attempts the question partially correct with equal number highlight regions from the correct and alternate tab and clicks on the \'Check answer\' button, green check-mark icons and green background should be displayed for attempted correct tab highlight regions, a label \'Incorrect answer\' and border should be displayed below the question preview and the correct answer container should not be displayed')
697
+ highlightImagePage.steps.checkAnswer();
698
+ highlightImagePage.steps.verifyCorrectHighlightRegion(0);
699
+ highlightImagePage.steps.verifyDefaultHighlightRegion(1);
700
+ highlightImagePage.steps.verifyDefaultHighlightRegion(2);
701
+ highlightImagePage.steps.verifyDefaultHighlightRegion(3);
702
+ highlightImagePage.steps.verifyCorrectAnswerContainerDoesNotExist();
703
+ highlightImagePage.steps.verifyIncorrectAttemptBorder();
704
+ highlightImagePage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect');
705
+ });
706
+
707
+ it('Race condition 2: When the user attempts the question with the all highlight regions of correct tab and alternate tab then user should be awarded 0 points and on selecting \'Show correct answer\' checkbox green check-mark icons and green background should be displayed for all the alternate tab highlight regions, and red cross-mark icon and red background should be displayed for the correct tab highlight region, \'Incorrect\' label and border should be displayed and the correct answers container should not be displayed', () => {
708
+ highlightImagePage.steps.resetQuestionPreview();
709
+ highlightImagePage.steps.highlightARegionInPreviewTab(0);
710
+ highlightImagePage.steps.highlightARegionInPreviewTab(1);
711
+ highlightImagePage.steps.highlightARegionInPreviewTab(3);
712
+ highlightImagePage.steps.verifyPreviewTabScoreText(0, 20);
713
+ highlightImagePage.steps.checkShowCorrectAnswerCheckbox();
714
+ highlightImagePage.steps.verifyCorrectHighlightRegion(0);
715
+ highlightImagePage.steps.verifyCorrectHighlightRegion(1);
716
+ highlightImagePage.steps.verifyDefaultHighlightRegion(2);
717
+ highlightImagePage.steps.verifyIncorrectHighlightRegion(3);
718
+ highlightImagePage.steps.verifyCorrectAnswerContainerDoesNotExist();
719
+ highlightImagePage.steps.verifyIncorrectAttemptBorder();
720
+ highlightImagePage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect');
721
+
722
+ highlightImagePage.steps.verifyQuestionPreviewStateWhenShowCorrectAnswerIsUnchecked();
723
+
724
+ cy.log('When the user attempts the question partially correct with equal number highlight regions from the correct and alternate tab and clicks on the \'Check answer\' button, green check-mark icons and green background should be displayed for attempted correct tab highlight regions, a label \'Incorrect answer\' and border should be displayed below the question preview and the correct answer container should not be displayed')
725
+ highlightImagePage.steps.checkAnswer();
726
+ highlightImagePage.steps.verifyCorrectHighlightRegion(0);
727
+ highlightImagePage.steps.verifyCorrectHighlightRegion(1);
728
+ highlightImagePage.steps.verifyDefaultHighlightRegion(2);
729
+ highlightImagePage.steps.verifyIncorrectHighlightRegion(3);
730
+ highlightImagePage.steps.verifyCorrectAnswerContainerDoesNotExist();
731
+ highlightImagePage.steps.verifyIncorrectAttemptBorder();
732
+ highlightImagePage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect');
733
+ });
734
+
735
+ it('When user attempts the question incorrectly then user should be awarded 0 points and on selecting \'Show correct answer\' checkbox green check-mark icons and green background should be displayed for the correct tab highlight regions, and red cross-mark icon and red background should be displayed for the incorrect highlight region, \'Incorrect\' label and border should be displayed and the correct answer container should contain the correct answers of the options from the correct tab with numeration', () => {
736
+ highlightImagePage.steps.resetQuestionPreview();
737
+ highlightImagePage.steps.highlightARegionInPreviewTab(2);
738
+ highlightImagePage.steps.verifyPreviewTabScoreText(0, 20);
739
+ highlightImagePage.steps.checkShowCorrectAnswerCheckbox();
740
+ highlightImagePage.steps.verifyCorrectHighlightRegion(0);
741
+ highlightImagePage.steps.verifyCorrectHighlightRegion(1);
742
+ highlightImagePage.steps.verifyIncorrectHighlightRegion(2);
743
+ highlightImagePage.steps.verifyDefaultHighlightRegion(3);
744
+ highlightImagePage.steps.verifyCorrectAnswerContainerContents(['Option 1', 'Option 2'], [1, 2]);
745
+ highlightImagePage.steps.verifyHighlightNumerationPreviewTab(0, 1);
746
+ highlightImagePage.steps.verifyHighlightNumerationPreviewTab(1, 2);
747
+ highlightImagePage.steps.verifyIncorrectAttemptBorder();
748
+ highlightImagePage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect');
749
+
750
+ highlightImagePage.steps.verifyQuestionPreviewStateWhenShowCorrectAnswerIsUnchecked();
751
+
752
+ cy.log('When the user attempts the question partially correct with equal number highlight regions from the correct and alternate tab and clicks on the \'Check answer\' button, green check-mark icons and green background should be displayed for attempted correct tab highlight regions, a label \'Incorrect answer\' and border should be displayed below the question preview and the correct answer container should not be displayed')
753
+ highlightImagePage.steps.checkAnswer();
754
+ highlightImagePage.steps.verifyDefaultHighlightRegion(0);
755
+ highlightImagePage.steps.verifyDefaultHighlightRegion(1);
756
+ highlightImagePage.steps.verifyIncorrectHighlightRegion(2);
757
+ highlightImagePage.steps.verifyDefaultHighlightRegion(3);
758
+ highlightImagePage.steps.verifyCorrectAnswerContainerDoesNotExist();
759
+ highlightImagePage.steps.verifyIncorrectAttemptBorder();
760
+ highlightImagePage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect');
761
+ });
762
+ });
763
+
764
+ describe('Question Preview: AutoScored - All or Nothing with alternate answer: When correct answer points are equal to alternate answer points', () => {
765
+ abortEarlySetup();
766
+ before(() => {
767
+ cy.log('Navigating to highlight image question type');
768
+ highlightImagePage.steps.navigateToCreateQuestion('highlight image');
769
+ cy.barsPreLoaderWait();
770
+ highlightImagePage.steps.addQuestionInstructions();
771
+ uploadImageSectionComponent.steps.uploadFile('highlightImage.jpg');
772
+ uploadImageSectionComponent.steps.verifyUploadedImageInImagePopup();
773
+ uploadImageSectionComponent.steps.clickOnImagePopupOkButton();
774
+ utilities.verifyElementVisibilityState(uploadImageSectionComponent.uploadImagePopup(), 'notExist');
775
+ highlightImagePage.steps.verifyImageUploadedInHighlightRegion();
776
+ highlightImagePage.steps.verifyImageUploadedInSetCorrectAnswerSection();
777
+ highlightImagePage.steps.highlightRegionInImage(flowerHighlightRegion);
778
+ highlightImagePage.steps.highlightRegionInImage(branchesHighlightRegion);
779
+ highlightImagePage.steps.highlightRegionInImage(leafHighlightRegion);
780
+ highlightImagePage.steps.highlightRegionInImage(rootsHighlightRegion);
781
+ highlightImagePage.steps.checkMultipleSelectionCheckbox();
782
+ highlightImagePage.steps.highlightARegionInSetCorrectAnswerSection(0);
783
+ highlightImagePage.steps.highlightARegionInSetCorrectAnswerSection(3);
784
+ highlightImagePage.steps.allotPoints(20);
785
+ highlightImagePage.steps.clickOnAddAlternateAnswerButton();
786
+ highlightImagePage.steps.highlightARegionInSetCorrectAnswerSection(0);
787
+ highlightImagePage.steps.highlightARegionInSetCorrectAnswerSection(1);
788
+ highlightImagePage.steps.allotPoints(20);
789
+ highlightImagePage.steps.expandAdditonalSettings();
790
+ highlightImagePage.steps.checkAllowStudentsToCheckAnswerCheckbox();
791
+ highlightImagePage.steps.switchToPreviewTab();
792
+ });
793
+
794
+ it('When the user selects \'Show correct answer\' checkbox without attempting the question then the correct tab regions should be highlighted, correct/incorrect answer label and border should not be displayed and correct answer container should not be displayed', () => {
795
+ cy.log('Total points displayed besides Show correct answer checkbox should be of alternate answer points')
796
+ highlightImagePage.steps.verifyPreviewTabScoreText(0, 20);
797
+ highlightImagePage.steps.checkShowCorrectAnswerCheckbox();
798
+ highlightImagePage.steps.verifyCorrectIncorrectBorderNotVisible();
799
+ highlightImagePage.steps.verifyCorrectIncorrectIconsDoesNotExist();
800
+ highlightImagePage.steps.verifyCorrectAnswerContainerDoesNotExist();
801
+ highlightImagePage.steps.verifyCorrectHighlightRegion(0);
802
+ highlightImagePage.steps.verifyDefaultHighlightRegion(1);
803
+ highlightImagePage.steps.verifyDefaultHighlightRegion(2);
804
+ highlightImagePage.steps.verifyCorrectHighlightRegion(3);
805
+ cy.log('Post step: Unchecking the show correct answer checkbox')
806
+ highlightImagePage.steps.uncheckShowCorrectAnswerCheckbox();
807
+ });
808
+
809
+ it('When the user attempts the question according to the correct tab then user should be awarded with full points and on selecting \'Show correct answer\' checkbox green check-mark icons and green background should be displayed for all the correct tab highlight regions, \'Correct\' label and border should be displayed and the correct answers container should not be displayed', () => {
810
+ highlightImagePage.steps.highlightARegionInPreviewTab(0);
811
+ highlightImagePage.steps.highlightARegionInPreviewTab(3);
812
+ highlightImagePage.steps.verifyPreviewTabScoreText(20, 20);
813
+ highlightImagePage.steps.checkShowCorrectAnswerCheckbox();
814
+ highlightImagePage.steps.verifyCorrectHighlightRegion(0);
815
+ highlightImagePage.steps.verifyDefaultHighlightRegion(1);
816
+ highlightImagePage.steps.verifyDefaultHighlightRegion(2);
817
+ highlightImagePage.steps.verifyCorrectHighlightRegion(3);
818
+ highlightImagePage.steps.verifyCorrectAnswerContainerDoesNotExist();
819
+ highlightImagePage.steps.verifyCorrectAttemptBorder();
820
+ highlightImagePage.steps.verifyCorrectIncorrectAnswerLabel('Correct');
821
+
822
+ highlightImagePage.steps.verifyQuestionPreviewStateWhenShowCorrectAnswerIsUnchecked();
823
+
824
+ cy.log('When user attempts the question correctly and clicks on the \'Check answer\' button, green check-mark icons and green background should be displayed for all correct tab highlight regions, a label \'Correct answer\' and border should be displayed below the question preview and the correct answer container should not be displayed')
825
+ highlightImagePage.steps.checkAnswer();
826
+ highlightImagePage.steps.verifyCorrectHighlightRegion(0);
827
+ highlightImagePage.steps.verifyDefaultHighlightRegion(1);
828
+ highlightImagePage.steps.verifyDefaultHighlightRegion(2);
829
+ highlightImagePage.steps.verifyCorrectHighlightRegion(3);
830
+ highlightImagePage.steps.verifyCorrectAttemptBorder();
831
+ highlightImagePage.steps.verifyCorrectIncorrectAnswerLabel('Correct');
832
+ highlightImagePage.steps.verifyCorrectAnswerContainerDoesNotExist();
833
+ });
834
+
835
+ it('When the user attempts the question according to the alternate tab then user should be awarded with full points and on selecting \'Show correct answer\' checkbox green check-mark icons and green background should be displayed for all the alternate tab highlight regions, \'Correct\' label and border should be displayed and the correct answers container should not be displayed', () => {
836
+ highlightImagePage.steps.resetQuestionPreview();
837
+ highlightImagePage.steps.highlightARegionInPreviewTab(0);
838
+ highlightImagePage.steps.highlightARegionInPreviewTab(1);
839
+ highlightImagePage.steps.verifyPreviewTabScoreText(20, 20);
840
+ highlightImagePage.steps.checkShowCorrectAnswerCheckbox();
841
+ highlightImagePage.steps.verifyCorrectHighlightRegion(0);
842
+ highlightImagePage.steps.verifyCorrectHighlightRegion(1);
843
+ highlightImagePage.steps.verifyDefaultHighlightRegion(2);
844
+ highlightImagePage.steps.verifyDefaultHighlightRegion(3);
845
+ highlightImagePage.steps.verifyCorrectAnswerContainerDoesNotExist();
846
+ highlightImagePage.steps.verifyCorrectAttemptBorder();
847
+ highlightImagePage.steps.verifyCorrectIncorrectAnswerLabel('Correct');
848
+
849
+ highlightImagePage.steps.verifyQuestionPreviewStateWhenShowCorrectAnswerIsUnchecked();
850
+
851
+ cy.log('When user attempts the question correctly and clicks on the \'Check answer\' button, green check-mark icons and green background should be displayed in all correct highlight regions, a label \'Correct answer\' and border should be displayed below the question preview and the correct answer container should not be displayed')
852
+ highlightImagePage.steps.checkAnswer();
853
+ highlightImagePage.steps.verifyCorrectHighlightRegion(0);
854
+ highlightImagePage.steps.verifyCorrectHighlightRegion(1);
855
+ highlightImagePage.steps.verifyDefaultHighlightRegion(2);
856
+ highlightImagePage.steps.verifyDefaultHighlightRegion(3);
857
+ highlightImagePage.steps.verifyCorrectAttemptBorder();
858
+ highlightImagePage.steps.verifyCorrectIncorrectAnswerLabel('Correct');
859
+ highlightImagePage.steps.verifyCorrectAnswerContainerDoesNotExist();
860
+ });
861
+
862
+ it('When the user attempts the question partially correct exclusively according to the correct tab then 0 points should be awarded and on selecting \'Show correct answer\' checkbox green check-mark icons and green background should be displayed for all the correct tab highlight regions, \'Incorrect\' label and border should be displayed and the correct answers container should contain the correct answers of the unattempted options from the correct tab with numeration', () => {
863
+ highlightImagePage.steps.resetQuestionPreview();
864
+ highlightImagePage.steps.highlightARegionInPreviewTab(3);
865
+ highlightImagePage.steps.verifyPreviewTabScoreText(0, 20);
866
+ highlightImagePage.steps.checkShowCorrectAnswerCheckbox();
867
+ highlightImagePage.steps.verifyCorrectHighlightRegion(0);
868
+ highlightImagePage.steps.verifyDefaultHighlightRegion(1);
869
+ highlightImagePage.steps.verifyDefaultHighlightRegion(2);
870
+ highlightImagePage.steps.verifyCorrectHighlightRegion(3);
871
+ highlightImagePage.steps.verifyCorrectAnswerContainerContents(['Option 1'], [1]);
872
+ highlightImagePage.steps.verifyHighlightNumerationPreviewTab(0, 1);
873
+ highlightImagePage.steps.verifyIncorrectAttemptBorder();
874
+ highlightImagePage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect');
875
+
876
+ highlightImagePage.steps.verifyQuestionPreviewStateWhenShowCorrectAnswerIsUnchecked();
877
+
878
+ cy.log('When the user attempts the question partially correct exclusively according to the correct tab and clicks on the \'Check answer\' button, green check-mark icons and green background should be displayed for attempted correct tab highlight regions, a label \'Incorrect answer\' and border should be displayed below the question preview and the correct answer container should not be displayed')
879
+ highlightImagePage.steps.checkAnswer();
880
+ highlightImagePage.steps.verifyDefaultHighlightRegion(0);
881
+ highlightImagePage.steps.verifyDefaultHighlightRegion(1);
882
+ highlightImagePage.steps.verifyDefaultHighlightRegion(2);
883
+ highlightImagePage.steps.verifyCorrectHighlightRegion(3);
884
+ highlightImagePage.steps.verifyCorrectAnswerContainerDoesNotExist();
885
+ highlightImagePage.steps.verifyIncorrectAttemptBorder();
886
+ highlightImagePage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect');
887
+ });
888
+
889
+ it('When the user attempts the question partially correct exclusively according to the alternate tab then 0 points should be awarded and on selecting \'Show correct answer\' checkbox green check-mark icons and green background should be displayed for all the alternate tab highlight regions, \'Incorrect\' label and border should be displayed and the correct answers container should contain the correct answers of the unattempted options from the alternate tab with numeration', () => {
890
+ highlightImagePage.steps.resetQuestionPreview();
891
+ highlightImagePage.steps.highlightARegionInPreviewTab(1);
892
+ highlightImagePage.steps.verifyPreviewTabScoreText(0, 20);
893
+ highlightImagePage.steps.checkShowCorrectAnswerCheckbox();
894
+ highlightImagePage.steps.verifyCorrectHighlightRegion(0);
895
+ highlightImagePage.steps.verifyCorrectHighlightRegion(1);
896
+ highlightImagePage.steps.verifyDefaultHighlightRegion(2);
897
+ highlightImagePage.steps.verifyDefaultHighlightRegion(3);
898
+ highlightImagePage.steps.verifyCorrectAnswerContainerContents(['Option 1'], [1]);
899
+ highlightImagePage.steps.verifyHighlightNumerationPreviewTab(0, 1);
900
+ highlightImagePage.steps.verifyIncorrectAttemptBorder();
901
+ highlightImagePage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect');
902
+
903
+ highlightImagePage.steps.verifyQuestionPreviewStateWhenShowCorrectAnswerIsUnchecked();
904
+
905
+ cy.log('When the user attempts the question partially correct exclusively according to the correct tab and clicks on the \'Check answer\' button, green check-mark icons and green background should be displayed for attempted correct tab highlight regions, a label \'Incorrect answer\' and border should be displayed below the question preview and the correct answer container should not be displayed')
906
+ highlightImagePage.steps.checkAnswer();
907
+ highlightImagePage.steps.verifyDefaultHighlightRegion(0);
908
+ highlightImagePage.steps.verifyCorrectHighlightRegion(1);
909
+ highlightImagePage.steps.verifyDefaultHighlightRegion(2);
910
+ highlightImagePage.steps.verifyDefaultHighlightRegion(3);
911
+ highlightImagePage.steps.verifyCorrectAnswerContainerDoesNotExist();
912
+ highlightImagePage.steps.verifyIncorrectAttemptBorder();
913
+ highlightImagePage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect');
914
+ });
915
+
916
+ it('When the user attempts the question partially correct with equal number of highlight regions from the correct and alternate tab then user should be awarded 0 points and on selecting \'Show correct answer\' checkbox green check-mark icons and green background should be displayed for all the correct tab highlight regions and red cross-mark icon with red background should be displayed for selected alternate tab highlight region, \'Incorrect\' label and border should be displayed and the correct answers container should contain the correct answers of the unattempted options from the correct tab with numeration', () => {
917
+ highlightImagePage.steps.resetQuestionPreview();
918
+ highlightImagePage.steps.highlightARegionInPreviewTab(1);
919
+ highlightImagePage.steps.highlightARegionInPreviewTab(3);
920
+ highlightImagePage.steps.verifyPreviewTabScoreText(0, 20);
921
+ highlightImagePage.steps.checkShowCorrectAnswerCheckbox();
922
+ highlightImagePage.steps.verifyCorrectHighlightRegion(0);
923
+ highlightImagePage.steps.verifyIncorrectHighlightRegion(1);
924
+ highlightImagePage.steps.verifyDefaultHighlightRegion(2);
925
+ highlightImagePage.steps.verifyCorrectHighlightRegion(3);
926
+ highlightImagePage.steps.verifyCorrectAnswerContainerContents(['Option 1'], [1]);
927
+ highlightImagePage.steps.verifyHighlightNumerationPreviewTab(0, 1);
928
+ highlightImagePage.steps.verifyIncorrectAttemptBorder();
929
+ highlightImagePage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect');
930
+
931
+ highlightImagePage.steps.verifyQuestionPreviewStateWhenShowCorrectAnswerIsUnchecked();
932
+
933
+ cy.log('When the user attempts the question partially correct with equal number highlight regions from the correct and alternate tab and clicks on the \'Check answer\' button, green check-mark icons and green background should be displayed for attempted correct tab highlight regions, a label \'Incorrect answer\' and border should be displayed below the question preview and the correct answer container should not be displayed')
934
+ highlightImagePage.steps.checkAnswer();
935
+ highlightImagePage.steps.verifyDefaultHighlightRegion(0);
936
+ highlightImagePage.steps.verifyIncorrectHighlightRegion(1);
937
+ highlightImagePage.steps.verifyDefaultHighlightRegion(2);
938
+ highlightImagePage.steps.verifyCorrectHighlightRegion(3);
939
+ highlightImagePage.steps.verifyCorrectAnswerContainerDoesNotExist();
940
+ highlightImagePage.steps.verifyIncorrectAttemptBorder();
941
+ highlightImagePage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect');
942
+ });
943
+
944
+ it('Race condition 1: When the user attempts the question with the common highlight region between correct tab and alternate tab then user should be awarded 0 points and on selecting \'Show correct answer\' checkbox green check-mark icons and green background should be displayed for all the correct tab highlight regions, \'Incorrect\' label and border should be displayed and the correct answers container should contain the correct answers of the unattempted options from the correct tab with numeration', () => {
945
+ highlightImagePage.steps.resetQuestionPreview();
946
+ highlightImagePage.steps.highlightARegionInPreviewTab(0);
947
+ highlightImagePage.steps.verifyPreviewTabScoreText(0, 20);
948
+ highlightImagePage.steps.checkShowCorrectAnswerCheckbox();
949
+ highlightImagePage.steps.verifyCorrectHighlightRegion(0);
950
+ highlightImagePage.steps.verifyDefaultHighlightRegion(1);
951
+ highlightImagePage.steps.verifyDefaultHighlightRegion(2);
952
+ highlightImagePage.steps.verifyCorrectHighlightRegion(3);
953
+ highlightImagePage.steps.verifyCorrectAnswerContainerContents(['Option 4'], [1]);
954
+ highlightImagePage.steps.verifyHighlightNumerationPreviewTab(3, 4);
955
+ highlightImagePage.steps.verifyIncorrectAttemptBorder();
956
+ highlightImagePage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect');
957
+
958
+ highlightImagePage.steps.verifyQuestionPreviewStateWhenShowCorrectAnswerIsUnchecked();
959
+
960
+ cy.log('When the user attempts the question partially correct with equal number highlight regions from the correct and alternate tab and clicks on the \'Check answer\' button, green check-mark icons and green background should be displayed for attempted correct tab highlight regions, a label \'Incorrect answer\' and border should be displayed below the question preview and the correct answer container should not be displayed')
961
+ highlightImagePage.steps.checkAnswer();
962
+ highlightImagePage.steps.verifyCorrectHighlightRegion(0);
963
+ highlightImagePage.steps.verifyDefaultHighlightRegion(1);
964
+ highlightImagePage.steps.verifyDefaultHighlightRegion(2);
965
+ highlightImagePage.steps.verifyDefaultHighlightRegion(3);
966
+ highlightImagePage.steps.verifyCorrectAnswerContainerDoesNotExist();
967
+ highlightImagePage.steps.verifyIncorrectAttemptBorder();
968
+ highlightImagePage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect');
969
+ });
970
+
971
+ it('Race condition 2: When the user attempts the question with the all highlight regions of correct tab and alternate tab then user should be awarded 0 points and on selecting \'Show correct answer\' checkbox green check-mark icons and green background should be displayed for all the correct tab highlight regions, and red cross-mark icon and red background should be displayed for the alternate tab highlight region, \'Incorrect\' label and border should be displayed and the correct answers container should not be displayed', () => {
972
+ highlightImagePage.steps.resetQuestionPreview();
973
+ highlightImagePage.steps.highlightARegionInPreviewTab(0);
974
+ highlightImagePage.steps.highlightARegionInPreviewTab(1);
975
+ highlightImagePage.steps.highlightARegionInPreviewTab(3);
976
+ highlightImagePage.steps.verifyPreviewTabScoreText(0, 20);
977
+ highlightImagePage.steps.checkShowCorrectAnswerCheckbox();
978
+ highlightImagePage.steps.verifyCorrectHighlightRegion(0);
979
+ highlightImagePage.steps.verifyIncorrectHighlightRegion(1);
980
+ highlightImagePage.steps.verifyDefaultHighlightRegion(2);
981
+ highlightImagePage.steps.verifyCorrectHighlightRegion(3);
982
+ highlightImagePage.steps.verifyCorrectAnswerContainerDoesNotExist();
983
+ highlightImagePage.steps.verifyIncorrectAttemptBorder();
984
+ highlightImagePage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect');
985
+
986
+ highlightImagePage.steps.verifyQuestionPreviewStateWhenShowCorrectAnswerIsUnchecked();
987
+
988
+ cy.log('When the user attempts the question partially correct with equal number highlight regions from the correct and alternate tab and clicks on the \'Check answer\' button, green check-mark icons and green background should be displayed for attempted correct tab highlight regions, a label \'Incorrect answer\' and border should be displayed below the question preview and the correct answer container should not be displayed')
989
+ highlightImagePage.steps.checkAnswer();
990
+ highlightImagePage.steps.verifyCorrectHighlightRegion(0);
991
+ highlightImagePage.steps.verifyIncorrectHighlightRegion(1);
992
+ highlightImagePage.steps.verifyDefaultHighlightRegion(2);
993
+ highlightImagePage.steps.verifyCorrectHighlightRegion(3);
994
+ highlightImagePage.steps.verifyCorrectAnswerContainerDoesNotExist();
995
+ highlightImagePage.steps.verifyIncorrectAttemptBorder();
996
+ highlightImagePage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect');
997
+ });
998
+
999
+ it('When user attempts the question incorrectly then user should be awarded 0 points and on selecting \'Show correct answer\' checkbox green check-mark icons and green background should be displayed for the correct tab highlight regions, and red cross-mark icon and red background should be displayed for the incorrect highlight region, \'Incorrect\' label and border should be displayed and the correct answer container should contain the correct answers of the options from the correct tab with numeration', () => {
1000
+ highlightImagePage.steps.resetQuestionPreview();
1001
+ highlightImagePage.steps.highlightARegionInPreviewTab(2);
1002
+ highlightImagePage.steps.verifyPreviewTabScoreText(0, 20);
1003
+ highlightImagePage.steps.checkShowCorrectAnswerCheckbox();
1004
+ highlightImagePage.steps.verifyCorrectHighlightRegion(0);
1005
+ highlightImagePage.steps.verifyDefaultHighlightRegion(1);
1006
+ highlightImagePage.steps.verifyIncorrectHighlightRegion(2);
1007
+ highlightImagePage.steps.verifyCorrectHighlightRegion(3);
1008
+ highlightImagePage.steps.verifyCorrectAnswerContainerContents(['Option 1', 'Option 4'], [1, 2]);
1009
+ highlightImagePage.steps.verifyHighlightNumerationPreviewTab(0, 1);
1010
+ highlightImagePage.steps.verifyHighlightNumerationPreviewTab(3, 4);
1011
+ highlightImagePage.steps.verifyIncorrectAttemptBorder();
1012
+ highlightImagePage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect');
1013
+
1014
+ highlightImagePage.steps.verifyQuestionPreviewStateWhenShowCorrectAnswerIsUnchecked();
1015
+
1016
+ cy.log('When the user attempts the question partially correct with equal number highlight regions from the correct and alternate tab and clicks on the \'Check answer\' button, green check-mark icons and green background should be displayed for attempted correct tab highlight regions, a label \'Incorrect answer\' and border should be displayed below the question preview and the correct answer container should not be displayed')
1017
+ highlightImagePage.steps.checkAnswer();
1018
+ highlightImagePage.steps.verifyDefaultHighlightRegion(0);
1019
+ highlightImagePage.steps.verifyDefaultHighlightRegion(1);
1020
+ highlightImagePage.steps.verifyIncorrectHighlightRegion(2);
1021
+ highlightImagePage.steps.verifyDefaultHighlightRegion(3);
1022
+ highlightImagePage.steps.verifyCorrectAnswerContainerDoesNotExist();
1023
+ highlightImagePage.steps.verifyIncorrectAttemptBorder();
1024
+ highlightImagePage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect');
1025
+ });
1026
+
1027
+ highlightImagePage.tests.verifyMinimumScoreAwardedIfAttemptedFunctionalityForIncorrectAnswer(20);
1028
+ });
1029
+ });