itemengine-cypress-automation 1.0.104 → 1.0.106

Sign up to get free protection for your applications and to get access to all the features.
Files changed (87) hide show
  1. package/cypress/e2e/ILC/AudioResponseNew/gradingViewAndCorrectAnswerViewContents.smoke.js +129 -0
  2. package/cypress/e2e/ILC/AudioResponseNew/minimalRecorderStyle.js +482 -0
  3. package/cypress/e2e/ILC/AudioResponseNew/previewContentsForAllViews.smoke.js +123 -0
  4. package/cypress/e2e/ILC/AudioResponseNew/standardRecorderStyle.js +554 -0
  5. package/cypress/e2e/ILC/DrawingResponse/drawingResponseCustomizeAdditionalOptions.js +1 -41
  6. package/cypress/e2e/ILC/EditTabSettingPage/ItemPreviewSettingsTabContent.js +5 -3
  7. package/cypress/e2e/ILC/EssayResponse/editCategoryFlyout.js +284 -0
  8. package/cypress/e2e/ILC/EssayResponse/equationEditor.smoke.js +412 -0
  9. package/cypress/e2e/ILC/EssayResponse/equationEditorCategories1.js +203 -0
  10. package/cypress/e2e/ILC/EssayResponse/equationEditorCategories2.js +340 -0
  11. package/cypress/e2e/ILC/EssayResponse/essayResponseAdditionalSettings.js +432 -0
  12. package/cypress/e2e/ILC/EssayResponse/essayResponseAdditionalSettingsBasic.js +134 -0
  13. package/cypress/e2e/ILC/EssayResponse/essayResponseCustomizeFormattingOptions1.smoke.js +336 -0
  14. package/cypress/e2e/ILC/EssayResponse/essayResponseCustomizeFormattingOptions2.js +332 -0
  15. package/cypress/e2e/ILC/EssayResponse/essayResponseCustomizeFormattingOptions3.js +522 -0
  16. package/cypress/e2e/ILC/EssayResponse/essayResponseSpecialCharacters.js +253 -0
  17. package/cypress/e2e/ILC/EssayResponse/previewHyperlink.js +266 -0
  18. package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/backgroundImageAndCanvasProperties.js +57 -640
  19. package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/previewContentsForAllViews.smoke.js +1 -2
  20. package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/Scoring/allOrNothingAlternativePointsGreaterThanCorrectPoints.js +209 -0
  21. package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/Scoring/allOrNothingCorrectPointsEqualToAlternativePoints.js +209 -0
  22. package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/Scoring/allOrNothingCorrectPointsGreaterThanAlternativePoints.js +303 -0
  23. package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/Scoring/allOrNothingPenaltyScoring.js +68 -0
  24. package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/Scoring/partialEqualWeightsBasic.js +149 -0
  25. package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/Scoring/partialEqualWeightsWithAlternativePointsGreaterThanCorrectPoints.js +218 -0
  26. package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/Scoring/partialEqualWeightsWithCorrectPointsEqualToAlternativePoints.js +191 -0
  27. package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/Scoring/partialEqualWeightsWithCorrectPointsGreaterThanAlternativePoints.js +219 -0
  28. package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/allOrNothingForAllView.smoke.js +240 -0
  29. package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/checkAnswerFunctionalityForAllViews.smoke.js +124 -0
  30. package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/previewContentsForAllViews.smoke.js +107 -0
  31. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/Scoring/manuallyAndNonScored.js +1 -1
  32. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/Scoring/partialEqualWeightsBasic.js +0 -2
  33. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/backgroundImageAndCanvasProperties.js +408 -0
  34. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/editTabScoringSection.js +2 -2
  35. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/previewContentsForAllViews.smoke.js +1 -1
  36. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/responseAnswersAndAcceptedStudentInput.js +2 -2
  37. package/cypress/e2e/ILC/MultipleSelection/headerSection.js +1 -0
  38. package/cypress/e2e/ILC/MultipleSelection/studentViewSettings.js +0 -6
  39. package/cypress/e2e/ILC/Passage/multipageContentEditTab.js +242 -0
  40. package/cypress/e2e/ILC/Passage/passageAdditionalSettings.js +99 -0
  41. package/cypress/e2e/ILC/Passage/passageEditTab.js +241 -0
  42. package/cypress/e2e/ILC/Passage/passageHeaderSection.js +73 -0
  43. package/cypress/e2e/ILC/Passage/passagePreviewTab.js +246 -0
  44. package/cypress/e2e/ILC/ReadingRuler/readingRulerEditTabBasicsSection.js +138 -33
  45. package/cypress/e2e/ILC/ReadingRuler/readingRulerHeaderSection.js +30 -6
  46. package/cypress/e2e/ILC/ReadingRuler/readingRulerPreviewTab.js +167 -101
  47. package/cypress/e2e/ILC/ReadingRuler/readingrulerPreviewContents.smoke.js +1 -1
  48. package/cypress/e2e/ILC/SingleSelection/headerSection.js +20 -5
  49. package/cypress/e2e/ILC/SingleSelection/manuallyAndNonScoredScoring.js +1 -0
  50. package/cypress/e2e/ILC/TextEntryMath/editTabBasicSection.js +12 -7
  51. package/cypress/e2e/ILC/TextEntryMath/evaluationMethodEquivalentStructures.js +1336 -0
  52. package/cypress/e2e/ILC/TextEntryMath/evaluationMethodMatchExact.js +419 -0
  53. package/cypress/e2e/ILC/TextEntryMath/evaluationMethodMatchValue.js +443 -0
  54. package/cypress/e2e/ILC/TextEntryMath/evaluationMethodSymbolsAreEquivalent.js +411 -0
  55. package/cypress/e2e/ILC/TextEntryMath/evaluationMethodValueIsEquivalent.js +411 -0
  56. package/cypress/e2e/ILC/TextEntryMath/previewContentsForAllViews.smoke.js +45 -0
  57. package/cypress/e2e/ILC/TextEntryMath/responseEvaluationMethodsAndCustomSettings.js +3 -3
  58. package/cypress/fixtures/specialAndMathCharacters.js +2 -0
  59. package/cypress/fixtures/theme/ilc.json +4 -2
  60. package/cypress/pages/audioResponsePage.js +326 -165
  61. package/cypress/pages/components/additionalSettingsPanel.js +1 -1
  62. package/cypress/pages/components/autoScoredSpecifyCorrectAnswerSection.js +1 -1
  63. package/cypress/pages/components/backgroundImageUploadComponent.js +162 -2
  64. package/cypress/pages/components/colorPopupComponent.js +115 -26
  65. package/cypress/pages/components/customizeMathCharacterComponent.js +133 -0
  66. package/cypress/pages/components/customizeSpecialCharacterComponent.js +74 -4
  67. package/cypress/pages/components/editCategoryFlyout.js +164 -2
  68. package/cypress/pages/components/equationEditorFlyout.js +36 -1
  69. package/cypress/pages/components/essayResponseCommonComponents.js +0 -2
  70. package/cypress/pages/components/figOverImageCanvasComponent.js +587 -134
  71. package/cypress/pages/components/index.js +2 -1
  72. package/cypress/pages/components/playbackControlsBaseComponent.js +137 -2
  73. package/cypress/pages/correctAnswerViewPage.js +12 -1
  74. package/cypress/pages/drawingResponsePage.js +26 -151
  75. package/cypress/pages/essayResponseMathPage.js +28 -16
  76. package/cypress/pages/essayResponsePage.js +187 -7
  77. package/cypress/pages/fillInTheGapsOverImageDragAndDropPage.js +78 -14
  78. package/cypress/pages/fillInTheGapsOverImageDropdownPage.js +178 -221
  79. package/cypress/pages/fillInTheGapsOverImageTextPage.js +79 -0
  80. package/cypress/pages/multipleSelectionPage.js +1 -1
  81. package/cypress/pages/readingRulerPage.js +219 -104
  82. package/cypress/pages/singleSelectionPage.js +1 -0
  83. package/cypress/pages/textEntryMathPage.js +17 -6
  84. package/cypress/pages/videoResponsePage.js +0 -8
  85. package/deploy/smoke/run.sh +1 -1
  86. package/package.json +1 -1
  87. package/scripts/sorry-cypress.mjs +1 -1
@@ -0,0 +1,332 @@
1
+ import abortEarlySetup from "../../../support/helpers/abortEarly";
2
+ import { essayResponsePage } from "../../../pages";
3
+
4
+ describe('Create question page - Essay Response: Customize formatting options (for student player) toolbar options', () => {
5
+ before(() => {
6
+ cy.loginAs('admin');
7
+ });
8
+
9
+ describe('Bulleted list, Numbered list formatting options - Preview tab', () => {
10
+ abortEarlySetup();
11
+ before(() => {
12
+ essayResponsePage.steps.navigateToCreateQuestion('essay response');
13
+ cy.barsPreLoaderWait();
14
+ essayResponsePage.steps.expandCustomizeFormattingOptionsAccordion();
15
+ essayResponsePage.steps.selectCustomizedFormattingOption(['Undo', 'Redo']);
16
+ essayResponsePage.steps.switchToPreviewTab();
17
+ });
18
+
19
+ it('When the user types something in the response field and selects the \'Bulleted list\' toolbar option, then the entered text should appear as a bulleted list', () => {
20
+ essayResponsePage.responseField()
21
+ .type('Lorem Ipsum');
22
+ essayResponsePage.steps.selectPreviewTabToolbarOption('Insert/Remove Bulleted List');
23
+ essayResponsePage.responseField()
24
+ .verifyInnerHTML('<ul><li>Lorem Ipsum</li></ul>');
25
+ });
26
+
27
+ essayResponsePage.tests.verifyUndoAndRedoFunctionalityForPreviewTabToolbarOption('Insert/Remove Bulleted List');
28
+
29
+ //Comment: Here we are unable to verify the bullet point marker that appears since it is displayed using ::marker
30
+ 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', () => {
31
+ essayResponsePage.steps.resetPreviewTabResponseField();
32
+ essayResponsePage.steps.selectPreviewTabToolbarOption('Insert/Remove Bulleted List');
33
+ essayResponsePage.responseField()
34
+ .verifyInnerHTML('<ul><li><br></li></ul>');
35
+ essayResponsePage.responseField()
36
+ .type('Lorem Ipsum');
37
+ essayResponsePage.responseField()
38
+ .verifyInnerHTML('<ul><li>Lorem Ipsum</li></ul>');
39
+ });
40
+
41
+ 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', () => {
42
+ essayResponsePage.responseField()
43
+ .type('{enter}')
44
+ .find('li')
45
+ .should('have.length', 2);
46
+ essayResponsePage.responseField()
47
+ .type('dolor sit amet')
48
+ .verifyInnerHTML('<ul><li>Lorem Ipsum</li><li>dolor sit amet</li></ul>')
49
+ });
50
+
51
+ it('When the user presses the \'Enter\' key twice without typing anything in the new bullet point, then the \'Bulleted list\' toolbar option should get deselected, the list should end and the cursor should move out of the list', () => {
52
+ essayResponsePage.responseField()
53
+ .type('{enter}{enter}')
54
+ .find('li')
55
+ .should('have.length', 2);
56
+ essayResponsePage.previewTabToolbarOption('Insert/Remove Bulleted List')
57
+ .should('have.attr', 'aria-pressed', 'false');
58
+ essayResponsePage.responseField()
59
+ .verifyInnerHTML('<ul><li>Lorem Ipsum</li><li>dolor sit amet</li></ul><p><br></p>');
60
+ });
61
+
62
+ it('When the user types something in the response field and selects the \'Numbered list\' toolbar option, then the entered text should appear as a numbered list', () => {
63
+ essayResponsePage.steps.resetPreviewTabResponseField();
64
+ essayResponsePage.responseField()
65
+ .type('Lorem Ipsum');
66
+ essayResponsePage.steps.selectPreviewTabToolbarOption('Insert/Remove Numbered List');
67
+ essayResponsePage.responseField()
68
+ .verifyInnerHTML('<ol><li>Lorem Ipsum</li></ol>');
69
+ });
70
+
71
+ essayResponsePage.tests.verifyUndoAndRedoFunctionalityForPreviewTabToolbarOption('Insert/Remove Numbered List');
72
+
73
+ //Comment: Here we are unable to verify the number of the list item that appears since it is displayed using ::marker
74
+ 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', () => {
75
+ essayResponsePage.steps.resetPreviewTabResponseField();
76
+ essayResponsePage.steps.selectPreviewTabToolbarOption('Insert/Remove Numbered List');
77
+ essayResponsePage.responseField()
78
+ .verifyInnerHTML('<ol><li><br></li></ol>');
79
+ essayResponsePage.responseField()
80
+ .type('Lorem Ipsum');
81
+ essayResponsePage.responseField()
82
+ .verifyInnerHTML('<ol><li>Lorem Ipsum</li></ol>');
83
+ });
84
+
85
+ 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', () => {
86
+ essayResponsePage.responseField()
87
+ .type('{enter}')
88
+ .find('li')
89
+ .should('have.length', 2);
90
+ essayResponsePage.responseField()
91
+ .type('dolor sit amet')
92
+ .verifyInnerHTML('<ol><li>Lorem Ipsum</li><li>dolor sit amet</li></ol>')
93
+ });
94
+
95
+ it('When the user presses the \'Enter\' key again without typing anything in the second list item, then the \'Numbered list\' toolbar option should get deselected, the list should end and the cursor should move out of the list', () => {
96
+ essayResponsePage.responseField()
97
+ .type('{enter}{enter}')
98
+ .find('li')
99
+ .should('have.length', 2);
100
+ essayResponsePage.previewTabToolbarOption('Insert/Remove Numbered List')
101
+ .should('have.attr', 'aria-pressed', 'false');
102
+ essayResponsePage.responseField()
103
+ .verifyInnerHTML('<ol><li>Lorem Ipsum</li><li>dolor sit amet</li></ol><p><br></p>');
104
+ });
105
+
106
+ it('When user is typing in a bulleted list, switches to the next line and clicks on the \'Numbered list\' option, then the \'Bulleted list\' toolbar option should get deselected, the bulleted list should end and a numbered list should begin', () => {
107
+ essayResponsePage.steps.resetPreviewTabResponseField();
108
+ essayResponsePage.steps.selectPreviewTabToolbarOption('Insert/Remove Bulleted List');
109
+ essayResponsePage.responseField()
110
+ .type('Lorem Ipsum{enter}');
111
+ essayResponsePage.steps.selectPreviewTabToolbarOption('Insert/Remove Numbered List');
112
+ essayResponsePage.previewTabToolbarOption('Insert/Remove Bulleted List')
113
+ .should('have.attr', 'aria-pressed', 'false');
114
+ essayResponsePage.responseField()
115
+ .verifyInnerHTML('<ul><li>Lorem Ipsum</li></ul><ol><li><br></li></ol>');
116
+ });
117
+
118
+ it('When the user adds multi line text, selects the entered text and clicks on the \'Numbered list\' toolbar option, then the lines should get converted to a list', () => {
119
+ essayResponsePage.steps.resetPreviewTabResponseField();
120
+ essayResponsePage.responseField()
121
+ .type('Lorem Ipsum{enter}dolor sit amet{selectAll}');
122
+ essayResponsePage.steps.selectPreviewTabToolbarOption('Insert/Remove Numbered List');
123
+ essayResponsePage.responseField()
124
+ .verifyInnerHTML('<ol><li>Lorem Ipsum</li><li>dolor sit amet</li></ol>');
125
+ });
126
+ });
127
+
128
+ describe('Superscript, Subscript formatting options - Preview tab', () => {
129
+ abortEarlySetup();
130
+ before(() => {
131
+ essayResponsePage.steps.navigateToCreateQuestion('essay response');
132
+ cy.barsPreLoaderWait();
133
+ essayResponsePage.steps.expandCustomizeFormattingOptionsAccordion();
134
+ essayResponsePage.steps.selectCustomizedFormattingOption(['Subscript', 'Undo', 'Redo']);
135
+ essayResponsePage.steps.switchToPreviewTab();
136
+ essayResponsePage.responseField()
137
+ .type('log')
138
+ .should('have.text', 'log');
139
+ });
140
+
141
+ it('When the user selects the \'Superscript\' toolbar option and types something in the response field, then the text should be displayed as a Superscript', () => {
142
+ essayResponsePage.steps.selectPreviewTabToolbarOption('Superscript');
143
+ essayResponsePage.responseField()
144
+ .type('x')
145
+ .verifyInnerHTML('<p>log<sup>​​​​​​​x</sup></p>');
146
+ });
147
+
148
+ it('When the user deselects the \'Superscript\' toolbar option, then the subsequent text that the user enters should appear in default format', () => {
149
+ essayResponsePage.steps.deselectPreviewTabToolbarOption('Superscript');
150
+ essayResponsePage.responseField()
151
+ .type('y')
152
+ .verifyInnerHTML('<p>log<sup>x</sup>​​​​​​​y</p>');
153
+ });
154
+
155
+ it('When the user enters text in the response field, selects the text and then selects the \'Superscript\' toolbar option, then the should be displayed as a superscript and if the user deselects the \'Superscript\' toolbar option, then the entered text should be displayed in default format', () => {
156
+ essayResponsePage.steps.resetPreviewTabResponseField();
157
+ essayResponsePage.responseField()
158
+ .type('log{selectAll}');
159
+ essayResponsePage.steps.selectPreviewTabToolbarOption('Superscript');
160
+ essayResponsePage.responseField()
161
+ .verifyInnerHTML('<p><sup>log</sup></p>')
162
+ essayResponsePage.steps.deselectPreviewTabToolbarOption('Superscript');
163
+ essayResponsePage.responseField()
164
+ .verifyInnerHTML('<p>log</p>');
165
+ });
166
+
167
+ essayResponsePage.tests.verifyUndoAndRedoFunctionalityForPreviewTabToolbarOption('Superscript');
168
+
169
+ it('When the user selects the \'Subscript\' toolbar option, then the text entered in the response field should be displayed as a Subscript', () => {
170
+ essayResponsePage.steps.resetPreviewTabResponseField();
171
+ essayResponsePage.responseField()
172
+ .type('log')
173
+ .should('have.text', 'log');
174
+ essayResponsePage.steps.selectPreviewTabToolbarOption('Subscript');
175
+ essayResponsePage.responseField()
176
+ .type('e')
177
+ .verifyInnerHTML('<p>log<sub>​​​​​​​e</sub></p>');
178
+ });
179
+
180
+ it('When the user deselects the \'Subscript\' toolbar option, then the subsequent text that the user enters should appear in default format', () => {
181
+ essayResponsePage.steps.deselectPreviewTabToolbarOption('Subscript');
182
+ essayResponsePage.responseField()
183
+ .type('y')
184
+ .verifyInnerHTML('<p>log<sub>e</sub>​​​​​​​y</p>');
185
+ });
186
+
187
+ it('When the user enters text in the response field, selects the text and then selects the \'Subscript\' toolbar option, then the should be displayed as a subscript and if the user deselects the \'Subscript\' toolbar option, then the entered text should be displayed in default format', () => {
188
+ essayResponsePage.steps.resetPreviewTabResponseField();
189
+ essayResponsePage.responseField()
190
+ .type('log{selectAll}');
191
+ essayResponsePage.steps.selectPreviewTabToolbarOption('Subscript');
192
+ essayResponsePage.responseField()
193
+ .verifyInnerHTML('<p><sub>log</sub></p>')
194
+ essayResponsePage.steps.deselectPreviewTabToolbarOption('Subscript');
195
+ essayResponsePage.responseField()
196
+ .verifyInnerHTML('<p>log</p>');
197
+ });
198
+
199
+ essayResponsePage.tests.verifyUndoAndRedoFunctionalityForPreviewTabToolbarOption('Subscript');
200
+
201
+ it('The user should be able to enter mathemical statements that require a combination of both superscript and subscript (x raised to (log y to the base e)', () => {
202
+ essayResponsePage.steps.resetPreviewTabResponseField();
203
+ essayResponsePage.responseField()
204
+ .type('x')
205
+ .should('have.text', 'x');
206
+ essayResponsePage.steps.selectPreviewTabToolbarOption('Superscript');
207
+ essayResponsePage.responseField()
208
+ .type('log')
209
+ .verifyInnerHTML('<p>x<sup>​​​​​​​log</sup></p>');
210
+ essayResponsePage.steps.selectPreviewTabToolbarOption('Subscript');
211
+ essayResponsePage.responseField()
212
+ .type('e')
213
+ .verifyInnerHTML('<p>x<sup>log<sub>​​​​​​​e</sub></sup></p>');
214
+ essayResponsePage.steps.deselectPreviewTabToolbarOption('Subscript');
215
+ essayResponsePage.responseField()
216
+ .type('y')
217
+ .verifyInnerHTML('<p>x<sup>log<sub>e</sub>​​​​​​​y</sup></p>');
218
+ });
219
+ });
220
+
221
+ describe('Align left, Center, Align right, Justify formatting options - Preview tab', () => {
222
+ abortEarlySetup();
223
+ before(() => {
224
+ essayResponsePage.steps.navigateToCreateQuestion('essay response');
225
+ cy.barsPreLoaderWait();
226
+ essayResponsePage.steps.expandCustomizeFormattingOptionsAccordion();
227
+ essayResponsePage.steps.selectCustomizedFormattingOption(['Align Left', 'Align Center', 'Align Right', 'Align Justify', 'Undo', 'Redo']);
228
+ essayResponsePage.steps.switchToPreviewTab();
229
+ });
230
+
231
+ 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', () => {
232
+ essayResponsePage.responseField()
233
+ .click();
234
+ essayResponsePage.previewTabToolbarOption('Align Left')
235
+ .should('have.attr', 'aria-pressed', 'false');
236
+ essayResponsePage.previewTabToolbarOption('Align Center')
237
+ .should('have.attr', 'aria-pressed', 'false');
238
+ essayResponsePage.previewTabToolbarOption('Align Right')
239
+ .should('have.attr', 'aria-pressed', 'false');
240
+ essayResponsePage.previewTabToolbarOption('Align Justify')
241
+ .should('have.attr', 'aria-pressed', 'false');
242
+ essayResponsePage.responseField()
243
+ .type('Lorem Ipsum')
244
+ .verifyInnerHTML('<p>Lorem Ipsum</p>')
245
+ });
246
+
247
+ 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', () => {
248
+ essayResponsePage.steps.selectPreviewTabToolbarOption('Align Center');
249
+ essayResponsePage.responseField()
250
+ .verifyInnerHTML('<p style=\"text-align: center;\">Lorem Ipsum</p>')
251
+ essayResponsePage.previewTabToolbarOption('Align Left')
252
+ .should('have.attr', 'aria-pressed', 'false');
253
+ });
254
+
255
+ 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', () => {
256
+ essayResponsePage.steps.selectPreviewTabToolbarOption('Align Left');
257
+ essayResponsePage.responseField()
258
+ .verifyInnerHTML('<p style="text-align: left;">Lorem Ipsum</p>');
259
+ essayResponsePage.previewTabToolbarOption('Align Center')
260
+ .should('have.attr', 'aria-pressed', 'false');
261
+ });
262
+
263
+ 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', () => {
264
+ essayResponsePage.steps.selectPreviewTabToolbarOption('Align Right');
265
+ essayResponsePage.responseField()
266
+ .verifyInnerHTML('<p style=\"text-align: right;\">Lorem Ipsum</p>');
267
+ essayResponsePage.previewTabToolbarOption('Align Left')
268
+ .should('have.attr', 'aria-pressed', 'false');
269
+ });
270
+
271
+ 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', () => {
272
+ essayResponsePage.steps.deselectPreviewTabToolbarOption('Align Right');
273
+ essayResponsePage.responseField()
274
+ .verifyInnerHTML('<p>Lorem Ipsum</p>');
275
+ });
276
+
277
+ 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', () => {
278
+ essayResponsePage.steps.selectPreviewTabToolbarOption('Align Justify');
279
+ essayResponsePage.responseField()
280
+ .verifyInnerHTML('<p style="text-align: justify;">Lorem Ipsum</p>');
281
+ essayResponsePage.previewTabToolbarOption('Align Right')
282
+ .should('have.attr', 'aria-pressed', 'false');
283
+ });
284
+
285
+ it('When the user switches to the next line, \'Justify\' toolbar option should persist', () => {
286
+ essayResponsePage.responseField()
287
+ .type('{enter}');
288
+ essayResponsePage.previewTabToolbarOption('Align Justify');
289
+ });
290
+
291
+ //checking undo and redo functionality for one text alignment option only, not necessary to check for all
292
+ essayResponsePage.tests.verifyUndoAndRedoFunctionalityForPreviewTabToolbarOption('Align Right');
293
+ });
294
+
295
+ describe('Increase indent, Decrease indent formatting options - Preview tab', () => {
296
+ abortEarlySetup();
297
+ before(() => {
298
+ essayResponsePage.steps.navigateToCreateQuestion('essay response');
299
+ cy.barsPreLoaderWait();
300
+ essayResponsePage.steps.expandCustomizeFormattingOptionsAccordion();
301
+ essayResponsePage.steps.selectCustomizedFormattingOption(['Increase Indent', 'Decrease Indent', 'Undo', 'Redo']);
302
+ essayResponsePage.steps.switchToPreviewTab();
303
+ essayResponsePage.responseField()
304
+ .type('Lorem Ipsum');
305
+ });
306
+
307
+ it('When the user has not increased any indent, the \'Decrease indent\' toolbar option should be in disabled state', () => {
308
+ essayResponsePage.previewTabToolbarOption('Decrease Indent')
309
+ .should('have.attr', 'aria-disabled', 'true');
310
+ });
311
+
312
+ 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', () => {
313
+ essayResponsePage.previewTabToolbarOption('Increase Indent')
314
+ .click();
315
+ essayResponsePage.responseField()
316
+ .verifyInnerHTML('<p style=\"margin-left: 40px;\">Lorem Ipsum</p>');
317
+ essayResponsePage.previewTabToolbarOption('Decrease Indent')
318
+ .should('have.attr', 'aria-disabled', 'false');
319
+ });
320
+
321
+ essayResponsePage.tests.verifyUndoAndRedoFunctionalityForPreviewTabToolbarOption('Increase Indent');
322
+
323
+ it('When the user selects the \'Decrease indent\' toolbar option, then the indentation of text in the response field should decrease', () => {
324
+ essayResponsePage.previewTabToolbarOption('Decrease Indent')
325
+ .click();
326
+ essayResponsePage.responseField()
327
+ .verifyInnerHTML('<p>Lorem Ipsum</p>');
328
+ });
329
+
330
+ essayResponsePage.tests.verifyUndoAndRedoFunctionalityForPreviewTabToolbarOption('Decrease Indent');
331
+ });
332
+ });