itemengine-cypress-automation 1.0.574-IEI-7071-main-96a7dd4.0 → 1.0.574-IEI-7065-Improve-test-coverage-for-essay-response-1a8de95.0

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 (41) hide show
  1. package/cypress/e2e/ILC/EssayResponse/additionalSettings.js +8 -2
  2. package/cypress/e2e/ILC/EssayResponse/additionalSettingsBasic.js +15 -0
  3. package/cypress/e2e/ILC/EssayResponse/createCustomCategory.smoke.js +13 -0
  4. package/cypress/e2e/ILC/EssayResponse/editTabBasicSections.js +155 -5
  5. package/cypress/e2e/ILC/EssayResponse/essayResponseCustomizeFormattingOptions2.js +117 -4
  6. package/cypress/e2e/ILC/EssayResponse/essayResponseCustomizeFormattingOptions3.js +101 -4
  7. package/cypress/e2e/ILC/EssayResponse/essayResponseCustomizeFormattingOptions4.js +114 -0
  8. package/cypress/e2e/ILC/EssayResponse/essayResponseSpecialCharacters.js +12 -2
  9. package/cypress/e2e/ILC/EssayResponse/previewAddTable.js +38 -3
  10. package/cypress/e2e/ILC/EssayResponse/previewContentsForAllViews.smoke.js +41 -23
  11. package/cypress/e2e/ILC/EssayResponse/previewEditTable.js +78 -3
  12. package/cypress/e2e/ILC/EssayResponse/previewHyperlink.js +15 -0
  13. package/cypress/e2e/ILC/EssayResponse/studentViewSettings.js +71 -0
  14. package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/allOrNothingAlternativePointsGreaterThanCorrectPoints.js +7 -108
  15. package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/allOrNothingCorrectPointsEqualToAlternativePoints.js +7 -108
  16. package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/allOrNothingCorrectPointsGreaterThanAlternativePoints.js +7 -108
  17. package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/partialDifferentWeightsAlternativePointsGreaterThanCorrectPoints.js +8 -123
  18. package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/partialDifferentWeightsWithCorrectPointsEqualToAlternativePoints.js +8 -123
  19. package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/partialDifferentWeightsWithCorrectPointsGreaterThanAlternativePoints.js +8 -123
  20. package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/partialEqualWeightsWithAlternativePointsGreaterThanCorrectPoints.js +7 -108
  21. package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/partialEqualWeightsWithCorrectPointsEqualToAlternativePoints.js +6 -93
  22. package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/partialEqualWeightsWithCorrectPointsGreaterThanAlternativePoints.js +7 -108
  23. package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/responseLevelAlternateAnswersBasicScoring.js +2 -23
  24. package/cypress/e2e/ILC/ShortTextResponseNew/additionalSettings.js +2 -99
  25. package/cypress/e2e/ILC/ShortTextResponseNew/allOrNothingWithAlternativeAnswer.js +245 -0
  26. package/cypress/e2e/ILC/ShortTextResponseNew/editTabBasicSections.js +1 -55
  27. package/cypress/e2e/ILC/ShortTextResponseNew/{Scoring/manuallyAndNonScoredScoring.js → manuallyAndNonScoredScoring.js} +18 -6
  28. package/cypress/e2e/ILC/ShortTextResponseNew/responseAnswersAndAcceptedStudentInput.js +1 -151
  29. package/cypress/e2e/ILC/ShortTextResponseNew/specialCharactersSection.js +3 -3
  30. package/cypress/e2e/ILC/ShortTextResponseNew/studentViewSettings.js +1 -129
  31. package/cypress/pages/components/equationEditorSectionCommonComponent.js +20 -0
  32. package/cypress/pages/components/essayResponseCommonComponents.js +29 -1
  33. package/cypress/pages/components/fillInTheGapsTextCommonComponent.js +0 -36
  34. package/cypress/pages/components/printPreviewComponent.js +1 -8
  35. package/cypress/pages/essayResponsePage.js +3 -1
  36. package/cypress/pages/shortTextResponsePage.js +6 -195
  37. package/package.json +1 -1
  38. package/cypress/e2e/ILC/ShortTextResponseNew/Scoring/allOrNothingAlternativePointsGreaterThanCorrectPoints.js +0 -63
  39. package/cypress/e2e/ILC/ShortTextResponseNew/Scoring/allOrNothingCorrectPointsEqualToAlternativePoints.js +0 -63
  40. package/cypress/e2e/ILC/ShortTextResponseNew/Scoring/allOrNothingCorrectPointsGreaterThanAlternativePoints.js +0 -87
  41. package/cypress/e2e/ILC/ShortTextResponseNew/Scoring/allOrNothingWeightsBasic.js +0 -163
@@ -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();
@@ -1,8 +1,8 @@
1
- import { essayResponsePage, itemPreviewPage } from "../../../pages";
1
+ import { dialogBoxBase, essayResponsePage, gradingViewPage, itemPreviewPage, studentViewPage } from "../../../pages";
2
2
  import abortEarlySetup from "../../../support/helpers/abortEarly";
3
3
  import utilities from "../../../support/helpers/utilities";
4
4
  const css = Cypress.env('css');
5
- let previewContentViews = ['Question preview', 'Item preview', 'Student view'];
5
+ let previewContentViews = ['Question preview', 'Item preview', 'Student view', 'Grading view'];
6
6
  const views = utilities.getViews(previewContentViews);
7
7
  let itemReferenceID = "";
8
8
 
@@ -48,32 +48,50 @@ describe('Create item page - Essay response: Preview contents', () => {
48
48
  });
49
49
  };
50
50
 
51
- it(`When the user switches to Preview tab, then the following options should be displayed in the response field toolbar - ${defaultFormattingOptionsPreviewTab.join('')} along with a separator after ${defaultFormattingOptionsPreviewTab[7]} option`, () => {
52
- essayResponsePage.steps.verifyDefaultToolbarOptions(defaultFormattingOptionsPreviewTab, defaultFormattingOptionsPreviewTab[7]);
53
- });
51
+ if (view === 'Item preview') {
52
+ it(`When user switches to item preview then in preview tab 'manually scored' scoring label should be displayed`, () => {
53
+ essayResponsePage.steps.switchToPreviewTab();
54
+ essayResponsePage.steps.checkManuallyScoredScoringLabel();
55
+ });
56
+ };
54
57
 
55
- it('Word count should be displayed in the format \'Maximum 1000 words\'', () => {
56
- essayResponsePage.steps.verifyResponseFieldWordCount('Maximum 1000 words');
57
- });
58
+ if (view === 'Grading view') {
59
+ it(`When user switches to teacher grading view then balnk score should be displayed out of the points alloted by author`, () => {
60
+ studentViewPage.steps.submitResponse();
61
+ utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'visible');
62
+ studentViewPage.steps.clickOnGoToGradingViewButton();
63
+ gradingViewPage.steps.verifyGradingViewScore('', 10);
64
+ });
65
+ };
58
66
 
59
- it('When the user updates the formatting options and types something in the response field', () => {
60
- essayResponsePage.steps.selectPreviewTabToolbarOption('Bold (Ctrl+B)');
61
- essayResponsePage.steps.selectPreviewTabToolbarOption('Italic (Ctrl+I)');
62
- essayResponsePage.steps.selectPreviewTabToolbarOption('Underline (Ctrl+U)');
63
- essayResponsePage.steps.enterInputInResponseField('This is a test for grading view preview contents');
64
- essayResponsePage.responseField()
65
- .verifyInnerHTML('<p><strong><em><u>​​​​​​​This is a test for grading view preview contents</u></em></strong><br></p>');
66
- });
67
+ if (view !== 'Grading view') {
68
+ it(`When the user switches to Preview tab, then the following options should be displayed in the response field toolbar - ${defaultFormattingOptionsPreviewTab.join('')} along with a separator after ${defaultFormattingOptionsPreviewTab[7]} option`, () => {
69
+ essayResponsePage.steps.verifyDefaultToolbarOptions(defaultFormattingOptionsPreviewTab, defaultFormattingOptionsPreviewTab[7]);
70
+ });
67
71
 
68
- it('CSS of formatting options in Preview tab', { tags: 'css' }, () => {
69
- utilities.verifyCSS(essayResponsePage.previewTabToolbarOption('Bold (Ctrl+B)').find('.cke_button_icon'), {
70
- 'color': css.color.activeButtons
72
+ it('Word count should be displayed in the format \'Maximum 1000 words\'', () => {
73
+ essayResponsePage.steps.verifyResponseFieldWordCount('Maximum 1000 words');
71
74
  });
72
- });
73
75
 
74
- it('Accessibility of formatting options in Preview tab', { tags: 'a11y' }, () => {
75
- cy.checkAccessibility(essayResponsePage.previewTabToolbarWrapper());
76
- });
76
+ it('When the user updates the formatting options and types something in the response field', () => {
77
+ essayResponsePage.steps.selectPreviewTabToolbarOption('Bold (Ctrl+B)');
78
+ essayResponsePage.steps.selectPreviewTabToolbarOption('Italic (Ctrl+I)');
79
+ essayResponsePage.steps.selectPreviewTabToolbarOption('Underline (Ctrl+U)');
80
+ essayResponsePage.steps.enterInputInResponseField('This is a test for grading view preview contents');
81
+ essayResponsePage.responseField()
82
+ .verifyInnerHTML('<p><strong><em><u>​​​​​​​This is a test for grading view preview contents</u></em></strong><br></p>');
83
+ });
84
+
85
+ it('CSS of formatting options in Preview tab', { tags: 'css' }, () => {
86
+ utilities.verifyCSS(essayResponsePage.previewTabToolbarOption('Bold (Ctrl+B)').find('.cke_button_icon'), {
87
+ 'color': css.color.activeButtons
88
+ });
89
+ });
90
+
91
+ it('Accessibility of formatting options in Preview tab', { tags: 'a11y' }, () => {
92
+ cy.checkAccessibility(essayResponsePage.previewTabToolbarWrapper());
93
+ });
94
+ }
77
95
  });
78
96
  });
79
97
  });
@@ -135,7 +135,7 @@ describe('Essay Response Preview: Edit Table functionality', () => {
135
135
  });
136
136
  });
137
137
 
138
- describe('Columns section \'Insert Before\', \'Insert After\' and \'Delete Column\' button functionality.', () => {
138
+ describe.only('Columns section \'Insert Before\', \'Insert After\' and \'Delete Column\' button functionality.', () => {
139
139
  abortEarlySetup();
140
140
  before(() => {
141
141
  cy.log('Navigating to Essay Response and switching to preview tab.');
@@ -199,7 +199,7 @@ describe('Essay Response Preview: Edit Table functionality', () => {
199
199
  });
200
200
  });
201
201
 
202
- describe('Rows section \'Insert Above\', \'Insert Below\' and \'Delete Row\' button functionality.', () => {
202
+ describe.only('Rows section \'Insert Above\', \'Insert Below\' and \'Delete Row\' button functionality.', () => {
203
203
  abortEarlySetup();
204
204
  before(() => {
205
205
  cy.log('Navigating to Essay Response and switching to preview tab.');
@@ -240,6 +240,30 @@ describe('Essay Response Preview: Edit Table functionality', () => {
240
240
  essayResponsePage.steps.verifyContentOfTableStandardCell(3, 'Standard cell');
241
241
  });
242
242
 
243
+ it('When user clicks on \'Insert Above\' button then a new identical row should be inserted above (item preview)', () => {
244
+ cy.log('Saving question to switch to item preview context.');
245
+ essayResponsePage.steps.saveAQuestionAndVerifySnackbar();
246
+ essayResponsePage.steps.switchToPreviewTab(); // Item preview context
247
+ cy.log('Right clicking in header cell to open edit table flyout.');
248
+ essayResponsePage.steps.openEditTablePopupThroughHeaderCell(0);
249
+ essayResponsePage.steps.clickOnEditTableInsertAboveButton();
250
+ cy.log('Opening flyout through a standard cell to insert another row above it.');
251
+ essayResponsePage.steps.openEditTablePopupThroughNormalCell(1);
252
+ essayResponsePage.steps.clickOnEditTableInsertAboveButton();
253
+ essayResponsePage.steps.verifyTableHeaderRowCellCount(6);
254
+ essayResponsePage.steps.verifyTableRowHeaderCellCount(0, 3);
255
+ essayResponsePage.steps.verifyTableRowHeaderCellCount(1, 3);
256
+ essayResponsePage.steps.verifyTableRowHeaderCellCount(2, 1);
257
+ essayResponsePage.steps.verifyTableRowStandardCellCount(2, 2);
258
+ essayResponsePage.steps.verifyTableRowHeaderCellCount(3, 1);
259
+ essayResponsePage.steps.verifyTableRowStandardCellCount(3, 2);
260
+ essayResponsePage.steps.verifyContentOfTableHeaderCell(7, 'Header cell');
261
+ essayResponsePage.steps.verifyContentOfTableStandardCell(3, 'Standard cell');
262
+ cy.log('Returning to edit mode for subsequent tests.');
263
+ essayResponsePage.steps.switchToEditTab();
264
+ essayResponsePage.steps.clickOnEditQuestionButton();
265
+ });
266
+
243
267
  it('When user clicks on \'Insert Below\' button, then a new row should be inserted below the row in which the user had focused. Also the newly inserted row should be identical to the row in which user had focused.', () => {
244
268
  cy.log('Pre-step: Right click in the required cell to open edit table flyout.');
245
269
  essayResponsePage.steps.openEditTablePopupThroughHeaderCell(0);
@@ -259,6 +283,28 @@ describe('Essay Response Preview: Edit Table functionality', () => {
259
283
  essayResponsePage.steps.verifyContentOfTableStandardCell(1, 'Standard cell');
260
284
  });
261
285
 
286
+ it('When user clicks on \'Insert Below\' button then a new identical row should be inserted below (item preview)', () => {
287
+ cy.log('Saving question to switch to item preview context.');
288
+ essayResponsePage.steps.saveAQuestionAndVerifySnackbar();
289
+ essayResponsePage.steps.switchToPreviewTab();
290
+ essayResponsePage.steps.openEditTablePopupThroughHeaderCell(0);
291
+ essayResponsePage.steps.clickOnEditTableInsertBelowButton();
292
+ essayResponsePage.steps.openEditTablePopupThroughNormalCell(1);
293
+ essayResponsePage.steps.clickOnEditTableInsertBelowButton();
294
+ essayResponsePage.steps.verifyTableHeaderRowCellCount(6);
295
+ essayResponsePage.steps.verifyTableRowHeaderCellCount(0, 3);
296
+ essayResponsePage.steps.verifyTableRowHeaderCellCount(1, 3);
297
+ essayResponsePage.steps.verifyTableRowHeaderCellCount(2, 1);
298
+ essayResponsePage.steps.verifyTableRowStandardCellCount(2, 2);
299
+ essayResponsePage.steps.verifyTableRowHeaderCellCount(3, 1);
300
+ essayResponsePage.steps.verifyTableRowStandardCellCount(3, 2);
301
+ essayResponsePage.steps.verifyContentOfTableHeaderCell(6, 'Header cell');
302
+ essayResponsePage.steps.verifyContentOfTableStandardCell(1, 'Standard cell');
303
+ cy.log('Returning to edit mode for subsequent tests.');
304
+ essayResponsePage.steps.switchToEditTab();
305
+ essayResponsePage.steps.clickOnEditQuestionButton();
306
+ });
307
+
262
308
  it('When user clicks on \'Delete Row\' button then, the row in which it had focused should be deleted.', () => {
263
309
  cy.log('Pre-step: Right click in the required cell to open edit table flyout.');
264
310
  essayResponsePage.steps.openEditTablePopupThroughHeaderCell(0);
@@ -270,6 +316,22 @@ describe('Essay Response Preview: Edit Table functionality', () => {
270
316
  essayResponsePage.steps.verifyContentOfTableStandardCell(1, 'Standard cell');
271
317
  });
272
318
 
319
+ it('When user clicks on \'Delete Row\' button then the focused row should be deleted (item preview)', () => {
320
+ cy.log('Saving question to switch to item preview context.');
321
+ essayResponsePage.steps.saveAQuestionAndVerifySnackbar();
322
+ essayResponsePage.steps.switchToPreviewTab();
323
+ essayResponsePage.steps.openEditTablePopupThroughHeaderCell(0);
324
+ essayResponsePage.steps.clickOnEditTableDeleteRowButton();
325
+ essayResponsePage.steps.verifyTableRowCount(1);
326
+ essayResponsePage.steps.verifyTableRowHeaderCellCount(0, 1);
327
+ essayResponsePage.steps.verifyTableRowStandardCellCount(0, 2);
328
+ essayResponsePage.steps.verifyContentOfTableHeaderCell(0, 'Header cell');
329
+ essayResponsePage.steps.verifyContentOfTableStandardCell(1, 'Standard cell');
330
+ cy.log('Returning to edit mode for subsequent tests.');
331
+ essayResponsePage.steps.switchToEditTab();
332
+ essayResponsePage.steps.clickOnEditQuestionButton();
333
+ });
334
+
273
335
  it('When user deletes the header row by clicking on the \'Delete Row\' button, then in edit table flyout the \'Add Header Row\' checkbox should be unchecked.', () => {
274
336
  cy.log('Pre-step: Right click in the required cell to open edit table flyout and click on Delete Row button.');
275
337
  essayResponsePage.steps.openEditTablePopupThroughHeaderCell(0);
@@ -277,9 +339,22 @@ describe('Essay Response Preview: Edit Table functionality', () => {
277
339
  essayResponsePage.steps.openEditTablePopupThroughNormalCell(0);
278
340
  essayResponsePage.steps.verifyUncheckedStateOfEditTableAddRowHeaderCheckbox();
279
341
  });
342
+
343
+ it('When header row is deleted then the Add Header Row checkbox should be unchecked (item preview)', () => {
344
+ cy.log('Saving question to switch to item preview context.');
345
+ essayResponsePage.steps.saveAQuestionAndVerifySnackbar();
346
+ essayResponsePage.steps.switchToPreviewTab();
347
+ essayResponsePage.steps.openEditTablePopupThroughHeaderCell(0);
348
+ essayResponsePage.steps.clickOnEditTableDeleteRowButton();
349
+ essayResponsePage.steps.openEditTablePopupThroughNormalCell(0);
350
+ essayResponsePage.steps.verifyUncheckedStateOfEditTableAddRowHeaderCheckbox();
351
+ cy.log('Returning to edit mode for subsequent tests.');
352
+ essayResponsePage.steps.switchToEditTab();
353
+ essayResponsePage.steps.clickOnEditQuestionButton();
354
+ });
280
355
  });
281
356
 
282
- describe('Edit \'Add header row\' and \'Highlight first column\' checkboxes.', () => {
357
+ describe.only('Edit \'Add header row\' and \'Highlight first column\' checkboxes.', () => {
283
358
  abortEarlySetup();
284
359
  before(() => {
285
360
  cy.log('Navigating to Essay Response and switching to preview tab.');
@@ -161,6 +161,21 @@ describe('Essay Response Preview: Hyperlink', () => {
161
161
  utilities.verifyInnerText(essayResponsePage.previewInputFieldHyperlinkText(), 'Link')
162
162
  });
163
163
 
164
+ it('When user adds both \'Display text\' as well as \'URL\' in the hyperlink popup and clicks on Ok button, then the hyperlink with the added display text and URL should be displayed in the response field of item preview', () => {
165
+ essayResponsePage.steps.saveAQuestionAndVerifySnackbar();
166
+ essayResponsePage.steps.switchToPreviewTab();
167
+ essayResponsePage.steps.selectPreviewTabToolbarOption('Insert Hyperlink');
168
+ essayResponsePage.steps.enterTextInHyperlinkDialogboxDisplayTextInputField('Link');
169
+ essayResponsePage.steps.enterTextInHyperlinkDialogBoxURLInputField(`${Cypress.config().baseUrl}`);
170
+ essayResponsePage.steps.clickOnHyperLinkDialogBoxOkButton();
171
+ utilities.verifyInnerText(essayResponsePage.previewInputFieldHyperlinkText(), 'Link')
172
+ essayResponsePage.steps.switchToEditTab();
173
+ essayResponsePage.steps.clickOnEditQuestionButton();
174
+ essayResponsePage.steps.switchToPreviewTab();
175
+ essayResponsePage.steps.selectPreviewTabToolbarOption('Insert Hyperlink');
176
+ essayResponsePage.steps.enterTextInHyperlinkDialogboxDisplayTextInputField('Link');
177
+ });
178
+
164
179
  it('CSS of the hyperlink in response field', { tags: 'css' }, () => {
165
180
  utilities.verifyCSS(essayResponsePage.previewInputFieldHyperlinkText(), {
166
181
  'color': css.color.linkText,
@@ -123,6 +123,53 @@ describe('Create Item page - Short text response : Student view settings', () =>
123
123
  });
124
124
  });
125
125
 
126
+ describe('Student view settings : Display character count, Display word count - Item preview functionality', () => {
127
+ abortEarlySetup();
128
+ before(() => {
129
+ essayResponsePage.steps.navigateToCreateQuestion('essay response');
130
+ cy.barsPreLoaderWait();
131
+ essayResponsePage.steps.checkCharacterRadioButton();
132
+ });
133
+
134
+ it('When \'Display character count\' checkbox is unchecked, then \'Character\' label and count should not be displayed in item preview', () => {
135
+ essayResponsePage.steps.verifyDisplayCharacterCountCheckboxUnchecked();
136
+ essayResponsePage.steps.saveAQuestionAndVerifySnackbar();
137
+ essayResponsePage.steps.switchToPreviewTab();
138
+ utilities.verifyElementVisibilityState(essayResponsePage.characterWordCountLabelPreviewTab(), 'hidden');
139
+ });
140
+
141
+ it('When \'Display character count\' checkbox is checked, then on switching to preview tab \'Character\' label and count should be displayed and count should be zero by default in item preview', () => {
142
+ essayResponsePage.steps.switchToEditTab();
143
+ essayResponsePage.steps.clickOnEditQuestionButton();
144
+ essayResponsePage.steps.checkDisplayCharacterCountCheckbox();
145
+ essayResponsePage.steps.saveAQuestionAndVerifySnackbar();
146
+ essayResponsePage.steps.switchToPreviewTab();
147
+ utilities.verifyInnerText(essayResponsePage.characterWordCountLabelPreviewTab(), 'Characters: 0');
148
+ utilities.verifyElementVisibilityState(essayResponsePage.characterWordCountLabelPreviewTab(), 'visible');
149
+ });
150
+
151
+ it('When user enters text in response field, then character count should be updated in item preview', () => {
152
+ essayResponsePage.steps.enterTextInResponseField('Flowers are blooming');
153
+ utilities.verifyInnerText(essayResponsePage.characterWordCountLabelPreviewTab(), 'Characters: 18');
154
+ });
155
+
156
+ it('When user selects word in set limit section and checks \'Display word count\' checkbox , then \'Word\' label and count should be displayed in item preview', () => {
157
+ essayResponsePage.steps.switchToEditTab();
158
+ essayResponsePage.steps.clickOnEditQuestionButton();
159
+ essayResponsePage.steps.selectWordRadioButton();
160
+ essayResponsePage.steps.checkDisplayWordCountCheckbox();
161
+ essayResponsePage.steps.saveAQuestionAndVerifySnackbar();
162
+ essayResponsePage.steps.switchToPreviewTab();
163
+ utilities.verifyInnerText(essayResponsePage.characterWordCountLabelPreviewTab(), 'Words: 0');
164
+ utilities.verifyElementVisibilityState(essayResponsePage.characterWordCountLabelPreviewTab(), 'visible');
165
+ });
166
+
167
+ it('When user enters text in response field, then character count should be updated in item preview', () => {
168
+ essayResponsePage.steps.enterTextInResponseField('Flowers are blooming');
169
+ utilities.verifyInnerText(essayResponsePage.characterWordCountLabelPreviewTab(), 'Words: 3');
170
+ });
171
+ });
172
+
126
173
  describe('Student view settings : Spell check - Preview tab functionality', () => {
127
174
  abortEarlySetup();
128
175
  before(() => {
@@ -143,4 +190,28 @@ describe('Create Item page - Short text response : Student view settings', () =>
143
190
  essayResponsePage.steps.verifySpellCheckOfResponseFieldPreviewTabEnabled();
144
191
  });
145
192
  });
193
+
194
+ describe('Student view settings : Spell check - Item preview', () => {
195
+ abortEarlySetup();
196
+ before(() => {
197
+ essayResponsePage.steps.navigateToCreateQuestion('essay response');
198
+ cy.barsPreLoaderWait();
199
+ essayResponsePage.steps.uncheckSpellCheckCheckbox();
200
+ essayResponsePage.steps.saveAQuestionAndVerifySnackbar();
201
+ essayResponsePage.steps.switchToPreviewTab();
202
+ });
203
+
204
+ it('When the \'Spell check\' checkbox is unchecked, the response field should have \'spellcheck\' attribute set as \'false\' in item preview', () => {
205
+ essayResponsePage.steps.verifySpellCheckOfResponseFieldPreviewTabDisabled();
206
+ });
207
+
208
+ it('When the \'Spell check\' checkbox is checked, the response field should have \'spellcheck\' attribute set as \'true\' in item preview', () => {
209
+ essayResponsePage.steps.switchToEditTab();
210
+ essayResponsePage.steps.clickOnEditQuestionButton();
211
+ essayResponsePage.steps.checkSpellCheckCheckbox();
212
+ essayResponsePage.steps.saveAQuestionAndVerifySnackbar();
213
+ essayResponsePage.steps.switchToPreviewTab();
214
+ essayResponsePage.steps.verifySpellCheckOfResponseFieldPreviewTabEnabled();
215
+ });
216
+ });
146
217
  });