itemengine-cypress-automation 1.0.27 → 1.0.28
Sign up to get free protection for your applications and to get access to all the features.
- package/cypress/e2e/ILC/FillInTheGapsDropdown/fillInTheGapsDropdownAdditionalSettings.js +1164 -0
- package/cypress/e2e/ILC/FillInTheGapsDropdown/fillInTheGapsDropdownAutoScoredScoring.js +104 -0
- package/cypress/e2e/ILC/FillInTheGapsDropdown/fillInTheGapsDropdownEditTabBasicSection.js +591 -0
- package/cypress/e2e/ILC/FillInTheGapsDropdown/fillInTheGapsDropdownEditTabScoringSection.js +131 -0
- package/cypress/e2e/ILC/FillInTheGapsDropdown/fillInTheGapsDropdownHeaderSection.js +126 -0
- package/cypress/e2e/ILC/FillInTheGapsDropdown/fillInTheGapsDropdownManuallyAndNonScoredScoring.js +57 -0
- package/cypress/e2e/ILC/FillInTheGapsDropdown/fillInTheGapsDropdownPartialEqualWeights.js +119 -0
- package/cypress/e2e/ILC/FillInTheGapsDropdown/fillInTheGapsDropdownRandomizeOptions.js +86 -0
- package/cypress/e2e/ILC/FillInTheGapsDropdown/fillInTheGapsDropdownScoringPartialDifferentWeights.js +122 -0
- package/cypress/e2e/ILC/FillInTheGapsDropdown/fillInTheGapsDropdownSetCorrectAnswerSection.js +170 -0
- package/package.json +1 -1
@@ -0,0 +1,1164 @@
|
|
1
|
+
import { commonComponents } from "../../../pages/components";
|
2
|
+
import { fillInTheGapsDropdownPage } from "../../../pages/fillInTheGapsDropdownPage";
|
3
|
+
import abortEarlySetup from "../../../support/helpers/abortEarly";
|
4
|
+
const css = Cypress.env('css');
|
5
|
+
|
6
|
+
let optionsForResponse1 = ['changing', 'progressively', 'healthy', 'new'];
|
7
|
+
let optionsForResponse2 = ['increasingly', 'decreasingly', 'extensively', 'exclusively'];
|
8
|
+
|
9
|
+
describe('Fill In the Gaps Additional settings and Responses accordion', () => {
|
10
|
+
before(() => {
|
11
|
+
cy.loginAs('admin');
|
12
|
+
});
|
13
|
+
|
14
|
+
describe('Additional Settings accordion', () => {
|
15
|
+
abortEarlySetup();
|
16
|
+
before(() => {
|
17
|
+
fillInTheGapsDropdownPage.steps.navigateToCreateQuestion('fill in the gaps with dropdown');
|
18
|
+
});
|
19
|
+
|
20
|
+
fillInTheGapsDropdownPage.tests.verifyAdditonalSettingsAccordionProperties();
|
21
|
+
});
|
22
|
+
|
23
|
+
describe('Additional Settings: Advanced settings for all response areas', () => {
|
24
|
+
abortEarlySetup();
|
25
|
+
before(() => {
|
26
|
+
fillInTheGapsDropdownPage.steps.navigateToCreateQuestion('fill in the gaps with dropdown');
|
27
|
+
fillInTheGapsDropdownPage.steps.expandAdditonalSettings();
|
28
|
+
});
|
29
|
+
|
30
|
+
fillInTheGapsDropdownPage.tests.verifyAdvanceSettingsForAllResponsesLabelAndCSS();
|
31
|
+
|
32
|
+
//Note: a11y covered in Additional settings accordion, verifyAdditonalSettingsAccordionProperties
|
33
|
+
});
|
34
|
+
|
35
|
+
describe('Additional Settings: Placeholder text', () => {
|
36
|
+
abortEarlySetup();
|
37
|
+
before(() => {
|
38
|
+
fillInTheGapsDropdownPage.steps.navigateToCreateQuestion('fill in the gaps with dropdown');
|
39
|
+
fillInTheGapsDropdownPage.steps.expandAdditonalSettings();
|
40
|
+
fillInTheGapsDropdownPage.steps.addInputToResponseOptionFields(0, optionsForResponse1)
|
41
|
+
});
|
42
|
+
|
43
|
+
fillInTheGapsDropdownPage.tests.verifyPlaceholderTextLabelInputFieldAndCSS()
|
44
|
+
|
45
|
+
//Note: a11y covered in Additional settings accordion, verifyAdditonalSettingsAccordionProperties
|
46
|
+
|
47
|
+
//Placeholder test cases for Set correct answer section response dropdown
|
48
|
+
it('When \'Placeholder text\' input field is empty then no \'Placeholder text\' should be displayed in the set correct answer response dropown', () => {
|
49
|
+
fillInTheGapsDropdownPage.placeholderTextInputField()
|
50
|
+
.should('have.value', '');
|
51
|
+
fillInTheGapsDropdownPage.responseDropdownWrapperSetCorrectAnswerSection()
|
52
|
+
.within(() => {
|
53
|
+
fillInTheGapsDropdownPage.responseDropdownPlaceholderText()
|
54
|
+
.should('not.exist');
|
55
|
+
});
|
56
|
+
});
|
57
|
+
|
58
|
+
it('When the user adds a text in the Placeholder input field, the added placeholder should be displayed in the set correct answer response dropdown', () => {
|
59
|
+
fillInTheGapsDropdownPage.placeholderTextInputField()
|
60
|
+
.type('Lorem Ipsum')
|
61
|
+
.should('have.value', 'Lorem Ipsum');
|
62
|
+
fillInTheGapsDropdownPage.responseDropdownWrapperSetCorrectAnswerSection()
|
63
|
+
.within(() => {
|
64
|
+
fillInTheGapsDropdownPage.responseDropdownPlaceholderText()
|
65
|
+
.verifyInnerText('Lorem Ipsum')
|
66
|
+
.should('be.visible');
|
67
|
+
});
|
68
|
+
});
|
69
|
+
|
70
|
+
it('CSS of \'Placeholder text\'', { tags: 'css' }, () => {
|
71
|
+
fillInTheGapsDropdownPage.responseDropdownPlaceholderText()
|
72
|
+
.verifyCSS(css.color.placeholderText, css.fontSize.normal, css.fontWeight.regular);
|
73
|
+
});
|
74
|
+
|
75
|
+
it('Accessibility of \'Placeholder text\'', { tags: 'a11y' }, () => {
|
76
|
+
cy.checkAccessibility(fillInTheGapsDropdownPage.responseDropdownWrapperSetCorrectAnswerSection());
|
77
|
+
});
|
78
|
+
|
79
|
+
it('When the user sets an answer using the response dropdown, then the placeholder text should disappear in \'Set correct answer\' section', () => {
|
80
|
+
fillInTheGapsDropdownPage.steps.selectResponseFromSetCorrectAnswerSectionResponseDropdown(0, 'changing')
|
81
|
+
fillInTheGapsDropdownPage.responseDropdownWrapperSetCorrectAnswerSection()
|
82
|
+
.within(() => {
|
83
|
+
fillInTheGapsDropdownPage.responseDropdownPlaceholderText()
|
84
|
+
.should('not.exist');
|
85
|
+
});
|
86
|
+
});
|
87
|
+
|
88
|
+
it('When the user removes the added \'Placeholder text\' then the placeholder text should not be displayed in \'Set correct answer\' section', () => {
|
89
|
+
cy.log('Clearing the placeholder text')
|
90
|
+
fillInTheGapsDropdownPage.placeholderTextInputField()
|
91
|
+
.clear()
|
92
|
+
.should('have.value', '');
|
93
|
+
fillInTheGapsDropdownPage.responseDropdownWrapperSetCorrectAnswerSection()
|
94
|
+
.within(() => {
|
95
|
+
fillInTheGapsDropdownPage.responseDropdownPlaceholderText()
|
96
|
+
.should('not.exist');
|
97
|
+
});
|
98
|
+
});
|
99
|
+
|
100
|
+
//Placeholder test cases for Preview tab response dropdown
|
101
|
+
it('When \'Placeholder text\' input field is empty then no \'Placeholder text\' should be displayed in the preview tab response dropdown', () => {
|
102
|
+
fillInTheGapsDropdownPage.steps.switchToPreviewTab();
|
103
|
+
fillInTheGapsDropdownPage.previewTabResponseDropdownWrapper()
|
104
|
+
.within(() => {
|
105
|
+
fillInTheGapsDropdownPage.responseDropdownPlaceholderText()
|
106
|
+
.should('not.exist');
|
107
|
+
});
|
108
|
+
});
|
109
|
+
|
110
|
+
it('When the user adds a text in the Placeholder input field, the added placeholder should be displayed in the preview tab response dropdown', () => {
|
111
|
+
cy.log('Pre step: Switch to Edit tab')
|
112
|
+
fillInTheGapsDropdownPage.steps.switchToEditTab();
|
113
|
+
fillInTheGapsDropdownPage.placeholderTextInputField()
|
114
|
+
.type('Lorem Ipsum')
|
115
|
+
.should('have.value', 'Lorem Ipsum');
|
116
|
+
fillInTheGapsDropdownPage.steps.switchToPreviewTab();
|
117
|
+
fillInTheGapsDropdownPage.previewTabResponseDropdownWrapper()
|
118
|
+
.within(() => {
|
119
|
+
fillInTheGapsDropdownPage.responseDropdownPlaceholderText()
|
120
|
+
.verifyInnerText('Lorem Ipsum')
|
121
|
+
.should('be.visible');
|
122
|
+
});
|
123
|
+
});
|
124
|
+
|
125
|
+
it('CSS of \'Placeholder text\'', { tags: 'css' }, () => {
|
126
|
+
fillInTheGapsDropdownPage.previewTabResponseDropdownWrapper()
|
127
|
+
.within(() => {
|
128
|
+
fillInTheGapsDropdownPage.responseDropdownPlaceholderText()
|
129
|
+
.verifyCSS(css.color.placeholderText, css.fontSize.normal, css.fontWeight.regular);
|
130
|
+
});
|
131
|
+
});
|
132
|
+
|
133
|
+
it('Accessibility of \'Placeholder text\'', { tags: 'a11y' }, () => {
|
134
|
+
cy.checkAccessibility(fillInTheGapsDropdownPage.previewTabResponseDropdownWrapper())
|
135
|
+
});
|
136
|
+
|
137
|
+
it('When the user sets an answer using the response dropdown, then the placeholder text should disappear in the preview tab', () => {
|
138
|
+
fillInTheGapsDropdownPage.steps.selectResponseFromPreviewTabResponseDropdown(0, 'changing')
|
139
|
+
fillInTheGapsDropdownPage.previewTabResponseDropdownWrapper()
|
140
|
+
.within(() => {
|
141
|
+
fillInTheGapsDropdownPage.responseDropdownPlaceholderText()
|
142
|
+
.should('not.exist');
|
143
|
+
});
|
144
|
+
});
|
145
|
+
|
146
|
+
it('When the user removes the added \'Placeholder text\' then the placeholder text should not be displayed in the preview tab', () => {
|
147
|
+
cy.log('Pre step: Switch to Edit tab')
|
148
|
+
fillInTheGapsDropdownPage.steps.switchToEditTab();
|
149
|
+
cy.log('Clearing the placeholder text and switching to Preview tab')
|
150
|
+
fillInTheGapsDropdownPage.placeholderTextInputField()
|
151
|
+
.clear()
|
152
|
+
.should('have.value', '');
|
153
|
+
fillInTheGapsDropdownPage.steps.switchToPreviewTab();
|
154
|
+
fillInTheGapsDropdownPage.previewTabResponseDropdownWrapper()
|
155
|
+
.within(() => {
|
156
|
+
fillInTheGapsDropdownPage.responseDropdownPlaceholderText()
|
157
|
+
.should('not.exist');
|
158
|
+
});
|
159
|
+
});
|
160
|
+
});
|
161
|
+
|
162
|
+
describe('Additional Settings: Height and Width', () => {
|
163
|
+
abortEarlySetup();
|
164
|
+
before(() => {
|
165
|
+
fillInTheGapsDropdownPage.steps.navigateToCreateQuestion('fill in the gaps with dropdown');
|
166
|
+
fillInTheGapsDropdownPage.steps.addInputToResponseOptionFields(0, optionsForResponse1)
|
167
|
+
fillInTheGapsDropdownPage.steps.expandAdditonalSettings();
|
168
|
+
});
|
169
|
+
|
170
|
+
fillInTheGapsDropdownPage.tests.verifyHeightAndWidthLabelInputFieldWithCSSAnda11y()
|
171
|
+
|
172
|
+
//Height and width test cases for set correct answer section response dropdowns
|
173
|
+
it('When the input field of \'Height\' and \'Width\' is kept empty, the default dimension of the response dropdown should be (200x34)px in \'Set correct answer\' section response dropdown', () => {
|
174
|
+
fillInTheGapsDropdownPage.heightInputField()
|
175
|
+
.should('have.value', '');
|
176
|
+
fillInTheGapsDropdownPage.widthInputField()
|
177
|
+
.should('have.value', '');
|
178
|
+
fillInTheGapsDropdownPage.responseDropdownWrapperSetCorrectAnswerSection()
|
179
|
+
.should('have.attr', 'height', '34px')
|
180
|
+
.and('have.attr', 'width', '200px');
|
181
|
+
});
|
182
|
+
|
183
|
+
it('When the user adds \'Height\' for the response dropdown then the height of the response dropdown should get updated accordingly in \'Set correct answer\' section', () => {
|
184
|
+
fillInTheGapsDropdownPage.heightInputField()
|
185
|
+
.type('100')
|
186
|
+
.should('have.value', '100');
|
187
|
+
fillInTheGapsDropdownPage.responseDropdownWrapperSetCorrectAnswerSection()
|
188
|
+
.should('have.attr', 'height', '100px');
|
189
|
+
});
|
190
|
+
|
191
|
+
it('When the user adds \'Width\' for the response dropdown then the Width of the response dropdown should get updated accordingly in \'Set correct answer\' section', () => {
|
192
|
+
fillInTheGapsDropdownPage.heightInputField()
|
193
|
+
.clear()
|
194
|
+
.should('have.value', '');
|
195
|
+
fillInTheGapsDropdownPage.widthInputField()
|
196
|
+
.type('100')
|
197
|
+
.should('have.value', '100');
|
198
|
+
fillInTheGapsDropdownPage.responseDropdownWrapperSetCorrectAnswerSection()
|
199
|
+
.should('have.attr', 'width', '100px');
|
200
|
+
});
|
201
|
+
|
202
|
+
it('When the user enters a value below 80px in the \'Width\' input field then the width of the input field should remain 80px in set correct answer section', () => {
|
203
|
+
fillInTheGapsDropdownPage.widthInputField()
|
204
|
+
.clear()
|
205
|
+
.type('50')
|
206
|
+
.should('have.value', '50');
|
207
|
+
fillInTheGapsDropdownPage.responseDropdownWrapperSetCorrectAnswerSection()
|
208
|
+
.should('have.attr', 'width', '80px');
|
209
|
+
});
|
210
|
+
|
211
|
+
it('When the user enters a value above 400px in the \'Width\' input field then the width of the input field should remain 400px in set correct answer section', () => {
|
212
|
+
fillInTheGapsDropdownPage.widthInputField()
|
213
|
+
.clear()
|
214
|
+
.type('500')
|
215
|
+
.should('have.value', '500');
|
216
|
+
fillInTheGapsDropdownPage.responseDropdownWrapperSetCorrectAnswerSection()
|
217
|
+
.should('have.attr', 'width', '400px');
|
218
|
+
});
|
219
|
+
|
220
|
+
//Height and width test cases for preview tab response dropdowns
|
221
|
+
//TODO: We will need to revisit below case as it will fail for mobile view
|
222
|
+
it('When the input field of \'Height\' and \'Width\' is kept empty, the default dimension of the response dropdown should be (200x34)px for the preview tab', () => {
|
223
|
+
cy.log('Pre step: Switching to Edit tab')
|
224
|
+
fillInTheGapsDropdownPage.steps.switchToEditTab();
|
225
|
+
fillInTheGapsDropdownPage.widthInputField()
|
226
|
+
.clear()
|
227
|
+
.should('have.value', '');
|
228
|
+
fillInTheGapsDropdownPage.steps.switchToPreviewTab();
|
229
|
+
fillInTheGapsDropdownPage.previewTabResponseDropdownWrapper()
|
230
|
+
.should('have.attr', 'height', '34px')
|
231
|
+
.and('have.attr', 'width', '200px');
|
232
|
+
});
|
233
|
+
|
234
|
+
it('When the user adds \'Height\' for the response dropdown then the height of the response dropdown should get updated accordingly in the preview tab', () => {
|
235
|
+
cy.log('Pre step: Switching to Edit tab')
|
236
|
+
fillInTheGapsDropdownPage.steps.switchToEditTab();
|
237
|
+
fillInTheGapsDropdownPage.heightInputField()
|
238
|
+
.type('100')
|
239
|
+
.should('have.value', '100');
|
240
|
+
fillInTheGapsDropdownPage.steps.switchToPreviewTab();
|
241
|
+
fillInTheGapsDropdownPage.previewTabResponseDropdownWrapper()
|
242
|
+
.should('have.attr', 'height', '100px');
|
243
|
+
});
|
244
|
+
|
245
|
+
it('When the user adds \'Width\' for the response dropdown then the response dropdowns should get updated accordingly in the preview tab', () => {
|
246
|
+
cy.log('Pre step: Switching to Edit tab')
|
247
|
+
fillInTheGapsDropdownPage.steps.switchToEditTab();
|
248
|
+
fillInTheGapsDropdownPage.widthInputField()
|
249
|
+
.type('100')
|
250
|
+
.should('have.value', '100');
|
251
|
+
fillInTheGapsDropdownPage.steps.switchToPreviewTab();
|
252
|
+
fillInTheGapsDropdownPage.previewTabResponseDropdownWrapper()
|
253
|
+
.should('have.attr', 'width', '100px');
|
254
|
+
});
|
255
|
+
|
256
|
+
it('When the user enters a value below 80px in the \'Width\' input field then the input field should remain 80px for the preview tab response dropdowns', () => {
|
257
|
+
cy.log('Pre step: Switching to Edit tab')
|
258
|
+
fillInTheGapsDropdownPage.steps.switchToEditTab();
|
259
|
+
fillInTheGapsDropdownPage.widthInputField()
|
260
|
+
.clear()
|
261
|
+
.type('50')
|
262
|
+
.should('have.value', '50');
|
263
|
+
fillInTheGapsDropdownPage.steps.switchToPreviewTab();
|
264
|
+
fillInTheGapsDropdownPage.previewTabResponseDropdownWrapper()
|
265
|
+
.should('have.attr', 'width', '80px');
|
266
|
+
});
|
267
|
+
|
268
|
+
it('When the user enters a value above 400px in the \'Width\' input field then the input field should remain 400px for preview tab repsonse field', () => {
|
269
|
+
cy.log('Pre step: Switching to Edit tab')
|
270
|
+
fillInTheGapsDropdownPage.steps.switchToEditTab();
|
271
|
+
fillInTheGapsDropdownPage.widthInputField()
|
272
|
+
.clear()
|
273
|
+
.type('500')
|
274
|
+
.should('have.value', '500');
|
275
|
+
fillInTheGapsDropdownPage.steps.switchToPreviewTab();
|
276
|
+
fillInTheGapsDropdownPage.previewTabResponseDropdownWrapper()
|
277
|
+
.should('have.attr', 'width', '400px');
|
278
|
+
});
|
279
|
+
});
|
280
|
+
|
281
|
+
describe('Additional Settings : Response accordion', () => {
|
282
|
+
abortEarlySetup();
|
283
|
+
before(() => {
|
284
|
+
fillInTheGapsDropdownPage.steps.navigateToCreateQuestion('fill in the gaps with dropdown');
|
285
|
+
fillInTheGapsDropdownPage.steps.addInputToResponseOptionFields(0, optionsForResponse1);
|
286
|
+
fillInTheGapsDropdownPage.steps.addResponseTokenInQuestionField();
|
287
|
+
fillInTheGapsDropdownPage.steps.expandAdditonalSettings();
|
288
|
+
});
|
289
|
+
|
290
|
+
fillInTheGapsDropdownPage.tests.verifyAdditionalSettingsResponseAccordionLabelCSSAndA11y();
|
291
|
+
});
|
292
|
+
|
293
|
+
describe('Response Accordions: ARIA label', () => {
|
294
|
+
abortEarlySetup();
|
295
|
+
before(() => {
|
296
|
+
fillInTheGapsDropdownPage.steps.navigateToCreateQuestion('fill in the gaps with dropdown');
|
297
|
+
fillInTheGapsDropdownPage.steps.addInputToResponseOptionFields(0, optionsForResponse1);
|
298
|
+
fillInTheGapsDropdownPage.steps.addResponseTokenInQuestionField();
|
299
|
+
fillInTheGapsDropdownPage.steps.expandAdditonalSettings();
|
300
|
+
fillInTheGapsDropdownPage.steps.expandResponseAccordion(0);
|
301
|
+
fillInTheGapsDropdownPage.steps.expandResponseAccordion(1);
|
302
|
+
});
|
303
|
+
|
304
|
+
fillInTheGapsDropdownPage.tests.verifyDefaultStateOfAriaLabelInputFieldInResponseAccordionAndCSS();
|
305
|
+
|
306
|
+
//Note: a11y covered in Additional Settings: Response accordion
|
307
|
+
|
308
|
+
//ARIA label test cases for set correct answer section
|
309
|
+
it('When the user has not set \'ARIA label\' input field then the default \'ARIA label\' should be present for the \'Set correct answer\' section response dropdown', () => {
|
310
|
+
fillInTheGapsDropdownPage.responseDropdownSetCorrectAnswerSection()
|
311
|
+
.each(($el, index) => {
|
312
|
+
cy.wrap($el)
|
313
|
+
.should('have.attr', 'aria-label', `Add answer for response ${index + 1}`);
|
314
|
+
});
|
315
|
+
});
|
316
|
+
|
317
|
+
fillInTheGapsDropdownPage.tests.verifyCustomLabelNotVisibleOnResponseAccordion('ARIA label');
|
318
|
+
|
319
|
+
it('When the user has set \'ARIA label\' in the response accordion then it should be present for the response dropdown in \'Set correct answer\' section and for the other response dropdown, value of the aria-label should remain the same', () => {
|
320
|
+
fillInTheGapsDropdownPage.steps.setAriaLabelInResponseAccordion(0, 'Custom ARIA label');
|
321
|
+
fillInTheGapsDropdownPage.responseDropdownSetCorrectAnswerSection()
|
322
|
+
.eq(0)
|
323
|
+
.should('have.attr', 'aria-label', `Custom ARIA label`);
|
324
|
+
fillInTheGapsDropdownPage.responseDropdownSetCorrectAnswerSection()
|
325
|
+
.eq(1)
|
326
|
+
.should('have.attr', 'aria-label', `Add answer for response 2`);
|
327
|
+
});
|
328
|
+
|
329
|
+
//https://redmine.zeuslearning.com/issues/529768
|
330
|
+
fillInTheGapsDropdownPage.tests.verifyCustomLabelVisibleOnResponseAccordion('ARIA label');
|
331
|
+
|
332
|
+
fillInTheGapsDropdownPage.tests.verifyCustomLabelOnResponseAccordionCSS();
|
333
|
+
|
334
|
+
it('Accessibility of dropdown in set correct answer section when custom \'ARIA label\' is set and Custom label', { tags: 'a11y' }, () => {
|
335
|
+
cy.checkAccessibility(fillInTheGapsDropdownPage.responseDropdownSetCorrectAnswerSection())
|
336
|
+
cy.checkAccessibility(fillInTheGapsDropdownPage.responseAccordionCustomLabel())
|
337
|
+
});
|
338
|
+
|
339
|
+
it('When the user clears the set value in the ARIA label input field, then the default ARIA label should be present for the response dropdown in the \'Set correct answer\' section', () => {
|
340
|
+
fillInTheGapsDropdownPage.responseAccordionWrapper()
|
341
|
+
.eq(0)
|
342
|
+
.within(() => {
|
343
|
+
fillInTheGapsDropdownPage.ariaLabelInputField()
|
344
|
+
.clear()
|
345
|
+
.should('have.value', '');
|
346
|
+
});
|
347
|
+
fillInTheGapsDropdownPage.responseDropdownSetCorrectAnswerSection()
|
348
|
+
.each(($el, index) => {
|
349
|
+
cy.wrap($el)
|
350
|
+
.should('have.attr', 'aria-label', `Add answer for response ${index + 1}`);
|
351
|
+
});
|
352
|
+
});
|
353
|
+
|
354
|
+
//ARIA label test cases for preview tab
|
355
|
+
it('When the user has not set \'ARIA label\' input field then in the preview tab default \'ARIA label\' should be present for the response dropdown in the preview tab', () => {
|
356
|
+
cy.log('Pre step: Switch to Preview tab')
|
357
|
+
fillInTheGapsDropdownPage.steps.switchToPreviewTab();
|
358
|
+
fillInTheGapsDropdownPage.previewTabResponseDropdown()
|
359
|
+
.each(($el, index) => {
|
360
|
+
cy.wrap($el)
|
361
|
+
.should('have.attr', 'aria-label', `Add answer for response ${index + 1}`);
|
362
|
+
});
|
363
|
+
});
|
364
|
+
|
365
|
+
it('When the user has set \'ARIA label\' in the response accordion then it should be present for the response dropdown in the preview tab', () => {
|
366
|
+
cy.log('Pre step: Switch to Edit tab')
|
367
|
+
fillInTheGapsDropdownPage.steps.switchToEditTab();
|
368
|
+
fillInTheGapsDropdownPage.steps.setAriaLabelInResponseAccordion(0, 'Custom Aria label');
|
369
|
+
fillInTheGapsDropdownPage.steps.switchToPreviewTab();
|
370
|
+
fillInTheGapsDropdownPage.previewTabResponseDropdown()
|
371
|
+
.eq(0)
|
372
|
+
.should('have.attr', 'aria-label', 'Custom Aria label');
|
373
|
+
fillInTheGapsDropdownPage.previewTabResponseDropdown()
|
374
|
+
.eq(1)
|
375
|
+
.should('have.attr', 'aria-label', `Add answer for response 2`);
|
376
|
+
});
|
377
|
+
|
378
|
+
it('Accessibility of input field in preview tab when custom \'ARIA label\' is set', { tags: 'a11y' }, () => {
|
379
|
+
cy.checkAccessibility(fillInTheGapsDropdownPage.responseDropdownSetCorrectAnswerSection());
|
380
|
+
});
|
381
|
+
|
382
|
+
it('When the user clears the set value in the \'ARIA label\' input field, then the default \'ARIA label\' should be present for the response dropdown in the preview tab', () => {
|
383
|
+
cy.log('Pre step: Switch to Edit tab')
|
384
|
+
fillInTheGapsDropdownPage.steps.switchToEditTab();
|
385
|
+
fillInTheGapsDropdownPage.responseAccordionWrapper()
|
386
|
+
.eq(0)
|
387
|
+
.within(() => {
|
388
|
+
fillInTheGapsDropdownPage.ariaLabelInputField()
|
389
|
+
.clear()
|
390
|
+
.should('have.value', '');
|
391
|
+
});
|
392
|
+
fillInTheGapsDropdownPage.steps.switchToPreviewTab();
|
393
|
+
fillInTheGapsDropdownPage.previewTabResponseDropdown()
|
394
|
+
.each(($el, index) => {
|
395
|
+
cy.wrap($el)
|
396
|
+
.should('have.attr', 'aria-label', `Add answer for response ${index + 1}`);
|
397
|
+
});
|
398
|
+
});
|
399
|
+
});
|
400
|
+
|
401
|
+
describe('Response Accordions: Placeholder text', () => {
|
402
|
+
abortEarlySetup();
|
403
|
+
before(() => {
|
404
|
+
fillInTheGapsDropdownPage.steps.navigateToCreateQuestion('fill in the gaps with dropdown');
|
405
|
+
fillInTheGapsDropdownPage.steps.addInputToResponseOptionFields(0, optionsForResponse1);
|
406
|
+
fillInTheGapsDropdownPage.steps.addResponseTokenInQuestionField();
|
407
|
+
fillInTheGapsDropdownPage.steps.expandAdditonalSettings();
|
408
|
+
fillInTheGapsDropdownPage.steps.expandResponseAccordion(0)
|
409
|
+
fillInTheGapsDropdownPage.steps.expandResponseAccordion(1)
|
410
|
+
});
|
411
|
+
|
412
|
+
fillInTheGapsDropdownPage.tests.verifyDefaultStateOfPlaceholderTextInputFieldInResponseAccordionAndCSS();
|
413
|
+
|
414
|
+
//Note: a11y covered in Additional Settings: Response accordion
|
415
|
+
|
416
|
+
//Placeholder test cases for Set correct answer section
|
417
|
+
it('When the user has not set Placeholder text in the Response accordion then placeholder should not be displayed in set correct answer section', () => {
|
418
|
+
fillInTheGapsDropdownPage.responseDropdownWrapperSetCorrectAnswerSection()
|
419
|
+
.each(($el) => {
|
420
|
+
cy.wrap($el)
|
421
|
+
.within(() => {
|
422
|
+
fillInTheGapsDropdownPage.responseDropdownPlaceholderText()
|
423
|
+
.should('not.exist');
|
424
|
+
});
|
425
|
+
});
|
426
|
+
});
|
427
|
+
|
428
|
+
fillInTheGapsDropdownPage.tests.verifyCustomLabelNotVisibleOnResponseAccordion('Placeholder text');
|
429
|
+
|
430
|
+
it('When the user has set a Placeholder text in either response accordion then a placeholder text should be displayed for the respective response in set correct answer section', () => {
|
431
|
+
fillInTheGapsDropdownPage.steps.setPlaceholderTextInResponseAccordion(0, 'Lorem Ipsum');
|
432
|
+
fillInTheGapsDropdownPage.responseDropdownWrapperSetCorrectAnswerSection()
|
433
|
+
.eq(0)
|
434
|
+
.within(() => {
|
435
|
+
fillInTheGapsDropdownPage.responseDropdownPlaceholderText()
|
436
|
+
.verifyInnerText('Lorem Ipsum')
|
437
|
+
.should('be.visible');
|
438
|
+
});
|
439
|
+
});
|
440
|
+
|
441
|
+
fillInTheGapsDropdownPage.tests.verifyCustomLabelVisibleOnResponseAccordion('Placeholder text');
|
442
|
+
|
443
|
+
it('When the user removes the Placeholder text from the individual responses the Placeholders should get updated accordingly in Set correct answer section', () => {
|
444
|
+
fillInTheGapsDropdownPage.responseAccordionWrapper()
|
445
|
+
.eq(0)
|
446
|
+
.within(() => {
|
447
|
+
fillInTheGapsDropdownPage.placeholderTextInputField()
|
448
|
+
.clear()
|
449
|
+
.should('have.value', '');
|
450
|
+
});
|
451
|
+
fillInTheGapsDropdownPage.responseDropdownWrapperSetCorrectAnswerSection()
|
452
|
+
.eq(0)
|
453
|
+
.within(() => {
|
454
|
+
fillInTheGapsDropdownPage.responseDropdownPlaceholderText()
|
455
|
+
.should('not.exist');
|
456
|
+
});
|
457
|
+
});
|
458
|
+
|
459
|
+
it('When the user has set placeholder text in the individual response areas, then it should override the placeholder text set in the \'Advanced settings for all response areas\' in \'Set correct answer\' section', () => {
|
460
|
+
fillInTheGapsDropdownPage.placeholderTextInputField()
|
461
|
+
.type('Global placeholder')
|
462
|
+
.should('have.value', 'Global placeholder');
|
463
|
+
fillInTheGapsDropdownPage.steps.setPlaceholderTextInResponseAccordion(0, 'Lorem Ipsum');
|
464
|
+
fillInTheGapsDropdownPage.responseDropdownWrapperSetCorrectAnswerSection()
|
465
|
+
.eq(0)
|
466
|
+
.within(() => {
|
467
|
+
fillInTheGapsDropdownPage.responseDropdownPlaceholderText()
|
468
|
+
.verifyInnerText('Lorem Ipsum')
|
469
|
+
.should('be.visible');
|
470
|
+
});
|
471
|
+
fillInTheGapsDropdownPage.responseDropdownWrapperSetCorrectAnswerSection()
|
472
|
+
.eq(1)
|
473
|
+
.verifyInnerText('Global placeholder\n\n')
|
474
|
+
.should('be.visible');
|
475
|
+
});
|
476
|
+
|
477
|
+
it('Accessibility of \'Placeholder text\' in set correct answer section', { tags: 'a11y' }, () => {
|
478
|
+
cy.checkAccessibility(fillInTheGapsDropdownPage.responseDropdownWrapperSetCorrectAnswerSection());
|
479
|
+
});
|
480
|
+
|
481
|
+
it('When the user selects an option from the response dropdown, then the placeholder text should disappear from the response dropdown from the set correct answer section', () => {
|
482
|
+
fillInTheGapsDropdownPage.steps.selectResponseFromSetCorrectAnswerSectionResponseDropdown(0, 'new')
|
483
|
+
fillInTheGapsDropdownPage.responseDropdownWrapperSetCorrectAnswerSection()
|
484
|
+
.eq(0)
|
485
|
+
.within(() => {
|
486
|
+
fillInTheGapsDropdownPage.responseDropdownPlaceholderText()
|
487
|
+
.should('not.exist');
|
488
|
+
});
|
489
|
+
});
|
490
|
+
|
491
|
+
//TODO: need to add or update above case for query: https://redmine.zeuslearning.com/issues/529774
|
492
|
+
|
493
|
+
//Placeholder test cases for preview tab
|
494
|
+
it('When the user has not set Placeholder text in the Response accordion then placeholder should not be displayed in preview tab response dropdowns', () => {
|
495
|
+
cy.log('Pre step: Clearing the set Placeholder text')
|
496
|
+
fillInTheGapsDropdownPage.placeholderTextInputField()
|
497
|
+
.clear()
|
498
|
+
.should('have.value', '');
|
499
|
+
fillInTheGapsDropdownPage.responseAccordionWrapper()
|
500
|
+
.eq(0)
|
501
|
+
.within(() => {
|
502
|
+
fillInTheGapsDropdownPage.placeholderTextInputField()
|
503
|
+
.clear()
|
504
|
+
.should('have.value', '');
|
505
|
+
});
|
506
|
+
fillInTheGapsDropdownPage.steps.switchToPreviewTab();
|
507
|
+
fillInTheGapsDropdownPage.previewTabResponseDropdownWrapper()
|
508
|
+
.each(($el) => {
|
509
|
+
cy.wrap($el)
|
510
|
+
.within(() => {
|
511
|
+
fillInTheGapsDropdownPage.responseDropdownPlaceholderText()
|
512
|
+
.should('not.exist');
|
513
|
+
});
|
514
|
+
});
|
515
|
+
});
|
516
|
+
|
517
|
+
it('When the user has set a Placeholder text in either individual response accordion a placeholder text should be displayed for the respective response in preview tab', () => {
|
518
|
+
fillInTheGapsDropdownPage.steps.switchToEditTab()
|
519
|
+
fillInTheGapsDropdownPage.steps.setPlaceholderTextInResponseAccordion(0, 'Lorem Ipsum');
|
520
|
+
fillInTheGapsDropdownPage.steps.switchToPreviewTab();
|
521
|
+
fillInTheGapsDropdownPage.previewTabResponseDropdownWrapper()
|
522
|
+
.eq(0)
|
523
|
+
.within(() => {
|
524
|
+
fillInTheGapsDropdownPage.responseDropdownPlaceholderText()
|
525
|
+
.verifyInnerText('Lorem Ipsum')
|
526
|
+
.should('be.visible');
|
527
|
+
});
|
528
|
+
fillInTheGapsDropdownPage.previewTabResponseDropdownWrapper()
|
529
|
+
.eq(1)
|
530
|
+
.within(() => {
|
531
|
+
fillInTheGapsDropdownPage.responseDropdownPlaceholderText()
|
532
|
+
.should('not.exist');
|
533
|
+
});
|
534
|
+
});
|
535
|
+
|
536
|
+
it('When the user removes the Placeholder text from individual responses the Placeholders should get updated accordingly for both the responses in preview tab', () => {
|
537
|
+
fillInTheGapsDropdownPage.steps.switchToEditTab()
|
538
|
+
fillInTheGapsDropdownPage.responseAccordionWrapper()
|
539
|
+
.eq(0)
|
540
|
+
.within(() => {
|
541
|
+
fillInTheGapsDropdownPage.placeholderTextInputField()
|
542
|
+
.clear()
|
543
|
+
.should('have.value', '');
|
544
|
+
});
|
545
|
+
fillInTheGapsDropdownPage.steps.switchToPreviewTab()
|
546
|
+
fillInTheGapsDropdownPage.previewTabResponseDropdownWrapper()
|
547
|
+
.eq(0)
|
548
|
+
.within(() => {
|
549
|
+
fillInTheGapsDropdownPage.responseDropdownPlaceholderText()
|
550
|
+
.should('not.exist');
|
551
|
+
});
|
552
|
+
});
|
553
|
+
|
554
|
+
it('When the user has set placeholder text in the individual response area, then it should override the placeholder text set in the \'Advanced settings for all response areas\' in the preview tab response dropdowns', () => {
|
555
|
+
fillInTheGapsDropdownPage.steps.switchToEditTab()
|
556
|
+
fillInTheGapsDropdownPage.placeholderTextInputField()
|
557
|
+
.type('Global placeholder')
|
558
|
+
.should('have.value', 'Global placeholder');
|
559
|
+
fillInTheGapsDropdownPage.steps.setPlaceholderTextInResponseAccordion(0, 'Lorem Ipsum');
|
560
|
+
fillInTheGapsDropdownPage.steps.switchToPreviewTab();
|
561
|
+
fillInTheGapsDropdownPage.previewTabResponseDropdownWrapper()
|
562
|
+
.eq(0)
|
563
|
+
.within(() => {
|
564
|
+
fillInTheGapsDropdownPage.responseDropdownPlaceholderText()
|
565
|
+
.verifyInnerText('Lorem Ipsum')
|
566
|
+
.should('be.visible');
|
567
|
+
});
|
568
|
+
fillInTheGapsDropdownPage.previewTabResponseDropdownWrapper()
|
569
|
+
.eq(1)
|
570
|
+
.within(() => {
|
571
|
+
fillInTheGapsDropdownPage.responseDropdownPlaceholderText()
|
572
|
+
.verifyInnerText('Global placeholder');
|
573
|
+
});
|
574
|
+
});
|
575
|
+
|
576
|
+
it('Accessibility of \'Placeholder text\' in preview tab', { tags: 'a11y' }, () => {
|
577
|
+
cy.checkAccessibility(fillInTheGapsDropdownPage.previewTabResponseDropdownWrapper());
|
578
|
+
});
|
579
|
+
|
580
|
+
it('When the user selects an option from the response dropdown, then the placeholder text should disappear', () => {
|
581
|
+
fillInTheGapsDropdownPage.steps.selectResponseFromPreviewTabResponseDropdown(0, 'new')
|
582
|
+
fillInTheGapsDropdownPage.previewTabResponseDropdownWrapper()
|
583
|
+
.eq(0)
|
584
|
+
.within(() => {
|
585
|
+
fillInTheGapsDropdownPage.responseDropdownPlaceholderText()
|
586
|
+
.should('not.exist');
|
587
|
+
});
|
588
|
+
});
|
589
|
+
|
590
|
+
//TODO: need to add or update above case for query: https://redmine.zeuslearning.com/issues/529774
|
591
|
+
});
|
592
|
+
|
593
|
+
describe('Response Accordions: Height and Width', () => {
|
594
|
+
abortEarlySetup();
|
595
|
+
before(() => {
|
596
|
+
fillInTheGapsDropdownPage.steps.navigateToCreateQuestion('fill in the gaps with dropdown');
|
597
|
+
fillInTheGapsDropdownPage.steps.addInputToResponseOptionFields(0, optionsForResponse1);
|
598
|
+
fillInTheGapsDropdownPage.steps.addResponseTokenInQuestionField();
|
599
|
+
fillInTheGapsDropdownPage.steps.expandAdditonalSettings();
|
600
|
+
fillInTheGapsDropdownPage.steps.expandResponseAccordion(0);
|
601
|
+
fillInTheGapsDropdownPage.steps.expandResponseAccordion(1);
|
602
|
+
});
|
603
|
+
|
604
|
+
fillInTheGapsDropdownPage.tests.verifyDefaultStateOfHeightAndWidthInputFieldInResponseAccordionAndCSS();
|
605
|
+
|
606
|
+
//Note: a11y covered in Additional Settings: Response accordion
|
607
|
+
|
608
|
+
//Height and width test cases for Set correct answer section
|
609
|
+
//TODO: We will need to revisit below case as it will fail for mobile view
|
610
|
+
it('When the user has not set \'Height\' and \'Width\' for response dropdowns then the default dimension of the response dropdown in \'Set correct answer\' section response dropdowns should be (200x34)px', () => {
|
611
|
+
fillInTheGapsDropdownPage.responseDropdownWrapperSetCorrectAnswerSection()
|
612
|
+
.should('have.attr', 'height', '34px')
|
613
|
+
.and('have.attr', 'width', '200px');
|
614
|
+
});
|
615
|
+
|
616
|
+
fillInTheGapsDropdownPage.tests.verifyCustomLabelNotVisibleOnResponseAccordion('Height and Width');
|
617
|
+
|
618
|
+
it('When the user has set \'Height\' for the response dropdown then the height of the response dropdown should get updated accordingly in \'Set correct answer\' section', () => {
|
619
|
+
fillInTheGapsDropdownPage.steps.setHeightInResponseAccordion(0, '100');
|
620
|
+
fillInTheGapsDropdownPage.responseDropdownWrapperSetCorrectAnswerSection()
|
621
|
+
.eq(0)
|
622
|
+
.should('have.attr', 'height', '100px');
|
623
|
+
});
|
624
|
+
|
625
|
+
fillInTheGapsDropdownPage.tests.verifyCustomLabelVisibleOnResponseAccordion('Height and Width');
|
626
|
+
|
627
|
+
it('When the user has set \'Width\' for the response dropdown then the Width of the response dropdown should get updated accordingly in \'Set correct answer\' section', () => {
|
628
|
+
fillInTheGapsDropdownPage.steps.setWidthInResponseAccordion(0, '100');
|
629
|
+
fillInTheGapsDropdownPage.responseDropdownWrapperSetCorrectAnswerSection()
|
630
|
+
.eq(0)
|
631
|
+
.should('have.attr', 'width', '100px');
|
632
|
+
});
|
633
|
+
|
634
|
+
it('When the user enters a value below 80px in the \'Width\' input field then the width of the input field should remain 80px in set correct answer section', () => {
|
635
|
+
fillInTheGapsDropdownPage.steps.setWidthInResponseAccordion(0, '60');
|
636
|
+
fillInTheGapsDropdownPage.responseDropdownWrapperSetCorrectAnswerSection()
|
637
|
+
.eq(0)
|
638
|
+
.should('have.attr', 'width', '80px');
|
639
|
+
});
|
640
|
+
|
641
|
+
it('When the user enters a value above 400px in the \'Width\' input field then the width of the input field should remain 400px in set correct answer section', () => {
|
642
|
+
fillInTheGapsDropdownPage.steps.setWidthInResponseAccordion(0, '600');
|
643
|
+
fillInTheGapsDropdownPage.responseDropdownWrapperSetCorrectAnswerSection()
|
644
|
+
.eq(0)
|
645
|
+
.should('have.attr', 'width', '400px');
|
646
|
+
});
|
647
|
+
|
648
|
+
it('When the user has set \'Height\' and \'Width\' in the individual responses accordion then it should override the \'Height\' and \'Width\'set in the \'Advanced settings for all response areas\' in \'Set correct answer\' section', () => {
|
649
|
+
fillInTheGapsDropdownPage.widthInputField()
|
650
|
+
.clear()
|
651
|
+
.type('250')
|
652
|
+
.should('have.value', '250');
|
653
|
+
fillInTheGapsDropdownPage.heightInputField()
|
654
|
+
.clear()
|
655
|
+
.type('180')
|
656
|
+
.should('have.value', '180');
|
657
|
+
fillInTheGapsDropdownPage.steps.setWidthInResponseAccordion(0, '175');
|
658
|
+
fillInTheGapsDropdownPage.steps.setHeightInResponseAccordion(0, '120');
|
659
|
+
fillInTheGapsDropdownPage.responseDropdownWrapperSetCorrectAnswerSection()
|
660
|
+
.eq(0)
|
661
|
+
.should('have.attr', 'width', '175px')
|
662
|
+
.and('have.attr', 'height', '120px');
|
663
|
+
fillInTheGapsDropdownPage.responseDropdownWrapperSetCorrectAnswerSection()
|
664
|
+
.eq(1)
|
665
|
+
.should('have.attr', 'width', '250px')
|
666
|
+
.and('have.attr', 'height', '180px')
|
667
|
+
});
|
668
|
+
|
669
|
+
//Height and width test cases for preview tab
|
670
|
+
//TODO: We will need to revisit below case as it will fail for mobile view
|
671
|
+
it('When the user has not set \'Height\' and \'Width\' for the response accordion then the default dimension of the response dropdown in the preview tab response dropdown should be (200x34)px', () => {
|
672
|
+
cy.log('Pre step: clearing the set values of height and width to bring back the dimensions of the response dropdown to default dimensions')
|
673
|
+
fillInTheGapsDropdownPage.widthInputField()
|
674
|
+
.clear()
|
675
|
+
.should('have.value', '');
|
676
|
+
fillInTheGapsDropdownPage.heightInputField()
|
677
|
+
.clear()
|
678
|
+
.should('have.value', '');
|
679
|
+
fillInTheGapsDropdownPage.responseAccordionWrapper()
|
680
|
+
.each(($el) => {
|
681
|
+
cy.wrap($el)
|
682
|
+
.within(() => {
|
683
|
+
fillInTheGapsDropdownPage.heightInputField()
|
684
|
+
.clear()
|
685
|
+
.should('have.value', '');
|
686
|
+
fillInTheGapsDropdownPage.widthInputField()
|
687
|
+
.clear()
|
688
|
+
.should('have.value', '');
|
689
|
+
});
|
690
|
+
})
|
691
|
+
fillInTheGapsDropdownPage.steps.switchToPreviewTab();
|
692
|
+
fillInTheGapsDropdownPage.previewTabResponseDropdownWrapper()
|
693
|
+
.each(($el) => {
|
694
|
+
cy.wrap($el)
|
695
|
+
.should('have.attr', 'height', '34px')
|
696
|
+
.and('have.attr', 'width', '200px');
|
697
|
+
});
|
698
|
+
});
|
699
|
+
|
700
|
+
it('When the user has set \'Height\' for the response field then the height of the preview tab response dropdown should get updated accordingly in the preview tab', () => {
|
701
|
+
cy.log('Pre step: Switch to Edit tab')
|
702
|
+
fillInTheGapsDropdownPage.steps.switchToEditTab();
|
703
|
+
fillInTheGapsDropdownPage.steps.setHeightInResponseAccordion(0, '100');
|
704
|
+
fillInTheGapsDropdownPage.steps.switchToPreviewTab();
|
705
|
+
fillInTheGapsDropdownPage.previewTabResponseDropdownWrapper()
|
706
|
+
.should('have.attr', 'height', '100px');
|
707
|
+
});
|
708
|
+
|
709
|
+
it('When the user has set \'Width\' for the response dropdown then the width of the preview tab response dropdown should get updated accordingly in the preview tab', () => {
|
710
|
+
cy.log('Pre step: Switch to Edit tab')
|
711
|
+
fillInTheGapsDropdownPage.steps.switchToEditTab();
|
712
|
+
fillInTheGapsDropdownPage.steps.setWidthInResponseAccordion(0, '100');
|
713
|
+
fillInTheGapsDropdownPage.steps.switchToPreviewTab();
|
714
|
+
fillInTheGapsDropdownPage.previewTabResponseDropdownWrapper()
|
715
|
+
.eq(0)
|
716
|
+
.should('have.attr', 'width', '100px');
|
717
|
+
});
|
718
|
+
|
719
|
+
it('When the user has set \'Height\' and \'Width\' in the individual responses accordion then it should override the \'Height\' and \'Width\'set in the \'Advanced settings for all response areas\' in the preview tab', () => {
|
720
|
+
cy.log('Pre step: Switch to Edit tab')
|
721
|
+
fillInTheGapsDropdownPage.steps.switchToEditTab();
|
722
|
+
fillInTheGapsDropdownPage.widthInputField()
|
723
|
+
.clear()
|
724
|
+
.type('250')
|
725
|
+
.should('have.value', '250');
|
726
|
+
fillInTheGapsDropdownPage.heightInputField()
|
727
|
+
.clear()
|
728
|
+
.type('180')
|
729
|
+
.should('have.value', '180');
|
730
|
+
fillInTheGapsDropdownPage.steps.setWidthInResponseAccordion(0, '175');
|
731
|
+
fillInTheGapsDropdownPage.steps.setHeightInResponseAccordion(0, '120');
|
732
|
+
fillInTheGapsDropdownPage.steps.switchToPreviewTab();
|
733
|
+
fillInTheGapsDropdownPage.previewTabResponseDropdownWrapper()
|
734
|
+
.eq(0)
|
735
|
+
.should('have.attr', 'width', '175px')
|
736
|
+
.and('have.attr', 'height', '120px');
|
737
|
+
fillInTheGapsDropdownPage.previewTabResponseDropdownWrapper()
|
738
|
+
.eq(1)
|
739
|
+
.should('have.attr', 'width', '250px')
|
740
|
+
.and('have.attr', 'height', '180px')
|
741
|
+
});
|
742
|
+
|
743
|
+
it('When the user enters a value below 80px in the \'Width\' input field then the input field should remain 80px for the preview tab response dropdowns', () => {
|
744
|
+
fillInTheGapsDropdownPage.steps.switchToEditTab();
|
745
|
+
fillInTheGapsDropdownPage.steps.setWidthInResponseAccordion(0, '50');
|
746
|
+
fillInTheGapsDropdownPage.steps.switchToPreviewTab();
|
747
|
+
fillInTheGapsDropdownPage.previewTabResponseDropdownWrapper()
|
748
|
+
.eq(0)
|
749
|
+
.should('have.attr', 'width', '80px');
|
750
|
+
});
|
751
|
+
|
752
|
+
it('When the user enters a value above 400px in the \'Width\' input field then the input field should remain 400px for preview tab repsonse field', () => {
|
753
|
+
fillInTheGapsDropdownPage.steps.switchToEditTab();
|
754
|
+
fillInTheGapsDropdownPage.steps.setWidthInResponseAccordion(0, '500');
|
755
|
+
fillInTheGapsDropdownPage.steps.switchToPreviewTab();
|
756
|
+
fillInTheGapsDropdownPage.previewTabResponseDropdownWrapper()
|
757
|
+
.eq(0)
|
758
|
+
.should('have.attr', 'width', '400px');
|
759
|
+
});
|
760
|
+
});
|
761
|
+
|
762
|
+
describe('Additional Settings: Answer numeration (only while grading) dropdown', () => {
|
763
|
+
const dropdownOptions = ['Numerical', 'Uppercase alphabet', 'Lowercase alphabet'];
|
764
|
+
const numbers = ['1', '2', '3', '4'];
|
765
|
+
const lowercase = ['a', 'b', 'c', 'd'];
|
766
|
+
const uppercase = ['A', 'B', 'C', 'D'];
|
767
|
+
abortEarlySetup();
|
768
|
+
before(() => {
|
769
|
+
fillInTheGapsDropdownPage.steps.navigateToCreateQuestion('fill in the gaps with dropdown');
|
770
|
+
fillInTheGapsDropdownPage.steps.addResponseTokenInQuestionField();
|
771
|
+
fillInTheGapsDropdownPage.steps.addInputToResponseOptionFields(0, optionsForResponse1);
|
772
|
+
fillInTheGapsDropdownPage.steps.addInputToResponseOptionFields(1, optionsForResponse2);
|
773
|
+
fillInTheGapsDropdownPage.steps.selectResponseFromSetCorrectAnswerSectionResponseDropdown(0, 'new');
|
774
|
+
fillInTheGapsDropdownPage.steps.selectResponseFromSetCorrectAnswerSectionResponseDropdown(1, 'exclusively');
|
775
|
+
fillInTheGapsDropdownPage.steps.allotPoints(20);
|
776
|
+
fillInTheGapsDropdownPage.steps.expandAdditonalSettings();
|
777
|
+
fillInTheGapsDropdownPage.allowStudentsToCheckAnswerCheckbox()
|
778
|
+
.click();
|
779
|
+
});
|
780
|
+
|
781
|
+
fillInTheGapsDropdownPage.tests.verifyAnswerNumerationContents();
|
782
|
+
|
783
|
+
//Answer numeration cases for Edit tab
|
784
|
+
it(`When the user selects any option from the Answer numeration dropdown then it should not affect the Options for response numeration as well as set correct answer response dropdown`, () => {
|
785
|
+
cy.log('Selecting an option from the dropdown')
|
786
|
+
fillInTheGapsDropdownPage.steps.selectAnswerNumerationDropdownOption('Lowercase alphabet')
|
787
|
+
cy.log('The numerical option numeration for the Options for response fields should not be affected by the Answer numeration dropdown')
|
788
|
+
fillInTheGapsDropdownPage.optionsSectionWrapper()
|
789
|
+
.each(($el) => {
|
790
|
+
cy.wrap($el)
|
791
|
+
.within(() => {
|
792
|
+
fillInTheGapsDropdownPage.optionWrapper()
|
793
|
+
.each(($el, index) => {
|
794
|
+
cy.wrap($el)
|
795
|
+
.within(() => {
|
796
|
+
fillInTheGapsDropdownPage.optionNumeration()
|
797
|
+
.should('have.text', numbers[index]);
|
798
|
+
});
|
799
|
+
});
|
800
|
+
});
|
801
|
+
});
|
802
|
+
cy.log('The option numeration should not be displayed in the set correct answer section')
|
803
|
+
fillInTheGapsDropdownPage.responseDropdownWrapperSetCorrectAnswerSection()
|
804
|
+
.each(($el, index) => {
|
805
|
+
cy.wrap($el)
|
806
|
+
.contains(uppercase[index])
|
807
|
+
.should('not.exist');
|
808
|
+
});
|
809
|
+
});
|
810
|
+
|
811
|
+
//Answer numeration cases for preview tab
|
812
|
+
dropdownOptions.forEach((option) => {
|
813
|
+
it(`When the user selects ${option} option from the Answer numeration dropdown then it should not be displayed in the Preview tab response dropdown`, () => {
|
814
|
+
fillInTheGapsDropdownPage.answerNumerationDropdown()
|
815
|
+
.click();
|
816
|
+
fillInTheGapsDropdownPage.answerNumerationDropdownListOptions(option)
|
817
|
+
.click();
|
818
|
+
fillInTheGapsDropdownPage.answerNumerationDropdown()
|
819
|
+
.verifyInnerText(`${option}`);
|
820
|
+
fillInTheGapsDropdownPage.steps.switchToPreviewTab()
|
821
|
+
fillInTheGapsDropdownPage.steps.verifyAnswerNumerationShouldNotExistInPreviewTabResponseDropdown()
|
822
|
+
});
|
823
|
+
|
824
|
+
it(`When the user clicks on Show correct answer checkbox then ${option} numeration should be displayed in the Preview tab response dropdown and the correct answer container`, () => {
|
825
|
+
fillInTheGapsDropdownPage.showCorrectAnswerCheckbox()
|
826
|
+
.click()
|
827
|
+
.should('be.checked');
|
828
|
+
cy.log('Checking answer numeration for response dropdown')
|
829
|
+
fillInTheGapsDropdownPage.previewTabResponseDropdownWrapper()
|
830
|
+
.each(($el, index) => {
|
831
|
+
cy.wrap($el)
|
832
|
+
.within(() => {
|
833
|
+
switch (option) {
|
834
|
+
case 'Numerical':
|
835
|
+
fillInTheGapsDropdownPage.responseDropdownAnswerNumeration()
|
836
|
+
.should('have.text', numbers[index])
|
837
|
+
.should('be.visible');
|
838
|
+
break;
|
839
|
+
case 'Uppercase alphabet':
|
840
|
+
fillInTheGapsDropdownPage.responseDropdownAnswerNumeration()
|
841
|
+
.should('have.text', uppercase[index])
|
842
|
+
.should('be.visible');
|
843
|
+
break;
|
844
|
+
case 'Lowercase alphabet':
|
845
|
+
fillInTheGapsDropdownPage.responseDropdownAnswerNumeration()
|
846
|
+
.should('have.text', lowercase[index])
|
847
|
+
.should('be.visible');
|
848
|
+
break;
|
849
|
+
default:
|
850
|
+
throw new Error('Invalid numeration option');
|
851
|
+
}
|
852
|
+
});
|
853
|
+
});
|
854
|
+
cy.log('Checking the answer numeration should be displayed in the correct answer container')
|
855
|
+
fillInTheGapsDropdownPage.previewTabCorrectAnswerResponseWrapper()
|
856
|
+
.each(($el, index) => {
|
857
|
+
cy.wrap($el)
|
858
|
+
.parents('.response-dropdown-wrapper')
|
859
|
+
.within(() => {
|
860
|
+
switch (option) {
|
861
|
+
case 'Numerical':
|
862
|
+
fillInTheGapsDropdownPage.responseDropdownAnswerNumeration()
|
863
|
+
.should('have.text', numbers[index])
|
864
|
+
.should('be.visible');
|
865
|
+
break;
|
866
|
+
case 'Uppercase alphabet':
|
867
|
+
fillInTheGapsDropdownPage.responseDropdownAnswerNumeration()
|
868
|
+
.should('have.text', uppercase[index])
|
869
|
+
.should('be.visible');
|
870
|
+
break;
|
871
|
+
case 'Lowercase alphabet':
|
872
|
+
fillInTheGapsDropdownPage.responseDropdownAnswerNumeration()
|
873
|
+
.should('have.text', lowercase[index])
|
874
|
+
.should('be.visible');
|
875
|
+
break;
|
876
|
+
default:
|
877
|
+
throw new Error('Invalid numeration option');
|
878
|
+
}
|
879
|
+
});
|
880
|
+
});
|
881
|
+
});
|
882
|
+
|
883
|
+
it('CSS of option numeration in response dropdown and correct answer container', { tags: 'css' }, () => {
|
884
|
+
cy.log('CSS of Response dropdown numeration')
|
885
|
+
fillInTheGapsDropdownPage.previewTabResponseDropdownWrapper()
|
886
|
+
.eq(0)
|
887
|
+
.within(() => {
|
888
|
+
fillInTheGapsDropdownPage.responseDropdownAnswerNumeration()
|
889
|
+
.verifyCSS(css.color.text, css.fontSize.default, css.fontWeight.regular);
|
890
|
+
});
|
891
|
+
cy.log('CSS of Correct answer container dropdown numeration')
|
892
|
+
fillInTheGapsDropdownPage.previewTabCorrectAnswerResponseWrapper()
|
893
|
+
.eq(0)
|
894
|
+
.parents('.response-dropdown-wrapper')
|
895
|
+
.within(() => {
|
896
|
+
fillInTheGapsDropdownPage.responseDropdownAnswerNumeration()
|
897
|
+
.eq(0)
|
898
|
+
.verifyCSS(css.color.text, css.fontSize.default, css.fontWeight.regular);
|
899
|
+
});
|
900
|
+
});
|
901
|
+
|
902
|
+
it('Accessibility of option numeration in response dropdown and correct answer container', { tags: 'a11y' }, () => {
|
903
|
+
cy.log('Accessibility of Response dropdown numeration')
|
904
|
+
cy.checkAccessibility(fillInTheGapsDropdownPage.previewTabResponseDropdownWrapper());
|
905
|
+
cy.log('Accessibility of Correct answer container dropdown numeration')
|
906
|
+
cy.checkAccessibility(fillInTheGapsDropdownPage.previewTabCorrectAnswerResponseWrapper().parents('.response-dropdown-wrapper'));
|
907
|
+
});
|
908
|
+
|
909
|
+
it(`When user clicks on Check answer button then ${option} numeration should not be displayed in the preview tab Response dropdown`, () => {
|
910
|
+
cy.log('Pre step: Unchecking the show correct answer checkbox')
|
911
|
+
fillInTheGapsDropdownPage.showCorrectAnswerCheckbox()
|
912
|
+
.click()
|
913
|
+
.should('not.be.checked');
|
914
|
+
fillInTheGapsDropdownPage.checkAnswerButton()
|
915
|
+
.click();
|
916
|
+
fillInTheGapsDropdownPage.steps.verifyAnswerNumerationShouldNotExistInPreviewTabResponseDropdown()
|
917
|
+
cy.log('Post step: Swicthing to Edit tab')
|
918
|
+
fillInTheGapsDropdownPage.steps.switchToEditTab()
|
919
|
+
});
|
920
|
+
});
|
921
|
+
|
922
|
+
//TODO: We have not checked the Response numeration in Grading view
|
923
|
+
});
|
924
|
+
|
925
|
+
describe('Additional Settings: Font Size dropdown', () => {
|
926
|
+
abortEarlySetup();
|
927
|
+
before(() => {
|
928
|
+
cy.log('Navigating to fill in the gaps - dropdown type, adding question instructions and options, alloting points and expanding additional settings accordion')
|
929
|
+
fillInTheGapsDropdownPage.steps.navigateToCreateQuestion('fill in the gaps with dropdown');
|
930
|
+
fillInTheGapsDropdownPage.questionInstructionsInputField()
|
931
|
+
.type('Question Instructions');
|
932
|
+
fillInTheGapsDropdownPage.pointsInputField()
|
933
|
+
.type('4');
|
934
|
+
fillInTheGapsDropdownPage.steps.addInputToResponseOptionFields(0, optionsForResponse1);
|
935
|
+
fillInTheGapsDropdownPage.steps.selectResponseFromSetCorrectAnswerSectionResponseDropdown(0, 'new')
|
936
|
+
fillInTheGapsDropdownPage.steps.expandAdditonalSettings();
|
937
|
+
});
|
938
|
+
|
939
|
+
fillInTheGapsDropdownPage.tests.verifyFontSizeSectionContents();
|
940
|
+
|
941
|
+
const fontsizes = ['Default', 'Small', 'Normal', 'Large', 'Extra large', 'Huge'];
|
942
|
+
const font = ['16px', '12px', '14px', '17px', '20px', '24px'];
|
943
|
+
fontsizes.forEach((option, count) => {
|
944
|
+
it(`When the user selects \'${option}\' option from the Font Size dropdown, then font size of the preview tab contents should be changed to ${option} in the \'Set Correct Answer\' section as well as in the \'Preview\' tab`, () => {
|
945
|
+
fillInTheGapsDropdownPage.fontSizeDropdown()
|
946
|
+
.click();
|
947
|
+
fillInTheGapsDropdownPage.fontSizeListOptions(count)
|
948
|
+
.click();
|
949
|
+
fillInTheGapsDropdownPage.fontSizeDropdown()
|
950
|
+
.verifyInnerText(`${option}`);
|
951
|
+
cy.log('Checking correct answer section font size')
|
952
|
+
fillInTheGapsDropdownPage.responseDropdownWrapperSetCorrectAnswerSection()
|
953
|
+
.should('have.css', 'font-size', font[count])
|
954
|
+
fillInTheGapsDropdownPage.responseDropdownSetCorrectAnswerSection()
|
955
|
+
.click();
|
956
|
+
fillInTheGapsDropdownPage.responseDropdownOptions()
|
957
|
+
.each(($el) => {
|
958
|
+
cy.wrap($el)
|
959
|
+
.find('span')
|
960
|
+
.should('have.css', 'font-size', font[count]);
|
961
|
+
});
|
962
|
+
cy.log('Closing the dropdown')
|
963
|
+
cy.get('body')
|
964
|
+
.click();
|
965
|
+
cy.log('Switching to Preview tab')
|
966
|
+
fillInTheGapsDropdownPage.steps.switchToPreviewTab();
|
967
|
+
cy.log('Checking Preview section font size')
|
968
|
+
fillInTheGapsDropdownPage.questionInstructionsText()
|
969
|
+
.should('have.css', 'font-size', font[count]);
|
970
|
+
fillInTheGapsDropdownPage.previewTabResponseDropdown()
|
971
|
+
.click();
|
972
|
+
cy.log('Checking font size of options')
|
973
|
+
fillInTheGapsDropdownPage.responseDropdownOptions()
|
974
|
+
.each(($el) => {
|
975
|
+
cy.wrap($el)
|
976
|
+
.find('span')
|
977
|
+
.should('have.css', 'font-size', font[count]);
|
978
|
+
});
|
979
|
+
cy.log('selecting an option to collapse the response dropdown')
|
980
|
+
fillInTheGapsDropdownPage.steps.selectOptionFromResponseDropdown('new');
|
981
|
+
cy.log('Checking font size of response dropdown')
|
982
|
+
fillInTheGapsDropdownPage.previewTabResponseDropdownWrapper()
|
983
|
+
.should('have.css', 'font-size', font[count]);
|
984
|
+
fillInTheGapsDropdownPage.previewTabQuestionContainer()
|
985
|
+
.should('have.css', 'font-size', font[count]);
|
986
|
+
cy.log('Post step: Switch to Edit tab')
|
987
|
+
fillInTheGapsDropdownPage.steps.switchToEditTab();
|
988
|
+
});
|
989
|
+
});
|
990
|
+
});
|
991
|
+
|
992
|
+
describe('Additional Settings: Check Answer', () => {
|
993
|
+
abortEarlySetup();
|
994
|
+
before(() => {
|
995
|
+
fillInTheGapsDropdownPage.steps.navigateToCreateQuestion('fill in the gaps with dropdown');
|
996
|
+
fillInTheGapsDropdownPage.questionInstructionsInputField()
|
997
|
+
.type('Question Instructions');
|
998
|
+
fillInTheGapsDropdownPage.pointsInputField()
|
999
|
+
.type('4');
|
1000
|
+
fillInTheGapsDropdownPage.steps.addInputToResponseOptionFields(0, optionsForResponse1);
|
1001
|
+
fillInTheGapsDropdownPage.steps.selectResponseFromSetCorrectAnswerSectionResponseDropdown(0, 'new')
|
1002
|
+
fillInTheGapsDropdownPage.steps.expandAdditonalSettings();
|
1003
|
+
});
|
1004
|
+
|
1005
|
+
fillInTheGapsDropdownPage.tests.verifyCheckAnswerSectionAndPreviewTabCheckAnswerButton();
|
1006
|
+
});
|
1007
|
+
|
1008
|
+
describe('Additional Settings: Check Answer - Functionality', () => {
|
1009
|
+
abortEarlySetup();
|
1010
|
+
before(() => {
|
1011
|
+
fillInTheGapsDropdownPage.steps.navigateToCreateQuestion('fill in the gaps with dropdown');
|
1012
|
+
fillInTheGapsDropdownPage.questionInstructionsInputField()
|
1013
|
+
.type('Question Instructions');
|
1014
|
+
fillInTheGapsDropdownPage.pointsInputField()
|
1015
|
+
.type('6');
|
1016
|
+
fillInTheGapsDropdownPage.questionInputField()
|
1017
|
+
.click();
|
1018
|
+
fillInTheGapsDropdownPage.ckEditorAddResponseButton()
|
1019
|
+
.click();
|
1020
|
+
fillInTheGapsDropdownPage.steps.addInputToResponseOptionFields(0, optionsForResponse1);
|
1021
|
+
fillInTheGapsDropdownPage.steps.selectResponseFromSetCorrectAnswerSectionResponseDropdown(0, 'new')
|
1022
|
+
fillInTheGapsDropdownPage.steps.addInputToResponseOptionFields(1, optionsForResponse2);
|
1023
|
+
fillInTheGapsDropdownPage.steps.selectResponseFromSetCorrectAnswerSectionResponseDropdown(1, 'extensively')
|
1024
|
+
fillInTheGapsDropdownPage.steps.expandAdditonalSettings();
|
1025
|
+
fillInTheGapsDropdownPage.steps.setMaximumCheckAnswerAttempts(2);
|
1026
|
+
fillInTheGapsDropdownPage.steps.switchToPreviewTab();
|
1027
|
+
});
|
1028
|
+
|
1029
|
+
it('When the user has not set any responses then on clicking on the Check Answer button icons should not be displayed beside both empty responses, label should not be displayed below the box', () => {
|
1030
|
+
fillInTheGapsDropdownPage.previewTabResponseDropdown()
|
1031
|
+
.each(($el) => {
|
1032
|
+
cy.wrap($el)
|
1033
|
+
.should('not.have.text')
|
1034
|
+
});
|
1035
|
+
fillInTheGapsDropdownPage.checkAnswerButton()
|
1036
|
+
.click();
|
1037
|
+
fillInTheGapsDropdownPage.correctIcon()
|
1038
|
+
.should('not.exist');
|
1039
|
+
fillInTheGapsDropdownPage.incorrectIcon()
|
1040
|
+
.should('not.exist');
|
1041
|
+
fillInTheGapsDropdownPage.correctIncorectAnswerLabel()
|
1042
|
+
.should('not.exist');
|
1043
|
+
fillInTheGapsDropdownPage.previewTabCorrectAnswerContainer()
|
1044
|
+
.should('not.exist')
|
1045
|
+
});
|
1046
|
+
|
1047
|
+
it('When the user has added correct response for one option then on clicking on the Check Answer button, green checkmark icon should be displayed besides the correct response, red crossmark should not be displayed beside empty response and \'Incorrect Answer\' label should be displayed below the box', () => {
|
1048
|
+
fillInTheGapsDropdownPage.steps.selectResponseFromPreviewTabResponseDropdown(0, 'new');
|
1049
|
+
fillInTheGapsDropdownPage.checkAnswerButton()
|
1050
|
+
.click();
|
1051
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectOptionCheckmarkIcon(0);
|
1052
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectIconNotVisible(1);
|
1053
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect')
|
1054
|
+
fillInTheGapsDropdownPage.steps.verifyIncorrectAttemptBorder()
|
1055
|
+
});
|
1056
|
+
|
1057
|
+
it('When the user has added both correct responses then on clicking on the Check Answer button, green checkmark icon should be displayed besides the responses and \'Correct Answer\' label should be displayed below the box', () => {
|
1058
|
+
fillInTheGapsDropdownPage.steps.selectResponseFromPreviewTabResponseDropdown(1, 'extensively');
|
1059
|
+
fillInTheGapsDropdownPage.checkAnswerButton()
|
1060
|
+
.click();
|
1061
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectOptionCheckmarkIcon(0)
|
1062
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectOptionCheckmarkIcon(1)
|
1063
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectAnswerLabel('Correct')
|
1064
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectAttemptBorder()
|
1065
|
+
});
|
1066
|
+
|
1067
|
+
|
1068
|
+
fillInTheGapsDropdownPage.tests.verifyDisabledCheckAnswerButtonWithCSSAnda11y()
|
1069
|
+
|
1070
|
+
it('When the user updates the value of Maximum check answer attempts input field, it should get reflected on the Preview tab', () => {
|
1071
|
+
cy.log('Pre step: Switching to Edit tab')
|
1072
|
+
fillInTheGapsDropdownPage.steps.switchToEditTab();
|
1073
|
+
fillInTheGapsDropdownPage.maximumCheckAnswerAttemptsInputField()
|
1074
|
+
.clear()
|
1075
|
+
.type(1)
|
1076
|
+
.should('have.value', '1');
|
1077
|
+
cy.log('Switching to Preview tab');
|
1078
|
+
fillInTheGapsDropdownPage.steps.switchToPreviewTab();
|
1079
|
+
fillInTheGapsDropdownPage.checkAnswerButton()
|
1080
|
+
.should('be.enabled');
|
1081
|
+
fillInTheGapsDropdownPage.steps.selectResponseFromPreviewTabResponseDropdown(0, 'new');
|
1082
|
+
fillInTheGapsDropdownPage.steps.selectResponseFromPreviewTabResponseDropdown(1, 'extensively');
|
1083
|
+
fillInTheGapsDropdownPage.checkAnswerButton()
|
1084
|
+
.click()
|
1085
|
+
.should('be.disabled');
|
1086
|
+
});
|
1087
|
+
|
1088
|
+
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', () => {
|
1089
|
+
fillInTheGapsDropdownPage.steps.switchToEditTab();
|
1090
|
+
fillInTheGapsDropdownPage.steps.clearMaximumCheckAnswerAttemptsInputField();
|
1091
|
+
fillInTheGapsDropdownPage.steps.addInputToMaximumCheckAnswerAttemptsInputField(0);
|
1092
|
+
cy.log('Switching to Preview tab')
|
1093
|
+
fillInTheGapsDropdownPage.steps.switchToPreviewTab();
|
1094
|
+
fillInTheGapsDropdownPage.checkAnswerButton()
|
1095
|
+
.should('be.enabled');
|
1096
|
+
cy.log('Clicking on \'Check Answer\' to check state of \'Check Answer\' to be enabled')
|
1097
|
+
fillInTheGapsDropdownPage.steps.selectResponseFromPreviewTabResponseDropdown(0, 'changing');
|
1098
|
+
fillInTheGapsDropdownPage.steps.selectResponseFromPreviewTabResponseDropdown(1, 'decreasingly');
|
1099
|
+
fillInTheGapsDropdownPage.checkAnswerButton()
|
1100
|
+
.click();
|
1101
|
+
fillInTheGapsDropdownPage.steps.verifyIncorrectOptionCrossmarkIcon(0)
|
1102
|
+
fillInTheGapsDropdownPage.steps.verifyIncorrectOptionCrossmarkIcon(1)
|
1103
|
+
fillInTheGapsDropdownPage.checkAnswerButton()
|
1104
|
+
.should('be.enabled');
|
1105
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect')
|
1106
|
+
fillInTheGapsDropdownPage.steps.verifyIncorrectAttemptBorder()
|
1107
|
+
cy.log('As the user is able to check answer multiple times, verifying state of \'Check Answer\' to be enabled by adding another response')
|
1108
|
+
fillInTheGapsDropdownPage.steps.selectResponseFromPreviewTabResponseDropdown(0, 'healthy');
|
1109
|
+
fillInTheGapsDropdownPage.steps.selectResponseFromPreviewTabResponseDropdown(1, 'extensively');
|
1110
|
+
fillInTheGapsDropdownPage.checkAnswerButton()
|
1111
|
+
.click();
|
1112
|
+
fillInTheGapsDropdownPage.steps.verifyIncorrectOptionCrossmarkIcon(0)
|
1113
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectOptionCheckmarkIcon(1)
|
1114
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect')
|
1115
|
+
fillInTheGapsDropdownPage.steps.verifyIncorrectAttemptBorder()
|
1116
|
+
fillInTheGapsDropdownPage.checkAnswerButton()
|
1117
|
+
.should('be.enabled');
|
1118
|
+
});
|
1119
|
+
|
1120
|
+
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', () => {
|
1121
|
+
cy.log('Pre step: Switching to Edit tab')
|
1122
|
+
fillInTheGapsDropdownPage.steps.switchToEditTab();
|
1123
|
+
fillInTheGapsDropdownPage.maximumCheckAnswerAttemptsInputField()
|
1124
|
+
.clear()
|
1125
|
+
.should('have.value', '');
|
1126
|
+
cy.log('Switching to Preview tab');
|
1127
|
+
fillInTheGapsDropdownPage.steps.switchToPreviewTab();
|
1128
|
+
fillInTheGapsDropdownPage.checkAnswerButton()
|
1129
|
+
.should('be.enabled');
|
1130
|
+
cy.log('Clicking on \'Check Answer\' to check state of \'Check Answer\' to be enabled')
|
1131
|
+
fillInTheGapsDropdownPage.steps.selectResponseFromPreviewTabResponseDropdown(0, 'changing');
|
1132
|
+
fillInTheGapsDropdownPage.steps.selectResponseFromPreviewTabResponseDropdown(1, 'decreasingly');
|
1133
|
+
fillInTheGapsDropdownPage.checkAnswerButton()
|
1134
|
+
.click();
|
1135
|
+
fillInTheGapsDropdownPage.steps.verifyIncorrectOptionCrossmarkIcon(0)
|
1136
|
+
fillInTheGapsDropdownPage.steps.verifyIncorrectOptionCrossmarkIcon(1)
|
1137
|
+
fillInTheGapsDropdownPage.checkAnswerButton()
|
1138
|
+
.should('be.enabled');
|
1139
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect')
|
1140
|
+
fillInTheGapsDropdownPage.steps.verifyIncorrectAttemptBorder()
|
1141
|
+
cy.log('As the user is able to check answer multiple times, verifying state of \'Check Answer\' to be enabled by adding another response')
|
1142
|
+
fillInTheGapsDropdownPage.steps.selectResponseFromPreviewTabResponseDropdown(0, 'healthy');
|
1143
|
+
fillInTheGapsDropdownPage.steps.selectResponseFromPreviewTabResponseDropdown(1, 'extensively');
|
1144
|
+
fillInTheGapsDropdownPage.checkAnswerButton()
|
1145
|
+
.click();
|
1146
|
+
fillInTheGapsDropdownPage.steps.verifyIncorrectOptionCrossmarkIcon(0)
|
1147
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectOptionCheckmarkIcon(1)
|
1148
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect')
|
1149
|
+
fillInTheGapsDropdownPage.steps.verifyIncorrectAttemptBorder()
|
1150
|
+
fillInTheGapsDropdownPage.checkAnswerButton()
|
1151
|
+
.should('be.enabled');
|
1152
|
+
});
|
1153
|
+
});
|
1154
|
+
|
1155
|
+
describe('Additional Settings: Details section', () => {
|
1156
|
+
abortEarlySetup();
|
1157
|
+
before(() => {
|
1158
|
+
fillInTheGapsDropdownPage.steps.navigateToCreateQuestion('fill in the gaps with dropdown');
|
1159
|
+
fillInTheGapsDropdownPage.steps.expandAdditonalSettings();
|
1160
|
+
});
|
1161
|
+
|
1162
|
+
fillInTheGapsDropdownPage.tests.verifyDetailsSection();
|
1163
|
+
});
|
1164
|
+
});
|