itemengine-cypress-automation 1.0.113 → 1.0.115

Sign up to get free protection for your applications and to get access to all the features.
Files changed (52) hide show
  1. package/cypress/e2e/ILC/AudioResponseNew/barRecorderStyle.js +489 -0
  2. package/cypress/e2e/ILC/AudioResponseNew/compactRecorderStyle.js +482 -0
  3. package/cypress/e2e/ILC/AudioResponseNew/customizePlaybackControls.js +488 -0
  4. package/cypress/e2e/ILC/AudioResponseNew/editAndPreviewTabScoringSection.js +92 -0
  5. package/cypress/e2e/ILC/AudioResponseNew/editTabBasicSection.js +229 -0
  6. package/cypress/e2e/ILC/AudioResponseNew/gradingViewAndCorrectAnswerViewContents.smoke.js +1 -1
  7. package/cypress/e2e/ILC/AudioResponseNew/headerSection.js +67 -0
  8. package/cypress/e2e/ILC/AudioResponseNew/previewContentsForAllViews.smoke.js +1 -1
  9. package/cypress/e2e/ILC/AudioResponseNew/standardRecorderStyle.js +11 -11
  10. package/cypress/e2e/ILC/AudioResponseNew/studentViewSettings.js +529 -0
  11. package/cypress/e2e/ILC/EssayResponse/essayResponseCustomizeFormattingOptions1.smoke.js +108 -190
  12. package/cypress/e2e/ILC/EssayResponse/essayResponseCustomizeFormattingOptions2.js +83 -155
  13. package/cypress/e2e/ILC/EssayResponse/essayResponseCustomizeFormattingOptions3.js +104 -315
  14. package/cypress/e2e/ILC/EssayResponseBasic/essayResponseBasicCustomizeFormattingOptions.js +121 -135
  15. package/cypress/e2e/ILC/EssayResponseMath/createItem.js +17 -0
  16. package/cypress/e2e/ILC/EssayResponseMath/mathCharacters.js +203 -0
  17. package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/Scoring/manuallyAndNonScored.js +121 -0
  18. package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/Scoring/partialDifferentWeightsAlternativePointsGreaterThanCorrectPoints.js +236 -0
  19. package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/Scoring/partialDifferentWeightsBasic.js +255 -0
  20. package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/Scoring/partialDifferentWeightsWithCorrectPointsEqualToAlternativePoints.js +237 -0
  21. package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/Scoring/partialDifferentWeightsWithCorrectPointsGreaterThanAlternativePoints.js +236 -0
  22. package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/Scoring/partialEqualWeightsWithAlternativePointsGreaterThanCorrectPoints.js +2 -2
  23. package/cypress/e2e/ILC/ShortTextResponseNew/additionalSettings.js +43 -0
  24. package/cypress/e2e/ILC/ShortTextResponseNew/allOrNothingBasicForAllViews.smoke.js +187 -0
  25. package/cypress/e2e/ILC/ShortTextResponseNew/allOrNothingWithAlternativeAnswer.js +245 -0
  26. package/cypress/e2e/ILC/ShortTextResponseNew/checkAnswerFunctionalityForAllViews.smoke.js +99 -0
  27. package/cypress/e2e/ILC/ShortTextResponseNew/editTabScoringSection.js +97 -0
  28. package/cypress/e2e/ILC/ShortTextResponseNew/headerSection.js +74 -0
  29. package/cypress/e2e/ILC/ShortTextResponseNew/manuallyAndNonScoredScoring.js +83 -0
  30. package/cypress/e2e/ILC/ShortTextResponseNew/previewContentsForAllViews.smoke.js +109 -0
  31. package/cypress/e2e/ILC/ShortTextResponseNew/specifyCorrectAnswerSection.js +66 -0
  32. package/cypress/e2e/ILC/TextEntryMath/allOrNothingBasicForAllViews.smoke.js +326 -0
  33. package/cypress/e2e/ILC/TextEntryMath/checkAnswerFunctionalityForAllViews.smoke.js +163 -0
  34. package/cypress/e2e/ILC/TextEntryMath/evaluationMethodEquivalentStructures.js +8 -8
  35. package/cypress/e2e/ILC/TextEntryMath/evaluationMethodValueIsEquivalent.js +3 -3
  36. package/cypress/e2e/ILC/TextEntryMath/previewContentsForAllViews.smoke.js +154 -0
  37. package/cypress/pages/audioResponsePage.js +523 -66
  38. package/cypress/pages/components/autoScoredScoringPreviewTab.js +2 -0
  39. package/cypress/pages/components/autoScoredSpecifyCorrectAnswerSection.js +6 -5
  40. package/cypress/pages/components/equationEditorFlyout.js +11 -0
  41. package/cypress/pages/components/essayResponseCommonComponents.js +290 -19
  42. package/cypress/pages/components/figOverImageCanvasComponent.js +1 -1
  43. package/cypress/pages/components/maximumRecorderLengthComponent.js +32 -15
  44. package/cypress/pages/components/playbackControlsBaseComponent.js +9 -1
  45. package/cypress/pages/components/questionInputFieldComponent.js +0 -7
  46. package/cypress/pages/dragAndDropIntoCategoriesPage.js +3 -3
  47. package/cypress/pages/essayResponseBasicPage.js +1 -26
  48. package/cypress/pages/essayResponsePage.js +21 -284
  49. package/cypress/pages/shortTextResponsePage.js +142 -103
  50. package/cypress/pages/textEntryMathPage.js +58 -7
  51. package/package.json +1 -1
  52. package/scripts/sorry-cypress.mjs +1 -1
@@ -1,5 +1,6 @@
1
1
  import abortEarlySetup from "../../../support/helpers/abortEarly";
2
2
  import { essayResponsePage } from "../../../pages";
3
+ import utilities from "../../../support/helpers/utilities";
3
4
 
4
5
  describe('Create question page - Essay Response: Customize formatting options (for student player) toolbar options', () => {
5
6
  before(() => {
@@ -12,16 +13,13 @@ describe('Create question page - Essay Response: Customize formatting options (f
12
13
  essayResponsePage.steps.navigateToCreateQuestion('essay response');
13
14
  cy.barsPreLoaderWait();
14
15
  essayResponsePage.steps.expandCustomizeFormattingOptionsAccordion();
15
- essayResponsePage.steps.selectCustomizedFormattingOption(['Undo', 'Redo']);
16
16
  essayResponsePage.steps.switchToPreviewTab();
17
17
  });
18
18
 
19
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');
20
+ essayResponsePage.steps.enterInputInResponseField('Lorem Ipsum');
22
21
  essayResponsePage.steps.selectPreviewTabToolbarOption('Insert/Remove Bulleted List');
23
- essayResponsePage.responseField()
24
- .verifyInnerHTML('<ul><li>Lorem Ipsum</li></ul>');
22
+ essayResponsePage.steps.verifyResponseFieldHTML('<ul><li>Lorem Ipsum</li></ul>');
25
23
  });
26
24
 
27
25
  essayResponsePage.tests.verifyUndoAndRedoFunctionalityForPreviewTabToolbarOption('Insert/Remove Bulleted List');
@@ -30,42 +28,30 @@ describe('Create question page - Essay Response: Customize formatting options (f
30
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', () => {
31
29
  essayResponsePage.steps.resetPreviewTabResponseField();
32
30
  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>');
31
+ essayResponsePage.steps.verifyResponseFieldHTML('<ul><li><br></li></ul>');
32
+ essayResponsePage.steps.enterInputInResponseField('Lorem Ipsum');
33
+ essayResponsePage.steps.verifyResponseFieldHTML('<ul><li>Lorem Ipsum</li></ul>');
39
34
  });
40
35
 
41
36
  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>')
37
+ essayResponsePage.steps.enterInputInResponseField('{enter}');
38
+ essayResponsePage.steps.verifyListItemLengthInResponseField(2);
39
+ essayResponsePage.steps.enterInputInResponseField('dolor sit amet');
40
+ essayResponsePage.steps.verifyResponseFieldHTML('<ul><li>Lorem Ipsum</li><li>dolor sit amet</li></ul>')
49
41
  });
50
42
 
51
43
  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>');
44
+ essayResponsePage.steps.enterInputInResponseField('{enter}{enter}');
45
+ essayResponsePage.steps.verifyListItemLengthInResponseField(2);
46
+ essayResponsePage.steps.verifyPreviewTabToolbarOptionNotSelected('Insert/Remove Bulleted List')
47
+ essayResponsePage.steps.verifyResponseFieldHTML('<ul><li>Lorem Ipsum</li><li>dolor sit amet</li></ul><p><br></p>');
60
48
  });
61
49
 
62
50
  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
51
  essayResponsePage.steps.resetPreviewTabResponseField();
64
- essayResponsePage.responseField()
65
- .type('Lorem Ipsum');
52
+ essayResponsePage.steps.enterInputInResponseField('Lorem Ipsum');
66
53
  essayResponsePage.steps.selectPreviewTabToolbarOption('Insert/Remove Numbered List');
67
- essayResponsePage.responseField()
68
- .verifyInnerHTML('<ol><li>Lorem Ipsum</li></ol>');
54
+ essayResponsePage.steps.verifyResponseFieldHTML('<ol><li>Lorem Ipsum</li></ol>');
69
55
  });
70
56
 
71
57
  essayResponsePage.tests.verifyUndoAndRedoFunctionalityForPreviewTabToolbarOption('Insert/Remove Numbered List');
@@ -74,54 +60,39 @@ describe('Create question page - Essay Response: Customize formatting options (f
74
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', () => {
75
61
  essayResponsePage.steps.resetPreviewTabResponseField();
76
62
  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>');
63
+ essayResponsePage.steps.verifyResponseFieldHTML('<ol><li><br></li></ol>');
64
+ essayResponsePage.steps.enterInputInResponseField('Lorem Ipsum');
65
+ essayResponsePage.steps.verifyResponseFieldHTML('<ol><li>Lorem Ipsum</li></ol>');
83
66
  });
84
67
 
85
68
  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>')
69
+ essayResponsePage.steps.enterInputInResponseField('{enter}');
70
+ essayResponsePage.steps.verifyListItemLengthInResponseField(2);
71
+ essayResponsePage.steps.enterInputInResponseField('dolor sit amet');
72
+ essayResponsePage.steps.verifyResponseFieldHTML('<ol><li>Lorem Ipsum</li><li>dolor sit amet</li></ol>')
93
73
  });
94
74
 
95
75
  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>');
76
+ essayResponsePage.steps.enterInputInResponseField('{enter}{enter}');
77
+ essayResponsePage.steps.verifyListItemLengthInResponseField(2);
78
+ essayResponsePage.steps.verifyPreviewTabToolbarOptionNotSelected('Insert/Remove Numbered List')
79
+ essayResponsePage.steps.verifyResponseFieldHTML('<ol><li>Lorem Ipsum</li><li>dolor sit amet</li></ol><p><br></p>');
104
80
  });
105
81
 
106
82
  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
83
  essayResponsePage.steps.resetPreviewTabResponseField();
108
84
  essayResponsePage.steps.selectPreviewTabToolbarOption('Insert/Remove Bulleted List');
109
- essayResponsePage.responseField()
110
- .type('Lorem Ipsum{enter}');
85
+ essayResponsePage.steps.enterInputInResponseField('Lorem Ipsum{enter}');
111
86
  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>');
87
+ essayResponsePage.steps.verifyPreviewTabToolbarOptionNotSelected('Insert/Remove Bulleted List')
88
+ essayResponsePage.steps.verifyResponseFieldHTML('<ul><li>Lorem Ipsum</li></ul><ol class="nested-level-decimal"><li><br></li></ol>');
116
89
  });
117
90
 
118
91
  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
92
  essayResponsePage.steps.resetPreviewTabResponseField();
120
- essayResponsePage.responseField()
121
- .type('Lorem Ipsum{enter}dolor sit amet{selectAll}');
93
+ essayResponsePage.steps.enterInputInResponseField('Lorem Ipsum{enter}dolor sit amet{selectAll}');
122
94
  essayResponsePage.steps.selectPreviewTabToolbarOption('Insert/Remove Numbered List');
123
- essayResponsePage.responseField()
124
- .verifyInnerHTML('<ol><li>Lorem Ipsum</li><li>dolor sit amet</li></ol>');
95
+ essayResponsePage.steps.verifyResponseFieldHTML('<ol><li>Lorem Ipsum</li><li>dolor sit amet</li></ol>');
125
96
  });
126
97
  });
127
98
 
@@ -131,90 +102,71 @@ describe('Create question page - Essay Response: Customize formatting options (f
131
102
  essayResponsePage.steps.navigateToCreateQuestion('essay response');
132
103
  cy.barsPreLoaderWait();
133
104
  essayResponsePage.steps.expandCustomizeFormattingOptionsAccordion();
134
- essayResponsePage.steps.selectCustomizedFormattingOption(['Subscript', 'Undo', 'Redo']);
105
+ essayResponsePage.steps.selectCustomizedFormattingOption(['Subscript', 'Superscript']);
135
106
  essayResponsePage.steps.switchToPreviewTab();
136
- essayResponsePage.responseField()
137
- .type('log')
138
- .should('have.text', 'log');
107
+ essayResponsePage.steps.enterInputInResponseField('log');
139
108
  });
140
109
 
141
110
  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
111
  essayResponsePage.steps.selectPreviewTabToolbarOption('Superscript');
143
- essayResponsePage.responseField()
144
- .type('x')
145
- .verifyInnerHTML('<p>log<sup>​​​​​​​x</sup></p>');
112
+ essayResponsePage.steps.enterInputInResponseField('x');
113
+ essayResponsePage.steps.verifyResponseFieldHTML('<p>log<sup>​​​​​​​x</sup></p>');
146
114
  });
147
115
 
148
116
  it('When the user deselects the \'Superscript\' toolbar option, then the subsequent text that the user enters should appear in default format', () => {
149
117
  essayResponsePage.steps.deselectPreviewTabToolbarOption('Superscript');
150
- essayResponsePage.responseField()
151
- .type('y')
152
- .verifyInnerHTML('<p>log<sup>x</sup>​​​​​​​y</p>');
118
+ essayResponsePage.steps.enterInputInResponseField('y');
119
+ essayResponsePage.steps.verifyResponseFieldHTML('<p>log<sup>x</sup>​​​​​​​y</p>');
153
120
  });
154
121
 
155
122
  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
123
  essayResponsePage.steps.resetPreviewTabResponseField();
157
- essayResponsePage.responseField()
158
- .type('log{selectAll}');
124
+ essayResponsePage.steps.enterInputInResponseField('log{selectAll}');
159
125
  essayResponsePage.steps.selectPreviewTabToolbarOption('Superscript');
160
- essayResponsePage.responseField()
161
- .verifyInnerHTML('<p><sup>log</sup></p>')
126
+ essayResponsePage.steps.verifyResponseFieldHTML('<p><sup>log</sup></p>')
162
127
  essayResponsePage.steps.deselectPreviewTabToolbarOption('Superscript');
163
- essayResponsePage.responseField()
164
- .verifyInnerHTML('<p>log</p>');
128
+ essayResponsePage.steps.verifyResponseFieldHTML('<p>log</p>');
165
129
  });
166
130
 
167
131
  essayResponsePage.tests.verifyUndoAndRedoFunctionalityForPreviewTabToolbarOption('Superscript');
168
132
 
169
133
  it('When the user selects the \'Subscript\' toolbar option, then the text entered in the response field should be displayed as a Subscript', () => {
170
134
  essayResponsePage.steps.resetPreviewTabResponseField();
171
- essayResponsePage.responseField()
172
- .type('log')
173
- .should('have.text', 'log');
135
+ essayResponsePage.steps.enterInputInResponseField('log');
174
136
  essayResponsePage.steps.selectPreviewTabToolbarOption('Subscript');
175
- essayResponsePage.responseField()
176
- .type('e')
177
- .verifyInnerHTML('<p>log<sub>​​​​​​​e</sub></p>');
137
+ essayResponsePage.steps.enterInputInResponseField('e');
138
+ essayResponsePage.steps.verifyResponseFieldHTML('<p>log<sub>​​​​​​​e</sub></p>');
178
139
  });
179
140
 
180
141
  it('When the user deselects the \'Subscript\' toolbar option, then the subsequent text that the user enters should appear in default format', () => {
181
142
  essayResponsePage.steps.deselectPreviewTabToolbarOption('Subscript');
182
- essayResponsePage.responseField()
183
- .type('y')
184
- .verifyInnerHTML('<p>log<sub>e</sub>​​​​​​​y</p>');
143
+ essayResponsePage.steps.enterInputInResponseField('y');
144
+ essayResponsePage.steps.verifyResponseFieldHTML('<p>log<sub>e</sub>​​​​​​​y</p>');
185
145
  });
186
146
 
187
147
  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
148
  essayResponsePage.steps.resetPreviewTabResponseField();
189
- essayResponsePage.responseField()
190
- .type('log{selectAll}');
149
+ essayResponsePage.steps.enterInputInResponseField('log{selectAll}');
191
150
  essayResponsePage.steps.selectPreviewTabToolbarOption('Subscript');
192
- essayResponsePage.responseField()
193
- .verifyInnerHTML('<p><sub>log</sub></p>')
151
+ essayResponsePage.steps.verifyResponseFieldHTML('<p><sub>log</sub></p>')
194
152
  essayResponsePage.steps.deselectPreviewTabToolbarOption('Subscript');
195
- essayResponsePage.responseField()
196
- .verifyInnerHTML('<p>log</p>');
153
+ essayResponsePage.steps.verifyResponseFieldHTML('<p>log</p>');
197
154
  });
198
155
 
199
156
  essayResponsePage.tests.verifyUndoAndRedoFunctionalityForPreviewTabToolbarOption('Subscript');
200
157
 
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)', () => {
158
+ it('The user should be able to enter mathematical statements that require a combination of both superscript and subscript (x raised to (log y to the base e)', () => {
202
159
  essayResponsePage.steps.resetPreviewTabResponseField();
203
- essayResponsePage.responseField()
204
- .type('x')
205
- .should('have.text', 'x');
160
+ essayResponsePage.steps.enterInputInResponseField('x')
206
161
  essayResponsePage.steps.selectPreviewTabToolbarOption('Superscript');
207
- essayResponsePage.responseField()
208
- .type('log')
209
- .verifyInnerHTML('<p>x<sup>​​​​​​​log</sup></p>');
162
+ essayResponsePage.steps.enterInputInResponseField('log');
163
+ essayResponsePage.steps.verifyResponseFieldHTML('<p>x<sup>​​​​​​​log</sup></p>');
210
164
  essayResponsePage.steps.selectPreviewTabToolbarOption('Subscript');
211
- essayResponsePage.responseField()
212
- .type('e')
213
- .verifyInnerHTML('<p>x<sup>log<sub>​​​​​​​e</sub></sup></p>');
165
+ essayResponsePage.steps.enterInputInResponseField('e');
166
+ essayResponsePage.steps.verifyResponseFieldHTML('<p>x<sup>log<sub>​​​​​​​e</sub></sup></p>');
214
167
  essayResponsePage.steps.deselectPreviewTabToolbarOption('Subscript');
215
- essayResponsePage.responseField()
216
- .type('y')
217
- .verifyInnerHTML('<p>x<sup>log<sub>e</sub>​​​​​​​y</sup></p>');
168
+ essayResponsePage.steps.enterInputInResponseField('y');
169
+ essayResponsePage.steps.verifyResponseFieldHTML('<p>x<sup>log<sub>e</sub>​​​​​​​y</sup></p>');
218
170
  });
219
171
  });
220
172
 
@@ -224,68 +176,52 @@ describe('Create question page - Essay Response: Customize formatting options (f
224
176
  essayResponsePage.steps.navigateToCreateQuestion('essay response');
225
177
  cy.barsPreLoaderWait();
226
178
  essayResponsePage.steps.expandCustomizeFormattingOptionsAccordion();
227
- essayResponsePage.steps.selectCustomizedFormattingOption(['Align Left', 'Align Center', 'Align Right', 'Align Justify', 'Undo', 'Redo']);
179
+ essayResponsePage.steps.selectCustomizedFormattingOption(['Align Left', 'Align Center', 'Align Right', 'Align Justify']);
228
180
  essayResponsePage.steps.switchToPreviewTab();
229
181
  });
230
182
 
231
183
  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>')
184
+ essayResponsePage.steps.focusInResponseField();
185
+ essayResponsePage.steps.verifyPreviewTabToolbarOptionNotSelected('Align Left');
186
+ essayResponsePage.steps.verifyPreviewTabToolbarOptionNotSelected('Align Center');
187
+ essayResponsePage.steps.verifyPreviewTabToolbarOptionNotSelected('Align Right');
188
+ essayResponsePage.steps.verifyPreviewTabToolbarOptionNotSelected('Align Justify');
189
+ essayResponsePage.steps.enterInputInResponseField('Lorem Ipsum');
190
+ essayResponsePage.steps.verifyResponseFieldHTML('<p>Lorem Ipsum</p>');
245
191
  });
246
192
 
247
193
  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
194
  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');
195
+ essayResponsePage.steps.verifyResponseFieldHTML('<p style=\"text-align: center;\">Lorem Ipsum</p>')
196
+ essayResponsePage.steps.verifyPreviewTabToolbarOptionNotSelected('Align Left')
253
197
  });
254
198
 
255
199
  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
200
  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');
201
+ essayResponsePage.steps.verifyResponseFieldHTML('<p style="text-align: left;">Lorem Ipsum</p>');
202
+ essayResponsePage.steps.verifyPreviewTabToolbarOptionNotSelected('Align Center')
261
203
  });
262
204
 
263
205
  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
206
  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');
207
+ essayResponsePage.steps.verifyResponseFieldHTML('<p style=\"text-align: right;\">Lorem Ipsum</p>');
208
+ essayResponsePage.steps.verifyPreviewTabToolbarOptionNotSelected('Align Left')
269
209
  });
270
210
 
271
211
  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
212
  essayResponsePage.steps.deselectPreviewTabToolbarOption('Align Right');
273
- essayResponsePage.responseField()
274
- .verifyInnerHTML('<p>Lorem Ipsum</p>');
213
+ essayResponsePage.steps.verifyResponseFieldHTML('<p>Lorem Ipsum</p>');
275
214
  });
276
215
 
277
216
  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
217
  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');
218
+ essayResponsePage.steps.verifyResponseFieldHTML('<p style="text-align: justify;">Lorem Ipsum</p>');
219
+ essayResponsePage.steps.verifyPreviewTabToolbarOptionNotSelected('Align Right')
283
220
  });
284
221
 
285
222
  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');
223
+ essayResponsePage.steps.enterInputInResponseField('{enter}');
224
+ utilities.verifyElementVisibilityState(essayResponsePage.previewTabToolbarOption('Align Justify'), 'visible');
289
225
  });
290
226
 
291
227
  //checking undo and redo functionality for one text alignment option only, not necessary to check for all
@@ -298,33 +234,25 @@ describe('Create question page - Essay Response: Customize formatting options (f
298
234
  essayResponsePage.steps.navigateToCreateQuestion('essay response');
299
235
  cy.barsPreLoaderWait();
300
236
  essayResponsePage.steps.expandCustomizeFormattingOptionsAccordion();
301
- essayResponsePage.steps.selectCustomizedFormattingOption(['Increase Indent', 'Decrease Indent', 'Undo', 'Redo']);
302
237
  essayResponsePage.steps.switchToPreviewTab();
303
- essayResponsePage.responseField()
304
- .type('Lorem Ipsum');
238
+ essayResponsePage.steps.enterInputInResponseField('Lorem Ipsum');
305
239
  });
306
240
 
307
241
  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');
242
+ essayResponsePage.steps.verifyPreviewTabToolbarOptionDisabled('Decrease Indent')
310
243
  });
311
244
 
312
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', () => {
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');
246
+ essayResponsePage.steps.selectPreviewTabToolbarOption('Increase Indent');
247
+ essayResponsePage.steps.verifyResponseFieldHTML('<p style=\"margin-left: 40px;\">Lorem Ipsum</p>');
248
+ essayResponsePage.steps.verifyPreviewTabToolbarOptionNotSelected('Decrease Indent')
319
249
  });
320
250
 
321
251
  essayResponsePage.tests.verifyUndoAndRedoFunctionalityForPreviewTabToolbarOption('Increase Indent');
322
252
 
323
253
  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>');
254
+ essayResponsePage.steps.selectPreviewTabToolbarOption('Decrease Indent')
255
+ essayResponsePage.steps.verifyResponseFieldHTML('<p>Lorem Ipsum</p>');
328
256
  });
329
257
 
330
258
  essayResponsePage.tests.verifyUndoAndRedoFunctionalityForPreviewTabToolbarOption('Decrease Indent');