itemengine-cypress-automation 1.0.573-IEI-7080-f70315e.0 → 1.0.573

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 (45) hide show
  1. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/Scoring/partialEqualWeightsBasic.js +181 -0
  2. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/additionalSettingsBasic.js +37 -2
  3. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/additionalSettingsForAnswerInputFields.js +72 -4
  4. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/backgroundImageAndCanvasProperties.js +19 -1
  5. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/responseAnswersAndAcceptedStudentInput.js +56 -1
  6. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/setLimitSection.js +57 -3
  7. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/specialCharactersSection.js +15 -18
  8. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/studentViewSettings.js +54 -1
  9. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/styleAndLayoutCustomization.js +12 -0
  10. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/styleAndLayoutCustomizationAllViews.js +156 -0
  11. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/supportedFileTypes.js +0 -2
  12. package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/partialDifferentWeightsAlternativePointsGreaterThanCorrectPoints.js +1 -1
  13. package/cypress/e2e/ILC/ImageHighlight/additionalSettings.js +86 -0
  14. package/cypress/e2e/ILC/ImageHighlight/backgroundImageAndCanvasProperties.js +60 -9
  15. package/cypress/e2e/ILC/ImageHighlight/customiseHighlightStyle.js +14 -12
  16. package/cypress/e2e/ILC/ImageHighlight/imageHighlightStyle.js +12 -3
  17. package/cypress/e2e/ILC/ImageHighlight/minimumScoringPenaltyPointsAndRoundingDropdown.js +65 -2
  18. package/cypress/e2e/ILC/ImageHighlight/studentViewSettings.js +15 -1
  19. package/cypress/e2e/ILC/MultipleSelection/allOrNothingBasicForAllViews.smoke.js +1 -168
  20. package/cypress/e2e/ILC/MultipleSelection/allOrNothingWithAlternativeAnswer.js +284 -17
  21. package/cypress/e2e/ILC/MultipleSelection/partialDifferentWeightsWithAlternativeAnswer.js +397 -25
  22. package/cypress/e2e/ILC/MultipleSelection/partialEqualWeightsWithAlternativeAnswer.js +320 -20
  23. package/cypress/e2e/ILC/SingleSelection/allOrNothingBasicForAllViews.smoke.js +0 -130
  24. package/cypress/e2e/ILC/SingleSelection/allOrNothingWithAlternativeAnswer.js +97 -10
  25. package/cypress/e2e/ILC/dataApi/saveItems.js +1 -1
  26. package/cypress/e2e/ILC/dataApi/saveQuestions.js +7 -7
  27. package/cypress/e2e/ILC/dataApi/saveQuestionsMCQAlternateAnswers.js +6 -6
  28. package/cypress/pages/components/additionalSettingsPanel.js +9 -0
  29. package/cypress/pages/components/backgroundImageUploadComponent.js +1 -1
  30. package/cypress/pages/components/colorPopupComponent.js +1 -1
  31. package/cypress/pages/components/figCommonStyleAndLayoutComponent.js +4 -10
  32. package/cypress/pages/components/fillInTheGapsTextCommonComponent.js +15 -2
  33. package/cypress/pages/components/gradingViewEnumerationComponent.js +5 -0
  34. package/cypress/pages/components/imageCanvasComponent.js +0 -3
  35. package/cypress/pages/components/placeholderTextSectionComponent.js +10 -0
  36. package/cypress/pages/components/showAlternativeAnswersComponent.js +41 -65
  37. package/cypress/pages/fillInTheGapsOverImageTextPage.js +21 -1
  38. package/cypress/pages/imageHighlightPage.js +184 -7
  39. package/cypress/pages/itemPreviewPage.js +1 -0
  40. package/cypress/pages/multipleSelectionPage.js +32 -0
  41. package/cypress/pages/singleSelectionPage.js +17 -0
  42. package/cypress/support/helpers/utilities.js +16 -0
  43. package/package.json +1 -1
  44. package/scripts/sorry-cypress.mjs +47 -53
  45. package/service.yaml +2 -2
@@ -1,7 +1,10 @@
1
- import { fillInTheGapsOverImageTextPage } from "../../../pages";
1
+ import { fillInTheGapsOverImageTextPage, itemPreviewPage, studentViewPage } from "../../../pages";
2
2
  import abortEarlySetup from "../../../support/helpers/abortEarly";
3
3
  import utilities from "../../../support/helpers/utilities";
4
4
  const css = Cypress.env('css');
5
+ let correctAnswerViews = ['Question preview', 'Item preview', 'Student view'];
6
+ const views = utilities.getViews(correctAnswerViews);
7
+ let itemReferenceID = "";
5
8
 
6
9
  describe('Create Item page - drag and drop into categories: Student view settings', () => {
7
10
  before(() => {
@@ -34,6 +37,56 @@ describe('Create Item page - drag and drop into categories: Student view setting
34
37
  fillInTheGapsOverImageTextPage.tests.verifySpellCheckFunctionalityPreviewTab();
35
38
  });
36
39
 
40
+ views.forEach((view) => {
41
+ describe(`${view}: Student view settings`, () => {
42
+ abortEarlySetup();
43
+ before(() => {
44
+ switch (view) {
45
+ case 'Question preview':
46
+ fillInTheGapsOverImageTextPage.steps.navigateToCreateQuestion('fill in the gaps over image with text');
47
+ cy.barsPreLoaderWait();
48
+ fillInTheGapsOverImageTextPage.steps.uploadFile('highlightImage.jpg');
49
+ fillInTheGapsOverImageTextPage.steps.verifyImageIsUploaded();
50
+ fillInTheGapsOverImageTextPage.steps.insertResponseArea(80);
51
+ fillInTheGapsOverImageTextPage.steps.checkSpellCheckCheckbox();
52
+ fillInTheGapsOverImageTextPage.steps.switchToPreviewTab();
53
+ break;
54
+ case 'Item preview':
55
+ cy.visit(`/item-engine/demo/edit-item/${utilities.base64Encoding(itemReferenceID)}`);
56
+ itemPreviewPage.steps.switchToPreviewTab();
57
+ break;
58
+ case 'Student view':
59
+ cy.visit(`/item-engine/demo/render-item/student-view/${utilities.base64Encoding(itemReferenceID)}`);
60
+ break;
61
+ };
62
+ });
63
+
64
+ beforeEach(() => {
65
+ switch (view) {
66
+ case 'Question preview':
67
+ break;
68
+ case 'Item preview':
69
+ break;
70
+ case 'Student view':
71
+ cy.visit(`/item-engine/demo/render-item/student-view/${utilities.base64Encoding(itemReferenceID)}`);
72
+ break;
73
+ }
74
+ });
75
+ if (view === 'Question preview') {
76
+ after(() => {
77
+ fillInTheGapsOverImageTextPage.steps.clickOnSaveQuestionButton();
78
+ fillInTheGapsOverImageTextPage.steps.clickOnConfirmButton();
79
+ utilities.verifyElementVisibilityState(itemPreviewPage.referenceID(), 'visible');
80
+ itemReferenceID = itemPreviewPage.steps.getItemReferenceID();
81
+ });
82
+ };
83
+
84
+ it('When the \'Spell check\' functionality is enabled, the response field should have \'spellcheck\' attribute set as \'true\' in the preview tab', () => {
85
+ fillInTheGapsOverImageTextPage.steps.verifySpellCheckOfResponseFieldPreviewTabEnabled(0);
86
+ });
87
+ });
88
+ });
89
+
37
90
  /*describe('Allow students to check answer: Edit tab', () => {
38
91
  abortEarlySetup();
39
92
  before(() => {
@@ -399,6 +399,18 @@ describe('Create Item page - Fill in the gaps over image with text: Style and la
399
399
  fillInTheGapsOverImageTextPage.steps.verifyResponseAreaDimensions(30, 118);
400
400
  });
401
401
 
402
+ it('User should only be able to enter numeric values in the \'Height (px)\' and \'Width (px)\' input fields', () => {
403
+ fillInTheGapsOverImageTextPage.steps.setTextContainerHeight('1*2');
404
+ fillInTheGapsOverImageTextPage.steps.setTextContainerWidth('2%1');
405
+ fillInTheGapsOverImageTextPage.steps.verifyValueInTextContainerWidthAndHeightInputField('12', '21');
406
+ fillInTheGapsOverImageTextPage.steps.setTextContainerHeight('apple');
407
+ fillInTheGapsOverImageTextPage.steps.setTextContainerWidth('news');
408
+ fillInTheGapsOverImageTextPage.steps.verifyValueInTextContainerWidthAndHeightInputField('', '');
409
+ fillInTheGapsOverImageTextPage.steps.setTextContainerHeight('54!@');
410
+ fillInTheGapsOverImageTextPage.steps.setTextContainerWidth('@12');
411
+ fillInTheGapsOverImageTextPage.steps.verifyValueInTextContainerWidthAndHeightInputField('54', '12');
412
+ });
413
+
402
414
  it('When the user specifies the height and width, the dimensions of the text containers should update accordingly', () => {
403
415
  fillInTheGapsOverImageTextPage.steps.setTextContainerHeight(100);
404
416
  fillInTheGapsOverImageTextPage.steps.setTextContainerWidth(200);
@@ -0,0 +1,156 @@
1
+ import { fillInTheGapsOverImageTextPage, itemPreviewPage, studentViewPage } from "../../../pages";
2
+ import abortEarlySetup from "../../../support/helpers/abortEarly";
3
+ import utilities from "../../../support/helpers/utilities";
4
+ import { colorPopupComponent } from "../../../pages/components";
5
+ let correctAnswerViews = ['Question preview', 'Item preview', 'Student view', 'Grading view', 'Correct answer view'];
6
+ const views = utilities.getViews(correctAnswerViews);
7
+ const css = Cypress.env('css');
8
+ let itemReferenceID = "";
9
+ const modifiedColor = 'rgb(121, 60, 60)';
10
+
11
+ describe('Create Item page - Drag and drop into categories: Style and layout customization', () => {
12
+ before(() => {
13
+ cy.loginAs('admin');
14
+ });
15
+
16
+ views.forEach((view) => {
17
+ describe(`${view}: Style and Layout Customization - Default State`, () => {
18
+ abortEarlySetup();
19
+ before(() => {
20
+ switch (view) {
21
+ case 'Question preview':
22
+ fillInTheGapsOverImageTextPage.steps.navigateToCreateQuestion('fill in the gaps over image with text');
23
+ cy.barsPreLoaderWait();
24
+ fillInTheGapsOverImageTextPage.steps.uploadFile('highlightImage.jpg');
25
+ fillInTheGapsOverImageTextPage.steps.verifyImageIsUploaded();
26
+ fillInTheGapsOverImageTextPage.steps.insertResponseArea(80);
27
+ fillInTheGapsOverImageTextPage.steps.selectResponseArea(0);
28
+ fillInTheGapsOverImageTextPage.steps.selectResponseAreaPointerStyle('left');
29
+ fillInTheGapsOverImageTextPage.steps.switchToPreviewTab();
30
+ break;
31
+ case 'Item preview':
32
+ cy.visit(`/item-engine/demo/edit-item/${utilities.base64Encoding(itemReferenceID)}`);
33
+ itemPreviewPage.steps.switchToPreviewTab();
34
+ fillInTheGapsOverImageTextPage.steps.switchToGradingView();
35
+ break;
36
+ case 'Student view':
37
+ cy.visit(`/item-engine/demo/render-item/student-view/${utilities.base64Encoding(itemReferenceID)}`);
38
+ break;
39
+ case 'Grading view':
40
+ cy.visit(`/item-engine/demo/render-item/grading-view/${utilities.base64Encoding(itemReferenceID)}`);
41
+ break;
42
+ case 'Correct answer view':
43
+ cy.visit(`/item-engine/demo/render-item/correct-answer-view/${utilities.base64Encoding(itemReferenceID)}`);
44
+ break;
45
+ };
46
+ });
47
+
48
+ beforeEach(() => {
49
+ switch (view) {
50
+ case 'Question preview':
51
+ break;
52
+ case 'Item preview':
53
+ fillInTheGapsOverImageTextPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
54
+ itemPreviewPage.steps.resetQuestionPreview();
55
+ break;
56
+ }
57
+ });
58
+
59
+ if (view === 'Question preview') {
60
+ after(() => {
61
+ fillInTheGapsOverImageTextPage.steps.clickOnSaveQuestionButton();
62
+ fillInTheGapsOverImageTextPage.steps.clickOnConfirmButton();
63
+ utilities.verifyElementVisibilityState(itemPreviewPage.referenceID(), 'visible');
64
+ itemReferenceID = itemPreviewPage.steps.getItemReferenceID();
65
+ });
66
+ };
67
+
68
+ it(`Text container should have default border color, fill color, and border style in ${view}`, () => {
69
+ fillInTheGapsOverImageTextPage.steps.verifyAnswerInputFieldFillColor(0, css.color.optionsBg);
70
+ fillInTheGapsOverImageTextPage.steps.verifyAnswerInputFieldBorderColor(0, `1px solid ${css.color.activeComponentBorder}`);
71
+ fillInTheGapsOverImageTextPage.steps.verifyAnswerInputFieldBorderStyle(0, 'solid');
72
+ });
73
+
74
+ it(`text container connector style should be displayed in default state in ${view}`, () => {
75
+ fillInTheGapsOverImageTextPage.steps.verifyResponseAreaConnectorEndPointShapePreviewTab('Circle');
76
+ });
77
+ });
78
+ });
79
+
80
+ views.forEach((view) => {
81
+ describe(`${view}: Style and Layout Customization - modified State`, () => {
82
+ abortEarlySetup();
83
+ before(() => {
84
+ switch (view) {
85
+ case 'Question preview':
86
+ fillInTheGapsOverImageTextPage.steps.navigateToCreateQuestion('fill in the gaps over image with text');
87
+ cy.barsPreLoaderWait();
88
+ fillInTheGapsOverImageTextPage.steps.uploadFile('highlightImage.jpg');
89
+ fillInTheGapsOverImageTextPage.steps.verifyImageIsUploaded();
90
+ fillInTheGapsOverImageTextPage.steps.insertResponseArea(80);
91
+ fillInTheGapsOverImageTextPage.steps.selectResponseArea(0);
92
+ fillInTheGapsOverImageTextPage.steps.selectResponseAreaPointerStyle('left');
93
+ fillInTheGapsOverImageTextPage.steps.expandStyleAndLayoutCustomizationAccordion();
94
+ fillInTheGapsOverImageTextPage.steps.selectEndPointShapeButton('Square');
95
+ fillInTheGapsOverImageTextPage.steps.editColor(0);
96
+ colorPopupComponent.steps.clickInColorSaturationPalette();
97
+ colorPopupComponent.steps.clickOnOkButton();
98
+ fillInTheGapsOverImageTextPage.steps.editColor(1);
99
+ colorPopupComponent.steps.clickInColorSaturationPalette();
100
+ colorPopupComponent.steps.clickOnOkButton();
101
+ fillInTheGapsOverImageTextPage.steps.selectBorderStyleToggleButton('Dotted');
102
+ fillInTheGapsOverImageTextPage.steps.checkSetHeightAndWidthForAllTextContainersCheckbox();
103
+ fillInTheGapsOverImageTextPage.steps.setTextContainerHeight(100);
104
+ fillInTheGapsOverImageTextPage.steps.setTextContainerWidth(200);
105
+ fillInTheGapsOverImageTextPage.steps.switchToPreviewTab();
106
+ break;
107
+ case 'Item preview':
108
+ cy.visit(`/item-engine/demo/edit-item/${utilities.base64Encoding(itemReferenceID)}`);
109
+ itemPreviewPage.steps.switchToPreviewTab();
110
+ fillInTheGapsOverImageTextPage.steps.switchToGradingView();
111
+ break;
112
+ case 'Grading view':
113
+ cy.visit(`/item-engine/demo/render-item/student-view/${utilities.base64Encoding(itemReferenceID)}`);
114
+ break;
115
+ };
116
+ });
117
+
118
+ beforeEach(() => {
119
+ switch (view) {
120
+ case 'Question preview':
121
+ break;
122
+ case 'Item preview':
123
+ fillInTheGapsOverImageTextPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
124
+ itemPreviewPage.steps.resetQuestionPreview();
125
+ break;
126
+ case 'Grading view':
127
+ cy.visit(`/item-engine/demo/render-item/student-view/${utilities.base64Encoding(itemReferenceID)}`);
128
+ break;
129
+ }
130
+ });
131
+
132
+ if (view === 'Question preview') {
133
+ after(() => {
134
+ fillInTheGapsOverImageTextPage.steps.clickOnSaveQuestionButton();
135
+ fillInTheGapsOverImageTextPage.steps.clickOnConfirmButton();
136
+ utilities.verifyElementVisibilityState(itemPreviewPage.referenceID(), 'visible');
137
+ itemReferenceID = itemPreviewPage.steps.getItemReferenceID();
138
+ });
139
+ };
140
+
141
+ it(`Text container should have default border color, fill color, and border style in ${view}`, () => {
142
+ fillInTheGapsOverImageTextPage.steps.verifyAnswerInputFieldFillColor(0, modifiedColor);
143
+ fillInTheGapsOverImageTextPage.steps.verifyAnswerInputFieldBorderColor(0, `1px dotted ${modifiedColor}`);
144
+ fillInTheGapsOverImageTextPage.steps.verifyAnswerInputFieldBorderStyle(0, 'dotted');
145
+ });
146
+
147
+ it(`text container connector style should be displayed in default state in ${view}`, () => {
148
+ fillInTheGapsOverImageTextPage.steps.verifyResponseAreaConnectorEndPointShapePreviewTab('Square');
149
+ });
150
+
151
+ it(`Text containers should have modified height and width in ${view}`, () => {
152
+ fillInTheGapsOverImageTextPage.steps.verifyAnswerInputFieldHeightAndWidthInAllViews(0, '100px', '200px');
153
+ });
154
+ });
155
+ });
156
+ });
@@ -43,7 +43,5 @@ describe('Create item page - Fill in the gaps over image with text: Supported fi
43
43
  utilities.verifyElementVisibilityState(fillInTheGapsOverImageTextPage.errorMessage(), 'notExist');
44
44
  utilities.verifyElementVisibilityState(fillInTheGapsOverImageTextPage.canvasUploadedImage(), 'notExist');
45
45
  });
46
-
47
- fillInTheGapsOverImageTextPage.tests.verifyErrorMessageCSSAndA11y();
48
46
  });
49
47
  });
@@ -25,7 +25,7 @@ describe('Create item page - Fill in the gaps with text: Partial different weigh
25
25
  fillInTheGapsTextPage.steps.switchToPreviewTab();
26
26
  });
27
27
 
28
- it.only('When the user selects \'Grading\' view without attempting the question, response area numeration should be displayed, correct answers section should be displayed with correct answers from the alternative accordion and respective response area numeration', () => {
28
+ it('When the user selects \'Grading\' view without attempting the question, response area numeration should be displayed, correct answers section should be displayed with correct answers from the alternative accordion and respective response area numeration', () => {
29
29
  fillInTheGapsTextPage.steps.switchToGradingView();
30
30
  fillInTheGapsTextPage.steps.verifyResponseAreaNumeration();
31
31
  if (alternativeAnswerCheck) {
@@ -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
  });