itemengine-cypress-automation 1.0.209-graphqlStagingUpdate-7ab593a.0 → 1.0.209
Sign up to get free protection for your applications and to get access to all the features.
- package/cypress/e2e/ILC/AudioPlayerNew/barAudioPlayerStyle.js +1 -1
- package/cypress/e2e/ILC/AudioPlayerNew/standardAudioPlayerStyle.js +1 -1
- package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/specifyCorrectAnswerSection.js +1 -1
- package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/styleAndLayoutCustomization.js +22 -22
- package/cypress/e2e/ILC/Graphing/Scoring/allOrNothingWithAlternativePointsGreaterThanCorrectPoints.js +1 -1
- package/cypress/e2e/ILC/Graphing/Scoring/allOrNothingWithCorrectPointsEqualToAlternatePoints.js +1 -1
- package/cypress/e2e/ILC/Graphing/Scoring/allOrNothingWithCorrectPointsGreaterThanAlternativePoints.js +1 -1
- package/cypress/e2e/ILC/Graphing/Scoring/manuallyAndNonScoredScoring.js +1 -1
- package/cypress/e2e/ILC/Graphing/toolsControlsAndBackgroundSection.js +824 -388
- package/cypress/e2e/ILC/GridFill/allOrNothingBasicForAllViews.smoke.js +1 -1
- package/cypress/e2e/ILC/GridFill/scoring/cellShadeCountPartialEqualWeightsWithAlternativePointsGreaterThanCorrectPoints.js +2 -2
- package/cypress/e2e/ILC/GridFill/scoring/cellShadeCountPartialEqualWeightsWithCorrectPointsGreaterThanAlternativePoints.js +1 -1
- package/cypress/e2e/ILC/ImageHighlight/Scoring/allOrNothingWithAlternativePointsGreaterThanCorrectPoints.js +19 -18
- package/cypress/e2e/ILC/ImageHighlight/Scoring/allOrNothingWithCorrectPointsEqualToAlternativePoints.js +27 -26
- package/cypress/e2e/ILC/ImageHighlight/Scoring/allOrNothingWithCorrectPointsGreaterThanAlternatePoints.js +27 -26
- package/cypress/e2e/ILC/ImageHighlight/Scoring/manuallyAndNonScored.js +10 -9
- package/cypress/e2e/ILC/ImageHighlight/Scoring/partialDifferentWeightsAlternativePointsGreaterThanCorrectPoints.js +23 -22
- package/cypress/e2e/ILC/ImageHighlight/Scoring/partialDifferentWeightsScoring.js +7 -6
- package/cypress/e2e/ILC/ImageHighlight/Scoring/partialDifferentWeightsWithCorrectPointsEqualToAlternativePoints.js +29 -28
- package/cypress/e2e/ILC/ImageHighlight/Scoring/partialDifferentWeigtsCorrectPointsGreaterThanAlternativePoints.js +30 -29
- package/cypress/e2e/ILC/ImageHighlight/Scoring/partialEqualWeightsAlternativePointsGreaterThanCorrectPoints.js +22 -21
- package/cypress/e2e/ILC/ImageHighlight/Scoring/partialEqualWeightsScoring.js +7 -6
- package/cypress/e2e/ILC/ImageHighlight/Scoring/partialEqualWeightsWithCorrectPointsEqualToAlternativePoints.js +27 -26
- package/cypress/e2e/ILC/ImageHighlight/Scoring/partialEqualWeightsWithCorrectPointsGreaterThanAlternativePoints.js +30 -29
- package/cypress/e2e/ILC/ImageHighlight/Scoring/singleSelectionPreviewScoring.js +21 -14
- package/cypress/e2e/ILC/ImageHighlight/allOrNothingForAllViews.smoke.js +17 -15
- package/cypress/e2e/ILC/ListOrderingDropdown/Scoring/partialDifferentWeightsAlternativePointsGreaterThanCorrectPoints.js +4 -4
- package/cypress/e2e/ILC/ListOrderingDropdown/Scoring/partialDifferentWeightsCorrectPointsEqualToAlternativePoints.js +2 -5
- package/cypress/e2e/ILC/ListOrderingDropdown/Scoring/partialDifferentWeightsCorrectPointsGreaterThanAlternativePoints.js +2 -3
- package/cypress/e2e/ILC/ListOrderingNew/horizontalOrientationAllOrNothingForAllViews.smoke.js +5 -1
- package/cypress/e2e/ILC/TextEntryMath/evaluationMethodEquivalentStructures.js +16 -16
- package/cypress/e2e/ILC/TextEntryMath/evaluationMethodMatchValue.js +4 -2
- package/cypress/e2e/ILC/TextEntryMath/evaluationMethodSymbolsAreEquivalent.js +7 -7
- package/cypress/e2e/ILC/TextEntryMath/evaluationMethodValueIsEquivalent.js +4 -4
- package/cypress/e2e/ILC/TextEntryMath/evaluationMethodsWithoutSetResponse.js +7 -9
- package/cypress/pages/components/correctIncorrectAnswerLabelComponent.js +4 -0
- package/cypress/pages/components/createCustomCategoryFlyout.js +4 -3
- package/cypress/pages/fillInTheGapsDragAndDropPage.js +1 -1
- package/cypress/pages/gridFillPage.js +5 -0
- package/cypress/pages/imageHighlightPage.js +2 -2
- package/cypress/pages/videoResponsePage.js +1 -1
- package/package.json +2 -2
@@ -1,388 +1,824 @@
|
|
1
|
-
import { dialogBoxBase, graphingPage } from "../../../pages";
|
2
|
-
import abortEarlySetup from "../../../support/helpers/abortEarly";
|
3
|
-
import utilities from "../../../support/helpers/utilities";
|
4
|
-
const unselectedToolOption = ['Circle', 'Parabola', 'Sine', 'Polygon'];
|
5
|
-
const selectedToolOption = ['Point', 'Line', 'Label', 'Ray', 'Segment', 'Vector'];
|
6
|
-
const controlOptions = ['Move', 'Undo', 'Redo', 'Reset'];
|
7
|
-
const patternOptions = ['Grid', 'Lines', 'Dots', 'Circular', 'Quadrant'];
|
8
|
-
const patternOptionsAltText = ['Grid pattern of evenly spaced horizontal and vertical lines', 'Line pattern of evenly spaced horizontal lines', 'Dot pattern of evenly spaced horizontal and vertical dots', 'Circular pattern of evenly spaced concentric circles', 'Quadrant pattern of evenly spaced horizontal and vertical lines'];
|
9
|
-
const alignmentOptions = ['Top left', 'Center', 'Top right'];
|
10
|
-
const toolOptions = [...selectedToolOption, ...unselectedToolOption];
|
11
|
-
const css = Cypress.env('css');
|
12
|
-
|
13
|
-
describe('Graphing: Tools and controls - Edit tab and preview tab tool options', () => {
|
14
|
-
before(() => {
|
15
|
-
cy.loginAs('admin');
|
16
|
-
});
|
17
|
-
|
18
|
-
//TODO: Need to update once https://redmine.zeuslearning.com/issues/564073 is resolved
|
19
|
-
describe('Tools and controls - Edit tab content and functionality', () => {
|
20
|
-
abortEarlySetup();
|
21
|
-
before(() => {
|
22
|
-
graphingPage.steps.navigateToCreateQuestion('Graphing');
|
23
|
-
cy.barsPreLoaderWait();
|
24
|
-
});
|
25
|
-
|
26
|
-
it('\'Tools\' label should be displayed with all the tools', () => {
|
27
|
-
utilities.verifyInnerText(graphingPage.toolsLabel(), 'Tools');
|
28
|
-
utilities.verifyElementVisibilityState(graphingPage.toolsLabel(), 'visible');
|
29
|
-
});
|
30
|
-
|
31
|
-
it(`The ${selectedToolOption} should be in selected state with tick icons and all the options should be in unselected state`, () => {
|
32
|
-
selectedToolOption.forEach((toolOption, index) => {
|
33
|
-
utilities.verifyElementVisibilityState(graphingPage.toolOptions(`${toolOption} selected`), 'visible');
|
34
|
-
utilities.verifyInnerText(utilities.getNthElement(graphingPage.toolOptionsLabel(), index), toolOption);
|
35
|
-
utilities.verifyElementVisibilityState(utilities.getNthElement(graphingPage.toolOptionsTickIcon(), index), 'visible');
|
36
|
-
});
|
37
|
-
unselectedToolOption.forEach((toolOption, index) => {
|
38
|
-
utilities.verifyElementVisibilityState(graphingPage.toolOptions(`${toolOption} not-selected`), 'visible');
|
39
|
-
utilities.verifyInnerText(utilities.getNthElement(graphingPage.toolOptionsLabel(), index + 6), toolOption);
|
40
|
-
utilities.verifyElementVisibilityState(utilities.getNthElement(graphingPage.toolOptionsTickIcon(), index + 6), 'hidden');
|
41
|
-
});
|
42
|
-
});
|
43
|
-
|
44
|
-
it('\'Controls\' label should be displayed with all the control options', () => {
|
45
|
-
utilities.verifyInnerText(graphingPage.controlsLabel(), 'Controls');
|
46
|
-
utilities.verifyElementVisibilityState(graphingPage.controlsLabel(), 'visible');
|
47
|
-
});
|
48
|
-
|
49
|
-
it('All the control options should be displayed in selected state', () => {
|
50
|
-
let controlOptions = ['Move', 'Undo/Redo', 'Reset'];
|
51
|
-
controlOptions.forEach((controlOption, index) => {
|
52
|
-
utilities.verifyElementVisibilityState(graphingPage.controlOptions(`${controlOption} selected`), 'visible');
|
53
|
-
utilities.verifyInnerText(utilities.getNthElement(graphingPage.controlsOptionsLabel(), index), controlOption);
|
54
|
-
utilities.verifyElementVisibilityState(utilities.getNthElement(graphingPage.controlsTickIcon(), index), 'visible');
|
55
|
-
});
|
56
|
-
});
|
57
|
-
|
58
|
-
graphingPage.tests.verifyDefaultToolDropdown(toolOptions);
|
59
|
-
|
60
|
-
it(`The ${selectedToolOption} options should be displayed in the \'Specify correct answer\' section and ${toolOptions} should be displayed in the background graph section`, () => {
|
61
|
-
selectedToolOption.forEach((toolOption) => {
|
62
|
-
utilities.verifyElementVisibilityState(graphingPage.graphToolOptionSpecifyCorrectAnswer(`${toolOption}`), 'visible');
|
63
|
-
});
|
64
|
-
utilities.verifyElementCount(graphingPage.graphToolOptionSpecifyCorrectAnswer(), 6);
|
65
|
-
toolOptions.forEach((toolOption) => {
|
66
|
-
utilities.verifyElementVisibilityState(graphingPage.graphToolOptionEditTab(`${toolOption}`), 'visible');
|
67
|
-
});
|
68
|
-
utilities.verifyElementCount(graphingPage.graphToolOptionEditTab(), 10);
|
69
|
-
});
|
70
|
-
|
71
|
-
it('By default, the \'Point\' option should be in selected state in the \'Specify correct answer\' section and background graph section', () => {
|
72
|
-
graphingPage.steps.verifyToolOptionSelectedEditTab(toolOptions[0]);
|
73
|
-
graphingPage.steps.verifyToolOptionNotSelectedEditTab(toolOptions.slice(1, toolOptions.length));
|
74
|
-
graphingPage.steps.verifyToolOptionSelectedSpecifyCorrectAnswerSection(toolOptions[0]);
|
75
|
-
graphingPage.steps.verifyToolOptionNotSelectedSpecifyCorrectAnswerSection(toolOptions.slice(1, 6));
|
76
|
-
});
|
77
|
-
|
78
|
-
it('When the user de-selects an selected option it should be removed from the \'Specify correct answer\' section, \'Default tool\' but all the options should be displayed in the background graph section', () => {
|
79
|
-
graphingPage.steps.deselectToolOptions(['Point']);
|
80
|
-
selectedToolOption.slice(1, selectedToolOption.length).forEach((toolOption) => {
|
81
|
-
utilities.verifyElementVisibilityState(graphingPage.graphToolOptionSpecifyCorrectAnswer(`${toolOption}`), 'visible');
|
82
|
-
});
|
83
|
-
graphingPage.steps.verifyToolOptionSelectedSpecifyCorrectAnswerSection(toolOptions[1]);
|
84
|
-
toolOptions.forEach((toolOption) => {
|
85
|
-
utilities.verifyElementVisibilityState(graphingPage.graphToolOptionEditTab(`${toolOption}`), 'visible');
|
86
|
-
});
|
87
|
-
graphingPage.steps.verifyToolOptionSelectedEditTab(toolOptions[0]);
|
88
|
-
graphingPage.steps.expandDefaultToolDropdown();
|
89
|
-
selectedToolOption.slice(1, selectedToolOption.length).forEach((dropdownOption) => {
|
90
|
-
utilities.verifyElementVisibilityState(graphingPage.defaultToolDropdownOptions(dropdownOption), 'exist');
|
91
|
-
});
|
92
|
-
graphingPage.steps.selectOptionFromDefaultToolDropdown('Line');
|
93
|
-
});
|
94
|
-
|
95
|
-
it('When user selects any of the default unselected options it should be added to the \'Specify correct answer\' section, \'Default tool\' and all the options should be displayed in the background graph section', () => {
|
96
|
-
graphingPage.steps.selectToolOptions(['Circle']);
|
97
|
-
toolOptions.slice(1, 6).forEach((toolOption) => {
|
98
|
-
utilities.verifyElementVisibilityState(graphingPage.graphToolOptionSpecifyCorrectAnswer(`${toolOption}`), 'visible');
|
99
|
-
});
|
100
|
-
toolOptions.forEach((toolOption) => {
|
101
|
-
utilities.verifyElementVisibilityState(graphingPage.graphToolOptionEditTab(`${toolOption}`), 'visible');
|
102
|
-
});
|
103
|
-
graphingPage.steps.expandDefaultToolDropdown();
|
104
|
-
toolOptions.slice(1, 6).forEach((dropdownOption) => {
|
105
|
-
utilities.verifyElementVisibilityState(graphingPage.defaultToolDropdownOptions(dropdownOption), 'exist');
|
106
|
-
});
|
107
|
-
graphingPage.steps.selectOptionFromDefaultToolDropdown('Line');
|
108
|
-
});
|
109
|
-
|
110
|
-
//Controls
|
111
|
-
it('All the controls should be displayed in the \'Specify correct answer\' section and background graph section', () => {
|
112
|
-
controlOptions.forEach((controlOption) => {
|
113
|
-
utilities.verifyElementVisibilityState(graphingPage.graphControlOptionSpecifyCorrectAnswer(controlOption), 'visible');
|
114
|
-
utilities.verifyElementVisibilityState(graphingPage.graphControlOptionEditTab(controlOption), 'visible');
|
115
|
-
});
|
116
|
-
});
|
117
|
-
|
118
|
-
it('When the user de-selects any control it should be removed from the \'Specify correct answer\' section and all controls should be displayed in the background graph section', () => {
|
119
|
-
graphingPage.steps.deselectControl('Move');
|
120
|
-
controlOptions.slice(1, controlOptions.length).forEach((controlOption) => {
|
121
|
-
utilities.verifyElementVisibilityState(graphingPage.graphControlOptionSpecifyCorrectAnswer(controlOption), 'visible');
|
122
|
-
});
|
123
|
-
controlOptions.forEach((controlOption) => {
|
124
|
-
utilities.verifyElementVisibilityState(graphingPage.graphControlOptionEditTab(controlOption), 'visible');
|
125
|
-
});
|
126
|
-
});
|
127
|
-
|
128
|
-
it('When the user selects a un-selected option it should be displayed again in the \'Specify correct answer\' section and all controls should be displayed in the background graph section', () => {
|
129
|
-
graphingPage.steps.selectControl('Move');
|
130
|
-
controlOptions.forEach((controlOption) => {
|
131
|
-
utilities.verifyElementVisibilityState(graphingPage.graphControlOptionSpecifyCorrectAnswer(controlOption), 'visible');
|
132
|
-
utilities.verifyElementVisibilityState(graphingPage.graphControlOptionEditTab(controlOption), 'visible');
|
133
|
-
});
|
134
|
-
});
|
135
|
-
|
136
|
-
//Default tool
|
137
|
-
it('When the user selects another tool as the default tool it should be displayed as selected and the \'Point\' tool should be displayed unselected in the \'Specify correct answer\' section and background graph section', () => {
|
138
|
-
graphingPage.steps.expandDefaultToolDropdown();
|
139
|
-
graphingPage.steps.selectOptionFromDefaultToolDropdown('Circle');
|
140
|
-
graphingPage.steps.verifyToolOptionSelectedSpecifyCorrectAnswerSection('Circle');
|
141
|
-
graphingPage.steps.verifyToolOptionNotSelectedSpecifyCorrectAnswerSection(['Line']);
|
142
|
-
graphingPage.steps.verifyToolOptionSelectedEditTab('Circle');
|
143
|
-
graphingPage.steps.verifyToolOptionNotSelectedEditTab(['Point']);
|
144
|
-
});
|
145
|
-
|
146
|
-
it('CSS of tools and controls', { tags: 'css' }, () => {
|
147
|
-
utilities.verifyCSS(graphingPage.toolOptions('Point').find('svg circle'), {
|
148
|
-
'fill': css.color.secondaryBtn
|
149
|
-
});
|
150
|
-
utilities.verifyCSS(graphingPage.toolOptions('Point'), {
|
151
|
-
'background-color': css.color.secondaryBtnBg
|
152
|
-
});
|
153
|
-
utilities.verifyCSS(graphingPage.toolOptions('Line').find('[data-name*="Path"]').eq(1), {
|
154
|
-
'fill': css.color.primaryBtn
|
155
|
-
});
|
156
|
-
utilities.verifyCSS(graphingPage.toolOptions('Line'), {
|
157
|
-
'background-color': css.color.activeButtons
|
158
|
-
});
|
159
|
-
utilities.verifyCSS(graphingPage.toolOptionsTickIcon().eq(1).find('[data-name="Icon feather-check"]'), {
|
160
|
-
'color': css.color.activeButtons,
|
161
|
-
'fill': css.color.activeButtons
|
162
|
-
});
|
163
|
-
});
|
164
|
-
|
165
|
-
it('Accessibility of tools and controls', { tags: 'a11y' }, () => {
|
166
|
-
cy.checkAccessibility(graphingPage.toolOptions().parents('[class*="CustomizedOptionWrapper"]'))
|
167
|
-
});
|
168
|
-
});
|
169
|
-
|
170
|
-
describe('Tools and controls - Preview tab functionality', () => {
|
171
|
-
abortEarlySetup();
|
172
|
-
before(() => {
|
173
|
-
graphingPage.steps.navigateToCreateQuestion('Graphing');
|
174
|
-
cy.barsPreLoaderWait();
|
175
|
-
});
|
176
|
-
|
177
|
-
it(`The ${selectedToolOption} options should be displayed in the preview tab`, () => {
|
178
|
-
graphingPage.steps.switchToPreviewTab();
|
179
|
-
selectedToolOption.forEach((toolOption) => {
|
180
|
-
utilities.verifyElementVisibilityState(graphingPage.graphToolOptionPreviewTab(`${toolOption}`), 'visible');
|
181
|
-
});
|
182
|
-
utilities.verifyElementCount(graphingPage.graphToolOptionPreviewTab(), 6);
|
183
|
-
});
|
184
|
-
|
185
|
-
it('By default, the \'Point\' option should be in selected state in the preview tab tool options', () => {
|
186
|
-
graphingPage.steps.verifyToolOptionSelectedPreviewTab(selectedToolOption[0]);
|
187
|
-
graphingPage.steps.verifyToolOptionNotSelectedPreviewTab(selectedToolOption.slice(1, selectedToolOption.length));
|
188
|
-
utilities.verifyElementCount(graphingPage.graphToolOptionPreviewTab(), 6)
|
189
|
-
});
|
190
|
-
|
191
|
-
it('When the user de-selects an selected option it should be removed from the preview tab tool options', () => {
|
192
|
-
graphingPage.steps.switchToEditTab();
|
193
|
-
graphingPage.steps.deselectToolOptions(['Point']);
|
194
|
-
graphingPage.steps.switchToPreviewTab();
|
195
|
-
selectedToolOption.slice(1, selectedToolOption.length).forEach((toolOption) => {
|
196
|
-
utilities.verifyElementVisibilityState(graphingPage.graphToolOptionPreviewTab(`${toolOption}`), 'visible');
|
197
|
-
});
|
198
|
-
graphingPage.steps.verifyToolOptionSelectedPreviewTab(toolOptions[1]);
|
199
|
-
});
|
200
|
-
|
201
|
-
it('When user selects any of the default unselected options it should be added to the preview tab tool options', () => {
|
202
|
-
graphingPage.steps.switchToEditTab();
|
203
|
-
graphingPage.steps.selectToolOptions(['Circle']);
|
204
|
-
graphingPage.steps.switchToPreviewTab();
|
205
|
-
toolOptions.slice(1, 6).forEach((toolOption) => {
|
206
|
-
utilities.verifyElementVisibilityState(graphingPage.graphToolOptionPreviewTab(`${toolOption}`), 'visible');
|
207
|
-
});
|
208
|
-
});
|
209
|
-
|
210
|
-
//Controls
|
211
|
-
it('All the controls should be displayed in the preview tab tool options', () => {
|
212
|
-
controlOptions.forEach((controlOption) => {
|
213
|
-
utilities.verifyElementVisibilityState(graphingPage.graphControlOptionPreviewTab(controlOption), 'visible');
|
214
|
-
});
|
215
|
-
});
|
216
|
-
|
217
|
-
it('When the user de-selects any control it should be removed from the preview tab tool options', () => {
|
218
|
-
graphingPage.steps.switchToEditTab();
|
219
|
-
graphingPage.steps.deselectControl('Move');
|
220
|
-
graphingPage.steps.switchToPreviewTab();
|
221
|
-
controlOptions.slice(1, controlOptions.length).forEach((controlOption) => {
|
222
|
-
utilities.verifyElementVisibilityState(graphingPage.graphControlOptionPreviewTab(controlOption), 'visible');
|
223
|
-
});
|
224
|
-
});
|
225
|
-
|
226
|
-
it('When the user selects a un-selected option it should be displayed again in the preview tab tool options', () => {
|
227
|
-
graphingPage.steps.switchToEditTab();
|
228
|
-
graphingPage.steps.selectControl('Move');
|
229
|
-
graphingPage.steps.switchToPreviewTab();
|
230
|
-
controlOptions.forEach((controlOption) => {
|
231
|
-
utilities.verifyElementVisibilityState(graphingPage.graphControlOptionPreviewTab(controlOption), 'visible');
|
232
|
-
});
|
233
|
-
});
|
234
|
-
|
235
|
-
//Default tool
|
236
|
-
it('When the user selects another tool as the default tool it should be displayed as selected and the \'Point\' tool should be displayed unselected in the preview tab tool options', () => {
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
[
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
|
311
|
-
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
|
317
|
-
|
318
|
-
|
319
|
-
|
320
|
-
|
321
|
-
|
322
|
-
|
323
|
-
|
324
|
-
|
325
|
-
|
326
|
-
|
327
|
-
|
328
|
-
|
329
|
-
|
330
|
-
|
331
|
-
|
332
|
-
|
333
|
-
|
334
|
-
|
335
|
-
|
336
|
-
|
337
|
-
|
338
|
-
|
339
|
-
|
340
|
-
|
341
|
-
|
342
|
-
|
343
|
-
|
344
|
-
|
345
|
-
|
346
|
-
|
347
|
-
|
348
|
-
|
349
|
-
|
350
|
-
|
351
|
-
|
352
|
-
|
353
|
-
|
354
|
-
|
355
|
-
|
356
|
-
|
357
|
-
|
358
|
-
|
359
|
-
|
360
|
-
|
361
|
-
|
362
|
-
|
363
|
-
|
364
|
-
|
365
|
-
|
366
|
-
|
367
|
-
|
368
|
-
|
369
|
-
|
370
|
-
|
371
|
-
|
372
|
-
|
373
|
-
|
374
|
-
|
375
|
-
|
376
|
-
|
377
|
-
|
378
|
-
|
379
|
-
|
380
|
-
|
381
|
-
|
382
|
-
|
383
|
-
|
384
|
-
|
385
|
-
|
386
|
-
|
387
|
-
|
388
|
-
|
1
|
+
import { dialogBoxBase, graphingPage } from "../../../pages";
|
2
|
+
import abortEarlySetup from "../../../support/helpers/abortEarly";
|
3
|
+
import utilities from "../../../support/helpers/utilities";
|
4
|
+
const unselectedToolOption = ['Circle', 'Parabola', 'Sine', 'Polygon'];
|
5
|
+
const selectedToolOption = ['Point', 'Line', 'Label', 'Ray', 'Segment', 'Vector'];
|
6
|
+
const controlOptions = ['Move', 'Undo', 'Redo', 'Reset'];
|
7
|
+
const patternOptions = ['Grid', 'Lines', 'Dots', 'Circular', 'Quadrant'];
|
8
|
+
const patternOptionsAltText = ['Grid pattern of evenly spaced horizontal and vertical lines', 'Line pattern of evenly spaced horizontal lines', 'Dot pattern of evenly spaced horizontal and vertical dots', 'Circular pattern of evenly spaced concentric circles', 'Quadrant pattern of evenly spaced horizontal and vertical lines'];
|
9
|
+
const alignmentOptions = ['Top left', 'Center', 'Top right'];
|
10
|
+
const toolOptions = [...selectedToolOption, ...unselectedToolOption];
|
11
|
+
const css = Cypress.env('css');
|
12
|
+
|
13
|
+
describe('Graphing: Tools and controls - Edit tab and preview tab tool options', () => {
|
14
|
+
before(() => {
|
15
|
+
cy.loginAs('admin');
|
16
|
+
});
|
17
|
+
|
18
|
+
//TODO: Need to update once https://redmine.zeuslearning.com/issues/564073 is resolved
|
19
|
+
describe('Tools and controls - Edit tab content and functionality', () => {
|
20
|
+
abortEarlySetup();
|
21
|
+
before(() => {
|
22
|
+
graphingPage.steps.navigateToCreateQuestion('Graphing');
|
23
|
+
cy.barsPreLoaderWait();
|
24
|
+
});
|
25
|
+
|
26
|
+
it('\'Tools\' label should be displayed with all the tools', () => {
|
27
|
+
utilities.verifyInnerText(graphingPage.toolsLabel(), 'Tools');
|
28
|
+
utilities.verifyElementVisibilityState(graphingPage.toolsLabel(), 'visible');
|
29
|
+
});
|
30
|
+
|
31
|
+
it(`The ${selectedToolOption} should be in selected state with tick icons and all the options should be in unselected state`, () => {
|
32
|
+
selectedToolOption.forEach((toolOption, index) => {
|
33
|
+
utilities.verifyElementVisibilityState(graphingPage.toolOptions(`${toolOption} selected`), 'visible');
|
34
|
+
utilities.verifyInnerText(utilities.getNthElement(graphingPage.toolOptionsLabel(), index), toolOption);
|
35
|
+
utilities.verifyElementVisibilityState(utilities.getNthElement(graphingPage.toolOptionsTickIcon(), index), 'visible');
|
36
|
+
});
|
37
|
+
unselectedToolOption.forEach((toolOption, index) => {
|
38
|
+
utilities.verifyElementVisibilityState(graphingPage.toolOptions(`${toolOption} not-selected`), 'visible');
|
39
|
+
utilities.verifyInnerText(utilities.getNthElement(graphingPage.toolOptionsLabel(), index + 6), toolOption);
|
40
|
+
utilities.verifyElementVisibilityState(utilities.getNthElement(graphingPage.toolOptionsTickIcon(), index + 6), 'hidden');
|
41
|
+
});
|
42
|
+
});
|
43
|
+
|
44
|
+
it('\'Controls\' label should be displayed with all the control options', () => {
|
45
|
+
utilities.verifyInnerText(graphingPage.controlsLabel(), 'Controls');
|
46
|
+
utilities.verifyElementVisibilityState(graphingPage.controlsLabel(), 'visible');
|
47
|
+
});
|
48
|
+
|
49
|
+
it('All the control options should be displayed in selected state', () => {
|
50
|
+
let controlOptions = ['Move', 'Undo/Redo', 'Reset'];
|
51
|
+
controlOptions.forEach((controlOption, index) => {
|
52
|
+
utilities.verifyElementVisibilityState(graphingPage.controlOptions(`${controlOption} selected`), 'visible');
|
53
|
+
utilities.verifyInnerText(utilities.getNthElement(graphingPage.controlsOptionsLabel(), index), controlOption);
|
54
|
+
utilities.verifyElementVisibilityState(utilities.getNthElement(graphingPage.controlsTickIcon(), index), 'visible');
|
55
|
+
});
|
56
|
+
});
|
57
|
+
|
58
|
+
graphingPage.tests.verifyDefaultToolDropdown(toolOptions);
|
59
|
+
|
60
|
+
it(`The ${selectedToolOption} options should be displayed in the \'Specify correct answer\' section and ${toolOptions} should be displayed in the background graph section`, () => {
|
61
|
+
selectedToolOption.forEach((toolOption) => {
|
62
|
+
utilities.verifyElementVisibilityState(graphingPage.graphToolOptionSpecifyCorrectAnswer(`${toolOption}`), 'visible');
|
63
|
+
});
|
64
|
+
utilities.verifyElementCount(graphingPage.graphToolOptionSpecifyCorrectAnswer(), 6);
|
65
|
+
toolOptions.forEach((toolOption) => {
|
66
|
+
utilities.verifyElementVisibilityState(graphingPage.graphToolOptionEditTab(`${toolOption}`), 'visible');
|
67
|
+
});
|
68
|
+
utilities.verifyElementCount(graphingPage.graphToolOptionEditTab(), 10);
|
69
|
+
});
|
70
|
+
|
71
|
+
it('By default, the \'Point\' option should be in selected state in the \'Specify correct answer\' section and background graph section', () => {
|
72
|
+
graphingPage.steps.verifyToolOptionSelectedEditTab(toolOptions[0]);
|
73
|
+
graphingPage.steps.verifyToolOptionNotSelectedEditTab(toolOptions.slice(1, toolOptions.length));
|
74
|
+
graphingPage.steps.verifyToolOptionSelectedSpecifyCorrectAnswerSection(toolOptions[0]);
|
75
|
+
graphingPage.steps.verifyToolOptionNotSelectedSpecifyCorrectAnswerSection(toolOptions.slice(1, 6));
|
76
|
+
});
|
77
|
+
|
78
|
+
it('When the user de-selects an selected option it should be removed from the \'Specify correct answer\' section, \'Default tool\' but all the options should be displayed in the background graph section', () => {
|
79
|
+
graphingPage.steps.deselectToolOptions(['Point']);
|
80
|
+
selectedToolOption.slice(1, selectedToolOption.length).forEach((toolOption) => {
|
81
|
+
utilities.verifyElementVisibilityState(graphingPage.graphToolOptionSpecifyCorrectAnswer(`${toolOption}`), 'visible');
|
82
|
+
});
|
83
|
+
graphingPage.steps.verifyToolOptionSelectedSpecifyCorrectAnswerSection(toolOptions[1]);
|
84
|
+
toolOptions.forEach((toolOption) => {
|
85
|
+
utilities.verifyElementVisibilityState(graphingPage.graphToolOptionEditTab(`${toolOption}`), 'visible');
|
86
|
+
});
|
87
|
+
graphingPage.steps.verifyToolOptionSelectedEditTab(toolOptions[0]);
|
88
|
+
graphingPage.steps.expandDefaultToolDropdown();
|
89
|
+
selectedToolOption.slice(1, selectedToolOption.length).forEach((dropdownOption) => {
|
90
|
+
utilities.verifyElementVisibilityState(graphingPage.defaultToolDropdownOptions(dropdownOption), 'exist');
|
91
|
+
});
|
92
|
+
graphingPage.steps.selectOptionFromDefaultToolDropdown('Line');
|
93
|
+
});
|
94
|
+
|
95
|
+
it('When user selects any of the default unselected options it should be added to the \'Specify correct answer\' section, \'Default tool\' and all the options should be displayed in the background graph section', () => {
|
96
|
+
graphingPage.steps.selectToolOptions(['Circle']);
|
97
|
+
toolOptions.slice(1, 6).forEach((toolOption) => {
|
98
|
+
utilities.verifyElementVisibilityState(graphingPage.graphToolOptionSpecifyCorrectAnswer(`${toolOption}`), 'visible');
|
99
|
+
});
|
100
|
+
toolOptions.forEach((toolOption) => {
|
101
|
+
utilities.verifyElementVisibilityState(graphingPage.graphToolOptionEditTab(`${toolOption}`), 'visible');
|
102
|
+
});
|
103
|
+
graphingPage.steps.expandDefaultToolDropdown();
|
104
|
+
toolOptions.slice(1, 6).forEach((dropdownOption) => {
|
105
|
+
utilities.verifyElementVisibilityState(graphingPage.defaultToolDropdownOptions(dropdownOption), 'exist');
|
106
|
+
});
|
107
|
+
graphingPage.steps.selectOptionFromDefaultToolDropdown('Line');
|
108
|
+
});
|
109
|
+
|
110
|
+
//Controls
|
111
|
+
it('All the controls should be displayed in the \'Specify correct answer\' section and background graph section', () => {
|
112
|
+
controlOptions.forEach((controlOption) => {
|
113
|
+
utilities.verifyElementVisibilityState(graphingPage.graphControlOptionSpecifyCorrectAnswer(controlOption), 'visible');
|
114
|
+
utilities.verifyElementVisibilityState(graphingPage.graphControlOptionEditTab(controlOption), 'visible');
|
115
|
+
});
|
116
|
+
});
|
117
|
+
|
118
|
+
it('When the user de-selects any control it should be removed from the \'Specify correct answer\' section and all controls should be displayed in the background graph section', () => {
|
119
|
+
graphingPage.steps.deselectControl('Move');
|
120
|
+
controlOptions.slice(1, controlOptions.length).forEach((controlOption) => {
|
121
|
+
utilities.verifyElementVisibilityState(graphingPage.graphControlOptionSpecifyCorrectAnswer(controlOption), 'visible');
|
122
|
+
});
|
123
|
+
controlOptions.forEach((controlOption) => {
|
124
|
+
utilities.verifyElementVisibilityState(graphingPage.graphControlOptionEditTab(controlOption), 'visible');
|
125
|
+
});
|
126
|
+
});
|
127
|
+
|
128
|
+
it('When the user selects a un-selected option it should be displayed again in the \'Specify correct answer\' section and all controls should be displayed in the background graph section', () => {
|
129
|
+
graphingPage.steps.selectControl('Move');
|
130
|
+
controlOptions.forEach((controlOption) => {
|
131
|
+
utilities.verifyElementVisibilityState(graphingPage.graphControlOptionSpecifyCorrectAnswer(controlOption), 'visible');
|
132
|
+
utilities.verifyElementVisibilityState(graphingPage.graphControlOptionEditTab(controlOption), 'visible');
|
133
|
+
});
|
134
|
+
});
|
135
|
+
|
136
|
+
//Default tool
|
137
|
+
it('When the user selects another tool as the default tool it should be displayed as selected and the \'Point\' tool should be displayed unselected in the \'Specify correct answer\' section and background graph section', () => {
|
138
|
+
graphingPage.steps.expandDefaultToolDropdown();
|
139
|
+
graphingPage.steps.selectOptionFromDefaultToolDropdown('Circle');
|
140
|
+
graphingPage.steps.verifyToolOptionSelectedSpecifyCorrectAnswerSection('Circle');
|
141
|
+
graphingPage.steps.verifyToolOptionNotSelectedSpecifyCorrectAnswerSection(['Line']);
|
142
|
+
graphingPage.steps.verifyToolOptionSelectedEditTab('Circle');
|
143
|
+
graphingPage.steps.verifyToolOptionNotSelectedEditTab(['Point']);
|
144
|
+
});
|
145
|
+
|
146
|
+
it('CSS of tools and controls', { tags: 'css' }, () => {
|
147
|
+
utilities.verifyCSS(graphingPage.toolOptions('Point').find('svg circle'), {
|
148
|
+
'fill': css.color.secondaryBtn
|
149
|
+
});
|
150
|
+
utilities.verifyCSS(graphingPage.toolOptions('Point'), {
|
151
|
+
'background-color': css.color.secondaryBtnBg
|
152
|
+
});
|
153
|
+
utilities.verifyCSS(graphingPage.toolOptions('Line').find('[data-name*="Path"]').eq(1), {
|
154
|
+
'fill': css.color.primaryBtn
|
155
|
+
});
|
156
|
+
utilities.verifyCSS(graphingPage.toolOptions('Line'), {
|
157
|
+
'background-color': css.color.activeButtons
|
158
|
+
});
|
159
|
+
utilities.verifyCSS(graphingPage.toolOptionsTickIcon().eq(1).find('[data-name="Icon feather-check"]'), {
|
160
|
+
'color': css.color.activeButtons,
|
161
|
+
'fill': css.color.activeButtons
|
162
|
+
});
|
163
|
+
});
|
164
|
+
|
165
|
+
it('Accessibility of tools and controls', { tags: 'a11y' }, () => {
|
166
|
+
cy.checkAccessibility(graphingPage.toolOptions().parents('[class*="CustomizedOptionWrapper"]'))
|
167
|
+
});
|
168
|
+
});
|
169
|
+
|
170
|
+
describe('Tools and controls - Preview tab functionality', () => {
|
171
|
+
abortEarlySetup();
|
172
|
+
before(() => {
|
173
|
+
graphingPage.steps.navigateToCreateQuestion('Graphing');
|
174
|
+
cy.barsPreLoaderWait();
|
175
|
+
});
|
176
|
+
|
177
|
+
it(`The ${selectedToolOption} options should be displayed in the preview tab`, () => {
|
178
|
+
graphingPage.steps.switchToPreviewTab();
|
179
|
+
selectedToolOption.forEach((toolOption) => {
|
180
|
+
utilities.verifyElementVisibilityState(graphingPage.graphToolOptionPreviewTab(`${toolOption}`), 'visible');
|
181
|
+
});
|
182
|
+
utilities.verifyElementCount(graphingPage.graphToolOptionPreviewTab(), 6);
|
183
|
+
});
|
184
|
+
|
185
|
+
it('By default, the \'Point\' option should be in selected state in the preview tab tool options', () => {
|
186
|
+
graphingPage.steps.verifyToolOptionSelectedPreviewTab(selectedToolOption[0]);
|
187
|
+
graphingPage.steps.verifyToolOptionNotSelectedPreviewTab(selectedToolOption.slice(1, selectedToolOption.length));
|
188
|
+
utilities.verifyElementCount(graphingPage.graphToolOptionPreviewTab(), 6)
|
189
|
+
});
|
190
|
+
|
191
|
+
it('When the user de-selects an selected option it should be removed from the preview tab tool options', () => {
|
192
|
+
graphingPage.steps.switchToEditTab();
|
193
|
+
graphingPage.steps.deselectToolOptions(['Point']);
|
194
|
+
graphingPage.steps.switchToPreviewTab();
|
195
|
+
selectedToolOption.slice(1, selectedToolOption.length).forEach((toolOption) => {
|
196
|
+
utilities.verifyElementVisibilityState(graphingPage.graphToolOptionPreviewTab(`${toolOption}`), 'visible');
|
197
|
+
});
|
198
|
+
graphingPage.steps.verifyToolOptionSelectedPreviewTab(toolOptions[1]);
|
199
|
+
});
|
200
|
+
|
201
|
+
it('When user selects any of the default unselected options it should be added to the preview tab tool options', () => {
|
202
|
+
graphingPage.steps.switchToEditTab();
|
203
|
+
graphingPage.steps.selectToolOptions(['Circle']);
|
204
|
+
graphingPage.steps.switchToPreviewTab();
|
205
|
+
toolOptions.slice(1, 6).forEach((toolOption) => {
|
206
|
+
utilities.verifyElementVisibilityState(graphingPage.graphToolOptionPreviewTab(`${toolOption}`), 'visible');
|
207
|
+
});
|
208
|
+
});
|
209
|
+
|
210
|
+
//Controls
|
211
|
+
it('All the controls should be displayed in the preview tab tool options', () => {
|
212
|
+
controlOptions.forEach((controlOption) => {
|
213
|
+
utilities.verifyElementVisibilityState(graphingPage.graphControlOptionPreviewTab(controlOption), 'visible');
|
214
|
+
});
|
215
|
+
});
|
216
|
+
|
217
|
+
it('When the user de-selects any control it should be removed from the preview tab tool options', () => {
|
218
|
+
graphingPage.steps.switchToEditTab();
|
219
|
+
graphingPage.steps.deselectControl('Move');
|
220
|
+
graphingPage.steps.switchToPreviewTab();
|
221
|
+
controlOptions.slice(1, controlOptions.length).forEach((controlOption) => {
|
222
|
+
utilities.verifyElementVisibilityState(graphingPage.graphControlOptionPreviewTab(controlOption), 'visible');
|
223
|
+
});
|
224
|
+
});
|
225
|
+
|
226
|
+
it('When the user selects a un-selected option it should be displayed again in the preview tab tool options', () => {
|
227
|
+
graphingPage.steps.switchToEditTab();
|
228
|
+
graphingPage.steps.selectControl('Move');
|
229
|
+
graphingPage.steps.switchToPreviewTab();
|
230
|
+
controlOptions.forEach((controlOption) => {
|
231
|
+
utilities.verifyElementVisibilityState(graphingPage.graphControlOptionPreviewTab(controlOption), 'visible');
|
232
|
+
});
|
233
|
+
});
|
234
|
+
|
235
|
+
//Default tool
|
236
|
+
it('When the user selects another tool as the default tool it should be displayed as selected and the \'Point\' tool should be displayed unselected in the preview tab tool options', () => {
|
237
|
+
graphingPage.steps.switchToEditTab();
|
238
|
+
graphingPage.steps.expandDefaultToolDropdown();
|
239
|
+
graphingPage.steps.selectOptionFromDefaultToolDropdown('Circle');
|
240
|
+
graphingPage.steps.switchToPreviewTab();
|
241
|
+
graphingPage.steps.verifyToolOptionSelectedPreviewTab('Circle');
|
242
|
+
graphingPage.steps.verifyToolOptionNotSelectedPreviewTab(['Line']);
|
243
|
+
});
|
244
|
+
});
|
245
|
+
|
246
|
+
describe('Undo, Redo and Reset functionality background section', () => {
|
247
|
+
abortEarlySetup();
|
248
|
+
before(() => {
|
249
|
+
graphingPage.steps.navigateToCreateQuestion('Graphing');
|
250
|
+
cy.barsPreLoaderWait();
|
251
|
+
});
|
252
|
+
|
253
|
+
it('By default, the \'Move\' button should be in enabled state and the \'Undo\', \'Redo\' and \'Reset\' buttons should be displayed in disabled state', () => {
|
254
|
+
utilities.verifyElementNotDisabled(graphingPage.graphControlOptionEditTab('Move'));
|
255
|
+
utilities.verifyElementDisabled(graphingPage.graphControlOptionEditTab('Undo'));
|
256
|
+
utilities.verifyElementDisabled(graphingPage.graphControlOptionEditTab('Redo'));
|
257
|
+
utilities.verifyElementDisabled(graphingPage.graphControlOptionEditTab('Reset'));
|
258
|
+
});
|
259
|
+
|
260
|
+
it('When the user plots points on the graph then the \'Undo\' button should be displayed in enabled state whereas, \'Redo\' and \'Reset\' buttons should be displayed in disabled state', () => {
|
261
|
+
graphingPage.steps.plotPointsOnGraphEditTab([{ x: 2, xRange: 20, y: 1, yRange: 20 }, { x: 2, xRange: 20, y: 2, yRange: 20 }, { x: 3, xRange: 20, y: 3, yRange: 20 }]);
|
262
|
+
graphingPage.steps.verifyPointsPlottedOnEditTabGraph([{ x: 2, xRange: 20, y: 1, yRange: 20 }, { x: 2, xRange: 20, y: 2, yRange: 20 }, { x: 3, xRange: 20, y: 3, yRange: 20 }]);
|
263
|
+
utilities.verifyElementNotDisabled(graphingPage.graphControlOptionEditTab('Undo'));
|
264
|
+
utilities.verifyElementDisabled(graphingPage.graphControlOptionEditTab('Redo'));
|
265
|
+
utilities.verifyElementNotDisabled(graphingPage.graphControlOptionEditTab('Reset'));
|
266
|
+
});
|
267
|
+
|
268
|
+
it('When the user selects \'Undo\' button then the latest action should be reversed and the \'Redo\' button should become enabled', () => {
|
269
|
+
graphingPage.steps.selectGraphControlOptionEditTab('Undo');
|
270
|
+
graphingPage.steps.verifyPointsPlottedOnEditTabGraph([{ x: 2, xRange: 20, y: 1, yRange: 20 }, { x: 2, xRange: 20, y: 2, yRange: 20 }]);
|
271
|
+
graphingPage.steps.verifyPointsPlottedNotExistOnEditTabGraph([{ x: 3, xRange: 20, y: 3, yRange: 20 }]);
|
272
|
+
utilities.verifyElementNotDisabled(graphingPage.graphControlOptionEditTab('Undo'));
|
273
|
+
utilities.verifyElementNotDisabled(graphingPage.graphControlOptionEditTab('Redo'));
|
274
|
+
});
|
275
|
+
|
276
|
+
it('When the user clicks on the \'Redo\' button the latest action should be reinstated and the the \'Redo\' button should be disabled again', () => {
|
277
|
+
graphingPage.steps.selectGraphControlOptionEditTab('Redo');
|
278
|
+
graphingPage.steps.verifyPointsPlottedOnEditTabGraph([{ x: 2, xRange: 20, y: 1, yRange: 20 }, { x: 2, xRange: 20, y: 2, yRange: 20 }, { x: 3, xRange: 20, y: 3, yRange: 20 }]);
|
279
|
+
utilities.verifyElementNotDisabled(graphingPage.graphControlOptionEditTab('Undo'));
|
280
|
+
utilities.verifyElementDisabled(graphingPage.graphControlOptionEditTab('Redo'));
|
281
|
+
});
|
282
|
+
|
283
|
+
it('When the user reaches the initial state by performing \'Undo\' actions then the \'Redo\' button should be in enabled state and \'Undo\' button should be in disabled state', () => {
|
284
|
+
graphingPage.steps.selectGraphControlOptionEditTab('Undo');
|
285
|
+
graphingPage.steps.selectGraphControlOptionEditTab('Undo');
|
286
|
+
graphingPage.steps.selectGraphControlOptionEditTab('Undo');
|
287
|
+
graphingPage.steps.verifyPointsPlottedNotExistOnEditTabGraph([{ x: 2, xRange: 20, y: 1, yRange: 20 }, { x: 2, xRange: 20, y: 2, yRange: 20 }, { x: 3, xRange: 20, y: 3, yRange: 20 }]);
|
288
|
+
utilities.verifyElementDisabled(graphingPage.graphControlOptionEditTab('Undo'));
|
289
|
+
utilities.verifyElementNotDisabled(graphingPage.graphControlOptionEditTab('Redo'));
|
290
|
+
});
|
291
|
+
|
292
|
+
it('When the user reaches the latest state by performing \'Redo\' actions then the \'Undo\' button should be in enabled state and \'Redo\' button should be in disabled state', () => {
|
293
|
+
graphingPage.steps.selectGraphControlOptionEditTab('Redo');
|
294
|
+
graphingPage.steps.selectGraphControlOptionEditTab('Redo');
|
295
|
+
graphingPage.steps.selectGraphControlOptionEditTab('Redo');
|
296
|
+
graphingPage.steps.verifyPointsPlottedOnEditTabGraph([{ x: 2, xRange: 20, y: 1, yRange: 20 }, { x: 2, xRange: 20, y: 2, yRange: 20 }, { x: 3, xRange: 20, y: 3, yRange: 20 }]);
|
297
|
+
utilities.verifyElementNotDisabled(graphingPage.graphControlOptionEditTab('Undo'));
|
298
|
+
utilities.verifyElementDisabled(graphingPage.graphControlOptionEditTab('Redo'));
|
299
|
+
});
|
300
|
+
|
301
|
+
it('User should be able to select \'Reset\' control', () => {
|
302
|
+
graphingPage.steps.selectGraphControlOptionEditTab('Reset');
|
303
|
+
});
|
304
|
+
|
305
|
+
graphingPage.tests.verifyResetPopupContentWithCSSAndA11y("graph");
|
306
|
+
|
307
|
+
it('When the user clicks on the \'Cancel\' button then the plotted graph should not be \'Reset\'', () => {
|
308
|
+
graphingPage.steps.cancelReset();
|
309
|
+
graphingPage.steps.verifyPointsPlottedOnEditTabGraph([{ x: 2, xRange: 20, y: 1, yRange: 20 }, { x: 2, xRange: 20, y: 2, yRange: 20 }, { x: 3, xRange: 20, y: 3, yRange: 20 }]);
|
310
|
+
});
|
311
|
+
|
312
|
+
it('When the user clicks on \'Confirm \'Reset\'\' then the plotted graph should be \'Reset\'', () => {
|
313
|
+
graphingPage.steps.selectGraphControlOptionEditTab('Reset');
|
314
|
+
graphingPage.steps.confirmReset();
|
315
|
+
graphingPage.steps.verifyPointsPlottedNotExistOnEditTabGraph([{ x: 2, xRange: 20, y: 1, yRange: 20 }, { x: 2, xRange: 20, y: 2, yRange: 20 }, { x: 3, xRange: 20, y: 3, yRange: 20 }]);
|
316
|
+
});
|
317
|
+
|
318
|
+
it('When the user \'Reset\'s the graph then the \'Undo\' and \'Redo\' buttons should be in disabled state', () => {
|
319
|
+
utilities.verifyElementDisabled(graphingPage.graphControlOptionEditTab('Undo'));
|
320
|
+
utilities.verifyElementDisabled(graphingPage.graphControlOptionEditTab('Redo'));
|
321
|
+
});
|
322
|
+
});
|
323
|
+
|
324
|
+
describe('Undo/Redo and Reset functionality specify correct answer section', () => {
|
325
|
+
abortEarlySetup();
|
326
|
+
before(() => {
|
327
|
+
graphingPage.steps.navigateToCreateQuestion('Graphing');
|
328
|
+
cy.barsPreLoaderWait();
|
329
|
+
});
|
330
|
+
|
331
|
+
it('By default, the \'Move\' button should be in enabled state and the \'Undo\', \'Redo\' and \'Reset\' buttons should be displayed in disabled state', () => {
|
332
|
+
utilities.verifyElementNotDisabled(graphingPage.graphControlOptionSpecifyCorrectAnswer('Move'));
|
333
|
+
utilities.verifyElementDisabled(graphingPage.graphControlOptionSpecifyCorrectAnswer('Undo'));
|
334
|
+
utilities.verifyElementDisabled(graphingPage.graphControlOptionSpecifyCorrectAnswer('Redo'));
|
335
|
+
utilities.verifyElementDisabled(graphingPage.graphControlOptionSpecifyCorrectAnswer('Reset'));
|
336
|
+
});
|
337
|
+
|
338
|
+
it('When the user plots points on the graph then the \'Undo\' button should be displayed in enabled state whereas, \'Redo\' and \'Reset\' buttons should be displayed in disabled state', () => {
|
339
|
+
graphingPage.steps.plotPointsOnGraphSpecifyCorrectAnswerSection([{ x: 2, xRange: 20, y: 1, yRange: 20 }, { x: 2, xRange: 20, y: 2, yRange: 20 }, { x: 3, xRange: 20, y: 3, yRange: 20 }]);
|
340
|
+
graphingPage.steps.verifyPointsPlottedOnSpecifyCorrectAnswerSection([{ x: 2, xRange: 20, y: 1, yRange: 20 }, { x: 2, xRange: 20, y: 2, yRange: 20 }, { x: 3, xRange: 20, y: 3, yRange: 20 }]);
|
341
|
+
utilities.verifyElementNotDisabled(graphingPage.graphControlOptionSpecifyCorrectAnswer('Undo'));
|
342
|
+
utilities.verifyElementDisabled(graphingPage.graphControlOptionSpecifyCorrectAnswer('Redo'));
|
343
|
+
utilities.verifyElementNotDisabled(graphingPage.graphControlOptionSpecifyCorrectAnswer('Reset'));
|
344
|
+
});
|
345
|
+
|
346
|
+
it('When the user selects \'Undo\' button then the latest action should be reversed and the \'Redo\' button should become enabled', () => {
|
347
|
+
graphingPage.steps.selectGraphControlOptionSpecifyCorrectAnswerSection('Undo');
|
348
|
+
graphingPage.steps.verifyPointsPlottedOnSpecifyCorrectAnswerSection([{ x: 2, xRange: 20, y: 1, yRange: 20 }, { x: 2, xRange: 20, y: 2, yRange: 20 }]);
|
349
|
+
graphingPage.steps.verifyPointsPlottedNotExistOnSpecifyCorrectAnswerSection([{ x: 3, xRange: 20, y: 3, yRange: 20 }]);
|
350
|
+
utilities.verifyElementNotDisabled(graphingPage.graphControlOptionSpecifyCorrectAnswer('Undo'));
|
351
|
+
utilities.verifyElementNotDisabled(graphingPage.graphControlOptionSpecifyCorrectAnswer('Redo'));
|
352
|
+
});
|
353
|
+
|
354
|
+
it('When the user clicks on the \'Redo\' button the latest action should be reinstated and the the \'Redo\' button should be disabled again', () => {
|
355
|
+
graphingPage.steps.selectGraphControlOptionSpecifyCorrectAnswerSection('Redo');
|
356
|
+
graphingPage.steps.verifyPointsPlottedOnSpecifyCorrectAnswerSection([{ x: 2, xRange: 20, y: 1, yRange: 20 }, { x: 2, xRange: 20, y: 2, yRange: 20 }, { x: 3, xRange: 20, y: 3, yRange: 20 }]);
|
357
|
+
utilities.verifyElementNotDisabled(graphingPage.graphControlOptionSpecifyCorrectAnswer('Undo'));
|
358
|
+
utilities.verifyElementDisabled(graphingPage.graphControlOptionSpecifyCorrectAnswer('Redo'));
|
359
|
+
});
|
360
|
+
|
361
|
+
it('When the user reaches the initial state by performing \'Undo\' actions then the \'Redo\' button should be in enabled state and \'Undo\' button should be in disabled state', () => {
|
362
|
+
graphingPage.steps.selectGraphControlOptionSpecifyCorrectAnswerSection('Undo');
|
363
|
+
graphingPage.steps.selectGraphControlOptionSpecifyCorrectAnswerSection('Undo');
|
364
|
+
graphingPage.steps.selectGraphControlOptionSpecifyCorrectAnswerSection('Undo');
|
365
|
+
graphingPage.steps.verifyPointsPlottedNotExistOnSpecifyCorrectAnswerSection([{ x: 2, xRange: 20, y: 1, yRange: 20 }, { x: 2, xRange: 20, y: 2, yRange: 20 }, { x: 3, xRange: 20, y: 3, yRange: 20 }]);
|
366
|
+
utilities.verifyElementDisabled(graphingPage.graphControlOptionSpecifyCorrectAnswer('Undo'));
|
367
|
+
utilities.verifyElementNotDisabled(graphingPage.graphControlOptionSpecifyCorrectAnswer('Redo'));
|
368
|
+
});
|
369
|
+
|
370
|
+
it('When the user reaches the latest state by performing \'Redo\' actions then the \'Undo\' button should be in enabled state and \'Redo\' button should be in disabled state', () => {
|
371
|
+
graphingPage.steps.selectGraphControlOptionSpecifyCorrectAnswerSection('Redo');
|
372
|
+
graphingPage.steps.selectGraphControlOptionSpecifyCorrectAnswerSection('Redo');
|
373
|
+
graphingPage.steps.selectGraphControlOptionSpecifyCorrectAnswerSection('Redo');
|
374
|
+
graphingPage.steps.verifyPointsPlottedOnSpecifyCorrectAnswerSection([{ x: 2, xRange: 20, y: 1, yRange: 20 }, { x: 2, xRange: 20, y: 2, yRange: 20 }, { x: 3, xRange: 20, y: 3, yRange: 20 }]);
|
375
|
+
utilities.verifyElementNotDisabled(graphingPage.graphControlOptionSpecifyCorrectAnswer('Undo'));
|
376
|
+
utilities.verifyElementDisabled(graphingPage.graphControlOptionSpecifyCorrectAnswer('Redo'));
|
377
|
+
});
|
378
|
+
|
379
|
+
it('User should be able to select \'Reset\' control', () => {
|
380
|
+
graphingPage.steps.selectGraphControlOptionSpecifyCorrectAnswerSection('Reset');
|
381
|
+
});
|
382
|
+
|
383
|
+
graphingPage.tests.verifyResetPopupContentWithCSSAndA11y("graph");
|
384
|
+
|
385
|
+
it('When the user clicks on the \'Cancel\' button then the plotted graph should not be \'Reset\'', () => {
|
386
|
+
graphingPage.steps.cancelReset();
|
387
|
+
graphingPage.steps.verifyPointsPlottedOnSpecifyCorrectAnswerSection([{ x: 2, xRange: 20, y: 1, yRange: 20 }, { x: 2, xRange: 20, y: 2, yRange: 20 }, { x: 3, xRange: 20, y: 3, yRange: 20 }]);
|
388
|
+
});
|
389
|
+
|
390
|
+
it('When the user clicks on \'Confirm \'Reset\'\' then the plotted graph should be \'Reset\'', () => {
|
391
|
+
graphingPage.steps.selectGraphControlOptionSpecifyCorrectAnswerSection('Reset');
|
392
|
+
graphingPage.steps.confirmReset();
|
393
|
+
graphingPage.steps.verifyPointsPlottedNotExistOnSpecifyCorrectAnswerSection([{ x: 2, xRange: 20, y: 1, yRange: 20 }, { x: 2, xRange: 20, y: 2, yRange: 20 }, { x: 3, xRange: 20, y: 3, yRange: 20 }]);
|
394
|
+
});
|
395
|
+
|
396
|
+
it('When the user \'Reset\'s the graph then the \'Undo\' and \'Redo\' buttons should be in disabled state', () => {
|
397
|
+
utilities.verifyElementDisabled(graphingPage.graphControlOptionSpecifyCorrectAnswer('Undo'));
|
398
|
+
utilities.verifyElementDisabled(graphingPage.graphControlOptionSpecifyCorrectAnswer('Redo'));
|
399
|
+
});
|
400
|
+
});
|
401
|
+
|
402
|
+
describe('Undo/Redo and Reset functionality preview tab', () => {
|
403
|
+
abortEarlySetup();
|
404
|
+
before(() => {
|
405
|
+
graphingPage.steps.navigateToCreateQuestion('Graphing');
|
406
|
+
cy.barsPreLoaderWait();
|
407
|
+
graphingPage.steps.switchToPreviewTab();
|
408
|
+
});
|
409
|
+
|
410
|
+
it('By default, the \'Move\' button should be in enabled state and the \'Undo\', \'Redo\' and \'Reset\' buttons should be displayed in disabled state', () => {
|
411
|
+
utilities.verifyElementNotDisabled(graphingPage.graphControlOptionPreviewTab('Move'));
|
412
|
+
utilities.verifyElementDisabled(graphingPage.graphControlOptionPreviewTab('Undo'));
|
413
|
+
utilities.verifyElementDisabled(graphingPage.graphControlOptionPreviewTab('Redo'));
|
414
|
+
utilities.verifyElementDisabled(graphingPage.graphControlOptionPreviewTab('Reset'));
|
415
|
+
});
|
416
|
+
|
417
|
+
it('When the user plots points on the graph then the \'Undo\' button should be displayed in enabled state whereas, \'Redo\' and \'Reset\' buttons should be displayed in disabled state', () => {
|
418
|
+
graphingPage.steps.plotPointsOnGraphPreviewTab([{ x: 2, xRange: 20, y: 1, yRange: 20 }, { x: 2, xRange: 20, y: 2, yRange: 20 }, { x: 3, xRange: 20, y: 3, yRange: 20 }]);
|
419
|
+
graphingPage.steps.verifyPointsPlottedOnPreviewTab([{ x: 2, xRange: 20, y: 1, yRange: 20 }, { x: 2, xRange: 20, y: 2, yRange: 20 }, { x: 3, xRange: 20, y: 3, yRange: 20 }]);
|
420
|
+
utilities.verifyElementNotDisabled(graphingPage.graphControlOptionPreviewTab('Undo'));
|
421
|
+
utilities.verifyElementDisabled(graphingPage.graphControlOptionPreviewTab('Redo'));
|
422
|
+
utilities.verifyElementNotDisabled(graphingPage.graphControlOptionPreviewTab('Reset'));
|
423
|
+
});
|
424
|
+
|
425
|
+
it('When the user selects \'Undo\' button then the latest action should be reversed and the \'Redo\' button should become enabled', () => {
|
426
|
+
graphingPage.steps.selectGraphControlOptionPreviewTab('Undo');
|
427
|
+
graphingPage.steps.verifyPointsPlottedOnPreviewTab([{ x: 2, xRange: 20, y: 1, yRange: 20 }, { x: 2, xRange: 20, y: 2, yRange: 20 }]);
|
428
|
+
graphingPage.steps.verifyPointsPlottedNotExistOnPreviewTab([{ x: 3, xRange: 20, y: 3, yRange: 20 }]);
|
429
|
+
utilities.verifyElementNotDisabled(graphingPage.graphControlOptionPreviewTab('Undo'));
|
430
|
+
utilities.verifyElementNotDisabled(graphingPage.graphControlOptionPreviewTab('Redo'));
|
431
|
+
});
|
432
|
+
|
433
|
+
it('When the user clicks on the \'Redo\' button the latest action should be reinstated and the the \'Redo\' button should be disabled again', () => {
|
434
|
+
graphingPage.steps.selectGraphControlOptionPreviewTab('Redo');
|
435
|
+
graphingPage.steps.verifyPointsPlottedOnPreviewTab([{ x: 2, xRange: 20, y: 1, yRange: 20 }, { x: 2, xRange: 20, y: 2, yRange: 20 }, { x: 3, xRange: 20, y: 3, yRange: 20 }]);
|
436
|
+
utilities.verifyElementNotDisabled(graphingPage.graphControlOptionPreviewTab('Undo'));
|
437
|
+
utilities.verifyElementDisabled(graphingPage.graphControlOptionPreviewTab('Redo'));
|
438
|
+
});
|
439
|
+
|
440
|
+
it('When the user reaches the initial state by performing \'Undo\' actions then the \'Redo\' button should be in enabled state and \'Undo\' button should be in disabled state', () => {
|
441
|
+
graphingPage.steps.selectGraphControlOptionPreviewTab('Undo');
|
442
|
+
graphingPage.steps.selectGraphControlOptionPreviewTab('Undo');
|
443
|
+
graphingPage.steps.selectGraphControlOptionPreviewTab('Undo');
|
444
|
+
graphingPage.steps.verifyPointsPlottedNotExistOnPreviewTab([{ x: 2, xRange: 20, y: 1, yRange: 20 }, { x: 2, xRange: 20, y: 2, yRange: 20 }, { x: 3, xRange: 20, y: 3, yRange: 20 }]);
|
445
|
+
utilities.verifyElementDisabled(graphingPage.graphControlOptionPreviewTab('Undo'));
|
446
|
+
utilities.verifyElementNotDisabled(graphingPage.graphControlOptionPreviewTab('Redo'));
|
447
|
+
});
|
448
|
+
|
449
|
+
it('When the user reaches the latest state by performing \'Redo\' actions then the \'Undo\' button should be in enabled state and \'Redo\' button should be in disabled state', () => {
|
450
|
+
graphingPage.steps.selectGraphControlOptionPreviewTab('Redo');
|
451
|
+
graphingPage.steps.selectGraphControlOptionPreviewTab('Redo');
|
452
|
+
graphingPage.steps.selectGraphControlOptionPreviewTab('Redo');
|
453
|
+
graphingPage.steps.verifyPointsPlottedOnPreviewTab([{ x: 2, xRange: 20, y: 1, yRange: 20 }, { x: 2, xRange: 20, y: 2, yRange: 20 }, { x: 3, xRange: 20, y: 3, yRange: 20 }]);
|
454
|
+
utilities.verifyElementNotDisabled(graphingPage.graphControlOptionPreviewTab('Undo'));
|
455
|
+
utilities.verifyElementDisabled(graphingPage.graphControlOptionPreviewTab('Redo'));
|
456
|
+
});
|
457
|
+
|
458
|
+
it('User should be able to select \'Reset\' control', () => {
|
459
|
+
graphingPage.steps.selectGraphControlOptionPreviewTab('Reset');
|
460
|
+
});
|
461
|
+
|
462
|
+
graphingPage.tests.verifyResetPopupContentWithCSSAndA11y("graph");
|
463
|
+
|
464
|
+
it('When the user clicks on the \'Cancel\' button then the plotted graph should not be \'Reset\' and the dialog box should not be displayed', () => {
|
465
|
+
graphingPage.steps.cancelReset();
|
466
|
+
graphingPage.steps.verifyPointsPlottedOnPreviewTab([{ x: 2, xRange: 20, y: 1, yRange: 20 }, { x: 2, xRange: 20, y: 2, yRange: 20 }, { x: 3, xRange: 20, y: 3, yRange: 20 }]);
|
467
|
+
utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'notExist');
|
468
|
+
});
|
469
|
+
|
470
|
+
it('When the user clicks on \'Confirm \'Reset\'\' then the plotted graph should be \'Reset\'', () => {
|
471
|
+
graphingPage.steps.selectGraphControlOptionPreviewTab('Reset');
|
472
|
+
graphingPage.steps.confirmReset();
|
473
|
+
graphingPage.steps.verifyPointsPlottedNotExistOnPreviewTab([{ x: 2, xRange: 20, y: 1, yRange: 20 }, { x: 2, xRange: 20, y: 2, yRange: 20 }, { x: 3, xRange: 20, y: 3, yRange: 20 }]);
|
474
|
+
utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'notExist');
|
475
|
+
});
|
476
|
+
|
477
|
+
it('When the user \'Reset\'s the graph then the \'Undo\' and \'Redo\' buttons should be in disabled state', () => {
|
478
|
+
utilities.verifyElementDisabled(graphingPage.graphControlOptionPreviewTab('Undo'));
|
479
|
+
utilities.verifyElementDisabled(graphingPage.graphControlOptionPreviewTab('Redo'));
|
480
|
+
});
|
481
|
+
});
|
482
|
+
|
483
|
+
describe('Background section content', () => {
|
484
|
+
abortEarlySetup();
|
485
|
+
before(() => {
|
486
|
+
graphingPage.steps.navigateToCreateQuestion('Graphing');
|
487
|
+
cy.barsPreLoaderWait();
|
488
|
+
});
|
489
|
+
|
490
|
+
it('\'Background\' label along with radio buttons \'Blank canvas\', \'Image\' and \'Pattern\' should be displayed', () => {
|
491
|
+
utilities.verifyInnerText(graphingPage.backgroundImageLabel(), 'Background');
|
492
|
+
utilities.verifyInnerText(graphingPage.blankCanvasLabel(), 'Blank canvas');
|
493
|
+
utilities.verifyElementVisibilityState(graphingPage.blankCanvasRadioButton(), 'exist');
|
494
|
+
utilities.verifyInnerText(graphingPage.imageLabel(), 'Image');
|
495
|
+
utilities.verifyElementVisibilityState(graphingPage.imageRadioButton(), 'exist');
|
496
|
+
utilities.verifyInnerText(graphingPage.patternLabel(), 'Pattern');
|
497
|
+
utilities.verifyElementVisibilityState(graphingPage.patternRadioButton(), 'exist');
|
498
|
+
});
|
499
|
+
|
500
|
+
it('By default, blank canvas should be selected', () => {
|
501
|
+
graphingPage.steps.verifyBackgroundRadioButtonChecked('Blank canvas');
|
502
|
+
});
|
503
|
+
|
504
|
+
it('User should be able to select \'Image\' radio button', () => {
|
505
|
+
graphingPage.steps.checkBackgroundRadioButton('Image');
|
506
|
+
});
|
507
|
+
|
508
|
+
graphingPage.tests.verifyBackgroundImageSectionContentWithCSSAndA11y('graphing');
|
509
|
+
|
510
|
+
it('\'Image properties\' label should be displayed.', () => {
|
511
|
+
graphingPage.steps.verifyImagePropertiesLabel();
|
512
|
+
utilities.verifyElementVisibilityState(graphingPage.imagePropertiesLabel(), 'visible');
|
513
|
+
});
|
514
|
+
|
515
|
+
it('\'Fill image to canvas\' label and checkbox should be displayed and checkbox should be unchecked by default', () => {
|
516
|
+
utilities.verifyElementVisibilityState(graphingPage.fillImageToCanvasLabel(), 'visible');
|
517
|
+
utilities.verifyInnerText(graphingPage.fillImageToCanvasLabel(), 'Fill image to canvas');
|
518
|
+
utilities.verifyElementVisibilityState(graphingPage.fillImageToCanvasCheckbox(), 'exist');
|
519
|
+
graphingPage.steps.verifyFillImageToCanvasCheckboxUnchecked();
|
520
|
+
});
|
521
|
+
|
522
|
+
it('User should be able to check \'Fill image to canvas\' checkbox', () => {
|
523
|
+
graphingPage.steps.checkFillImageToCanvasCheckbox();
|
524
|
+
});
|
525
|
+
|
526
|
+
it('\'Image alignment\' label should be displayed. ', () => {
|
527
|
+
utilities.verifyInnerText(graphingPage.imageAlignmentLabel(), 'Image alignment');
|
528
|
+
utilities.verifyElementVisibilityState(graphingPage.imageAlignmentLabel(), 'visible');
|
529
|
+
});
|
530
|
+
|
531
|
+
it(`\'Image alignment\' section should have three options ${alignmentOptions} and ${alignmentOptions[0]} should be active selection by default`, () => {
|
532
|
+
utilities.verifyInnerText(graphingPage.topLeftAlignmentButton(), 'Top left');
|
533
|
+
utilities.verifyElementVisibilityState(graphingPage.topLeftAlignmentButton(), 'visible');
|
534
|
+
utilities.verifyInnerText(graphingPage.centerAlignmentButton(), 'Center');
|
535
|
+
utilities.verifyElementVisibilityState(graphingPage.centerAlignmentButton(), 'visible');
|
536
|
+
utilities.verifyInnerText(graphingPage.topRightAlignmentButton(), 'Top right');
|
537
|
+
utilities.verifyElementVisibilityState(graphingPage.topRightAlignmentButton(), 'visible');
|
538
|
+
});
|
539
|
+
|
540
|
+
it('\'Opacity\' label, input field and slider should be displayed and by default the slider and input field of \'Opacity\' should be set to 100 percent', () => {
|
541
|
+
graphingPage.steps.verifyDefaultOpacityLabelSliderAndInputField();
|
542
|
+
graphingPage.steps.verifyOpacityInputFieldValue(100);
|
543
|
+
graphingPage.steps.verifyValueOfOpacitySlider(100);
|
544
|
+
});
|
545
|
+
|
546
|
+
it('The maximum value of \'Opacity\' slider should be 100', () => {
|
547
|
+
graphingPage.steps.verifyMaxOpacitySliderValue();
|
548
|
+
});
|
549
|
+
|
550
|
+
it('When the user changes value in the opacity input field, the slider value should also change accordingly', () => {
|
551
|
+
graphingPage.steps.enterInputToOpacityInputField(85);
|
552
|
+
graphingPage.steps.verifyOpacityInputFieldValue(85);
|
553
|
+
graphingPage.steps.verifyValueOfOpacitySlider(85);
|
554
|
+
});
|
555
|
+
|
556
|
+
graphingPage.tests.verifyOpacityCSSAndA11y();
|
557
|
+
|
558
|
+
it('When the user changes the opacity slider value, value in the opacity input field should also change', () => {
|
559
|
+
graphingPage.steps.clickActionOnOpacitySlider();
|
560
|
+
graphingPage.steps.verifyValueOfOpacitySlider(50);
|
561
|
+
graphingPage.steps.verifyOpacityInputFieldValue(50);
|
562
|
+
});
|
563
|
+
|
564
|
+
graphingPage.tests.verifyDeleteImagePopupContentAndFunctionality();
|
565
|
+
|
566
|
+
it(`When the user selects \'Pattern\' radio button \'Select pattern\' label should be displayed with ${patternOptions} and by default ${patternOptions[0]} should be selected`, () => {
|
567
|
+
graphingPage.steps.checkBackgroundRadioButton('Pattern');
|
568
|
+
utilities.verifyInnerText(graphingPage.selectPatternLabel(), 'Select pattern');
|
569
|
+
patternOptions.forEach((patternOption) => {
|
570
|
+
utilities.verifyElementVisibilityState(graphingPage.selectPatternOptions(patternOption), 'visible');
|
571
|
+
utilities.verifyElementVisibilityState(graphingPage.selectPatternOptionsLabel(patternOption), 'visible');
|
572
|
+
});
|
573
|
+
});
|
574
|
+
|
575
|
+
it('\'Image alternative text\' label should be displayed with input field should be displayed', () => {
|
576
|
+
utilities.verifyInnerText(graphingPage.selectPatternImageAltTextLabel(), 'Image alternative text');
|
577
|
+
utilities.verifyElementVisibilityState(graphingPage.selectPatternImageAltTextInputField(), 'visible');
|
578
|
+
});
|
579
|
+
|
580
|
+
it(`When the user selects ${patternOptions} then \'Image alternative text\' input field should be accordingly for all them`, () => {
|
581
|
+
patternOptions.forEach((patternOption, index) => {
|
582
|
+
graphingPage.steps.selectSelectPatternOption(patternOption);
|
583
|
+
graphingPage.steps.verifySelectPatternImageAltTextInputField(patternOptionsAltText[index]);
|
584
|
+
});
|
585
|
+
});
|
586
|
+
});
|
587
|
+
|
588
|
+
describe('Background section edit tab functionality', () => {
|
589
|
+
abortEarlySetup();
|
590
|
+
before(() => {
|
591
|
+
graphingPage.steps.navigateToCreateQuestion('Graphing');
|
592
|
+
cy.barsPreLoaderWait();
|
593
|
+
});
|
594
|
+
|
595
|
+
//Note: Update once https://redmine.zeuslearning.com/issues/564975 is resolved
|
596
|
+
it('When the user has selected \'Blank canvas\' radio button then no grid lines or image should be displayed for the \'Specify correct answer\' and background section graph', () => {
|
597
|
+
|
598
|
+
});
|
599
|
+
|
600
|
+
//Note: Update once https://redmine.zeuslearning.com/issues/564975 is resolved
|
601
|
+
it('When the user selects \'Image\' radio button then and no image is uploaded then grid lines should be displayed for the \'Specify correct answer\' and background section graph', () => {
|
602
|
+
graphingPage.steps.checkBackgroundRadioButton('Image');
|
603
|
+
});
|
604
|
+
|
605
|
+
it('When the user uploads a image then the uploaded image should be displayed for the \'Specify correct answer\' and background section graph', () => {
|
606
|
+
graphingPage.steps.uploadFile('image.png');
|
607
|
+
graphingPage.steps.verifyFileNameLabel('image.png');
|
608
|
+
utilities.verifyElementVisibilityState(graphingPage.uploadImageProgressBar(), 'notExist');
|
609
|
+
utilities.scrollIntoView(graphingPage.graphEditTab())
|
610
|
+
cy.wait(5000);
|
611
|
+
graphingPage.steps.plotPointsOnGraphEditTab([{ x: -8, xRange: 20, y: 8, yRange: 20 }]);
|
612
|
+
graphingPage.steps.verifyUploadedImageInGraphEditTab('png');
|
613
|
+
graphingPage.steps.verifyUploadedImageInGraphSpecifyCorrectAnswerSection('png');
|
614
|
+
});
|
615
|
+
|
616
|
+
it('When the user uploads another image then the current image should be replaced by the new image for the \'Specify correct answer\' and background section graph', () => {
|
617
|
+
graphingPage.steps.uploadFile('highlightImage.jpg');
|
618
|
+
graphingPage.steps.verifyFileNameLabel('highlightImage.jpg');
|
619
|
+
utilities.verifyElementVisibilityState(graphingPage.uploadImageProgressBar(), 'notExist');
|
620
|
+
utilities.scrollIntoView(graphingPage.graphEditTab())
|
621
|
+
cy.wait(2000);
|
622
|
+
graphingPage.steps.plotPointsOnGraphEditTab([{ x: -9, xRange: 20, y: 9, yRange: 20 }]);
|
623
|
+
graphingPage.steps.verifyUploadedImageInGraphEditTab('jpg');
|
624
|
+
graphingPage.steps.verifyUploadedImageInGraphSpecifyCorrectAnswerSection('jpg');
|
625
|
+
});
|
626
|
+
|
627
|
+
it('When user unchecks \'Fill image to canvas\' checkbox, then image dimensions should set to default state for the \'Specify correct answer\' and background section graph', () => {
|
628
|
+
graphingPage.steps.verifyFillImageToCanvasCheckboxUnchecked();
|
629
|
+
utilities.scrollIntoView(graphingPage.graphEditTab());
|
630
|
+
cy.wait(2000);
|
631
|
+
graphingPage.steps.plotPointsOnGraphEditTab([{ x: -7, xRange: 20, y: 7, yRange: 20 }]);
|
632
|
+
graphingPage.steps.verifyImageDoesNotFitToGraphEditTab();
|
633
|
+
graphingPage.steps.verifyImageDoesNotFitToGraphSpecifyCorrectAnswerSection();
|
634
|
+
});
|
635
|
+
|
636
|
+
it('When user checks \'Fill image to canvas\' checkbox, then image should be adjusted to fit the \'Specify correct answer\' and background section graph ', () => {
|
637
|
+
graphingPage.steps.checkFillImageToCanvasCheckbox();
|
638
|
+
utilities.scrollIntoView(graphingPage.graphEditTab());
|
639
|
+
cy.wait(2000);
|
640
|
+
graphingPage.steps.plotPointsOnGraphEditTab([{ x: -2, xRange: 20, y: 2, yRange: 20 }]);
|
641
|
+
graphingPage.steps.verifyImageFitsToGraphEditTab();
|
642
|
+
graphingPage.steps.verifyImageFitsToGraphSpecifyCorrectAnswerSection();
|
643
|
+
});
|
644
|
+
|
645
|
+
it('When \'Top left\' image alignment is selected by default, then image should be aligned to top left for the \'Specify correct answer\' and background section graph', () => {
|
646
|
+
graphingPage.steps.uncheckFillImageToCanvasCheckbox();
|
647
|
+
graphingPage.steps.plotPointsOnGraphEditTab([{ x: -6, xRange: 20, y: 6, yRange: 20 }]);
|
648
|
+
graphingPage.steps.verifyImageTopLeftAlignedGraphEditTab();
|
649
|
+
graphingPage.steps.verifyImageTopLeftAlignedGraphSpecifyCorrectAnswerSection();
|
650
|
+
});
|
651
|
+
|
652
|
+
it('When user selects \'Center\' image alignment in edit tab, then image should be aligned to center for the \'Specify correct answer\' and background section graph', () => {
|
653
|
+
graphingPage.steps.selectCenterImageAlignment();
|
654
|
+
graphingPage.steps.plotPointsOnGraphEditTab([{ x: 1, xRange: 20, y: 1, yRange: 20 }]);
|
655
|
+
graphingPage.steps.verifyImageCenterAlignedGraphEditTab();
|
656
|
+
graphingPage.steps.verifyImageCenterAlignedGraphSpecifyCorrectAnswerSection();
|
657
|
+
});
|
658
|
+
|
659
|
+
it('When user selects \'Top right\' image alignment, then image should be aligned to top right for the \'Specify correct answer\' and background section graph', () => {
|
660
|
+
graphingPage.steps.selectTopRightImageAlignment();
|
661
|
+
graphingPage.steps.plotPointsOnGraphEditTab([{ x: 4, xRange: 20, y: 4, yRange: 20 }]);
|
662
|
+
graphingPage.steps.verifyImageTopRightAlignedGraphEditTab();
|
663
|
+
graphingPage.steps.verifyImageTopRightAlignedGraphSpecifyCorrectAnswerSection();
|
664
|
+
});
|
665
|
+
|
666
|
+
it('When user selects \'Top left\' image alignment again, then image should be aligned to top left for the \'Specify correct answer\' and background section graph', () => {
|
667
|
+
graphingPage.steps.selectTopLeftImageAlignment();
|
668
|
+
graphingPage.steps.plotPointsOnGraphEditTab([{ x: -5, xRange: 20, y: 5, yRange: 20 }]);
|
669
|
+
graphingPage.steps.verifyImageTopLeftAlignedGraphEditTab();
|
670
|
+
graphingPage.steps.verifyImageTopLeftAlignedGraphSpecifyCorrectAnswerSection();
|
671
|
+
});
|
672
|
+
|
673
|
+
it('When the opacity value is set to 100 percent by default, then the opacity of the image should be set to 100 percent', () => {
|
674
|
+
graphingPage.steps.verifyOpacityInputFieldValue('100');
|
675
|
+
utilities.scrollIntoView(graphingPage.graphEditTab())
|
676
|
+
graphingPage.steps.plotPointsOnGraphEditTab([{ x: -6, xRange: 20, y: 6, yRange: 20 }]);
|
677
|
+
graphingPage.steps.verifyImageOpacityGraphEditTab('100');
|
678
|
+
graphingPage.steps.verifyImageOpacityGraphSpecifyCorrectAnswerSection('100');
|
679
|
+
});
|
680
|
+
|
681
|
+
it('When the user changes the opacity value from the opacity slider in the edit tab, then the opacity of image should also change accordingly', () => {
|
682
|
+
graphingPage.steps.clickActionOnOpacitySlider();
|
683
|
+
utilities.scrollIntoView(graphingPage.graphEditTab())
|
684
|
+
graphingPage.steps.plotPointsOnGraphEditTab([{ x: -7, xRange: 20, y: 7, yRange: 20 }]);
|
685
|
+
graphingPage.steps.verifyImageOpacityGraphEditTab('50');
|
686
|
+
graphingPage.steps.verifyImageOpacityGraphSpecifyCorrectAnswerSection('50');
|
687
|
+
});
|
688
|
+
|
689
|
+
it('When the user changes the opacity value from the opacity input field in the edit tab, then the opacity of image should also change accordingly', () => {
|
690
|
+
graphingPage.steps.enterInputToOpacityInputField(70);
|
691
|
+
utilities.scrollIntoView(graphingPage.graphEditTab());
|
692
|
+
cy.wait(2000);
|
693
|
+
graphingPage.steps.plotPointsOnGraphEditTab([{ x: -5, xRange: 20, y: 5, yRange: 20 }]);
|
694
|
+
graphingPage.steps.verifyImageOpacityGraphEditTab('70');
|
695
|
+
graphingPage.steps.verifyImageOpacityGraphSpecifyCorrectAnswerSection('70');
|
696
|
+
});
|
697
|
+
|
698
|
+
it('When the user deletes the image then grid lines should be displayed for the \'Specify correct answer\' and background section graph', () => {
|
699
|
+
graphingPage.steps.deleteImage();
|
700
|
+
graphingPage.steps.clickOnDeleteButtonInDeleteImagePopup();
|
701
|
+
});
|
702
|
+
|
703
|
+
it('When the user selects \'Pattern\' radio button and \'Grid\' option is selected then grid lines should be displayed for the \'Specify correct answer\' and background section graph', () => {
|
704
|
+
graphingPage.steps.checkBackgroundRadioButton('Pattern');
|
705
|
+
graphingPage.steps.verifySelectPatternOptionSelected('Grid');
|
706
|
+
});
|
707
|
+
|
708
|
+
//Note: Update once https://redmine.zeuslearning.com/issues/564975 is resolved
|
709
|
+
it(`When the user selects ${patternOptions} then the patterns should change and should be displayed for the \'Specify correct answer\' and background section graph`, () => {
|
710
|
+
|
711
|
+
});
|
712
|
+
});
|
713
|
+
|
714
|
+
describe('Background section preview tab functionality', () => {
|
715
|
+
abortEarlySetup();
|
716
|
+
before(() => {
|
717
|
+
graphingPage.steps.navigateToCreateQuestion('Graphing');
|
718
|
+
cy.barsPreLoaderWait();
|
719
|
+
});
|
720
|
+
|
721
|
+
//Note: Update once https://redmine.zeuslearning.com/issues/564975 is resolved
|
722
|
+
it('When the user has selected \'Blank canvas\' radio button then no grid lines or image should be displayed for the preview tab graph', () => {
|
723
|
+
|
724
|
+
});
|
725
|
+
|
726
|
+
it('When the user selects \'Image\' radio button then and no image is uploaded then grid lines should be displayed for the preview tab graph', () => {
|
727
|
+
graphingPage.steps.checkBackgroundRadioButton('Image');
|
728
|
+
|
729
|
+
});
|
730
|
+
|
731
|
+
it('When the user uploads a image then the uploaded image should be displayed for the preview tab graph', () => {
|
732
|
+
graphingPage.steps.switchToEditTab();
|
733
|
+
graphingPage.steps.uploadFile('image.png');
|
734
|
+
utilities.verifyElementVisibilityState(graphingPage.uploadImageProgressBar(), 'notExist');
|
735
|
+
graphingPage.steps.switchToPreviewTab();
|
736
|
+
graphingPage.steps.verifyUploadedImageInGraphPreviewTab('png');
|
737
|
+
});
|
738
|
+
|
739
|
+
it('When the user uploads another image then the current image should be replaced by the new image for the preview tab graph', () => {
|
740
|
+
graphingPage.steps.switchToEditTab();
|
741
|
+
graphingPage.steps.uploadFile('highlightImage.jpg');
|
742
|
+
utilities.verifyElementVisibilityState(graphingPage.uploadImageProgressBar(), 'notExist');
|
743
|
+
graphingPage.steps.switchToPreviewTab();
|
744
|
+
graphingPage.steps.verifyUploadedImageInGraphPreviewTab('jpg');
|
745
|
+
});
|
746
|
+
|
747
|
+
it('When user checks \'Fill image to canvas\' checkbox, then image should be adjusted to fit the preview tab graph ', () => {
|
748
|
+
graphingPage.steps.switchToEditTab();
|
749
|
+
graphingPage.steps.checkFillImageToCanvasCheckbox();
|
750
|
+
graphingPage.steps.switchToPreviewTab();
|
751
|
+
graphingPage.steps.verifyImageFitsToGraphPreviewTab();
|
752
|
+
});
|
753
|
+
|
754
|
+
it('When user unchecks \'Fill image to canvas\' checkbox, then image dimensions should set to default state for the preview tab graph', () => {
|
755
|
+
graphingPage.steps.switchToEditTab();
|
756
|
+
graphingPage.steps.uncheckFillImageToCanvasCheckbox();
|
757
|
+
graphingPage.steps.switchToPreviewTab();
|
758
|
+
graphingPage.steps.verifyImageDoesNotFitToGraphPreviewTab();
|
759
|
+
});
|
760
|
+
|
761
|
+
it('When \'Top left\' image alignment is selected by default, then image should be aligned to top left for the preview tab graph', () => {
|
762
|
+
graphingPage.steps.verifyImageTopLeftAlignedGraphPreviewTab();
|
763
|
+
});
|
764
|
+
|
765
|
+
it('When user selects \'Center\' image alignment in edit tab, then image should be aligned to center for the preview tab graph', () => {
|
766
|
+
graphingPage.steps.switchToEditTab();
|
767
|
+
graphingPage.steps.selectCenterImageAlignment();
|
768
|
+
graphingPage.steps.switchToPreviewTab();
|
769
|
+
graphingPage.steps.verifyImageCenterAlignedGraphPreviewTab();
|
770
|
+
});
|
771
|
+
|
772
|
+
it('When user selects \'Top right\' image alignment, then image should be aligned to top right for the preview tab graph', () => {
|
773
|
+
graphingPage.steps.switchToEditTab();
|
774
|
+
graphingPage.steps.selectTopRightImageAlignment();
|
775
|
+
graphingPage.steps.switchToPreviewTab();
|
776
|
+
graphingPage.steps.verifyImageTopRightAlignedGraphPreviewTab();
|
777
|
+
});
|
778
|
+
|
779
|
+
it('When user selects \'Top left\' image alignment again, then image should be aligned to top left for the preview tab graph', () => {
|
780
|
+
graphingPage.steps.switchToEditTab();
|
781
|
+
graphingPage.steps.selectTopLeftImageAlignment();
|
782
|
+
graphingPage.steps.switchToPreviewTab();
|
783
|
+
graphingPage.steps.verifyImageTopLeftAlignedGraphPreviewTab();
|
784
|
+
});
|
785
|
+
|
786
|
+
it('When the opacity value is set to 100 percent by default, then the opacity of the image should be set to 100 percent', () => {
|
787
|
+
graphingPage.steps.switchToEditTab();
|
788
|
+
graphingPage.steps.verifyOpacityInputFieldValue('100');
|
789
|
+
graphingPage.steps.switchToPreviewTab();
|
790
|
+
graphingPage.steps.verifyImageOpacityGraphPreviewTab('100');
|
791
|
+
});
|
792
|
+
|
793
|
+
it('When the user changes the opacity value from the opacity slider in the edit tab, then the opacity of image should also change accordingly', () => {
|
794
|
+
graphingPage.steps.switchToEditTab();
|
795
|
+
graphingPage.steps.clickActionOnOpacitySlider();
|
796
|
+
graphingPage.steps.switchToPreviewTab();
|
797
|
+
graphingPage.steps.verifyImageOpacityGraphPreviewTab('50');
|
798
|
+
});
|
799
|
+
|
800
|
+
it('When the user changes the opacity value from the opacity input field in the edit tab, then the opacity of image should also change accordingly', () => {
|
801
|
+
graphingPage.steps.switchToEditTab();
|
802
|
+
graphingPage.steps.enterInputToOpacityInputField(70);
|
803
|
+
graphingPage.steps.switchToPreviewTab();
|
804
|
+
graphingPage.steps.verifyImageOpacityGraphPreviewTab('70');
|
805
|
+
});
|
806
|
+
|
807
|
+
it('When the user deletes the image then grid lines should be displayed for the preview tab graph', () => {
|
808
|
+
graphingPage.steps.switchToEditTab();
|
809
|
+
graphingPage.steps.deleteImage();
|
810
|
+
graphingPage.steps.clickOnDeleteButtonInDeleteImagePopup();
|
811
|
+
graphingPage.steps.switchToPreviewTab();
|
812
|
+
});
|
813
|
+
|
814
|
+
it('When the user selects \'Pattern\' radio button then grid lines should be displayed for the preview tab graph', () => {
|
815
|
+
graphingPage.steps.switchToEditTab();
|
816
|
+
graphingPage.steps.checkBackgroundRadioButton('Pattern');
|
817
|
+
});
|
818
|
+
|
819
|
+
//Note: Update once https://redmine.zeuslearning.com/issues/564975 is resolved
|
820
|
+
it(`When the user selects ${patternOptions} then the patterns should change and should be displayed for the preview tab graph`, () => {
|
821
|
+
|
822
|
+
});
|
823
|
+
});
|
824
|
+
});
|