itemengine-cypress-automation 1.0.206-12thJuneFixesAndRepoUpdate-5fe2304.0 → 1.0.206
Sign up to get free protection for your applications and to get access to all the features.
- package/cypress/e2e/ILC/ChartsBar/Scoring/addAndDeleteBarAllOrNothingScoring.js +1 -1
- package/cypress/e2e/ILC/ChartsBar/gridSettings.js +3 -3
- package/cypress/e2e/ILC/ChartsBar/labelOptionsSection.js +2 -0
- package/cypress/e2e/ILC/ChartsBar/previewContentsForAllViews.smoke.js +17 -17
- package/cypress/e2e/ILC/ChartsBar/selectChartTypeSection.js +747 -0
- package/cypress/e2e/ILC/ChartsBar/specifyCorrectAnswerSection.js +1 -1
- package/cypress/e2e/ILC/ChartsLine/previewContentsForAllViews.smoke.js +7 -7
- package/cypress/e2e/ILC/EssayResponse/additionalSettings.js +257 -0
- package/cypress/e2e/ILC/EssayResponse/toolSettings.js +73 -0
- package/cypress/e2e/ILC/FillInTheGapsDropdownNew/Scoring/manuallyAndNonScored.js +1 -1
- package/cypress/e2e/ILC/FillInTheGapsDropdownNew/additionalSettingsBasic.js +2 -2
- package/cypress/e2e/ILC/FillInTheGapsDropdownNew/additionalSettingsForDropdowns.js +1 -1
- package/cypress/e2e/ILC/FillInTheGapsDropdownNew/editTabBasicSection.js +3 -3
- package/cypress/e2e/ILC/FillInTheGapsDropdownNew/previewContentsForAllViews.smoke.js +1 -1
- package/cypress/e2e/ILC/FillInTheGapsDropdownNew/specifyCorrectAnswerSection.js +2 -2
- package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/backgroundImageAndCanvasProperties.js +1 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/studentViewSettings.js +2 -2
- package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/Scoring/partialEqualWeightsWithAlternativePointsGreaterThanCorrectPoints.js +1 -1
- package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/specifyCorrectAnswerSection.js +3 -2
- package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/styleAndLayoutCutomization.js +2 -2
- package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/Scoring/partialDifferentWeightsAlternativePointsGreaterThanCorrectPoints.js +1 -1
- package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/allOrNothingForAllViews.smoke.js +1 -1
- package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/backgroundImageAndCanvasProperties.js +4 -3
- package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/styleAndLayoutCustomization.js +29 -26
- package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/manuallyAndNonScored.js +1 -1
- package/cypress/e2e/ILC/FillInTheGapsTextNew/additionalSettingsForAnswerInputFields.js +1 -1
- package/cypress/e2e/ILC/FillInTheGapsTextNew/allOrNothingForAllViews.smoke.js +1 -1
- package/cypress/e2e/ILC/FillInTheGapsTextNew/editTabBasicSection.js +3 -3
- package/cypress/e2e/ILC/FillInTheGapsTextNew/previewContentsForAllViews.smoke.js +1 -1
- package/cypress/e2e/ILC/ImageHighlight/customiseHighlightStyle.js +707 -0
- package/cypress/e2e/ILC/ImageHighlight/imageHighlightStyle.js +4 -3
- package/cypress/pages/chartsBarPage.js +212 -35
- package/cypress/pages/chartsDotPlotPage.js +10 -25
- package/cypress/pages/components/barAndLineChartComponent.js +54 -5
- package/cypress/pages/components/chartsCommonComponent.js +16 -1
- package/cypress/pages/components/createQuestionBasePage.js +1 -1
- package/cypress/pages/components/figCommonStyleAndLayoutComponent.js +1 -1
- package/cypress/pages/components/imageCanvasComponent.js +3 -3
- package/cypress/pages/essayResponsePage.js +152 -2
- package/cypress/pages/imageHighlightPage.js +398 -15
- package/cypress/pages/matchingPage.js +1 -0
- package/package.json +2 -2
@@ -0,0 +1,707 @@
|
|
1
|
+
import { imageHighlightPage } from "../../../pages";
|
2
|
+
import { colorPopupComponent } from "../../../pages/components";
|
3
|
+
import abortEarlySetup from "../../../support/helpers/abortEarly";
|
4
|
+
import utilities from "../../../support/helpers/utilities";
|
5
|
+
const css = Cypress.env('css');
|
6
|
+
|
7
|
+
const borderStyleOptions = ['Dashed', 'Dotted', 'Default', 'None'];
|
8
|
+
const flowerHighlightRegion = [[40, 6], [40, 20], [55, 20], [55, 6]];
|
9
|
+
const branchesHighlightRegion = [[50, 30], [50, 42], [65, 42], [65, 30]];
|
10
|
+
const leafHighlightRegion = [[26, 26], [26, 36], [48, 36], [48, 26]];
|
11
|
+
const rootsHighlightRegion = [[45, 45], [45, 55], [57, 55], [57, 45]];
|
12
|
+
|
13
|
+
const defaultStateColor = 'rgb(120, 60, 60)';
|
14
|
+
const activeStateColor = 'rgb(60, 120, 120)';
|
15
|
+
|
16
|
+
describe('Create Item page - Image highlight: Customize image highlight style', () => {
|
17
|
+
before(() => {
|
18
|
+
cy.loginAs('admin');
|
19
|
+
});
|
20
|
+
|
21
|
+
describe('Fill color image highlight style : Edit tab content and functionality', () => {
|
22
|
+
abortEarlySetup();
|
23
|
+
before(() => {
|
24
|
+
imageHighlightPage.steps.navigateToCreateQuestion('image highlight');
|
25
|
+
imageHighlightPage.steps.uploadFile('highlightImage.jpg');
|
26
|
+
imageHighlightPage.steps.verifyImageUploadedInSpecifyPossibleOptionsSection();
|
27
|
+
imageHighlightPage.steps.verifyImageUploadedSpecifyCorrectAnswer();
|
28
|
+
imageHighlightPage.steps.highlightRegionInImage(flowerHighlightRegion);
|
29
|
+
imageHighlightPage.steps.highlightRegionInImage(branchesHighlightRegion);
|
30
|
+
imageHighlightPage.steps.highlightRegionInImage(leafHighlightRegion);
|
31
|
+
imageHighlightPage.steps.highlightRegionInImage(rootsHighlightRegion);
|
32
|
+
imageHighlightPage.steps.highlightARegionInSpecifyCorrectAnswerSection(0);
|
33
|
+
imageHighlightPage.steps.highlightARegionInSpecifyCorrectAnswerSection(1);
|
34
|
+
});
|
35
|
+
|
36
|
+
it('\'Fill color\' icon should be displayed and as user hovers over it then a tooltip \'Fill color\' should be displayed', () => {
|
37
|
+
utilities.verifyElementVisibilityState(imageHighlightPage.fillColorButton(), 'visible');
|
38
|
+
imageHighlightPage.steps.verifyToolTipText(1, imageHighlightPage.fillColorButton(), 'Fill color');
|
39
|
+
});
|
40
|
+
|
41
|
+
it('When user clicks on the \'Fill color\' icon then a popup should be displayed', () => {
|
42
|
+
imageHighlightPage.steps.clickOnFillColorIcon();
|
43
|
+
utilities.verifyElementVisibilityState(imageHighlightPage.colorPopupWrapper(), 'visible');
|
44
|
+
});
|
45
|
+
|
46
|
+
it('The popup should contain \'Fill color\' label and two color boxes with label \'Default\' and \'Active\'. Both color boxes should have edit color button. Verify defualt color of both \'Default\' and \'Active\' color boxes', () => {
|
47
|
+
utilities.verifyElementVisibilityState(imageHighlightPage.colorPopupMenuLabel(), 'visible');
|
48
|
+
utilities.verifyInnerText(imageHighlightPage.colorPopupMenuLabel(), 'Fill color');
|
49
|
+
utilities.verifyElementVisibilityState(imageHighlightPage.defaultStateColorLabel(), 'visible');
|
50
|
+
utilities.verifyInnerText(imageHighlightPage.defaultStateColorLabel(), 'Default');
|
51
|
+
utilities.verifyElementVisibilityState(imageHighlightPage.activeStateColorLabel(), 'visible');
|
52
|
+
utilities.verifyInnerText(imageHighlightPage.activeStateColorLabel(), 'Active');
|
53
|
+
utilities.verifyElementVisibilityState(imageHighlightPage.defaultColorButton(), 'visible');
|
54
|
+
utilities.verifyElementVisibilityState(imageHighlightPage.activeColorButton(), 'visible');
|
55
|
+
utilities.verifyElementVisibilityState(imageHighlightPage.defaultStateEditButton(), 'visible');
|
56
|
+
utilities.verifyInnerText(imageHighlightPage.defaultStateEditButton(), 'Edit color');
|
57
|
+
utilities.verifyElementVisibilityState(imageHighlightPage.activeStateEditButton(), 'visible');
|
58
|
+
utilities.verifyInnerText(imageHighlightPage.activeStateEditButton(), 'Edit color');
|
59
|
+
utilities.verifyCSS(imageHighlightPage.defaultColorButton(), {
|
60
|
+
'background-color': "rgba(186, 201, 255, 0.4)",
|
61
|
+
});
|
62
|
+
utilities.verifyCSS(imageHighlightPage.activeColorButton(), {
|
63
|
+
'background-color': "rgba(107, 139, 255, 0.7)",
|
64
|
+
});
|
65
|
+
});
|
66
|
+
|
67
|
+
it('The popup should contain \'Apply to all options\' checkbox and it should be checked by default', () => {
|
68
|
+
utilities.verifyElementVisibilityState(imageHighlightPage.applyToAllOptionsCheckbox(), 'visible');
|
69
|
+
utilities.verifyInnerText(imageHighlightPage.applyToAllOptionsCheckboxLabel(), 'Apply to all options');
|
70
|
+
imageHighlightPage.steps.verifyApplyToAllOptionsCheckboxChecked();
|
71
|
+
});
|
72
|
+
|
73
|
+
it('CSS of \'Fill color\' defualt popup', { tags: 'css' }, () => {
|
74
|
+
utilities.verifyCSS(imageHighlightPage.colorPopupMenuLabel(), {
|
75
|
+
'color': css.color.labels,
|
76
|
+
'font-size': css.fontSize.default,
|
77
|
+
'font-weight': css.fontWeight.semibold
|
78
|
+
});
|
79
|
+
utilities.verifyCSS(imageHighlightPage.defaultStateColorLabel(), {
|
80
|
+
'color': css.color.labels,
|
81
|
+
'font-size': css.fontSize.normal,
|
82
|
+
'font-weight': css.fontWeight.semibold
|
83
|
+
});
|
84
|
+
utilities.verifyCSS(imageHighlightPage.activeStateColorLabel(), {
|
85
|
+
'color': css.color.labels,
|
86
|
+
'font-size': css.fontSize.normal,
|
87
|
+
'font-weight': css.fontWeight.semibold
|
88
|
+
});
|
89
|
+
utilities.verifyCSS(imageHighlightPage.defaultEditButtonText(), {
|
90
|
+
'color': css.color.activeButtons,
|
91
|
+
'font-size': css.fontSize.default,
|
92
|
+
'font-weight': css.fontWeight.regular
|
93
|
+
});
|
94
|
+
utilities.verifyCSS(imageHighlightPage.activeEditButtonText(), {
|
95
|
+
'color': css.color.activeButtons,
|
96
|
+
'font-size': css.fontSize.default,
|
97
|
+
'font-weight': css.fontWeight.regular
|
98
|
+
});
|
99
|
+
utilities.verifyCSS(imageHighlightPage.applyToAllOptionsCheckboxLabel(), {
|
100
|
+
'color': css.color.labels,
|
101
|
+
'font-size': css.fontSize.normal,
|
102
|
+
'font-weight': css.fontWeight.regular
|
103
|
+
});
|
104
|
+
});
|
105
|
+
|
106
|
+
it('Accessibility of \'Fill color\' defualt popup', { tags: 'a11y' }, () => {
|
107
|
+
cy.checkAccessibility(imageHighlightPage.colorPopupWrapper());
|
108
|
+
});
|
109
|
+
|
110
|
+
imageHighlightPage.tests.verifyColorPopupContentCSSandAccessibility('Fill color');
|
111
|
+
|
112
|
+
it('When user updates the default color from the fill color popup then the edited color should be displayed on the default state of all highlight regions for \'Specify correct answer\ section', () => {
|
113
|
+
imageHighlightPage.steps.clickOnCancelButton();
|
114
|
+
imageHighlightPage.steps.clickOnFillColorIcon();
|
115
|
+
imageHighlightPage.steps.clickOnDefaultStateColorEditButton();
|
116
|
+
colorPopupComponent.steps.clickInColorSaturationPalette();
|
117
|
+
imageHighlightPage.steps.verifySelectedColorBlock(defaultStateColor);
|
118
|
+
imageHighlightPage.steps.clickOnOkButton();
|
119
|
+
imageHighlightPage.steps.verifyEditedFillColorInSpecifyCorrectAnswerSection(2, defaultStateColor);
|
120
|
+
imageHighlightPage.steps.verifyEditedFillColorInSpecifyCorrectAnswerSection(3, defaultStateColor);
|
121
|
+
});
|
122
|
+
|
123
|
+
it('When user updates the active color from the fill color popup then the edited color should be displayed on the selected state of all highlight regions for \'Specify correct answer\ options', () => {
|
124
|
+
imageHighlightPage.steps.clickOnFillColorIcon();
|
125
|
+
imageHighlightPage.steps.clickOnActiveStateColorEditButton();
|
126
|
+
colorPopupComponent.steps.clickInColorHuePalette();
|
127
|
+
colorPopupComponent.steps.clickInColorSaturationPalette();
|
128
|
+
imageHighlightPage.steps.verifySelectedColorBlock(activeStateColor);
|
129
|
+
imageHighlightPage.steps.clickOnOkButton();
|
130
|
+
imageHighlightPage.steps.verifyEditedFillColorInSpecifyCorrectAnswerSection(0, activeStateColor);
|
131
|
+
imageHighlightPage.steps.verifyEditedFillColorInSpecifyCorrectAnswerSection(1, activeStateColor);
|
132
|
+
});
|
133
|
+
|
134
|
+
it('When user selects a region in \'Specify possible options\' and updates the default color from the fill color popup and unchecks the \'Apply to all options\' checkbox then the edited color should be displayed on the default state of selected highlight regions for \'Specify correct answer\ section and other regions should be in their previous state', () => {
|
135
|
+
imageHighlightPage.steps.selectARegionInSpecifyPossibleOptions(leafHighlightRegion);
|
136
|
+
imageHighlightPage.steps.clickOnFillColorIcon();
|
137
|
+
imageHighlightPage.steps.uncheckApplyToAllOptionsCheckbox();
|
138
|
+
imageHighlightPage.steps.clickOnDefaultStateColorEditButton();
|
139
|
+
colorPopupComponent.steps.clickInColorHuePalette();
|
140
|
+
colorPopupComponent.steps.clickInColorSaturationPalette();
|
141
|
+
imageHighlightPage.steps.verifySelectedColorBlock(activeStateColor);
|
142
|
+
imageHighlightPage.steps.clickOnOkButton();
|
143
|
+
imageHighlightPage.steps.verifyEditedFillColorInSpecifyCorrectAnswerSection(2, activeStateColor);
|
144
|
+
imageHighlightPage.steps.verifyEditedFillColorInSpecifyCorrectAnswerSection(3, defaultStateColor);
|
145
|
+
});
|
146
|
+
|
147
|
+
it('When user selects a region in \'Specify possible options\' and updates the active color from the fill color popup and unchecks the \'Apply to all options\' checkbox then the edited color should be displayed on the default state of selected highlight regions for \'Specify correct answer\ section and other regions should be in their previous state', () => {
|
148
|
+
imageHighlightPage.steps.selectARegionInSpecifyPossibleOptions(flowerHighlightRegion);
|
149
|
+
imageHighlightPage.steps.clickOnFillColorIcon();
|
150
|
+
imageHighlightPage.steps.clickOnActiveStateColorEditButton();
|
151
|
+
colorPopupComponent.steps.clickInColorSaturationPalette();
|
152
|
+
imageHighlightPage.steps.verifySelectedColorBlock(defaultStateColor);
|
153
|
+
imageHighlightPage.steps.clickOnOkButton();
|
154
|
+
imageHighlightPage.steps.verifyEditedFillColorInSpecifyCorrectAnswerSection(0, defaultStateColor);
|
155
|
+
imageHighlightPage.steps.verifyEditedFillColorInSpecifyCorrectAnswerSection(1, activeStateColor);
|
156
|
+
});
|
157
|
+
});
|
158
|
+
|
159
|
+
describe('Border color image highlight style : Edit tab content and functionality', () => {
|
160
|
+
abortEarlySetup();
|
161
|
+
before(() => {
|
162
|
+
imageHighlightPage.steps.navigateToCreateQuestion('image highlight');
|
163
|
+
imageHighlightPage.steps.uploadFile('highlightImage.jpg');
|
164
|
+
imageHighlightPage.steps.verifyImageUploadedInSpecifyPossibleOptionsSection();
|
165
|
+
imageHighlightPage.steps.verifyImageUploadedSpecifyCorrectAnswer();
|
166
|
+
imageHighlightPage.steps.highlightRegionInImage(flowerHighlightRegion);
|
167
|
+
imageHighlightPage.steps.highlightRegionInImage(branchesHighlightRegion);
|
168
|
+
imageHighlightPage.steps.highlightRegionInImage(leafHighlightRegion);
|
169
|
+
imageHighlightPage.steps.highlightRegionInImage(rootsHighlightRegion);
|
170
|
+
imageHighlightPage.steps.highlightARegionInSpecifyCorrectAnswerSection(0);
|
171
|
+
imageHighlightPage.steps.highlightARegionInSpecifyCorrectAnswerSection(1);
|
172
|
+
});
|
173
|
+
|
174
|
+
it('\'Border color\' icon should be displayed and as user hovers over it then a tooltip \'Border color\' should be displayed', () => {
|
175
|
+
utilities.verifyElementVisibilityState(imageHighlightPage.borderColorButton(), 'visible');
|
176
|
+
imageHighlightPage.steps.verifyToolTipText(2, imageHighlightPage.borderColorButton(), 'Border color');
|
177
|
+
});
|
178
|
+
|
179
|
+
it('When user clicks on the \'Border color\' icon then a popup should be displayed', () => {
|
180
|
+
imageHighlightPage.steps.clickOnBorderColorIcon();
|
181
|
+
utilities.verifyElementVisibilityState(imageHighlightPage.colorPopupWrapper(), 'visible');
|
182
|
+
});
|
183
|
+
|
184
|
+
it('The popup should contain \'Border color\' label and two color boxes with label \'Default\' and \'Active\'. Both color boxes should have edit color button.Verify defualt color of both \'Default\' and \'Active\' color boxes', () => {
|
185
|
+
utilities.verifyElementVisibilityState(imageHighlightPage.colorPopupMenuLabel(), 'visible');
|
186
|
+
utilities.verifyInnerText(imageHighlightPage.colorPopupMenuLabel(), 'Border color');
|
187
|
+
utilities.verifyElementVisibilityState(imageHighlightPage.defaultStateColorLabel(), 'visible');
|
188
|
+
utilities.verifyInnerText(imageHighlightPage.defaultStateColorLabel(), 'Default');
|
189
|
+
utilities.verifyElementVisibilityState(imageHighlightPage.activeStateColorLabel(), 'visible');
|
190
|
+
utilities.verifyInnerText(imageHighlightPage.activeStateColorLabel(), 'Active');
|
191
|
+
utilities.verifyElementVisibilityState(imageHighlightPage.defaultColorButton(), 'visible');
|
192
|
+
utilities.verifyElementVisibilityState(imageHighlightPage.activeColorButton(), 'visible');
|
193
|
+
utilities.verifyElementVisibilityState(imageHighlightPage.defaultStateEditButton(), 'visible');
|
194
|
+
utilities.verifyInnerText(imageHighlightPage.defaultStateEditButton(), 'Edit color');
|
195
|
+
utilities.verifyElementVisibilityState(imageHighlightPage.activeStateEditButton(), 'visible');
|
196
|
+
utilities.verifyInnerText(imageHighlightPage.activeStateEditButton(), 'Edit color');
|
197
|
+
utilities.verifyCSS(imageHighlightPage.defaultColorButton(), {
|
198
|
+
'background-color': css.color.activeButtons,
|
199
|
+
});
|
200
|
+
utilities.verifyCSS(imageHighlightPage.activeColorButton(), {
|
201
|
+
'background-color': css.color.activeHighlightBorder,
|
202
|
+
});
|
203
|
+
});
|
204
|
+
|
205
|
+
it('The popup should contain \'Apply to all options\' checkbox and it should be checked by default', () => {
|
206
|
+
utilities.verifyElementVisibilityState(imageHighlightPage.applyToAllOptionsCheckbox(), 'visible');
|
207
|
+
utilities.verifyInnerText(imageHighlightPage.applyToAllOptionsCheckboxLabel(), 'Apply to all options');
|
208
|
+
imageHighlightPage.steps.verifyApplyToAllOptionsCheckboxChecked();
|
209
|
+
});
|
210
|
+
|
211
|
+
it('CSS of \'Border color\' defualt popup', { tags: 'css' }, () => {
|
212
|
+
utilities.verifyCSS(imageHighlightPage.colorPopupMenuLabel(), {
|
213
|
+
'color': css.color.labels,
|
214
|
+
'font-size': css.fontSize.default,
|
215
|
+
'font-weight': css.fontWeight.semibold
|
216
|
+
});
|
217
|
+
utilities.verifyCSS(imageHighlightPage.defaultStateColorLabel(), {
|
218
|
+
'color': css.color.labels,
|
219
|
+
'font-size': css.fontSize.normal,
|
220
|
+
'font-weight': css.fontWeight.semibold
|
221
|
+
});
|
222
|
+
utilities.verifyCSS(imageHighlightPage.activeStateColorLabel(), {
|
223
|
+
'color': css.color.labels,
|
224
|
+
'font-size': css.fontSize.normal,
|
225
|
+
'font-weight': css.fontWeight.semibold
|
226
|
+
});
|
227
|
+
utilities.verifyCSS(imageHighlightPage.defaultEditButtonText(), {
|
228
|
+
'color': css.color.activeButtons,
|
229
|
+
'font-size': css.fontSize.default,
|
230
|
+
'font-weight': css.fontWeight.regular
|
231
|
+
});
|
232
|
+
utilities.verifyCSS(imageHighlightPage.activeEditButtonText(), {
|
233
|
+
'color': css.color.activeButtons,
|
234
|
+
'font-size': css.fontSize.default,
|
235
|
+
'font-weight': css.fontWeight.regular
|
236
|
+
});
|
237
|
+
utilities.verifyCSS(imageHighlightPage.applyToAllOptionsCheckboxLabel(), {
|
238
|
+
'color': css.color.labels,
|
239
|
+
'font-size': css.fontSize.normal,
|
240
|
+
'font-weight': css.fontWeight.regular
|
241
|
+
});
|
242
|
+
});
|
243
|
+
|
244
|
+
it('Accessibility of \'Border color\' defualt popup', { tags: 'a11y' }, () => {
|
245
|
+
cy.checkAccessibility(imageHighlightPage.colorPopupWrapper());
|
246
|
+
});
|
247
|
+
|
248
|
+
imageHighlightPage.tests.verifyColorPopupContentCSSandAccessibility('Border color');
|
249
|
+
|
250
|
+
it('When user updates the default color from the border color popup then the edited border color should be displayed on the default state of all highlight regions for \'Specify correct answer\ section', () => {
|
251
|
+
imageHighlightPage.steps.clickOnCancelButton();
|
252
|
+
imageHighlightPage.steps.clickOnBorderColorIcon();
|
253
|
+
imageHighlightPage.steps.clickOnDefaultStateColorEditButton();
|
254
|
+
colorPopupComponent.steps.clickInColorSaturationPalette();
|
255
|
+
imageHighlightPage.steps.verifySelectedColorBlock(defaultStateColor);
|
256
|
+
imageHighlightPage.steps.clickOnOkButton();
|
257
|
+
imageHighlightPage.steps.verifyEditedBorderColorInSpecifyCorrectAnswerSection(2, defaultStateColor);
|
258
|
+
imageHighlightPage.steps.verifyEditedBorderColorInSpecifyCorrectAnswerSection(3, defaultStateColor);
|
259
|
+
});
|
260
|
+
|
261
|
+
it('When user updates the active color from the border color popup then the edited border color should be displayed on the selected state of all highlight regions for \'Specify correct answer\ options', () => {
|
262
|
+
imageHighlightPage.steps.clickOnBorderColorIcon();
|
263
|
+
imageHighlightPage.steps.clickOnActiveStateColorEditButton();
|
264
|
+
colorPopupComponent.steps.clickInColorHuePalette();
|
265
|
+
colorPopupComponent.steps.clickInColorSaturationPalette();
|
266
|
+
imageHighlightPage.steps.verifySelectedColorBlock(activeStateColor);
|
267
|
+
imageHighlightPage.steps.clickOnOkButton();
|
268
|
+
imageHighlightPage.steps.verifyEditedBorderColorInSpecifyCorrectAnswerSection(0, activeStateColor);
|
269
|
+
imageHighlightPage.steps.verifyEditedBorderColorInSpecifyCorrectAnswerSection(1, activeStateColor);
|
270
|
+
});
|
271
|
+
|
272
|
+
it('When user selects a region in \'Specify possible options\' and updates the default color from the border color popup and unchecks the \'Apply to all options\' checkbox then the edited border color should be displayed on the default state of selected highlight regions for \'Specify correct answer\ section and other regions should be in their previous state', () => {
|
273
|
+
imageHighlightPage.steps.selectARegionInSpecifyPossibleOptions(leafHighlightRegion);
|
274
|
+
imageHighlightPage.steps.clickOnBorderColorIcon();
|
275
|
+
imageHighlightPage.steps.uncheckApplyToAllOptionsCheckbox();
|
276
|
+
imageHighlightPage.steps.clickOnDefaultStateColorEditButton();
|
277
|
+
colorPopupComponent.steps.clickInColorHuePalette();
|
278
|
+
colorPopupComponent.steps.clickInColorSaturationPalette();
|
279
|
+
imageHighlightPage.steps.verifySelectedColorBlock(activeStateColor);
|
280
|
+
imageHighlightPage.steps.clickOnOkButton();
|
281
|
+
imageHighlightPage.steps.verifyEditedBorderColorInSpecifyCorrectAnswerSection(2, activeStateColor);
|
282
|
+
imageHighlightPage.steps.verifyEditedBorderColorInSpecifyCorrectAnswerSection(3, defaultStateColor);
|
283
|
+
});
|
284
|
+
|
285
|
+
it('When user selects a region in \'Specify possible options\' and updates the active color from the border color popup and unchecks the \'Apply to all options\' checkbox then the edited border color should be displayed on the default state of selected highlight regions for \'Specify correct answer\ section and other regions should be in their previous state', () => {
|
286
|
+
imageHighlightPage.steps.selectARegionInSpecifyPossibleOptions(flowerHighlightRegion);
|
287
|
+
imageHighlightPage.steps.clickOnBorderColorIcon();
|
288
|
+
imageHighlightPage.steps.clickOnActiveStateColorEditButton();
|
289
|
+
colorPopupComponent.steps.clickInColorSaturationPalette();
|
290
|
+
imageHighlightPage.steps.verifySelectedColorBlock(defaultStateColor);
|
291
|
+
imageHighlightPage.steps.clickOnOkButton();
|
292
|
+
imageHighlightPage.steps.verifyEditedBorderColorInSpecifyCorrectAnswerSection(0, defaultStateColor);
|
293
|
+
imageHighlightPage.steps.verifyEditedBorderColorInSpecifyCorrectAnswerSection(1, activeStateColor);
|
294
|
+
});
|
295
|
+
});
|
296
|
+
|
297
|
+
describe('Border style image highlight style : Edit tab content and functionality', () => {
|
298
|
+
abortEarlySetup();
|
299
|
+
before(() => {
|
300
|
+
imageHighlightPage.steps.navigateToCreateQuestion('image highlight');
|
301
|
+
imageHighlightPage.steps.uploadFile('highlightImage.jpg');
|
302
|
+
imageHighlightPage.steps.verifyImageUploadedInSpecifyPossibleOptionsSection();
|
303
|
+
imageHighlightPage.steps.verifyImageUploadedSpecifyCorrectAnswer();
|
304
|
+
imageHighlightPage.steps.highlightRegionInImage(flowerHighlightRegion);
|
305
|
+
imageHighlightPage.steps.highlightRegionInImage(branchesHighlightRegion);
|
306
|
+
imageHighlightPage.steps.highlightRegionInImage(leafHighlightRegion);
|
307
|
+
imageHighlightPage.steps.highlightRegionInImage(rootsHighlightRegion);
|
308
|
+
imageHighlightPage.steps.highlightARegionInSpecifyCorrectAnswerSection(0);
|
309
|
+
imageHighlightPage.steps.highlightARegionInSpecifyCorrectAnswerSection(1);
|
310
|
+
});
|
311
|
+
|
312
|
+
it('\'Border style\' icon should be displayed and as user hovers over it then a tooltip \'Border style\' should be displayed', () => {
|
313
|
+
utilities.verifyElementVisibilityState(imageHighlightPage.borderStyleButton(), 'visible');
|
314
|
+
imageHighlightPage.steps.verifyToolTipText(3, imageHighlightPage.borderStyleButton(), 'Border style');
|
315
|
+
});
|
316
|
+
|
317
|
+
it('When user clicks on the \'Border style\' icon then a popup should be displayed', () => {
|
318
|
+
imageHighlightPage.steps.clickOnBorderStyleIcon();
|
319
|
+
utilities.verifyElementVisibilityState(imageHighlightPage.colorPopupWrapper(), 'visible');
|
320
|
+
});
|
321
|
+
|
322
|
+
it('In the popup, the \'Border style\' label should be displayed', () => {
|
323
|
+
utilities.verifyElementVisibilityState(imageHighlightPage.colorPopupMenuLabel(), 'visible');
|
324
|
+
utilities.verifyInnerText(imageHighlightPage.colorPopupMenuLabel(), 'Border style');
|
325
|
+
});
|
326
|
+
|
327
|
+
it('Two toggle buttons Default and Active should be displayed and by default \'Active\' toggle button should be selected', () => {
|
328
|
+
utilities.verifyElementVisibilityState(imageHighlightPage.activeDefaultToggleButton('active'), 'visible');
|
329
|
+
utilities.verifyInnerText(imageHighlightPage.activeDefaultToggleButton('active'), 'Active');
|
330
|
+
utilities.verifyElementVisibilityState(imageHighlightPage.activeDefaultToggleButton('default'), 'visible');
|
331
|
+
utilities.verifyInnerText(imageHighlightPage.activeDefaultToggleButton('default'), 'Default');
|
332
|
+
imageHighlightPage.steps.verifyActiveDefaultToggleButtonSelected('active');
|
333
|
+
});
|
334
|
+
|
335
|
+
it('Four border style buttons \'Dashed\', \'Dotted\',\'Default\' and \'No-Border\' should be dispalyed and by default \'Default\' style should be selected', () => {
|
336
|
+
imageHighlightPage.steps.verifyBorderStyleButtonsVisible();
|
337
|
+
imageHighlightPage.steps.verifyDefaultStyleButtonSelected();
|
338
|
+
});
|
339
|
+
|
340
|
+
it('\'Apply to all options\' checkbox should be displayed and by default checkbox should be checked', () => {
|
341
|
+
utilities.verifyElementVisibilityState(imageHighlightPage.applyToAllOptionsCheckboxLabel(), 'visible');
|
342
|
+
utilities.verifyInnerText(imageHighlightPage.applyToAllOptionsCheckboxLabel(), 'Apply to all options');
|
343
|
+
imageHighlightPage.steps.verifyApplyToAllOptionsCheckboxChecked();
|
344
|
+
});
|
345
|
+
|
346
|
+
it('When user selects Default toggle button then four border style options \'Dashed\', \'Dotted\',\'Default\' and \'No-Border\' should be displayed and by default the \'Default\' style should be selected', () => {
|
347
|
+
imageHighlightPage.steps.selectActiveDefaultToggleButton('default');
|
348
|
+
imageHighlightPage.steps.verifyBorderStyleButtonsVisible();
|
349
|
+
imageHighlightPage.steps.verifyDefaultStyleButtonSelected();
|
350
|
+
});
|
351
|
+
|
352
|
+
it('\'Apply to all options\' checkbox should be displayed and by default checkbox should be checked', () => {
|
353
|
+
utilities.verifyElementVisibilityState(imageHighlightPage.applyToAllOptionsCheckboxLabel(), 'visible');
|
354
|
+
utilities.verifyInnerText(imageHighlightPage.applyToAllOptionsCheckboxLabel(), 'Apply to all options');
|
355
|
+
imageHighlightPage.steps.verifyApplyToAllOptionsCheckboxChecked();
|
356
|
+
cy.log('Swiching toggle button to active as required for next test cases');
|
357
|
+
imageHighlightPage.steps.selectActiveDefaultToggleButton('active');
|
358
|
+
});
|
359
|
+
|
360
|
+
it('CSS of \'Border style\' defualt popup', { tags: 'css' }, () => {
|
361
|
+
utilities.verifyCSS(imageHighlightPage.colorPopupMenuLabel(), {
|
362
|
+
'color': css.color.labels,
|
363
|
+
'font-size': css.fontSize.default,
|
364
|
+
'font-weight': css.fontWeight.semibold
|
365
|
+
});
|
366
|
+
utilities.verifyCSS(imageHighlightPage.applyToAllOptionsCheckboxLabel(), {
|
367
|
+
'color': css.color.labels,
|
368
|
+
'font-size': css.fontSize.normal,
|
369
|
+
'font-weight': css.fontWeight.regular
|
370
|
+
});
|
371
|
+
utilities.verifyCSS(imageHighlightPage.activeDefaultToggleButton('default'), {
|
372
|
+
'background-color': css.color.primaryBtn,
|
373
|
+
'font-size': css.fontSize.normal,
|
374
|
+
'font-weight': css.fontWeight.bold,
|
375
|
+
});
|
376
|
+
utilities.verifyCSS(imageHighlightPage.activeDefaultToggleButton('active'), {
|
377
|
+
'background-color': css.color.activeButtons,
|
378
|
+
'font-size': css.fontSize.normal,
|
379
|
+
'font-weight': css.fontWeight.bold,
|
380
|
+
});
|
381
|
+
});
|
382
|
+
|
383
|
+
it('Accessibility of \'Border color\' defualt popup', { tags: 'a11y' }, () => {
|
384
|
+
cy.checkAccessibility(imageHighlightPage.colorPopupWrapper());
|
385
|
+
});
|
386
|
+
|
387
|
+
borderStyleOptions.forEach((borderStyle) => {
|
388
|
+
it(`When user updates the active border style to ${borderStyle} and \'Apply to all options\' checkbox is checked and user selects the highlight regions in \'Specify correct answer\' section then the ${borderStyle} border style should be applied to all correct highlight regions and non-correct regions should be in previous state.`, () => {
|
389
|
+
imageHighlightPage.steps.verifyActiveDefaultToggleButtonSelected('active');
|
390
|
+
imageHighlightPage.steps.selectBorderStyleForHighlightRegions(`${borderStyle}`);
|
391
|
+
imageHighlightPage.steps.verifyBorderStyleForHighlightRegionsSpecifyCorrectAnswer(`${borderStyle}`, 0);
|
392
|
+
imageHighlightPage.steps.verifyBorderStyleForHighlightRegionsSpecifyCorrectAnswer(`${borderStyle}`, 1);
|
393
|
+
imageHighlightPage.steps.verifyBorderStyleForHighlightRegionsSpecifyCorrectAnswer('Default', 2);
|
394
|
+
imageHighlightPage.steps.verifyBorderStyleForHighlightRegionsSpecifyCorrectAnswer('Default', 3);
|
395
|
+
imageHighlightPage.steps.clickOnBorderStyleIcon();
|
396
|
+
});
|
397
|
+
});
|
398
|
+
|
399
|
+
it('Pre steps for next case: When user selects a specific region in \'Specify possible options\' and then uncheck the \'Apply to all options\' checkbox then the changes should be applied to only that highlight region', () => {
|
400
|
+
imageHighlightPage.steps.selectARegionInSpecifyPossibleOptions(flowerHighlightRegion);
|
401
|
+
imageHighlightPage.steps.clickOnBorderStyleIcon();
|
402
|
+
imageHighlightPage.steps.uncheckApplyToAllOptionsCheckbox();
|
403
|
+
imageHighlightPage.steps.clickOnBorderStyleIcon();
|
404
|
+
});
|
405
|
+
|
406
|
+
borderStyleOptions.forEach((borderStyle) => {
|
407
|
+
it(`When user selects a single region in the \'Specify possible options\' and updates the active border style to ${borderStyle} and \'Apply to all options\' checkbox is unchecked then the ${borderStyle} border style should be applied to that correct highlight region only in \'Specify correct answer\' section and other regions should be in previous state.`, () => {
|
408
|
+
imageHighlightPage.steps.clickOnBorderStyleIcon();
|
409
|
+
imageHighlightPage.steps.verifyActiveDefaultToggleButtonSelected('active');
|
410
|
+
imageHighlightPage.steps.selectBorderStyleForHighlightRegions(`${borderStyle}`);
|
411
|
+
imageHighlightPage.steps.verifyBorderStyleForHighlightRegionsSpecifyCorrectAnswer(`${borderStyle}`, 0);
|
412
|
+
imageHighlightPage.steps.verifyBorderStyleForHighlightRegionsSpecifyCorrectAnswer('None', 1);
|
413
|
+
imageHighlightPage.steps.verifyBorderStyleForHighlightRegionsSpecifyCorrectAnswer('Default', 2);
|
414
|
+
imageHighlightPage.steps.verifyBorderStyleForHighlightRegionsSpecifyCorrectAnswer('Default', 3);
|
415
|
+
});
|
416
|
+
});
|
417
|
+
|
418
|
+
it('Pre steps for next case: When user selects \'Default\' option in popup and check the \'Apply to all options\' checkbox, then the border style should be applied to the default state of all highlight regions', () => {
|
419
|
+
imageHighlightPage.steps.clickOnBorderStyleIcon();
|
420
|
+
imageHighlightPage.steps.checkApplyToAllOptionsCheckbox();
|
421
|
+
imageHighlightPage.steps.clickOnBorderStyleIcon();
|
422
|
+
});
|
423
|
+
|
424
|
+
borderStyleOptions.forEach((borderStyle) => {
|
425
|
+
it(`When user updates the default border style to ${borderStyle} and \'Apply to all options\' checkbox is checked then the ${borderStyle} border style should be applied to all highlight regions in \'Specify possible options\' and non-correct highlight regions in \'Specify correct answer\' section.`, () => {
|
426
|
+
imageHighlightPage.steps.clickOnBorderStyleIcon();
|
427
|
+
imageHighlightPage.steps.selectActiveDefaultToggleButton('default');
|
428
|
+
imageHighlightPage.steps.selectBorderStyleForHighlightRegions(`${borderStyle}`);
|
429
|
+
imageHighlightPage.steps.verifyBorderStyleForHighlightRegionsSpecifyCorrectAnswer('None', 0);
|
430
|
+
imageHighlightPage.steps.verifyBorderStyleForHighlightRegionsSpecifyCorrectAnswer('None', 1);
|
431
|
+
imageHighlightPage.steps.verifyBorderStyleForHighlightRegionsSpecifyCorrectAnswer(`${borderStyle}`, 2);
|
432
|
+
imageHighlightPage.steps.verifyBorderStyleForHighlightRegionsSpecifyCorrectAnswer(`${borderStyle}`, 3);
|
433
|
+
});
|
434
|
+
});
|
435
|
+
|
436
|
+
it('Pre steps for next case: When user selects a specific region in \'Specify possible options\' and then uncheck the \'Apply to all options\' checkbox then the changes should be applied to only that region', () => {
|
437
|
+
imageHighlightPage.steps.selectARegionInSpecifyPossibleOptions(leafHighlightRegion);
|
438
|
+
imageHighlightPage.steps.clickOnBorderStyleIcon();
|
439
|
+
imageHighlightPage.steps.uncheckApplyToAllOptionsCheckbox();
|
440
|
+
imageHighlightPage.steps.clickOnBorderStyleIcon();
|
441
|
+
});
|
442
|
+
|
443
|
+
borderStyleOptions.forEach((borderStyle) => {
|
444
|
+
it(`When user selects a single region in the \'Specify possible options\' and updates the default border style to ${borderStyle} and \'Apply to all options\' checkbox is unchecked then the ${borderStyle} border style should be applied to that highlight region in \'Specify possible options\' and \'Specify correct answer\' section. Other regions should be in their previous state.`, () => {
|
445
|
+
imageHighlightPage.steps.clickOnBorderStyleIcon();
|
446
|
+
imageHighlightPage.steps.verifyActiveDefaultToggleButtonSelected('default');
|
447
|
+
imageHighlightPage.steps.selectBorderStyleForHighlightRegions(`${borderStyle}`);
|
448
|
+
imageHighlightPage.steps.verifyBorderStyleForHighlightRegionsSpecifyCorrectAnswer(`${borderStyle}`, 2);
|
449
|
+
imageHighlightPage.steps.verifyBorderStyleForHighlightRegionsSpecifyCorrectAnswer('None', 0);
|
450
|
+
imageHighlightPage.steps.verifyBorderStyleForHighlightRegionsSpecifyCorrectAnswer('None', 1);
|
451
|
+
imageHighlightPage.steps.verifyBorderStyleForHighlightRegionsSpecifyCorrectAnswer('None', 3);
|
452
|
+
});
|
453
|
+
});
|
454
|
+
});
|
455
|
+
|
456
|
+
describe('Fill color image highlight style : Preview tab and functionality', () => {
|
457
|
+
abortEarlySetup();
|
458
|
+
before(() => {
|
459
|
+
imageHighlightPage.steps.navigateToCreateQuestion('image highlight');
|
460
|
+
imageHighlightPage.steps.uploadFile('highlightImage.jpg');
|
461
|
+
imageHighlightPage.steps.verifyImageUploadedInSpecifyPossibleOptionsSection();
|
462
|
+
imageHighlightPage.steps.verifyImageUploadedSpecifyCorrectAnswer();
|
463
|
+
imageHighlightPage.steps.highlightRegionInImage(flowerHighlightRegion);
|
464
|
+
imageHighlightPage.steps.highlightRegionInImage(branchesHighlightRegion);
|
465
|
+
imageHighlightPage.steps.highlightRegionInImage(leafHighlightRegion);
|
466
|
+
imageHighlightPage.steps.highlightRegionInImage(rootsHighlightRegion);
|
467
|
+
imageHighlightPage.steps.highlightARegionInSpecifyCorrectAnswerSection(0);
|
468
|
+
imageHighlightPage.steps.highlightARegionInSpecifyCorrectAnswerSection(1);
|
469
|
+
imageHighlightPage.steps.checkShowAvailableOptionsToStudentsCheckbox();
|
470
|
+
});
|
471
|
+
|
472
|
+
it('When user updates the default color from the fill color popup then the edited color should be displayed on the default state of all highlight regions in the preview tab', () => {
|
473
|
+
imageHighlightPage.steps.clickOnFillColorIcon();
|
474
|
+
imageHighlightPage.steps.clickOnDefaultStateColorEditButton();
|
475
|
+
colorPopupComponent.steps.clickInColorSaturationPalette();
|
476
|
+
imageHighlightPage.steps.verifySelectedColorBlock(defaultStateColor);
|
477
|
+
imageHighlightPage.steps.clickOnOkButton();
|
478
|
+
imageHighlightPage.steps.switchToPreviewTab();
|
479
|
+
imageHighlightPage.steps.verifyEditedFillColorInPreviewtabSection(0, defaultStateColor);
|
480
|
+
imageHighlightPage.steps.verifyEditedFillColorInPreviewtabSection(1, defaultStateColor);
|
481
|
+
imageHighlightPage.steps.verifyEditedFillColorInPreviewtabSection(2, defaultStateColor);
|
482
|
+
imageHighlightPage.steps.verifyEditedFillColorInPreviewtabSection(3, defaultStateColor);
|
483
|
+
});
|
484
|
+
|
485
|
+
it('When user updates the active color from the fill color popup and in preview tab selects regions, then the edited color should be displayed on the selected state of all highlight regions', () => {
|
486
|
+
imageHighlightPage.steps.switchToEditTab();
|
487
|
+
imageHighlightPage.steps.clickOnFillColorIcon();
|
488
|
+
imageHighlightPage.steps.clickOnActiveStateColorEditButton();
|
489
|
+
colorPopupComponent.steps.clickInColorHuePalette();
|
490
|
+
colorPopupComponent.steps.clickInColorSaturationPalette();
|
491
|
+
imageHighlightPage.steps.verifySelectedColorBlock(activeStateColor);
|
492
|
+
imageHighlightPage.steps.clickOnOkButton();
|
493
|
+
imageHighlightPage.steps.switchToPreviewTab();
|
494
|
+
imageHighlightPage.steps.clickOnARegionInPreviewTab(0);
|
495
|
+
imageHighlightPage.steps.clickOnARegionInPreviewTab(1);
|
496
|
+
imageHighlightPage.steps.verifyEditedFillColorInPreviewtabSection(0, activeStateColor);
|
497
|
+
imageHighlightPage.steps.verifyEditedFillColorInPreviewtabSection(1, activeStateColor);
|
498
|
+
imageHighlightPage.steps.verifyEditedFillColorInPreviewtabSection(2, defaultStateColor);
|
499
|
+
imageHighlightPage.steps.verifyEditedFillColorInPreviewtabSection(3, defaultStateColor);
|
500
|
+
});
|
501
|
+
|
502
|
+
it('When user selects a region in \'Specify possible options\' and updates the default color from the fill color popup and unchecks the \'Apply to all options\' checkbox then the edited color should be displayed on the default state of selected highlight regions in the preview tab and other regions should be in their previous state', () => {
|
503
|
+
imageHighlightPage.steps.switchToEditTab();
|
504
|
+
imageHighlightPage.steps.selectARegionInSpecifyPossibleOptions(leafHighlightRegion);
|
505
|
+
imageHighlightPage.steps.clickOnFillColorIcon();
|
506
|
+
imageHighlightPage.steps.uncheckApplyToAllOptionsCheckbox();
|
507
|
+
imageHighlightPage.steps.clickOnDefaultStateColorEditButton();
|
508
|
+
colorPopupComponent.steps.clickInColorHuePalette();
|
509
|
+
colorPopupComponent.steps.clickInColorSaturationPalette();
|
510
|
+
imageHighlightPage.steps.verifySelectedColorBlock(activeStateColor);
|
511
|
+
imageHighlightPage.steps.clickOnOkButton();
|
512
|
+
imageHighlightPage.steps.switchToPreviewTab();
|
513
|
+
imageHighlightPage.steps.verifyEditedFillColorInPreviewtabSection(2, activeStateColor);
|
514
|
+
imageHighlightPage.steps.verifyEditedFillColorInPreviewtabSection(3, defaultStateColor);
|
515
|
+
});
|
516
|
+
|
517
|
+
it('When user selects a region in \'Specify possible options\' and updates the active color from the fill color popup and unchecks the \'Apply to all options\' checkbox and then selects a highlight region in preview tab then the edited color should be displayed on selected highlight regions and other regions should be in their previous state', () => {
|
518
|
+
imageHighlightPage.steps.switchToEditTab();
|
519
|
+
imageHighlightPage.steps.selectARegionInSpecifyPossibleOptions(flowerHighlightRegion);
|
520
|
+
imageHighlightPage.steps.clickOnFillColorIcon();
|
521
|
+
imageHighlightPage.steps.clickOnActiveStateColorEditButton();
|
522
|
+
colorPopupComponent.steps.clickInColorSaturationPalette();
|
523
|
+
imageHighlightPage.steps.verifySelectedColorBlock(defaultStateColor);
|
524
|
+
imageHighlightPage.steps.clickOnOkButton();
|
525
|
+
imageHighlightPage.steps.switchToPreviewTab();
|
526
|
+
imageHighlightPage.steps.clickOnARegionInPreviewTab(0);
|
527
|
+
imageHighlightPage.steps.clickOnARegionInPreviewTab(1);
|
528
|
+
imageHighlightPage.steps.verifyEditedFillColorInPreviewtabSection(0, defaultStateColor);
|
529
|
+
imageHighlightPage.steps.verifyEditedFillColorInPreviewtabSection(1, activeStateColor);
|
530
|
+
});
|
531
|
+
});
|
532
|
+
|
533
|
+
describe('Border color image highlight style : Preview tab functionality', () => {
|
534
|
+
abortEarlySetup();
|
535
|
+
before(() => {
|
536
|
+
imageHighlightPage.steps.navigateToCreateQuestion('image highlight');
|
537
|
+
imageHighlightPage.steps.uploadFile('highlightImage.jpg');
|
538
|
+
imageHighlightPage.steps.verifyImageUploadedInSpecifyPossibleOptionsSection();
|
539
|
+
imageHighlightPage.steps.verifyImageUploadedSpecifyCorrectAnswer();
|
540
|
+
imageHighlightPage.steps.highlightRegionInImage(flowerHighlightRegion);
|
541
|
+
imageHighlightPage.steps.highlightRegionInImage(branchesHighlightRegion);
|
542
|
+
imageHighlightPage.steps.highlightRegionInImage(leafHighlightRegion);
|
543
|
+
imageHighlightPage.steps.highlightRegionInImage(rootsHighlightRegion);
|
544
|
+
imageHighlightPage.steps.highlightARegionInSpecifyCorrectAnswerSection(0);
|
545
|
+
imageHighlightPage.steps.highlightARegionInSpecifyCorrectAnswerSection(1);
|
546
|
+
imageHighlightPage.steps.checkShowAvailableOptionsToStudentsCheckbox();
|
547
|
+
});
|
548
|
+
|
549
|
+
it('When user updates the default color from the border color popup then the edited border color should be displayed on the default state of all highlight regions in the preview tab', () => {
|
550
|
+
imageHighlightPage.steps.clickOnBorderColorIcon();
|
551
|
+
imageHighlightPage.steps.clickOnDefaultStateColorEditButton();
|
552
|
+
colorPopupComponent.steps.clickInColorSaturationPalette();
|
553
|
+
imageHighlightPage.steps.verifySelectedColorBlock(defaultStateColor);
|
554
|
+
imageHighlightPage.steps.clickOnOkButton();
|
555
|
+
imageHighlightPage.steps.switchToPreviewTab();
|
556
|
+
imageHighlightPage.steps.verifyEditedBorderColorInPreviewtabSection(0, defaultStateColor);
|
557
|
+
imageHighlightPage.steps.verifyEditedBorderColorInPreviewtabSection(1, defaultStateColor);
|
558
|
+
imageHighlightPage.steps.verifyEditedBorderColorInPreviewtabSection(2, defaultStateColor);
|
559
|
+
imageHighlightPage.steps.verifyEditedBorderColorInPreviewtabSection(3, defaultStateColor);
|
560
|
+
});
|
561
|
+
|
562
|
+
it('When user updates the active color from the border color popup and in preview tab selects correct regions, then the edited border color should be displayed on the selected state of all highlight regions', () => {
|
563
|
+
imageHighlightPage.steps.switchToEditTab();
|
564
|
+
imageHighlightPage.steps.clickOnBorderColorIcon();
|
565
|
+
imageHighlightPage.steps.clickOnActiveStateColorEditButton();
|
566
|
+
colorPopupComponent.steps.clickInColorHuePalette();
|
567
|
+
colorPopupComponent.steps.clickInColorSaturationPalette();
|
568
|
+
imageHighlightPage.steps.verifySelectedColorBlock(activeStateColor);
|
569
|
+
imageHighlightPage.steps.clickOnOkButton();
|
570
|
+
imageHighlightPage.steps.switchToPreviewTab();
|
571
|
+
imageHighlightPage.steps.clickOnARegionInPreviewTab(0);
|
572
|
+
imageHighlightPage.steps.clickOnARegionInPreviewTab(1);
|
573
|
+
imageHighlightPage.steps.verifyEditedBorderColorInPreviewtabSection(0, activeStateColor);
|
574
|
+
imageHighlightPage.steps.verifyEditedBorderColorInPreviewtabSection(1, activeStateColor);
|
575
|
+
imageHighlightPage.steps.verifyEditedBorderColorInPreviewtabSection(2, defaultStateColor);
|
576
|
+
imageHighlightPage.steps.verifyEditedBorderColorInPreviewtabSection(3, defaultStateColor);
|
577
|
+
});
|
578
|
+
|
579
|
+
it('When user selects a region in \'Specify possible options\' and updates the default color from the border color popup and unchecks the \'Apply to all options\' checkbox then the edited border color should be displayed on the default state of selected highlight regions in the preview tab and other regions should be in their previous state', () => {
|
580
|
+
imageHighlightPage.steps.switchToEditTab();
|
581
|
+
imageHighlightPage.steps.selectARegionInSpecifyPossibleOptions(leafHighlightRegion);
|
582
|
+
imageHighlightPage.steps.clickOnBorderColorIcon();
|
583
|
+
imageHighlightPage.steps.uncheckApplyToAllOptionsCheckbox();
|
584
|
+
imageHighlightPage.steps.clickOnDefaultStateColorEditButton();
|
585
|
+
colorPopupComponent.steps.clickInColorHuePalette();
|
586
|
+
colorPopupComponent.steps.clickInColorSaturationPalette();
|
587
|
+
imageHighlightPage.steps.verifySelectedColorBlock(activeStateColor);
|
588
|
+
imageHighlightPage.steps.clickOnOkButton();
|
589
|
+
imageHighlightPage.steps.switchToPreviewTab();
|
590
|
+
imageHighlightPage.steps.verifyEditedBorderColorInPreviewtabSection(2, activeStateColor);
|
591
|
+
imageHighlightPage.steps.verifyEditedBorderColorInPreviewtabSection(3, defaultStateColor);
|
592
|
+
});
|
593
|
+
|
594
|
+
it('When user selects a region in \'Specify possible options\' and updates the active color from the border color popup and unchecks the \'Apply to all options\' checkbox and then selects a highlight region in preview tab then the edited border color should be displayed on selected highlight regions and other regions should be in their previous state', () => {
|
595
|
+
imageHighlightPage.steps.switchToEditTab();
|
596
|
+
imageHighlightPage.steps.selectARegionInSpecifyPossibleOptions(flowerHighlightRegion);
|
597
|
+
imageHighlightPage.steps.clickOnBorderColorIcon();
|
598
|
+
imageHighlightPage.steps.clickOnActiveStateColorEditButton();
|
599
|
+
colorPopupComponent.steps.clickInColorSaturationPalette();
|
600
|
+
imageHighlightPage.steps.verifySelectedColorBlock(defaultStateColor);
|
601
|
+
imageHighlightPage.steps.clickOnOkButton();
|
602
|
+
imageHighlightPage.steps.switchToPreviewTab();
|
603
|
+
imageHighlightPage.steps.clickOnARegionInPreviewTab(0);
|
604
|
+
imageHighlightPage.steps.clickOnARegionInPreviewTab(1);
|
605
|
+
imageHighlightPage.steps.verifyEditedBorderColorInPreviewtabSection(0, defaultStateColor);
|
606
|
+
imageHighlightPage.steps.verifyEditedBorderColorInPreviewtabSection(1, activeStateColor);
|
607
|
+
});
|
608
|
+
});
|
609
|
+
|
610
|
+
describe('Border style image highlight style : Preview tab functionality', () => {
|
611
|
+
abortEarlySetup();
|
612
|
+
before(() => {
|
613
|
+
imageHighlightPage.steps.navigateToCreateQuestion('image highlight');
|
614
|
+
imageHighlightPage.steps.uploadFile('highlightImage.jpg');
|
615
|
+
imageHighlightPage.steps.verifyImageUploadedInSpecifyPossibleOptionsSection();
|
616
|
+
imageHighlightPage.steps.verifyImageUploadedSpecifyCorrectAnswer();
|
617
|
+
imageHighlightPage.steps.highlightRegionInImage(flowerHighlightRegion);
|
618
|
+
imageHighlightPage.steps.highlightRegionInImage(branchesHighlightRegion);
|
619
|
+
imageHighlightPage.steps.highlightRegionInImage(leafHighlightRegion);
|
620
|
+
imageHighlightPage.steps.highlightRegionInImage(rootsHighlightRegion);
|
621
|
+
imageHighlightPage.steps.highlightARegionInSpecifyCorrectAnswerSection(0);
|
622
|
+
imageHighlightPage.steps.highlightARegionInSpecifyCorrectAnswerSection(1);
|
623
|
+
imageHighlightPage.steps.checkShowAvailableOptionsToStudentsCheckbox();
|
624
|
+
});
|
625
|
+
|
626
|
+
borderStyleOptions.forEach((borderStyle) => {
|
627
|
+
it(`When user updates the active border style to ${borderStyle} in \'Edit tab\' and \'Apply to all options\' checkbox is checked then in the \'Preview tab\' when user selects the highlight regions then ${borderStyle} border style should be applied to all highlight regions and non-selected regions should be in previous state.`, () => {
|
628
|
+
imageHighlightPage.steps.clickOnBorderStyleIcon();
|
629
|
+
imageHighlightPage.steps.verifyActiveDefaultToggleButtonSelected('active');
|
630
|
+
imageHighlightPage.steps.selectBorderStyleForHighlightRegions(`${borderStyle}`);
|
631
|
+
imageHighlightPage.steps.switchToPreviewTab();
|
632
|
+
imageHighlightPage.steps.clickOnARegionInPreviewTab(0);
|
633
|
+
imageHighlightPage.steps.clickOnARegionInPreviewTab(1);
|
634
|
+
imageHighlightPage.steps.verifyBorderStyleForHighlightRegionsPreviewTab(`${borderStyle}`, 0);
|
635
|
+
imageHighlightPage.steps.verifyBorderStyleForHighlightRegionsPreviewTab(`${borderStyle}`, 1);
|
636
|
+
imageHighlightPage.steps.verifyBorderStyleForHighlightRegionsPreviewTab('Default', 2);
|
637
|
+
imageHighlightPage.steps.verifyBorderStyleForHighlightRegionsPreviewTab('Default', 3);
|
638
|
+
imageHighlightPage.steps.switchToEditTab();
|
639
|
+
});
|
640
|
+
});
|
641
|
+
|
642
|
+
it('Pre steps for next case: When user selects a specific region in \'Specify possible options\' and then uncheck the \'Apply to all options\' checkbox then the changes should be applied to only that region in preview tab', () => {
|
643
|
+
imageHighlightPage.steps.selectARegionInSpecifyPossibleOptions(flowerHighlightRegion);
|
644
|
+
imageHighlightPage.steps.clickOnBorderStyleIcon();
|
645
|
+
imageHighlightPage.steps.uncheckApplyToAllOptionsCheckbox();
|
646
|
+
imageHighlightPage.steps.clickOnBorderStyleIcon();
|
647
|
+
});
|
648
|
+
|
649
|
+
borderStyleOptions.forEach((borderStyle) => {
|
650
|
+
it(`When user selects a single region in the \'Specify possible options\' and updates the active border style to ${borderStyle} in \'Edit tab\' and \'Apply to all options\' checkbox is unchecked and when user switches to preview tab and selects same region then the ${borderStyle} border style should be applied to that highlight region only and other regions should be in previous state.`, () => {
|
651
|
+
imageHighlightPage.steps.clickOnBorderStyleIcon();
|
652
|
+
imageHighlightPage.steps.verifyActiveDefaultToggleButtonSelected('active');
|
653
|
+
imageHighlightPage.steps.selectBorderStyleForHighlightRegions(`${borderStyle}`);
|
654
|
+
imageHighlightPage.steps.switchToPreviewTab();
|
655
|
+
imageHighlightPage.steps.clickOnARegionInPreviewTab(0);
|
656
|
+
imageHighlightPage.steps.clickOnARegionInPreviewTab(1);
|
657
|
+
imageHighlightPage.steps.verifyBorderStyleForHighlightRegionsPreviewTab(`${borderStyle}`, 0);
|
658
|
+
imageHighlightPage.steps.verifyBorderStyleForHighlightRegionsPreviewTab('None', 1);
|
659
|
+
imageHighlightPage.steps.verifyBorderStyleForHighlightRegionsPreviewTab('Default', 2);
|
660
|
+
imageHighlightPage.steps.verifyBorderStyleForHighlightRegionsPreviewTab('Default', 3);
|
661
|
+
imageHighlightPage.steps.switchToEditTab();
|
662
|
+
});
|
663
|
+
});
|
664
|
+
|
665
|
+
it('Pre steps for next case: When user selects \'Defualt\' border style option in popup and check the \'Apply to all options\' checkbox, then the border style should be applied to the default state of all highlight regions in preview tab', () => {
|
666
|
+
imageHighlightPage.steps.clickOnBorderStyleIcon();
|
667
|
+
imageHighlightPage.steps.checkApplyToAllOptionsCheckbox();
|
668
|
+
imageHighlightPage.steps.clickOnBorderStyleIcon();
|
669
|
+
});
|
670
|
+
|
671
|
+
borderStyleOptions.forEach((borderStyle) => {
|
672
|
+
it(`When user updates the default border style to ${borderStyle} in \'Edit tab\' and \'Apply to all options\' checkbox is checked then the ${borderStyle} border style should be applied to all highlight regions in the \'Preview tab\'.`, () => {
|
673
|
+
imageHighlightPage.steps.clickOnBorderStyleIcon();
|
674
|
+
imageHighlightPage.steps.clickOnDefaultToggleButton();
|
675
|
+
imageHighlightPage.steps.selectBorderStyleForHighlightRegions(`${borderStyle}`);
|
676
|
+
imageHighlightPage.steps.switchToPreviewTab();
|
677
|
+
imageHighlightPage.steps.clickOnARegionInPreviewTab(0);
|
678
|
+
imageHighlightPage.steps.clickOnARegionInPreviewTab(1);
|
679
|
+
imageHighlightPage.steps.verifyBorderStyleForHighlightRegionsPreviewTab('None', 0);
|
680
|
+
imageHighlightPage.steps.verifyBorderStyleForHighlightRegionsPreviewTab('None', 1);
|
681
|
+
imageHighlightPage.steps.verifyBorderStyleForHighlightRegionsPreviewTab(`${borderStyle}`, 2);
|
682
|
+
imageHighlightPage.steps.verifyBorderStyleForHighlightRegionsPreviewTab(`${borderStyle}`, 3);
|
683
|
+
imageHighlightPage.steps.switchToEditTab();
|
684
|
+
});
|
685
|
+
});
|
686
|
+
|
687
|
+
it('Pre steps for next case: When user selects a specific region in \'Specify possible options\' and then uncheck the \'Apply to all options\' checkbox then the changes should be applied to only that region i preview tab', () => {
|
688
|
+
imageHighlightPage.steps.clickOnBorderStyleIcon();
|
689
|
+
imageHighlightPage.steps.uncheckApplyToAllOptionsCheckbox();
|
690
|
+
imageHighlightPage.steps.clickOnBorderStyleIcon();
|
691
|
+
});
|
692
|
+
|
693
|
+
borderStyleOptions.forEach((borderStyle) => {
|
694
|
+
it(`When user selects a single region in the \'Specify possible options\' and updates the default border style to ${borderStyle} in \'Edit tab\' and \'Apply to all options\' checkbox is unchecked then the ${borderStyle} border style should be applied to that highlight region in the \'Preview tab\' and other regions should be in their previous state.`, () => {
|
695
|
+
imageHighlightPage.steps.clickOnBorderStyleIcon();
|
696
|
+
imageHighlightPage.steps.verifyActiveDefaultToggleButtonSelected('default');
|
697
|
+
imageHighlightPage.steps.selectBorderStyleForHighlightRegions(`${borderStyle}`);
|
698
|
+
imageHighlightPage.steps.switchToPreviewTab();
|
699
|
+
imageHighlightPage.steps.verifyBorderStyleForHighlightRegionsPreviewTab('None', 3);
|
700
|
+
imageHighlightPage.steps.verifyBorderStyleForHighlightRegionsPreviewTab(`${borderStyle}`, 0);
|
701
|
+
imageHighlightPage.steps.verifyBorderStyleForHighlightRegionsPreviewTab('None', 1);
|
702
|
+
imageHighlightPage.steps.verifyBorderStyleForHighlightRegionsPreviewTab('None', 2);
|
703
|
+
imageHighlightPage.steps.switchToEditTab();
|
704
|
+
});
|
705
|
+
});
|
706
|
+
});
|
707
|
+
});
|