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
@@ -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
  });