itemengine-cypress-automation 1.0.193-packageUpdated-7f1e306.0 → 1.0.193-packageUpdated-0af2e49.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (53) hide show
  1. package/cypress/e2e/ILC/AudioPlayerNew/allSupportedFileTypes.js +3 -3
  2. package/cypress/e2e/ILC/AudioPlayerNew/audioOverviewAndTranscript.js +568 -0
  3. package/cypress/e2e/ILC/AudioPlayerNew/barAudioPlayerStyle.js +4 -4
  4. package/cypress/e2e/ILC/AudioPlayerNew/compactAudioPlayerStyle.js +5 -5
  5. package/cypress/e2e/ILC/AudioPlayerNew/customizePlayerLayoutSettings.js +2 -2
  6. package/cypress/e2e/ILC/AudioPlayerNew/headerSection.js +125 -0
  7. package/cypress/e2e/ILC/AudioPlayerNew/previewContents.smoke.js +5 -5
  8. package/cypress/e2e/ILC/AudioPlayerNew/standardAudioPlayerStyle.js +4 -4
  9. package/cypress/e2e/ILC/AudioPlayerNew/studentViewSettings.js +3 -3
  10. package/cypress/e2e/ILC/AudioPlayerNew/uploadAndAddAudioFile.js +19 -17
  11. package/cypress/e2e/ILC/ChartsBar/previewContentsForAllViews.smoke.js +7 -4
  12. package/cypress/e2e/ILC/ChartsLine/allOrNothingScoringForAllViews.smoke.js +366 -0
  13. package/cypress/e2e/ILC/ChartsLine/checkAnswerFunctionalityForAllViews.smoke.js +183 -0
  14. package/cypress/e2e/ILC/ChartsLine/gradingViewAndCorrectAnswerView.smoke.js +281 -0
  15. package/cypress/e2e/ILC/ChartsLine/previewContentsForAllViews.smoke.js +595 -0
  16. package/cypress/e2e/ILC/GridFill/allOrNothingBasicForAllViews.smoke.js +8 -8
  17. package/cypress/e2e/ILC/ImageHighlight/Scoring/allOrNothingWithAlternativePointsGreaterThanCorrectPoints.js +241 -0
  18. package/cypress/e2e/ILC/ImageHighlight/Scoring/allOrNothingWithCorrectPointsEqualToAlternativePoints.js +241 -0
  19. package/cypress/e2e/ILC/ImageHighlight/Scoring/allOrNothingWithCorrectPointsGreaterThanAlternatePoints.js +285 -0
  20. package/cypress/e2e/ILC/ImageHighlight/Scoring/manuallyAndNonScored.js +164 -0
  21. package/cypress/e2e/ILC/ImageHighlight/Scoring/partialDifferentWeightsAlternativePointsGreaterThanCorrectPoints.js +281 -0
  22. package/cypress/e2e/ILC/ImageHighlight/Scoring/partialDifferentWeightsScoring.js +467 -0
  23. package/cypress/e2e/ILC/ImageHighlight/Scoring/partialDifferentWeightsWithCorrectPointsEqualToAlternativePoints.js +250 -0
  24. package/cypress/e2e/ILC/ImageHighlight/Scoring/partialDifferentWeigtsCorrectPointsGreaterThanAlternativePoints.js +281 -0
  25. package/cypress/e2e/ILC/ImageHighlight/Scoring/partialEqualWeightsAlternativePointsGreaterThanCorrectPoints.js +260 -0
  26. package/cypress/e2e/ILC/ImageHighlight/Scoring/partialEqualWeightsScoring.js +184 -0
  27. package/cypress/e2e/ILC/ImageHighlight/Scoring/partialEqualWeightsWithCorrectPointsEqualToAlternativePoints.js +229 -0
  28. package/cypress/e2e/ILC/ImageHighlight/Scoring/partialEqualWeightsWithCorrectPointsGreaterThanAlternativePoints.js +261 -0
  29. package/cypress/e2e/ILC/chartsDotsPlot/allOrNothingForAllViews.smoke.js +409 -0
  30. package/cypress/e2e/ILC/chartsDotsPlot/checkAnswerFunctionalityForAllViews.smoke.js +199 -0
  31. package/cypress/e2e/ILC/chartsDotsPlot/gradingViewAndCorrectAnswerView.smoke.js +223 -0
  32. package/cypress/e2e/ILC/chartsDotsPlot/previewContentsForAllViews.smoke.js +402 -0
  33. package/cypress/pages/audioPlayerPage.js +229 -9
  34. package/cypress/pages/chartsBarPage.js +2 -70
  35. package/cypress/pages/chartsDotPlotPage.js +986 -3
  36. package/cypress/pages/chartsLinePage.js +368 -9
  37. package/cypress/pages/components/autoScoredScoringSectionMultiResponseType.js +0 -1
  38. package/cypress/pages/components/autoScoredSpecifyCorrectAnswerSection.js +3 -0
  39. package/cypress/pages/components/backgroundImageUploadComponent.js +1 -1
  40. package/cypress/pages/components/barAndLineChartComponent.js +27 -1
  41. package/cypress/pages/components/chartsCommonComponent.js +31 -2
  42. package/cypress/pages/components/createQuestionBasePage.js +1 -0
  43. package/cypress/pages/components/layoutSectionComponent.js +2 -2
  44. package/cypress/pages/components/singleMultipleSelectionModeComponent.js +5 -0
  45. package/cypress/pages/components/toolSettingsComponent.js +2 -2
  46. package/cypress/pages/feedbackScalePage.js +1 -1
  47. package/cypress/pages/gridFillPage.js +13 -6
  48. package/cypress/pages/imageHighlightPage.js +308 -2
  49. package/cypress/pages/numberLinePage.js +40 -16
  50. package/cypress/pages/textEntryMathPage.js +1 -1
  51. package/cypress/pages/videoResponsePage.js +350 -6
  52. package/package.json +1 -1
  53. package/cypress/e2e/ILC/ChartsBar/allOrNothingScoringForAllViews.smoke.js +0 -366
@@ -94,7 +94,7 @@ describe('Create item page - Grid fill: All or nothing', () => {
94
94
  if (view === 'Grading view') {
95
95
  studentViewPage.steps.submitResponse();
96
96
  utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'exist');
97
- studentViewPage.steps.clickOnGoToGradingViewButton();
97
+ gridFillPage.steps.clickOnGoToGradingViewButton();
98
98
  gradingViewPage.steps.verifyGradingViewScore(0, 20);
99
99
  }
100
100
  if (view === 'Question preview' || view === 'Item preview') {
@@ -112,9 +112,9 @@ describe('Create item page - Grid fill: All or nothing', () => {
112
112
  if (view === 'Grading view') {
113
113
  studentViewPage.steps.submitResponse();
114
114
  utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'exist');
115
- studentViewPage.steps.clickOnGoToGradingViewButton()
115
+ gridFillPage.steps.clickOnGoToGradingViewButton()
116
116
  gradingViewPage.steps.verifyGradingViewScore(0, 20);
117
- gridFillPage.steps.verifyIncorrectResponseIconPreviewTab(0,3);
117
+ gridFillPage.steps.verifyIncorrectResponseIconPreviewTab(0, 3);
118
118
  gridFillPage.steps.verifyCorrectResponseIconCorrectAnswerSection(0, 0);
119
119
  gridFillPage.steps.verifyCorrectResponseIconCorrectAnswerSection(0, 1);
120
120
  }
@@ -122,7 +122,7 @@ describe('Create item page - Grid fill: All or nothing', () => {
122
122
  gridFillPage.steps.switchToGradingView();
123
123
  gridFillPage.steps.verifyPreviewScore(0, 20);
124
124
  }
125
- gridFillPage.steps.verifyIncorrectResponseIconPreviewTab(0,3);
125
+ gridFillPage.steps.verifyIncorrectResponseIconPreviewTab(0, 3);
126
126
  gridFillPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
127
127
  });
128
128
 
@@ -134,7 +134,7 @@ describe('Create item page - Grid fill: All or nothing', () => {
134
134
  if (view === 'Grading view') {
135
135
  studentViewPage.steps.submitResponse();
136
136
  utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'exist');
137
- studentViewPage.steps.clickOnGoToGradingViewButton();
137
+ gridFillPage.steps.clickOnGoToGradingViewButton();
138
138
  gradingViewPage.steps.verifyGradingViewScore(0, 20);
139
139
  };
140
140
  if (view === 'Question preview' || view === 'Item preview') {
@@ -156,7 +156,7 @@ describe('Create item page - Grid fill: All or nothing', () => {
156
156
  if (view === 'Grading view') {
157
157
  studentViewPage.steps.submitResponse();
158
158
  utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'exist');
159
- studentViewPage.steps.clickOnGoToGradingViewButton();
159
+ gridFillPage.steps.clickOnGoToGradingViewButton();
160
160
  gradingViewPage.steps.verifyGradingViewScore(0, 20);
161
161
  };
162
162
  if (view === 'Question preview' || view === 'Item preview') {
@@ -180,7 +180,7 @@ describe('Create item page - Grid fill: All or nothing', () => {
180
180
  if (view === 'Grading view') {
181
181
  studentViewPage.steps.submitResponse();
182
182
  utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'exist');
183
- studentViewPage.steps.clickOnGoToGradingViewButton();
183
+ gridFillPage.steps.clickOnGoToGradingViewButton();
184
184
  gradingViewPage.steps.verifyGradingViewScore(0, 20);
185
185
  };
186
186
  if (view === 'Question preview' || view === 'Item preview') {
@@ -204,7 +204,7 @@ describe('Create item page - Grid fill: All or nothing', () => {
204
204
  if (view === 'Grading view') {
205
205
  studentViewPage.steps.submitResponse();
206
206
  utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'exist');
207
- studentViewPage.steps.clickOnGoToGradingViewButton();
207
+ gridFillPage.steps.clickOnGoToGradingViewButton();
208
208
  gradingViewPage.steps.verifyGradingViewScore(20, 20);
209
209
  }
210
210
  if (view === 'Question preview' || view === 'Item preview') {
@@ -0,0 +1,241 @@
1
+ import { imageHighlightPage } from "../../../../pages";
2
+ import abortEarlySetup from "../../../../support/helpers/abortEarly";
3
+
4
+ const flowerHighlightRegion = [[40, 6], [40, 20], [55, 20], [55, 6]];
5
+ const branchesHighlightRegion = [[50, 30], [50, 42], [65, 42], [65, 30]];
6
+ const leafHighlightRegion = [[26, 26], [26, 36], [48, 36], [48, 26]];
7
+ const rootsHighlightRegion = [[45, 45], [45, 55], [57, 55], [57, 45]];
8
+
9
+ describe('Create Item page - Image highlight: All or nothing with alternative answers', () => {
10
+ before(() => {
11
+ cy.loginAs('admin');
12
+ });
13
+
14
+ describe('Question Preview: AutoScored - All or Nothing with alternate answer: When alternative answer points are more than correct answer points', () => {
15
+ abortEarlySetup();
16
+ before(() => {
17
+ cy.log('Navigating to highlight image question type');
18
+ imageHighlightPage.steps.navigateToCreateQuestion('image highlight');
19
+ cy.barsPreLoaderWait();
20
+ imageHighlightPage.steps.addQuestionInstructions();
21
+ imageHighlightPage.steps.uploadFile('highlightImage.jpg');
22
+ imageHighlightPage.steps.verifyImageUploadedInSpecifyPossibleOptionsSection();
23
+ imageHighlightPage.steps.verifyImageUploadedSpecifyCorrectAnswer();
24
+ imageHighlightPage.steps.highlightRegionInImage(flowerHighlightRegion);
25
+ imageHighlightPage.steps.highlightRegionInImage(branchesHighlightRegion);
26
+ imageHighlightPage.steps.highlightRegionInImage(leafHighlightRegion);
27
+ imageHighlightPage.steps.highlightRegionInImage(rootsHighlightRegion);
28
+ imageHighlightPage.steps.selectMultipleSelectionToggle();
29
+ imageHighlightPage.steps.highlightARegionInSpecifyCorrectAnswerSection(0);
30
+ imageHighlightPage.steps.highlightARegionInSpecifyCorrectAnswerSection(3);
31
+ imageHighlightPage.steps.allotPoints(12);
32
+ imageHighlightPage.steps.clickOnAddAlternativeAnswerButton();
33
+ imageHighlightPage.steps.highlightARegionInSpecifyCorrectAnswerSection(0);
34
+ imageHighlightPage.steps.highlightARegionInSpecifyCorrectAnswerSection(1);
35
+ imageHighlightPage.steps.allotPoints(20);
36
+ imageHighlightPage.steps.checkAllowStudentsToCheckAnswerCheckbox();
37
+ imageHighlightPage.steps.switchToPreviewTab();
38
+ });
39
+
40
+ it('When the user switches to \'Grading view\' without attempting the question then the no regions should be highlighted, \'Your answer is incorrect\' label should be displayed and the correct answer section with the answers of the alternative accordion should be displayed', () => {
41
+ cy.log('Total points displayed besides Show correct answer checkbox should be of alternate answer points')
42
+ imageHighlightPage.steps.verifyPreviewScore(0, 20);
43
+ imageHighlightPage.steps.switchToGradingView();
44
+ imageHighlightPage.steps.verifyHighlightRegionNumerationPreviewTab()
45
+ imageHighlightPage.steps.verifyDefaultHighlightRegion(0);
46
+ imageHighlightPage.steps.verifyDefaultHighlightRegion(1);
47
+ imageHighlightPage.steps.verifyDefaultHighlightRegion(2);
48
+ imageHighlightPage.steps.verifyDefaultHighlightRegion(3);
49
+ imageHighlightPage.steps.verifyCorrectAnswerContainerContents(['Option 1', 'Option 2'], [1, 2]);
50
+ });
51
+
52
+ it('When the user attempts the question with responses from the correct accordion, then the user should be awarded points specified for correct points accordion(less than full points) and on switching to \'Grading\' view, correct icons should be displayed beside all the correct responses, a status message with text \'Your answer is correct\' should be displayed and correct answer section should not be displayed', () => {
53
+ imageHighlightPage.steps.resetQuestionPreview();
54
+ imageHighlightPage.steps.highlightARegionInPreviewTab(0);
55
+ imageHighlightPage.steps.highlightARegionInPreviewTab(3);
56
+ imageHighlightPage.steps.verifyPreviewScore(12, 20);
57
+ imageHighlightPage.steps.switchToGradingView();
58
+ imageHighlightPage.steps.verifyCorrectHighlightRegion(0);
59
+ imageHighlightPage.steps.verifyDefaultHighlightRegion(1);
60
+ imageHighlightPage.steps.verifyDefaultHighlightRegion(2);
61
+ imageHighlightPage.steps.verifyCorrectHighlightRegion(3);
62
+ imageHighlightPage.steps.verifyCorrectAnswerSectionNotExists();
63
+ imageHighlightPage.steps.verifyCorrectIncorrectAnswerLabel('correct');
64
+ imageHighlightPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
65
+
66
+ cy.log('When the user has attempted the question with responses from the correct accordion and clicks on \'Check answer\' button, then correct icon should be displayed besides the correct answer responses, a status message with text \'Your answer is correct\' and correct answer section should not be displayed')
67
+ imageHighlightPage.steps.checkAnswer();
68
+ imageHighlightPage.steps.verifyCorrectHighlightRegion(0);
69
+ imageHighlightPage.steps.verifyHiddenHighlightRegion(1);
70
+ imageHighlightPage.steps.verifyHiddenHighlightRegion(2);
71
+ imageHighlightPage.steps.verifyCorrectHighlightRegion(3);
72
+ imageHighlightPage.steps.verifyCorrectIncorrectAnswerLabel('correct');
73
+ imageHighlightPage.steps.verifyCorrectAnswerSectionNotExists();
74
+ });
75
+
76
+ it('When the user attempts the question with responses from the alternative accordion, then the user should be awarded with full points and on switching to \'Grading\' view, correct icons should be displayed beside all the correct responses, a status message with text \'Your answer is correct\' and correct answer section should not be displayed', () => {
77
+ imageHighlightPage.steps.resetQuestionPreview();
78
+ imageHighlightPage.steps.highlightARegionInPreviewTab(0);
79
+ imageHighlightPage.steps.highlightARegionInPreviewTab(1);
80
+ imageHighlightPage.steps.verifyPreviewScore(20, 20);
81
+ imageHighlightPage.steps.switchToGradingView();
82
+ imageHighlightPage.steps.verifyCorrectHighlightRegion(0);
83
+ imageHighlightPage.steps.verifyCorrectHighlightRegion(1);
84
+ imageHighlightPage.steps.verifyDefaultHighlightRegion(2);
85
+ imageHighlightPage.steps.verifyDefaultHighlightRegion(3);
86
+ imageHighlightPage.steps.verifyCorrectAnswerSectionNotExists();
87
+ imageHighlightPage.steps.verifyCorrectIncorrectAnswerLabel('correct');
88
+ imageHighlightPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
89
+
90
+ cy.log('When the user has attempted the question with responses from the alternative accordion and clicks on \'Check answer\' button, then correct icon should be displayed besides the correct answer responses, a status message with text \'Your answer is correct\' and correct answer section should not be displayed')
91
+ imageHighlightPage.steps.checkAnswer();
92
+ imageHighlightPage.steps.verifyCorrectHighlightRegion(0);
93
+ imageHighlightPage.steps.verifyCorrectHighlightRegion(1);
94
+ imageHighlightPage.steps.verifyHiddenHighlightRegion(2);
95
+ imageHighlightPage.steps.verifyHiddenHighlightRegion(3);
96
+ imageHighlightPage.steps.verifyCorrectIncorrectAnswerLabel('correct');
97
+ imageHighlightPage.steps.verifyCorrectAnswerSectionNotExists();
98
+ });
99
+
100
+ it('When the user attempts the question with partially correct options exclusively from the correct accordion, then the user should be awarded 0 points and on switching to \'Grading\' view, correct icon should be displayed besides the correct answer responses, no icon should be displayed beside unattempted response a status message with text \'Your answer is incorrect\' and correct answer section with all correct answers from the alternative accordion should be displayed', () => {
101
+ imageHighlightPage.steps.resetQuestionPreview();
102
+ imageHighlightPage.steps.highlightARegionInPreviewTab(3);
103
+ imageHighlightPage.steps.verifyPreviewScore(0, 20);
104
+ imageHighlightPage.steps.switchToGradingView();
105
+ imageHighlightPage.steps.verifyDefaultHighlightRegion(0);
106
+ imageHighlightPage.steps.verifyDefaultHighlightRegion(1);
107
+ imageHighlightPage.steps.verifyDefaultHighlightRegion(2);
108
+ imageHighlightPage.steps.verifyCorrectHighlightRegion(3);
109
+ imageHighlightPage.steps.verifyCorrectAnswerContainerContents(['Option 1', 'Option 2'], [1, 2]);
110
+ imageHighlightPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
111
+ imageHighlightPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
112
+
113
+ cy.log('When the user has attempted the question with partially correct options exclusively from the correct accordion and clicks on \'Check answer\' button, then correct icon should be displayed besides the correct answer responses, a status message with text \'Your answer is incorrect\' and correct answer section should not be displayed')
114
+ imageHighlightPage.steps.checkAnswer();
115
+ imageHighlightPage.steps.verifyHiddenHighlightRegion(0);
116
+ imageHighlightPage.steps.verifyHiddenHighlightRegion(1);
117
+ imageHighlightPage.steps.verifyHiddenHighlightRegion(2);
118
+ imageHighlightPage.steps.verifyCorrectHighlightRegion(3);
119
+ imageHighlightPage.steps.verifyCorrectAnswerSectionNotExists();
120
+ imageHighlightPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
121
+ });
122
+
123
+ it('When the user attempts the question with partially correct options exclusively from the alternative accordion, then the user should be awarded 0 points and on switching to \'Grading\' view, correct icon should be displayed besides the correct answer responses, no icon should be displayed beside unattempted response a status message with text \'Your answer is incorrect\' and correct answer section with all correct answers from the alternative accordion should be displayed', () => {
124
+ imageHighlightPage.steps.resetQuestionPreview();
125
+ imageHighlightPage.steps.highlightARegionInPreviewTab(1);
126
+ imageHighlightPage.steps.verifyPreviewScore(0, 20);
127
+ imageHighlightPage.steps.switchToGradingView();
128
+ imageHighlightPage.steps.verifyDefaultHighlightRegion(0);
129
+ imageHighlightPage.steps.verifyCorrectHighlightRegion(1);
130
+ imageHighlightPage.steps.verifyDefaultHighlightRegion(2);
131
+ imageHighlightPage.steps.verifyDefaultHighlightRegion(3);
132
+ imageHighlightPage.steps.verifyCorrectAnswerContainerContents(['Option 1', 'Option 2'], [1, 2]);
133
+ imageHighlightPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
134
+ imageHighlightPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
135
+
136
+ cy.log('When the user has attempted the question with partially correct options exclusively from the alternative accordion and clicks on \'Check answer\' button, then correct icon should be displayed besides the correct answer responses, no icon should be displayed beside unattempted response a status message with text \'Your answer is incorrect\' and correct answer section should not be displayed')
137
+ imageHighlightPage.steps.checkAnswer();
138
+ imageHighlightPage.steps.verifyHiddenHighlightRegion(0);
139
+ imageHighlightPage.steps.verifyCorrectHighlightRegion(1);
140
+ imageHighlightPage.steps.verifyHiddenHighlightRegion(2);
141
+ imageHighlightPage.steps.verifyHiddenHighlightRegion(3);
142
+ imageHighlightPage.steps.verifyCorrectAnswerSectionNotExists();
143
+ imageHighlightPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
144
+ });
145
+
146
+ it('When the user has attempted the question with equal number of correct responses from correct and alternative accordion, then the user should be awarded with 0 points and on switching to \'Grading\' view, green check-mark icon should be displayed besides response field with alternative answer responses, red cross-mark icon should be displayed beside responses from the correct tab, a status message with text \'Your answer is incorrect\' and correct answer section with all correct answers from the alternative accordion should be displayed', () => {
147
+ imageHighlightPage.steps.resetQuestionPreview();
148
+ imageHighlightPage.steps.highlightARegionInPreviewTab(1);
149
+ imageHighlightPage.steps.highlightARegionInPreviewTab(3);
150
+ imageHighlightPage.steps.verifyPreviewScore(0, 20);
151
+ imageHighlightPage.steps.switchToGradingView();
152
+ imageHighlightPage.steps.verifyDefaultHighlightRegion(0);
153
+ imageHighlightPage.steps.verifyCorrectHighlightRegion(1);
154
+ imageHighlightPage.steps.verifyDefaultHighlightRegion(2);
155
+ imageHighlightPage.steps.verifyIncorrectHighlightRegion(3);
156
+ imageHighlightPage.steps.verifyCorrectAnswerContainerContents(['Option 1', 'Option 2'], [1, 2]);
157
+ imageHighlightPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
158
+ imageHighlightPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
159
+
160
+ cy.log('When the user has attempted the question with equal number of correct responses from correct and alternative accordion and clicks on \'Check answer\' button, then correct icon should be displayed besides the correct answer responses, incorrect icon should be displayed beside empty responses a status message with text \'Your answer is incorrect\' and correct answer section should not be displayed')
161
+ imageHighlightPage.steps.checkAnswer();
162
+ imageHighlightPage.steps.verifyHiddenHighlightRegion(0);
163
+ imageHighlightPage.steps.verifyCorrectHighlightRegion(1);
164
+ imageHighlightPage.steps.verifyHiddenHighlightRegion(2);
165
+ imageHighlightPage.steps.verifyIncorrectHighlightRegion(3);
166
+ imageHighlightPage.steps.verifyCorrectAnswerSectionNotExists();
167
+ imageHighlightPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
168
+ });
169
+
170
+ it('Race condition 1: When the user attempts the question with the common response between correct and alternative accordion, then the user should be awarded with 0 points and on switching to \'Grading\' view, green check-mark icon should be besides the common response, no icon should be displayed beside unattempted response, \'Your answer is incorrect\' and correct answer section with all correct answers from the alternative accordion should be displayed', () => {
171
+ imageHighlightPage.steps.resetQuestionPreview();
172
+ imageHighlightPage.steps.highlightARegionInPreviewTab(0);
173
+ imageHighlightPage.steps.verifyPreviewScore(0, 20);
174
+ imageHighlightPage.steps.switchToGradingView();
175
+ imageHighlightPage.steps.verifyCorrectHighlightRegion(0);
176
+ imageHighlightPage.steps.verifyDefaultHighlightRegion(1);
177
+ imageHighlightPage.steps.verifyDefaultHighlightRegion(2);
178
+ imageHighlightPage.steps.verifyDefaultHighlightRegion(3);
179
+ imageHighlightPage.steps.verifyCorrectAnswerContainerContents(['Option 1', 'Option 2'], [1, 2]);
180
+ imageHighlightPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
181
+ imageHighlightPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
182
+
183
+ cy.log('When the user has attempted the question with equal number of correct responses from correct and alternative accordion and clicks on \'Check answer\' button, then correct icon should be displayed besides the correct answer responses, no icon should be displayed beside unattempted response a status message with text \'Your answer is incorrect\' and correct answer section should not be displayed')
184
+ imageHighlightPage.steps.checkAnswer();
185
+ imageHighlightPage.steps.verifyCorrectHighlightRegion(0);
186
+ imageHighlightPage.steps.verifyHiddenHighlightRegion(1);
187
+ imageHighlightPage.steps.verifyHiddenHighlightRegion(2);
188
+ imageHighlightPage.steps.verifyHiddenHighlightRegion(3);
189
+ imageHighlightPage.steps.verifyCorrectAnswerSectionNotExists();
190
+ imageHighlightPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
191
+ });
192
+
193
+ it('Race condition 2: When the user attempts the question partially correct with all the responses, then the user should be awarded 0 points and on switching to \'Grading\' view, correct icon should be displayed besides the response from the alternative accordion, incorrect icon should be displayed besides the responses from the correct accordion and no icon should be displayed beside unattempted response, a status message with text \'Your answer is incorrect\' and correct answer section with all correct answers from the alternative accordion should be displayed', () => {
194
+ imageHighlightPage.steps.resetQuestionPreview();
195
+ imageHighlightPage.steps.highlightARegionInPreviewTab(0);
196
+ imageHighlightPage.steps.highlightARegionInPreviewTab(1);
197
+ imageHighlightPage.steps.highlightARegionInPreviewTab(3);
198
+ imageHighlightPage.steps.verifyPreviewScore(0, 20);
199
+ imageHighlightPage.steps.switchToGradingView();
200
+ imageHighlightPage.steps.verifyCorrectHighlightRegion(0);
201
+ imageHighlightPage.steps.verifyCorrectHighlightRegion(1);
202
+ imageHighlightPage.steps.verifyDefaultHighlightRegion(2);
203
+ imageHighlightPage.steps.verifyIncorrectHighlightRegion(3);
204
+ imageHighlightPage.steps.verifyCorrectAnswerContainerContents(['Option 1', 'Option 2'], [1, 2]);
205
+ imageHighlightPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
206
+ imageHighlightPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
207
+
208
+ cy.log('When the user has attempted the question with partially correct with all the response and clicks on \'Check answer\' button, then correct icon should be displayed besides the response from the alternative accordion, incorrect icon should be displayed besides the responses from the correct accordion and no icon should be displayed beside unattempted response, a status message with text \'Your answer is incorrect\' and correct answer section should not be displayed')
209
+ imageHighlightPage.steps.checkAnswer();
210
+ imageHighlightPage.steps.verifyCorrectHighlightRegion(0);
211
+ imageHighlightPage.steps.verifyCorrectHighlightRegion(1);
212
+ imageHighlightPage.steps.verifyHiddenHighlightRegion(2);
213
+ imageHighlightPage.steps.verifyIncorrectHighlightRegion(3);
214
+ imageHighlightPage.steps.verifyCorrectAnswerSectionNotExists();
215
+ imageHighlightPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
216
+ });
217
+
218
+ it('When the user attempts the question incorrectly, then the user should be awarded 0 points and on switching to \'Grading\' view, incorrect icons should be displayed besides all incorrect responses, no icon should be displayed beside unattempted response a status message with text \'Your answer is incorrect\' and correct answer section with all alternative answers should be displayed', () => {
219
+ imageHighlightPage.steps.resetQuestionPreview();
220
+ imageHighlightPage.steps.highlightARegionInPreviewTab(2);
221
+ imageHighlightPage.steps.verifyPreviewScore(0, 20);
222
+ imageHighlightPage.steps.switchToGradingView();
223
+ imageHighlightPage.steps.verifyDefaultHighlightRegion(0);
224
+ imageHighlightPage.steps.verifyDefaultHighlightRegion(1);
225
+ imageHighlightPage.steps.verifyIncorrectHighlightRegion(2);
226
+ imageHighlightPage.steps.verifyDefaultHighlightRegion(3);
227
+ imageHighlightPage.steps.verifyCorrectAnswerContainerContents(['Option 1', 'Option 2'], [1, 2]);
228
+ imageHighlightPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
229
+ imageHighlightPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
230
+
231
+ cy.log('When the user has attempted the question incorrectly and clicks on \'Check answer\' button, then incorrect icons should be displayed besides all incorrect responses, no icon should be displayed beside unattempted response a status message with text \'Your answer is incorrect\' and correct answer section should not be displayed')
232
+ imageHighlightPage.steps.checkAnswer();
233
+ imageHighlightPage.steps.verifyHiddenHighlightRegion(0);
234
+ imageHighlightPage.steps.verifyHiddenHighlightRegion(1);
235
+ imageHighlightPage.steps.verifyIncorrectHighlightRegion(2);
236
+ imageHighlightPage.steps.verifyHiddenHighlightRegion(3);
237
+ imageHighlightPage.steps.verifyCorrectAnswerSectionNotExists();
238
+ imageHighlightPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
239
+ });
240
+ });
241
+ });
@@ -0,0 +1,241 @@
1
+ import { imageHighlightPage } from "../../../../pages";
2
+ import abortEarlySetup from "../../../../support/helpers/abortEarly";
3
+
4
+ const flowerHighlightRegion = [[40, 6], [40, 20], [55, 20], [55, 6]];
5
+ const branchesHighlightRegion = [[50, 30], [50, 42], [65, 42], [65, 30]];
6
+ const leafHighlightRegion = [[26, 26], [26, 36], [48, 36], [48, 26]];
7
+ const rootsHighlightRegion = [[45, 45], [45, 55], [57, 55], [57, 45]];
8
+
9
+ describe('Create Item page - Image highlight: All or nothing with alternative answers', () => {
10
+ before(() => {
11
+ cy.loginAs('admin');
12
+ });
13
+
14
+ describe('Question Preview: AutoScored - All or Nothing with alternate answer: When correct answer points are equal to alternate answer points', () => {
15
+ abortEarlySetup();
16
+ before(() => {
17
+ cy.log('Navigating to highlight image question type');
18
+ imageHighlightPage.steps.navigateToCreateQuestion('image highlight');
19
+ cy.barsPreLoaderWait();
20
+ imageHighlightPage.steps.addQuestionInstructions();
21
+ imageHighlightPage.steps.uploadFile('highlightImage.jpg');
22
+ imageHighlightPage.steps.verifyImageUploadedInSpecifyPossibleOptionsSection();
23
+ imageHighlightPage.steps.verifyImageUploadedSpecifyCorrectAnswer();
24
+ imageHighlightPage.steps.highlightRegionInImage(flowerHighlightRegion);
25
+ imageHighlightPage.steps.highlightRegionInImage(branchesHighlightRegion);
26
+ imageHighlightPage.steps.highlightRegionInImage(leafHighlightRegion);
27
+ imageHighlightPage.steps.highlightRegionInImage(rootsHighlightRegion);
28
+ imageHighlightPage.steps.selectMultipleSelectionToggle();
29
+ imageHighlightPage.steps.highlightARegionInSpecifyCorrectAnswerSection(0);
30
+ imageHighlightPage.steps.highlightARegionInSpecifyCorrectAnswerSection(3);
31
+ imageHighlightPage.steps.allotPoints(20);
32
+ imageHighlightPage.steps.clickOnAddAlternativeAnswerButton();
33
+ imageHighlightPage.steps.highlightARegionInSpecifyCorrectAnswerSection(0);
34
+ imageHighlightPage.steps.highlightARegionInSpecifyCorrectAnswerSection(1);
35
+ imageHighlightPage.steps.allotPoints(20);
36
+ imageHighlightPage.steps.checkAllowStudentsToCheckAnswerCheckbox();
37
+ imageHighlightPage.steps.switchToPreviewTab();
38
+ });
39
+
40
+ it('When the user switches to \'Grading view\' without attempting the question then the no regions should be highlighted, \'Your answer is incorrect\' label should be displayed and the correct answer section with the answers of the correct accordion should be displayed', () => {
41
+ cy.log('Total points displayed besides Show correct answer checkbox should be of alternate answer points')
42
+ imageHighlightPage.steps.verifyPreviewScore(0, 20);
43
+ imageHighlightPage.steps.switchToGradingView();
44
+ imageHighlightPage.steps.verifyHighlightRegionNumerationPreviewTab()
45
+ imageHighlightPage.steps.verifyDefaultHighlightRegion(0);
46
+ imageHighlightPage.steps.verifyDefaultHighlightRegion(1);
47
+ imageHighlightPage.steps.verifyDefaultHighlightRegion(2);
48
+ imageHighlightPage.steps.verifyDefaultHighlightRegion(3);
49
+ imageHighlightPage.steps.verifyCorrectAnswerContainerContents(['Option 1', 'Option 4'], [1, 2]);
50
+ });
51
+
52
+ it('When the user attempts the question with responses from the correct accordion, then the user should be awarded full points and on switching to \'Grading\' view, correct icons should be displayed beside all the correct responses, a status message with text \'Your answer is correct\' should be displayed and correct answer section should not be displayed', () => {
53
+ imageHighlightPage.steps.resetQuestionPreview();
54
+ imageHighlightPage.steps.highlightARegionInPreviewTab(0);
55
+ imageHighlightPage.steps.highlightARegionInPreviewTab(3);
56
+ imageHighlightPage.steps.verifyPreviewScore(20, 20);
57
+ imageHighlightPage.steps.switchToGradingView();
58
+ imageHighlightPage.steps.verifyCorrectHighlightRegion(0);
59
+ imageHighlightPage.steps.verifyDefaultHighlightRegion(1);
60
+ imageHighlightPage.steps.verifyDefaultHighlightRegion(2);
61
+ imageHighlightPage.steps.verifyCorrectHighlightRegion(3);
62
+ imageHighlightPage.steps.verifyCorrectAnswerSectionNotExists();
63
+ imageHighlightPage.steps.verifyCorrectIncorrectAnswerLabel('correct');
64
+ imageHighlightPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
65
+
66
+ cy.log('When the user has attempted the question with responses from the correct accordion and clicks on \'Check answer\' button, then correct icon should be displayed besides the correct answer responses, a status message with text \'Your answer is correct\' and correct answer section should not be displayed')
67
+ imageHighlightPage.steps.checkAnswer();
68
+ imageHighlightPage.steps.verifyCorrectHighlightRegion(0);
69
+ imageHighlightPage.steps.verifyHiddenHighlightRegion(1);
70
+ imageHighlightPage.steps.verifyHiddenHighlightRegion(2);
71
+ imageHighlightPage.steps.verifyCorrectHighlightRegion(3);
72
+ imageHighlightPage.steps.verifyCorrectIncorrectAnswerLabel('correct');
73
+ imageHighlightPage.steps.verifyCorrectAnswerSectionNotExists();
74
+ });
75
+
76
+ it('When the user attempts the question with responses from the alternative accordion, then the user should be awarded with full points and on switching to \'Grading\' view, correct icons should be displayed beside all the correct responses, a status message with text \'Your answer is correct\' and correct answer section should not be displayed', () => {
77
+ imageHighlightPage.steps.resetQuestionPreview();
78
+ imageHighlightPage.steps.highlightARegionInPreviewTab(0);
79
+ imageHighlightPage.steps.highlightARegionInPreviewTab(1);
80
+ imageHighlightPage.steps.verifyPreviewScore(20, 20);
81
+ imageHighlightPage.steps.switchToGradingView();
82
+ imageHighlightPage.steps.verifyCorrectHighlightRegion(0);
83
+ imageHighlightPage.steps.verifyCorrectHighlightRegion(1);
84
+ imageHighlightPage.steps.verifyDefaultHighlightRegion(2);
85
+ imageHighlightPage.steps.verifyDefaultHighlightRegion(3);
86
+ imageHighlightPage.steps.verifyCorrectAnswerSectionNotExists();
87
+ imageHighlightPage.steps.verifyCorrectIncorrectAnswerLabel('correct');
88
+ imageHighlightPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
89
+
90
+ cy.log('When the user has attempted the question with responses from the alternative accordion and clicks on \'Check answer\' button, then correct icon should be displayed besides the correct answer responses, a status message with text \'Your answer is correct\' and correct answer section should not be displayed')
91
+ imageHighlightPage.steps.checkAnswer();
92
+ imageHighlightPage.steps.verifyCorrectHighlightRegion(0);
93
+ imageHighlightPage.steps.verifyCorrectHighlightRegion(1);
94
+ imageHighlightPage.steps.verifyHiddenHighlightRegion(2);
95
+ imageHighlightPage.steps.verifyHiddenHighlightRegion(3);
96
+ imageHighlightPage.steps.verifyCorrectIncorrectAnswerLabel('correct');
97
+ imageHighlightPage.steps.verifyCorrectAnswerSectionNotExists();
98
+ });
99
+
100
+ it('When the user attempts the question with partially correct options exclusively from the correct accordion, then the user should be awarded 0 points and on switching to \'Grading\' view, correct icon should be displayed besides the correct answer responses, no icon should be displayed beside unattempted response a status message with text \'Your answer is incorrect\' and correct answer section with all correct answers from the correct accordion should be displayed', () => {
101
+ imageHighlightPage.steps.resetQuestionPreview();
102
+ imageHighlightPage.steps.highlightARegionInPreviewTab(3);
103
+ imageHighlightPage.steps.verifyPreviewScore(0, 20);
104
+ imageHighlightPage.steps.switchToGradingView();
105
+ imageHighlightPage.steps.verifyDefaultHighlightRegion(0);
106
+ imageHighlightPage.steps.verifyDefaultHighlightRegion(1);
107
+ imageHighlightPage.steps.verifyDefaultHighlightRegion(2);
108
+ imageHighlightPage.steps.verifyCorrectHighlightRegion(3);
109
+ imageHighlightPage.steps.verifyCorrectAnswerContainerContents(['Option 1', 'Option 4'], [1, 2]);
110
+ imageHighlightPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
111
+ imageHighlightPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
112
+
113
+ cy.log('When the user has attempted the question with partially correct options exclusively from the correct accordion and clicks on \'Check answer\' button, then correct icon should be displayed besides the correct answer responses, a status message with text \'Your answer is incorrect\' and correct answer section should not be displayed')
114
+ imageHighlightPage.steps.checkAnswer();
115
+ imageHighlightPage.steps.verifyHiddenHighlightRegion(0);
116
+ imageHighlightPage.steps.verifyHiddenHighlightRegion(1);
117
+ imageHighlightPage.steps.verifyHiddenHighlightRegion(2);
118
+ imageHighlightPage.steps.verifyCorrectHighlightRegion(3);
119
+ imageHighlightPage.steps.verifyCorrectAnswerSectionNotExists();
120
+ imageHighlightPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
121
+ });
122
+
123
+ it('When the user attempts the question with partially correct options exclusively from the alternative accordion, then the user should be awarded 0 points and on switching to \'Grading\' view, correct icon should be displayed besides the correct answer responses, no icon should be displayed beside unattempted response a status message with text \'Your answer is incorrect\' and correct answer section with all correct answers from the correct accordion should be displayed', () => {
124
+ imageHighlightPage.steps.resetQuestionPreview();
125
+ imageHighlightPage.steps.highlightARegionInPreviewTab(1);
126
+ imageHighlightPage.steps.verifyPreviewScore(0, 20);
127
+ imageHighlightPage.steps.switchToGradingView();
128
+ imageHighlightPage.steps.verifyDefaultHighlightRegion(0);
129
+ imageHighlightPage.steps.verifyCorrectHighlightRegion(1);
130
+ imageHighlightPage.steps.verifyDefaultHighlightRegion(2);
131
+ imageHighlightPage.steps.verifyDefaultHighlightRegion(3);
132
+ imageHighlightPage.steps.verifyCorrectAnswerContainerContents(['Option 1', 'Option 4'], [1, 2]);
133
+ imageHighlightPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
134
+ imageHighlightPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
135
+
136
+ cy.log('When the user has attempted the question with partially correct options exclusively from the alternative accordion and clicks on \'Check answer\' button, then correct icon should be displayed besides the correct answer responses, no icon should be displayed beside unattempted response a status message with text \'Your answer is incorrect\' and correct answer section should not be displayed')
137
+ imageHighlightPage.steps.checkAnswer();
138
+ imageHighlightPage.steps.verifyHiddenHighlightRegion(0);
139
+ imageHighlightPage.steps.verifyCorrectHighlightRegion(1);
140
+ imageHighlightPage.steps.verifyHiddenHighlightRegion(2);
141
+ imageHighlightPage.steps.verifyHiddenHighlightRegion(3);
142
+ imageHighlightPage.steps.verifyCorrectAnswerSectionNotExists();
143
+ imageHighlightPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
144
+ });
145
+
146
+ it('When the user has attempted the question with equal number of correct responses from correct and alternative accordion, then the user should be awarded with 0 points and on switching to \'Grading\' view, green check-mark icon should be displayed besides response field with correct answer responses, red cross-mark icon should be displayed beside responses from the alternative tab, a status message with text \'Your answer is incorrect\' and correct answer section with all correct answers from the correct accordion should be displayed', () => {
147
+ imageHighlightPage.steps.resetQuestionPreview();
148
+ imageHighlightPage.steps.highlightARegionInPreviewTab(1);
149
+ imageHighlightPage.steps.highlightARegionInPreviewTab(3);
150
+ imageHighlightPage.steps.verifyPreviewScore(0, 20);
151
+ imageHighlightPage.steps.switchToGradingView();
152
+ imageHighlightPage.steps.verifyDefaultHighlightRegion(0);
153
+ imageHighlightPage.steps.verifyIncorrectHighlightRegion(1);
154
+ imageHighlightPage.steps.verifyDefaultHighlightRegion(2);
155
+ imageHighlightPage.steps.verifyCorrectHighlightRegion(3);
156
+ imageHighlightPage.steps.verifyCorrectAnswerContainerContents(['Option 1', 'Option 4'], [1, 2]);
157
+ imageHighlightPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
158
+ imageHighlightPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
159
+
160
+ cy.log('When the user has attempted the question with equal number of correct responses from correct and alternative accordion and clicks on \'Check answer\' button, then correct icon should be displayed besides the correct answer responses, incorrect icon should be displayed beside empty responses a status message with text \'Your answer is incorrect\' and correct answer section should not be displayed')
161
+ imageHighlightPage.steps.checkAnswer();
162
+ imageHighlightPage.steps.verifyHiddenHighlightRegion(0);
163
+ imageHighlightPage.steps.verifyIncorrectHighlightRegion(1);
164
+ imageHighlightPage.steps.verifyHiddenHighlightRegion(2);
165
+ imageHighlightPage.steps.verifyCorrectHighlightRegion(3);
166
+ imageHighlightPage.steps.verifyCorrectAnswerSectionNotExists();
167
+ imageHighlightPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
168
+ });
169
+
170
+ it('Race condition 1: When the user attempts the question with the common response between correct and alternative accordion, then the user should be awarded with 0 points and on switching to \'Grading\' view, green check-mark icon should be besides the common response, no icon should be displayed beside unattempted response, \'Your answer is incorrect\' and correct answer section with all correct answers from the correct accordion should be displayed', () => {
171
+ imageHighlightPage.steps.resetQuestionPreview();
172
+ imageHighlightPage.steps.highlightARegionInPreviewTab(0);
173
+ imageHighlightPage.steps.verifyPreviewScore(0, 20);
174
+ imageHighlightPage.steps.switchToGradingView();
175
+ imageHighlightPage.steps.verifyCorrectHighlightRegion(0);
176
+ imageHighlightPage.steps.verifyDefaultHighlightRegion(1);
177
+ imageHighlightPage.steps.verifyDefaultHighlightRegion(2);
178
+ imageHighlightPage.steps.verifyDefaultHighlightRegion(3);
179
+ imageHighlightPage.steps.verifyCorrectAnswerContainerContents(['Option 1', 'Option 4'], [1, 2]);
180
+ imageHighlightPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
181
+ imageHighlightPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
182
+
183
+ cy.log('When the user has attempted the question with equal number of correct responses from correct and alternative accordion and clicks on \'Check answer\' button, then correct icon should be displayed besides the correct answer responses, no icon should be displayed beside unattempted response a status message with text \'Your answer is incorrect\' and correct answer section should not be displayed')
184
+ imageHighlightPage.steps.checkAnswer();
185
+ imageHighlightPage.steps.verifyCorrectHighlightRegion(0);
186
+ imageHighlightPage.steps.verifyHiddenHighlightRegion(1);
187
+ imageHighlightPage.steps.verifyHiddenHighlightRegion(2);
188
+ imageHighlightPage.steps.verifyHiddenHighlightRegion(3);
189
+ imageHighlightPage.steps.verifyCorrectAnswerSectionNotExists();
190
+ imageHighlightPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
191
+ });
192
+
193
+ it('Race condition 2: When the user attempts the question partially correct with all the responses, then the user should be awarded 0 points and on switching to \'Grading\' view, correct icon should be displayed besides the response from the correct accordion, incorrect icon should be displayed besides the responses from the alternative accordion and no icon should be displayed beside unattempted response, a status message with text \'Your answer is incorrect\' and correct answer section with all correct answers from the correct accordion should be displayed', () => {
194
+ imageHighlightPage.steps.resetQuestionPreview();
195
+ imageHighlightPage.steps.highlightARegionInPreviewTab(0);
196
+ imageHighlightPage.steps.highlightARegionInPreviewTab(1);
197
+ imageHighlightPage.steps.highlightARegionInPreviewTab(3);
198
+ imageHighlightPage.steps.verifyPreviewScore(0, 20);
199
+ imageHighlightPage.steps.switchToGradingView();
200
+ imageHighlightPage.steps.verifyCorrectHighlightRegion(0);
201
+ imageHighlightPage.steps.verifyIncorrectHighlightRegion(1);
202
+ imageHighlightPage.steps.verifyDefaultHighlightRegion(2);
203
+ imageHighlightPage.steps.verifyCorrectHighlightRegion(3);
204
+ imageHighlightPage.steps.verifyCorrectAnswerContainerContents(['Option 1', 'Option 4'], [1, 2]);
205
+ imageHighlightPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
206
+ imageHighlightPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
207
+
208
+ cy.log('When the user has attempted the question with partially correct with all the response, and clicks on \'Check answer\' button, then correct icon should be displayed besides the response from the correct accordion, incorrect icon should be displayed besides the responses from the alternative accordion and no icon should be displayed beside unattempted response, a status message with text \'Your answer is incorrect\' and correct answer section should not be displayed')
209
+ imageHighlightPage.steps.checkAnswer();
210
+ imageHighlightPage.steps.verifyCorrectHighlightRegion(0);
211
+ imageHighlightPage.steps.verifyIncorrectHighlightRegion(1);
212
+ imageHighlightPage.steps.verifyHiddenHighlightRegion(2);
213
+ imageHighlightPage.steps.verifyCorrectHighlightRegion(3);
214
+ imageHighlightPage.steps.verifyCorrectAnswerSectionNotExists();
215
+ imageHighlightPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
216
+ });
217
+
218
+ it('When the user attempts the question incorrectly, then the user should be awarded 0 points and on switching to \'Grading\' view, incorrect icons should be displayed besides all incorrect responses, no icon should be displayed beside unattempted response a status message with text \'Your answer is incorrect\' and correct answer section with all correct answers should be displayed', () => {
219
+ imageHighlightPage.steps.resetQuestionPreview();
220
+ imageHighlightPage.steps.highlightARegionInPreviewTab(2);
221
+ imageHighlightPage.steps.verifyPreviewScore(0, 20);
222
+ imageHighlightPage.steps.switchToGradingView();
223
+ imageHighlightPage.steps.verifyDefaultHighlightRegion(0);
224
+ imageHighlightPage.steps.verifyDefaultHighlightRegion(1);
225
+ imageHighlightPage.steps.verifyIncorrectHighlightRegion(2);
226
+ imageHighlightPage.steps.verifyDefaultHighlightRegion(3);
227
+ imageHighlightPage.steps.verifyCorrectAnswerContainerContents(['Option 1', 'Option 4'], [1, 2]);
228
+ imageHighlightPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
229
+ imageHighlightPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
230
+
231
+ cy.log('When the user has attempted the question incorrectly and clicks on \'Check answer\' button, then incorrect icons should be displayed besides all incorrect responses, no icon should be displayed beside unattempted response a status message with text \'Your answer is incorrect\' and correct answer section should not be displayed')
232
+ imageHighlightPage.steps.checkAnswer();
233
+ imageHighlightPage.steps.verifyHiddenHighlightRegion(0);
234
+ imageHighlightPage.steps.verifyHiddenHighlightRegion(1);
235
+ imageHighlightPage.steps.verifyIncorrectHighlightRegion(2);
236
+ imageHighlightPage.steps.verifyHiddenHighlightRegion(3);
237
+ imageHighlightPage.steps.verifyCorrectAnswerSectionNotExists();
238
+ imageHighlightPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
239
+ });
240
+ });
241
+ });