itemengine-cypress-automation 1.0.14 → 1.0.15

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,830 @@
1
+ import { multipleSelectionGridPage } from "../../../pages/multipleSelectionGridPage";
2
+ import abortEarlySetup from "../../../support/helpers/abortEarly";
3
+ const css = Cypress.env('css');
4
+
5
+ const questionStems = ['Bat', 'Ostrich', 'Platypus', 'Eagle'];
6
+ const options = ['Is mammal', 'Lays eggs', 'Can fly'];
7
+
8
+ const gridStyleDropdownOptions = ['With border', 'Row dividers', 'No border', 'Inline', 'Inline - row dividers'];
9
+ const questionStemNumerationOptions = ['None', 'Numerical', 'Uppercase alphabet', 'Lowercase alphabet'];
10
+ const fontSizeDropdownOptions = ['Default', 'Small', 'Normal', 'Large', 'Extra large', 'Huge'];
11
+ const numbers = ['1', '2', '3', '4'];
12
+ const lowercase = ['a', 'b', 'c', 'd'];
13
+ const uppercase = ['A', 'B', 'C', 'D'];
14
+ const fontSizes = ['16px', '12px', '14px', '17px', '20px', '24px'];
15
+
16
+ describe('Create Item page - Multiple Selection Grid: Additional settings', () => {
17
+ before(() => {
18
+ cy.loginAs('admin');
19
+ });
20
+
21
+ describe('Additional Settings accordion', () => {
22
+ abortEarlySetup();
23
+ before(() => {
24
+ cy.log('Navigating to multiple selection grid question type');
25
+ multipleSelectionGridPage.steps.navigateToCreateQuestion('multiple selection grid');
26
+ });
27
+
28
+ multipleSelectionGridPage.tests.verifyAdditonalSettingsAccordionProperties();
29
+ });
30
+
31
+ describe('Additional settings: Student response area and layout', () => {
32
+ abortEarlySetup();
33
+ before(() => {
34
+ cy.log('Navigating to multiple selection grid question type');
35
+ multipleSelectionGridPage.steps.navigateToCreateQuestion('multiple selection grid');
36
+ multipleSelectionGridPage.steps.expandAdditonalSettings();
37
+ });
38
+
39
+ multipleSelectionGridPage.tests.verifyStudentResponseAreaAndLayoutLabelAndCSS();
40
+ });
41
+
42
+ describe('Additional settings: Grid style contents', () => {
43
+ abortEarlySetup();
44
+ before(() => {
45
+ cy.log('Navigating to multiple selection grid question type');
46
+ multipleSelectionGridPage.steps.navigateToCreateQuestion('multiple selection grid');
47
+ multipleSelectionGridPage.steps.expandAdditonalSettings();
48
+ });
49
+
50
+ it(`\'Grid style\' label and dropdown should be displayed and by default, ${gridStyleDropdownOptions[1]} option should be selected in the dropdown`, () => {
51
+ multipleSelectionGridPage.gridStyleLabel()
52
+ .verifyInnerText('Grid style')
53
+ .should('be.visible');
54
+ multipleSelectionGridPage.gridStyleDropdown()
55
+ .verifyInnerText(`${gridStyleDropdownOptions[1]}`)
56
+ .should('be.visible');
57
+ });
58
+
59
+ it('CSS of Grid style section', { tags: 'css' }, () => {
60
+ multipleSelectionGridPage.gridStyleLabel()
61
+ .verifyCSS(css.color.labels, css.fontSize.normal, css.fontWeight.semibold);
62
+ multipleSelectionGridPage.gridStyleDropdown()
63
+ .verifyCSS(css.color.liText, css.fontSize.default, css.fontWeight.regular);
64
+ });
65
+
66
+ it(`When user clicks on the Grid style dropdown a list of 5 options - ${gridStyleDropdownOptions} should be displayed`, () => {
67
+ multipleSelectionGridPage.steps.expandGridStyleDropdown();
68
+ multipleSelectionGridPage.steps.verifyGridStyleDropdownOptions(gridStyleDropdownOptions);
69
+ });
70
+
71
+ it('CSS of Grid style dropdown in active state', { tags: 'css' }, () => {
72
+ multipleSelectionGridPage.gridStyleDropdownOptions()
73
+ .eq(1)
74
+ .verifyCSS(css.color.liText, css.fontSize.default, css.fontWeight.regular)
75
+ .should('have.css', 'background-color', css.color.liTextSelectedBg);
76
+ multipleSelectionGridPage.gridStyleDropdownOptions()
77
+ .eq(0)
78
+ .should('have.css', 'background-color', css.color.transparent);
79
+ cy.log('Selecting a dropdown option to close the dropdown')
80
+ multipleSelectionGridPage.gridStyleDropdownOptions()
81
+ .eq(1)
82
+ .click();
83
+ });
84
+
85
+ it('Accessibility of Grid style dropdown in active state', { tags: 'a11y' }, () => {
86
+ multipleSelectionGridPage.steps.expandGridStyleDropdown();
87
+ cy.checkAccessibility(multipleSelectionGridPage.dropdownList());
88
+ });
89
+ });
90
+
91
+ //Note: This needs to be checked manually during full execution, added this to the Manual sheet
92
+ describe.skip('Additional settings: Grid style set correct answer section', () => {
93
+ abortEarlySetup();
94
+ before(() => {
95
+ cy.log('Navigating to multiple selection grid question type');
96
+ multipleSelectionGridPage.steps.navigateToCreateQuestion('multiple selection grid');
97
+ multipleSelectionGridPage.steps.addQuestionInstructions();
98
+ multipleSelectionGridPage.steps.addInputToAllQuestionStemFields(questionStems);
99
+ multipleSelectionGridPage.steps.addInputToAllOptionsFields(options);
100
+ multipleSelectionGridPage.steps.allotPoints(10);
101
+ multipleSelectionGridPage.steps.expandAdditonalSettings();
102
+ });
103
+
104
+ it(`By default when ${gridStyleDropdownOptions[1]} option is selected then row dividers should be displayed in the set correct answer table`, () => {
105
+
106
+ });
107
+
108
+ it(`When user selects ${gridStyleDropdownOptions[0]} option then only table borders should be displayed in the set correct answer table`, () => {
109
+
110
+ });
111
+
112
+ it(`When user selects ${gridStyleDropdownOptions[2]} option then table borders should not be displayed in the set correct answer table`, () => {
113
+
114
+ });
115
+
116
+ it(`When user selects ${gridStyleDropdownOptions[3]} option then the options should not be displayed in the table header and should be displayed inline with the question stems without row dividers in the set correct answer table`, () => {
117
+
118
+ });
119
+
120
+
121
+ it(`When user selects ${gridStyleDropdownOptions[4]} option then the options should not be displayed in the table header and should be displayed inline with the question stems with row dividers in the set correct answer table`, () => {
122
+
123
+ });
124
+ });
125
+
126
+ describe.skip('Additional settings: Grid style preview tab section', () => {
127
+ abortEarlySetup();
128
+ before(() => {
129
+ cy.log('Navigating to multiple selection grid question type');
130
+ multipleSelectionGridPage.steps.navigateToCreateQuestion('multiple selection grid');
131
+ multipleSelectionGridPage.steps.addQuestionInstructions();
132
+ multipleSelectionGridPage.steps.addInputToAllQuestionStemFields(questionStems);
133
+ multipleSelectionGridPage.steps.addInputToAllOptionsFields(options);
134
+ multipleSelectionGridPage.steps.allotPoints(10);
135
+ multipleSelectionGridPage.steps.expandAdditonalSettings();
136
+ });
137
+
138
+ it(`By default when ${gridStyleDropdownOptions[1]} option is selected then row dividers should be displayed in the preview tab answer table`, () => {
139
+
140
+ });
141
+
142
+ it(`When user selects ${gridStyleDropdownOptions[0]} option then only table borders should be displayed in the preview tab answer table`, () => {
143
+
144
+ });
145
+
146
+ it(`When user selects ${gridStyleDropdownOptions[2]} option then table borders should not be displayed in the preview tab answer table`, () => {
147
+
148
+ });
149
+
150
+ it(`When user selects ${gridStyleDropdownOptions[3]} option then the options should not be displayed in the table header and should be displayed inline with the question stems without row dividers in the preview tab answer table`, () => {
151
+
152
+ });
153
+
154
+
155
+ it(`When user selects ${gridStyleDropdownOptions[4]} option then the options should not be displayed in the table header and should be displayed inline with the question stems with row dividers in the preview tab answer table`, () => {
156
+
157
+ });
158
+ });
159
+
160
+ describe('Additional settings: Question stem numeration contents', () => {
161
+ abortEarlySetup();
162
+ before(() => {
163
+ cy.log('Navigating to multiple selection grid question type');
164
+ multipleSelectionGridPage.steps.navigateToCreateQuestion('multiple selection grid');
165
+ multipleSelectionGridPage.steps.expandAdditonalSettings();
166
+ });
167
+
168
+ it(`\'Question stem numeration\' label and dropdown should be displayed and by default, ${questionStemNumerationOptions[0]} option should be selected in the dropdown`, () => {
169
+ multipleSelectionGridPage.questionStemNumerationLabel()
170
+ .verifyInnerText('Question stem numeration')
171
+ .should('be.visible');
172
+ multipleSelectionGridPage.questionStemNumerationDropdown()
173
+ .verifyInnerText('None')
174
+ .should('exist');
175
+ });
176
+
177
+ it('CSS of Question stem numeration section', { tags: 'css' }, () => {
178
+ multipleSelectionGridPage.questionStemNumerationLabel()
179
+ .verifyCSS(css.color.labels, css.fontSize.normal, css.fontWeight.semibold);
180
+ multipleSelectionGridPage.questionStemNumerationDropdown()
181
+ .verifyCSS(css.color.liText, css.fontSize.default, css.fontWeight.regular);
182
+ });
183
+
184
+ it(`When user clicks on the Question stem numeration dropdown a list of 4 options - ${questionStemNumerationOptions} should be displayed`, () => {
185
+ multipleSelectionGridPage.steps.expandQuestionStemNumerationDropdown();
186
+ multipleSelectionGridPage.steps.verifyQuestionStemNumerationDropdownOptions(questionStemNumerationOptions);
187
+ });
188
+
189
+ it('CSS of Question stem numeration dropdown in active state', { tags: 'css' }, () => {
190
+ multipleSelectionGridPage.questionStemNumerationDropdownOptions()
191
+ .eq(0)
192
+ .verifyCSS(css.color.liText, css.fontSize.default, css.fontWeight.regular)
193
+ .should('have.css', 'background-color', css.color.liTextSelectedBg);
194
+ multipleSelectionGridPage.questionStemNumerationDropdownOptions()
195
+ .eq(1)
196
+ .should('have.css', 'background-color', css.color.transparent);
197
+ });
198
+
199
+ it('Accessbility of Question stem numeration dropdown in active state', { tags: 'a11y' }, () => {
200
+ it('Accessbility of Grid style dropdown in active state', { tags: 'a11y' }, () => {
201
+ cy.checkAccessibility(multipleSelectionGridPage.dropdownList());
202
+ });
203
+ });
204
+ });
205
+
206
+ describe('Additional settings: Question stem numeration set correct answer section', () => {
207
+ abortEarlySetup();
208
+ before(() => {
209
+ cy.log('Navigating to multiple selection grid question type');
210
+ multipleSelectionGridPage.steps.navigateToCreateQuestion('multiple selection grid');
211
+ multipleSelectionGridPage.steps.addQuestionInstructions();
212
+ multipleSelectionGridPage.steps.addOption();
213
+ multipleSelectionGridPage.steps.addInputToAllQuestionStemFields(questionStems);
214
+ multipleSelectionGridPage.steps.addInputToAllOptionsFields(options);
215
+ multipleSelectionGridPage.steps.allotPoints(10);
216
+ multipleSelectionGridPage.steps.expandAdditonalSettings();
217
+ });
218
+
219
+ it(`When the user selects ${questionStemNumerationOptions[0]} option from the Option stem numeration dropdown, then numeration should not be displayed in the Set correct answer table`, () => {
220
+ multipleSelectionGridPage.questionStemNumerationDropdown()
221
+ .verifyInnerText(`${questionStemNumerationOptions[0]}`);
222
+ multipleSelectionGridPage.questionStemNumeration()
223
+ .should('not.exist');
224
+ });
225
+
226
+ it(`When the user selects ${questionStemNumerationOptions[1]} option from the Option stem numeration dropdown, then numbers should be displayed in the Set correct answer table`, () => {
227
+ multipleSelectionGridPage.steps.selectQuestionStemNumerationDropdownOption(`${questionStemNumerationOptions[1]}`);
228
+ multipleSelectionGridPage.steps.verifyQuestionStemNumerationInSetCorrectAnswerTable(numbers);
229
+ });
230
+
231
+ it(`When the user selects ${questionStemNumerationOptions[2]} option from the Option stem numeration dropdown, then uppercase alphabets should be displayed in the Set correct answer table`, () => {
232
+ multipleSelectionGridPage.steps.selectQuestionStemNumerationDropdownOption(`${questionStemNumerationOptions[2]}`);
233
+ multipleSelectionGridPage.steps.verifyQuestionStemNumerationInSetCorrectAnswerTable(uppercase);
234
+ });
235
+
236
+ it(`When the user selects ${questionStemNumerationOptions[3]} option from the Option stem numeration dropdown, then lowercase alphabets should be displayed in the Set correct answer table`, () => {
237
+ multipleSelectionGridPage.steps.selectQuestionStemNumerationDropdownOption(`${questionStemNumerationOptions[3]}`);
238
+ multipleSelectionGridPage.steps.verifyQuestionStemNumerationInSetCorrectAnswerTable(lowercase);
239
+ });
240
+
241
+ it('CSS for question stem numeration', { tags: 'css' }, () => {
242
+ multipleSelectionGridPage.questionStemNumeration()
243
+ .eq(0)
244
+ .verifyCSS(css.color.activeButtons, css.fontSize.default, css.fontWeight.regular)
245
+ .should('have.css', 'background-color', css.color.optionNumerationBg);
246
+ });
247
+
248
+ it('Accessibility of question stem numeration', () => {
249
+ cy.checkAccessibility(multipleSelectionGridPage.questionStemNumeration().eq(0).parents('.stem-numeration-present'));
250
+ });
251
+ });
252
+
253
+ describe('Additional settings: Question stem numeration preview tab section', () => {
254
+ abortEarlySetup();
255
+ before(() => {
256
+ cy.log('Navigating to multiple selection grid question type');
257
+ multipleSelectionGridPage.steps.navigateToCreateQuestion('multiple selection grid');
258
+ multipleSelectionGridPage.steps.addQuestionInstructions();
259
+ multipleSelectionGridPage.steps.addOption()
260
+ multipleSelectionGridPage.steps.addInputToAllQuestionStemFields(questionStems);
261
+ multipleSelectionGridPage.steps.addInputToAllOptionsFields(options);
262
+ multipleSelectionGridPage.steps.allotPoints(10);
263
+ multipleSelectionGridPage.steps.expandAdditonalSettings();
264
+ });
265
+
266
+ it(`When the user selects ${questionStemNumerationOptions[0]} option from the Option stem numeration dropdown, then numeration should not be displayed in the preview tab answer table`, () => {
267
+ multipleSelectionGridPage.questionStemNumerationDropdown()
268
+ .verifyInnerText(`${questionStemNumerationOptions[0]}`);
269
+ multipleSelectionGridPage.steps.switchToPreviewTab();
270
+ multipleSelectionGridPage.previewTabQuestionStemNumeration()
271
+ .should('not.exist');
272
+ });
273
+
274
+ it(`When the user selects ${questionStemNumerationOptions[1]} option from the Option stem numeration dropdown, then numbers should be displayed in the preview tab answer table`, () => {
275
+ multipleSelectionGridPage.steps.switchToEditTab();
276
+ multipleSelectionGridPage.steps.selectQuestionStemNumerationDropdownOption(`${questionStemNumerationOptions[1]}`);
277
+ multipleSelectionGridPage.steps.switchToPreviewTab();
278
+ multipleSelectionGridPage.steps.verifyQuestionStemNumerationInPreviewTabAnswerTable(numbers);
279
+ });
280
+
281
+ it(`When the user selects ${questionStemNumerationOptions[2]} option from the Option stem numeration dropdown, then uppercase alphabets should be displayed in the preview tab answer table`, () => {
282
+ multipleSelectionGridPage.steps.switchToEditTab();
283
+ multipleSelectionGridPage.steps.selectQuestionStemNumerationDropdownOption(`${questionStemNumerationOptions[2]}`);
284
+ multipleSelectionGridPage.steps.switchToPreviewTab();
285
+ multipleSelectionGridPage.steps.verifyQuestionStemNumerationInPreviewTabAnswerTable(uppercase);
286
+ });
287
+
288
+ it(`When the user selects ${questionStemNumerationOptions[3]} option from the Option stem numeration dropdown, then lowercase alphabets should be displayed in the preview tab answer table`, () => {
289
+ multipleSelectionGridPage.steps.switchToEditTab()
290
+ multipleSelectionGridPage.steps.selectQuestionStemNumerationDropdownOption(`${questionStemNumerationOptions[3]}`);
291
+ multipleSelectionGridPage.steps.switchToPreviewTab();
292
+ multipleSelectionGridPage.steps.verifyQuestionStemNumerationInPreviewTabAnswerTable(lowercase);
293
+ });
294
+
295
+ it('When user selects \'Randomize options\' the numeration should be displayed in ascending order in the preview tab answer table', () => {
296
+ multipleSelectionGridPage.steps.switchToEditTab();
297
+ multipleSelectionGridPage.steps.selectRandomizeOptionsCheckbox();
298
+ multipleSelectionGridPage.steps.switchToPreviewTab();
299
+ multipleSelectionGridPage.steps.verifyQuestionStemNumerationInPreviewTabAnswerTable(lowercase);
300
+ });
301
+
302
+ it('CSS for option numeration', { tags: 'css' }, () => {
303
+ multipleSelectionGridPage.previewTabQuestionStemNumeration()
304
+ .eq(0)
305
+ .verifyCSS(css.color.activeButtons, css.fontSize.default, css.fontWeight.regular)
306
+ .should('have.css', 'background-color', css.color.optionNumerationBg);
307
+ });
308
+
309
+ it('Accessibility of question stem numeration', () => {
310
+ cy.checkAccessibility(multipleSelectionGridPage.previewTabQuestionStemNumeration().eq(0).parents('.stem-numeration-present'));
311
+ });
312
+ });
313
+
314
+ describe('Additional settings: Title for question stems contents', () => {
315
+ abortEarlySetup();
316
+ before(() => {
317
+ cy.log('Navigating to multiple selection grid question type');
318
+ multipleSelectionGridPage.steps.navigateToCreateQuestion('multiple selection grid');
319
+ multipleSelectionGridPage.steps.expandAdditonalSettings();
320
+ });
321
+
322
+ it('\'Title for question stems\' label and input field should be displayed and by default, the input field should be prefilled with \'Question stem\'', () => {
323
+ multipleSelectionGridPage.titleForQuestionStemsLabel()
324
+ .verifyInnerText('Title for question stems')
325
+ .should('be.visible');
326
+ multipleSelectionGridPage.titleForQuestionStemInputField()
327
+ .verifyInnerText('Question stem')
328
+ });
329
+
330
+ it('CSS of Title for question stems label and input field', { tags: 'css' }, () => {
331
+ multipleSelectionGridPage.titleForQuestionStemsLabel()
332
+ .verifyCSS(css.color.labels, css.fontSize.normal, css.fontWeight.semibold);
333
+ multipleSelectionGridPage.titleForQuestionStemInputField()
334
+ .verifyCSS(css.color.text, css.fontSize.default, css.fontWeight.regular);
335
+ });
336
+
337
+ //Note: a11y covered in verifyAdditonalSettingsAccordionProperties
338
+ });
339
+
340
+ describe('Additional settings: Title for question stems set correct answer section', () => {
341
+ abortEarlySetup();
342
+ before(() => {
343
+ cy.log('Navigating to multiple selection grid question type');
344
+ multipleSelectionGridPage.steps.navigateToCreateQuestion('multiple selection grid');
345
+ multipleSelectionGridPage.steps.addQuestionInstructions();
346
+ multipleSelectionGridPage.steps.addOption();
347
+ multipleSelectionGridPage.steps.addInputToAllQuestionStemFields(questionStems);
348
+ multipleSelectionGridPage.steps.addInputToAllOptionsFields(options);
349
+ multipleSelectionGridPage.steps.allotPoints(10);
350
+ multipleSelectionGridPage.steps.expandAdditonalSettings();
351
+ });
352
+
353
+ it('By default, Question stem should be displayed as the question stem title in the set correct answer table', () => {
354
+ multipleSelectionGridPage.setCorrectAnswerTableQuestionStemTitle()
355
+ .verifyInnerText('Question stem');
356
+ });
357
+
358
+ it('When user enters any text in the Title for question stems then that title should be displayed the set correct answer table', () => {
359
+ multipleSelectionGridPage.steps.addInputToTitleForQuestionStemInputField('Causes of Pollution');
360
+ multipleSelectionGridPage.setCorrectAnswerTableQuestionStemTitle()
361
+ .verifyInnerText('Causes of Pollution');
362
+ });
363
+ });
364
+
365
+ describe('Additional settings: Title for question stems preview tab section', () => {
366
+ abortEarlySetup();
367
+ before(() => {
368
+ cy.log('Navigating to multiple selection grid question type');
369
+ multipleSelectionGridPage.steps.navigateToCreateQuestion('multiple selection grid');
370
+ multipleSelectionGridPage.steps.addQuestionInstructions();
371
+ multipleSelectionGridPage.steps.addOption()
372
+ multipleSelectionGridPage.steps.addInputToAllQuestionStemFields(questionStems);
373
+ multipleSelectionGridPage.steps.addInputToAllOptionsFields(options);
374
+ multipleSelectionGridPage.steps.allotPoints(10);
375
+ multipleSelectionGridPage.steps.expandAdditonalSettings();
376
+ multipleSelectionGridPage.steps.switchToPreviewTab();
377
+ });
378
+
379
+ it('By default, Question stem should be displayed as the question stem title in the preview tab answer table', () => {
380
+ multipleSelectionGridPage.previewTabAnswerTableQuestionStemTitle()
381
+ .verifyInnerText('Question stem');
382
+ });
383
+
384
+ it('When user enters any text in the \'Title for question stems\' then that title should be displayed the preview tab answer table', () => {
385
+ multipleSelectionGridPage.steps.switchToEditTab();
386
+ multipleSelectionGridPage.steps.addInputToTitleForQuestionStemInputField('Causes of Pollution');
387
+ multipleSelectionGridPage.steps.switchToPreviewTab();
388
+ multipleSelectionGridPage.previewTabAnswerTableQuestionStemTitle()
389
+ .verifyInnerText('Causes of Pollution');
390
+ });
391
+ });
392
+
393
+ describe('Additional settings: Title for options contents', () => {
394
+ abortEarlySetup();
395
+ before(() => {
396
+ cy.log('Navigating to multiple selection grid question type');
397
+ multipleSelectionGridPage.steps.navigateToCreateQuestion('multiple selection grid');
398
+ multipleSelectionGridPage.steps.expandAdditonalSettings();
399
+ });
400
+
401
+ it('\'Title for options\' label and input field should be displayed and by default, the input field should be empty', () => {
402
+ multipleSelectionGridPage.titleForOptionsLabel()
403
+ .verifyInnerText('Title for options')
404
+ .should('be.visible');
405
+ multipleSelectionGridPage.titleForOptionsInputField()
406
+ .should('have.text', '');
407
+ });
408
+
409
+ it('CSS of Title for options label and input field', { tags: 'css' }, () => {
410
+ multipleSelectionGridPage.titleForOptionsLabel()
411
+ .verifyCSS(css.color.labels, css.fontSize.normal, css.fontWeight.semibold);
412
+ multipleSelectionGridPage.titleForOptionsInputField()
413
+ .verifyCSS(css.color.text, css.fontSize.default, css.fontWeight.regular);
414
+ });
415
+
416
+ //Note: a11y covered in verifyAdditonalSettingsAccordionProperties
417
+ });
418
+
419
+ describe('Additional settings: Title for options set correct answer section', () => {
420
+ abortEarlySetup();
421
+ before(() => {
422
+ cy.log('Navigating to multiple selection grid question type');
423
+ multipleSelectionGridPage.steps.navigateToCreateQuestion('multiple selection grid');
424
+ multipleSelectionGridPage.steps.addQuestionInstructions();
425
+ multipleSelectionGridPage.steps.addOption();
426
+ multipleSelectionGridPage.steps.addInputToAllQuestionStemFields(questionStems);
427
+ multipleSelectionGridPage.steps.addInputToAllOptionsFields(options);
428
+ multipleSelectionGridPage.steps.allotPoints(10);
429
+ multipleSelectionGridPage.steps.expandAdditonalSettings();
430
+ });
431
+
432
+ it('By default, only options should be displayed in the header of the set correct answer table', () => {
433
+ multipleSelectionGridPage.steps.verifyTableHeaderContentsInSetCorrectAnswerTable(options)
434
+ multipleSelectionGridPage.setCorrectAnswerTableOptionsTitle()
435
+ .should('not.exist');
436
+ });
437
+
438
+ it('When user enters any text in the Title for options then that title should be displayed along with the options in the header section of the set correct answer table', () => {
439
+ multipleSelectionGridPage.steps.addInputToTitleForOptionsInputField('Choose the correct option')
440
+ multipleSelectionGridPage.setCorrectAnswerTableOptionsTitle()
441
+ .verifyInnerText('Choose the correct option');
442
+ multipleSelectionGridPage.steps.verifyTableHeaderContentsInSetCorrectAnswerTable(options)
443
+ });
444
+ });
445
+
446
+ describe('Additional settings: Title for options preview tab section', () => {
447
+ abortEarlySetup();
448
+ before(() => {
449
+ cy.log('Navigating to multiple selection grid question type');
450
+ multipleSelectionGridPage.steps.navigateToCreateQuestion('multiple selection grid');
451
+ multipleSelectionGridPage.steps.addQuestionInstructions();
452
+ multipleSelectionGridPage.steps.addOption();
453
+ multipleSelectionGridPage.steps.addInputToAllQuestionStemFields(questionStems);
454
+ multipleSelectionGridPage.steps.addInputToAllOptionsFields(options);
455
+ multipleSelectionGridPage.steps.allotPoints(10);
456
+ multipleSelectionGridPage.steps.expandAdditonalSettings();
457
+ multipleSelectionGridPage.steps.switchToPreviewTab()
458
+ });
459
+
460
+ it('By default, only options should be displayed in the header of the preview tab answer table', () => {
461
+ multipleSelectionGridPage.steps.verifyTableHeaderContentsInPreviewTabAnswerTable(options)
462
+ multipleSelectionGridPage.previewTabAnswerTableOptionsTitle()
463
+ .should('not.exist');
464
+ });
465
+
466
+ it('When user enters any text in the Title for options then that title should be displayed along with the options in the header section of the preview tab answer table', () => {
467
+ multipleSelectionGridPage.steps.switchToEditTab();
468
+ multipleSelectionGridPage.steps.addInputToTitleForOptionsInputField('Choose the correct option');
469
+ multipleSelectionGridPage.steps.switchToPreviewTab();
470
+ multipleSelectionGridPage.previewTabAnswerTableOptionsTitle()
471
+ .verifyInnerText('Choose the correct option');
472
+ multipleSelectionGridPage.steps.verifyTableHeaderContentsInPreviewTabAnswerTable(options);
473
+ });
474
+ });
475
+
476
+ describe('Additional settings: Question stem width and Option width contents', () => {
477
+ abortEarlySetup();
478
+ before(() => {
479
+ cy.log('Navigating to multiple selection grid question type');
480
+ multipleSelectionGridPage.steps.navigateToCreateQuestion('multiple selection grid');
481
+ multipleSelectionGridPage.steps.expandAdditonalSettings();
482
+ });
483
+
484
+ it('\'Question stem width\' and \'Option width\' labels and input fields should be displayed and by default, the input fields should be empty', () => {
485
+ multipleSelectionGridPage.questionStemWidthLabel()
486
+ .verifyInnerText('Question stem width')
487
+ .should('be.visible');
488
+ multipleSelectionGridPage.questionStemWidthInputField()
489
+ .should('have.text', '');
490
+ multipleSelectionGridPage.optionsWidthLabel()
491
+ .verifyInnerText('Option width')
492
+ .should('be.visible');
493
+ multipleSelectionGridPage.optionWidthInputField()
494
+ .should('have.text', '');
495
+ });
496
+
497
+ it('CSS of \'Question stem width\' and \'Option width\' section', { tags: 'css' }, () => {
498
+ multipleSelectionGridPage.questionStemWidthLabel()
499
+ .verifyCSS(css.color.labels, css.fontSize.normal, css.fontWeight.semibold);
500
+ multipleSelectionGridPage.questionStemWidthInputField()
501
+ .verifyCSS(css.color.text, css.fontSize.default, css.fontWeight.regular);
502
+ multipleSelectionGridPage.optionsWidthLabel()
503
+ .verifyCSS(css.color.labels, css.fontSize.normal, css.fontWeight.semibold);
504
+ multipleSelectionGridPage.optionWidthInputField()
505
+ .verifyCSS(css.color.text, css.fontSize.default, css.fontWeight.regular);
506
+ });
507
+ });
508
+
509
+ describe('Additional settings: Question stem width and Option width set correct section', () => {
510
+ abortEarlySetup();
511
+ before(() => {
512
+ cy.log('Navigating to multiple selection grid question type');
513
+ multipleSelectionGridPage.steps.navigateToCreateQuestion('multiple selection grid');
514
+ multipleSelectionGridPage.steps.addQuestionInstructions();
515
+ multipleSelectionGridPage.steps.addOption()
516
+ multipleSelectionGridPage.steps.addInputToAllQuestionStemFields(questionStems);
517
+ multipleSelectionGridPage.steps.addInputToAllOptionsFields(options);
518
+ multipleSelectionGridPage.steps.allotPoints(10);
519
+ multipleSelectionGridPage.steps.expandAdditonalSettings();
520
+ });
521
+
522
+ it('When the input field of \'Question stem width\' kept empty, the question stem should have min and max width 140px and 380px respectively in set correct answer table', () => {
523
+ multipleSelectionGridPage.questionStemWidthInputField()
524
+ .should('have.text', '');
525
+ multipleSelectionGridPage.steps.verifyQuestionStemWidthInSetCorrectAnswerTable('140', '380');
526
+ });
527
+
528
+ it('When user enters value for \'Question stem width\', the width should get updated accordingly in set correct answer table', () => {
529
+ multipleSelectionGridPage.steps.addInputToQuestionStemWidthInputField('200');
530
+ multipleSelectionGridPage.steps.verifyQuestionStemWidthInSetCorrectAnswerTable('200', '200');
531
+ });
532
+
533
+ it('When the user enters a value above 500px in the \'Option width\' input field then the width of the input field should remain 500px in \'Set correct answer\' section', () => {
534
+ multipleSelectionGridPage.steps.addInputToQuestionStemWidthInputField('700');
535
+ multipleSelectionGridPage.steps.verifyQuestionStemWidthInSetCorrectAnswerTable('500', '500');
536
+ });
537
+
538
+ it('When the input field of \'Option width\' kept empty, the question stem should have width 128px in set correct answer table', () => {
539
+ multipleSelectionGridPage.optionWidthInputField()
540
+ .should('have.text', '');
541
+ multipleSelectionGridPage.steps.verifyTableHeaderWidthInSetCorrectAnswerTable('128');
542
+ });
543
+
544
+ it('When user enters value for \'Option width\', the width should get updated accordingly in set correct answer table', () => {
545
+ multipleSelectionGridPage.steps.addInputToOptionsWidthInputField('250');
546
+ multipleSelectionGridPage.steps.verifyTableHeaderWidthInSetCorrectAnswerTable('250')
547
+ });
548
+
549
+ it('When the user enters a value above 500px in the \'Option width\' input field then the width of the input field should remain 500px in \'Set correct answer\' section', () => {
550
+ multipleSelectionGridPage.steps.addInputToOptionsWidthInputField('950');
551
+ multipleSelectionGridPage.steps.verifyTableHeaderWidthInSetCorrectAnswerTable('500')
552
+ });
553
+ });
554
+
555
+ describe('Additional settings: Question stem width and Option width set correct section', () => {
556
+ abortEarlySetup();
557
+ before(() => {
558
+ cy.log('Navigating to multiple selection grid question type');
559
+ multipleSelectionGridPage.steps.navigateToCreateQuestion('multiple selection grid');
560
+ multipleSelectionGridPage.steps.addQuestionInstructions();
561
+ multipleSelectionGridPage.steps.addOption()
562
+ multipleSelectionGridPage.steps.addInputToAllQuestionStemFields(questionStems);
563
+ multipleSelectionGridPage.steps.addInputToAllOptionsFields(options);
564
+ multipleSelectionGridPage.steps.allotPoints(10);
565
+ multipleSelectionGridPage.steps.expandAdditonalSettings();
566
+ multipleSelectionGridPage.steps.switchToPreviewTab();
567
+ });
568
+
569
+ it('When the input field of \'Question stem width\' kept empty, the question stem should have min and max width 140px and 380px respectively in preview tab answer table', () => {
570
+ multipleSelectionGridPage.steps.verifyQuestionStemWidthInPreviewTabAnswerTable('140', '380');
571
+ });
572
+
573
+ it('When user enters value for \'Question stem width\', the width should get updated accordingly in preview tab answer table', () => {
574
+ multipleSelectionGridPage.steps.switchToEditTab();
575
+ multipleSelectionGridPage.steps.addInputToQuestionStemWidthInputField('200');
576
+ multipleSelectionGridPage.steps.switchToPreviewTab();
577
+ multipleSelectionGridPage.steps.verifyQuestionStemWidthInPreviewTabAnswerTable('200', '200');
578
+ });
579
+
580
+ it('When the user enters a value above 500px in the \'Option width\' input field then the width of the input field should remain 500px in \'Set correct answer\' section', () => {
581
+ multipleSelectionGridPage.steps.switchToEditTab();
582
+ multipleSelectionGridPage.steps.addInputToQuestionStemWidthInputField('700');
583
+ multipleSelectionGridPage.steps.switchToPreviewTab();
584
+ multipleSelectionGridPage.steps.verifyQuestionStemWidthInPreviewTabAnswerTable('500', '500');
585
+ });
586
+
587
+ it('When the input field of \'Option width\' kept empty, the question stem should have width 128px in preview tab answer table', () => {
588
+ multipleSelectionGridPage.steps.verifyTableHeaderWidthInPreviewTabAnswerTable('128')
589
+ });
590
+
591
+ it('When user enters value for \'Option width\', the width should get updated accordingly in preview tab answer table', () => {
592
+ multipleSelectionGridPage.steps.switchToEditTab();
593
+ multipleSelectionGridPage.steps.addInputToOptionsWidthInputField('250');
594
+ multipleSelectionGridPage.steps.switchToPreviewTab();
595
+ multipleSelectionGridPage.steps.verifyTableHeaderWidthInPreviewTabAnswerTable('250')
596
+ });
597
+
598
+ it('When the user enters a value above 500px in the \'Option width\' input field then the width of the input field should remain 500px in \'Set correct answer\' section', () => {
599
+ multipleSelectionGridPage.steps.switchToEditTab();
600
+ multipleSelectionGridPage.steps.addInputToOptionsWidthInputField('950');
601
+ multipleSelectionGridPage.steps.switchToPreviewTab();
602
+ multipleSelectionGridPage.steps.verifyTableHeaderWidthInPreviewTabAnswerTable('500')
603
+ });
604
+ });
605
+
606
+ describe('Additional settings: Font size contents', () => {
607
+ abortEarlySetup();
608
+ before(() => {
609
+ cy.log('Navigating to multiple selection grid question type');
610
+ multipleSelectionGridPage.steps.navigateToCreateQuestion('multiple selection grid');
611
+ multipleSelectionGridPage.steps.expandAdditonalSettings();
612
+ });
613
+
614
+ multipleSelectionGridPage.tests.verifyFontSizeSectionContents();
615
+ });
616
+
617
+ describe('Additional settings: Font size contents set correct answer section', () => {
618
+ abortEarlySetup();
619
+ before(() => {
620
+ cy.log('Navigating to multiple selection grid question type');
621
+ multipleSelectionGridPage.steps.navigateToCreateQuestion('multiple selection grid');
622
+ multipleSelectionGridPage.steps.addQuestionInstructions();
623
+ multipleSelectionGridPage.steps.addOption();
624
+ multipleSelectionGridPage.steps.addInputToAllQuestionStemFields(questionStems);
625
+ multipleSelectionGridPage.steps.addInputToAllOptionsFields(options);
626
+ multipleSelectionGridPage.steps.allotPoints(10);
627
+ multipleSelectionGridPage.steps.expandAdditonalSettings();
628
+ multipleSelectionGridPage.steps.selectQuestionStemNumerationDropdownOption('Lowercase alphabet')
629
+ multipleSelectionGridPage.steps.addInputToTitleForOptionsInputField('Title for options')
630
+ });
631
+
632
+ //Failing due to https://redmine.zeuslearning.com/issues/534772
633
+ fontSizeDropdownOptions.forEach((option, fontsIndex) => {
634
+ it(`When the user selects \'${option}\' option from the Font Size dropdown, then font size of the preview (options, question instructions question stems) should be changed to ${option} in the set correct answer table`, () => {
635
+ multipleSelectionGridPage.steps.selectFontSizeOptionFromFontSizeDropdown(fontsIndex)
636
+ multipleSelectionGridPage.fontSizeDropdown()
637
+ .verifyInnerText(`${option}`);
638
+ multipleSelectionGridPage.setCorrectAnswerTableHeader()
639
+ .should('have.css', 'font-size', fontSizes[fontsIndex]);
640
+ multipleSelectionGridPage.questionStemNumeration()
641
+ .should('have.css', 'font-size', fontSizes[fontsIndex]);
642
+ multipleSelectionGridPage.setCorrectAnswertableQuestionStem()
643
+ .should('have.css', 'font-size', fontSizes[fontsIndex]);
644
+ multipleSelectionGridPage.setCorrectAnswerTableQuestionStemTitle()
645
+ .should('have.css', 'font-size', fontSizes[fontsIndex]);
646
+ multipleSelectionGridPage.setCorrectAnswerTableOptionsTitle()
647
+ .should('have.css', 'font-size', fontSizes[fontsIndex]);
648
+ });
649
+ });
650
+ });
651
+
652
+ describe('Additional settings: Font size contents preview tab section', () => {
653
+ abortEarlySetup();
654
+ before(() => {
655
+ cy.log('Navigating to multiple selection grid question type');
656
+ multipleSelectionGridPage.steps.navigateToCreateQuestion('multiple selection grid');
657
+ multipleSelectionGridPage.steps.addQuestionInstructions();
658
+ multipleSelectionGridPage.steps.addOption();
659
+ multipleSelectionGridPage.steps.addInputToAllQuestionStemFields(questionStems);
660
+ multipleSelectionGridPage.steps.addInputToAllOptionsFields(options);
661
+ multipleSelectionGridPage.steps.allotPoints(10);
662
+ multipleSelectionGridPage.steps.expandAdditonalSettings();
663
+ multipleSelectionGridPage.steps.selectQuestionStemNumerationDropdownOption('Lowercase alphabet');
664
+ multipleSelectionGridPage.steps.addInputToTitleForOptionsInputField('Title for options');
665
+ });
666
+
667
+ fontSizeDropdownOptions.forEach((option, fontsIndex) => {
668
+ it(`When the user selects \'${option}\' option from the Font Size dropdown, then font size of the preview (options, question instructions question stems) should be changed to ${option} in the preview tab Answer table`, () => {
669
+ multipleSelectionGridPage.steps.selectFontSizeOptionFromFontSizeDropdown(fontsIndex)
670
+ multipleSelectionGridPage.fontSizeDropdown()
671
+ .verifyInnerText(`${option}`);
672
+ multipleSelectionGridPage.steps.switchToPreviewTab();
673
+ multipleSelectionGridPage.questionInstructionsText()
674
+ .should('have.css', 'font-size', fontSizes[fontsIndex]);
675
+ multipleSelectionGridPage.previewTabAnswerTableHeader()
676
+ .should('have.css', 'font-size', fontSizes[fontsIndex]);
677
+ multipleSelectionGridPage.previewTabQuestionStemNumeration()
678
+ .should('have.css', 'font-size', fontSizes[fontsIndex]);
679
+ multipleSelectionGridPage.previewTabAnswertableQuestionStem()
680
+ .should('have.css', 'font-size', fontSizes[fontsIndex]);
681
+ multipleSelectionGridPage.previewTabAnswerTableQuestionStemTitle()
682
+ .should('have.css', 'font-size', fontSizes[fontsIndex]);
683
+ multipleSelectionGridPage.previewTabAnswerTableOptionsTitle()
684
+ .should('have.css', 'font-size', fontSizes[fontsIndex]);
685
+ multipleSelectionGridPage.steps.switchToEditTab();
686
+ });
687
+ });
688
+ });
689
+
690
+ describe('Additional settings: Check answer', () => {
691
+ abortEarlySetup();
692
+ before(() => {
693
+ cy.log('Navigating to multiple selection grid question type');
694
+ multipleSelectionGridPage.steps.navigateToCreateQuestion('multiple selection grid');
695
+ multipleSelectionGridPage.steps.addQuestionInstructions();
696
+ multipleSelectionGridPage.steps.addOption()
697
+ multipleSelectionGridPage.steps.addInputToAllQuestionStemFields(questionStems);
698
+ multipleSelectionGridPage.steps.addInputToAllOptionsFields(options);
699
+ multipleSelectionGridPage.steps.allotPoints(10);
700
+ multipleSelectionGridPage.steps.setAnswersForAllQuestionStemsInSetCorrectAnswerTable([[0, 2], [1], [0, 1], [0, 1]]);
701
+ multipleSelectionGridPage.steps.expandAdditonalSettings();
702
+ });
703
+
704
+ multipleSelectionGridPage.tests.verifyCheckAnswerSectionAndPreviewTabCheckAnswerButton();
705
+ });
706
+
707
+ describe('Additional settings: Check answer functionality', () => {
708
+ abortEarlySetup();
709
+ before(() => {
710
+ cy.log('Navigating to multiple selection grid question type');
711
+ multipleSelectionGridPage.steps.navigateToCreateQuestion('multiple selection grid');
712
+ multipleSelectionGridPage.steps.addQuestionInstructions();
713
+ multipleSelectionGridPage.steps.addOption();
714
+ multipleSelectionGridPage.steps.addInputToAllQuestionStemFields(questionStems);
715
+ multipleSelectionGridPage.steps.addInputToAllOptionsFields(options);
716
+ multipleSelectionGridPage.steps.allotPoints(10);
717
+ multipleSelectionGridPage.steps.setAnswersForAllQuestionStemsInSetCorrectAnswerTable([[0, 2], [1], [0, 1], [1, 2]]);
718
+ multipleSelectionGridPage.steps.expandAdditonalSettings();
719
+ multipleSelectionGridPage.steps.setMaximumCheckAnswerAttempts(2);
720
+ multipleSelectionGridPage.steps.switchToPreviewTab();
721
+ });
722
+
723
+ multipleSelectionGridPage.tests.verifyCheckAnswerButtonFunctionalityWhenQuestionIsUnattempted()
724
+
725
+ it('When the user has selected correct answer for two options then on clicking on the Check Answer button, green checkmark icon should be displayed besides the selected correct option, and \'Incorrect Answer\' label should be displayed below the box', () => {
726
+ multipleSelectionGridPage.steps.setAnswersForAllQuestionStemsInPreviewTabAnswerTable([[0, 2], [1]]);
727
+ multipleSelectionGridPage.steps.checkAnswer();
728
+ multipleSelectionGridPage.steps.verifyCorrectOptionsCheckmarkIcon(0, [0, 2]);
729
+ multipleSelectionGridPage.steps.verifyCorrectOptionsCheckmarkIcon(1, [1]);
730
+ multipleSelectionGridPage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect')
731
+ multipleSelectionGridPage.steps.verifyIncorrectAttemptBorder();
732
+ });
733
+
734
+ it('When the user has selected all correct answer options 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', () => {
735
+ multipleSelectionGridPage.steps.setAnswersForQuestionStemInPreviewTabAnswerTable(2, [0, 1]);
736
+ multipleSelectionGridPage.steps.setAnswersForQuestionStemInPreviewTabAnswerTable(3, [1, 2]);
737
+ multipleSelectionGridPage.steps.checkAnswer();
738
+ multipleSelectionGridPage.steps.verifyCorrectOptionsCheckmarkIcon(0, [0, 2]);
739
+ multipleSelectionGridPage.steps.verifyCorrectOptionsCheckmarkIcon(1, [1]);
740
+ multipleSelectionGridPage.steps.verifyCorrectOptionsCheckmarkIcon(2, [0, 1]);
741
+ multipleSelectionGridPage.steps.verifyCorrectOptionsCheckmarkIcon(3, [1, 2]);
742
+ multipleSelectionGridPage.steps.verifyCorrectIncorrectAnswerLabel('Correct');
743
+ multipleSelectionGridPage.steps.verifyCorrectAttemptBorder();
744
+ });
745
+
746
+ multipleSelectionGridPage.tests.verifyDisabledCheckAnswerButtonWithCSSAnda11y();
747
+
748
+ it('When the user updates the value of Maximum check answer attempts input field, it should get reflected on the Preview tab', () => {
749
+ multipleSelectionGridPage.steps.switchToEditTab();
750
+ multipleSelectionGridPage.steps.clearMaximumCheckAnswerAttemptsInputField();
751
+ multipleSelectionGridPage.steps.addInputToMaximumCheckAnswerAttemptsInputField(1);
752
+ multipleSelectionGridPage.steps.switchToPreviewTab();
753
+ multipleSelectionGridPage.checkAnswerButton()
754
+ .should('be.enabled');
755
+ multipleSelectionGridPage.steps.setAnswersForAllQuestionStemsInPreviewTabAnswerTable([[0, 2], [1], [0, 1], [1, 2]]);
756
+ multipleSelectionGridPage.steps.checkAnswer();
757
+ multipleSelectionGridPage.checkAnswerButton()
758
+ .should('be.disabled');
759
+ });
760
+
761
+ 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', () => {
762
+ multipleSelectionGridPage.steps.switchToEditTab();
763
+ multipleSelectionGridPage.steps.clearMaximumCheckAnswerAttemptsInputField();
764
+ multipleSelectionGridPage.steps.addInputToMaximumCheckAnswerAttemptsInputField(0);
765
+ cy.log('Switching to Preview tab')
766
+ multipleSelectionGridPage.steps.switchToPreviewTab();
767
+ multipleSelectionGridPage.steps.setAnswersForAllQuestionStemsInPreviewTabAnswerTable([[1], [2], [2], [0]]);
768
+ multipleSelectionGridPage.steps.checkAnswer();
769
+ multipleSelectionGridPage.steps.verifyIncorrectOptionsCrossmarkIcon(0, [1]);
770
+ multipleSelectionGridPage.steps.verifyIncorrectOptionsCrossmarkIcon(1, [2]);
771
+ multipleSelectionGridPage.steps.verifyIncorrectOptionsCrossmarkIcon(2, [2]);
772
+ multipleSelectionGridPage.steps.verifyIncorrectOptionsCrossmarkIcon(3, [0]);
773
+ multipleSelectionGridPage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect')
774
+ multipleSelectionGridPage.steps.verifyIncorrectAttemptBorder();
775
+ multipleSelectionGridPage.checkAnswerButton()
776
+ .should('be.enabled');
777
+ multipleSelectionGridPage.steps.setAnswersForQuestionStemInPreviewTabAnswerTable(1, [0]);
778
+ multipleSelectionGridPage.steps.checkAnswer();
779
+ multipleSelectionGridPage.steps.verifyIncorrectOptionsCrossmarkIcon(0, [1]);
780
+ multipleSelectionGridPage.steps.verifyIncorrectOptionsCrossmarkIcon(1, [0, 2]);
781
+ multipleSelectionGridPage.steps.verifyIncorrectOptionsCrossmarkIcon(2, [2]);
782
+ multipleSelectionGridPage.steps.verifyIncorrectOptionsCrossmarkIcon(3, [0]);
783
+ multipleSelectionGridPage.correctIcon()
784
+ .should('not.exist');
785
+ multipleSelectionGridPage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect')
786
+ multipleSelectionGridPage.steps.verifyIncorrectAttemptBorder();
787
+ multipleSelectionGridPage.checkAnswerButton()
788
+ .should('be.enabled');
789
+ });
790
+
791
+ 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', () => {
792
+ multipleSelectionGridPage.steps.switchToEditTab();
793
+ multipleSelectionGridPage.steps.clearMaximumCheckAnswerAttemptsInputField()
794
+ multipleSelectionGridPage.steps.switchToPreviewTab();
795
+ multipleSelectionGridPage.steps.setAnswersForAllQuestionStemsInPreviewTabAnswerTable([[1], [2], [2], [0]]);
796
+ multipleSelectionGridPage.steps.checkAnswer();
797
+ multipleSelectionGridPage.steps.verifyIncorrectOptionsCrossmarkIcon(0, [1]);
798
+ multipleSelectionGridPage.steps.verifyIncorrectOptionsCrossmarkIcon(1, [2]);
799
+ multipleSelectionGridPage.steps.verifyIncorrectOptionsCrossmarkIcon(2, [2]);
800
+ multipleSelectionGridPage.steps.verifyIncorrectOptionsCrossmarkIcon(3, [0]);
801
+ multipleSelectionGridPage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect')
802
+ multipleSelectionGridPage.steps.verifyIncorrectAttemptBorder();
803
+ multipleSelectionGridPage.checkAnswerButton()
804
+ .should('be.enabled');
805
+ multipleSelectionGridPage.steps.setAnswersForQuestionStemInPreviewTabAnswerTable(1, [0]);
806
+ multipleSelectionGridPage.steps.checkAnswer();
807
+ multipleSelectionGridPage.steps.verifyIncorrectOptionsCrossmarkIcon(0, [1]);
808
+ multipleSelectionGridPage.steps.verifyIncorrectOptionsCrossmarkIcon(1, [0, 2]);
809
+ multipleSelectionGridPage.steps.verifyIncorrectOptionsCrossmarkIcon(2, [2]);
810
+ multipleSelectionGridPage.steps.verifyIncorrectOptionsCrossmarkIcon(3, [0]);
811
+ multipleSelectionGridPage.correctIcon()
812
+ .should('not.exist');
813
+ multipleSelectionGridPage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect')
814
+ multipleSelectionGridPage.steps.verifyIncorrectAttemptBorder();
815
+ multipleSelectionGridPage.checkAnswerButton()
816
+ .should('be.enabled');
817
+ });
818
+ });
819
+
820
+ describe('Additional Settings: Details section', () => {
821
+ abortEarlySetup();
822
+ before(() => {
823
+ cy.log('Navigating to multiple selection grid question type');
824
+ multipleSelectionGridPage.steps.navigateToCreateQuestion('multiple selection grid');
825
+ multipleSelectionGridPage.steps.expandAdditonalSettings();
826
+ });
827
+
828
+ multipleSelectionGridPage.tests.verifyDetailsSection();
829
+ });
830
+ });