itemengine-cypress-automation 1.0.26 → 1.0.27

Sign up to get free protection for your applications and to get access to all the features.
@@ -22,17 +22,6 @@ describe('Create Item page - Highlight image: Additional settings', () => {
22
22
  cy.loginAs('admin');
23
23
  });
24
24
 
25
- describe('Additional Settings accordion', () => {
26
- abortEarlySetup();
27
- before(() => {
28
- cy.log('Navigating to Highlight image question type');
29
- highlightImagePage.steps.navigateToCreateQuestion('highlight image');
30
- cy.barsPreLoaderWait();
31
- });
32
-
33
- highlightImagePage.tests.verifyAdditonalSettingsAccordionProperties();
34
- });
35
-
36
25
  describe('Additional settings: Student response area and layout', () => {
37
26
  abortEarlySetup();
38
27
  before(() => {
@@ -58,7 +47,7 @@ describe('Create Item page - Highlight image: Additional settings', () => {
58
47
 
59
48
  //Note: a11y covered in verifyAdditonalSettingsAccordionProperties
60
49
  });
61
-
50
+
62
51
  describe('Additional settings: Answer numeration (only while grading) contents', () => {
63
52
  abortEarlySetup();
64
53
  before(() => {
@@ -148,211 +137,6 @@ describe('Create Item page - Highlight image: Additional settings', () => {
148
137
  });
149
138
  });
150
139
 
151
- describe('Additional settings: Font size contents', () => {
152
- abortEarlySetup();
153
- before(() => {
154
- cy.log('Navigating to Highlight question type');
155
- highlightImagePage.steps.navigateToCreateQuestion('highlight image');
156
- cy.barsPreLoaderWait();
157
- highlightImagePage.steps.expandAdditonalSettings();
158
- });
159
-
160
- highlightImagePage.tests.verifyFontSizeSectionContents();
161
- });
162
-
163
- describe('Additional settings: Font size functionality set correct answer section', () => {
164
- abortEarlySetup();
165
- before(() => {
166
- cy.log('Navigating to Highlight question type');
167
- highlightImagePage.steps.navigateToCreateQuestion('highlight image');
168
- cy.barsPreLoaderWait();
169
- uploadImageSectionComponent.steps.uploadFile('highlightImage.jpg');
170
- uploadImageSectionComponent.steps.verifyUploadedImageInImagePopup();
171
- uploadImageSectionComponent.steps.clickOnImagePopupOkButton();
172
- utilities.verifyElementVisibilityState(uploadImageSectionComponent.uploadImagePopup(), 'notExist');
173
- highlightImagePage.steps.verifyImageUploadedInHighlightRegion();
174
- highlightImagePage.steps.verifyImageUploadedInSetCorrectAnswerSection();
175
- highlightImagePage.steps.highlightRegionInImage(flowerHighlightRegion);
176
- highlightImagePage.steps.highlightRegionInImage(branchesHighlightRegion);
177
- highlightImagePage.steps.expandAdditonalSettings();
178
- });
179
-
180
- fontSizeDropdownOptions.forEach((option, fontsIndex) => {
181
- it(`When the user selects \'${option}\' option from the Font Size dropdown, then font size of the set correct answer section should not change to ${option}`, () => {
182
- highlightImagePage.steps.selectFontSizeOptionFromFontSizeDropdown(fontsIndex);
183
- utilities.verifyInnerText(highlightImagePage.fontSizeDropdown(), `${option}`);
184
- utilities.verifyCSS(highlightImagePage.setCorrectAnswerSectionImage(), {
185
- 'font-size': fontSizes[2]
186
- });
187
- utilities.verifyCSS(highlightImagePage.highlightNumeration(), {
188
- 'font-size': fontSizes[0]
189
- });
190
- });
191
- });
192
- });
193
-
194
- describe('Additional settings: Font size functionality preview tab', () => {
195
- abortEarlySetup();
196
- before(() => {
197
- cy.log('Navigating to Highlight question type');
198
- highlightImagePage.steps.navigateToCreateQuestion('highlight image');
199
- cy.barsPreLoaderWait();
200
- highlightImagePage.steps.addQuestionInstructions();
201
- uploadImageSectionComponent.steps.uploadFile('highlightImage.jpg');
202
- uploadImageSectionComponent.steps.verifyUploadedImageInImagePopup();
203
- uploadImageSectionComponent.steps.clickOnImagePopupOkButton();
204
- utilities.verifyElementVisibilityState(uploadImageSectionComponent.uploadImagePopup(), 'notExist');
205
- highlightImagePage.steps.verifyImageUploadedInHighlightRegion();
206
- highlightImagePage.steps.verifyImageUploadedInSetCorrectAnswerSection();
207
- highlightImagePage.steps.highlightRegionInImage(flowerHighlightRegion);
208
- highlightImagePage.steps.highlightRegionInImage(branchesHighlightRegion);
209
- highlightImagePage.steps.allotPoints(10);
210
- highlightImagePage.steps.highlightARegionInSetCorrectAnswerSection(0);
211
- highlightImagePage.steps.expandAdditonalSettings();
212
- });
213
-
214
- fontSizeDropdownOptions.forEach((option, fontsIndex) => {
215
- it(`When the user selects \'${option}\' option from the Font Size dropdown, then font size of the preview tab should change to ${option} accordingly`, () => {
216
- highlightImagePage.steps.selectFontSizeOptionFromFontSizeDropdown(fontsIndex);
217
- utilities.verifyInnerText(highlightImagePage.fontSizeDropdown(), `${option}`);
218
- highlightImagePage.steps.switchToPreviewTab();
219
- utilities.verifyCSS(highlightImagePage.questionInstructionsText(), {
220
- 'font-size': fontSizes[fontsIndex]
221
- });
222
- utilities.verifyCSS(highlightImagePage.previewTabImage(), {
223
- 'font-size': fontSizes[fontsIndex]
224
- });
225
- highlightImagePage.steps.checkShowCorrectAnswerCheckbox();
226
- highlightImagePage.steps.highlightARegionInPreviewTab(1);
227
- utilities.verifyCSS(highlightImagePage.correctAnswerContainerLabel(), {
228
- 'font-size': fontSizes[fontsIndex]
229
- });
230
- utilities.verifyCSS(highlightImagePage.correctAnswerNumeration(), {
231
- 'font-size': fontSizes[fontsIndex]
232
- });
233
- utilities.verifyCSS(highlightImagePage.correctAnswerContainerAnswerWrapper(), {
234
- 'font-size': fontSizes[fontsIndex]
235
- });
236
- highlightImagePage.steps.uncheckShowCorrectAnswerCheckbox();
237
- highlightImagePage.steps.switchToEditTab();
238
- });
239
- });
240
- });
241
-
242
- describe('Additional settings: Check answer', () => {
243
- abortEarlySetup();
244
- before(() => {
245
- cy.log('Navigating to Highlight question type');
246
- highlightImagePage.steps.navigateToCreateQuestion('highlight image');
247
- cy.barsPreLoaderWait();
248
- uploadImageSectionComponent.steps.uploadFile('highlightImage.jpg');
249
- uploadImageSectionComponent.steps.verifyUploadedImageInImagePopup();
250
- uploadImageSectionComponent.steps.clickOnImagePopupOkButton();
251
- utilities.verifyElementVisibilityState(uploadImageSectionComponent.uploadImagePopup(), 'notExist');
252
- highlightImagePage.steps.verifyImageUploadedInHighlightRegion();
253
- highlightImagePage.steps.verifyImageUploadedInSetCorrectAnswerSection();
254
- highlightImagePage.steps.highlightRegionInImage(flowerHighlightRegion);
255
- highlightImagePage.steps.highlightRegionInImage(branchesHighlightRegion);
256
- highlightImagePage.steps.allotPoints(10);
257
- highlightImagePage.steps.highlightARegionInSetCorrectAnswerSection(0);
258
- highlightImagePage.steps.expandAdditonalSettings();
259
- });
260
-
261
- highlightImagePage.tests.verifyCheckAnswerSectionAndPreviewTabCheckAnswerButton();
262
- });
263
-
264
- describe('Additional settings: Check answer functionality', () => {
265
- abortEarlySetup();
266
- before(() => {
267
- cy.log('Navigating to Highlight question type');
268
- highlightImagePage.steps.navigateToCreateQuestion('highlight image');
269
- cy.barsPreLoaderWait();
270
- highlightImagePage.steps.addQuestionInstructions();
271
- uploadImageSectionComponent.steps.uploadFile('highlightImage.jpg');
272
- uploadImageSectionComponent.steps.verifyUploadedImageInImagePopup();
273
- uploadImageSectionComponent.steps.clickOnImagePopupOkButton();
274
- utilities.verifyElementVisibilityState(uploadImageSectionComponent.uploadImagePopup(), 'notExist');
275
- highlightImagePage.steps.verifyImageUploadedInHighlightRegion();
276
- highlightImagePage.steps.verifyImageUploadedInSetCorrectAnswerSection();
277
- highlightImagePage.steps.highlightRegionInImage(flowerHighlightRegion);
278
- highlightImagePage.steps.highlightRegionInImage(branchesHighlightRegion);
279
- highlightImagePage.steps.highlightRegionInImage(leafHighlightRegion);
280
- highlightImagePage.steps.highlightRegionInImage(rootsHighlightRegion);
281
- highlightImagePage.steps.checkMultipleSelectionCheckbox();
282
- highlightImagePage.steps.highlightARegionInSetCorrectAnswerSection(0);
283
- highlightImagePage.steps.highlightARegionInSetCorrectAnswerSection(3);
284
- highlightImagePage.steps.allotPoints(10);
285
- highlightImagePage.steps.expandAdditonalSettings();
286
- highlightImagePage.steps.setMaximumCheckAnswerAttempts(2);
287
- highlightImagePage.steps.switchToPreviewTab();
288
- });
289
-
290
- highlightImagePage.tests.verifyCheckAnswerButtonFunctionalityWhenQuestionIsUnattempted();
291
-
292
- it('When user attempts the question partially correct then on clicking on the Check Answer button, green check-mark regions should be displayed for the correctly attempted highlights, red cross-mark regions should be displayed for the incorrectly attempted highlights, a label \'Incorrect answer\' and border should be displayed below the question preview', () => {
293
- highlightImagePage.steps.highlightARegionInPreviewTab(0);
294
- highlightImagePage.steps.highlightARegionInPreviewTab(1);
295
- highlightImagePage.steps.checkAnswer();
296
- highlightImagePage.steps.verifyCorrectHighlightRegion(0);
297
- highlightImagePage.steps.verifyIncorrectHighlightRegion(1);
298
- highlightImagePage.steps.verifyDefaultHighlightRegion(2);
299
- highlightImagePage.steps.verifyDefaultHighlightRegion(3);
300
- highlightImagePage.steps.verifyIncorrectAttemptBorder();
301
- highlightImagePage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect');
302
- });
303
-
304
- it('When user attempts the question correctly and clicks on the \'Check Answer\' button, green check-mark regions should be displayed for the correctly attempted highlights, a label \'Correct answer\' and border should be displayed below the question preview', () => {
305
- highlightImagePage.steps.removeHighlightOfARegionInPreviewTab(1);
306
- highlightImagePage.steps.highlightARegionInPreviewTab(3);
307
- highlightImagePage.steps.checkAnswer();
308
- highlightImagePage.steps.verifyCorrectHighlightRegion(0);
309
- highlightImagePage.steps.verifyDefaultHighlightRegion(1);
310
- highlightImagePage.steps.verifyDefaultHighlightRegion(2);
311
- highlightImagePage.steps.verifyCorrectHighlightRegion(3);
312
- highlightImagePage.steps.verifyCorrectAttemptBorder();
313
- highlightImagePage.steps.verifyCorrectIncorrectAnswerLabel('Correct');
314
- });
315
-
316
- highlightImagePage.tests.verifyDisabledCheckAnswerButtonWithCSSAnda11y();
317
-
318
- it('When the user updates the value of Maximum check answer attempts input field, it should get reflected on the Preview tab', () => {
319
- highlightImagePage.steps.switchToEditTab();
320
- highlightImagePage.steps.clearMaximumCheckAnswerAttemptsInputField();
321
- highlightImagePage.steps.addInputToMaximumCheckAnswerAttemptsInputField(1);
322
- highlightImagePage.steps.switchToPreviewTab();
323
- highlightImagePage.steps.verifyCheckAnswerButtonEnabled();
324
- highlightImagePage.steps.highlightARegionInPreviewTab(2);
325
- highlightImagePage.steps.checkAnswer();
326
- highlightImagePage.steps.verifyCheckAnswerButtonDisabled();
327
- });
328
-
329
- it('When the \'Maximum check answer attempts\' input field has value \'0\' and user switches to Preview tab, then the \'Check Answer\' button should be enabled and user should be able to check answer multiple times', () => {
330
- highlightImagePage.steps.switchToEditTab();
331
- highlightImagePage.steps.clearMaximumCheckAnswerAttemptsInputField();
332
- highlightImagePage.steps.addInputToMaximumCheckAnswerAttemptsInputField(0);
333
- cy.log('Switching to Preview tab')
334
- highlightImagePage.steps.switchToPreviewTab();
335
- highlightImagePage.steps.highlightARegionInPreviewTab(0);
336
- highlightImagePage.steps.checkAnswer();
337
- highlightImagePage.steps.verifyCheckAnswerButtonEnabled();
338
- highlightImagePage.steps.highlightARegionInPreviewTab(1);
339
- highlightImagePage.steps.checkAnswer();
340
- highlightImagePage.steps.verifyCheckAnswerButtonEnabled();
341
- });
342
-
343
- it('When the \'Maximum check answer attempts\' input field is empty and user switches to Preview tab, then the \'Check Answer\' button should be enabled and user should be able to check answer multiple times', () => {
344
- highlightImagePage.steps.switchToEditTab();
345
- highlightImagePage.steps.clearMaximumCheckAnswerAttemptsInputField()
346
- highlightImagePage.steps.switchToPreviewTab();
347
- highlightImagePage.steps.highlightARegionInPreviewTab(0);
348
- highlightImagePage.steps.checkAnswer();
349
- highlightImagePage.steps.verifyCheckAnswerButtonEnabled();
350
- highlightImagePage.steps.highlightARegionInPreviewTab(1);
351
- highlightImagePage.steps.checkAnswer();
352
- highlightImagePage.steps.verifyCheckAnswerButtonEnabled();
353
- });
354
- });
355
-
356
140
  describe('Additional settings: Canvas maximum width contents and set correct answer section', () => {
357
141
  abortEarlySetup();
358
142
  before(() => {
@@ -432,16 +216,4 @@ describe('Create Item page - Highlight image: Additional settings', () => {
432
216
  highlightImagePage.steps.verifyHeightAndWidthOfImageInPreviewTab(imageHeight, imageWidth);
433
217
  });
434
218
  });
435
-
436
- describe('Additional Settings: Details section', () => {
437
- abortEarlySetup();
438
- before(() => {
439
- cy.log('Navigating to Highlight image question type');
440
- highlightImagePage.steps.navigateToCreateQuestion('highlight image');
441
- cy.barsPreLoaderWait();
442
- highlightImagePage.steps.expandAdditonalSettings();
443
- });
444
-
445
- highlightImagePage.tests.verifyDetailsSection();
446
- });
447
219
  });
@@ -0,0 +1,252 @@
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
+ let imageWidth = 500;
8
+ let imageHeight = 500;
9
+ const flowerHighlightRegion = [[24, 6], [24, 24], [56, 24], [56, 6]];
10
+ const branchesHighlightRegion = [[36, 36], [36, 46], [58, 46], [58, 36]];
11
+ const leafHighlightRegion = [[54, 48], [54, 72], [82, 72], [82, 48]];
12
+ const rootsHighlightRegion = [[28, 84], [28, 98], [74, 98], [74, 84]];
13
+ const numbers = ['1', '2'];
14
+ const lowercase = ['a', 'b'];
15
+ const uppercase = ['A', 'B'];
16
+ const fontSizeDropdownOptions = ['Default', 'Small', 'Normal', 'Large', 'Extra large', 'Huge'];
17
+ const fontSizes = ['16px', '12px', '14px', '17px', '20px', '24px'];
18
+ const answerNumerationDropdownOptions = ['Numerical', 'Uppercase alphabet', 'Lowercase alphabet'];
19
+
20
+ describe('Create Item page - Highlight image: Additional settings', () => {
21
+ before(() => {
22
+ cy.loginAs('admin');
23
+ });
24
+
25
+ describe('Additional Settings accordion', () => {
26
+ abortEarlySetup();
27
+ before(() => {
28
+ cy.log('Navigating to Highlight image question type');
29
+ highlightImagePage.steps.navigateToCreateQuestion('highlight image');
30
+ cy.barsPreLoaderWait();
31
+ });
32
+
33
+ highlightImagePage.tests.verifyAdditonalSettingsAccordionProperties();
34
+ });
35
+
36
+ describe('Additional settings: Font size contents', () => {
37
+ abortEarlySetup();
38
+ before(() => {
39
+ cy.log('Navigating to Highlight question type');
40
+ highlightImagePage.steps.navigateToCreateQuestion('highlight image');
41
+ cy.barsPreLoaderWait();
42
+ highlightImagePage.steps.expandAdditonalSettings();
43
+ });
44
+
45
+ highlightImagePage.tests.verifyFontSizeSectionContents();
46
+ });
47
+
48
+ describe('Additional settings: Font size functionality set correct answer section', () => {
49
+ abortEarlySetup();
50
+ before(() => {
51
+ cy.log('Navigating to Highlight question type');
52
+ highlightImagePage.steps.navigateToCreateQuestion('highlight image');
53
+ cy.barsPreLoaderWait();
54
+ uploadImageSectionComponent.steps.uploadFile('highlightImage.jpg');
55
+ uploadImageSectionComponent.steps.verifyUploadedImageInImagePopup();
56
+ uploadImageSectionComponent.steps.clickOnImagePopupOkButton();
57
+ utilities.verifyElementVisibilityState(uploadImageSectionComponent.uploadImagePopup(), 'notExist');
58
+ highlightImagePage.steps.verifyImageUploadedInHighlightRegion();
59
+ highlightImagePage.steps.verifyImageUploadedInSetCorrectAnswerSection();
60
+ highlightImagePage.steps.highlightRegionInImage(flowerHighlightRegion);
61
+ highlightImagePage.steps.highlightRegionInImage(branchesHighlightRegion);
62
+ highlightImagePage.steps.expandAdditonalSettings();
63
+ });
64
+
65
+ fontSizeDropdownOptions.forEach((option, fontsIndex) => {
66
+ it(`When the user selects \'${option}\' option from the Font Size dropdown, then font size of the set correct answer section should not change to ${option}`, () => {
67
+ highlightImagePage.steps.selectFontSizeOptionFromFontSizeDropdown(fontsIndex);
68
+ utilities.verifyInnerText(highlightImagePage.fontSizeDropdown(), `${option}`);
69
+ utilities.verifyCSS(highlightImagePage.setCorrectAnswerSectionImage(), {
70
+ 'font-size': fontSizes[2]
71
+ });
72
+ utilities.verifyCSS(highlightImagePage.highlightNumeration(), {
73
+ 'font-size': fontSizes[0]
74
+ });
75
+ });
76
+ });
77
+ });
78
+
79
+ describe('Additional settings: Font size functionality preview tab', () => {
80
+ abortEarlySetup();
81
+ before(() => {
82
+ cy.log('Navigating to Highlight question type');
83
+ highlightImagePage.steps.navigateToCreateQuestion('highlight image');
84
+ cy.barsPreLoaderWait();
85
+ highlightImagePage.steps.addQuestionInstructions();
86
+ uploadImageSectionComponent.steps.uploadFile('highlightImage.jpg');
87
+ uploadImageSectionComponent.steps.verifyUploadedImageInImagePopup();
88
+ uploadImageSectionComponent.steps.clickOnImagePopupOkButton();
89
+ utilities.verifyElementVisibilityState(uploadImageSectionComponent.uploadImagePopup(), 'notExist');
90
+ highlightImagePage.steps.verifyImageUploadedInHighlightRegion();
91
+ highlightImagePage.steps.verifyImageUploadedInSetCorrectAnswerSection();
92
+ highlightImagePage.steps.highlightRegionInImage(flowerHighlightRegion);
93
+ highlightImagePage.steps.highlightRegionInImage(branchesHighlightRegion);
94
+ highlightImagePage.steps.allotPoints(10);
95
+ highlightImagePage.steps.highlightARegionInSetCorrectAnswerSection(0);
96
+ highlightImagePage.steps.expandAdditonalSettings();
97
+ });
98
+
99
+ fontSizeDropdownOptions.forEach((option, fontsIndex) => {
100
+ it(`When the user selects \'${option}\' option from the Font Size dropdown, then font size of the preview tab should change to ${option} accordingly`, () => {
101
+ highlightImagePage.steps.selectFontSizeOptionFromFontSizeDropdown(fontsIndex);
102
+ utilities.verifyInnerText(highlightImagePage.fontSizeDropdown(), `${option}`);
103
+ highlightImagePage.steps.switchToPreviewTab();
104
+ utilities.verifyCSS(highlightImagePage.questionInstructionsText(), {
105
+ 'font-size': fontSizes[fontsIndex]
106
+ });
107
+ utilities.verifyCSS(highlightImagePage.previewTabImage(), {
108
+ 'font-size': fontSizes[fontsIndex]
109
+ });
110
+ highlightImagePage.steps.checkShowCorrectAnswerCheckbox();
111
+ highlightImagePage.steps.highlightARegionInPreviewTab(1);
112
+ utilities.verifyCSS(highlightImagePage.correctAnswerContainerLabel(), {
113
+ 'font-size': fontSizes[fontsIndex]
114
+ });
115
+ utilities.verifyCSS(highlightImagePage.correctAnswerNumeration(), {
116
+ 'font-size': fontSizes[fontsIndex]
117
+ });
118
+ utilities.verifyCSS(highlightImagePage.correctAnswerContainerAnswerWrapper(), {
119
+ 'font-size': fontSizes[fontsIndex]
120
+ });
121
+ highlightImagePage.steps.uncheckShowCorrectAnswerCheckbox();
122
+ highlightImagePage.steps.switchToEditTab();
123
+ });
124
+ });
125
+ });
126
+
127
+ describe('Additional settings: Check answer', () => {
128
+ abortEarlySetup();
129
+ before(() => {
130
+ cy.log('Navigating to Highlight question type');
131
+ highlightImagePage.steps.navigateToCreateQuestion('highlight image');
132
+ cy.barsPreLoaderWait();
133
+ uploadImageSectionComponent.steps.uploadFile('highlightImage.jpg');
134
+ uploadImageSectionComponent.steps.verifyUploadedImageInImagePopup();
135
+ uploadImageSectionComponent.steps.clickOnImagePopupOkButton();
136
+ utilities.verifyElementVisibilityState(uploadImageSectionComponent.uploadImagePopup(), 'notExist');
137
+ highlightImagePage.steps.verifyImageUploadedInHighlightRegion();
138
+ highlightImagePage.steps.verifyImageUploadedInSetCorrectAnswerSection();
139
+ highlightImagePage.steps.highlightRegionInImage(flowerHighlightRegion);
140
+ highlightImagePage.steps.highlightRegionInImage(branchesHighlightRegion);
141
+ highlightImagePage.steps.allotPoints(10);
142
+ highlightImagePage.steps.highlightARegionInSetCorrectAnswerSection(0);
143
+ highlightImagePage.steps.expandAdditonalSettings();
144
+ });
145
+
146
+ highlightImagePage.tests.verifyCheckAnswerSectionAndPreviewTabCheckAnswerButton();
147
+ });
148
+
149
+ describe('Additional settings: Check answer functionality', () => {
150
+ abortEarlySetup();
151
+ before(() => {
152
+ cy.log('Navigating to Highlight question type');
153
+ highlightImagePage.steps.navigateToCreateQuestion('highlight image');
154
+ cy.barsPreLoaderWait();
155
+ highlightImagePage.steps.addQuestionInstructions();
156
+ uploadImageSectionComponent.steps.uploadFile('highlightImage.jpg');
157
+ uploadImageSectionComponent.steps.verifyUploadedImageInImagePopup();
158
+ uploadImageSectionComponent.steps.clickOnImagePopupOkButton();
159
+ utilities.verifyElementVisibilityState(uploadImageSectionComponent.uploadImagePopup(), 'notExist');
160
+ highlightImagePage.steps.verifyImageUploadedInHighlightRegion();
161
+ highlightImagePage.steps.verifyImageUploadedInSetCorrectAnswerSection();
162
+ highlightImagePage.steps.highlightRegionInImage(flowerHighlightRegion);
163
+ highlightImagePage.steps.highlightRegionInImage(branchesHighlightRegion);
164
+ highlightImagePage.steps.highlightRegionInImage(leafHighlightRegion);
165
+ highlightImagePage.steps.highlightRegionInImage(rootsHighlightRegion);
166
+ highlightImagePage.steps.checkMultipleSelectionCheckbox();
167
+ highlightImagePage.steps.highlightARegionInSetCorrectAnswerSection(0);
168
+ highlightImagePage.steps.highlightARegionInSetCorrectAnswerSection(3);
169
+ highlightImagePage.steps.allotPoints(10);
170
+ highlightImagePage.steps.expandAdditonalSettings();
171
+ highlightImagePage.steps.setMaximumCheckAnswerAttempts(2);
172
+ highlightImagePage.steps.switchToPreviewTab();
173
+ });
174
+
175
+ highlightImagePage.tests.verifyCheckAnswerButtonFunctionalityWhenQuestionIsUnattempted();
176
+
177
+ it('When user attempts the question partially correct then on clicking on the Check Answer button, green check-mark regions should be displayed for the correctly attempted highlights, red cross-mark regions should be displayed for the incorrectly attempted highlights, a label \'Incorrect answer\' and border should be displayed below the question preview', () => {
178
+ highlightImagePage.steps.highlightARegionInPreviewTab(0);
179
+ highlightImagePage.steps.highlightARegionInPreviewTab(1);
180
+ highlightImagePage.steps.checkAnswer();
181
+ highlightImagePage.steps.verifyCorrectHighlightRegion(0);
182
+ highlightImagePage.steps.verifyIncorrectHighlightRegion(1);
183
+ highlightImagePage.steps.verifyDefaultHighlightRegion(2);
184
+ highlightImagePage.steps.verifyDefaultHighlightRegion(3);
185
+ highlightImagePage.steps.verifyIncorrectAttemptBorder();
186
+ highlightImagePage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect');
187
+ });
188
+
189
+ it('When user attempts the question correctly and clicks on the \'Check Answer\' button, green check-mark regions should be displayed for the correctly attempted highlights, a label \'Correct answer\' and border should be displayed below the question preview', () => {
190
+ highlightImagePage.steps.removeHighlightOfARegionInPreviewTab(1);
191
+ highlightImagePage.steps.highlightARegionInPreviewTab(3);
192
+ highlightImagePage.steps.checkAnswer();
193
+ highlightImagePage.steps.verifyCorrectHighlightRegion(0);
194
+ highlightImagePage.steps.verifyDefaultHighlightRegion(1);
195
+ highlightImagePage.steps.verifyDefaultHighlightRegion(2);
196
+ highlightImagePage.steps.verifyCorrectHighlightRegion(3);
197
+ highlightImagePage.steps.verifyCorrectAttemptBorder();
198
+ highlightImagePage.steps.verifyCorrectIncorrectAnswerLabel('Correct');
199
+ });
200
+
201
+ highlightImagePage.tests.verifyDisabledCheckAnswerButtonWithCSSAnda11y();
202
+
203
+ it('When the user updates the value of Maximum check answer attempts input field, it should get reflected on the Preview tab', () => {
204
+ highlightImagePage.steps.switchToEditTab();
205
+ highlightImagePage.steps.clearMaximumCheckAnswerAttemptsInputField();
206
+ highlightImagePage.steps.addInputToMaximumCheckAnswerAttemptsInputField(1);
207
+ highlightImagePage.steps.switchToPreviewTab();
208
+ highlightImagePage.steps.verifyCheckAnswerButtonEnabled();
209
+ highlightImagePage.steps.highlightARegionInPreviewTab(2);
210
+ highlightImagePage.steps.checkAnswer();
211
+ highlightImagePage.steps.verifyCheckAnswerButtonDisabled();
212
+ });
213
+
214
+ it('When the \'Maximum check answer attempts\' input field has value \'0\' and user switches to Preview tab, then the \'Check Answer\' button should be enabled and user should be able to check answer multiple times', () => {
215
+ highlightImagePage.steps.switchToEditTab();
216
+ highlightImagePage.steps.clearMaximumCheckAnswerAttemptsInputField();
217
+ highlightImagePage.steps.addInputToMaximumCheckAnswerAttemptsInputField(0);
218
+ cy.log('Switching to Preview tab')
219
+ highlightImagePage.steps.switchToPreviewTab();
220
+ highlightImagePage.steps.highlightARegionInPreviewTab(0);
221
+ highlightImagePage.steps.checkAnswer();
222
+ highlightImagePage.steps.verifyCheckAnswerButtonEnabled();
223
+ highlightImagePage.steps.highlightARegionInPreviewTab(1);
224
+ highlightImagePage.steps.checkAnswer();
225
+ highlightImagePage.steps.verifyCheckAnswerButtonEnabled();
226
+ });
227
+
228
+ it('When the \'Maximum check answer attempts\' input field is empty and user switches to Preview tab, then the \'Check Answer\' button should be enabled and user should be able to check answer multiple times', () => {
229
+ highlightImagePage.steps.switchToEditTab();
230
+ highlightImagePage.steps.clearMaximumCheckAnswerAttemptsInputField()
231
+ highlightImagePage.steps.switchToPreviewTab();
232
+ highlightImagePage.steps.highlightARegionInPreviewTab(0);
233
+ highlightImagePage.steps.checkAnswer();
234
+ highlightImagePage.steps.verifyCheckAnswerButtonEnabled();
235
+ highlightImagePage.steps.highlightARegionInPreviewTab(1);
236
+ highlightImagePage.steps.checkAnswer();
237
+ highlightImagePage.steps.verifyCheckAnswerButtonEnabled();
238
+ });
239
+ });
240
+
241
+ describe('Additional Settings: Details section', () => {
242
+ abortEarlySetup();
243
+ before(() => {
244
+ cy.log('Navigating to Highlight image question type');
245
+ highlightImagePage.steps.navigateToCreateQuestion('highlight image');
246
+ cy.barsPreLoaderWait();
247
+ highlightImagePage.steps.expandAdditonalSettings();
248
+ });
249
+
250
+ highlightImagePage.tests.verifyDetailsSection();
251
+ });
252
+ });