itemengine-cypress-automation 1.0.576-IEI-7079-92d877f.0 → 1.0.576

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (50) hide show
  1. package/cypress/e2e/ILC/ChartsBar/Scoring/allOrNothingAlternatePointsGreaterThanCorrectPoints.js +0 -205
  2. package/cypress/e2e/ILC/ChartsBar/Scoring/allOrNothingCorrectPointsEqualToAlternatePoints.js +0 -205
  3. package/cypress/e2e/ILC/ChartsBar/Scoring/allOrNothingCorrectPointsGreaterThanAlternatePoints.js +0 -205
  4. package/cypress/e2e/ILC/ChartsBar/Scoring/partialDifferentWeightsAlternativePointsGreaterThanCorrectPoints.js +1 -248
  5. package/cypress/e2e/ILC/ChartsBar/Scoring/partialDifferentWeightsCorrectPointsEqualToAlternativePoints.js +0 -247
  6. package/cypress/e2e/ILC/ChartsBar/Scoring/partialDifferentWeightsCorrectPointsGreaterThanAlternativePoints.js +0 -223
  7. package/cypress/e2e/ILC/ChartsBar/Scoring/partialEqualWeightsAlternativePointsGreaterThanCorrectPoints.js +0 -223
  8. package/cypress/e2e/ILC/ChartsBar/Scoring/partialEqualWeightsCorrectPointsEqualToAlternativePoints.js +0 -175
  9. package/cypress/e2e/ILC/ChartsBar/Scoring/partialEqualWeightsCorrectPointsGreaterThanAlternativePoints.js +0 -223
  10. package/cypress/e2e/ILC/ChartsBar/Scoring/partialEqualWeightsCorrectPointsGreaterThanAlternativePointsLocked.js +0 -191
  11. package/cypress/e2e/ILC/ChartsDotsPlot/scoring/partialEqualWeightsWithCorrectPointsGreaterThanAlternativePointsLocked.js +24 -184
  12. package/cypress/e2e/ILC/ChartsLine/Scoring/allOrNothingAlternatePointsGreaterThanCorrectPoints.js +0 -177
  13. package/cypress/e2e/ILC/ChartsLine/Scoring/allOrNothingCorrectPointsEqualToAlternatePoints.js +0 -206
  14. package/cypress/e2e/ILC/ChartsLine/Scoring/allOrNothingCorrectPointsGreaterThanAlternatePoints.js +0 -205
  15. package/cypress/e2e/ILC/ChartsLine/Scoring/partialDifferentWeightsAlternativePointsGreaterThanCorrectPoints.js +0 -228
  16. package/cypress/e2e/ILC/ChartsLine/Scoring/partialDifferentWeightsCorrectPointsEqualToAlternativePoints.js +1 -229
  17. package/cypress/e2e/ILC/ChartsLine/Scoring/partialDifferentWeightsCorrectPointsGreaterThanAlternativePoints.js +1 -229
  18. package/cypress/e2e/ILC/ChartsLine/Scoring/partialEqualWeightsAlternativePointsGreaterThanCorrectPoints.js +0 -206
  19. package/cypress/e2e/ILC/ChartsLine/Scoring/partialEqualWeightsCorrectPointsEqualToAlternativePoints.js +0 -183
  20. package/cypress/e2e/ILC/ChartsLine/Scoring/partialEqualWeightsCorrectPointsGreaterThanAlternativePoints.js +0 -206
  21. package/cypress/e2e/ILC/ChartsLine/Scoring/partialEqualWeightsCorrectPointsGreaterThanAlternativePointsLocked.js +0 -184
  22. package/cypress/e2e/ILC/EssayResponse/additionalSettings.js +8 -2
  23. package/cypress/e2e/ILC/EssayResponse/additionalSettingsBasic.js +15 -0
  24. package/cypress/e2e/ILC/EssayResponse/createCustomCategory.smoke.js +13 -0
  25. package/cypress/e2e/ILC/EssayResponse/editTabBasicSections.js +155 -5
  26. package/cypress/e2e/ILC/EssayResponse/essayResponseCustomizeFormattingOptions2.js +117 -4
  27. package/cypress/e2e/ILC/EssayResponse/essayResponseCustomizeFormattingOptions3.js +101 -4
  28. package/cypress/e2e/ILC/EssayResponse/essayResponseCustomizeFormattingOptions4.js +114 -0
  29. package/cypress/e2e/ILC/EssayResponse/essayResponseSpecialCharacters.js +12 -2
  30. package/cypress/e2e/ILC/EssayResponse/previewAddTable.js +38 -3
  31. package/cypress/e2e/ILC/EssayResponse/previewContentsForAllViews.smoke.js +41 -23
  32. package/cypress/e2e/ILC/EssayResponse/previewEditTable.js +78 -3
  33. package/cypress/e2e/ILC/EssayResponse/previewHyperlink.js +15 -0
  34. package/cypress/e2e/ILC/EssayResponse/studentViewSettings.js +71 -0
  35. package/cypress/e2e/ILC/chartsDotsPlot/scoring/allOrNothingWithAlternatePointsGreaterThanCorrectPoints.js +10 -164
  36. package/cypress/e2e/ILC/chartsDotsPlot/scoring/allOrNothingWithCorrectPointsEqualToAlternativePoints.js +11 -165
  37. package/cypress/e2e/ILC/chartsDotsPlot/scoring/allOrNothingWithCorrectPointsGreaterThanAlternativePoints.js +11 -165
  38. package/cypress/e2e/ILC/chartsDotsPlot/scoring/partialDifferentWeightsWithAlternativePointsGreaterThanCorrectPoints.js +14 -164
  39. package/cypress/e2e/ILC/chartsDotsPlot/scoring/partialDifferentWeightsWithCorrectPointsEqualToAlternativePoints.js +10 -121
  40. package/cypress/e2e/ILC/chartsDotsPlot/scoring/partialDifferentWeightsWithCorrectPointsGreaterThanAlternativePoints.js +16 -167
  41. package/cypress/e2e/ILC/chartsDotsPlot/scoring/partialEqualWeightsWithAlternativePointsGreaterThanCorrectPoints.js +15 -178
  42. package/cypress/e2e/ILC/chartsDotsPlot/scoring/partialEqualWeightsWithCorrectPointsEqualToAlternativePoints.js +10 -121
  43. package/cypress/e2e/ILC/chartsDotsPlot/scoring/partialEqualWeightsWithCorrectPointsGreaterThanAlternativePoints.js +13 -165
  44. package/cypress/pages/chartsBarPage.js +1 -44
  45. package/cypress/pages/chartsDotPlotPage.js +1 -99
  46. package/cypress/pages/chartsLinePage.js +1 -48
  47. package/cypress/pages/components/equationEditorSectionCommonComponent.js +20 -0
  48. package/cypress/pages/components/essayResponseCommonComponents.js +29 -1
  49. package/cypress/pages/essayResponsePage.js +3 -1
  50. package/package.json +1 -1
@@ -25,7 +25,7 @@ describe('Create question page - Essay Response: Customize formatting options (f
25
25
  essayResponsePage.tests.verifyUndoAndRedoFunctionalityForPreviewTabToolbarOption('Insert/Remove Bulleted List');
26
26
 
27
27
  //Comment: Here we are unable to verify the bullet point marker that appears since it is displayed using ::marker
28
- it('When the user selects the \'Bulleted list\' toolbar option in an empty response field, then a bulleted list with \'1 bullet point\' should be displayed in the response field and when the user enters text, then that text should appear as a bulleted list', () => {
28
+ it('When the user selects the \'Bulleted list\' toolbar option in an empty response field, then a bulleted list with \'1 bullet point\' should be displayed in the response field and when the user enters text, then that text should appear as a bulleted list in question preview', () => {
29
29
  essayResponsePage.steps.resetPreviewTabResponseField();
30
30
  essayResponsePage.steps.selectPreviewTabToolbarOption('Insert/Remove Bulleted List');
31
31
  essayResponsePage.steps.verifyResponseFieldHTML('<ul><li><br></li></ul>');
@@ -33,6 +33,19 @@ describe('Create question page - Essay Response: Customize formatting options (f
33
33
  essayResponsePage.steps.verifyResponseFieldHTML('<ul><li>Lorem Ipsum</li></ul>');
34
34
  });
35
35
 
36
+ it('When the user selects the \'Bulleted list\' toolbar option in an empty response field, then a bulleted list with \'1 bullet point\' should be displayed in the response field and when the user enters text, then that text should appear as a bulleted list in item preview', () => {
37
+ essayResponsePage.steps.saveAQuestionAndVerifySnackbar();
38
+ essayResponsePage.steps.switchToPreviewTab();
39
+ essayResponsePage.steps.resetPreviewTabResponseField();
40
+ essayResponsePage.steps.selectPreviewTabToolbarOption('Insert/Remove Bulleted List');
41
+ essayResponsePage.steps.verifyResponseFieldHTML('<ul><li><br></li></ul>');
42
+ essayResponsePage.steps.enterInputInResponseField('Lorem Ipsum');
43
+ essayResponsePage.steps.verifyResponseFieldHTML('<ul><li>Lorem Ipsum</li></ul>');
44
+ essayResponsePage.steps.switchToEditTab();
45
+ essayResponsePage.steps.clickOnEditQuestionButton();
46
+ essayResponsePage.steps.switchToPreviewTab();
47
+ });
48
+
36
49
  it('When the user presses the \'Enter\' key, another bullet point should appear below the first point and user should be able to enter text to the 2nd list item', () => {
37
50
  essayResponsePage.steps.enterInputInResponseField('{enter}');
38
51
  essayResponsePage.steps.verifyListItemLengthInResponseField(2);
@@ -57,7 +70,7 @@ describe('Create question page - Essay Response: Customize formatting options (f
57
70
  essayResponsePage.tests.verifyUndoAndRedoFunctionalityForPreviewTabToolbarOption('Insert/Remove Numbered List');
58
71
 
59
72
  //Comment: Here we are unable to verify the number of the list item that appears since it is displayed using ::marker
60
- it('When the user selects the \'Numbered list\' toolbar option in an empty response field, then a numbered list with \'1. list item\' should be displayed in the response field and when the user enters text, then that text should appear as a numbered list', () => {
73
+ it('When the user selects the \'Numbered list\' toolbar option in an empty response field, then a numbered list with \'1. list item\' should be displayed in the response field and when the user enters text, then that text should appear as a numbered list in question preview', () => {
61
74
  essayResponsePage.steps.resetPreviewTabResponseField();
62
75
  essayResponsePage.steps.selectPreviewTabToolbarOption('Insert/Remove Numbered List');
63
76
  essayResponsePage.steps.verifyResponseFieldHTML('<ol><li><br></li></ol>');
@@ -65,6 +78,18 @@ describe('Create question page - Essay Response: Customize formatting options (f
65
78
  essayResponsePage.steps.verifyResponseFieldHTML('<ol><li>Lorem Ipsum</li></ol>');
66
79
  });
67
80
 
81
+ it('When the user selects the \'Numbered list\' toolbar option in an empty response field, then a numbered list with \'1. list item\' should be displayed in the response field and when the user enters text, then that text should appear as a numbered list in item preview', () => {
82
+ essayResponsePage.steps.saveAQuestionAndVerifySnackbar();
83
+ essayResponsePage.steps.switchToPreviewTab();
84
+ essayResponsePage.steps.resetPreviewTabResponseField();
85
+ essayResponsePage.steps.selectPreviewTabToolbarOption('Insert/Remove Numbered List');
86
+ essayResponsePage.steps.verifyResponseFieldHTML('<ol><li><br></li></ol>');
87
+ essayResponsePage.steps.enterInputInResponseField('Lorem Ipsum');
88
+ essayResponsePage.steps.verifyResponseFieldHTML('<ol><li>Lorem Ipsum</li></ol>');
89
+ essayResponsePage.steps.clickOnEditQuestionButton();
90
+ essayResponsePage.steps.switchToPreviewTab();
91
+ });
92
+
68
93
  it('When the user presses the \'Enter\' key, \'2. list item\' should appear below the first list item and user should be able to enter text to the 2nd list item', () => {
69
94
  essayResponsePage.steps.enterInputInResponseField('{enter}');
70
95
  essayResponsePage.steps.verifyListItemLengthInResponseField(2);
@@ -228,6 +253,64 @@ describe('Create question page - Essay Response: Customize formatting options (f
228
253
  essayResponsePage.tests.verifyUndoAndRedoFunctionalityForPreviewTabToolbarOption('Align Right');
229
254
  });
230
255
 
256
+ describe('Align left, Center, Align right, Justify formatting options - Item preview', () => {
257
+ abortEarlySetup();
258
+ before(() => {
259
+ essayResponsePage.steps.navigateToCreateQuestion('essay response');
260
+ cy.barsPreLoaderWait();
261
+ essayResponsePage.steps.expandCustomizeFormattingOptionsAccordion();
262
+ essayResponsePage.steps.selectCustomizedFormattingOption(['Align Left', 'Align Center', 'Align Right', 'Align Justify']);
263
+ essayResponsePage.steps.saveAQuestionAndVerifySnackbar();
264
+ essayResponsePage.steps.switchToPreviewTab();
265
+ });
266
+
267
+ it('When the user focuses in the response field, then none of the options should be displayed in selected state and the text in the response field should be displayed as normal text without any alignment in item preview', () => {
268
+ essayResponsePage.steps.focusInResponseField();
269
+ essayResponsePage.steps.verifyPreviewTabToolbarOptionNotSelected('Align Left');
270
+ essayResponsePage.steps.verifyPreviewTabToolbarOptionNotSelected('Align Center');
271
+ essayResponsePage.steps.verifyPreviewTabToolbarOptionNotSelected('Align Right');
272
+ essayResponsePage.steps.verifyPreviewTabToolbarOptionNotSelected('Align Justify');
273
+ essayResponsePage.steps.enterInputInResponseField('Lorem Ipsum');
274
+ essayResponsePage.steps.verifyResponseFieldHTML('<p>Lorem Ipsum</p>');
275
+ });
276
+
277
+ it('When the user selects the \'Center\' toolbar option, then text in the response field should get aligned to the center and \'Align left\' toolbar option should get deselected in item preview', () => {
278
+ essayResponsePage.steps.selectPreviewTabToolbarOption('Align Center');
279
+ essayResponsePage.steps.verifyResponseFieldHTML('<p style=\"text-align: center;\">Lorem Ipsum</p>')
280
+ essayResponsePage.steps.verifyPreviewTabToolbarOptionNotSelected('Align Left')
281
+ });
282
+
283
+ it('When the user selects the \'Align Left\' toolbar option, then text in the response field should get aligned to the left and \'Center\' toolbar option should get deselected in item preview', () => {
284
+ essayResponsePage.steps.selectPreviewTabToolbarOption('Align Left');
285
+ essayResponsePage.steps.verifyResponseFieldHTML('<p style="text-align: left;">Lorem Ipsum</p>');
286
+ essayResponsePage.steps.verifyPreviewTabToolbarOptionNotSelected('Align Center')
287
+ });
288
+
289
+ it('When the user selects the \'Align Right\' toolbar option, then text in the response field should get aligned to the right and \'Align left\' toolbar option should get deselected in item preview', () => {
290
+ essayResponsePage.steps.selectPreviewTabToolbarOption('Align Right');
291
+ essayResponsePage.steps.verifyResponseFieldHTML('<p style=\"text-align: right;\">Lorem Ipsum</p>');
292
+ essayResponsePage.steps.verifyPreviewTabToolbarOptionNotSelected('Align Left')
293
+ });
294
+
295
+ it('When the user deselects \'Align Right\' toolbar option, then the text in the response field should be displayed as normal text without any alignment in item preview', () => {
296
+ essayResponsePage.steps.deselectPreviewTabToolbarOption('Align Right');
297
+ essayResponsePage.steps.verifyResponseFieldHTML('<p>Lorem Ipsum</p>');
298
+ });
299
+
300
+ it('When the user selects the \'Justify\' toolbar option, then text in the response field should get justified alignment and \'Align right\' toolbar option should get deselected in item preview', () => {
301
+ essayResponsePage.steps.selectPreviewTabToolbarOption('Align Justify');
302
+ essayResponsePage.steps.verifyResponseFieldHTML('<p style="text-align: justify;">Lorem Ipsum</p>');
303
+ essayResponsePage.steps.verifyPreviewTabToolbarOptionNotSelected('Align Right')
304
+ });
305
+
306
+ it('When the user switches to the next line, \'Justify\' toolbar option should persist in item preview', () => {
307
+ essayResponsePage.steps.enterInputInResponseField('{enter}');
308
+ utilities.verifyElementVisibilityState(essayResponsePage.previewTabToolbarOption('Align Justify'), 'visible');
309
+ });
310
+
311
+ essayResponsePage.tests.verifyUndoAndRedoFunctionalityForPreviewTabToolbarOption('Align Right');
312
+ });
313
+
231
314
  describe('Increase indent, Decrease indent formatting options - Preview tab', () => {
232
315
  abortEarlySetup();
233
316
  before(() => {
@@ -242,15 +325,29 @@ describe('Create question page - Essay Response: Customize formatting options (f
242
325
  essayResponsePage.steps.verifyPreviewTabToolbarOptionDisabled('Decrease Indent')
243
326
  });
244
327
 
245
- it('When the user selects the \'Increase indent\' toolbar option, then indentation of text in the response field should increase and the \'Decrease indent\' toolbar option should get enabled', () => {
328
+ it('When the user selects the \'Increase indent\' toolbar option, then indentation of text in the response field should increase and the \'Decrease indent\' toolbar option should get enabled in question preview', () => {
246
329
  essayResponsePage.steps.selectPreviewTabToolbarOption('Increase Indent');
247
330
  essayResponsePage.steps.verifyResponseFieldHTML('<p style=\"margin-left: 40px;\">Lorem Ipsum</p>');
248
331
  essayResponsePage.steps.verifyPreviewTabToolbarOptionNotSelected('Decrease Indent')
249
332
  });
250
333
 
334
+ it('When the user selects the \'Increase indent\' toolbar option, then indentation of text in the response field should increase and the \'Decrease indent\' toolbar option should get enabled in item preview', () => {
335
+ essayResponsePage.steps.saveAQuestionAndVerifySnackbar();
336
+ essayResponsePage.steps.switchToPreviewTab();
337
+ essayResponsePage.steps.enterInputInResponseField('Lorem Ipsum');
338
+ essayResponsePage.steps.selectPreviewTabToolbarOption('Increase Indent');
339
+ essayResponsePage.steps.verifyResponseFieldHTML('<p style=\"margin-left: 40px;\">Lorem Ipsum</p>');
340
+ essayResponsePage.steps.verifyPreviewTabToolbarOptionNotSelected('Decrease Indent')
341
+ essayResponsePage.steps.switchToEditTab();
342
+ essayResponsePage.steps.clickOnEditQuestionButton();
343
+ essayResponsePage.steps.switchToPreviewTab();
344
+ essayResponsePage.steps.enterInputInResponseField('Lorem Ipsum');
345
+ essayResponsePage.steps.selectPreviewTabToolbarOption('Increase Indent');
346
+ });
347
+
251
348
  essayResponsePage.tests.verifyUndoAndRedoFunctionalityForPreviewTabToolbarOption('Increase Indent');
252
349
 
253
- it('When the user selects the \'Decrease indent\' toolbar option, then the indentation of text in the response field should decrease', () => {
350
+ it('When the user selects the \'Decrease indent\' toolbar option, then the indentation of text in the response field should decrease in question', () => {
254
351
  essayResponsePage.steps.resetPreviewTabResponseField();
255
352
  essayResponsePage.steps.enterInputInResponseField('Lorem Ipsum');
256
353
  essayResponsePage.steps.selectPreviewTabToolbarOption('Increase Indent');
@@ -259,6 +356,22 @@ describe('Create question page - Essay Response: Customize formatting options (f
259
356
  essayResponsePage.steps.verifyResponseFieldHTML('<p>Lorem Ipsum</p>');
260
357
  });
261
358
 
359
+ it('When the user selects the \'Decrease indent\' toolbar option, then the indentation of text in the response field should decrease in question', () => {
360
+ essayResponsePage.steps.saveAQuestionAndVerifySnackbar();
361
+ essayResponsePage.steps.switchToPreviewTab();
362
+ essayResponsePage.steps.enterInputInResponseField('Lorem Ipsum');
363
+ essayResponsePage.steps.selectPreviewTabToolbarOption('Increase Indent');
364
+ essayResponsePage.steps.verifyResponseFieldHTML('<p style=\"margin-left: 40px;\">Lorem Ipsum</p>');
365
+ essayResponsePage.steps.selectPreviewTabToolbarOption('Decrease Indent');
366
+ essayResponsePage.steps.verifyResponseFieldHTML('<p>Lorem Ipsum</p>');
367
+ essayResponsePage.steps.switchToEditTab();
368
+ essayResponsePage.steps.clickOnEditQuestionButton();
369
+ essayResponsePage.steps.switchToPreviewTab();
370
+ essayResponsePage.steps.enterInputInResponseField('Lorem Ipsum');
371
+ essayResponsePage.steps.selectPreviewTabToolbarOption('Increase Indent');
372
+ essayResponsePage.steps.selectPreviewTabToolbarOption('Decrease Indent');
373
+ });
374
+
262
375
  essayResponsePage.tests.verifyUndoAndRedoFunctionalityForPreviewTabToolbarOption('Decrease Indent');
263
376
  });
264
377
  });
@@ -33,6 +33,31 @@ describe('Create question page - Essay Response: Customize formatting options (f
33
33
  essayResponsePage.tests.verifyUndoAndRedoFunctionalityForPreviewTabToolbarOption('Insert Horizontal Line');
34
34
  });
35
35
 
36
+ describe('Horizontal line formatting option - Item preview', () => {
37
+ abortEarlySetup();
38
+ before(() => {
39
+ essayResponsePage.steps.navigateToCreateQuestion('essay response');
40
+ cy.barsPreLoaderWait();
41
+ essayResponsePage.steps.expandCustomizeFormattingOptionsAccordion();
42
+ essayResponsePage.steps.selectCustomizedFormattingOption(['Insert Horizontal Line']);
43
+ essayResponsePage.steps.switchToPreviewTab();
44
+ essayResponsePage.steps.saveAQuestionAndVerifySnackbar();
45
+ essayResponsePage.steps.switchToPreviewTab();
46
+ essayResponsePage.steps.enterInputInResponseField('Lorem Ipsum');
47
+ });
48
+
49
+ it('When the user selects the \'Insert horizontal line\' toolbar option, a horizontal line should be inserted below from where the cursor is pointing in the response field, the \'Insert horizontal line\' toolbar option should not stay in selected state in item preview', () => {
50
+ essayResponsePage.steps.selectPreviewTabToolbarOption('Insert Horizontal Line');
51
+ essayResponsePage.steps.verifyResponseFieldHTML('<p>Lorem Ipsum</p><hr><p><br></p>');
52
+ essayResponsePage.steps.verifyPreviewTabToolbarOptionNotSelected('Insert Horizontal Line')
53
+ });
54
+
55
+ it('When the user hits \'backspace\', then the horizontal line should get removed in item preview', () => {
56
+ essayResponsePage.steps.enterInputInResponseField('{backspace}')
57
+ essayResponsePage.steps.verifyResponseFieldHTML('<p>Lorem Ipsum</p><p><br></p>');
58
+ });
59
+ });
60
+
36
61
  describe('Blockquote formatting option - Preview tab', () => {
37
62
  abortEarlySetup();
38
63
  before(() => {
@@ -49,6 +74,20 @@ describe('Create question page - Essay Response: Customize formatting options (f
49
74
  essayResponsePage.steps.verifyResponseFieldHTML('<blockquote><p>Lorem Ipsum</p></blockquote>')
50
75
  });
51
76
 
77
+ it('When the user selects the \'Blockquote\' toolbar option, then the text in the response field should appear as a block quote in item preview', () => {
78
+ essayResponsePage.steps.saveAQuestionAndVerifySnackbar();
79
+ essayResponsePage.steps.switchToPreviewTab();
80
+ essayResponsePage.steps.selectPreviewTabToolbarOption('Block Quote');
81
+ essayResponsePage.steps.enterInputInResponseField('Lorem Ipsum');
82
+ essayResponsePage.steps.verifyResponseFieldHTML('<blockquote><p>Lorem Ipsum</p></blockquote>');
83
+ essayResponsePage.steps.switchToEditTab();
84
+ essayResponsePage.steps.clickOnEditQuestionButton();
85
+ essayResponsePage.steps.switchToPreviewTab();
86
+ essayResponsePage.steps.selectPreviewTabToolbarOption('Block Quote');
87
+ essayResponsePage.steps.enterInputInResponseField('Lorem Ipsum');
88
+ essayResponsePage.steps.verifyResponseFieldHTML('<blockquote><p>Lorem Ipsum</p></blockquote>')
89
+ });
90
+
52
91
  it('When the user presses the \'Enter\' key and switches to a new line, then the \'Blockquote\' toolbar option should be in selected state and the block quote formatting should persist and user should be able to enter text in the next line', () => {
53
92
  essayResponsePage.steps.enterInputInResponseField('{enter}dolor sit amet');
54
93
  essayResponsePage.steps.verifyPreviewTabToolbarOptionSelected('Block Quote')
@@ -85,6 +124,25 @@ describe('Create question page - Essay Response: Customize formatting options (f
85
124
  essayResponsePage.steps.verifyPreviewTabToolbarOptionNotDisabled('Bold (Ctrl+B)');
86
125
  });
87
126
 
127
+ it('When the user selects the \'Code inline\' toolbar option, then the text entered in the response field should appear as a highlighted inline code text, the word count should also update and all the toolbar formatting options should be in enabled state in item preview', () => {
128
+ cy.log('Saving question to switch to item preview context.');
129
+ essayResponsePage.steps.saveAQuestionAndVerifySnackbar();
130
+ essayResponsePage.steps.switchToPreviewTab();
131
+ essayResponsePage.steps.selectPreviewTabToolbarOption('Code Inline');
132
+ essayResponsePage.steps.enterInputInResponseField('console.log()')
133
+ essayResponsePage.steps.verifyResponseFieldHTML('<p><code>​​​​​​​console.log()</code><br></p>');
134
+ essayResponsePage.steps.verifyWordCount('1');
135
+ //Just checking if Bold option is disabled or not, no need to check for all toolbar options
136
+ essayResponsePage.steps.verifyPreviewTabToolbarOptionNotDisabled('Bold (Ctrl+B)');
137
+ cy.log('Returning to edit mode.');
138
+ essayResponsePage.steps.switchToEditTab();
139
+ essayResponsePage.steps.clickOnEditQuestionButton();
140
+ essayResponsePage.steps.switchToPreviewTab();
141
+ essayResponsePage.steps.selectPreviewTabToolbarOption('Code Inline');
142
+ essayResponsePage.steps.enterInputInResponseField('console.log()')
143
+ essayResponsePage.steps.verifyResponseFieldHTML('<p><code>​​​​​​​console.log()</code><br></p>');
144
+ });
145
+
88
146
  //Comment: exceptional assertion of font size since in code inline font size is 14.4px
89
147
  it('CSS of \'highlighted inline code text\'', { tags: 'css' }, () => {
90
148
  utilities.verifyCSS(essayResponsePage.responseField().find('code'), {
@@ -203,6 +261,27 @@ describe('Create question page - Essay Response: Customize formatting options (f
203
261
  essayResponsePage.steps.verifyResponseFieldHTML('<p>Lorem Ipsum</p>');
204
262
  });
205
263
 
264
+ it('When the user applies Bold, Italic, Underline, Strikethrough and removes formatting in item preview, text should revert to default format', () => {
265
+ cy.log('Saving question to switch to item preview context.');
266
+ essayResponsePage.steps.saveAQuestionAndVerifySnackbar();
267
+ essayResponsePage.steps.switchToPreviewTab(); // item preview
268
+ // Recreate initial content
269
+ essayResponsePage.steps.resetPreviewTabResponseField();
270
+ essayResponsePage.steps.enterInputInResponseField('Lorem Ipsum{selectAll}');
271
+ essayResponsePage.steps.selectPreviewTabToolbarOption('Bold (Ctrl+B)');
272
+ essayResponsePage.steps.selectPreviewTabToolbarOption('Italic (Ctrl+I)');
273
+ essayResponsePage.steps.selectPreviewTabToolbarOption('Underline (Ctrl+U)');
274
+ essayResponsePage.steps.selectPreviewTabToolbarOption('Strikethrough');
275
+ essayResponsePage.steps.verifyResponseFieldHTML('<p><s><u><em><strong>Lorem Ipsum</strong></em></u></s></p>');
276
+ essayResponsePage.steps.selectPreviewTabToolbarOption('Remove Format');
277
+ essayResponsePage.steps.verifyResponseFieldHTML('<p>Lorem Ipsum</p>');
278
+ cy.log('Returning to edit mode.');
279
+ essayResponsePage.steps.switchToEditTab();
280
+ essayResponsePage.steps.clickOnEditQuestionButton();
281
+ essayResponsePage.steps.switchToPreviewTab();
282
+ essayResponsePage.steps.enterInputInResponseField('Lorem Ipsum{selectAll}');
283
+ });
284
+
206
285
  essayResponsePage.tests.verifyUndoAndRedoFunctionalityForPreviewTabToolbarOption('Remove Format');
207
286
 
208
287
  it('When the user has selected text in the response field and applies text formatting options - Superscript, Subscript and clicks on the \'Remove format\' toolbar option, then all the text formatting should get removed and the text should be displayed in default format', () => {
@@ -215,18 +294,36 @@ describe('Create question page - Essay Response: Customize formatting options (f
215
294
  essayResponsePage.steps.verifyResponseFieldHTML('<p>Lorem Ipsum<br></p>');
216
295
  });
217
296
 
297
+ it('When the user applies Superscript & Subscript and removes formatting in item preview, text should revert to default format', () => {
298
+ cy.log('Saving question to switch to item preview context for superscript/subscript removal.');
299
+ essayResponsePage.steps.saveAQuestionAndVerifySnackbar();
300
+ essayResponsePage.steps.switchToPreviewTab();
301
+ essayResponsePage.steps.resetPreviewTabResponseField();
302
+ essayResponsePage.steps.selectPreviewTabToolbarOption('Subscript');
303
+ essayResponsePage.steps.selectPreviewTabToolbarOption('Superscript');
304
+ essayResponsePage.steps.enterInputInResponseField('Lorem Ipsum{selectAll}');
305
+ essayResponsePage.steps.verifyResponseFieldHTML('<p><sub><sup>​​​​​​​Lorem Ipsum</sup></sub><br></p>');
306
+ essayResponsePage.steps.selectPreviewTabToolbarOption('Remove Format');
307
+ essayResponsePage.steps.verifyResponseFieldHTML('<p>Lorem Ipsum<br></p>');
308
+ cy.log('Returning to edit mode after item preview test.');
309
+ essayResponsePage.steps.switchToEditTab();
310
+ essayResponsePage.steps.clickOnEditQuestionButton();
311
+ essayResponsePage.steps.switchToPreviewTab();
312
+ essayResponsePage.steps.enterInputInResponseField('Lorem Ipsum{selectAll}');
313
+ });
314
+
218
315
  it('When the user has selected text in the response field and applies text formatting option - Align right/Center/Justify and clicks on the \'Remove format\' toolbar option, then all the text formatting should get removed and the text should be displayed in default format', () => {
219
316
  essayResponsePage.steps.selectPreviewTabToolbarOption('Align Right');
220
- essayResponsePage.steps.verifyResponseFieldHTML('<p style=\"text-align: right;\">Lorem Ipsum<br></p>');
317
+ essayResponsePage.steps.verifyResponseFieldHTML('<p style=\"text-align: right;\">Lorem Ipsum</p>');
221
318
  essayResponsePage.steps.selectPreviewTabToolbarOption('Remove Format')
222
- essayResponsePage.steps.verifyResponseFieldHTML('<p>Lorem Ipsum<br></p>');
319
+ essayResponsePage.steps.verifyResponseFieldHTML('<p>Lorem Ipsum</p>');
223
320
  });
224
321
 
225
322
  it('When the user has selected text in the response field and applies text formatting option - Code inline and clicks on the \'Remove format\' toolbar option, then all the text formatting should get removed and the text should be displayed in default format', () => {
226
323
  essayResponsePage.steps.selectPreviewTabToolbarOption('Code Inline');
227
- essayResponsePage.steps.verifyResponseFieldHTML('<p><code>Lorem Ipsum</code><br></p>');
324
+ essayResponsePage.steps.verifyResponseFieldHTML('<p><code>Lorem Ipsum</code></p>');
228
325
  essayResponsePage.steps.selectPreviewTabToolbarOption('Remove Format')
229
- essayResponsePage.steps.verifyResponseFieldHTML('<p>Lorem Ipsum<br></p>');
326
+ essayResponsePage.steps.verifyResponseFieldHTML('<p>Lorem Ipsum</p>');
230
327
  });
231
328
  });
232
329
 
@@ -108,6 +108,44 @@ describe('Create question page - Essay Response: Customize formatting options (f
108
108
  });
109
109
  });
110
110
 
111
+ describe('Font Size formatting option - Item preview', () => {
112
+ abortEarlySetup();
113
+ before(() => {
114
+ essayResponsePage.steps.navigateToCreateQuestion('essay response');
115
+ cy.barsPreLoaderWait();
116
+ essayResponsePage.steps.expandCustomizeFormattingOptionsAccordion();
117
+ essayResponsePage.steps.selectCustomizedFormattingOption(['Font size']);
118
+ essayResponsePage.steps.switchToPreviewTab();
119
+ essayResponsePage.steps.enterInputInResponseField('Lorem Ipsum');
120
+ essayResponsePage.steps.enterInputInResponseField('{selectAll}');
121
+ essayResponsePage.steps.saveAQuestionAndVerifySnackbar();
122
+ essayResponsePage.steps.switchToPreviewTab();
123
+ });
124
+
125
+ it('By default fontsize of response filed text is 16 px ', () => {
126
+ essayResponsePage.steps.verifyResponseFieldTextFontSizeNew(16);
127
+ });
128
+
129
+ it(`When the user selects the \'Font size\' toolbar option,then open a list of ${Object.keys(fontSizes).length} options - ${Object.keys(fontSizes).join(',')} is should be display and by default \'Default\' option should be selected`, () => {
130
+ essayResponsePage.steps.selectPreviewTabToolbarOption('Font Size');
131
+ Object.values(fontSizes).forEach((option) => {
132
+ essayResponsePage.steps.verifyFontSizeListContent(option);
133
+ });
134
+ essayResponsePage.steps.selectFontSizeOption(16);
135
+ essayResponsePage.steps.clearResponseField();
136
+ });
137
+
138
+ Object.values(fontSizes).forEach((option) => {
139
+ it(`When the user selects \'${option}\' option from the font size list, then font size of the response field text should be change to ${fontSizes[option]} accordingly`, () => {
140
+ essayResponsePage.steps.selectPreviewTabToolbarOption('Font Size');
141
+ essayResponsePage.steps.selectFontSizeOption(`${option}`);
142
+ essayResponsePage.steps.enterInputInResponseField('Lorem Ipsum');
143
+ essayResponsePage.steps.verifyResponseFieldTextFontSize(`${option}`);
144
+ essayResponsePage.steps.clearResponseField();
145
+ });
146
+ });
147
+ });
148
+
111
149
  describe('Highlight Text formatting option - Preview tab', () => {
112
150
  abortEarlySetup();
113
151
  before(() => {
@@ -218,6 +256,39 @@ describe('Create question page - Essay Response: Customize formatting options (f
218
256
  });
219
257
  });
220
258
 
259
+ describe('Clear All Controls - Item preview', () => {
260
+ abortEarlySetup();
261
+ before(() => {
262
+ essayResponsePage.steps.navigateToCreateQuestion('essay response');
263
+ cy.barsPreLoaderWait();
264
+ essayResponsePage.steps.expandCustomizeFormattingOptionsAccordion();
265
+ essayResponsePage.steps.selectCustomizedFormattingOption(['Clear All']);
266
+ essayResponsePage.steps.switchToPreviewTab();
267
+ essayResponsePage.steps.enterInputInResponseField('Lorem Ipsum');
268
+ essayResponsePage.steps.saveAQuestionAndVerifySnackbar();
269
+ essayResponsePage.steps.switchToPreviewTab();
270
+ });
271
+
272
+ it('When the user select the \'Highlight Text\' toolbar option,then a pop up should be display in item preview', () => {
273
+ essayResponsePage.steps.selectPreviewTabToolbarOption('Clear all');
274
+ utilities.verifyElementVisibilityState(essayResponsePage.dialogBox(), 'visible');
275
+ });
276
+
277
+ it('\'Are you sure you want to clear all text?\' message,\'Clear all\' title,\'Cancel\' and \'Clear all\' button should be visible in item preview', () => {
278
+ utilities.verifyTextContent(essayResponsePage.clearTextMessage(), 'Are you sure you want to clear all text?');
279
+ utilities.verifyElementVisibilityState(essayResponsePage.clearTextMessage(), 'visible');
280
+ utilities.verifyTextContent(essayResponsePage.clearAllLabel(), 'Clear all');
281
+ utilities.verifyElementVisibilityState(essayResponsePage.clearAllLabel(), 'visible');
282
+ utilities.verifyElementVisibilityState(essayResponsePage.cancelButton(), 'visible');
283
+ utilities.verifyElementVisibilityState(essayResponsePage.clearAllButton(), 'visible');
284
+ });
285
+
286
+ it('When the user click on \'Clear All\' button,no text should be display in item preview', () => {
287
+ essayResponsePage.steps.clickOnClearAllButton();
288
+ utilities.verifyTextContent(essayResponsePage.responseField(), '');
289
+ });
290
+ });
291
+
221
292
  describe('enable color picker - Preview tab', () => {
222
293
  abortEarlySetup();
223
294
  before(() => {
@@ -258,4 +329,47 @@ describe('Create question page - Essay Response: Customize formatting options (f
258
329
  essayResponsePage.steps.verifyResponseFieldTextColor(`${css.color.newResponseFieldColor}`);
259
330
  });
260
331
  });
332
+
333
+ describe('Enable color picker - Item preview', () => {
334
+ abortEarlySetup();
335
+ before(() => {
336
+ essayResponsePage.steps.navigateToCreateQuestion('essay response');
337
+ cy.barsPreLoaderWait();
338
+ essayResponsePage.steps.expandCustomizeFormattingOptionsAccordion();
339
+ essayResponsePage.steps.selectCustomizedFormattingOption(['Font Color']);
340
+ essayResponsePage.steps.clickOnEnableColorPickerCheckbox();
341
+ essayResponsePage.steps.switchToPreviewTab();
342
+ essayResponsePage.steps.enterInputInResponseField('Lorem Ipsum');
343
+ essayResponsePage.steps.saveAQuestionAndVerifySnackbar();
344
+ essayResponsePage.steps.switchToPreviewTab();
345
+ });
346
+
347
+ it('When the user checked \'Enable color picker\' checkbox,then \'Select color\' label, \'Selected color\' label,\'Cancel\' button and \'ok\' button should be display,and by default color option \'rgb(0, 0, 0)\' is selected in item preview', () => {
348
+ essayResponsePage.steps.selectPreviewTabToolbarOption('Text Color');
349
+ utilities.verifyInnerText(utilities.getNthElement(essayResponsePage.selectColorLabel(), 0), 'Select color');
350
+ utilities.verifyElementVisibilityState(utilities.getNthElement(essayResponsePage.selectColorLabel(), 0), 'visible');
351
+ utilities.verifyInnerText(utilities.getNthElement(essayResponsePage.selectColorLabel(), 1), 'Selected color');
352
+ utilities.verifyElementVisibilityState(utilities.getNthElement(essayResponsePage.selectColorLabel(), 1), 'visible');
353
+ utilities.verifyElementVisibilityState(colorPopupComponent.cancelButton(), 'visible');
354
+ utilities.verifyInnerText(colorPopupComponent.cancelButton(), 'Cancel');
355
+ utilities.verifyElementVisibilityState(colorPopupComponent.okButton(), 'visible');
356
+ utilities.verifyInnerText(colorPopupComponent.okButton(), 'Ok');
357
+ });
358
+
359
+ colorPopupComponent.tests.verifySaturationAndOpacityGradientPalette('rgb(0, 0, 0)');
360
+
361
+ it('When the user click \'Cancel\' button,then response field text color should not be change in item preview', () => {
362
+ colorPopupComponent.steps.clickOnCancelButton();
363
+ essayResponsePage.steps.verifyResponseFieldTextNewColor(`${css.color.text}`);
364
+ });
365
+
366
+ it('When the user select color using color palate and click on \'Ok\' button,then response field text color should change accordingly in item preview', () => {
367
+ essayResponsePage.steps.enterInputInResponseField(`{selectAll}{backspace}`);
368
+ essayResponsePage.steps.selectPreviewTabToolbarOption('Text Color');
369
+ colorPopupComponent.steps.clickInColorSaturationPalette();
370
+ colorPopupComponent.steps.clickOnOkButton();
371
+ essayResponsePage.steps.enterInputInResponseField('Lorem Ipsum');
372
+ essayResponsePage.steps.verifyResponseFieldTextColor(`${css.color.newResponseFieldColor}`);
373
+ });
374
+ });
261
375
  });
@@ -33,7 +33,7 @@ describe('Essay response: Customize math characters', () => {
33
33
  });
34
34
 
35
35
  it('By default the \'Special characters\' toolbar option should be in deselected state', () => {
36
- essayResponsePage.steps.verifyPreviewTabToolbarOptionNotSelected('Special characters');
36
+ essayResponsePage.steps.verifyPreviewTabToolbarOptionNotExpanded('Special characters');
37
37
  });
38
38
 
39
39
  it('When user clicks on \'Special characters\' toolbar option, then the \'Special characters\' popup should be displayed with \'Special characters\' title and a \'Close\' button', () => {
@@ -150,7 +150,7 @@ describe('Essay response: Customize math characters', () => {
150
150
  essayResponsePage.steps.closeWarningPopup();
151
151
  });
152
152
 
153
- it('When the user has specified custom special characters and opens the special characters popup in the preview tab, then only the specified custom special characters should be displayed in the popup', () => {
153
+ it('When the user has specified custom special characters and opens the special characters popup in the preview tab, then only the specified custom special characters should be displayed in the popup in question preview', () => {
154
154
  essayResponsePage.steps.switchToPreviewTab();
155
155
  essayResponsePage.steps.selectPreviewTabToolbarOption('Special characters');
156
156
  essayResponsePage.steps.verifyCustomSpecialCharactersDisplayedInPreviewTab(customSpecialCharacters);
@@ -158,6 +158,16 @@ describe('Essay response: Customize math characters', () => {
158
158
  essayResponsePage.steps.switchToEditTab();
159
159
  });
160
160
 
161
+ it('When the user has specified custom special characters and opens the special characters popup in the preview tab, then only the specified custom special characters should be displayed in the popup in item preview', () => {
162
+ essayResponsePage.steps.saveAQuestionAndVerifySnackbar();
163
+ essayResponsePage.steps.switchToPreviewTab();
164
+ essayResponsePage.steps.selectPreviewTabToolbarOption('Special characters');
165
+ essayResponsePage.steps.verifyCustomSpecialCharactersDisplayedInPreviewTab(customSpecialCharacters);
166
+ cy.log('Post-step: Switching to edit tab');
167
+ essayResponsePage.steps.switchToEditTab();
168
+ essayResponsePage.steps.clickOnEditQuestionButton();
169
+ });
170
+
161
171
  it('CSS of Customize special characters', { tags: 'css' }, () => {
162
172
  utilities.verifyCSS(essayResponsePage.customizeSpecialCharactersLabel(), {
163
173
  'color': css.color.labels,
@@ -221,7 +221,7 @@ describe('Essay Response Preview: Add Table Functionality', () => {
221
221
  });
222
222
  });
223
223
 
224
- describe('Add table with header row, highlighted column.', () => {
224
+ describe.only('Add table with header row, highlighted column.', () => {
225
225
  abortEarlySetup();
226
226
  before(() => {
227
227
  cy.log('Navigating to Essay Response question type and switching to preview tab.');
@@ -235,7 +235,7 @@ describe('Essay Response Preview: Add Table Functionality', () => {
235
235
  essayResponsePage.steps.selectPreviewTabToolbarOption('Insert Table');
236
236
  });
237
237
 
238
- it('When user checks the \'Add header row\' checkbox and then clicks on \'Add table\' button, the first row of the added table should be highlighted as table header', () => {
238
+ it('When user checks the \'Add header row\' checkbox and then clicks on \'Add table\' button, the first row of the added table should be highlighted as table header in question preview', () => {
239
239
  cy.log('Check the \'Add header row\' checkbox.');
240
240
  essayResponsePage.steps.checkAddRowHeaderCheckbox();
241
241
  essayResponsePage.steps.addTable();
@@ -245,7 +245,24 @@ describe('Essay Response Preview: Add Table Functionality', () => {
245
245
  essayResponsePage.steps.verifyTableNormalCellsAreNotHighlighted();
246
246
  });
247
247
 
248
- it('When user checks the \'Highlight first column\' checkbox and then clicks on \'Add table\' button, the first column of the added table should be highlighted.', () => {
248
+ it('When user checks the \'Add header row\' checkbox and then clicks on \'Add table\' button, the first row of the added table should be highlighted as table header in item preview', () => {
249
+ essayResponsePage.steps.addTable();
250
+ essayResponsePage.steps.saveAQuestionAndVerifySnackbar();
251
+ essayResponsePage.steps.switchToPreviewTab();
252
+ essayResponsePage.steps.enterInputInResponseField('{selectAll}{backspace}');
253
+ essayResponsePage.steps.selectPreviewTabToolbarOption('Insert Table');
254
+ essayResponsePage.steps.checkAddRowHeaderCheckbox();
255
+ essayResponsePage.steps.addTable();
256
+ essayResponsePage.steps.verifyTableHeaderRowCellCount(3);
257
+ essayResponsePage.steps.verifyTableProperties(2, 3, 3);
258
+ essayResponsePage.steps.verifyTableHeaderCellsAreHighlighted();
259
+ essayResponsePage.steps.verifyTableNormalCellsAreNotHighlighted();
260
+ essayResponsePage.steps.switchToEditTab();
261
+ essayResponsePage.steps.clickOnEditQuestionButton();
262
+ essayResponsePage.steps.switchToPreviewTab();
263
+ });
264
+
265
+ it('When user checks the \'Highlight first column\' checkbox and then clicks on \'Add table\' button, the first column of the added table should be highlighted in question preview.', () => {
249
266
  cy.log('Check the \'Highlight first column\' checkbox.');
250
267
  essayResponsePage.steps.checkHighlightFirstColumnCheckbox();
251
268
  essayResponsePage.steps.addTable();
@@ -255,6 +272,24 @@ describe('Essay Response Preview: Add Table Functionality', () => {
255
272
  essayResponsePage.steps.verifyTableNormalCellsAreNotHighlighted();
256
273
  });
257
274
 
275
+ it('When user checks the \'Highlight first column\' checkbox and then clicks on \'Add table\' button, the first column of the added table should be highlighted in item preview.', () => {
276
+ cy.log('Check the \'Highlight first column\' checkbox.');
277
+ essayResponsePage.steps.addTable();
278
+ essayResponsePage.steps.saveAQuestionAndVerifySnackbar();
279
+ essayResponsePage.steps.switchToPreviewTab();
280
+ essayResponsePage.steps.enterInputInResponseField('{selectAll}{backspace}');
281
+ essayResponsePage.steps.selectPreviewTabToolbarOption('Insert Table');
282
+ essayResponsePage.steps.checkHighlightFirstColumnCheckbox();
283
+ essayResponsePage.steps.addTable();
284
+ essayResponsePage.steps.verifyFirstColumnsIsHighlighted(2);
285
+ essayResponsePage.steps.verifyTableProperties(2, 4, 2);
286
+ essayResponsePage.steps.verifyTableHeaderCellsAreHighlighted();
287
+ essayResponsePage.steps.verifyTableNormalCellsAreNotHighlighted();
288
+ essayResponsePage.steps.switchToEditTab();
289
+ essayResponsePage.steps.clickOnEditQuestionButton();
290
+ essayResponsePage.steps.switchToPreviewTab();
291
+ });
292
+
258
293
  it('When user checks both \'Add header row\' and \'Highlight first column\' checkboxes and then clicks on \'Add table\' button, the first column and first row of the added table should be highlighted.', () => {
259
294
  cy.log('Check both \'Add header row\' and \'Highlight first column\' checkboxes.');
260
295
  essayResponsePage.steps.checkAddRowHeaderCheckbox();