itemengine-cypress-automation 1.0.25 → 1.0.27

Sign up to get free protection for your applications and to get access to all the features.
Files changed (22) hide show
  1. package/cypress/e2e/ILC/HighlightImage/highlightImageAdditionalSettings.js +219 -0
  2. package/cypress/e2e/ILC/HighlightImage/highlightImageAdditionalSettingsBasic.js +252 -0
  3. package/cypress/e2e/ILC/HighlightImage/highlightImageAllOrNothingScoring.js +235 -0
  4. package/cypress/e2e/ILC/HighlightImage/highlightImageAllOrNothingWithAlternateAnswer.js +810 -0
  5. package/cypress/e2e/ILC/HighlightImage/highlightImageCustomizeHighlightProperties.js +669 -0
  6. package/cypress/e2e/ILC/HighlightImage/highlightImageCustomizeHighlightPropertiesFunctionality.js +356 -0
  7. package/cypress/e2e/ILC/HighlightImage/highlightImageEditTabBasic.js +125 -0
  8. package/cypress/e2e/ILC/HighlightImage/highlightImageEditTabHighlightSectionContents.js +318 -0
  9. package/cypress/e2e/ILC/HighlightImage/highlightImageEditTabScoring.js +403 -0
  10. package/cypress/e2e/ILC/HighlightImage/highlightImageHeaderSection.js +86 -0
  11. package/cypress/e2e/ILC/HighlightImage/highlightImageManuallyAndNonScoredScoring.js +176 -0
  12. package/cypress/e2e/ILC/HighlightImage/highlightImagePartialDifferentWeightsScoring.js +210 -0
  13. package/cypress/e2e/ILC/HighlightImage/highlightImagePartialDifferentWeightsWithAlternateAnswer.js +898 -0
  14. package/cypress/e2e/ILC/HighlightImage/highlightImagePartialEqualWeightsScoring.js +208 -0
  15. package/cypress/e2e/ILC/HighlightImage/highlightImagePartialEqualWeightsWithAlternateAnswer.js +894 -0
  16. package/cypress/e2e/ILC/HighlightImage/highlightImagePreviewTab.js +88 -0
  17. package/cypress/e2e/ILC/HighlightImage/highlightImageSetCorrectAnswerCheckboxes.js +244 -0
  18. package/cypress/e2e/ILC/HighlightImage/highlightImageSetCorrectAnswerSection.js +186 -0
  19. package/cypress/e2e/ILC/HighlightImage/highlightImageSupportedFileTypes.js +86 -0
  20. package/cypress/e2e/ILC/HighlightImage/highlightImageToolsFunctionalityEditTab.js +160 -0
  21. package/cypress/e2e/ILC/HighlightImage/highlightImageToolsFunctionalityPreviewTab.js +163 -0
  22. package/package.json +1 -1
@@ -0,0 +1,356 @@
1
+ import { highlightImagePage } from "../../../pages";
2
+ import { colorPopupComponent } from "../../../pages/components";
3
+ import { uploadImageSectionComponent } from "../../../pages/components/uploadImageSectionComponent";
4
+ import abortEarlySetup from "../../../support/helpers/abortEarly";
5
+ import utilities from "../../../support/helpers/utilities";
6
+ const css = Cypress.env('css');
7
+
8
+ const flowerHighlightRegion = [[24, 6], [24, 24], [56, 24], [56, 6]];
9
+ const leafHighlightRegion = [[54, 48], [54, 72], [82, 72], [82, 48]];
10
+
11
+ describe('Create Item page - Highlight image: Customize highlight properties', () => {
12
+ before(() => {
13
+ cy.loginAs('admin');
14
+ });
15
+
16
+ //Failing due to https://redmine.zeuslearning.com/issues/546130
17
+ describe('Customize highlight properties accordion: Global and option tab functionality of default state in set correct answer and preview tab', () => {
18
+ abortEarlySetup();
19
+ before(() => {
20
+ cy.log('Navigating to highlight image question type');
21
+ highlightImagePage.steps.navigateToCreateQuestion('highlight image');
22
+ cy.barsPreLoaderWait();
23
+ cy.log('Uploading an image');
24
+ uploadImageSectionComponent.steps.uploadFile('highlightImage.jpg');
25
+ uploadImageSectionComponent.steps.verifyUploadedImageInImagePopup();
26
+ uploadImageSectionComponent.steps.clickOnImagePopupOkButton();
27
+ utilities.verifyElementVisibilityState(uploadImageSectionComponent.uploadImagePopup(), 'notExist');
28
+ highlightImagePage.steps.verifyImageUploadedInHighlightRegion();
29
+ highlightImagePage.steps.verifyImageUploadedInSetCorrectAnswerSection();
30
+ highlightImagePage.steps.highlightRegionInImage(flowerHighlightRegion);
31
+ highlightImagePage.steps.verifyHighlightRegionsInSetCorrectAnswerSection(0, flowerHighlightRegion);
32
+ highlightImagePage.steps.highlightRegionInImage(leafHighlightRegion);
33
+ highlightImagePage.steps.verifyHighlightRegionsInSetCorrectAnswerSection(1, leafHighlightRegion);
34
+ highlightImagePage.steps.expandCustomizeHighlightProperties();
35
+ });
36
+
37
+ it('When the user has not updated \'Fill color\' and \'Border color\' of \'Default\' state in \'Global\' tab then the default state of \'Option 1\' and \'Option 2\' highlight region should have the \'Fill color\' and \'Border color\' according to the global tab in the \'Set correct answer\' section', () => {
38
+ highlightImagePage.steps.verifyDefaultFillColorOfHighlightRegionInSetCorrectAnswerSection(0, 'rgb(186, 201, 255)', '0.4');
39
+ highlightImagePage.steps.verifyDefaultBorderColorOfHighlightRegionInSetCorrectAnswerSection(0, 'rgb(82, 0, 255)', '1');
40
+ highlightImagePage.steps.verifyDefaultFillColorOfHighlightRegionInSetCorrectAnswerSection(1, 'rgb(186, 201, 255)', '0.4');
41
+ highlightImagePage.steps.verifyDefaultBorderColorOfHighlightRegionInSetCorrectAnswerSection(1, 'rgb(82, 0, 255)', '1');
42
+ });
43
+
44
+ it('When the user has not updated \'Fill color\' and \'Border color\' of \'Default\' state in \'Global\' tab then the default state of \'Option 1\' and \'Option 2\' highlight region should have the \'Fill color\' and \'Border color\' according to the global tab in the\'Preview tab\'', () => {
45
+ cy.log('Switching to preview Tab');
46
+ highlightImagePage.steps.switchToPreviewTab();
47
+ highlightImagePage.steps.verifyDefaultFillColorOfHighlightRegionInPreviewTab(0, 'rgb(186, 201, 255)', '0.4');
48
+ highlightImagePage.steps.verifyDefaultBorderColorOfHighlightRegionInPreviewTab(0, 'rgb(82, 0, 255)', '1');
49
+ highlightImagePage.steps.verifyDefaultFillColorOfHighlightRegionInPreviewTab(1, 'rgb(186, 201, 255)', '0.4');
50
+ highlightImagePage.steps.verifyDefaultBorderColorOfHighlightRegionInPreviewTab(1, 'rgb(82, 0, 255)', '1');
51
+ });
52
+
53
+ it('When the user updates the \'Fill color\' and \'Border color\' of \'Default\' state in \'Option 1\' tab then the default state of the \'Option 1\' highlight region should be updated accordingly and the \'Option 2\' highlight region should have \'Fill color\' and \'Border color\' of default state according to the \'Global\' tab and hover and active state for \'Option 1\' and \'Option 2\' highlight region should be also according to the \'Global\' tab in the \'Set correct answer\' section', () => {
54
+ cy.log('Switching to edit Tab');
55
+ highlightImagePage.steps.switchToEditTab();
56
+ highlightImagePage.steps.navigateToOptionTab(1);
57
+ highlightImagePage.steps.clickOnHighlightColorBlock('defaultFillColor');
58
+ colorPopupComponent.steps.selectRecommendedColorBlock(0);
59
+ colorPopupComponent.steps.addInputToOpacityInputField('50');
60
+ colorPopupComponent.steps.clickOnOkButton();
61
+ highlightImagePage.steps.clickOnHighlightColorBlock('defaultBorderColor');
62
+ colorPopupComponent.steps.selectRecommendedColorBlock(1);
63
+ colorPopupComponent.steps.addInputToOpacityInputField('50');
64
+ colorPopupComponent.steps.clickOnOkButton();
65
+ cy.log("Verifying default state");
66
+ highlightImagePage.steps.verifyDefaultFillColorOfHighlightRegionInSetCorrectAnswerSection(0, 'rgb(229, 76, 25)', '0.5');
67
+ highlightImagePage.steps.verifyDefaultBorderColorOfHighlightRegionInSetCorrectAnswerSection(0, 'rgb(255, 240, 25)', '0.5');
68
+ highlightImagePage.steps.verifyDefaultFillColorOfHighlightRegionInSetCorrectAnswerSection(1, 'rgb(186, 201, 255)', '0.4');
69
+ highlightImagePage.steps.verifyDefaultBorderColorOfHighlightRegionInSetCorrectAnswerSection(1, 'rgb(82, 0, 255)', '1');
70
+ cy.log("Verifying hover state");
71
+ highlightImagePage.steps.verifyHoverFillColorOfHighlightRegionInSetCorrectAnswerSection(0, 'rgb(186, 201, 255)', '0.4');
72
+ highlightImagePage.steps.verifyHoverBorderColorOfHighlightRegionInSetCorrectAnswerSection(0, 'rgb(66, 0, 204)', '1');
73
+ highlightImagePage.steps.verifyHoverFillColorOfHighlightRegionInSetCorrectAnswerSection(1, 'rgb(186, 201, 255)', '0.4');
74
+ highlightImagePage.steps.verifyHoverBorderColorOfHighlightRegionInSetCorrectAnswerSection(1, 'rgb(66, 0, 204)', '1');
75
+ cy.log("Verifying active state");
76
+ highlightImagePage.steps.verifyActiveFillColorOfHighlightRegionInSetCorrectAnswerSection(0, 'rgb(107, 139, 255)', '0.7');
77
+ highlightImagePage.steps.verifyActiveBorderColorOfHighlightRegionInSetCorrectAnswerSection(0, 'rgb(41, 0, 128)', '1');
78
+ highlightImagePage.steps.verifyActiveFillColorOfHighlightRegionInSetCorrectAnswerSection(1, 'rgb(107, 139, 255)', '0.7');
79
+ highlightImagePage.steps.verifyActiveBorderColorOfHighlightRegionInSetCorrectAnswerSection(1, 'rgb(41, 0, 128)', '1');
80
+ });
81
+
82
+ it('When the user has updated the \'Fill color\' and \'Border color\' of \'Default\' state in \'Option 1\' tab then the default state of the \'Option 1\' highlight region should be updated accordingly and the \'Option 2\' highlight region should have \'Fill color\' and \'Border color\' of default state according to the \'Global\' tab and hover and active state for \'Option 1\' and \'Option 2\' highlight region should be also according to the \'Global\' tab in the \'Preview tab\'', () => {
83
+ cy.log('Switching to preview Tab');
84
+ highlightImagePage.steps.switchToPreviewTab();
85
+ cy.log("Verifying default state");
86
+ highlightImagePage.steps.verifyDefaultFillColorOfHighlightRegionInPreviewTab(0, 'rgb(229, 76, 25)', '0.5');
87
+ highlightImagePage.steps.verifyDefaultBorderColorOfHighlightRegionInPreviewTab(0, 'rgb(255, 240, 25)', '0.5');
88
+ highlightImagePage.steps.verifyDefaultFillColorOfHighlightRegionInPreviewTab(1, 'rgb(186, 201, 255)', '0.4');
89
+ highlightImagePage.steps.verifyDefaultBorderColorOfHighlightRegionInPreviewTab(1, 'rgb(82, 0, 255)', '1');
90
+ cy.log("Verifying hover state");
91
+ highlightImagePage.steps.verifyHoverFillColorOfHighlightRegionInPreviewTab(0, 'rgb(186, 201, 255)', '0.4');
92
+ highlightImagePage.steps.verifyHoverBorderColorOfHighlightRegionInPreviewTab(0, 'rgb(66, 0, 204)', '1');
93
+ highlightImagePage.steps.verifyHoverFillColorOfHighlightRegionInPreviewTab(1, 'rgb(186, 201, 255)', '0.4');
94
+ highlightImagePage.steps.verifyHoverBorderColorOfHighlightRegionInPreviewTab(1, 'rgb(66, 0, 204)', '1');
95
+ cy.log("Verifying active state");
96
+ highlightImagePage.steps.verifyActiveFillColorOfHighlightRegionInPreviewTab(0, 'rgb(107, 139, 255)', '0.7');
97
+ highlightImagePage.steps.verifyActiveBorderColorOfHighlightRegionInPreviewTab(0, 'rgb(41, 0, 128)', '1');
98
+ highlightImagePage.steps.verifyActiveFillColorOfHighlightRegionInPreviewTab(1, 'rgb(107, 139, 255)', '0.7');
99
+ highlightImagePage.steps.verifyActiveBorderColorOfHighlightRegionInPreviewTab(1, 'rgb(41, 0, 128)', '1');
100
+ });
101
+
102
+ it('When the user updates \'Fill color\' and \'Border color\' of \'Default\' state in \'Global tab\' then the default state of the \'Option 2\' highlight region should be updated accordingly and \'Fill color\' and \'Border color\' of \'Option 1\' highlight region of default state should be according to \'Option 1\' tab in the \'Set correct answer\' section', () => {
103
+ cy.log('Switching to edit Tab');
104
+ highlightImagePage.steps.switchToEditTab();
105
+ highlightImagePage.steps.navigateToGlobalTab();
106
+ highlightImagePage.steps.clickOnHighlightColorBlock('defaultFillColor');
107
+ colorPopupComponent.steps.selectRecommendedColorBlock(3);
108
+ colorPopupComponent.steps.addInputToOpacityInputField(70);
109
+ colorPopupComponent.steps.clickOnOkButton();
110
+ highlightImagePage.steps.clickOnHighlightColorBlock('defaultBorderColor');
111
+ colorPopupComponent.steps.selectRecommendedColorBlock(2);
112
+ colorPopupComponent.steps.addInputToOpacityInputField(70);
113
+ colorPopupComponent.steps.clickOnOkButton();
114
+ highlightImagePage.steps.verifyDefaultFillColorOfHighlightRegionInSetCorrectAnswerSection(1, 'rgb(0, 0, 0)', '0.7');
115
+ highlightImagePage.steps.verifyDefaultBorderColorOfHighlightRegionInSetCorrectAnswerSection(1, 'rgb(9, 179, 33)', '0.7');
116
+ highlightImagePage.steps.verifyDefaultFillColorOfHighlightRegionInSetCorrectAnswerSection(0, 'rgb(229, 76, 25)', '0.5');
117
+ highlightImagePage.steps.verifyDefaultBorderColorOfHighlightRegionInSetCorrectAnswerSection(0, 'rgb(255, 240, 25)', '0.5');
118
+ });
119
+
120
+ it('When the user has updated \'Fill color\' and \'Border color\' of \'Default\' state in \'Global tab\' then the default state of the \'Option 2\' highlight region should be updated accordingly and \'Fill color\' and \'Border color\' of \'Option 1\' highlight region of default state should be according to \'Option 1\' tab in the in the \'Preview tab\'', () => {
121
+ cy.log('Switching to preview Tab');
122
+ highlightImagePage.steps.switchToPreviewTab();
123
+ highlightImagePage.steps.verifyDefaultFillColorOfHighlightRegionInPreviewTab(1, 'rgb(0, 0, 0)', '0.7');
124
+ highlightImagePage.steps.verifyDefaultBorderColorOfHighlightRegionInPreviewTab(1, 'rgb(9, 179, 33)', '0.7');
125
+ highlightImagePage.steps.verifyDefaultFillColorOfHighlightRegionInPreviewTab(0, 'rgb(229, 76, 25)', '0.5');
126
+ highlightImagePage.steps.verifyDefaultBorderColorOfHighlightRegionInPreviewTab(0, 'rgb(255, 240, 25)', '0.5');
127
+ });
128
+ });
129
+
130
+ //Failing due to https://redmine.zeuslearning.com/issues/546130
131
+ describe('Customize highlight properties accordion: Global and option tab functionality of hover state in set correct answer and preview tab', () => {
132
+ abortEarlySetup();
133
+ before(() => {
134
+ cy.log('Navigating to highlight image question type');
135
+ highlightImagePage.steps.navigateToCreateQuestion('highlight image');
136
+ cy.barsPreLoaderWait();
137
+ cy.log('Uploading an image');
138
+ uploadImageSectionComponent.steps.uploadFile('highlightImage.jpg');
139
+ uploadImageSectionComponent.steps.verifyUploadedImageInImagePopup();
140
+ uploadImageSectionComponent.steps.clickOnImagePopupOkButton();
141
+ utilities.verifyElementVisibilityState(uploadImageSectionComponent.uploadImagePopup(), 'notExist');
142
+ highlightImagePage.steps.verifyImageUploadedInHighlightRegion();
143
+ highlightImagePage.steps.verifyImageUploadedInSetCorrectAnswerSection();
144
+ highlightImagePage.steps.highlightRegionInImage(flowerHighlightRegion);
145
+ highlightImagePage.steps.verifyHighlightRegionsInSetCorrectAnswerSection(0, flowerHighlightRegion);
146
+ highlightImagePage.steps.highlightRegionInImage(leafHighlightRegion);
147
+ highlightImagePage.steps.verifyHighlightRegionsInSetCorrectAnswerSection(1, leafHighlightRegion);
148
+ highlightImagePage.steps.expandCustomizeHighlightProperties();
149
+ });
150
+
151
+ it('When the user has not updated \'Fill color\' and \'Border color\' of \'Hover\' state in \'Global\' tab then the hover state of \'Option 1\' and \'Option 2\' highlight region should have the \'Fill color\' and \'Border color\' according to the global tab in the \'Set correct answer\' section', () => {
152
+ highlightImagePage.steps.verifyHoverFillColorOfHighlightRegionInSetCorrectAnswerSection(0, 'rgb(186, 201, 255)', '0.4');
153
+ highlightImagePage.steps.verifyHoverBorderColorOfHighlightRegionInSetCorrectAnswerSection(0, 'rgb(66, 0, 204)', '1');
154
+ highlightImagePage.steps.verifyHoverFillColorOfHighlightRegionInSetCorrectAnswerSection(1, 'rgb(186, 201, 255)', '0.4');
155
+ highlightImagePage.steps.verifyHoverBorderColorOfHighlightRegionInSetCorrectAnswerSection(1, 'rgb(66, 0, 204)', '1');
156
+ });
157
+
158
+ it('When the user has not updated \'Fill color\' and \'Border color\' of \'Hover\' state in \'Global\' tab then the hover state of \'Option 1\' and \'Option 2\' highlight region should have the \'Fill color\' and \'Border color\' according to the global tab in the\'Preview tab\'', () => {
159
+ highlightImagePage.steps.switchToPreviewTab();
160
+ highlightImagePage.steps.verifyHoverFillColorOfHighlightRegionInPreviewTab(0, 'rgb(186, 201, 255)', '0.4');
161
+ highlightImagePage.steps.verifyHoverBorderColorOfHighlightRegionInPreviewTab(0, 'rgb(66, 0, 204)', '1');
162
+ highlightImagePage.steps.verifyHoverFillColorOfHighlightRegionInPreviewTab(1, 'rgb(186, 201, 255)', '0.4');
163
+ highlightImagePage.steps.verifyHoverBorderColorOfHighlightRegionInPreviewTab(1, 'rgb(66, 0, 204)', '1');
164
+ });
165
+
166
+ it('When the user updates the \'Fill color\' and \'Border color\' of \'Hover\' state in \'Option 1\' tab then the hover state of the \'Option 1\' highlight region should be updated accordingly and the \'Option 2\' highlight region should have \'Fill color\' and \'Border color\' of hover state according to the \'Global\' tab and default and active state for \'Option 1\' and \'Option 2 \' highlight region should be also according to the \'Global\' tab in the \'Set correct answer\' section', () => {
167
+ cy.log('Switching to edit Tab');
168
+ highlightImagePage.steps.switchToEditTab();
169
+ highlightImagePage.steps.navigateToOptionTab(1);
170
+ highlightImagePage.steps.clickOnHighlightColorBlock('hoverFillColor');
171
+ colorPopupComponent.steps.selectRecommendedColorBlock(2);
172
+ colorPopupComponent.steps.addInputToOpacityInputField(70);
173
+ colorPopupComponent.steps.clickOnOkButton();
174
+ highlightImagePage.steps.clickOnHighlightColorBlock('hoverBorderColor');
175
+ colorPopupComponent.steps.selectRecommendedColorBlock(3);
176
+ colorPopupComponent.steps.addInputToOpacityInputField(70);
177
+ colorPopupComponent.steps.clickOnOkButton();
178
+ cy.log("Verifying hover state");
179
+ highlightImagePage.steps.verifyHoverFillColorOfHighlightRegionInSetCorrectAnswerSection(0, 'rgb(9, 179, 33)', '0.7');
180
+ highlightImagePage.steps.verifyHoverBorderColorOfHighlightRegionInSetCorrectAnswerSection(0, 'rgb(0, 0, 0)', '0.7');
181
+ highlightImagePage.steps.verifyHoverFillColorOfHighlightRegionInSetCorrectAnswerSection(1, 'rgb(186, 201, 255)', '0.4');
182
+ highlightImagePage.steps.verifyHoverBorderColorOfHighlightRegionInSetCorrectAnswerSection(1, 'rgb(66, 0, 204)', '1');
183
+ cy.log("Verifying default state");
184
+ highlightImagePage.steps.verifyDefaultFillColorOfHighlightRegionInSetCorrectAnswerSection(0, 'rgb(186, 201, 255)', '0.4');
185
+ highlightImagePage.steps.verifyDefaultBorderColorOfHighlightRegionInSetCorrectAnswerSection(0, 'rgb(82, 0, 255)', '1');
186
+ highlightImagePage.steps.verifyDefaultFillColorOfHighlightRegionInSetCorrectAnswerSection(1, 'rgb(186, 201, 255)', '0.4');
187
+ highlightImagePage.steps.verifyDefaultBorderColorOfHighlightRegionInSetCorrectAnswerSection(1, 'rgb(82, 0, 255)', '1');
188
+ cy.log("Verifying active state");
189
+ highlightImagePage.steps.verifyActiveFillColorOfHighlightRegionInSetCorrectAnswerSection(0, 'rgb(107, 139, 255)', '0.7');
190
+ highlightImagePage.steps.verifyActiveBorderColorOfHighlightRegionInSetCorrectAnswerSection(0, 'rgb(41, 0, 128)', '1');
191
+ highlightImagePage.steps.verifyActiveFillColorOfHighlightRegionInSetCorrectAnswerSection(1, 'rgb(107, 139, 255)', '0.7');
192
+ highlightImagePage.steps.verifyActiveBorderColorOfHighlightRegionInSetCorrectAnswerSection(1, 'rgb(41, 0, 128)', '1');
193
+ });
194
+
195
+ it('When the user has updated the \'Fill color\' and \'Border color\' of \'Hover\' state in \'Option 1\' tab then the hover state of the \'Option 1\' highlight region should be updated accordingly and the \'Option 2\' highlight region should have \'Fill color\' and \'Border color\' of hover state according to the \'Global\' tab and default and active state for \'Option 1\' and \'Option 2 \' highlight region should be also according to the \'Global\' tab in the \'Preview\' tab', () => {
196
+ cy.log('Switching to preview Tab');
197
+ highlightImagePage.steps.switchToPreviewTab();
198
+ cy.log("Verifying hover state");
199
+ highlightImagePage.steps.verifyHoverFillColorOfHighlightRegionInPreviewTab(0, 'rgb(9, 179, 33)', '0.7');
200
+ highlightImagePage.steps.verifyHoverBorderColorOfHighlightRegionInPreviewTab(0, 'rgb(0, 0, 0)', '0.7');
201
+ highlightImagePage.steps.verifyHoverFillColorOfHighlightRegionInPreviewTab(1, 'rgb(186, 201, 255)', '0.4');
202
+ highlightImagePage.steps.verifyHoverBorderColorOfHighlightRegionInPreviewTab(1, 'rgb(66, 0, 204)', '1');
203
+ cy.log("Verifying default state");
204
+ highlightImagePage.steps.verifyDefaultFillColorOfHighlightRegionInPreviewTab(0, 'rgb(186, 201, 255)', '0.4');
205
+ highlightImagePage.steps.verifyDefaultBorderColorOfHighlightRegionInPreviewTab(0, 'rgb(82, 0, 255)', '1');
206
+ highlightImagePage.steps.verifyDefaultFillColorOfHighlightRegionInPreviewTab(1, 'rgb(186, 201, 255)', '0.4');
207
+ highlightImagePage.steps.verifyDefaultBorderColorOfHighlightRegionInPreviewTab(1, 'rgb(82, 0, 255)', '1');
208
+ cy.log("Verifying active state");
209
+ highlightImagePage.steps.verifyActiveFillColorOfHighlightRegionInPreviewTab(0, 'rgb(107, 139, 255)', '0.7');
210
+ highlightImagePage.steps.verifyActiveBorderColorOfHighlightRegionInPreviewTab(0, 'rgb(41, 0, 128)', '1');
211
+ highlightImagePage.steps.verifyActiveFillColorOfHighlightRegionInPreviewTab(1, 'rgb(107, 139, 255)', '0.7');
212
+ highlightImagePage.steps.verifyActiveBorderColorOfHighlightRegionInPreviewTab(1, 'rgb(41, 0, 128)', '1');
213
+ });
214
+
215
+ it('When the user updates \'Fill color\' and \'Border color\' of \'Hover\' state in \'Global tab\' then the hover state of the \'Option 2\' highlight region should be updated accordingly and \'Fill color\' and \'Border color\' of \'Option 1\' highlight region of hover state should be according to \'Option 1\' tab in the \'Set correct answer\' section', () => {
216
+ cy.log('Switching to edit Tab');
217
+ highlightImagePage.steps.switchToEditTab();
218
+ highlightImagePage.steps.navigateToGlobalTab();
219
+ highlightImagePage.steps.clickOnHighlightColorBlock('hoverFillColor');
220
+ colorPopupComponent.steps.selectRecommendedColorBlock(0);
221
+ colorPopupComponent.steps.addInputToOpacityInputField(30);
222
+ colorPopupComponent.steps.clickOnOkButton();
223
+ highlightImagePage.steps.clickOnHighlightColorBlock('hoverBorderColor');
224
+ colorPopupComponent.steps.selectRecommendedColorBlock(1);
225
+ colorPopupComponent.steps.addInputToOpacityInputField(30);
226
+ colorPopupComponent.steps.clickOnOkButton();
227
+ highlightImagePage.steps.verifyHoverFillColorOfHighlightRegionInSetCorrectAnswerSection(1, 'rgb(229, 76, 25)', '0.3');
228
+ highlightImagePage.steps.verifyHoverBorderColorOfHighlightRegionInSetCorrectAnswerSection(1, 'rgb(255, 240, 25)', '0.3');
229
+ highlightImagePage.steps.verifyHoverFillColorOfHighlightRegionInSetCorrectAnswerSection(0, 'rgb(9, 179, 33)', '0.7');
230
+ highlightImagePage.steps.verifyHoverBorderColorOfHighlightRegionInSetCorrectAnswerSection(0, 'rgb(0, 0, 0)', '0.7');
231
+ });
232
+
233
+ it('When the user has updated \'Fill color\' and \'Border color\' of \'Hover\' state in \'Global tab\' then the hover state of the \'Option 2\' highlight region should be updated accordingly and \'Fill color\' and \'Border color\' of \'Option 1\' highlight region of hover state should be according to \'Option 1\' tab in the in the \'Preview tab\'', () => {
234
+ cy.log('Switching to preview Tab');
235
+ highlightImagePage.steps.switchToPreviewTab();
236
+ highlightImagePage.steps.verifyHoverFillColorOfHighlightRegionInPreviewTab(1, 'rgb(229, 76, 25)', '0.3');
237
+ highlightImagePage.steps.verifyHoverBorderColorOfHighlightRegionInPreviewTab(1, 'rgb(255, 240, 25)', '0.3');
238
+ highlightImagePage.steps.verifyHoverFillColorOfHighlightRegionInPreviewTab(0, 'rgb(9, 179, 33)', '0.7');
239
+ highlightImagePage.steps.verifyHoverBorderColorOfHighlightRegionInPreviewTab(0, 'rgb(0, 0, 0)', '0.7');
240
+ });
241
+ });
242
+
243
+ //Failing due to https://redmine.zeuslearning.com/issues/546130
244
+ describe('Customize highlight properties accordion: Global and option tab functionality of active state in set correct answer and preview tab', () => {
245
+ abortEarlySetup();
246
+ before(() => {
247
+ cy.log('Navigating to highlight image question type');
248
+ highlightImagePage.steps.navigateToCreateQuestion('highlight image');
249
+ cy.barsPreLoaderWait();
250
+ cy.log('Uploading an image');
251
+ uploadImageSectionComponent.steps.uploadFile('highlightImage.jpg');
252
+ uploadImageSectionComponent.steps.verifyUploadedImageInImagePopup();
253
+ uploadImageSectionComponent.steps.clickOnImagePopupOkButton();
254
+ utilities.verifyElementVisibilityState(uploadImageSectionComponent.uploadImagePopup(), 'notExist');
255
+ highlightImagePage.steps.verifyImageUploadedInHighlightRegion();
256
+ highlightImagePage.steps.verifyImageUploadedInSetCorrectAnswerSection();
257
+ highlightImagePage.steps.highlightRegionInImage(flowerHighlightRegion);
258
+ highlightImagePage.steps.verifyHighlightRegionsInSetCorrectAnswerSection(0, flowerHighlightRegion);
259
+ highlightImagePage.steps.highlightRegionInImage(leafHighlightRegion);
260
+ highlightImagePage.steps.verifyHighlightRegionsInSetCorrectAnswerSection(1, leafHighlightRegion);
261
+ highlightImagePage.steps.expandCustomizeHighlightProperties();
262
+ });
263
+
264
+ it('When the user has not updated \'Fill color\' and \'Border color\' of \'Active\' state in \'Global\' tab then the active state of \'Option 1\' and \'Option 2\' highlight region should have the \'Fill color\' and \'Border color\' according to the global tab in the \'Set correct answer\' section', () => {
265
+ highlightImagePage.steps.verifyActiveFillColorOfHighlightRegionInSetCorrectAnswerSection(0, 'rgb(107, 139, 255)', '0.7');
266
+ highlightImagePage.steps.verifyActiveBorderColorOfHighlightRegionInSetCorrectAnswerSection(0, 'rgb(41, 0, 128)', '1');
267
+ highlightImagePage.steps.verifyActiveFillColorOfHighlightRegionInSetCorrectAnswerSection(1, 'rgb(107, 139, 255)', '0.7');
268
+ highlightImagePage.steps.verifyActiveBorderColorOfHighlightRegionInSetCorrectAnswerSection(1, 'rgb(41, 0, 128)', '1');
269
+ });
270
+
271
+ it('When the user has not updated \'Fill color\' and \'Border color\' of \'Active\' state in \'Global\' tab then the active state of \'Option 1\' and \'Option 2\' highlight region should have the \'Fill color\' and \'Border color\' according to the global tab in the\'Preview tab\'', () => {
272
+ cy.log('Switching to preview Tab');
273
+ highlightImagePage.steps.switchToPreviewTab();
274
+ highlightImagePage.steps.verifyActiveFillColorOfHighlightRegionInPreviewTab(0, 'rgb(107, 139, 255)', '0.7');
275
+ highlightImagePage.steps.verifyActiveBorderColorOfHighlightRegionInPreviewTab(0, 'rgb(41, 0, 128)', '1');
276
+ highlightImagePage.steps.verifyActiveFillColorOfHighlightRegionInPreviewTab(1, 'rgb(107, 139, 255)', '0.7');
277
+ highlightImagePage.steps.verifyActiveBorderColorOfHighlightRegionInPreviewTab(1, 'rgb(41, 0, 128)', '1');
278
+ });
279
+
280
+ it('When the user updates the \'Fill color\' and \'Border color\' of \'Active\' state in \'Option 1\' tab then the active state of the \'Option 1\' highlight region should be updated accordingly and the \'Option 2\' highlight region should have \'Fill color\' and \'Border color\' of active state according to the \'Global\' tab and default and hover state for \'Option 1\' and \'Option 2 \' highlight region should be also according to the \'Global\' tab in the \'Set correct answer\' section', () => {
281
+ cy.log('Switching to edit Tab');
282
+ highlightImagePage.steps.switchToEditTab();
283
+ highlightImagePage.steps.navigateToOptionTab(1);
284
+ highlightImagePage.steps.clickOnHighlightColorBlock('activeFillColor');
285
+ colorPopupComponent.steps.selectRecommendedColorBlock(1);
286
+ colorPopupComponent.steps.addInputToOpacityInputField(90);
287
+ colorPopupComponent.steps.clickOnOkButton();
288
+ highlightImagePage.steps.clickOnHighlightColorBlock('activeBorderColor');
289
+ colorPopupComponent.steps.selectRecommendedColorBlock(3);
290
+ colorPopupComponent.steps.addInputToOpacityInputField(90);
291
+ colorPopupComponent.steps.clickOnOkButton()
292
+ cy.log('Verfying default state')
293
+ highlightImagePage.steps.verifyDefaultFillColorOfHighlightRegionInSetCorrectAnswerSection(0, 'rgb(186, 201, 255)', '0.4');
294
+ highlightImagePage.steps.verifyDefaultBorderColorOfHighlightRegionInSetCorrectAnswerSection(0, 'rgb(82, 0, 255)', '1');
295
+ highlightImagePage.steps.verifyDefaultFillColorOfHighlightRegionInSetCorrectAnswerSection(1, 'rgb(186, 201, 255)', '0.4');
296
+ highlightImagePage.steps.verifyDefaultBorderColorOfHighlightRegionInSetCorrectAnswerSection(1, 'rgb(82, 0, 255)', '1');
297
+ cy.log("Verifying hover state");
298
+ highlightImagePage.steps.verifyHoverFillColorOfHighlightRegionInSetCorrectAnswerSection(0, 'rgb(186, 201, 255)', '0.4');
299
+ highlightImagePage.steps.verifyHoverBorderColorOfHighlightRegionInSetCorrectAnswerSection(0, 'rgb(66, 0, 204)', '1');
300
+ highlightImagePage.steps.verifyHoverFillColorOfHighlightRegionInSetCorrectAnswerSection(1, 'rgb(186, 201, 255)', '0.4');
301
+ highlightImagePage.steps.verifyHoverBorderColorOfHighlightRegionInSetCorrectAnswerSection(1, 'rgb(66, 0, 204)', '1');
302
+ cy.log("Verifying active state");
303
+ highlightImagePage.steps.verifyActiveFillColorOfHighlightRegionInSetCorrectAnswerSection(0, 'rgb(255, 240, 25)', '0.9');
304
+ highlightImagePage.steps.verifyActiveBorderColorOfHighlightRegionInSetCorrectAnswerSection(0, 'rgb(0, 0, 0)', '0.9');
305
+ highlightImagePage.steps.verifyActiveFillColorOfHighlightRegionInSetCorrectAnswerSection(1, 'rgb(107, 139, 255)', '0.7');
306
+ highlightImagePage.steps.verifyActiveBorderColorOfHighlightRegionInSetCorrectAnswerSection(1, 'rgb(41, 0, 128)', '1');
307
+ });
308
+
309
+ it('When the user has updated the \'Fill color\' and \'Border color\' of \'Active\' state in \'Option 1\' tab then the active state of the \'Option 1\' highlight region should be updated accordingly and the \'Option 2\' highlight region should have \'Fill color\' and \'Border color\' of active state according to the \'Global\' tab and default and hover state for \'Option 1\' and \'Option 2 \' highlight region should be also according to the \'Global\' tab in the \'Preview tab\'', () => {
310
+ cy.log('Switching to preview Tab');
311
+ highlightImagePage.steps.switchToPreviewTab();
312
+ cy.log('Verfying default state')
313
+ highlightImagePage.steps.verifyDefaultFillColorOfHighlightRegionInPreviewTab(0, 'rgb(186, 201, 255)', '0.4');
314
+ highlightImagePage.steps.verifyDefaultBorderColorOfHighlightRegionInPreviewTab(0, 'rgb(82, 0, 255)', '1');
315
+ highlightImagePage.steps.verifyDefaultFillColorOfHighlightRegionInPreviewTab(1, 'rgb(186, 201, 255)', '0.4');
316
+ highlightImagePage.steps.verifyDefaultBorderColorOfHighlightRegionInPreviewTab(1, 'rgb(82, 0, 255)', '1');
317
+ cy.log("Verifying hover state");
318
+ highlightImagePage.steps.verifyHoverFillColorOfHighlightRegionInPreviewTab(0, 'rgb(186, 201, 255)', '0.4');
319
+ highlightImagePage.steps.verifyHoverBorderColorOfHighlightRegionInPreviewTab(0, 'rgb(66, 0, 204)', '1');
320
+ highlightImagePage.steps.verifyHoverFillColorOfHighlightRegionInPreviewTab(1, 'rgb(186, 201, 255)', '0.4');
321
+ highlightImagePage.steps.verifyHoverBorderColorOfHighlightRegionInPreviewTab(1, 'rgb(66, 0, 204)', '1');
322
+ cy.log("Verifying active state");
323
+ highlightImagePage.steps.verifyActiveFillColorOfHighlightRegionInPreviewTab(0, 'rgb(255, 240, 25)', '0.9');
324
+ highlightImagePage.steps.verifyActiveBorderColorOfHighlightRegionInPreviewTab(0, 'rgb(0, 0, 0)', '0.9');
325
+ highlightImagePage.steps.verifyActiveFillColorOfHighlightRegionInPreviewTab(1, 'rgb(107, 139, 255)', '0.7');
326
+ highlightImagePage.steps.verifyActiveBorderColorOfHighlightRegionInPreviewTab(1, 'rgb(41, 0, 128)', '1');
327
+ });
328
+
329
+ it('When the user updates \'Fill color\' and \'Border color\' of \'Active\' state in \'Global tab\' then the active state of the \'Option 2\' highlight region should be updated accordingly and \'Fill color\' and \'Border color\' of \'Option 1\' highlight region of active state should be according to \'Option 1\' tab in the \'Set correct answer\' section', () => {
330
+ cy.log('Switching to edit Tab');
331
+ highlightImagePage.steps.switchToEditTab();
332
+ highlightImagePage.steps.navigateToGlobalTab();
333
+ highlightImagePage.steps.clickOnHighlightColorBlock('activeFillColor');
334
+ colorPopupComponent.steps.selectRecommendedColorBlock(0);
335
+ colorPopupComponent.steps.addInputToOpacityInputField(80);
336
+ colorPopupComponent.steps.clickOnOkButton();
337
+ highlightImagePage.steps.clickOnHighlightColorBlock('activeBorderColor');
338
+ colorPopupComponent.steps.selectRecommendedColorBlock(2);
339
+ colorPopupComponent.steps.addInputToOpacityInputField(80);
340
+ colorPopupComponent.steps.clickOnOkButton();
341
+ highlightImagePage.steps.verifyActiveFillColorOfHighlightRegionInSetCorrectAnswerSection(1, 'rgb(229, 76, 25)', '0.8');
342
+ highlightImagePage.steps.verifyActiveBorderColorOfHighlightRegionInSetCorrectAnswerSection(1, 'rgb(9, 179, 33)', '0.8');
343
+ highlightImagePage.steps.verifyActiveFillColorOfHighlightRegionInSetCorrectAnswerSection(0, 'rgb(255, 240, 25)', '0.9');
344
+ highlightImagePage.steps.verifyActiveBorderColorOfHighlightRegionInSetCorrectAnswerSection(0, 'rgb(0, 0, 0)', '0.9');
345
+ });
346
+
347
+ it('When the user has updated \'Fill color\' and \'Border color\' of \'Active\' state in \'Global tab\' then the active state of the \'Option 2\' highlight region should be updated accordingly and \'Fill color\' and \'Border color\' of \'Option 1\' highlight region of active state should be according to \'Option 1\' tab in the in the \'Preview tab\'', () => {
348
+ cy.log('Switching to preview Tab');
349
+ highlightImagePage.steps.switchToPreviewTab();
350
+ highlightImagePage.steps.verifyActiveFillColorOfHighlightRegionInPreviewTab(1, 'rgb(229, 76, 25)', '0.8');
351
+ highlightImagePage.steps.verifyActiveBorderColorOfHighlightRegionInPreviewTab(1, 'rgb(9, 179, 33)', '0.8');
352
+ highlightImagePage.steps.verifyActiveFillColorOfHighlightRegionInPreviewTab(0, 'rgb(255, 240, 25)', '0.9');
353
+ highlightImagePage.steps.verifyActiveBorderColorOfHighlightRegionInPreviewTab(0, 'rgb(0, 0, 0)', '0.9');
354
+ });
355
+ });
356
+ });
@@ -0,0 +1,125 @@
1
+ import constants from "../../../fixtures/constants";
2
+ import { highlightImagePage } from "../../../pages";
3
+ import { uploadImageSectionComponent } from "../../../pages/components/uploadImageSectionComponent";
4
+ import abortEarlySetup from "../../../support/helpers/abortEarly";
5
+ import utilities from "../../../support/helpers/utilities";
6
+
7
+ describe('Create Item page - Highlight image: Question instructions, edit tab contents and image popup', () => {
8
+ before(() => {
9
+ cy.loginAs('admin');
10
+ });
11
+
12
+ describe('Question instructions input field - Edit tab', () => {
13
+ abortEarlySetup();
14
+ before(() => {
15
+ cy.log('Navigating to highlight image question type');
16
+ highlightImagePage.steps.navigateToCreateQuestion('highlight image');
17
+ });
18
+
19
+ highlightImagePage.tests.verifyQuestionInstructionsInputFieldEditTab();
20
+ });
21
+
22
+ describe('Question instructions input field - Preview tab', () => {
23
+ abortEarlySetup();
24
+ before(() => {
25
+ cy.log('Navigating to Highlight image question type');
26
+ highlightImagePage.steps.navigateToCreateQuestion('highlight image');
27
+ });
28
+
29
+ highlightImagePage.tests.verifyQuestionInstructionsInputFieldPreviewTab();
30
+ });
31
+
32
+ describe('Highlight image - Edit tab default contents', () => {
33
+ abortEarlySetup();
34
+ before(() => {
35
+ cy.log('Navigating to highlight image question type');
36
+ highlightImagePage.steps.navigateToCreateQuestion('highlight image');
37
+ });
38
+
39
+ it('\'Highlight image\' title should be displayed', () => {
40
+ utilities.verifyInnerText(highlightImagePage.highlightImageLabel(), 'Highlight image');
41
+ utilities.verifyElementVisibilityState(highlightImagePage.highlightImageLabel(), 'visible');
42
+ });
43
+
44
+ uploadImageSectionComponent.tests.uploadImageEditTabContents();
45
+ });
46
+
47
+ describe('Upload image - device popup contents', () => {
48
+ abortEarlySetup();
49
+ before(() => {
50
+ cy.log('Navigating to highlight image question type');
51
+ highlightImagePage.steps.navigateToCreateQuestion('highlight image');
52
+ });
53
+
54
+ uploadImageSectionComponent.tests.verifyUploadImagePopupImageTitle();
55
+
56
+ uploadImageSectionComponent.tests.uploadImagePopupContents(500, 500);
57
+
58
+ uploadImageSectionComponent.tests.verifyButtonReplaceInImagePopup();
59
+ });
60
+
61
+ //Failing due to https://redmine.zeuslearning.com/issues/547305
62
+ describe('Upload image popup contents functionality', () => {
63
+ abortEarlySetup();
64
+ before(() => {
65
+ cy.log('Navigating to highlight image question type');
66
+ highlightImagePage.steps.navigateToCreateQuestion('highlight image');
67
+ uploadImageSectionComponent.steps.uploadFile('highlightImage.jpg');
68
+ });
69
+
70
+ uploadImageSectionComponent.tests.uploadImageHeightWidthAspectRatioAndResetDimensionsFunctionality(500, 500);
71
+
72
+ uploadImageSectionComponent.tests.uploadImageReplaceButtonFunctionality();
73
+
74
+ it('When user selects the \'Cancel\' button the image should not be uploaded', () => {
75
+ uploadImageSectionComponent.steps.clickOnImagePopupCancelButton();
76
+ utilities.verifyElementVisibilityState(highlightImagePage.highlighImageCanvas(), 'notExist');
77
+ });
78
+
79
+ it('When user uploads an image and selects \'Ok\' button the image should be displayed in the highlight image section', () => {
80
+ uploadImageSectionComponent.steps.uploadFile('highlightImage.jpg');
81
+ uploadImageSectionComponent.steps.verifyUploadedImageInImagePopup();
82
+ uploadImageSectionComponent.steps.clickOnImagePopupOkButton();
83
+ utilities.verifyElementVisibilityState(highlightImagePage.highlighImageCanvas(), 'visible');
84
+ });
85
+ });
86
+
87
+ describe('Upload image - source URL popup contents', () => {
88
+ abortEarlySetup();
89
+ before(() => {
90
+ cy.log('Navigating to highlight image question type');
91
+ highlightImagePage.steps.navigateToCreateQuestion('highlight image');
92
+ });
93
+
94
+ uploadImageSectionComponent.tests.verifyUploadImageSourceURLTitle();
95
+
96
+ uploadImageSectionComponent.tests.verifyUploadImageSourceURLDefaultLabelAndInputField();
97
+
98
+ uploadImageSectionComponent.tests.uploadImagePopupContents(650, 684);
99
+ });
100
+
101
+ describe('Upload image \'Source URL\' popup contents functionality', () => {
102
+ abortEarlySetup();
103
+ before(() => {
104
+ cy.log('Navigating to highlight image question type');
105
+ highlightImagePage.steps.navigateToCreateQuestion('highlight image');
106
+ uploadImageSectionComponent.steps.clickOnSourceURL();
107
+ uploadImageSectionComponent.steps.uploadImageUsingSourceURL(constants.flowerImage);
108
+ });
109
+
110
+ uploadImageSectionComponent.tests.uploadImageHeightWidthAspectRatioAndResetDimensionsFunctionality(650, 684);
111
+
112
+ it('When user selects the \'Cancel\' button the image should not be uploaded', () => {
113
+ uploadImageSectionComponent.steps.clickOnImagePopupCancelButton();
114
+ utilities.verifyElementVisibilityState(highlightImagePage.highlighImageCanvas(), 'notExist');
115
+ });
116
+
117
+ it('When user uploads an image and selects \'Ok\' button the image should be displayed in the highlight image section', () => {
118
+ uploadImageSectionComponent.steps.clickOnSourceURL();
119
+ uploadImageSectionComponent.steps.uploadImageUsingSourceURL(constants.flowerImage);
120
+ uploadImageSectionComponent.steps.verifyUploadedImageInImagePopup();
121
+ uploadImageSectionComponent.steps.clickOnImagePopupOkButton();
122
+ utilities.verifyElementVisibilityState(highlightImagePage.highlighImageCanvas(), 'visible');
123
+ });
124
+ });
125
+ });