itemengine-cypress-automation 1.0.25 → 1.0.26

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,1010 @@
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
+ const highlightColorProperties = {
12
+ default: {
13
+ displayName: 'Default',
14
+ colorProperties: {
15
+ fillColorHexValue: '#BAC9FF',
16
+ fillColorRgbaValue: 'rgba(186, 201, 255, 0.4)',
17
+ fillColorOpacity: 40,
18
+ borderColorHexValue: '#5200FF',
19
+ borderColorRgbValue: 'rgb(82, 0, 255)',
20
+ borderColorOpacity: 100
21
+ }
22
+ },
23
+ hover: {
24
+ displayName: 'Hover',
25
+ colorProperties: {
26
+ fillColorHexValue: '#BAC9FF',
27
+ fillColorRgbaValue: 'rgba(186, 201, 255, 0.4)',
28
+ fillColorOpacity: 40,
29
+ borderColorHexValue: '#4200CC',
30
+ borderColorRgbValue: 'rgb(66, 0, 204)',
31
+ borderColorOpacity: 100
32
+ }
33
+ },
34
+ active: {
35
+ displayName: 'Active',
36
+ colorProperties: {
37
+ fillColorHexValue: '#6B8BFF',
38
+ fillColorRgbaValue: 'rgba(107, 139, 255, 0.7)',
39
+ fillColorOpacity: 70,
40
+ borderColorHexValue: '#290080',
41
+ borderColorRgbValue: 'rgb(41, 0, 128)',
42
+ borderColorOpacity: 100
43
+ }
44
+ }
45
+ }
46
+
47
+ describe('Create Item page - Highlight image: Customize highlight properties', () => {
48
+ before(() => {
49
+ cy.loginAs('admin');
50
+ });
51
+
52
+ describe('Customize highlight properties content : Edit tab', () => {
53
+ abortEarlySetup();
54
+ before(() => {
55
+ cy.log('Navigating to Highlight image question type');
56
+ highlightImagePage.steps.navigateToCreateQuestion('highlight image');
57
+ });
58
+
59
+ it('When user has not uploaded an image \'Customize highlight properties\' accordion should not be displayed', () => {
60
+ utilities.verifyElementVisibilityState(highlightImagePage.customizeHighlightPropertiesPanel(), 'notExist');
61
+ });
62
+
63
+ it('When user adds uploads an image, \'Customize highlight properties\' accordion should be visible and by default it should be collapsed', () => {
64
+ cy.log('Uploading an image');
65
+ uploadImageSectionComponent.steps.uploadFile('highlightImage.jpg');
66
+ uploadImageSectionComponent.steps.verifyUploadedImageInImagePopup();
67
+ uploadImageSectionComponent.steps.clickOnImagePopupOkButton();
68
+ highlightImagePage.steps.verifyImageUploadedInHighlightRegion();
69
+ utilities.verifyInnerText(highlightImagePage.customizeHighlightPropertiesLabel(), 'Customize highlight properties');
70
+ utilities.verifyElementVisibilityState(highlightImagePage.customizeHighlightPropertiesPanel(), 'visible');
71
+ highlightImagePage.steps.verifyCustomizeHighlightPropertiesCollapsedState();
72
+ });
73
+
74
+ it('When user clicks on the \'Customize highlight properties\' accordion it should be displayed in expanded state', () => {
75
+ highlightImagePage.steps.expandCustomizeHighlightProperties();
76
+ });
77
+
78
+ it('When user has not highlighted any region in the image then only \'Global\' tab should be displayed and by default it should be in active state', () => {
79
+ utilities.verifyElementVisibilityState(highlightImagePage.customizeHighlightPropertiesTab(), 'visible')
80
+ utilities.verifyInnerText(highlightImagePage.customizeHighlightPropertiesTab(), 'Global')
81
+ highlightImagePage.steps.verifyActiveStateOfCustomizeHighlightPropertiesTab(0);
82
+ highlightImagePage.steps.verifyCountOfCustomizePropertiesTab(1);
83
+ });
84
+
85
+ it('\'Highlight color\' label should be displayed', () => {
86
+ utilities.verifyInnerText(highlightImagePage.highlightColorLabel(), 'Highlight color');
87
+ utilities.verifyElementVisibilityState(highlightImagePage.highlightColorLabel(), 'visible');
88
+ });
89
+
90
+ it(`\'Customize highlight properties\' accordion should have \'Default\' section with ${highlightColorProperties['default'].displayName} label, fill color label, border color label, hex colors and opacity with color blocks`, () => {
91
+ utilities.verifyInnerText(highlightImagePage.defaultLabel(), highlightColorProperties['default'].displayName);
92
+ utilities.verifyInnerText(highlightImagePage.defaultFillColorLabel(), 'Fill color');
93
+ utilities.verifyInnerText(highlightImagePage.defaultBorderColorLabel(), 'Border color');
94
+ utilities.verifyInnerText(highlightImagePage.defaultFillColorHexCodeLabel(), highlightColorProperties.default.colorProperties.fillColorHexValue);
95
+ utilities.verifyInnerText(highlightImagePage.defaultBorderColorHexCodeLabel(), highlightColorProperties.default.colorProperties.borderColorHexValue);
96
+ utilities.verifyInnerText(highlightImagePage.defaultFillColorOpacityLabel(), `${highlightColorProperties.default.colorProperties.fillColorOpacity}%`);
97
+ utilities.verifyInnerText(highlightImagePage.defaultBorderColorOpacityLabel(), `${highlightColorProperties.default.colorProperties.borderColorOpacity}%`);
98
+ utilities.verifyElementVisibilityState(highlightImagePage.defaultFillColorBlock(), 'visible');
99
+ highlightImagePage.steps.verifyDefaultFillColorBlockColor(highlightColorProperties.default.colorProperties.fillColorRgbaValue);
100
+ utilities.verifyElementVisibilityState(highlightImagePage.defaultBorderColorBlock(), 'visible');
101
+ highlightImagePage.steps.verifyDefaultBorderColorBlockColor(highlightColorProperties.default.colorProperties.borderColorRgbValue);
102
+ });
103
+
104
+ it(`\'Customize highlight properties\' accordion should have \'Hover\' section with ${highlightColorProperties['hover'].displayName} label, fill color label, border color label, hex colors and opacity with color blocks`, () => {
105
+ utilities.verifyInnerText(highlightImagePage.hoverLabel(), highlightColorProperties['hover'].displayName);
106
+ utilities.verifyInnerText(highlightImagePage.hoverFillColorLabel(), 'Fill color');
107
+ utilities.verifyInnerText(highlightImagePage.hoverBorderColorLabel(), 'Border color');
108
+ utilities.verifyInnerText(highlightImagePage.hoverFillColorHexCodeLabel(), highlightColorProperties.hover.colorProperties.fillColorHexValue);
109
+ utilities.verifyInnerText(highlightImagePage.hoverBorderColorHexCodeLabel(), highlightColorProperties.hover.colorProperties.borderColorHexValue);
110
+ utilities.verifyInnerText(highlightImagePage.hoverFillColorOpacityLabel(), `${highlightColorProperties.hover.colorProperties.fillColorOpacity}%`);
111
+ utilities.verifyInnerText(highlightImagePage.hoverBorderColorOpacityLabel(), `${highlightColorProperties.hover.colorProperties.borderColorOpacity}%`);
112
+ utilities.verifyElementVisibilityState(highlightImagePage.hoverFillColorBlock(), 'visible');
113
+ highlightImagePage.steps.verifyHoverFillColorBlockColor(highlightColorProperties.hover.colorProperties.fillColorRgbaValue);
114
+ utilities.verifyElementVisibilityState(highlightImagePage.hoverBorderColorBlock(), 'visible');
115
+ highlightImagePage.steps.verifyHoverBorderColorBlockColor(highlightColorProperties.hover.colorProperties.borderColorRgbValue);
116
+ });
117
+
118
+ it(`\'Customize highlight properties\' accordion should have \'Active\' section with ${highlightColorProperties['active'].displayName} label, fill color label, border color label, hex colors and opacity with color blocks`, () => {
119
+ utilities.verifyInnerText(highlightImagePage.activeLabel(), highlightColorProperties['active'].displayName);
120
+ utilities.verifyInnerText(highlightImagePage.activeFillColorLabel(), 'Fill color');
121
+ utilities.verifyInnerText(highlightImagePage.activeBorderColorLabel(), 'Border color');
122
+ utilities.verifyInnerText(highlightImagePage.activeFillColorHexCodeLabel(), highlightColorProperties.active.colorProperties.fillColorHexValue);
123
+ utilities.verifyInnerText(highlightImagePage.activeBorderColorHexCodeLabel(), highlightColorProperties.active.colorProperties.borderColorHexValue);
124
+ utilities.verifyInnerText(highlightImagePage.activeFillColorOpacityLabel(), `${highlightColorProperties.active.colorProperties.fillColorOpacity}%`);
125
+ utilities.verifyInnerText(highlightImagePage.activeBorderColorOpacityLabel(), `${highlightColorProperties.active.colorProperties.borderColorOpacity}%`);
126
+ utilities.verifyElementVisibilityState(highlightImagePage.activeFillColorBlock(), 'visible');
127
+ highlightImagePage.steps.verifyActiveFillColorBlockColor(highlightColorProperties.active.colorProperties.fillColorRgbaValue);
128
+ highlightImagePage.steps.verifyPatternAppliedOnActiveState();
129
+ utilities.verifyElementVisibilityState(highlightImagePage.activeBorderColorBlock(), 'visible');
130
+ highlightImagePage.steps.verifyActiveBorderColorBlockColor(highlightColorProperties.active.colorProperties.borderColorRgbValue);
131
+ });
132
+
133
+ it('\'Apply pattern on active state\' label and checkbox should be displayed and by default the checkbox should be checked', () => {
134
+ utilities.verifyInnerText(highlightImagePage.applyPatternOnActiveStateLabel(), 'Apply pattern on active state');
135
+ utilities.verifyElementVisibilityState(highlightImagePage.applyPatternOnActiveStateLabel(), 'visible');
136
+ highlightImagePage.steps.verifyApplyPatternOnActiveStateCheckboxIsChecked();
137
+ });
138
+
139
+ it('CSS of \'Customize highlight properties\' accordion', () => {
140
+ utilities.verifyCSS(highlightImagePage.customizeHighlightPropertiesLabel(), {
141
+ 'color': css.color.accordionLabel,
142
+ 'font-size': css.fontSize.default,
143
+ 'font-weight': css.fontWeight.bold
144
+ });
145
+ utilities.verifyCSS(highlightImagePage.customizeHighlightPropertiesPanel().find('svg'), {
146
+ 'fill': css.color.activeButtons
147
+ });
148
+ utilities.verifyCSS(highlightImagePage.customizeHighlightPropertiesTab(), {
149
+ 'color': css.color.secondaryBtnActive,
150
+ 'font-size': css.fontSize.default,
151
+ 'font-weight': css.fontWeight.bold
152
+ });
153
+ utilities.verifyCSS(highlightImagePage.highlightColorLabel(), {
154
+ 'color': css.color.sectionHeading,
155
+ 'font-size': css.fontSize.default,
156
+ 'font-weight': css.fontWeight.semibold
157
+ });
158
+ highlightImagePage.steps.verifyCSSOfApplyPatternOnActiveState();
159
+ highlightImagePage.steps.verifyHighlightColorDefaultContentCSS();
160
+ highlightImagePage.steps.verifyHighlightColorHoverContentCSS();
161
+ highlightImagePage.steps.verifyHighlightColorActiveContentCSS();
162
+ });
163
+
164
+
165
+ it('Accessibility of \'Customize highlight properties\' accordion', { tags: 'a11y' }, () => {
166
+ cy.checkAccessibility(highlightImagePage.customizeHighlightPropertiesPanel());
167
+ });
168
+ });
169
+
170
+ //Failing due to https://redmine.zeuslearning.com/issues/546130
171
+ describe('Customize highlight properties accordion: Global tab popup contents and functionality', () => {
172
+ abortEarlySetup();
173
+ before(() => {
174
+ cy.log('Navigating to Highlight image question type');
175
+ highlightImagePage.steps.navigateToCreateQuestion('highlight image');
176
+ cy.barsPreLoaderWait();
177
+ cy.log('Uploading an image');
178
+ uploadImageSectionComponent.steps.uploadFile('highlightImage.jpg');
179
+ uploadImageSectionComponent.steps.verifyUploadedImageInImagePopup();
180
+ uploadImageSectionComponent.steps.clickOnImagePopupOkButton();
181
+ highlightImagePage.steps.verifyImageUploadedInHighlightRegion();
182
+ highlightImagePage.steps.verifyImageUploadedInSetCorrectAnswerSection();
183
+ highlightImagePage.steps.expandCustomizeHighlightProperties();
184
+ });
185
+
186
+ it('When the user clicks on the color block, a color popup should be visible with a title \'Select color\',\'Color saturation\' and \'Color hue\' palette along with the color picker should be displayed, labels \'Selected color\', \'Hex\', \'Opacity\' along with the input field and \'Recommended colors\' label along with recommended color blocks - Red, Yellow, Green, Black should be displayed', () => {
187
+ highlightImagePage.steps.clickOnHighlightColorBlock('defaultFillColor');
188
+ colorPopupComponent.steps.verifyColorPopupIsDisplayed();
189
+ colorPopupComponent.steps.verifyColorPopupSelectColorTitle();
190
+ colorPopupComponent.steps.verifyColorSaturationPaletteAndPicker();
191
+ colorPopupComponent.steps.verifySaturationPaletteColor('rgb(189, 203, 255)');
192
+ colorPopupComponent.steps.verifyColorHuePaletteAndPicker();
193
+ colorPopupComponent.steps.verifyHuePaletteColor('rgb(0, 55, 255)');
194
+ colorPopupComponent.steps.verifySelectedColorLabelAndSelectedColorBlock();
195
+ colorPopupComponent.steps.verifyHexLabelAndInputField();
196
+ colorPopupComponent.steps.verifyOpacityLabelSliderAndInputField();
197
+ colorPopupComponent.steps.verifyRecommendedColorBlocksLabel();
198
+ colorPopupComponent.steps.verifyColorPopupCancelButton();
199
+ colorPopupComponent.steps.verifyColorPopupOkButton();
200
+ colorPopupComponent.steps.clickOnCancelButton();
201
+ });
202
+
203
+ it('When the user clicks on the default \'Fill color\' block, a color popup should be visible with pre-filled values of \'Selected color\', \'Hex code\' and \'Opacity\' and the user should able to change the selected color and opacity which should be displayed in the default \'Fill color\' block', () => {
204
+ highlightImagePage.steps.clickOnHighlightColorBlock('defaultFillColor');
205
+ colorPopupComponent.steps.verifyColorPopupIsDisplayed();
206
+ colorPopupComponent.steps.verifySelectedColorBlock(highlightColorProperties.default.colorProperties.fillColorRgbaValue);
207
+ colorPopupComponent.steps.verifyHexValue(highlightColorProperties.default.colorProperties.fillColorHexValue);
208
+ colorPopupComponent.steps.verifyOpacityInputFieldValue(highlightColorProperties.default.colorProperties.fillColorOpacity);
209
+ colorPopupComponent.steps.verifyOpacitySliderValue(highlightColorProperties.default.colorProperties.fillColorOpacity);
210
+ colorPopupComponent.steps.selectRecommendedColorBlock(0);
211
+ colorPopupComponent.steps.addInputToOpacityInputField(20);
212
+ colorPopupComponent.steps.clickOnOkButton();
213
+ highlightImagePage.steps.verifyDefaultFillColorBlockColor('rgba(229, 76, 25, 0.2)');
214
+ highlightImagePage.steps.verifyDefaultFillColorHexCodeLabel('#E54C19');
215
+ highlightImagePage.steps.verifyDefaultFillColorOpacityLabel('20%');
216
+ });
217
+
218
+ it('When the user clicks on the default \'Border color\' block, a color popup should be visible with pre-filled values of \'Selected color\', \'Hex code\' and \'Opacity\' and the user should able to change the selected color and opacity which should be displayed in the default \'Border color\' block', () => {
219
+ highlightImagePage.steps.clickOnHighlightColorBlock('defaultBorderColor');
220
+ colorPopupComponent.steps.verifyColorPopupIsDisplayed();
221
+ colorPopupComponent.steps.verifySelectedColorBlock(highlightColorProperties.default.colorProperties.borderColorRgbValue);
222
+ colorPopupComponent.steps.verifyHexValue(highlightColorProperties.default.colorProperties.borderColorHexValue);
223
+ colorPopupComponent.steps.verifyOpacityInputFieldValue(highlightColorProperties.default.colorProperties.borderColorOpacity);
224
+ colorPopupComponent.steps.verifyOpacitySliderValue(highlightColorProperties.default.colorProperties.borderColorOpacity);
225
+ colorPopupComponent.steps.selectRecommendedColorBlock(1);
226
+ colorPopupComponent.steps.addInputToOpacityInputField(30);
227
+ colorPopupComponent.steps.clickOnOkButton();
228
+ highlightImagePage.steps.verifyDefaultBorderColorBlockColor('rgba(255, 240, 25, 0.3)');
229
+ highlightImagePage.steps.verifyDefaultBorderColorHexCodeLabel('#FFF019');
230
+ highlightImagePage.steps.verifyDefaultBorderColorOpacityLabel('30%')
231
+ });
232
+
233
+ it('When the user clicks on the hover \'Fill color\' block, a color popup should be visible with pre-filled values of \'Selected color\', \'Hex code\' and \'Opacity\' and the user should able to change the selected color and opacity which should be displayed in the hover \'Fill color\' block', () => {
234
+ highlightImagePage.steps.clickOnHighlightColorBlock('hoverFillColor');
235
+ colorPopupComponent.steps.verifyColorPopupIsDisplayed();
236
+ colorPopupComponent.steps.verifySelectedColorBlock(highlightColorProperties.hover.colorProperties.fillColorRgbaValue);
237
+ colorPopupComponent.steps.verifyHexValue(highlightColorProperties.hover.colorProperties.fillColorHexValue);
238
+ colorPopupComponent.steps.verifyOpacityInputFieldValue(highlightColorProperties.hover.colorProperties.fillColorOpacity);
239
+ colorPopupComponent.steps.verifyOpacitySliderValue(highlightColorProperties.hover.colorProperties.fillColorOpacity);
240
+ colorPopupComponent.steps.selectRecommendedColorBlock(2);
241
+ colorPopupComponent.steps.addInputToOpacityInputField(60);
242
+ colorPopupComponent.steps.clickOnOkButton();
243
+ highlightImagePage.steps.verifyHoverFillColorBlockColor('rgba(9, 179, 33, 0.6)');
244
+ highlightImagePage.steps.verifyHoverFillColorHexCodeLabel('#09B321');
245
+ highlightImagePage.steps.verifyHoverFillColorOpacityLabel('60%')
246
+ });
247
+
248
+ it('When the user clicks on the hover \'Border color\' block, a color popup should be visible with pre-filled values of \'Selected color\', \'Hex code\' and \'Opacity\' and the user should able to change the selected color and opacity which should be displayed in the hover \'Border color\' block', () => {
249
+ highlightImagePage.steps.clickOnHighlightColorBlock('hoverBorderColor');
250
+ colorPopupComponent.steps.verifyColorPopupIsDisplayed();
251
+ colorPopupComponent.steps.verifySelectedColorBlock(highlightColorProperties.hover.colorProperties.borderColorRgbValue);
252
+ colorPopupComponent.steps.verifyHexValue(highlightColorProperties.hover.colorProperties.borderColorHexValue);
253
+ colorPopupComponent.steps.verifyOpacityInputFieldValue(highlightColorProperties.hover.colorProperties.borderColorOpacity);
254
+ colorPopupComponent.steps.verifyOpacitySliderValue(highlightColorProperties.hover.colorProperties.borderColorOpacity);
255
+ colorPopupComponent.steps.selectRecommendedColorBlock(3);
256
+ colorPopupComponent.steps.addInputToOpacityInputField(90);
257
+ colorPopupComponent.steps.clickOnOkButton();
258
+ highlightImagePage.steps.verifyHoverBorderColorBlockColor('rgba(0, 0, 0, 0.9)');
259
+ highlightImagePage.steps.verifyHoverBorderColorHexCodeLabel('#000000');
260
+ highlightImagePage.steps.verifyHoverBorderColorOpacityLabel('90%')
261
+ });
262
+
263
+ it('When the user clicks on the active \'Fill color\' block, a color popup should be visible with pre-filled values of \'Selected color\', \'Hex code\' and \'Opacity\' and the user should able to change the selected color and opacity which should be displayed in the active \'Fill color\' block', () => {
264
+ highlightImagePage.steps.clickOnHighlightColorBlock('activeFillColor');
265
+ colorPopupComponent.steps.verifyColorPopupIsDisplayed();
266
+ colorPopupComponent.steps.verifySelectedColorBlock(highlightColorProperties.active.colorProperties.fillColorRgbaValue);
267
+ colorPopupComponent.steps.verifyHexValue(highlightColorProperties.active.colorProperties.fillColorHexValue);
268
+ colorPopupComponent.steps.verifyOpacityInputFieldValue(highlightColorProperties.active.colorProperties.fillColorOpacity);
269
+ colorPopupComponent.steps.verifyOpacitySliderValue(highlightColorProperties.active.colorProperties.fillColorOpacity);
270
+ colorPopupComponent.steps.selectRecommendedColorBlock(1);
271
+ colorPopupComponent.steps.addInputToOpacityInputField(10);
272
+ colorPopupComponent.steps.clickOnOkButton();
273
+ highlightImagePage.steps.verifyActiveFillColorBlockColor('rgba(255, 240, 25, 0.1)');
274
+ highlightImagePage.steps.verifyActiveFillColorHexCodeLabel('#FFF019');
275
+ highlightImagePage.steps.verifyActiveFillColorOpacityLabel('10%')
276
+ });
277
+
278
+ it('When the user clicks on the active \'Border color\' block, a color popup should be visible with pre-filled values of \'Selected color\', \'Hex code\' and \'Opacity\' and the user should able to change the selected color and opacity which should be displayed in the active \'Border color\' block', () => {
279
+ highlightImagePage.steps.clickOnHighlightColorBlock('activeBorderColor');
280
+ colorPopupComponent.steps.verifyColorPopupIsDisplayed();
281
+ colorPopupComponent.steps.verifySelectedColorBlock(highlightColorProperties.active.colorProperties.borderColorRgbValue);
282
+ colorPopupComponent.steps.verifyHexValue(highlightColorProperties.active.colorProperties.borderColorHexValue);
283
+ colorPopupComponent.steps.verifyOpacityInputFieldValue(highlightColorProperties.active.colorProperties.borderColorOpacity);
284
+ colorPopupComponent.steps.verifyOpacitySliderValue(highlightColorProperties.active.colorProperties.borderColorOpacity);
285
+ colorPopupComponent.steps.selectRecommendedColorBlock(2);
286
+ colorPopupComponent.steps.addInputToOpacityInputField(80);
287
+ colorPopupComponent.steps.clickOnOkButton();
288
+ highlightImagePage.steps.verifyActiveBorderColorBlockColor('rgba(9, 179, 33, 0.8)');
289
+ highlightImagePage.steps.verifyActiveBorderColorHexCodeLabel('#09B321');
290
+ highlightImagePage.steps.verifyActiveBorderColorOpacityLabel('80%')
291
+ });
292
+ });
293
+
294
+ describe('Customize highlight properties accordion: Option tab default contents', () => {
295
+ abortEarlySetup();
296
+ before(() => {
297
+ cy.log('Navigating to Highlight image question type');
298
+ highlightImagePage.steps.navigateToCreateQuestion('highlight image');
299
+ cy.barsPreLoaderWait();
300
+ cy.log('Uploading an image');
301
+ uploadImageSectionComponent.steps.uploadFile('highlightImage.jpg');
302
+ uploadImageSectionComponent.steps.verifyUploadedImageInImagePopup();
303
+ uploadImageSectionComponent.steps.clickOnImagePopupOkButton();
304
+ highlightImagePage.steps.verifyImageUploadedInHighlightRegion();
305
+ highlightImagePage.steps.verifyImageUploadedInSetCorrectAnswerSection();
306
+ highlightImagePage.steps.expandCustomizeHighlightProperties();
307
+ });
308
+
309
+ it('When the user has not highlighted any region then, \'Option 1\' tab should not be displayed in \'Customize highlight properties\' accordion', () => {
310
+ highlightImagePage.steps.verifyCountOfCustomizePropertiesTab(1);
311
+ utilities.verifyInnerText(highlightImagePage.customizeHighlightPropertiesTab(), 'Global');
312
+ });
313
+
314
+ it('When the user highlights a region then \'Option 1\' tab should be displayed in \'Customize highlight properties\' and by default it should be in inactive state', () => {
315
+ highlightImagePage.steps.highlightRegionInImage(flowerHighlightRegion);
316
+ highlightImagePage.steps.verifyHighlightRegionsInSetCorrectAnswerSection(0, flowerHighlightRegion);
317
+ highlightImagePage.steps.verifyCountOfCustomizePropertiesTab(2);
318
+ highlightImagePage.steps.verifyOptionTabIsDisplayed(1);
319
+ highlightImagePage.steps.verifyInactiveStateOfCustomizeHighlightPropertiesTab(1);
320
+ });
321
+
322
+ it('When the user highlights another region then a new tab should be added with the name \'Option 2\' in \'Customize highlight properties\' section', () => {
323
+ highlightImagePage.steps.highlightRegionInImage(leafHighlightRegion);
324
+ highlightImagePage.steps.verifyHighlightRegionsInSetCorrectAnswerSection(1, leafHighlightRegion);
325
+ highlightImagePage.steps.verifyCountOfCustomizePropertiesTab(3);
326
+ highlightImagePage.steps.verifyOptionTabIsDisplayed(2);
327
+ });
328
+
329
+ it('When the user deletes the first highlight region then \'Option 1\' tab should be removed and the name of the option tabs should get updated accordingly in \'Customize highlight properties\' section', () => {
330
+ highlightImagePage.steps.eraseAHighlightRegion([flowerHighlightRegion[0]]);
331
+ highlightImagePage.steps.verifyCountOfCustomizePropertiesTab(2);
332
+ highlightImagePage.steps.verifyOptionTabIsDisplayed(1);
333
+ });
334
+
335
+ it('When the user switches to \'Option 1\' tab, it should be displayed in active state and \'Global\' tab should be in inactive state', () => {
336
+ highlightImagePage.steps.navigateToOptionTab(1);
337
+ highlightImagePage.steps.verifyActiveStateOfCustomizeHighlightPropertiesTab(1);
338
+ highlightImagePage.steps.verifyInactiveStateOfCustomizeHighlightPropertiesTab(0);
339
+ });
340
+
341
+ //Failing due to https://redmine.zeuslearning.com/issues/546464
342
+ it('\'Label\' title should be displayed', () => {
343
+ utilities.verifyInnerText(highlightImagePage.labelTitle(), 'Label');
344
+ utilities.verifyElementVisibilityState(highlightImagePage.labelTitle(), 'visible');
345
+ });
346
+
347
+ //Failing due to https://redmine.zeuslearning.com/issues/548722
348
+ it('\'Option label\' and \'ARIA label\' label and input field should be displayed and by default the input fields should be empty', () => {
349
+ utilities.verifyInnerText(highlightImagePage.optionLabelInputFieldLabel(), 'Option label');
350
+ utilities.verifyElementVisibilityState(highlightImagePage.optionLabelInputFieldLabel(), 'visible');
351
+ utilities.verifyElementVisibilityState(highlightImagePage.optionLabelInputField(), 'visible');
352
+ utilities.verifyInnerText(highlightImagePage.optionLabelInputField(), '')
353
+ utilities.verifyInnerText(highlightImagePage.ariaLabelInputFieldLabel(), 'ARIA label');
354
+ utilities.verifyElementVisibilityState(highlightImagePage.ariaLabelInputFieldLabel(), 'visible');
355
+ utilities.verifyElementVisibilityState(highlightImagePage.ariaLabelInputField(), 'visible');
356
+ utilities.verifyInnerText(highlightImagePage.ariaLabelInputField(), '')
357
+ });
358
+
359
+ it('User should be able to enter the text in \'Option label\' and \'ARIA label\' input field', () => {
360
+ highlightImagePage.steps.addAndVerifyTextInOptionLabelInputField('top flower');
361
+ highlightImagePage.steps.addAndVerifyTextInAriaLabelInputField('top flower is highlighted');
362
+ });
363
+
364
+ it('\'Reset to global color\' button should be displayed and by default it should be disabled', () => {
365
+ utilities.verifyInnerText(highlightImagePage.resetToGlobalColorButton(), 'Reset to global color');
366
+ utilities.verifyElementVisibilityState(highlightImagePage.resetToGlobalColorButton(), 'visible');
367
+ highlightImagePage.steps.verifyResetToGlobalColorButtonDisabled();
368
+ });
369
+
370
+ it('\'Highlight color\' label should be displayed', () => {
371
+ highlightImagePage.steps.verifyHighlightColorLabelIsDisplayed();
372
+ });
373
+
374
+ //Failing due to https://redmine.zeuslearning.com/issues/546130
375
+ it(`\'Customize highlight properties\' accordion should have \'Default\' section with ${highlightColorProperties['default'].displayName} label, fill color label, border color label, hex colors and opacity with color blocks`, () => {
376
+ utilities.verifyInnerText(highlightImagePage.defaultLabel(), highlightColorProperties['default'].displayName);
377
+ utilities.verifyInnerText(highlightImagePage.defaultFillColorLabel(), 'Fill color');
378
+ utilities.verifyInnerText(highlightImagePage.defaultBorderColorLabel(), 'Border color');
379
+ utilities.verifyInnerText(highlightImagePage.defaultFillColorHexCodeLabel(), highlightColorProperties.default.colorProperties.fillColorHexValue);
380
+ utilities.verifyInnerText(highlightImagePage.defaultBorderColorHexCodeLabel(), highlightColorProperties.default.colorProperties.borderColorHexValue);
381
+ utilities.verifyInnerText(highlightImagePage.defaultFillColorOpacityLabel(), `${highlightColorProperties.default.colorProperties.fillColorOpacity}%`);
382
+ utilities.verifyInnerText(highlightImagePage.defaultBorderColorOpacityLabel(), `${highlightColorProperties.default.colorProperties.borderColorOpacity}%`);
383
+ utilities.verifyElementVisibilityState(highlightImagePage.defaultFillColorBlock(), 'visible');
384
+ highlightImagePage.steps.verifyDefaultFillColorBlockColor(highlightColorProperties.default.colorProperties.fillColorRgbaValue);
385
+ utilities.verifyElementVisibilityState(highlightImagePage.defaultBorderColorBlock(), 'visible');
386
+ highlightImagePage.steps.verifyDefaultBorderColorBlockColor(highlightColorProperties.default.colorProperties.borderColorRgbValue);
387
+ });
388
+
389
+ //Failing due to https://redmine.zeuslearning.com/issues/546130
390
+ it(`\'Customize highlight properties\' accordion should have \'Hover\' section with ${highlightColorProperties['hover'].displayName} label, fill color label, border color label, hex colors and opacity with color blocks`, () => {
391
+ utilities.verifyInnerText(highlightImagePage.hoverLabel(), highlightColorProperties['hover'].displayName);
392
+ utilities.verifyInnerText(highlightImagePage.hoverFillColorLabel(), 'Fill color');
393
+ utilities.verifyInnerText(highlightImagePage.hoverBorderColorLabel(), 'Border color');
394
+ utilities.verifyInnerText(highlightImagePage.hoverFillColorHexCodeLabel(), highlightColorProperties.hover.colorProperties.fillColorHexValue);
395
+ utilities.verifyInnerText(highlightImagePage.hoverBorderColorHexCodeLabel(), highlightColorProperties.hover.colorProperties.borderColorHexValue);
396
+ utilities.verifyInnerText(highlightImagePage.hoverFillColorOpacityLabel(), `${highlightColorProperties.hover.colorProperties.fillColorOpacity}%`);
397
+ utilities.verifyInnerText(highlightImagePage.hoverBorderColorOpacityLabel(), `${highlightColorProperties.hover.colorProperties.borderColorOpacity}%`);
398
+ utilities.verifyElementVisibilityState(highlightImagePage.hoverFillColorBlock(), 'visible');
399
+ highlightImagePage.steps.verifyHoverFillColorBlockColor(highlightColorProperties.hover.colorProperties.fillColorRgbaValue);
400
+ utilities.verifyElementVisibilityState(highlightImagePage.hoverBorderColorBlock(), 'visible');
401
+ highlightImagePage.steps.verifyHoverBorderColorBlockColor(highlightColorProperties.hover.colorProperties.borderColorRgbValue);
402
+ });
403
+
404
+ //Failing due to https://redmine.zeuslearning.com/issues/546130
405
+ it(`\'Customize highlight properties\' accordion should have \'Active\' section with ${highlightColorProperties['active'].displayName} label, fill color label, border color label, hex colors and opacity with color blocks`, () => {
406
+ utilities.verifyInnerText(highlightImagePage.activeLabel(), highlightColorProperties['active'].displayName);
407
+ utilities.verifyInnerText(highlightImagePage.activeFillColorLabel(), 'Fill color');
408
+ utilities.verifyInnerText(highlightImagePage.activeBorderColorLabel(), 'Border color');
409
+ utilities.verifyInnerText(highlightImagePage.activeFillColorHexCodeLabel(), highlightColorProperties.active.colorProperties.fillColorHexValue);
410
+ utilities.verifyInnerText(highlightImagePage.activeBorderColorHexCodeLabel(), highlightColorProperties.active.colorProperties.borderColorHexValue);
411
+ utilities.verifyInnerText(highlightImagePage.activeFillColorOpacityLabel(), `${highlightColorProperties.active.colorProperties.fillColorOpacity}%`);
412
+ utilities.verifyInnerText(highlightImagePage.activeBorderColorOpacityLabel(), `${highlightColorProperties.active.colorProperties.borderColorOpacity}%`);
413
+ utilities.verifyElementVisibilityState(highlightImagePage.activeFillColorBlock(), 'visible');
414
+ highlightImagePage.steps.verifyActiveFillColorBlockColor(highlightColorProperties.active.colorProperties.fillColorRgbaValue);
415
+ highlightImagePage.steps.verifyPatternAppliedOnActiveState();
416
+ utilities.verifyElementVisibilityState(highlightImagePage.activeBorderColorBlock(), 'visible');
417
+ highlightImagePage.steps.verifyActiveBorderColorBlockColor(highlightColorProperties.active.colorProperties.borderColorRgbValue);
418
+ });
419
+
420
+ it('\'Apply pattern on active state\' label and checkbox should be displayed and by default the checkbox should be checked', () => {
421
+ utilities.verifyInnerText(highlightImagePage.applyPatternOnActiveStateLabel(), 'Apply pattern on active state');
422
+ utilities.verifyElementVisibilityState(highlightImagePage.applyPatternOnActiveStateLabel(), 'visible');
423
+ highlightImagePage.steps.verifyApplyPatternOnActiveStateCheckboxIsChecked();
424
+ });
425
+
426
+ it('CSS of option tab contents', { tags: 'css' }, () => {
427
+ const sectionlabel = [highlightImagePage.labelTitle, highlightImagePage.highlightColorLabel];
428
+ for (let index = 0; index < sectionlabel.length; index++) {
429
+ utilities.verifyCSS(sectionlabel[index](), {
430
+ 'color': css.color.sectionHeading,
431
+ 'font-size': css.fontSize.default,
432
+ 'font-weight': css.fontWeight.semibold
433
+ });
434
+ };
435
+ const labels = [highlightImagePage.optionLabelInputFieldLabel, highlightImagePage.ariaLabelInputFieldLabel];
436
+ for (let index = 0; index < labels.length; index++) {
437
+ utilities.verifyCSS(labels[index](), {
438
+ 'color': css.color.labels,
439
+ 'font-size': css.fontSize.normal,
440
+ 'font-weight': css.fontWeight.semibold
441
+ });
442
+ };
443
+ const inputFields = [highlightImagePage.optionLabelInputField, highlightImagePage.ariaLabelInputField];
444
+ for (let index = 0; index < inputFields.length; index++) {
445
+ utilities.verifyCSS(inputFields[index](), {
446
+ 'color': css.color.text,
447
+ 'font-size': css.fontSize.default,
448
+ 'font-weight': css.fontWeight.regular
449
+ });
450
+ };
451
+ utilities.verifyCSS(highlightImagePage.resetToGlobalColorButton(), {
452
+ 'color': css.color.secondaryBtnDisabled,
453
+ 'font-size': css.fontSize.default,
454
+ 'font-weight': css.fontWeight.regular
455
+ });
456
+ highlightImagePage.steps.verifyCSSOfApplyPatternOnActiveState();
457
+ highlightImagePage.steps.verifyHighlightColorDefaultContentCSS();
458
+ highlightImagePage.steps.verifyHighlightColorHoverContentCSS();
459
+ highlightImagePage.steps.verifyHighlightColorActiveContentCSS();
460
+ });
461
+
462
+ it('Accessiblity of option tab', { tags: 'a11y' }, () => {
463
+ cy.checkAccessibility(highlightImagePage.customizeHighlightPropertiesTab().parents('.MuiCollapse-wrapper'));
464
+ });
465
+ });
466
+
467
+ //Failing due to https://redmine.zeuslearning.com/issues/546130
468
+ describe('Customize highlight properties accordion: Global and option tab functionality of default state in set correct answer and preview tab', () => {
469
+ abortEarlySetup();
470
+ before(() => {
471
+ cy.log('Navigating to highlight image question type');
472
+ highlightImagePage.steps.navigateToCreateQuestion('highlight image');
473
+ cy.barsPreLoaderWait();
474
+ cy.log('Uploading an image');
475
+ uploadImageSectionComponent.steps.uploadFile('highlightImage.jpg');
476
+ uploadImageSectionComponent.steps.verifyUploadedImageInImagePopup();
477
+ uploadImageSectionComponent.steps.clickOnImagePopupOkButton();
478
+ utilities.verifyElementVisibilityState(uploadImageSectionComponent.uploadImagePopup(), 'notExist');
479
+ highlightImagePage.steps.verifyImageUploadedInHighlightRegion();
480
+ highlightImagePage.steps.verifyImageUploadedInSetCorrectAnswerSection();
481
+ highlightImagePage.steps.highlightRegionInImage(flowerHighlightRegion);
482
+ highlightImagePage.steps.verifyHighlightRegionsInSetCorrectAnswerSection(0, flowerHighlightRegion);
483
+ highlightImagePage.steps.highlightRegionInImage(leafHighlightRegion);
484
+ highlightImagePage.steps.verifyHighlightRegionsInSetCorrectAnswerSection(1, leafHighlightRegion);
485
+ highlightImagePage.steps.expandCustomizeHighlightProperties();
486
+ });
487
+
488
+ 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', () => {
489
+ highlightImagePage.steps.verifyDefaultFillColorOfHighlightRegionInSetCorrectAnswerSection(0, 'rgb(186, 201, 255)', '0.4');
490
+ highlightImagePage.steps.verifyDefaultBorderColorOfHighlightRegionInSetCorrectAnswerSection(0, 'rgb(82, 0, 255)', '1');
491
+ highlightImagePage.steps.verifyDefaultFillColorOfHighlightRegionInSetCorrectAnswerSection(1, 'rgb(186, 201, 255)', '0.4');
492
+ highlightImagePage.steps.verifyDefaultBorderColorOfHighlightRegionInSetCorrectAnswerSection(1, 'rgb(82, 0, 255)', '1');
493
+ });
494
+
495
+ 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\'', () => {
496
+ cy.log('Switching to preview Tab');
497
+ highlightImagePage.steps.switchToPreviewTab();
498
+ highlightImagePage.steps.verifyDefaultFillColorOfHighlightRegionInPreviewTab(0, 'rgb(186, 201, 255)', '0.4');
499
+ highlightImagePage.steps.verifyDefaultBorderColorOfHighlightRegionInPreviewTab(0, 'rgb(82, 0, 255)', '1');
500
+ highlightImagePage.steps.verifyDefaultFillColorOfHighlightRegionInPreviewTab(1, 'rgb(186, 201, 255)', '0.4');
501
+ highlightImagePage.steps.verifyDefaultBorderColorOfHighlightRegionInPreviewTab(1, 'rgb(82, 0, 255)', '1');
502
+ });
503
+
504
+ 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', () => {
505
+ cy.log('Switching to edit Tab');
506
+ highlightImagePage.steps.switchToEditTab();
507
+ highlightImagePage.steps.navigateToOptionTab(1);
508
+ highlightImagePage.steps.clickOnHighlightColorBlock('defaultFillColor');
509
+ colorPopupComponent.steps.selectRecommendedColorBlock(0);
510
+ colorPopupComponent.steps.addInputToOpacityInputField('50');
511
+ colorPopupComponent.steps.clickOnOkButton();
512
+ highlightImagePage.steps.clickOnHighlightColorBlock('defaultBorderColor');
513
+ colorPopupComponent.steps.selectRecommendedColorBlock(1);
514
+ colorPopupComponent.steps.addInputToOpacityInputField('50');
515
+ colorPopupComponent.steps.clickOnOkButton();
516
+ cy.log("Verifying default state");
517
+ highlightImagePage.steps.verifyDefaultFillColorOfHighlightRegionInSetCorrectAnswerSection(0, 'rgb(229, 76, 25)', '0.5');
518
+ highlightImagePage.steps.verifyDefaultBorderColorOfHighlightRegionInSetCorrectAnswerSection(0, 'rgb(255, 240, 25)', '0.5');
519
+ highlightImagePage.steps.verifyDefaultFillColorOfHighlightRegionInSetCorrectAnswerSection(1, 'rgb(186, 201, 255)', '0.4');
520
+ highlightImagePage.steps.verifyDefaultBorderColorOfHighlightRegionInSetCorrectAnswerSection(1, 'rgb(82, 0, 255)', '1');
521
+ cy.log("Verifying hover state");
522
+ highlightImagePage.steps.verifyHoverFillColorOfHighlightRegionInSetCorrectAnswerSection(0, 'rgb(186, 201, 255)', '0.4');
523
+ highlightImagePage.steps.verifyHoverBorderColorOfHighlightRegionInSetCorrectAnswerSection(0, 'rgb(66, 0, 204)', '1');
524
+ highlightImagePage.steps.verifyHoverFillColorOfHighlightRegionInSetCorrectAnswerSection(1, 'rgb(186, 201, 255)', '0.4');
525
+ highlightImagePage.steps.verifyHoverBorderColorOfHighlightRegionInSetCorrectAnswerSection(1, 'rgb(66, 0, 204)', '1');
526
+ cy.log("Verifying active state");
527
+ highlightImagePage.steps.verifyActiveFillColorOfHighlightRegionInSetCorrectAnswerSection(0, 'rgb(107, 139, 255)', '0.7');
528
+ highlightImagePage.steps.verifyActiveBorderColorOfHighlightRegionInSetCorrectAnswerSection(0, 'rgb(41, 0, 128)', '1');
529
+ highlightImagePage.steps.verifyActiveFillColorOfHighlightRegionInSetCorrectAnswerSection(1, 'rgb(107, 139, 255)', '0.7');
530
+ highlightImagePage.steps.verifyActiveBorderColorOfHighlightRegionInSetCorrectAnswerSection(1, 'rgb(41, 0, 128)', '1');
531
+ });
532
+
533
+ 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\'', () => {
534
+ cy.log('Switching to preview Tab');
535
+ highlightImagePage.steps.switchToPreviewTab();
536
+ cy.log("Verifying default state");
537
+ highlightImagePage.steps.verifyDefaultFillColorOfHighlightRegionInPreviewTab(0, 'rgb(229, 76, 25)', '0.5');
538
+ highlightImagePage.steps.verifyDefaultBorderColorOfHighlightRegionInPreviewTab(0, 'rgb(255, 240, 25)', '0.5');
539
+ highlightImagePage.steps.verifyDefaultFillColorOfHighlightRegionInPreviewTab(1, 'rgb(186, 201, 255)', '0.4');
540
+ highlightImagePage.steps.verifyDefaultBorderColorOfHighlightRegionInPreviewTab(1, 'rgb(82, 0, 255)', '1');
541
+ cy.log("Verifying hover state");
542
+ highlightImagePage.steps.verifyHoverFillColorOfHighlightRegionInPreviewTab(0, 'rgb(186, 201, 255)', '0.4');
543
+ highlightImagePage.steps.verifyHoverBorderColorOfHighlightRegionInPreviewTab(0, 'rgb(66, 0, 204)', '1');
544
+ highlightImagePage.steps.verifyHoverFillColorOfHighlightRegionInPreviewTab(1, 'rgb(186, 201, 255)', '0.4');
545
+ highlightImagePage.steps.verifyHoverBorderColorOfHighlightRegionInPreviewTab(1, 'rgb(66, 0, 204)', '1');
546
+ cy.log("Verifying active state");
547
+ highlightImagePage.steps.verifyActiveFillColorOfHighlightRegionInPreviewTab(0, 'rgb(107, 139, 255)', '0.7');
548
+ highlightImagePage.steps.verifyActiveBorderColorOfHighlightRegionInPreviewTab(0, 'rgb(41, 0, 128)', '1');
549
+ highlightImagePage.steps.verifyActiveFillColorOfHighlightRegionInPreviewTab(1, 'rgb(107, 139, 255)', '0.7');
550
+ highlightImagePage.steps.verifyActiveBorderColorOfHighlightRegionInPreviewTab(1, 'rgb(41, 0, 128)', '1');
551
+ });
552
+
553
+ 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', () => {
554
+ cy.log('Switching to edit Tab');
555
+ highlightImagePage.steps.switchToEditTab();
556
+ highlightImagePage.steps.navigateToGlobalTab();
557
+ highlightImagePage.steps.clickOnHighlightColorBlock('defaultFillColor');
558
+ colorPopupComponent.steps.selectRecommendedColorBlock(3);
559
+ colorPopupComponent.steps.addInputToOpacityInputField(70);
560
+ colorPopupComponent.steps.clickOnOkButton();
561
+ highlightImagePage.steps.clickOnHighlightColorBlock('defaultBorderColor');
562
+ colorPopupComponent.steps.selectRecommendedColorBlock(2);
563
+ colorPopupComponent.steps.addInputToOpacityInputField(70);
564
+ colorPopupComponent.steps.clickOnOkButton();
565
+ highlightImagePage.steps.verifyDefaultFillColorOfHighlightRegionInSetCorrectAnswerSection(1, 'rgb(0, 0, 0)', '0.7');
566
+ highlightImagePage.steps.verifyDefaultBorderColorOfHighlightRegionInSetCorrectAnswerSection(1, 'rgb(9, 179, 33)', '0.7');
567
+ highlightImagePage.steps.verifyDefaultFillColorOfHighlightRegionInSetCorrectAnswerSection(0, 'rgb(229, 76, 25)', '0.5');
568
+ highlightImagePage.steps.verifyDefaultBorderColorOfHighlightRegionInSetCorrectAnswerSection(0, 'rgb(255, 240, 25)', '0.5');
569
+ });
570
+
571
+ 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\'', () => {
572
+ cy.log('Switching to preview Tab');
573
+ highlightImagePage.steps.switchToPreviewTab();
574
+ highlightImagePage.steps.verifyDefaultFillColorOfHighlightRegionInPreviewTab(1, 'rgb(0, 0, 0)', '0.7');
575
+ highlightImagePage.steps.verifyDefaultBorderColorOfHighlightRegionInPreviewTab(1, 'rgb(9, 179, 33)', '0.7');
576
+ highlightImagePage.steps.verifyDefaultFillColorOfHighlightRegionInPreviewTab(0, 'rgb(229, 76, 25)', '0.5');
577
+ highlightImagePage.steps.verifyDefaultBorderColorOfHighlightRegionInPreviewTab(0, 'rgb(255, 240, 25)', '0.5');
578
+ });
579
+ });
580
+
581
+ //Failing due to https://redmine.zeuslearning.com/issues/546130
582
+ describe('Customize highlight properties accordion: Global and option tab functionality of hover state in set correct answer and preview tab', () => {
583
+ abortEarlySetup();
584
+ before(() => {
585
+ cy.log('Navigating to highlight image question type');
586
+ highlightImagePage.steps.navigateToCreateQuestion('highlight image');
587
+ cy.barsPreLoaderWait();
588
+ cy.log('Uploading an image');
589
+ uploadImageSectionComponent.steps.uploadFile('highlightImage.jpg');
590
+ uploadImageSectionComponent.steps.verifyUploadedImageInImagePopup();
591
+ uploadImageSectionComponent.steps.clickOnImagePopupOkButton();
592
+ utilities.verifyElementVisibilityState(uploadImageSectionComponent.uploadImagePopup(), 'notExist');
593
+ highlightImagePage.steps.verifyImageUploadedInHighlightRegion();
594
+ highlightImagePage.steps.verifyImageUploadedInSetCorrectAnswerSection();
595
+ highlightImagePage.steps.highlightRegionInImage(flowerHighlightRegion);
596
+ highlightImagePage.steps.verifyHighlightRegionsInSetCorrectAnswerSection(0, flowerHighlightRegion);
597
+ highlightImagePage.steps.highlightRegionInImage(leafHighlightRegion);
598
+ highlightImagePage.steps.verifyHighlightRegionsInSetCorrectAnswerSection(1, leafHighlightRegion);
599
+ highlightImagePage.steps.expandCustomizeHighlightProperties();
600
+ });
601
+
602
+ 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', () => {
603
+ highlightImagePage.steps.verifyHoverFillColorOfHighlightRegionInSetCorrectAnswerSection(0, 'rgb(186, 201, 255)', '0.4');
604
+ highlightImagePage.steps.verifyHoverBorderColorOfHighlightRegionInSetCorrectAnswerSection(0, 'rgb(66, 0, 204)', '1');
605
+ highlightImagePage.steps.verifyHoverFillColorOfHighlightRegionInSetCorrectAnswerSection(1, 'rgb(186, 201, 255)', '0.4');
606
+ highlightImagePage.steps.verifyHoverBorderColorOfHighlightRegionInSetCorrectAnswerSection(1, 'rgb(66, 0, 204)', '1');
607
+ });
608
+
609
+ 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\'', () => {
610
+ highlightImagePage.steps.switchToPreviewTab();
611
+ highlightImagePage.steps.verifyHoverFillColorOfHighlightRegionInPreviewTab(0, 'rgb(186, 201, 255)', '0.4');
612
+ highlightImagePage.steps.verifyHoverBorderColorOfHighlightRegionInPreviewTab(0, 'rgb(66, 0, 204)', '1');
613
+ highlightImagePage.steps.verifyHoverFillColorOfHighlightRegionInPreviewTab(1, 'rgb(186, 201, 255)', '0.4');
614
+ highlightImagePage.steps.verifyHoverBorderColorOfHighlightRegionInPreviewTab(1, 'rgb(66, 0, 204)', '1');
615
+ });
616
+
617
+ 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', () => {
618
+ cy.log('Switching to edit Tab');
619
+ highlightImagePage.steps.switchToEditTab();
620
+ highlightImagePage.steps.navigateToOptionTab(1);
621
+ highlightImagePage.steps.clickOnHighlightColorBlock('hoverFillColor');
622
+ colorPopupComponent.steps.selectRecommendedColorBlock(2);
623
+ colorPopupComponent.steps.addInputToOpacityInputField(70);
624
+ colorPopupComponent.steps.clickOnOkButton();
625
+ highlightImagePage.steps.clickOnHighlightColorBlock('hoverBorderColor');
626
+ colorPopupComponent.steps.selectRecommendedColorBlock(3);
627
+ colorPopupComponent.steps.addInputToOpacityInputField(70);
628
+ colorPopupComponent.steps.clickOnOkButton();
629
+ cy.log("Verifying hover state");
630
+ highlightImagePage.steps.verifyHoverFillColorOfHighlightRegionInSetCorrectAnswerSection(0, 'rgb(9, 179, 33)', '0.7');
631
+ highlightImagePage.steps.verifyHoverBorderColorOfHighlightRegionInSetCorrectAnswerSection(0, 'rgb(0, 0, 0)', '0.7');
632
+ highlightImagePage.steps.verifyHoverFillColorOfHighlightRegionInSetCorrectAnswerSection(1, 'rgb(186, 201, 255)', '0.4');
633
+ highlightImagePage.steps.verifyHoverBorderColorOfHighlightRegionInSetCorrectAnswerSection(1, 'rgb(66, 0, 204)', '1');
634
+ cy.log("Verifying default state");
635
+ highlightImagePage.steps.verifyDefaultFillColorOfHighlightRegionInSetCorrectAnswerSection(0, 'rgb(186, 201, 255)', '0.4');
636
+ highlightImagePage.steps.verifyDefaultBorderColorOfHighlightRegionInSetCorrectAnswerSection(0, 'rgb(82, 0, 255)', '1');
637
+ highlightImagePage.steps.verifyDefaultFillColorOfHighlightRegionInSetCorrectAnswerSection(1, 'rgb(186, 201, 255)', '0.4');
638
+ highlightImagePage.steps.verifyDefaultBorderColorOfHighlightRegionInSetCorrectAnswerSection(1, 'rgb(82, 0, 255)', '1');
639
+ cy.log("Verifying active state");
640
+ highlightImagePage.steps.verifyActiveFillColorOfHighlightRegionInSetCorrectAnswerSection(0, 'rgb(107, 139, 255)', '0.7');
641
+ highlightImagePage.steps.verifyActiveBorderColorOfHighlightRegionInSetCorrectAnswerSection(0, 'rgb(41, 0, 128)', '1');
642
+ highlightImagePage.steps.verifyActiveFillColorOfHighlightRegionInSetCorrectAnswerSection(1, 'rgb(107, 139, 255)', '0.7');
643
+ highlightImagePage.steps.verifyActiveBorderColorOfHighlightRegionInSetCorrectAnswerSection(1, 'rgb(41, 0, 128)', '1');
644
+ });
645
+
646
+ 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', () => {
647
+ cy.log('Switching to preview Tab');
648
+ highlightImagePage.steps.switchToPreviewTab();
649
+ cy.log("Verifying hover state");
650
+ highlightImagePage.steps.verifyHoverFillColorOfHighlightRegionInPreviewTab(0, 'rgb(9, 179, 33)', '0.7');
651
+ highlightImagePage.steps.verifyHoverBorderColorOfHighlightRegionInPreviewTab(0, 'rgb(0, 0, 0)', '0.7');
652
+ highlightImagePage.steps.verifyHoverFillColorOfHighlightRegionInPreviewTab(1, 'rgb(186, 201, 255)', '0.4');
653
+ highlightImagePage.steps.verifyHoverBorderColorOfHighlightRegionInPreviewTab(1, 'rgb(66, 0, 204)', '1');
654
+ cy.log("Verifying default state");
655
+ highlightImagePage.steps.verifyDefaultFillColorOfHighlightRegionInPreviewTab(0, 'rgb(186, 201, 255)', '0.4');
656
+ highlightImagePage.steps.verifyDefaultBorderColorOfHighlightRegionInPreviewTab(0, 'rgb(82, 0, 255)', '1');
657
+ highlightImagePage.steps.verifyDefaultFillColorOfHighlightRegionInPreviewTab(1, 'rgb(186, 201, 255)', '0.4');
658
+ highlightImagePage.steps.verifyDefaultBorderColorOfHighlightRegionInPreviewTab(1, 'rgb(82, 0, 255)', '1');
659
+ cy.log("Verifying active state");
660
+ highlightImagePage.steps.verifyActiveFillColorOfHighlightRegionInPreviewTab(0, 'rgb(107, 139, 255)', '0.7');
661
+ highlightImagePage.steps.verifyActiveBorderColorOfHighlightRegionInPreviewTab(0, 'rgb(41, 0, 128)', '1');
662
+ highlightImagePage.steps.verifyActiveFillColorOfHighlightRegionInPreviewTab(1, 'rgb(107, 139, 255)', '0.7');
663
+ highlightImagePage.steps.verifyActiveBorderColorOfHighlightRegionInPreviewTab(1, 'rgb(41, 0, 128)', '1');
664
+ });
665
+
666
+ 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', () => {
667
+ cy.log('Switching to edit Tab');
668
+ highlightImagePage.steps.switchToEditTab();
669
+ highlightImagePage.steps.navigateToGlobalTab();
670
+ highlightImagePage.steps.clickOnHighlightColorBlock('hoverFillColor');
671
+ colorPopupComponent.steps.selectRecommendedColorBlock(0);
672
+ colorPopupComponent.steps.addInputToOpacityInputField(30);
673
+ colorPopupComponent.steps.clickOnOkButton();
674
+ highlightImagePage.steps.clickOnHighlightColorBlock('hoverBorderColor');
675
+ colorPopupComponent.steps.selectRecommendedColorBlock(1);
676
+ colorPopupComponent.steps.addInputToOpacityInputField(30);
677
+ colorPopupComponent.steps.clickOnOkButton();
678
+ highlightImagePage.steps.verifyHoverFillColorOfHighlightRegionInSetCorrectAnswerSection(1, 'rgb(229, 76, 25)', '0.3');
679
+ highlightImagePage.steps.verifyHoverBorderColorOfHighlightRegionInSetCorrectAnswerSection(1, 'rgb(255, 240, 25)', '0.3');
680
+ highlightImagePage.steps.verifyHoverFillColorOfHighlightRegionInSetCorrectAnswerSection(0, 'rgb(9, 179, 33)', '0.7');
681
+ highlightImagePage.steps.verifyHoverBorderColorOfHighlightRegionInSetCorrectAnswerSection(0, 'rgb(0, 0, 0)', '0.7');
682
+ });
683
+
684
+ 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\'', () => {
685
+ cy.log('Switching to preview Tab');
686
+ highlightImagePage.steps.switchToPreviewTab();
687
+ highlightImagePage.steps.verifyHoverFillColorOfHighlightRegionInPreviewTab(1, 'rgb(229, 76, 25)', '0.3');
688
+ highlightImagePage.steps.verifyHoverBorderColorOfHighlightRegionInPreviewTab(1, 'rgb(255, 240, 25)', '0.3');
689
+ highlightImagePage.steps.verifyHoverFillColorOfHighlightRegionInPreviewTab(0, 'rgb(9, 179, 33)', '0.7');
690
+ highlightImagePage.steps.verifyHoverBorderColorOfHighlightRegionInPreviewTab(0, 'rgb(0, 0, 0)', '0.7');
691
+ });
692
+ });
693
+
694
+ //Failing due to https://redmine.zeuslearning.com/issues/546130
695
+ describe('Customize highlight properties accordion: Global and option tab functionality of active state in set correct answer and preview tab', () => {
696
+ abortEarlySetup();
697
+ before(() => {
698
+ cy.log('Navigating to highlight image question type');
699
+ highlightImagePage.steps.navigateToCreateQuestion('highlight image');
700
+ cy.barsPreLoaderWait();
701
+ cy.log('Uploading an image');
702
+ uploadImageSectionComponent.steps.uploadFile('highlightImage.jpg');
703
+ uploadImageSectionComponent.steps.verifyUploadedImageInImagePopup();
704
+ uploadImageSectionComponent.steps.clickOnImagePopupOkButton();
705
+ utilities.verifyElementVisibilityState(uploadImageSectionComponent.uploadImagePopup(), 'notExist');
706
+ highlightImagePage.steps.verifyImageUploadedInHighlightRegion();
707
+ highlightImagePage.steps.verifyImageUploadedInSetCorrectAnswerSection();
708
+ highlightImagePage.steps.highlightRegionInImage(flowerHighlightRegion);
709
+ highlightImagePage.steps.verifyHighlightRegionsInSetCorrectAnswerSection(0, flowerHighlightRegion);
710
+ highlightImagePage.steps.highlightRegionInImage(leafHighlightRegion);
711
+ highlightImagePage.steps.verifyHighlightRegionsInSetCorrectAnswerSection(1, leafHighlightRegion);
712
+ highlightImagePage.steps.expandCustomizeHighlightProperties();
713
+ });
714
+
715
+ 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', () => {
716
+ highlightImagePage.steps.verifyActiveFillColorOfHighlightRegionInSetCorrectAnswerSection(0, 'rgb(107, 139, 255)', '0.7');
717
+ highlightImagePage.steps.verifyActiveBorderColorOfHighlightRegionInSetCorrectAnswerSection(0, 'rgb(41, 0, 128)', '1');
718
+ highlightImagePage.steps.verifyActiveFillColorOfHighlightRegionInSetCorrectAnswerSection(1, 'rgb(107, 139, 255)', '0.7');
719
+ highlightImagePage.steps.verifyActiveBorderColorOfHighlightRegionInSetCorrectAnswerSection(1, 'rgb(41, 0, 128)', '1');
720
+ });
721
+
722
+ 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\'', () => {
723
+ cy.log('Switching to preview Tab');
724
+ highlightImagePage.steps.switchToPreviewTab();
725
+ highlightImagePage.steps.verifyActiveFillColorOfHighlightRegionInPreviewTab(0, 'rgb(107, 139, 255)', '0.7');
726
+ highlightImagePage.steps.verifyActiveBorderColorOfHighlightRegionInPreviewTab(0, 'rgb(41, 0, 128)', '1');
727
+ highlightImagePage.steps.verifyActiveFillColorOfHighlightRegionInPreviewTab(1, 'rgb(107, 139, 255)', '0.7');
728
+ highlightImagePage.steps.verifyActiveBorderColorOfHighlightRegionInPreviewTab(1, 'rgb(41, 0, 128)', '1');
729
+ });
730
+
731
+ 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', () => {
732
+ cy.log('Switching to edit Tab');
733
+ highlightImagePage.steps.switchToEditTab();
734
+ highlightImagePage.steps.navigateToOptionTab(1);
735
+ highlightImagePage.steps.clickOnHighlightColorBlock('activeFillColor');
736
+ colorPopupComponent.steps.selectRecommendedColorBlock(1);
737
+ colorPopupComponent.steps.addInputToOpacityInputField(90);
738
+ colorPopupComponent.steps.clickOnOkButton();
739
+ highlightImagePage.steps.clickOnHighlightColorBlock('activeBorderColor');
740
+ colorPopupComponent.steps.selectRecommendedColorBlock(3);
741
+ colorPopupComponent.steps.addInputToOpacityInputField(90);
742
+ colorPopupComponent.steps.clickOnOkButton()
743
+ cy.log('Verfying default state')
744
+ highlightImagePage.steps.verifyDefaultFillColorOfHighlightRegionInSetCorrectAnswerSection(0, 'rgb(186, 201, 255)', '0.4');
745
+ highlightImagePage.steps.verifyDefaultBorderColorOfHighlightRegionInSetCorrectAnswerSection(0, 'rgb(82, 0, 255)', '1');
746
+ highlightImagePage.steps.verifyDefaultFillColorOfHighlightRegionInSetCorrectAnswerSection(1, 'rgb(186, 201, 255)', '0.4');
747
+ highlightImagePage.steps.verifyDefaultBorderColorOfHighlightRegionInSetCorrectAnswerSection(1, 'rgb(82, 0, 255)', '1');
748
+ cy.log("Verifying hover state");
749
+ highlightImagePage.steps.verifyHoverFillColorOfHighlightRegionInSetCorrectAnswerSection(0, 'rgb(186, 201, 255)', '0.4');
750
+ highlightImagePage.steps.verifyHoverBorderColorOfHighlightRegionInSetCorrectAnswerSection(0, 'rgb(66, 0, 204)', '1');
751
+ highlightImagePage.steps.verifyHoverFillColorOfHighlightRegionInSetCorrectAnswerSection(1, 'rgb(186, 201, 255)', '0.4');
752
+ highlightImagePage.steps.verifyHoverBorderColorOfHighlightRegionInSetCorrectAnswerSection(1, 'rgb(66, 0, 204)', '1');
753
+ cy.log("Verifying active state");
754
+ highlightImagePage.steps.verifyActiveFillColorOfHighlightRegionInSetCorrectAnswerSection(0, 'rgb(255, 240, 25)', '0.9');
755
+ highlightImagePage.steps.verifyActiveBorderColorOfHighlightRegionInSetCorrectAnswerSection(0, 'rgb(0, 0, 0)', '0.9');
756
+ highlightImagePage.steps.verifyActiveFillColorOfHighlightRegionInSetCorrectAnswerSection(1, 'rgb(107, 139, 255)', '0.7');
757
+ highlightImagePage.steps.verifyActiveBorderColorOfHighlightRegionInSetCorrectAnswerSection(1, 'rgb(41, 0, 128)', '1');
758
+ });
759
+
760
+ 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\'', () => {
761
+ cy.log('Switching to preview Tab');
762
+ highlightImagePage.steps.switchToPreviewTab();
763
+ cy.log('Verfying default state')
764
+ highlightImagePage.steps.verifyDefaultFillColorOfHighlightRegionInPreviewTab(0, 'rgb(186, 201, 255)', '0.4');
765
+ highlightImagePage.steps.verifyDefaultBorderColorOfHighlightRegionInPreviewTab(0, 'rgb(82, 0, 255)', '1');
766
+ highlightImagePage.steps.verifyDefaultFillColorOfHighlightRegionInPreviewTab(1, 'rgb(186, 201, 255)', '0.4');
767
+ highlightImagePage.steps.verifyDefaultBorderColorOfHighlightRegionInPreviewTab(1, 'rgb(82, 0, 255)', '1');
768
+ cy.log("Verifying hover state");
769
+ highlightImagePage.steps.verifyHoverFillColorOfHighlightRegionInPreviewTab(0, 'rgb(186, 201, 255)', '0.4');
770
+ highlightImagePage.steps.verifyHoverBorderColorOfHighlightRegionInPreviewTab(0, 'rgb(66, 0, 204)', '1');
771
+ highlightImagePage.steps.verifyHoverFillColorOfHighlightRegionInPreviewTab(1, 'rgb(186, 201, 255)', '0.4');
772
+ highlightImagePage.steps.verifyHoverBorderColorOfHighlightRegionInPreviewTab(1, 'rgb(66, 0, 204)', '1');
773
+ cy.log("Verifying active state");
774
+ highlightImagePage.steps.verifyActiveFillColorOfHighlightRegionInPreviewTab(0, 'rgb(255, 240, 25)', '0.9');
775
+ highlightImagePage.steps.verifyActiveBorderColorOfHighlightRegionInPreviewTab(0, 'rgb(0, 0, 0)', '0.9');
776
+ highlightImagePage.steps.verifyActiveFillColorOfHighlightRegionInPreviewTab(1, 'rgb(107, 139, 255)', '0.7');
777
+ highlightImagePage.steps.verifyActiveBorderColorOfHighlightRegionInPreviewTab(1, 'rgb(41, 0, 128)', '1');
778
+ });
779
+
780
+ 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', () => {
781
+ cy.log('Switching to edit Tab');
782
+ highlightImagePage.steps.switchToEditTab();
783
+ highlightImagePage.steps.navigateToGlobalTab();
784
+ highlightImagePage.steps.clickOnHighlightColorBlock('activeFillColor');
785
+ colorPopupComponent.steps.selectRecommendedColorBlock(0);
786
+ colorPopupComponent.steps.addInputToOpacityInputField(80);
787
+ colorPopupComponent.steps.clickOnOkButton();
788
+ highlightImagePage.steps.clickOnHighlightColorBlock('activeBorderColor');
789
+ colorPopupComponent.steps.selectRecommendedColorBlock(2);
790
+ colorPopupComponent.steps.addInputToOpacityInputField(80);
791
+ colorPopupComponent.steps.clickOnOkButton();
792
+ highlightImagePage.steps.verifyActiveFillColorOfHighlightRegionInSetCorrectAnswerSection(1, 'rgb(229, 76, 25)', '0.8');
793
+ highlightImagePage.steps.verifyActiveBorderColorOfHighlightRegionInSetCorrectAnswerSection(1, 'rgb(9, 179, 33)', '0.8');
794
+ highlightImagePage.steps.verifyActiveFillColorOfHighlightRegionInSetCorrectAnswerSection(0, 'rgb(255, 240, 25)', '0.9');
795
+ highlightImagePage.steps.verifyActiveBorderColorOfHighlightRegionInSetCorrectAnswerSection(0, 'rgb(0, 0, 0)', '0.9');
796
+ });
797
+
798
+ 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\'', () => {
799
+ cy.log('Switching to preview Tab');
800
+ highlightImagePage.steps.switchToPreviewTab();
801
+ highlightImagePage.steps.verifyActiveFillColorOfHighlightRegionInPreviewTab(1, 'rgb(229, 76, 25)', '0.8');
802
+ highlightImagePage.steps.verifyActiveBorderColorOfHighlightRegionInPreviewTab(1, 'rgb(9, 179, 33)', '0.8');
803
+ highlightImagePage.steps.verifyActiveFillColorOfHighlightRegionInPreviewTab(0, 'rgb(255, 240, 25)', '0.9');
804
+ highlightImagePage.steps.verifyActiveBorderColorOfHighlightRegionInPreviewTab(0, 'rgb(0, 0, 0)', '0.9');
805
+ });
806
+ });
807
+
808
+ describe('Customize highlight properties accordion: Apply pattern on active state', () => {
809
+ abortEarlySetup();
810
+ before(() => {
811
+ cy.log('Navigating to highlight image question type');
812
+ highlightImagePage.steps.navigateToCreateQuestion('highlight image');
813
+ cy.barsPreLoaderWait();
814
+ cy.log('Uploading an image');
815
+ uploadImageSectionComponent.steps.uploadFile('highlightImage.jpg');
816
+ uploadImageSectionComponent.steps.verifyUploadedImageInImagePopup();
817
+ uploadImageSectionComponent.steps.clickOnImagePopupOkButton();
818
+ highlightImagePage.steps.verifyImageUploadedInHighlightRegion();
819
+ highlightImagePage.steps.verifyImageUploadedInSetCorrectAnswerSection();
820
+ highlightImagePage.steps.highlightRegionInImage(flowerHighlightRegion);
821
+ highlightImagePage.steps.verifyHighlightRegionsInSetCorrectAnswerSection(0, flowerHighlightRegion);
822
+ highlightImagePage.steps.highlightRegionInImage(leafHighlightRegion);
823
+ highlightImagePage.steps.verifyHighlightRegionsInSetCorrectAnswerSection(1, leafHighlightRegion);
824
+ highlightImagePage.steps.expandCustomizeHighlightProperties();
825
+ });
826
+
827
+ it('When user highlights a region then in the \'Customize highlight properties accordion\' the \'Apply pattern on active state\' should be in checked state', () => {
828
+ highlightImagePage.steps.verifyApplyPatternOnActiveStateCheckboxIsChecked();
829
+ });
830
+
831
+ it('When \'Apply pattern on active state\' is checked and user selects a highlight region in \'Set correct answer\' section then the active pattern should be displayed in the \'Set correct answer\' section', () => {
832
+ highlightImagePage.steps.verifyApplyPatternOnActiveStateCheckboxIsChecked();
833
+ highlightImagePage.steps.highlightARegionInSetCorrectAnswerSection(0);
834
+ highlightImagePage.steps.verifyActivePatternIsDisplayedOnHighlightRegionInSetCorrectAnswerSection(0);
835
+ });
836
+
837
+ it('When \'Apply pattern on active state\' is checked and user selects a highlight region in \'Preview tab\' then the active pattern should be displayed in the \'Preview tab\'', () => {
838
+ highlightImagePage.steps.verifyApplyPatternOnActiveStateCheckboxIsChecked();
839
+ cy.log('Switching to preview tab')
840
+ highlightImagePage.steps.switchToPreviewTab();
841
+ highlightImagePage.steps.highlightARegionInPreviewTab(0);
842
+ highlightImagePage.steps.verifyActivePatternIsDisplayedOnHighlightRegionInPreviewTab(0);
843
+ });
844
+
845
+ it('When user unchecks the \'Apply pattern on active state\' in the \'Global\' tab then the checkbox should be unchecked in all tabs', () => {
846
+ cy.log('Switching to edit tab')
847
+ highlightImagePage.steps.switchToEditTab();
848
+ highlightImagePage.steps.uncheckApplyPatternOnActiveStateCheckbox();
849
+ highlightImagePage.steps.navigateToOptionTab(1);
850
+ highlightImagePage.steps.verifyApplyPatternOnActiveStateCheckboxIsUnchecked();
851
+ highlightImagePage.steps.navigateToOptionTab(2);
852
+ highlightImagePage.steps.verifyApplyPatternOnActiveStateCheckboxIsUnchecked();
853
+ });
854
+
855
+ it('When \'Apply pattern on active state\' is unchecked and user selects a highlight region in \'Set correct answer\' section then the active pattern should not be displayed in the \'Set correct answer\' section', () => {
856
+ highlightImagePage.steps.navigateToGlobalTab();
857
+ highlightImagePage.steps.verifyApplyPatternOnActiveStateCheckboxIsUnchecked();
858
+ highlightImagePage.steps.highlightARegionInSetCorrectAnswerSection(1);
859
+ highlightImagePage.steps.verifyActivePatternIsNotDisplayedOnHighlightRegionInSetCorrectAnswerSection(1);
860
+ });
861
+
862
+ it('When \'Apply pattern on active state\' is unchecked and user selects a highlight region in \'Preview tab\' then the active pattern should not be displayed in the \'Preview tab\'', () => {
863
+ highlightImagePage.steps.verifyApplyPatternOnActiveStateCheckboxIsUnchecked();
864
+ cy.log('Switching to preview tab')
865
+ highlightImagePage.steps.switchToPreviewTab();
866
+ highlightImagePage.steps.highlightARegionInPreviewTab(1);
867
+ highlightImagePage.steps.verifyActivePatternIsNotDisplayedOnHighlightRegionInPreviewTab(1);
868
+ });
869
+
870
+ it('CSS of selected highlight in \'Set correct answer\' section and \'Preview tab\'', { tags: 'css' }, () => {
871
+ cy.log('CSS of selected highlight in preview tab')
872
+ utilities.verifyCSS(highlightImagePage.setCorrectAnswerSectionHighlightPolygon().eq(1), {
873
+ 'stroke': css.color.activeHighlightBorder,
874
+ 'fill': css.color.videoProgressBarElapsedFill,
875
+ 'stroke-width': '4px'
876
+ });
877
+ cy.log('CSS of selected highlight in edit tab')
878
+ highlightImagePage.steps.switchToEditTab();
879
+ utilities.verifyCSS(highlightImagePage.setCorrectAnswerSectionHighlightPolygon().eq(1), {
880
+ 'stroke': css.color.activeHighlightBorder,
881
+ 'fill': css.color.videoProgressBarElapsedFill,
882
+ 'stroke-width': '4px'
883
+ });
884
+ highlightImagePage.steps.switchToPreviewTab();
885
+ });
886
+
887
+ it('When the user checks \'Hide highlights\' checkbox and \'Apply pattern on active state\' is unchecked then on selecting a highlight region in \'Set correct answer\' section active pattern should not be displayed in \'Set correct answer\' section', () => {
888
+ cy.log('Pre step: Removing highlight of region in set correct section');
889
+ highlightImagePage.steps.switchToEditTab()
890
+ highlightImagePage.steps.removeHighlightOfARegionInSetCorrectAnswerSection(1);
891
+ highlightImagePage.steps.checkHideHighlightsCheckbox();
892
+ highlightImagePage.steps.verifyApplyPatternOnActiveStateCheckboxIsUnchecked();
893
+ highlightImagePage.steps.highlightARegionInSetCorrectAnswerSection(0);
894
+ highlightImagePage.steps.verifyActivePatternIsNotDisplayedOnHighlightRegionInSetCorrectAnswerSection(0);
895
+ });
896
+
897
+ it('When the \'Hide highlights\' checkbox is checked and \'Apply pattern on active state\' is unchecked then on selecting a highlight region in \'Preview tab\' active pattern should not be displayed in the \'Preview tab\'', () => {
898
+ highlightImagePage.steps.verifyHideHighlightsCheckboxIsChecked();
899
+ highlightImagePage.steps.verifyApplyPatternOnActiveStateCheckboxIsUnchecked();
900
+ cy.log('Switching to preview tab')
901
+ highlightImagePage.steps.switchToPreviewTab();
902
+ highlightImagePage.steps.highlightARegionInPreviewTab(0);
903
+ highlightImagePage.steps.verifyActivePatternIsNotDisplayedOnHighlightRegionInPreviewTab(0);
904
+ });
905
+
906
+ it('When \'Hide highlights\' and \'Apply pattern on active state\' checkbox is checked then on selecting a highlight region in \'Set correct answer\' section active pattern should be displayed in \'Set correct answer\' section', () => {
907
+ cy.log('Switching to edit tab')
908
+ highlightImagePage.steps.switchToEditTab();
909
+ highlightImagePage.steps.verifyHideHighlightsCheckboxIsChecked();
910
+ highlightImagePage.steps.checkApplyPatternOnActiveStateCheckbox();
911
+ highlightImagePage.steps.highlightARegionInSetCorrectAnswerSection(1);
912
+ highlightImagePage.steps.verifyActivePatternIsDisplayedOnHighlightRegionInSetCorrectAnswerSection(1);
913
+ });
914
+
915
+ it('When \'Hide highlights\' and \'Apply pattern on active state\' checkbox is checked then on selecting a highlight region in \'Preview tab\' active pattern should be displayed in \'Preview tab\'', () => {
916
+ highlightImagePage.steps.verifyHideHighlightsCheckboxIsChecked();
917
+ highlightImagePage.steps.verifyApplyPatternOnActiveStateCheckboxIsChecked();
918
+ cy.log('Switching to preview tab')
919
+ highlightImagePage.steps.switchToPreviewTab();
920
+ highlightImagePage.steps.highlightARegionInPreviewTab(1);
921
+ highlightImagePage.steps.verifyActivePatternIsDisplayedOnHighlightRegionInPreviewTab(1);
922
+ });
923
+ });
924
+
925
+ describe('Customize highlight properties accordion: Reset to global color functionality', () => {
926
+ abortEarlySetup();
927
+ before(() => {
928
+ cy.log('Navigating to highlight image question type');
929
+ highlightImagePage.steps.navigateToCreateQuestion('highlight image');
930
+ cy.barsPreLoaderWait();
931
+ cy.log('Uploading an image');
932
+ uploadImageSectionComponent.steps.uploadFile('highlightImage.jpg');
933
+ uploadImageSectionComponent.steps.verifyUploadedImageInImagePopup();
934
+ uploadImageSectionComponent.steps.clickOnImagePopupOkButton();
935
+ highlightImagePage.steps.verifyImageUploadedInHighlightRegion();
936
+ highlightImagePage.steps.verifyImageUploadedInSetCorrectAnswerSection();
937
+ highlightImagePage.steps.highlightRegionInImage(flowerHighlightRegion);
938
+ highlightImagePage.steps.verifyHighlightRegionsInSetCorrectAnswerSection(0, flowerHighlightRegion);
939
+ highlightImagePage.steps.expandCustomizeHighlightProperties();
940
+ highlightImagePage.steps.navigateToOptionTab(1);
941
+ });
942
+
943
+ it('When the user draws a highlight region the \'Reset to global color\' button should be displayed in disabled state in the \'Option 1\' tab', () => {
944
+ utilities.verifyInnerText(highlightImagePage.resetToGlobalColorButton(), 'Reset to global color');
945
+ utilities.verifyElementVisibilityState(highlightImagePage.resetToGlobalColorButton(), 'visible');
946
+ highlightImagePage.steps.verifyResetToGlobalColorButtonDisabled();
947
+ });
948
+
949
+ it('When the user updates any property color in the \'Option\' tab then the \'Reset to global color\' should be displayed in enabled state', () => {
950
+ highlightImagePage.steps.clickOnHighlightColorBlock('defaultFillColor');
951
+ colorPopupComponent.steps.selectRecommendedColorBlock(1);
952
+ colorPopupComponent.steps.clickOnOkButton();
953
+ highlightImagePage.steps.verifyDefaultFillColorBlockColor('rgba(255, 240, 25, 0.4)');
954
+ highlightImagePage.steps.verifyDefaultFillColorHexCodeLabel('#FFF019');
955
+ highlightImagePage.steps.verifyResetToGlobalColorButtonEnabled();
956
+ });
957
+
958
+ it('CSS of enabled \'Reset to global color\' button', { tags: 'css' }, () => {
959
+ utilities.verifyCSS(highlightImagePage.resetToGlobalColorButton(), {
960
+ 'color': css.color.activeButtons,
961
+ 'font-size': css.fontSize.default,
962
+ 'font-weight': css.fontWeight.regular
963
+ });
964
+ });
965
+
966
+ it('Accessibility of enabled \'Reset to global color\' button', { tags: 'a11y' }, () => {
967
+ cy.checkAccessibility(highlightImagePage.resetToGlobalColorButton());
968
+ });
969
+
970
+ it('When the user clicks on the \'Reset to global color\' button then all the changes should be reverted and the global properties should be displayed and the button should be disabled again', () => {
971
+ highlightImagePage.steps.clickOnResetToGlobalColorButton();
972
+ highlightImagePage.steps.verifyDefaultFillColorBlockColor(highlightColorProperties.default.colorProperties.fillColorRgbaValue);
973
+ highlightImagePage.steps.verifyDefaultFillColorHexCodeLabel(highlightColorProperties.default.colorProperties.fillColorHexValue);
974
+ highlightImagePage.steps.verifyResetToGlobalColorButtonDisabled();
975
+ });
976
+
977
+ it('When the user makes any changes in the \'Global\' tab then the changes should be reflected in the \'Option 1\' tab and the \'Reset to global color\' should be in disabled state', () => {
978
+ highlightImagePage.steps.navigateToGlobalTab();
979
+ highlightImagePage.steps.clickOnHighlightColorBlock('defaultBorderColor');
980
+ colorPopupComponent.steps.selectRecommendedColorBlock(2);
981
+ colorPopupComponent.steps.clickOnOkButton();
982
+ highlightImagePage.steps.verifyDefaultBorderColorBlockColor('rgb(9, 179, 33)');
983
+ highlightImagePage.steps.verifyDefaultBorderColorHexCodeLabel('#09B321');
984
+ highlightImagePage.steps.navigateToOptionTab(1);
985
+ highlightImagePage.steps.verifyDefaultBorderColorBlockColor('rgb(9, 179, 33)');
986
+ highlightImagePage.steps.verifyDefaultBorderColorHexCodeLabel('#09B321');
987
+ highlightImagePage.steps.verifyResetToGlobalColorButtonDisabled();
988
+ });
989
+ });
990
+
991
+ //TODO: Need to write script after https://redmine.zeuslearning.com/issues/546352 is resolved
992
+ describe('Option label and Aria label functionaity in Set correct answer section and preview tab', () => {
993
+
994
+ it('When user adds input to \'Option label\' and \'ARIA label\' input field then option label and aria label should be displayed for \'Option 1\' highlight region in \'Set correct answer\' section', () => {
995
+
996
+ });
997
+
998
+ it('When user adds input to \'Option label\' and \'ARIA label\' input field then option label and aria label should be displayed for \'Option 1\' highlight region in \'Preview tab\'', () => {
999
+
1000
+ });
1001
+
1002
+ it('Option label and aria label should not be displayed for \'Option 2\' highlight region in \'Set correct answer\' section', () => {
1003
+
1004
+ });
1005
+
1006
+ it('Option label and aria label should not be displayed for \'Option 2\' highlight region in the \'Preview tab\'', () => {
1007
+
1008
+ });
1009
+ });
1010
+ });