itemengine-cypress-automation 1.0.24 → 1.0.26
Sign up to get free protection for your applications and to get access to all the features.
- package/cypress/e2e/ILC/FillInTheGapsText/fillInTheGapsTextAdditionalSettingsAdvanceSettingsForAllResponseAreas.js +511 -0
- package/cypress/e2e/ILC/FillInTheGapsText/fillInTheGapsTextAdditionalSettingsBasic.js +263 -0
- package/cypress/e2e/ILC/FillInTheGapsText/fillInTheGapsTextAdditionalSettingsResponseAccordions.js +734 -0
- package/cypress/e2e/ILC/FillInTheGapsText/fillInTheGapsTextAdditionalSettingsStudentResponseAreaAndLayout.js +603 -0
- package/cypress/e2e/ILC/FillInTheGapsText/fillInTheGapsTextAllOrNothingWithAlternateAnswer.js +54 -0
- package/cypress/e2e/ILC/FillInTheGapsText/fillInTheGapsTextAutoScoredScoring.js +0 -46
- package/cypress/e2e/ILC/FillInTheGapsText/fillInTheGapsTextPartialDifferentWeights.js +47 -0
- package/cypress/e2e/ILC/FillInTheGapsText/{fillInTheGapsTextScoringPartialDifferentWeights.js → fillInTheGapsTextPartialDifferentWeightsWithAlternateAnswer.js} +1 -38
- package/cypress/e2e/ILC/FillInTheGapsText/fillInTheGapsTextPartialEqualWeights.js +45 -0
- package/cypress/e2e/ILC/FillInTheGapsText/{fillInTheGapsTextScoringPartialEqualWeights.js → fillInTheGapsTextPartialEqualWeightsWithAlternateAnswer.js} +0 -37
- package/cypress/e2e/ILC/HighlightImage/highlightImageAdditionalSettings.js +447 -0
- package/cypress/e2e/ILC/HighlightImage/highlightImageAllOrNothingScoring.js +1029 -0
- package/cypress/e2e/ILC/HighlightImage/highlightImageCustomizeHighlightProperties.js +1010 -0
- package/cypress/e2e/ILC/HighlightImage/highlightImageEditTabBasic.js +200 -0
- package/cypress/e2e/ILC/HighlightImage/highlightImageEditTabHighlightSectionContents.js +318 -0
- package/cypress/e2e/ILC/HighlightImage/highlightImageEditTabScoring.js +403 -0
- package/cypress/e2e/ILC/HighlightImage/highlightImageHeaderSection.js +86 -0
- package/cypress/e2e/ILC/HighlightImage/highlightImageManuallyAndNonScoredScoring.js +176 -0
- package/cypress/e2e/ILC/HighlightImage/highlightImagePartialDifferentWeightsScoring.js +1093 -0
- package/cypress/e2e/ILC/HighlightImage/highlightImagePartialEqualWeightsScoring.js +1087 -0
- package/cypress/e2e/ILC/HighlightImage/highlightImagePreviewTab.js +88 -0
- package/cypress/e2e/ILC/HighlightImage/highlightImageSetCorrectAnswerCheckboxes.js +244 -0
- package/cypress/e2e/ILC/HighlightImage/highlightImageSetCorrectAnswerSection.js +186 -0
- package/cypress/e2e/ILC/HighlightImage/highlightImageToolsFunctionality.js +309 -0
- package/package.json +1 -1
- package/cypress/e2e/ILC/FillInTheGapsText/fillInTheGapsTextAdditionalSettings.js +0 -2060
@@ -0,0 +1,447 @@
|
|
1
|
+
import { highlightImagePage } from "../../../pages";
|
2
|
+
import { uploadImageSectionComponent } from "../../../pages/components/uploadImageSectionComponent";
|
3
|
+
import abortEarlySetup from "../../../support/helpers/abortEarly";
|
4
|
+
import utilities from "../../../support/helpers/utilities";
|
5
|
+
const css = Cypress.env('css');
|
6
|
+
|
7
|
+
let imageWidth = 500;
|
8
|
+
let imageHeight = 500;
|
9
|
+
const flowerHighlightRegion = [[24, 6], [24, 24], [56, 24], [56, 6]];
|
10
|
+
const branchesHighlightRegion = [[36, 36], [36, 46], [58, 46], [58, 36]];
|
11
|
+
const leafHighlightRegion = [[54, 48], [54, 72], [82, 72], [82, 48]];
|
12
|
+
const rootsHighlightRegion = [[28, 84], [28, 98], [74, 98], [74, 84]];
|
13
|
+
const numbers = ['1', '2'];
|
14
|
+
const lowercase = ['a', 'b'];
|
15
|
+
const uppercase = ['A', 'B'];
|
16
|
+
const fontSizeDropdownOptions = ['Default', 'Small', 'Normal', 'Large', 'Extra large', 'Huge'];
|
17
|
+
const fontSizes = ['16px', '12px', '14px', '17px', '20px', '24px'];
|
18
|
+
const answerNumerationDropdownOptions = ['Numerical', 'Uppercase alphabet', 'Lowercase alphabet'];
|
19
|
+
|
20
|
+
describe('Create Item page - Highlight image: Additional settings', () => {
|
21
|
+
before(() => {
|
22
|
+
cy.loginAs('admin');
|
23
|
+
});
|
24
|
+
|
25
|
+
describe('Additional Settings accordion', () => {
|
26
|
+
abortEarlySetup();
|
27
|
+
before(() => {
|
28
|
+
cy.log('Navigating to Highlight image question type');
|
29
|
+
highlightImagePage.steps.navigateToCreateQuestion('highlight image');
|
30
|
+
cy.barsPreLoaderWait();
|
31
|
+
});
|
32
|
+
|
33
|
+
highlightImagePage.tests.verifyAdditonalSettingsAccordionProperties();
|
34
|
+
});
|
35
|
+
|
36
|
+
describe('Additional settings: Student response area and layout', () => {
|
37
|
+
abortEarlySetup();
|
38
|
+
before(() => {
|
39
|
+
cy.log('Navigating to Highlight image question type');
|
40
|
+
highlightImagePage.steps.navigateToCreateQuestion('highlight image');
|
41
|
+
cy.barsPreLoaderWait();
|
42
|
+
highlightImagePage.steps.expandAdditonalSettings();
|
43
|
+
});
|
44
|
+
|
45
|
+
//TODO: Need to remove this and use common function verifyStudentResponseAreaAndLayoutLabelAndCSS when https://redmine.zeuslearning.com/issues/518498 is resolved
|
46
|
+
it('\'Student response area and layout\' label should be displayed', () => {
|
47
|
+
utilities.verifyInnerText(highlightImagePage.studentResponseAreaAndLayoutLabel(), 'Student response area and layout');
|
48
|
+
utilities.verifyElementVisibilityState(highlightImagePage.studentResponseAreaAndLayoutLabel(), 'visible');
|
49
|
+
});
|
50
|
+
|
51
|
+
it('CSS of \'Student response area and layout\' section', { tags: 'css' }, () => {
|
52
|
+
utilities.verifyCSS(highlightImagePage.studentResponseAreaAndLayoutLabel(), {
|
53
|
+
'color': css.color.labels,
|
54
|
+
'font-size': css.fontSize.default,
|
55
|
+
'font-weight': css.fontWeight.semibold
|
56
|
+
});
|
57
|
+
});
|
58
|
+
|
59
|
+
//Note: a11y covered in verifyAdditonalSettingsAccordionProperties
|
60
|
+
});
|
61
|
+
|
62
|
+
describe('Additional settings: Answer numeration (only while grading) contents', () => {
|
63
|
+
abortEarlySetup();
|
64
|
+
before(() => {
|
65
|
+
cy.log('Navigating to Highlight image question type');
|
66
|
+
highlightImagePage.steps.navigateToCreateQuestion('highlight image');
|
67
|
+
cy.barsPreLoaderWait();
|
68
|
+
highlightImagePage.steps.expandAdditonalSettings();
|
69
|
+
});
|
70
|
+
|
71
|
+
highlightImagePage.tests.verifyAnswerNumerationContents();
|
72
|
+
});
|
73
|
+
|
74
|
+
describe('Additional settings: Answer numeration Set correct answer section', () => {
|
75
|
+
abortEarlySetup();
|
76
|
+
before(() => {
|
77
|
+
cy.log('Navigating to Highlight image question type');
|
78
|
+
highlightImagePage.steps.navigateToCreateQuestion('highlight image');
|
79
|
+
cy.barsPreLoaderWait();
|
80
|
+
uploadImageSectionComponent.steps.uploadFile('highlightImage.jpg');
|
81
|
+
uploadImageSectionComponent.steps.verifyUploadedImageInImagePopup();
|
82
|
+
uploadImageSectionComponent.steps.clickOnImagePopupOkButton();
|
83
|
+
highlightImagePage.steps.expandAdditonalSettings();
|
84
|
+
highlightImagePage.steps.highlightRegionInImage(flowerHighlightRegion);
|
85
|
+
highlightImagePage.steps.highlightRegionInImage(branchesHighlightRegion);
|
86
|
+
});
|
87
|
+
|
88
|
+
it(`When the user selects ${answerNumerationDropdownOptions[0]} option from the Answer Numeration dropdown, then numeration should not be displayed in the Set correct answer section`, () => {
|
89
|
+
utilities.verifyInnerText(highlightImagePage.answerNumerationDropdown(), `${answerNumerationDropdownOptions[0]}`)
|
90
|
+
utilities.verifyElementVisibilityState(highlightImagePage.correctAnswerNumeration(), 'notExist');
|
91
|
+
});
|
92
|
+
|
93
|
+
it(`When the user selects ${answerNumerationDropdownOptions[1]} option from the Answer Numeration dropdown, then numeration should not be displayed in the Set correct answer section`, () => {
|
94
|
+
highlightImagePage.steps.selectAnswerNumerationDropdownOption(`${answerNumerationDropdownOptions[1]}`);
|
95
|
+
utilities.verifyElementVisibilityState(highlightImagePage.correctAnswerNumeration(), 'notExist');
|
96
|
+
});
|
97
|
+
|
98
|
+
it(`When the user selects ${answerNumerationDropdownOptions[2]} option from the Answer Numeration dropdown, then numeration should not be displayed in the Set correct answer section`, () => {
|
99
|
+
highlightImagePage.steps.selectAnswerNumerationDropdownOption(`${answerNumerationDropdownOptions[2]}`);
|
100
|
+
utilities.verifyElementVisibilityState(highlightImagePage.correctAnswerNumeration(), 'notExist');
|
101
|
+
});
|
102
|
+
});
|
103
|
+
|
104
|
+
describe('Additional settings: Answer numeration preview tab', () => {
|
105
|
+
abortEarlySetup();
|
106
|
+
before(() => {
|
107
|
+
cy.log('Navigating to Highlight image question type');
|
108
|
+
highlightImagePage.steps.navigateToCreateQuestion('highlight image');
|
109
|
+
cy.barsPreLoaderWait();
|
110
|
+
uploadImageSectionComponent.steps.uploadFile('highlightImage.jpg');
|
111
|
+
uploadImageSectionComponent.steps.verifyUploadedImageInImagePopup();
|
112
|
+
uploadImageSectionComponent.steps.clickOnImagePopupOkButton();
|
113
|
+
utilities.verifyElementVisibilityState(uploadImageSectionComponent.uploadImagePopup(), 'notExist');
|
114
|
+
highlightImagePage.steps.verifyImageUploadedInHighlightRegion();
|
115
|
+
highlightImagePage.steps.verifyImageUploadedInSetCorrectAnswerSection();
|
116
|
+
highlightImagePage.steps.highlightRegionInImage(flowerHighlightRegion);
|
117
|
+
highlightImagePage.steps.highlightRegionInImage(branchesHighlightRegion);
|
118
|
+
highlightImagePage.steps.highlightRegionInImage(leafHighlightRegion);
|
119
|
+
highlightImagePage.steps.checkMultipleSelectionCheckbox();
|
120
|
+
highlightImagePage.steps.highlightARegionInSetCorrectAnswerSection(0);
|
121
|
+
highlightImagePage.steps.highlightARegionInSetCorrectAnswerSection(2);
|
122
|
+
highlightImagePage.steps.allotPoints(10);
|
123
|
+
highlightImagePage.steps.expandAdditonalSettings();
|
124
|
+
});
|
125
|
+
|
126
|
+
it(`When the user attempts the question when ${answerNumerationDropdownOptions[0]} is selected and selects \'Show correct answer\' checkbox then the correct answer section should have ${answerNumerationDropdownOptions[0]} numeration`, () => {
|
127
|
+
utilities.verifyInnerText(highlightImagePage.answerNumerationDropdown(), `${answerNumerationDropdownOptions[0]}`);
|
128
|
+
highlightImagePage.steps.switchToPreviewTab();
|
129
|
+
highlightImagePage.steps.checkShowCorrectAnswerCheckbox();
|
130
|
+
highlightImagePage.steps.highlightARegionInPreviewTab(1);
|
131
|
+
highlightImagePage.steps.verifyCorrectAnswerContainerNumeration(numbers);
|
132
|
+
});
|
133
|
+
|
134
|
+
it(`When the user attempts the question when ${answerNumerationDropdownOptions[1]} is selected and selects \'Show correct answer\' checkbox then the correct answer section should have ${answerNumerationDropdownOptions[1]} numeration`, () => {
|
135
|
+
highlightImagePage.steps.switchToEditTab();
|
136
|
+
highlightImagePage.steps.selectAnswerNumerationDropdownOption(`${answerNumerationDropdownOptions[1]}`);
|
137
|
+
highlightImagePage.steps.switchToPreviewTab();
|
138
|
+
highlightImagePage.steps.highlightARegionInPreviewTab(1);
|
139
|
+
highlightImagePage.steps.verifyCorrectAnswerContainerNumeration(uppercase);
|
140
|
+
});
|
141
|
+
|
142
|
+
it(`When the user attempts the question when ${answerNumerationDropdownOptions[2]} is selected and selects \'Show correct answer\' checkbox then the correct answer section should have ${answerNumerationDropdownOptions[2]} numeration`, () => {
|
143
|
+
highlightImagePage.steps.switchToEditTab();
|
144
|
+
highlightImagePage.steps.selectAnswerNumerationDropdownOption(`${answerNumerationDropdownOptions[2]}`);
|
145
|
+
highlightImagePage.steps.switchToPreviewTab();
|
146
|
+
highlightImagePage.steps.highlightARegionInPreviewTab(1);
|
147
|
+
highlightImagePage.steps.verifyCorrectAnswerContainerNumeration(lowercase);
|
148
|
+
});
|
149
|
+
});
|
150
|
+
|
151
|
+
describe('Additional settings: Font size contents', () => {
|
152
|
+
abortEarlySetup();
|
153
|
+
before(() => {
|
154
|
+
cy.log('Navigating to Highlight question type');
|
155
|
+
highlightImagePage.steps.navigateToCreateQuestion('highlight image');
|
156
|
+
cy.barsPreLoaderWait();
|
157
|
+
highlightImagePage.steps.expandAdditonalSettings();
|
158
|
+
});
|
159
|
+
|
160
|
+
highlightImagePage.tests.verifyFontSizeSectionContents();
|
161
|
+
});
|
162
|
+
|
163
|
+
describe('Additional settings: Font size functionality set correct answer section', () => {
|
164
|
+
abortEarlySetup();
|
165
|
+
before(() => {
|
166
|
+
cy.log('Navigating to Highlight question type');
|
167
|
+
highlightImagePage.steps.navigateToCreateQuestion('highlight image');
|
168
|
+
cy.barsPreLoaderWait();
|
169
|
+
uploadImageSectionComponent.steps.uploadFile('highlightImage.jpg');
|
170
|
+
uploadImageSectionComponent.steps.verifyUploadedImageInImagePopup();
|
171
|
+
uploadImageSectionComponent.steps.clickOnImagePopupOkButton();
|
172
|
+
utilities.verifyElementVisibilityState(uploadImageSectionComponent.uploadImagePopup(), 'notExist');
|
173
|
+
highlightImagePage.steps.verifyImageUploadedInHighlightRegion();
|
174
|
+
highlightImagePage.steps.verifyImageUploadedInSetCorrectAnswerSection();
|
175
|
+
highlightImagePage.steps.highlightRegionInImage(flowerHighlightRegion);
|
176
|
+
highlightImagePage.steps.highlightRegionInImage(branchesHighlightRegion);
|
177
|
+
highlightImagePage.steps.expandAdditonalSettings();
|
178
|
+
});
|
179
|
+
|
180
|
+
fontSizeDropdownOptions.forEach((option, fontsIndex) => {
|
181
|
+
it(`When the user selects \'${option}\' option from the Font Size dropdown, then font size of the set correct answer section should not change to ${option}`, () => {
|
182
|
+
highlightImagePage.steps.selectFontSizeOptionFromFontSizeDropdown(fontsIndex);
|
183
|
+
utilities.verifyInnerText(highlightImagePage.fontSizeDropdown(), `${option}`);
|
184
|
+
utilities.verifyCSS(highlightImagePage.setCorrectAnswerSectionImage(), {
|
185
|
+
'font-size': fontSizes[2]
|
186
|
+
});
|
187
|
+
utilities.verifyCSS(highlightImagePage.highlightNumeration(), {
|
188
|
+
'font-size': fontSizes[0]
|
189
|
+
});
|
190
|
+
});
|
191
|
+
});
|
192
|
+
});
|
193
|
+
|
194
|
+
describe('Additional settings: Font size functionality preview tab', () => {
|
195
|
+
abortEarlySetup();
|
196
|
+
before(() => {
|
197
|
+
cy.log('Navigating to Highlight question type');
|
198
|
+
highlightImagePage.steps.navigateToCreateQuestion('highlight image');
|
199
|
+
cy.barsPreLoaderWait();
|
200
|
+
highlightImagePage.steps.addQuestionInstructions();
|
201
|
+
uploadImageSectionComponent.steps.uploadFile('highlightImage.jpg');
|
202
|
+
uploadImageSectionComponent.steps.verifyUploadedImageInImagePopup();
|
203
|
+
uploadImageSectionComponent.steps.clickOnImagePopupOkButton();
|
204
|
+
utilities.verifyElementVisibilityState(uploadImageSectionComponent.uploadImagePopup(), 'notExist');
|
205
|
+
highlightImagePage.steps.verifyImageUploadedInHighlightRegion();
|
206
|
+
highlightImagePage.steps.verifyImageUploadedInSetCorrectAnswerSection();
|
207
|
+
highlightImagePage.steps.highlightRegionInImage(flowerHighlightRegion);
|
208
|
+
highlightImagePage.steps.highlightRegionInImage(branchesHighlightRegion);
|
209
|
+
highlightImagePage.steps.allotPoints(10);
|
210
|
+
highlightImagePage.steps.highlightARegionInSetCorrectAnswerSection(0);
|
211
|
+
highlightImagePage.steps.expandAdditonalSettings();
|
212
|
+
});
|
213
|
+
|
214
|
+
fontSizeDropdownOptions.forEach((option, fontsIndex) => {
|
215
|
+
it(`When the user selects \'${option}\' option from the Font Size dropdown, then font size of the preview tab should change to ${option} accordingly`, () => {
|
216
|
+
highlightImagePage.steps.selectFontSizeOptionFromFontSizeDropdown(fontsIndex);
|
217
|
+
utilities.verifyInnerText(highlightImagePage.fontSizeDropdown(), `${option}`);
|
218
|
+
highlightImagePage.steps.switchToPreviewTab();
|
219
|
+
utilities.verifyCSS(highlightImagePage.questionInstructionsText(), {
|
220
|
+
'font-size': fontSizes[fontsIndex]
|
221
|
+
});
|
222
|
+
utilities.verifyCSS(highlightImagePage.previewTabImage(), {
|
223
|
+
'font-size': fontSizes[fontsIndex]
|
224
|
+
});
|
225
|
+
highlightImagePage.steps.checkShowCorrectAnswerCheckbox();
|
226
|
+
highlightImagePage.steps.highlightARegionInPreviewTab(1);
|
227
|
+
utilities.verifyCSS(highlightImagePage.correctAnswerContainerLabel(), {
|
228
|
+
'font-size': fontSizes[fontsIndex]
|
229
|
+
});
|
230
|
+
utilities.verifyCSS(highlightImagePage.correctAnswerNumeration(), {
|
231
|
+
'font-size': fontSizes[fontsIndex]
|
232
|
+
});
|
233
|
+
utilities.verifyCSS(highlightImagePage.correctAnswerContainerAnswerWrapper(), {
|
234
|
+
'font-size': fontSizes[fontsIndex]
|
235
|
+
});
|
236
|
+
highlightImagePage.steps.uncheckShowCorrectAnswerCheckbox();
|
237
|
+
highlightImagePage.steps.switchToEditTab();
|
238
|
+
});
|
239
|
+
});
|
240
|
+
});
|
241
|
+
|
242
|
+
describe('Additional settings: Check answer', () => {
|
243
|
+
abortEarlySetup();
|
244
|
+
before(() => {
|
245
|
+
cy.log('Navigating to Highlight question type');
|
246
|
+
highlightImagePage.steps.navigateToCreateQuestion('highlight image');
|
247
|
+
cy.barsPreLoaderWait();
|
248
|
+
uploadImageSectionComponent.steps.uploadFile('highlightImage.jpg');
|
249
|
+
uploadImageSectionComponent.steps.verifyUploadedImageInImagePopup();
|
250
|
+
uploadImageSectionComponent.steps.clickOnImagePopupOkButton();
|
251
|
+
utilities.verifyElementVisibilityState(uploadImageSectionComponent.uploadImagePopup(), 'notExist');
|
252
|
+
highlightImagePage.steps.verifyImageUploadedInHighlightRegion();
|
253
|
+
highlightImagePage.steps.verifyImageUploadedInSetCorrectAnswerSection();
|
254
|
+
highlightImagePage.steps.highlightRegionInImage(flowerHighlightRegion);
|
255
|
+
highlightImagePage.steps.highlightRegionInImage(branchesHighlightRegion);
|
256
|
+
highlightImagePage.steps.allotPoints(10);
|
257
|
+
highlightImagePage.steps.highlightARegionInSetCorrectAnswerSection(0);
|
258
|
+
highlightImagePage.steps.expandAdditonalSettings();
|
259
|
+
});
|
260
|
+
|
261
|
+
highlightImagePage.tests.verifyCheckAnswerSectionAndPreviewTabCheckAnswerButton();
|
262
|
+
});
|
263
|
+
|
264
|
+
describe('Additional settings: Check answer functionality', () => {
|
265
|
+
abortEarlySetup();
|
266
|
+
before(() => {
|
267
|
+
cy.log('Navigating to Highlight question type');
|
268
|
+
highlightImagePage.steps.navigateToCreateQuestion('highlight image');
|
269
|
+
cy.barsPreLoaderWait();
|
270
|
+
highlightImagePage.steps.addQuestionInstructions();
|
271
|
+
uploadImageSectionComponent.steps.uploadFile('highlightImage.jpg');
|
272
|
+
uploadImageSectionComponent.steps.verifyUploadedImageInImagePopup();
|
273
|
+
uploadImageSectionComponent.steps.clickOnImagePopupOkButton();
|
274
|
+
utilities.verifyElementVisibilityState(uploadImageSectionComponent.uploadImagePopup(), 'notExist');
|
275
|
+
highlightImagePage.steps.verifyImageUploadedInHighlightRegion();
|
276
|
+
highlightImagePage.steps.verifyImageUploadedInSetCorrectAnswerSection();
|
277
|
+
highlightImagePage.steps.highlightRegionInImage(flowerHighlightRegion);
|
278
|
+
highlightImagePage.steps.highlightRegionInImage(branchesHighlightRegion);
|
279
|
+
highlightImagePage.steps.highlightRegionInImage(leafHighlightRegion);
|
280
|
+
highlightImagePage.steps.highlightRegionInImage(rootsHighlightRegion);
|
281
|
+
highlightImagePage.steps.checkMultipleSelectionCheckbox();
|
282
|
+
highlightImagePage.steps.highlightARegionInSetCorrectAnswerSection(0);
|
283
|
+
highlightImagePage.steps.highlightARegionInSetCorrectAnswerSection(3);
|
284
|
+
highlightImagePage.steps.allotPoints(10);
|
285
|
+
highlightImagePage.steps.expandAdditonalSettings();
|
286
|
+
highlightImagePage.steps.setMaximumCheckAnswerAttempts(2);
|
287
|
+
highlightImagePage.steps.switchToPreviewTab();
|
288
|
+
});
|
289
|
+
|
290
|
+
highlightImagePage.tests.verifyCheckAnswerButtonFunctionalityWhenQuestionIsUnattempted();
|
291
|
+
|
292
|
+
it('When user attempts the question partially correct then on clicking on the Check Answer button, green check-mark regions should be displayed for the correctly attempted highlights, red cross-mark regions should be displayed for the incorrectly attempted highlights, a label \'Incorrect answer\' and border should be displayed below the question preview', () => {
|
293
|
+
highlightImagePage.steps.highlightARegionInPreviewTab(0);
|
294
|
+
highlightImagePage.steps.highlightARegionInPreviewTab(1);
|
295
|
+
highlightImagePage.steps.checkAnswer();
|
296
|
+
highlightImagePage.steps.verifyCorrectHighlightRegion(0);
|
297
|
+
highlightImagePage.steps.verifyIncorrectHighlightRegion(1);
|
298
|
+
highlightImagePage.steps.verifyDefaultHighlightRegion(2);
|
299
|
+
highlightImagePage.steps.verifyDefaultHighlightRegion(3);
|
300
|
+
highlightImagePage.steps.verifyIncorrectAttemptBorder();
|
301
|
+
highlightImagePage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect');
|
302
|
+
});
|
303
|
+
|
304
|
+
it('When user attempts the question correctly and clicks on the \'Check Answer\' button, green check-mark regions should be displayed for the correctly attempted highlights, a label \'Correct answer\' and border should be displayed below the question preview', () => {
|
305
|
+
highlightImagePage.steps.removeHighlightOfARegionInPreviewTab(1);
|
306
|
+
highlightImagePage.steps.highlightARegionInPreviewTab(3);
|
307
|
+
highlightImagePage.steps.checkAnswer();
|
308
|
+
highlightImagePage.steps.verifyCorrectHighlightRegion(0);
|
309
|
+
highlightImagePage.steps.verifyDefaultHighlightRegion(1);
|
310
|
+
highlightImagePage.steps.verifyDefaultHighlightRegion(2);
|
311
|
+
highlightImagePage.steps.verifyCorrectHighlightRegion(3);
|
312
|
+
highlightImagePage.steps.verifyCorrectAttemptBorder();
|
313
|
+
highlightImagePage.steps.verifyCorrectIncorrectAnswerLabel('Correct');
|
314
|
+
});
|
315
|
+
|
316
|
+
highlightImagePage.tests.verifyDisabledCheckAnswerButtonWithCSSAnda11y();
|
317
|
+
|
318
|
+
it('When the user updates the value of Maximum check answer attempts input field, it should get reflected on the Preview tab', () => {
|
319
|
+
highlightImagePage.steps.switchToEditTab();
|
320
|
+
highlightImagePage.steps.clearMaximumCheckAnswerAttemptsInputField();
|
321
|
+
highlightImagePage.steps.addInputToMaximumCheckAnswerAttemptsInputField(1);
|
322
|
+
highlightImagePage.steps.switchToPreviewTab();
|
323
|
+
highlightImagePage.steps.verifyCheckAnswerButtonEnabled();
|
324
|
+
highlightImagePage.steps.highlightARegionInPreviewTab(2);
|
325
|
+
highlightImagePage.steps.checkAnswer();
|
326
|
+
highlightImagePage.steps.verifyCheckAnswerButtonDisabled();
|
327
|
+
});
|
328
|
+
|
329
|
+
it('When the \'Maximum check answer attempts\' input field has value \'0\' and user switches to Preview tab, then the \'Check Answer\' button should be enabled and user should be able to check answer multiple times', () => {
|
330
|
+
highlightImagePage.steps.switchToEditTab();
|
331
|
+
highlightImagePage.steps.clearMaximumCheckAnswerAttemptsInputField();
|
332
|
+
highlightImagePage.steps.addInputToMaximumCheckAnswerAttemptsInputField(0);
|
333
|
+
cy.log('Switching to Preview tab')
|
334
|
+
highlightImagePage.steps.switchToPreviewTab();
|
335
|
+
highlightImagePage.steps.highlightARegionInPreviewTab(0);
|
336
|
+
highlightImagePage.steps.checkAnswer();
|
337
|
+
highlightImagePage.steps.verifyCheckAnswerButtonEnabled();
|
338
|
+
highlightImagePage.steps.highlightARegionInPreviewTab(1);
|
339
|
+
highlightImagePage.steps.checkAnswer();
|
340
|
+
highlightImagePage.steps.verifyCheckAnswerButtonEnabled();
|
341
|
+
});
|
342
|
+
|
343
|
+
it('When the \'Maximum check answer attempts\' input field is empty and user switches to Preview tab, then the \'Check Answer\' button should be enabled and user should be able to check answer multiple times', () => {
|
344
|
+
highlightImagePage.steps.switchToEditTab();
|
345
|
+
highlightImagePage.steps.clearMaximumCheckAnswerAttemptsInputField()
|
346
|
+
highlightImagePage.steps.switchToPreviewTab();
|
347
|
+
highlightImagePage.steps.highlightARegionInPreviewTab(0);
|
348
|
+
highlightImagePage.steps.checkAnswer();
|
349
|
+
highlightImagePage.steps.verifyCheckAnswerButtonEnabled();
|
350
|
+
highlightImagePage.steps.highlightARegionInPreviewTab(1);
|
351
|
+
highlightImagePage.steps.checkAnswer();
|
352
|
+
highlightImagePage.steps.verifyCheckAnswerButtonEnabled();
|
353
|
+
});
|
354
|
+
});
|
355
|
+
|
356
|
+
describe('Additional settings: Canvas maximum width contents and set correct answer section', () => {
|
357
|
+
abortEarlySetup();
|
358
|
+
before(() => {
|
359
|
+
cy.log('Navigating to Highlight image question type');
|
360
|
+
highlightImagePage.steps.navigateToCreateQuestion('highlight image');
|
361
|
+
cy.barsPreLoaderWait();
|
362
|
+
uploadImageSectionComponent.steps.uploadFile('highlightImage.jpg');
|
363
|
+
uploadImageSectionComponent.steps.verifyUploadedImageInImagePopup();
|
364
|
+
uploadImageSectionComponent.steps.clickOnImagePopupOkButton();
|
365
|
+
utilities.verifyElementVisibilityState(uploadImageSectionComponent.uploadImagePopup(), 'notExist');
|
366
|
+
highlightImagePage.steps.verifyImageUploadedInHighlightRegion();
|
367
|
+
highlightImagePage.steps.verifyImageUploadedInSetCorrectAnswerSection();
|
368
|
+
highlightImagePage.steps.expandAdditonalSettings();
|
369
|
+
});
|
370
|
+
|
371
|
+
it('\'Canvas maximum width (px)\' label and input field should be displayed and the input field should be empty by default', () => {
|
372
|
+
utilities.verifyInnerText(highlightImagePage.canvasMaximumWidthLabel(), 'Canvas maximum width (px)');
|
373
|
+
utilities.verifyElementVisibilityState(highlightImagePage.canvasMaximumWidthLabel(), 'visible');
|
374
|
+
utilities.verifyElementVisibilityState(highlightImagePage.canvasMaximumWidthInputField(), 'visible');
|
375
|
+
highlightImagePage.steps.verifyCanvasMaximumWidthInputField('');
|
376
|
+
});
|
377
|
+
|
378
|
+
it('When user enters value in \'Canvas maximum width (px)\' the width of the image should change accordingly in set correct answer section', () => {
|
379
|
+
highlightImagePage.steps.addInputToCanvasMaximumWidthInputField(400);
|
380
|
+
highlightImagePage.steps.verifyHeightAndWidthOfImageInSetCorrectAnswerSection(imageHeight, 400);
|
381
|
+
highlightImagePage.steps.verifyImageWidthInHighlightImageSection(imageWidth);
|
382
|
+
});
|
383
|
+
|
384
|
+
it('User should not be able to set \'Canvas maximum width (px)\' below 288px', () => {
|
385
|
+
highlightImagePage.steps.clearCanvasMaximumWidthInputField();
|
386
|
+
highlightImagePage.steps.addInputToCanvasMaximumWidthInputField(200);
|
387
|
+
highlightImagePage.steps.verifyCanvasMaximumWidthInputField(288);
|
388
|
+
highlightImagePage.steps.verifyHeightAndWidthOfImageInSetCorrectAnswerSection(imageHeight, 288);
|
389
|
+
highlightImagePage.steps.verifyImageWidthInHighlightImageSection(imageWidth);
|
390
|
+
});
|
391
|
+
|
392
|
+
it('When user clears the input field the width of the image should be displayed according to the original width', () => {
|
393
|
+
highlightImagePage.steps.clearCanvasMaximumWidthInputField();
|
394
|
+
highlightImagePage.steps.verifyHeightAndWidthOfImageInSetCorrectAnswerSection(imageHeight, imageWidth);
|
395
|
+
highlightImagePage.steps.verifyImageWidthInHighlightImageSection(imageWidth);
|
396
|
+
});
|
397
|
+
});
|
398
|
+
|
399
|
+
describe('Additional settings: Canvas maximum width preview tab', () => {
|
400
|
+
abortEarlySetup();
|
401
|
+
before(() => {
|
402
|
+
cy.log('Navigating to Highlight image question type');
|
403
|
+
highlightImagePage.steps.navigateToCreateQuestion('highlight image');
|
404
|
+
cy.barsPreLoaderWait();
|
405
|
+
uploadImageSectionComponent.steps.uploadFile('highlightImage.jpg');
|
406
|
+
uploadImageSectionComponent.steps.verifyUploadedImageInImagePopup();
|
407
|
+
uploadImageSectionComponent.steps.clickOnImagePopupOkButton();
|
408
|
+
utilities.verifyElementVisibilityState(uploadImageSectionComponent.uploadImagePopup(), 'notExist');
|
409
|
+
highlightImagePage.steps.verifyImageUploadedInHighlightRegion();
|
410
|
+
highlightImagePage.steps.verifyImageUploadedInSetCorrectAnswerSection();
|
411
|
+
highlightImagePage.steps.expandAdditonalSettings();
|
412
|
+
});
|
413
|
+
|
414
|
+
it('When user enters value in \'Canvas maximum width (px)\' the width of the image should change accordingly in preview tab', () => {
|
415
|
+
highlightImagePage.steps.addInputToCanvasMaximumWidthInputField(400);
|
416
|
+
highlightImagePage.steps.switchToPreviewTab();
|
417
|
+
highlightImagePage.steps.verifyHeightAndWidthOfImageInPreviewTab(imageHeight, 400);
|
418
|
+
});
|
419
|
+
|
420
|
+
it('User should not be able to set width of image below 288px', () => {
|
421
|
+
highlightImagePage.steps.switchToEditTab();
|
422
|
+
highlightImagePage.steps.clearCanvasMaximumWidthInputField();
|
423
|
+
highlightImagePage.steps.addInputToCanvasMaximumWidthInputField(200);
|
424
|
+
highlightImagePage.steps.switchToPreviewTab();
|
425
|
+
highlightImagePage.steps.verifyHeightAndWidthOfImageInPreviewTab(imageHeight, 288);
|
426
|
+
});
|
427
|
+
|
428
|
+
it('When user clears the input field the width of the image should be displayed according to the original width', () => {
|
429
|
+
highlightImagePage.steps.switchToEditTab();
|
430
|
+
highlightImagePage.steps.clearCanvasMaximumWidthInputField();
|
431
|
+
highlightImagePage.steps.switchToPreviewTab();
|
432
|
+
highlightImagePage.steps.verifyHeightAndWidthOfImageInPreviewTab(imageHeight, imageWidth);
|
433
|
+
});
|
434
|
+
});
|
435
|
+
|
436
|
+
describe('Additional Settings: Details section', () => {
|
437
|
+
abortEarlySetup();
|
438
|
+
before(() => {
|
439
|
+
cy.log('Navigating to Highlight image question type');
|
440
|
+
highlightImagePage.steps.navigateToCreateQuestion('highlight image');
|
441
|
+
cy.barsPreLoaderWait();
|
442
|
+
highlightImagePage.steps.expandAdditonalSettings();
|
443
|
+
});
|
444
|
+
|
445
|
+
highlightImagePage.tests.verifyDetailsSection();
|
446
|
+
});
|
447
|
+
});
|