itemengine-cypress-automation 1.0.564-IEI-7011-cf323ce.0 → 1.0.564-IEI-6998-Add-coverage-for-image-hightlight-question-type-f372002.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (24) hide show
  1. package/cypress/config-files/ilprod.json +1 -2
  2. package/cypress/config-files/ilqa.json +1 -2
  3. package/cypress/config-files/ilstage.json +1 -2
  4. package/cypress/e2e/ILC/ImageHighlight/additionalSettings.js +86 -0
  5. package/cypress/e2e/ILC/ImageHighlight/backgroundImageAndCanvasProperties.js +60 -9
  6. package/cypress/e2e/ILC/ImageHighlight/customiseHighlightStyle.js +14 -12
  7. package/cypress/e2e/ILC/ImageHighlight/imageHighlightStyle.js +12 -3
  8. package/cypress/e2e/ILC/ImageHighlight/minimumScoringPenaltyPointsAndRoundingDropdown.js +65 -2
  9. package/cypress/e2e/ILC/ImageHighlight/studentViewSettings.js +15 -1
  10. package/cypress/e2e/ILC/MultipleSelection/allOrNothingBasicForAllViews.smoke.js +1 -168
  11. package/cypress/e2e/ILC/MultipleSelection/allOrNothingWithAlternativeAnswer.js +0 -86
  12. package/cypress/e2e/ILC/MultipleSelection/partialDifferentWeightsWithAlternativeAnswer.js +0 -91
  13. package/cypress/e2e/ILC/MultipleSelection/partialEqualWeightsWithAlternativeAnswer.js +0 -79
  14. package/cypress/e2e/ILC/SingleSelection/allOrNothingBasicForAllViews.smoke.js +0 -130
  15. package/cypress/e2e/ILC/SingleSelection/allOrNothingWithAlternativeAnswer.js +0 -16
  16. package/cypress/pages/components/index.js +0 -1
  17. package/cypress/pages/imageHighlightPage.js +184 -7
  18. package/cypress/pages/itemPreviewPage.js +1 -0
  19. package/cypress/pages/multipleSelectionPage.js +1 -3
  20. package/cypress/pages/singleSelectionPage.js +1 -5
  21. package/cypress/support/helpers/utilities.js +16 -0
  22. package/package.json +1 -1
  23. package/service.yaml +1 -9
  24. package/cypress/pages/components/showAlternativeAnswersComponent.js +0 -169
@@ -12,7 +12,6 @@
12
12
  "admin_password": "GzL1Ezjou4wVFL8o",
13
13
  "organisation_id": "eb7d4a20-c96c-4852-9b34-7e3231016315",
14
14
  "migration_usernme": "ilc-prod-content-user",
15
- "migration_password": "Oj2kTWQM7ZRmegmS",
16
- "ENABLE_ALTERNATIVE_ANSWER_ENHANCEMENT": "false"
15
+ "migration_password": "Oj2kTWQM7ZRmegmS"
17
16
  }
18
17
  }
@@ -12,7 +12,6 @@
12
12
  "admin_password": "GtOrLiig9surpeW1",
13
13
  "organisation_id": "eb7d4a20-c96c-4852-9b34-7e3231016315",
14
14
  "migration_usernme": "demo-technical-tester",
15
- "migration_password": "SXYeokWOoTuwEg2w",
16
- "ENABLE_ALTERNATIVE_ANSWER_ENHANCEMENT": "true"
15
+ "migration_password": "SXYeokWOoTuwEg2w"
17
16
  }
18
17
  }
@@ -10,7 +10,6 @@
10
10
  "scriptSrc": "https://assets-itemengine-staging.imaginelearning.com/content/itemengine-assets-staging/v2/author-loader-nocache.js",
11
11
  "admin_username": "demouser-ilc",
12
12
  "admin_password": "T6b9FK0pC6Tg8wDz",
13
- "organisation_id": "eb7d4a20-c96c-4852-9b34-7e3231016315",
14
- "ENABLE_ALTERNATIVE_ANSWER_ENHANCEMENT": "false"
13
+ "organisation_id": "eb7d4a20-c96c-4852-9b34-7e3231016315"
15
14
  }
16
15
  }
@@ -198,4 +198,90 @@ describe('Create Item page - Image highlight : Additional settings', () => {
198
198
  imageHighlightPage.steps.verifyHighlightRegionAriaLabelPreviewTab(1, 'Response 2 of 2');
199
199
  });
200
200
  });
201
+
202
+ describe('Additional settings: Enumeration placement and details section', () => {
203
+ abortEarlySetup();
204
+ before(() => {
205
+ imageHighlightPage.steps.navigateToCreateQuestion('image highlight');
206
+ cy.barsPreLoaderWait();
207
+ imageHighlightPage.steps.uploadFile('highlightImage.jpg');
208
+ imageHighlightPage.steps.addTextInQuestionInstructionsInputField('Select the appropriate highlight in the image below');
209
+ imageHighlightPage.steps.verifyImageUploadedInSpecifyPossibleOptionsSection();
210
+ imageHighlightPage.steps.verifyImageUploadedSpecifyCorrectAnswer();
211
+ imageHighlightPage.steps.highlightRegionInImage(flowerHighlightRegion);
212
+ imageHighlightPage.steps.highlightRegionInImage(leafHighlightRegion);
213
+ imageHighlightPage.steps.allotPoints(10);
214
+ imageHighlightPage.steps.highlightARegionInSpecifyCorrectAnswerSection(0);
215
+ imageHighlightPage.steps.highlightARegionInSpecifyCorrectAnswerSection(1);
216
+ imageHighlightPage.steps.expandAdditionalSettings();
217
+ imageHighlightPage.steps.switchToPreviewTab();
218
+ });
219
+
220
+ it('The enumeration placement label should be displayed in the additional settings accordion of edit tab and should contain text "Enumeration placement"', () => {
221
+ imageHighlightPage.steps.switchToEditTab();
222
+ utilities.verifyInnerText(imageHighlightPage.enumerationPlacementLabel(), 'Enumeration placement');
223
+ utilities.verifyElementVisibilityState(imageHighlightPage.enumerationPlacementLabel(), 'visible');
224
+ });
225
+
226
+ it('Toggle buttons with options "Top", "Center" and "Bottom" should be present for enumeration placement and by default "Top" enumeration placement toggle button should be selected and other toggles should not be not selected', () => {
227
+ utilities.verifyElementVisibilityState(imageHighlightPage.enumerationToggleButtonContainer(), 'visible');
228
+ utilities.verifyElementVisibilityState(imageHighlightPage.enumerationPlacementTopToggleButton(), 'visible');
229
+ utilities.verifyElementVisibilityState(imageHighlightPage.enumerationPlacementCenterToggleButton(), 'visible');
230
+ utilities.verifyElementVisibilityState(imageHighlightPage.enumerationPlacementBottomToggleButton(), 'visible');
231
+ utilities.verifiedElementSelectedNotSelectedState(imageHighlightPage.enumerationPlacementTopToggleButton(), 'selected');
232
+ utilities.verifiedElementSelectedNotSelectedState(imageHighlightPage.enumerationPlacementCenterToggleButton(), 'notSelected');
233
+ utilities.verifiedElementSelectedNotSelectedState(imageHighlightPage.enumerationPlacementBottomToggleButton(), 'notSelected');
234
+ });
235
+
236
+ it('When toggle button for "Enumeration placement" is set to "Top" then the numeration placement should be updated to top for the highlight region in the preview tab', () => {
237
+ imageHighlightPage.steps.switchToPreviewTab();
238
+ imageHighlightPage.steps.highlightARegionInPreviewTab(0);
239
+ imageHighlightPage.steps.highlightARegionInPreviewTab(1);
240
+ imageHighlightPage.steps.switchToGradingView();
241
+ imageHighlightPage.steps.verifyNumerationPlacementForHighlightRegionInPreviewTab('Top', 0);
242
+ imageHighlightPage.steps.verifyNumerationPlacementForHighlightRegionInPreviewTab('Top', 1);
243
+ });
244
+
245
+ it('When the user changes "Enumeration placement" to bottom then the numeration placement should be updated to bottom for the highlight region in the preview tab', () => {
246
+ imageHighlightPage.steps.switchToEditTab();
247
+ imageHighlightPage.steps.selectBottomEnumerationPlacementToggle();
248
+ imageHighlightPage.steps.switchToPreviewTab();
249
+ imageHighlightPage.steps.highlightARegionInPreviewTab(0);
250
+ imageHighlightPage.steps.highlightARegionInPreviewTab(1);
251
+ imageHighlightPage.steps.switchToGradingView();
252
+ imageHighlightPage.steps.verifyNumerationPlacementForHighlightRegionInPreviewTab('Bottom', 0);
253
+ imageHighlightPage.steps.verifyNumerationPlacementForHighlightRegionInPreviewTab('Bottom', 1);
254
+ });
255
+
256
+ it('When the user changes "Enumeration placement" to center then the numeration placement should be updated to center for the highlight region in the preview tab', () => {
257
+ imageHighlightPage.steps.switchToEditTab();
258
+ imageHighlightPage.steps.selectCenterEnumerationPlacementToggle();
259
+ imageHighlightPage.steps.switchToPreviewTab();
260
+ imageHighlightPage.steps.highlightARegionInPreviewTab(0);
261
+ imageHighlightPage.steps.highlightARegionInPreviewTab(1);
262
+ imageHighlightPage.steps.switchToGradingView();
263
+ imageHighlightPage.steps.verifyNumerationPlacementForHighlightRegionInPreviewTab('Center', 0);
264
+ imageHighlightPage.steps.verifyNumerationPlacementForHighlightRegionInPreviewTab('Center', 1);
265
+ });
266
+
267
+ it('When the user has set "ARIA label", then it should be present for the highlight region in the preview tab', () => {
268
+ imageHighlightPage.steps.switchToEditTab();
269
+ imageHighlightPage.steps.enterTextInAriaLabelInputField(0, 'Correct response 1');
270
+ imageHighlightPage.steps.switchToPreviewTab();
271
+ imageHighlightPage.steps.verifyHighlightRegionAriaLabelPreviewTab(0, 'Correct response 1, Response 1 of 2');
272
+ imageHighlightPage.steps.verifyHighlightRegionAriaLabelPreviewTab(1, 'Response 2 of 2');
273
+ });
274
+
275
+ it('Accessibility of input field in preview tab when custom \'ARIA label\' is set', { tags: 'a11y' }, () => {
276
+ cy.checkAccessibility(imageHighlightPage.highlightPreviewTab());
277
+ });
278
+
279
+ it('When the user clears the set value in the "ARIA label" input field, then the default aria labels should be present for the highlight region in the preview tab', () => {
280
+ imageHighlightPage.steps.switchToEditTab();
281
+ imageHighlightPage.steps.clearTextInAriaLabelInputField(0);
282
+ imageHighlightPage.steps.switchToPreviewTab();
283
+ imageHighlightPage.steps.verifyHighlightRegionAriaLabelPreviewTab(0, 'Response 1 of 2');
284
+ imageHighlightPage.steps.verifyHighlightRegionAriaLabelPreviewTab(1, 'Response 2 of 2');
285
+ });
286
+ });
201
287
  });
@@ -122,6 +122,18 @@ describe('Create item page - Image highlight: Background image section', () => {
122
122
  imageHighlightPage.steps.uncheckFillImageToCanvasCheckbox();
123
123
  });
124
124
 
125
+ it('When user unchecks \'Fill image to canvas\' checkbox, then the original image dimensions should be restored', () => {
126
+ imageHighlightPage.steps.switchToPreviewTab();
127
+ imageHighlightPage.steps.verifyImageUploadedPreviewTab();
128
+ imageHighlightPage.steps.verifyImageDimensionsPreviewTab(500, 500);
129
+ });
130
+
131
+ it('When user unchecks \'Fill image to canvas\' checkbox, saves the question then the original image dimensions should be restored in item preview', () => {
132
+ imageHighlightPage.steps.saveAQuestionWithIncompleteAuthoring();
133
+ imageHighlightPage.steps.verifyImageDimensionsPreviewTab(500, 500);
134
+ imageHighlightPage.steps.clickOnEditQuestionButton();
135
+ });
136
+
125
137
  it('\'Lock aspect ratio\' and \'Reset dimensions\' buttons should be displayed and by default \'Lock aspect ratio\' button should be locked', () => {
126
138
  utilities.verifyElementVisibilityState(imageHighlightPage.lockAspectRatioButton(), 'visible');
127
139
  utilities.verifyElementVisibilityState(imageHighlightPage.resetDimensionsButton(), 'visible');
@@ -220,7 +232,7 @@ describe('Create item page - Image highlight: Background image section', () => {
220
232
  });
221
233
  });
222
234
 
223
- describe.skip('Canvas width, Canvas height, Image alternative text - Edit tab canvas section functionality', () => {
235
+ describe('Canvas width, Canvas height, Image alternative text - Edit tab canvas section functionality', () => {
224
236
  abortEarlySetup();
225
237
  before(() => {
226
238
  imageHighlightPage.steps.navigateToCreateQuestion('image highlight');
@@ -242,6 +254,7 @@ describe('Create item page - Image highlight: Background image section', () => {
242
254
 
243
255
  it('When aspect ratio is unlocked and user changes the value in height input field, then width input field should remain unchanged and the dimensions should be updated in the image popup preview section', () => {
244
256
  imageHighlightPage.steps.updateCanvasHeight(500);
257
+ cy.wait(500); //wait added to stabilize the test as sometimes it fails due to slow rendering of canvas preview section
245
258
  imageHighlightPage.steps.verifyCanvasHeight(500);
246
259
  imageHighlightPage.steps.verifyCanvasWidth(500);
247
260
  imageHighlightPage.steps.verifyCanvasHeightSpecifyCorrectAnswer(500);
@@ -251,8 +264,9 @@ describe('Create item page - Image highlight: Background image section', () => {
251
264
  it('When user locks the aspect ratio button and changes the value in the width input field, the height input field should be updated accordingly to maintain the updated aspect ratio', () => {
252
265
  imageHighlightPage.steps.lockAspectRatio();
253
266
  imageHighlightPage.steps.updateCanvasWidth(800);
254
- imageHighlightPage.steps.verifyCanvasHeight(500);
255
- imageHighlightPage.steps.verifyCanvasHeightSpecifyCorrectAnswer(500);
267
+ cy.wait(500); //wait added to stabilize the test as sometimes it fails due to slow rendering of canvas preview section
268
+ imageHighlightPage.steps.verifyCanvasHeight(450);
269
+ imageHighlightPage.steps.verifyCanvasHeightSpecifyCorrectAnswer(450);
256
270
  });
257
271
 
258
272
  it('When user selects the \'Reset dimensions\' button the height and width should reset to the original values', () => {
@@ -294,28 +308,47 @@ describe('Create item page - Image highlight: Background image section', () => {
294
308
  imageHighlightPage.steps.verifyCanvasImageTopLeftAlignedInPreviewTab();
295
309
  });
296
310
 
297
- it('When user selects \'Center\' image alignment in edit tab, then canvas image should be aligned to center in preview tab ', () => {
311
+ it('When \'Top left\' image alignment is selected by default, saves the question then in item preview the canvas image should be aligned to top left', () => {
312
+ imageHighlightPage.steps.saveAQuestionWithIncompleteAuthoring();
313
+ imageHighlightPage.steps.switchToPreviewTab();
314
+ imageHighlightPage.steps.verifyImageUploadedPreviewTab();
315
+ imageHighlightPage.steps.verifyCanvasImageTopLeftAlignedInPreviewTab();
298
316
  imageHighlightPage.steps.switchToEditTab();
317
+ imageHighlightPage.steps.clickOnEditQuestionButton();
318
+ });
319
+
320
+ it('When user selects \'Center\' image alignment in edit tab, then canvas image should be aligned to center in preview tab ', () => {
299
321
  imageHighlightPage.steps.selectCenterImageAlignment();
300
322
  imageHighlightPage.steps.switchToPreviewTab();
301
323
  imageHighlightPage.steps.verifyCanvasImageCenterAlignedInPreviewTab();
302
324
  });
303
325
 
304
- it('When user selects \'Top right\' image alignment, then canvas image should be aligned to top right in preview tab', () => {
326
+ it('When \'Center\' image alignment is selected by default, saves the question then in item preview the canvas image should be aligned to center', () => {
327
+ imageHighlightPage.steps.saveAQuestionWithIncompleteAuthoring();
328
+ imageHighlightPage.steps.switchToPreviewTab();
329
+ imageHighlightPage.steps.verifyImageUploadedPreviewTab();
330
+ imageHighlightPage.steps.verifyCanvasImageCenterAlignedInPreviewTab();
305
331
  imageHighlightPage.steps.switchToEditTab();
332
+ imageHighlightPage.steps.clickOnEditQuestionButton();
333
+ });
334
+
335
+ it('When user selects \'Top right\' image alignment, then canvas image should be aligned to top right in preview tab', () => {
306
336
  imageHighlightPage.steps.selectTopRightImageAlignment();
307
337
  imageHighlightPage.steps.switchToPreviewTab();
308
338
  imageHighlightPage.steps.verifyCanvasImageTopRightAlignedInPreviewTab();
309
339
  });
310
340
 
311
- it('When user selects \'Top left\' image alignment again, then image should be aligned to top left inside the canvas in preview tab', () => {
312
- imageHighlightPage.steps.switchToEditTab();
313
- imageHighlightPage.steps.selectTopLeftImageAlignment();
341
+ it('When \'Top right\' image alignment is selected by default, saves the question then in item preview the canvas image should be aligned to center', () => {
342
+ imageHighlightPage.steps.saveAQuestionWithIncompleteAuthoring();
314
343
  imageHighlightPage.steps.switchToPreviewTab();
315
- imageHighlightPage.steps.verifyCanvasImageTopLeftAlignedInPreviewTab();
344
+ imageHighlightPage.steps.verifyImageUploadedPreviewTab();
345
+ imageHighlightPage.steps.verifyCanvasImageTopRightAlignedInPreviewTab();
346
+ imageHighlightPage.steps.switchToEditTab();
347
+ imageHighlightPage.steps.clickOnEditQuestionButton();
316
348
  });
317
349
 
318
350
  it('When opacity is 100 percent by default, then canvas image should have 100 percent opacity in preview tab ', () => {
351
+ imageHighlightPage.steps.switchToPreviewTab();
319
352
  imageHighlightPage.steps.verifyOpacityValueForCanvasImageInPreviewTab(100);
320
353
  });
321
354
 
@@ -333,6 +366,15 @@ describe('Create item page - Image highlight: Background image section', () => {
333
366
  imageHighlightPage.steps.verifyOpacityValueForCanvasImageInPreviewTab(40);
334
367
  });
335
368
 
369
+ it('When user changes opacity input field value in edit tab, saves the question then opacity for canvas image should change accordingly in item preview tab ', () => {
370
+ imageHighlightPage.steps.switchToEditTab();
371
+ imageHighlightPage.steps.enterInputToOpacityInputField(50);
372
+ imageHighlightPage.steps.saveQuestion();
373
+ imageHighlightPage.steps.switchToItemPreviewTab();
374
+ imageHighlightPage.steps.verifyOpacityValueForCanvasImageInItemPreviewTab(50);
375
+ imageHighlightPage.steps.clickOnEditQuestionButton();
376
+ });
377
+
336
378
  it('When user checks \'Fill image to canvas\' checkbox in edit tab, then image should be adjusted to fit inside the canvas in preview tab', () => {
337
379
  imageHighlightPage.steps.switchToEditTab();
338
380
  imageHighlightPage.steps.checkFillImageToCanvasCheckbox();
@@ -340,6 +382,15 @@ describe('Create item page - Image highlight: Background image section', () => {
340
382
  imageHighlightPage.steps.verifyImageFitsToCanvasInPreviewTab();
341
383
  });
342
384
 
385
+ it('When user checks \'Fill image to canvas\' checkbox in edit tab, saves the question, then image should be adjusted to fit inside the canvas in item preview', () => {
386
+ imageHighlightPage.steps.switchToEditTab();
387
+ imageHighlightPage.steps.checkFillImageToCanvasCheckbox();
388
+ imageHighlightPage.steps.saveQuestion();
389
+ imageHighlightPage.steps.switchToPreviewTab();
390
+ imageHighlightPage.steps.verifyImageFitsToCanvasInPreviewTab();
391
+ imageHighlightPage.steps.clickOnEditQuestionButton();
392
+ });
393
+
343
394
  it('When user unchecks \'Fill image to canvas\' checkbox, then image dimensions should set to default state in preview tab', () => {
344
395
  imageHighlightPage.steps.switchToEditTab();
345
396
  imageHighlightPage.steps.uncheckFillImageToCanvasCheckbox();
@@ -10,10 +10,11 @@ const branchesHighlightRegion = [[50, 30], [50, 42], [65, 42], [65, 30]];
10
10
  const leafHighlightRegion = [[26, 26], [26, 36], [48, 36], [48, 26]];
11
11
  const rootsHighlightRegion = [[45, 45], [45, 55], [57, 55], [57, 45]];
12
12
 
13
- const defaultStateColor = 'rgb(120, 60, 60)';
13
+ const defaultStateColor = 'rgba(60, 73, 120, 0.4)';
14
+ const defaultStateColorSpecifyPossibleOptions = 'rgba(60, 120, 119, 0.7)';
14
15
  const activeStateColor = 'rgb(60, 120, 120)';
15
- const defaultStateBorderColorWithOpacity = 'rgba(120, 61, 61, 0.5)';
16
- const defaultStateBorderColorWithNoOpacity = 'rgba(120, 60, 60, 0)';
16
+ const defaultStateBorderColorWithOpacity = 'rgba(79, 60, 120, 0.5)';
17
+ const defaultStateBorderColorWithNoOpacity = 'rgba(79, 60, 120, 0)';
17
18
 
18
19
  describe('Create Item page - Image highlight: Customize image highlight style', () => {
19
20
  before(() => {
@@ -151,9 +152,9 @@ describe('Create Item page - Image highlight: Customize image highlight style',
151
152
  imageHighlightPage.steps.clickOnFillColorIcon();
152
153
  imageHighlightPage.steps.clickOnActiveStateColorEditButton();
153
154
  colorPopupComponent.steps.clickInColorSaturationPalette();
154
- imageHighlightPage.steps.verifySelectedColorBlock(defaultStateColor);
155
+ imageHighlightPage.steps.verifySelectedColorBlock(defaultStateColorSpecifyPossibleOptions);
155
156
  imageHighlightPage.steps.clickOnOkButton();
156
- imageHighlightPage.steps.verifyEditedFillColorInSpecifyCorrectAnswerSection(0, defaultStateColor);
157
+ imageHighlightPage.steps.verifyEditedFillColorInSpecifyCorrectAnswerSection(0, defaultStateColorSpecifyPossibleOptions);
157
158
  imageHighlightPage.steps.verifyEditedFillColorInSpecifyCorrectAnswerSection(1, activeStateColor);
158
159
  });
159
160
  });
@@ -323,7 +324,8 @@ describe('Create Item page - Image highlight: Customize image highlight style',
323
324
 
324
325
  // Change 'Stroke color' to 'Border color' in the following tests after https://redmine.zeuslearning.com/issues/580697 has been resolved.
325
326
 
326
- describe('Border color image highlight style : Edit tab content and functionality', () => {
327
+ //Remove skip once https://weldnorthed.atlassian.net/browse/IEI-6981 is resolved.
328
+ describe.skip('Border color image highlight style : Edit tab content and functionality', () => {
327
329
  abortEarlySetup();
328
330
  before(() => {
329
331
  imageHighlightPage.steps.navigateToCreateQuestion('image highlight');
@@ -349,9 +351,9 @@ describe('Create Item page - Image highlight: Customize image highlight style',
349
351
  utilities.verifyElementVisibilityState(imageHighlightPage.colorPopupWrapper(), 'visible');
350
352
  });
351
353
 
352
- it('The popup should contain \'Border color\' label and two color boxes with label \'Default\' and \'Active\'. Both color boxes should have edit color button.Verify defualt color of both \'Default\' and \'Active\' color boxes', () => {
354
+ it('The popup should contain \'Stroke color\' label and two color boxes with label \'Default\' and \'Active\'. Both color boxes should have edit color button.Verify defualt color of both \'Default\' and \'Active\' color boxes', () => {
353
355
  utilities.verifyElementVisibilityState(imageHighlightPage.colorPopupMenuLabel(), 'visible');
354
- utilities.verifyInnerText(imageHighlightPage.colorPopupMenuLabel(), 'Border color');
356
+ utilities.verifyInnerText(imageHighlightPage.colorPopupMenuLabel(), 'Stroke color');
355
357
  utilities.verifyElementVisibilityState(imageHighlightPage.defaultStateColorLabel(), 'visible');
356
358
  utilities.verifyInnerText(imageHighlightPage.defaultStateColorLabel(), 'Default');
357
359
  utilities.verifyElementVisibilityState(imageHighlightPage.activeStateColorLabel(), 'visible');
@@ -479,7 +481,7 @@ describe('Create Item page - Image highlight: Customize image highlight style',
479
481
 
480
482
  it('\'Border style\' icon should be displayed and as user hovers over it then a tooltip \'Border style\' should be displayed', () => {
481
483
  utilities.verifyElementVisibilityState(imageHighlightPage.borderStyleButton(), 'visible');
482
- imageHighlightPage.steps.verifyToolTipText(3, imageHighlightPage.borderStyleButton(), 'Border style');
484
+ imageHighlightPage.steps.verifyToolTipText(3, imageHighlightPage.borderStyleButton(), 'Border Style');
483
485
  });
484
486
 
485
487
  it('When user clicks on the \'Border style\' icon then a popup should be displayed', () => {
@@ -622,7 +624,7 @@ describe('Create Item page - Image highlight: Customize image highlight style',
622
624
  });
623
625
 
624
626
  //Remove skip once ⁠https://redmine.zeuslearning.com/issues/579605 is resolved
625
- describe.skip('Fill color image highlight style : Preview tab and functionality', () => {
627
+ describe('Fill color image highlight style : Preview tab and functionality', () => {
626
628
  abortEarlySetup();
627
629
  before(() => {
628
630
  imageHighlightPage.steps.navigateToCreateQuestion('image highlight');
@@ -700,7 +702,7 @@ describe('Create Item page - Image highlight: Customize image highlight style',
700
702
  });
701
703
 
702
704
  //Remove skip once ⁠https://redmine.zeuslearning.com/issues/579605 is resolved
703
- describe.skip('Border color image highlight style : Preview tab functionality', () => {
705
+ describe('Border color image highlight style : Preview tab functionality', () => {
704
706
  abortEarlySetup();
705
707
  before(() => {
706
708
  imageHighlightPage.steps.navigateToCreateQuestion('image highlight');
@@ -778,7 +780,7 @@ describe('Create Item page - Image highlight: Customize image highlight style',
778
780
  });
779
781
 
780
782
  //Remove skip once ⁠https://redmine.zeuslearning.com/issues/579605 is resolved
781
- describe.skip('Border style image highlight style : Preview tab functionality', () => {
783
+ describe('Border style image highlight style : Preview tab functionality', () => {
782
784
  abortEarlySetup();
783
785
  before(() => {
784
786
  imageHighlightPage.steps.navigateToCreateQuestion('image highlight');
@@ -102,8 +102,7 @@ describe('Create Item page - Image Highlight : Image selection style', () => {
102
102
 
103
103
  });
104
104
 
105
- //Need to remove skip once https://redmine.zeuslearning.com/issues/579605
106
- describe.skip('Image selection style: Preview tab functionality', () => {
105
+ describe('Image selection style: Preview tab functionality', () => {
107
106
  abortEarlySetup();
108
107
  before(() => {
109
108
  imageHighlightPage.steps.navigateToCreateQuestion('image highlight');
@@ -139,6 +138,17 @@ describe('Create Item page - Image Highlight : Image selection style', () => {
139
138
  imageHighlightPage.steps.switchToEditTab();
140
139
  });
141
140
 
141
+ it('When user has selected \'Outline\' image selection style, saves the question and selects a highlighted region in \'Preview tab\' section then the region should be outlined and unselected highlighted regions should be in default state', () => {
142
+ imageHighlightPage.steps.saveAQuestionWithIncompleteAuthoring();
143
+ imageHighlightPage.steps.switchToPreviewTab();
144
+ imageHighlightPage.steps.highlightARegionInPreviewTab(0);
145
+ imageHighlightPage.steps.verifyOutlineHighlightRegionItemPreviewTabSection(0);
146
+ imageHighlightPage.steps.verifyDefaultHighlightRegion(1);
147
+ imageHighlightPage.steps.verifyDefaultHighlightRegion(2);
148
+ imageHighlightPage.steps.switchToEditTab();
149
+ imageHighlightPage.steps.clickOnEditQuestionButton();
150
+ });
151
+
142
152
  it('When user has selected \'Pattern\' image selection style and selects a highlighted region in \'Preview tab\' section then the region should be filled with pattern and unselected highlighted regions should be in default state', () => {
143
153
  imageHighlightPage.steps.selectpatternToggleButton();
144
154
  imageHighlightPage.steps.verifyToggleButtonSelected('Pattern');
@@ -148,6 +158,5 @@ describe('Create Item page - Image Highlight : Image selection style', () => {
148
158
  imageHighlightPage.steps.verifyDefaultHighlightRegion(1);
149
159
  imageHighlightPage.steps.verifyDefaultHighlightRegion(2);
150
160
  });
151
-
152
161
  });
153
162
  });
@@ -196,12 +196,75 @@ describe('Create item page - Image highlight: Minimum scoring, Penalty scoring,
196
196
  before(() => {
197
197
  imageHighlightPage.steps.navigateToCreateQuestion('image highlight');
198
198
  cy.barsPreLoaderWait();
199
- imageHighlightPage.steps.allotPoints(10);
200
- imageHighlightPage.steps.selectAutoScoredScoringSubtype('Partial equal weights')
199
+ imageHighlightPage.steps.uploadFile('highlightImage.jpg');
200
+ imageHighlightPage.steps.verifyImageUploadedInSpecifyPossibleOptionsSection();
201
+ imageHighlightPage.steps.verifyImageUploadedSpecifyCorrectAnswer();
202
+ imageHighlightPage.steps.allotPoints(4);
203
+ imageHighlightPage.steps.highlightRegionInImage(flowerHighlightRegion);
204
+ imageHighlightPage.steps.highlightRegionInImage(branchesHighlightRegion);
205
+ imageHighlightPage.steps.highlightRegionInImage(leafHighlightRegion);
206
+ imageHighlightPage.steps.highlightARegionInSpecifyCorrectAnswerSection(0);
207
+ imageHighlightPage.steps.highlightARegionInSpecifyCorrectAnswerSection(1);
208
+ imageHighlightPage.steps.highlightARegionInSpecifyCorrectAnswerSection(2);
209
+ imageHighlightPage.steps.selectAutoScoredScoringSubtype('Partial equal weights');
201
210
  });
202
211
 
203
212
  imageHighlightPage.tests.verifyRoundingDropdown();
204
213
 
205
214
  imageHighlightPage.tests.verifyRoundNegativeScoreToZeroLabelAndCheckbox();
215
+
216
+ it("When the user selects rounding to 'Round down if <= 0.99' then the score '<=0.99' should be rounded down to nearest whole number", () => {
217
+ imageHighlightPage.steps.switchToPreviewTab();
218
+ imageHighlightPage.steps.highlightARegionInPreviewTab(0);
219
+ imageHighlightPage.steps.verifyPreviewScore(1,4);
220
+ imageHighlightPage.steps.highlightARegionInPreviewTab(1);
221
+ imageHighlightPage.steps.verifyPreviewScore(2,4);
222
+ imageHighlightPage.steps.highlightARegionInPreviewTab(2);
223
+ imageHighlightPage.steps.verifyPreviewScore(4,4);
224
+ imageHighlightPage.steps.switchToGradingView();
225
+ imageHighlightPage.steps.verifyCorrectHighlightRegion(0);
226
+ imageHighlightPage.steps.verifyCorrectHighlightRegion(1);
227
+ imageHighlightPage.steps.verifyCorrectHighlightRegion(2);
228
+ imageHighlightPage.steps.verifyCorrectIncorrectAnswerLabelNotExist();
229
+ imageHighlightPage.steps.verifyCorrectAnswerSectionNotExists();
230
+ });
231
+
232
+ it("When the user selects rounding to 'Round down if <= 0.50' then the score '<=0.50' should be rounded down to nearest whole number", () => {
233
+ imageHighlightPage.steps.switchToEditTab();
234
+ imageHighlightPage.steps.expandRoundingDropdown();
235
+ imageHighlightPage.steps.selectOptionFromRoundingDropdown('round down if <= 0.50');
236
+ imageHighlightPage.steps.switchToPreviewTab();
237
+ imageHighlightPage.steps.highlightARegionInPreviewTab(0);
238
+ imageHighlightPage.steps.verifyPreviewScore(1,4);
239
+ imageHighlightPage.steps.highlightARegionInPreviewTab(1);
240
+ imageHighlightPage.steps.verifyPreviewScore(2.6667,4);
241
+ imageHighlightPage.steps.highlightARegionInPreviewTab(2);
242
+ imageHighlightPage.steps.verifyPreviewScore(4,4);
243
+ imageHighlightPage.steps.switchToGradingView();
244
+ imageHighlightPage.steps.verifyCorrectHighlightRegion(0);
245
+ imageHighlightPage.steps.verifyCorrectHighlightRegion(1);
246
+ imageHighlightPage.steps.verifyCorrectHighlightRegion(2);
247
+ imageHighlightPage.steps.verifyCorrectIncorrectAnswerLabelNotExist();
248
+ imageHighlightPage.steps.verifyCorrectAnswerSectionNotExists();
249
+ });
250
+
251
+ it('When the user selects rounding to \'Round down if <= 0.50; Round up if > 0.50\' then the score \'<=0.50\' should be rounded down to nearest whole number and the score \'>0.50\' should be rounded up to nearest whole number', () => {
252
+ imageHighlightPage.steps.switchToEditTab();
253
+ imageHighlightPage.steps.expandRoundingDropdown();
254
+ imageHighlightPage.steps.selectOptionFromRoundingDropdown('round down if <= 0.50; Round up if > 0.50');
255
+ imageHighlightPage.steps.switchToPreviewTab();
256
+ imageHighlightPage.steps.highlightARegionInPreviewTab(0);
257
+ imageHighlightPage.steps.verifyPreviewScore(1,4);
258
+ imageHighlightPage.steps.highlightARegionInPreviewTab(1);
259
+ imageHighlightPage.steps.verifyPreviewScore(3,4);
260
+ imageHighlightPage.steps.highlightARegionInPreviewTab(2);
261
+ imageHighlightPage.steps.verifyPreviewScore(4,4);
262
+ imageHighlightPage.steps.switchToGradingView();
263
+ imageHighlightPage.steps.verifyCorrectHighlightRegion(0);
264
+ imageHighlightPage.steps.verifyCorrectHighlightRegion(1);
265
+ imageHighlightPage.steps.verifyCorrectHighlightRegion(2);
266
+ imageHighlightPage.steps.verifyCorrectIncorrectAnswerLabelNotExist();
267
+ imageHighlightPage.steps.verifyCorrectAnswerSectionNotExists();
268
+ });
206
269
  });
207
270
  });
@@ -171,7 +171,15 @@ describe('Image highlight - Student view settings', () => {
171
171
  imageHighlightPage.steps.switchToPreviewTab();
172
172
  });
173
173
 
174
- it('When \'Show the available options to students\' checkbox is unchecked, then in preview tab the options should be displayed in standard state without any highlighted background', () => {
174
+ it('When \'Show the available options to students\' checkbox is unchecked, then in preview tab the options should be displayed in standard state without any highlighted background in question preview', () => {
175
+ imageHighlightPage.steps.verifyHiddenHighlightRegion(0);
176
+ imageHighlightPage.steps.verifyHiddenHighlightRegion(1);
177
+ imageHighlightPage.steps.verifyHiddenHighlightRegion(2);
178
+ });
179
+
180
+ it('When \'Show the available options to students\' checkbox is unchecked, then in preview tab the options should be displayed in standard state without any highlighted background in item preview', () => {
181
+ imageHighlightPage.steps.saveAQuestionAndVerifySnackbar();
182
+ imageHighlightPage.steps.switchToPreviewTab();
175
183
  imageHighlightPage.steps.verifyHiddenHighlightRegion(0);
176
184
  imageHighlightPage.steps.verifyHiddenHighlightRegion(1);
177
185
  imageHighlightPage.steps.verifyHiddenHighlightRegion(2);
@@ -179,6 +187,7 @@ describe('Image highlight - Student view settings', () => {
179
187
 
180
188
  it('When \'Show the available options to students\' checkbox is checked, then in preview tab the available options should be displayed with a highlighted background', () => {
181
189
  imageHighlightPage.steps.switchToEditTab();
190
+ imageHighlightPage.steps.clickOnEditQuestionButton();
182
191
  imageHighlightPage.steps.checkShowAvailableOptionsToStudentsCheckbox();
183
192
  imageHighlightPage.steps.switchToPreviewTab();
184
193
  imageHighlightPage.steps.verifyDefaultHighlightRegion(0);
@@ -187,6 +196,8 @@ describe('Image highlight - Student view settings', () => {
187
196
  });
188
197
 
189
198
  it('When user selects an option in preview tab, then that option should be selected', () => {
199
+ imageHighlightPage.steps.saveAQuestionAndVerifySnackbar();
200
+ imageHighlightPage.steps.switchToPreviewTab();
190
201
  imageHighlightPage.steps.highlightARegionInPreviewTab(0);
191
202
  imageHighlightPage.steps.highlightARegionInPreviewTab(1);
192
203
  imageHighlightPage.steps.verifySelectedHighlightRegionInPreviewTab(0);
@@ -199,6 +210,9 @@ describe('Image highlight - Student view settings', () => {
199
210
  });
200
211
 
201
212
  it('Accessibility of options with highlighted background', { tags: 'a11y' }, () => {
213
+ imageHighlightPage.steps.switchToEditTab();
214
+ imageHighlightPage.steps.clickOnEditQuestionButton();
215
+ imageHighlightPage.steps.switchToPreviewTab();
202
216
  cy.checkAccessibility(imageHighlightPage.previewTabQuestionWrapper());
203
217
  });
204
218