itemengine-cypress-automation 1.0.113 → 1.0.114

Sign up to get free protection for your applications and to get access to all the features.
Files changed (49) 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/maximumRecorderLengthComponent.js +32 -15
  43. package/cypress/pages/components/playbackControlsBaseComponent.js +9 -1
  44. package/cypress/pages/components/questionInputFieldComponent.js +0 -7
  45. package/cypress/pages/essayResponseBasicPage.js +1 -26
  46. package/cypress/pages/essayResponsePage.js +21 -284
  47. package/cypress/pages/shortTextResponsePage.js +142 -103
  48. package/cypress/pages/textEntryMathPage.js +58 -7
  49. package/package.json +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
  const css = Cypress.env('css');
4
5
 
5
6
  describe('Create question page - Essay Response: Customize formatting options (for student player) toolbar options', () => {
@@ -13,25 +14,20 @@ describe('Create question page - Essay Response: Customize formatting options (f
13
14
  essayResponsePage.steps.navigateToCreateQuestion('essay response');
14
15
  cy.barsPreLoaderWait();
15
16
  essayResponsePage.steps.expandCustomizeFormattingOptionsAccordion();
16
- essayResponsePage.steps.selectCustomizedFormattingOption(['Insert Horizontal Line', 'Undo', 'Redo']);
17
+ essayResponsePage.steps.selectCustomizedFormattingOption(['Insert Horizontal Line']);
17
18
  essayResponsePage.steps.switchToPreviewTab();
18
- essayResponsePage.responseField()
19
- .type('Lorem Ipsum');
19
+ essayResponsePage.steps.enterInputInResponseField('Lorem Ipsum');
20
20
  });
21
21
 
22
22
  it('When the user selects the \'Insert horizontal line\' toolbar option, a horizontal line should be inserted below from where the cursor is pointing in the response field, the \'Insert horizontal line\' toolbar option should not stay in selected state', () => {
23
- essayResponsePage.previewTabToolbarOption('Insert Horizontal Line')
24
- .click();
25
- essayResponsePage.responseField()
26
- .verifyInnerHTML('<p>Lorem Ipsum</p><hr><p><br></p>');
27
- essayResponsePage.previewTabToolbarOption('Insert Horizontal Line')
28
- .should('have.attr', 'aria-pressed', 'false');
23
+ essayResponsePage.steps.selectPreviewTabToolbarOption('Insert Horizontal Line');
24
+ essayResponsePage.steps.verifyResponseFieldHTML('<p>Lorem Ipsum</p><hr><p><br></p>');
25
+ essayResponsePage.steps.verifyPreviewTabToolbarOptionNotSelected('Insert Horizontal Line')
29
26
  });
30
27
 
31
28
  it('When the user hits \'backspace\', then the horizontal line should get removed', () => {
32
- essayResponsePage.responseField()
33
- .type('{backspace}')
34
- .verifyInnerHTML('<p>Lorem Ipsum</p><p><br></p>');
29
+ essayResponsePage.steps.enterInputInResponseField('{backspace}')
30
+ essayResponsePage.steps.verifyResponseFieldHTML('<p>Lorem Ipsum</p><p><br></p>');
35
31
  });
36
32
 
37
33
  essayResponsePage.tests.verifyUndoAndRedoFunctionalityForPreviewTabToolbarOption('Insert Horizontal Line');
@@ -43,34 +39,26 @@ describe('Create question page - Essay Response: Customize formatting options (f
43
39
  essayResponsePage.steps.navigateToCreateQuestion('essay response');
44
40
  cy.barsPreLoaderWait();
45
41
  essayResponsePage.steps.expandCustomizeFormattingOptionsAccordion();
46
- essayResponsePage.steps.selectCustomizedFormattingOption(['Block Quote', 'Undo', 'Redo']);
42
+ essayResponsePage.steps.selectCustomizedFormattingOption(['Block Quote']);
47
43
  essayResponsePage.steps.switchToPreviewTab();
48
- essayResponsePage.responseField()
49
- .type('Lorem Ipsum');
44
+ essayResponsePage.steps.enterInputInResponseField('Lorem Ipsum');
50
45
  });
51
46
 
52
47
  it('When the user selects the \'Blockquote\' toolbar option, then the text in the response field should appear as a block quote', () => {
53
48
  essayResponsePage.steps.selectPreviewTabToolbarOption('Block Quote');
54
- essayResponsePage.responseField()
55
- .verifyInnerHTML('<blockquote><p>Lorem Ipsum</p></blockquote>')
49
+ essayResponsePage.steps.verifyResponseFieldHTML('<blockquote><p>Lorem Ipsum</p></blockquote>')
56
50
  });
57
51
 
58
52
  it('When the user presses the \'Enter\' key and switches to a new line, then the \'Blockquote\' toolbar option should be in selected state and the block quote formatting should persist and user should be able to enter text in the next line', () => {
59
- essayResponsePage.responseField()
60
- .type('{enter}dolor sit amet');
61
- essayResponsePage.previewTabToolbarOption('Block Quote')
62
- .should('have.attr', 'aria-pressed', 'true');
63
- essayResponsePage.responseField()
64
- .verifyInnerHTML('<blockquote><p>Lorem Ipsum</p><p>dolor sit amet</p></blockquote>');
53
+ essayResponsePage.steps.enterInputInResponseField('{enter}dolor sit amet');
54
+ essayResponsePage.steps.verifyPreviewTabToolbarOptionSelected('Block Quote')
55
+ essayResponsePage.steps.verifyResponseFieldHTML('<blockquote><p>Lorem Ipsum</p><p>dolor sit amet</p></blockquote>');
65
56
  });
66
57
 
67
58
  it('When the user presses the \'Enter\' key again without typing anything in the new line, then the \'Blockquote\' toolbar option should get deselected, the block quote should end and the cursor should move out of the block quote', () => {
68
- essayResponsePage.responseField()
69
- .type('{enter}{enter}');
70
- essayResponsePage.previewTabToolbarOption('Block Quote')
71
- .should('have.attr', 'aria-pressed', 'false');
72
- essayResponsePage.responseField()
73
- .verifyInnerHTML('<blockquote><p>Lorem Ipsum</p><p>dolor sit amet</p></blockquote><p><br></p>');
59
+ essayResponsePage.steps.enterInputInResponseField('{enter}{enter}');
60
+ essayResponsePage.steps.verifyPreviewTabToolbarOptionNotSelected('Block Quote');
61
+ essayResponsePage.steps.verifyResponseFieldHTML('<blockquote><p>Lorem Ipsum</p><p>dolor sit amet</p></blockquote><p><br></p>');
74
62
  });
75
63
 
76
64
  essayResponsePage.tests.verifyUndoAndRedoFunctionalityForPreviewTabToolbarOption('Block Quote');
@@ -82,28 +70,29 @@ describe('Create question page - Essay Response: Customize formatting options (f
82
70
  essayResponsePage.steps.navigateToCreateQuestion('essay response');
83
71
  cy.barsPreLoaderWait();
84
72
  essayResponsePage.steps.expandCustomizeFormattingOptionsAccordion();
85
- essayResponsePage.steps.setWordLimit(10);
86
- essayResponsePage.steps.selectCustomizedFormattingOption(['Code Inline', 'Code Editor', 'Undo', 'Redo']);
73
+ essayResponsePage.steps.setMaximumLimit(10);
74
+ essayResponsePage.steps.checkDisplayWordCountCheckbox();
75
+ essayResponsePage.steps.selectCustomizedFormattingOption(['Code Inline', 'Code Editor']);
87
76
  essayResponsePage.steps.switchToPreviewTab();
88
77
  });
89
78
 
90
79
  it('When the user selects the \'Code inline\' toolbar option, then the text entered in the response field should appear as a highlighted inline code text, the word count should also update and all the toolbar formatting options should be in enabled state', () => {
91
80
  essayResponsePage.steps.selectPreviewTabToolbarOption('Code Inline');
92
- essayResponsePage.responseField()
93
- .type('console.log()')
94
- .verifyInnerHTML('<p><code>​​​​​​​console.log()</code><br></p>');
95
- essayResponsePage.steps.verifyResponseFieldWordCount('1/10');
81
+ essayResponsePage.steps.enterInputInResponseField('console.log()')
82
+ essayResponsePage.steps.verifyResponseFieldHTML('<p><code>​​​​​​​console.log()</code><br></p>');
83
+ essayResponsePage.steps.verifyWordCount('1');
96
84
  //Just checking if Bold option is disabled or not, no need to check for all toolbar options
97
- essayResponsePage.previewTabToolbarOption('Bold (Ctrl+B)')
98
- .should('have.attr', 'aria-disabled', 'false');
85
+ essayResponsePage.steps.verifyPreviewTabToolbarOptionNotDisabled('Bold (Ctrl+B)');
99
86
  });
100
87
 
101
88
  //Comment: exceptional assertion of font size since in code inline font size is 14.4px
102
89
  it('CSS of \'highlighted inline code text\'', { tags: 'css' }, () => {
103
- essayResponsePage.responseField()
104
- .find('code')
105
- .verifyCSS(css.color.codeInlineText, '14.4px', css.fontWeight.regular)
106
- .and('have.css', 'background-color', css.color.codeInlineTextBg);
90
+ utilities.verifyCSS(essayResponsePage.responseField().find('code'), {
91
+ 'color': css.color.codeInlineText,
92
+ 'font-size': '14.4px',
93
+ 'font-weight': css.fontWeight.regular,
94
+ 'background-color': css.color.codeInlineTextBg
95
+ });
107
96
  });
108
97
 
109
98
  it('Accessibility of \'highlighted inline code text\'', { tags: 'a11y' }, () => {
@@ -113,70 +102,58 @@ describe('Create question page - Essay Response: Customize formatting options (f
113
102
  essayResponsePage.tests.verifyUndoAndRedoFunctionalityForPreviewTabToolbarOption('Code Inline');
114
103
 
115
104
  it('If user selects the entered text and deselects the \'Code inline\' toolbar option, then the selected text should be displayed in default format', () => {
116
- essayResponsePage.responseField()
117
- .type('{selectAll}');
105
+ essayResponsePage.steps.enterInputInResponseField('{selectAll}');
118
106
  essayResponsePage.steps.deselectPreviewTabToolbarOption('Code Inline');
119
- essayResponsePage.responseField()
120
- .verifyInnerHTML('<p>Lorem Ipsum</p>')
107
+ essayResponsePage.steps.verifyResponseFieldHTML('<p>Lorem Ipsum</p>')
121
108
  });
122
109
 
123
110
  it('When the user is typing while \'Code inline\' toolbar option is selected, then the text should appear as a highlighted inline code and when the user deselects the \'Code inline\' toolbar option and continues to type, then the text should appear as plain text', () => {
124
111
  essayResponsePage.steps.resetPreviewTabResponseField();
125
112
  essayResponsePage.steps.selectPreviewTabToolbarOption('Code Inline');
126
- essayResponsePage.responseField()
127
- .type('console.log()');
113
+ essayResponsePage.steps.enterInputInResponseField('console.log()');
128
114
  essayResponsePage.steps.deselectPreviewTabToolbarOption('Code Inline');
129
- essayResponsePage.responseField()
130
- .type('command to write a message in Javascript')
131
- .verifyInnerHTML('<p><code>console.log()</code>​​​​​​​command to write a message in Javascript<br></p>');
115
+ essayResponsePage.steps.enterInputInResponseField('command to write a message in Javascript')
116
+ essayResponsePage.steps.verifyResponseFieldHTML('<p><code>console.log()</code>​​​​​​​command to write a message in Javascript<br></p>');
132
117
  });
133
118
 
134
119
  it('When the user selects the \'Code inline\' toolbar option, enters text and presses the \'Enter\' key and switches to a new line, then the \'Code inline\' toolbar option should be in selected state and the code inline formatting should persist', () => {
135
120
  essayResponsePage.steps.resetPreviewTabResponseField();
136
121
  essayResponsePage.steps.selectPreviewTabToolbarOption('Code Inline');
137
- essayResponsePage.responseField()
138
- .type('console.log(){enter}')
139
- .verifyInnerHTML('<p><code>console.log()</code><br></p><p><code>​​​​​​​</code><br></p>');
122
+ essayResponsePage.steps.enterInputInResponseField('console.log(){enter}')
123
+ essayResponsePage.steps.verifyResponseFieldHTML('<p><code>console.log()</code><br></p><p><code>​​​​​​​</code><br></p>');
140
124
  });
141
125
 
142
126
  it('When the user presses the \'Enter\' key again without typing anything in the new line, even then the code inline formatting should persist', () => {
143
- essayResponsePage.responseField()
144
- .type('{enter}')
145
- .verifyInnerHTML('<p><code>console.log()</code><br></p><p><code></code><br></p><p><code>​​​​​​​</code><br></p>');
127
+ essayResponsePage.steps.enterInputInResponseField('{enter}')
128
+ essayResponsePage.steps.verifyResponseFieldHTML('<p><code>console.log()</code><br></p><p><code></code><br></p><p><code>​​​​​​​</code><br></p>');
146
129
  });
147
130
 
148
131
  it('When the user adds multi line text, selects the entered text and clicks on the \'Code inline\' toolbar option, then the lines should get converted to highlighted inline code text', () => {
149
132
  essayResponsePage.steps.resetPreviewTabResponseField();
150
- essayResponsePage.responseField()
151
- .type('console.log(){enter}on.click(){selectAll}');
133
+ essayResponsePage.steps.enterInputInResponseField('console.log(){enter}on.click(){selectAll}');
152
134
  essayResponsePage.steps.selectPreviewTabToolbarOption('Code Inline');
153
- essayResponsePage.responseField()
154
- .verifyInnerHTML('<p><code>console.log()</code></p><p><code>on.click()</code></p>');
135
+ essayResponsePage.steps.verifyResponseFieldHTML('<p><code>console.log()</code></p><p><code>on.click()</code></p>');
155
136
  });
156
137
 
157
- it('When the user selectes the \'Code editor\' toolbar option, then the text entered in the response field should appear as a highlighted code block, the word count should update, and all the toolbar formatting options except \'Undo\' should be in disabled state', () => {
138
+ it('When the user selects the \'Code editor\' toolbar option, then the text entered in the response field should appear as a highlighted code block, the word count should update, and all the toolbar formatting options except \'Undo\' should be in disabled state', () => {
158
139
  essayResponsePage.steps.resetPreviewTabResponseField();
159
- essayResponsePage.previewTabToolbarOption('Code Editor')
160
- .click();
161
- essayResponsePage.responseField()
162
- .type('console.log()')
163
- .find('.codeblock')
164
- .verifyInnerHTML('<pre class=\"line\">console.log()</pre>');
165
- essayResponsePage.steps.verifyResponseFieldWordCount('1/10');
140
+ essayResponsePage.steps.selectPreviewTabToolbarOption('Code Editor')
141
+ essayResponsePage.steps.enterInputInResponseField('console.log()');
142
+ essayResponsePage.steps.verifyResponseFieldCodeblockHTML('<pre class=\"line\">console.log()</pre>');
143
+ essayResponsePage.steps.verifyWordCount('1');
166
144
  //Just checking if Bold option is disabled or not, no need to check for all toolbar options
167
- essayResponsePage.previewTabToolbarOption('Bold (Ctrl+B)')
168
- .should('have.attr', 'aria-disabled', 'true');
169
- essayResponsePage.previewTabToolbarOption('Undo (Ctrl+Z)')
170
- .should('have.attr', 'aria-disabled', 'false');
171
-
145
+ essayResponsePage.steps.verifyPreviewTabToolbarOptionDisabled('Bold (Ctrl+B)');
146
+ essayResponsePage.steps.verifyPreviewTabToolbarOptionNotDisabled('Undo (Ctrl+Z)');
172
147
  });
173
148
 
174
149
  //No designs available https://redmine.zeuslearning.com/issues/525365
175
150
  it('CSS of \'highlighted code block\'', { tags: 'css' }, () => {
176
- essayResponsePage.responseField()
177
- .find('.codeblock')
178
- .verifyCSS(css.color.codeBlockText, css.fontSize.default, css.fontWeight.regular)
179
- .and('have.css', 'background-color', css.color.codeBlockTextBg);
151
+ utilities.verifyCSS(essayResponsePage.responseField().find('.codeblock'), {
152
+ 'color': css.color.codeBlockText,
153
+ 'font-size': css.fontSize.default,
154
+ 'font-weight': css.fontWeight.regular,
155
+ 'background-color': css.color.codeBlockTextBg
156
+ });
180
157
  });
181
158
 
182
159
  it('Accessibility of \'highlighted code block \'', { tags: 'a11y' }, () => {
@@ -187,155 +164,28 @@ describe('Create question page - Essay Response: Customize formatting options (f
187
164
 
188
165
  //Comment: Here we are unable to verify the number of the code line that appears since it is displayed using ::before
189
166
  it('When the user presses the \'Enter\' key and switches to a new line, then a new code line with \'2\'number should appear in the response field, the \'Code editor\' toolbar option should be in selected state and the inline code block formatting should persist', () => {
190
- essayResponsePage.responseField()
191
- .type('console.log(){enter}')
192
- .find('.codeblock')
193
- .verifyInnerHTML('<pre class=\"line\">console.log()</pre><pre class=\"line\"><br></pre>');
194
- essayResponsePage.previewTabToolbarOption('Bold (Ctrl+B)')
195
- .should('have.attr', 'aria-disabled', 'true');
167
+ essayResponsePage.steps.enterInputInResponseField('console.log(){enter}')
168
+ essayResponsePage.steps.verifyResponseFieldCodeblockHTML('<pre class=\"line\">console.log()</pre><pre class=\"line\"><br></pre>');
169
+ essayResponsePage.steps.verifyPreviewTabToolbarOptionDisabled('Bold (Ctrl+B)');
196
170
  });
197
171
 
198
172
  it('When the user presses the \'Enter\' key again without typing anything in the new line, even then the inline code block formatting should persist', () => {
199
- essayResponsePage.responseField()
200
- .type('{enter}')
201
- .find('.codeblock')
202
- .verifyInnerHTML('<pre class=\"line\">console.log()</pre><pre class=\"line\"><br></pre><pre class=\"line\"><br></pre>');
203
- essayResponsePage.responseField()
204
- .find('pre')
205
- .should('have.length', 3);
206
- essayResponsePage.previewTabToolbarOption('Bold (Ctrl+B)')
207
- .should('have.attr', 'aria-disabled', 'true');
173
+ essayResponsePage.steps.enterInputInResponseField('{enter}')
174
+ essayResponsePage.steps.verifyResponseFieldCodeblockHTML('<pre class=\"line\">console.log()</pre><pre class=\"line\"><br></pre><pre class=\"line\"><br></pre>');
175
+ essayResponsePage.steps.verifyCodeLength(3);
176
+ essayResponsePage.steps.verifyPreviewTabToolbarOptionDisabled('Bold (Ctrl+B)');
208
177
  });
209
178
  });
210
179
 
211
- describe('Background color, Text color formatting toolbar options - Preview tab', () => {
212
- abortEarlySetup();
213
- before(() => {
214
- essayResponsePage.steps.navigateToCreateQuestion('essay response');
215
- cy.barsPreLoaderWait();
216
- essayResponsePage.steps.expandCustomizeFormattingOptionsAccordion();
217
- essayResponsePage.steps.selectCustomizedFormattingOption(['Background Color', 'Text Color', 'Undo', 'Redo']);
218
- essayResponsePage.steps.switchToPreviewTab();
219
- });
220
-
221
- it('When the user clicks on the \'Background color\' toolbar option, a popup with an \'Automatic\' color option and a color pallete should be displayed and if the user clicks anywhere outside the popup, then the popup should disappear', () => {
222
- essayResponsePage.previewTabToolbarOption('Background Color')
223
- .click();
224
- essayResponsePage.previewTabToolbarOption('Background Color')
225
- .should('have.attr', 'aria-expanded', 'true');
226
- essayResponsePage.previewTabColorPalettePopup()
227
- .its('0.contentDocument.body').should('not.be.empty')
228
- .within(() => {
229
- cy.get('[title="Colors"]')
230
- .find('[title="Automatic"]')
231
- .should('be.visible');
232
- });
233
- cy.get('body')
234
- .click();
235
- essayResponsePage.previewTabColorPalettePopup()
236
- .should('not.be.visible');
237
- });
238
-
239
- it('When the user selects the \'Background color\' toolbar option and selects a color from the popup, the respective color should appear as a background color of the text entered in the response field and the \'Background color\' toolbar option should be in selected state', () => {
240
- essayResponsePage.previewTabToolbarOption('Background Color')
241
- .click();
242
- essayResponsePage.steps.selectColorFromPopup('Strong Cyan');
243
- essayResponsePage.responseField()
244
- .type('Lorem Ipsum')
245
- .verifyInnerHTML('<p><span style="background-color:#1abc9c;">​​​​​​​Lorem Ipsum</span><br></p>');
246
- });
247
-
248
- it('When the user enters text in the response field, selects the text and then selects the \'Background color\' toolbar option and selects a color from the popup, the respective color should appear as a background color of the text entered in the response field', () => {
249
- essayResponsePage.steps.resetPreviewTabResponseField();
250
- essayResponsePage.responseField()
251
- .type('Lorem Ipsum{selectAll}');
252
- essayResponsePage.previewTabToolbarOption('Background Color')
253
- .click()
254
- .should('have.attr', 'aria-expanded', 'true');
255
- essayResponsePage.steps.selectColorFromPopup('Strong Cyan');
256
- essayResponsePage.responseField()
257
- .verifyInnerHTML('<p><span style="background-color:#1abc9c;">Lorem Ipsum</span></p>');
258
- });
259
-
260
- it('When the user selects the \'Automatic\' option from the \'Background color\' popup, then the background color should get set to the default color', () => {
261
- essayResponsePage.responseField()
262
- .click();
263
- essayResponsePage.previewTabToolbarOption('Background Color')
264
- .click();
265
- essayResponsePage.steps.selectColorFromPopup('Automatic');
266
- essayResponsePage.responseField()
267
- .click()
268
- .type('dolor sit amet');
269
- essayResponsePage.responseField()
270
- .verifyInnerHTML('<p><span style="background-color:#1abc9c;">Lorem Ipsum</span>​​​​​​​dolor sit amet</p>')
271
- });
272
-
273
- essayResponsePage.tests.verifyUndoAndRedoFunctionalityForPreviewTabToolbarOption('Background Color');
274
-
275
- it('When the user clicks on the \'Text color\' toolbar option, a popup with an \'Automatic\' color option and a color pallete should be displayed and if the user clicks anywhere outside the popup, then the popup should disappear', () => {
276
- essayResponsePage.steps.resetPreviewTabResponseField();
277
- essayResponsePage.previewTabToolbarOption('Text Color')
278
- .click();
279
- essayResponsePage.previewTabToolbarOption('Text Color')
280
- .should('have.attr', 'aria-expanded', 'true');
281
- essayResponsePage.previewTabColorPalettePopup()
282
- .its('0.contentDocument.body').should('not.be.empty')
283
- .within(() => {
284
- cy.get('[title="Colors"]')
285
- .find('[title="Automatic"]')
286
- .should('be.visible');
287
- });
288
- cy.get('body')
289
- .click();
290
- essayResponsePage.previewTabColorPalettePopup()
291
- .should('not.be.visible');
292
- });
293
-
294
- it('When the user selects the \'Text color\' toolbar option and selects a color from the popup, the respective color should appear as color of the text entered in the response field', () => {
295
- essayResponsePage.previewTabToolbarOption('Text Color')
296
- .click();
297
- essayResponsePage.steps.selectColorFromPopup('Strong Cyan');
298
- essayResponsePage.responseField()
299
- .type('Lorem Ipsum')
300
- .verifyInnerHTML('<p><span style="color:#1abc9c;">​​​​​​​Lorem Ipsum</span><br></p>');
301
- });
302
-
303
- it('When the user enters text in the response field, selects the text and then selects the \'text color\' toolbar option and selects a color from the popup, the respective color should appear as a text color of the text entered in the response field', () => {
304
- essayResponsePage.steps.resetPreviewTabResponseField();
305
- essayResponsePage.responseField()
306
- .type('Lorem Ipsum{selectAll}');
307
- essayResponsePage.previewTabToolbarOption('Text Color')
308
- .click()
309
- .should('have.attr', 'aria-expanded', 'true');
310
- essayResponsePage.steps.selectColorFromPopup('Strong Cyan');
311
- essayResponsePage.responseField()
312
- .type('Lorem Ipsum')
313
- .verifyInnerHTML('<p><span style="color:#1abc9c;">Lorem Ipsum</span></p>');
314
- });
315
-
316
- it('When the user selects the \'Automatic\' option from the \'text color\' popup, then the text color should get set to the default color', () => {
317
- essayResponsePage.previewTabToolbarOption('Text Color')
318
- .click();
319
- essayResponsePage.steps.selectColorFromPopup('Automatic');
320
- essayResponsePage.responseField()
321
- .type('dolor sit amet');
322
- essayResponsePage.responseField()
323
- .verifyInnerHTML('<p><span style="color:#1abc9c;">Lorem Ipsum</span>​​​​​​​dolor sit amet</p>')
324
- });
325
-
326
- essayResponsePage.tests.verifyUndoAndRedoFunctionalityForPreviewTabToolbarOption('Text Color');
327
- });
328
-
329
180
  describe('Remove formatting toolbar option - Preview tab', () => {
330
181
  abortEarlySetup();
331
182
  before(() => {
332
183
  essayResponsePage.steps.navigateToCreateQuestion('essay response');
333
184
  cy.barsPreLoaderWait();
334
185
  essayResponsePage.steps.expandCustomizeFormattingOptionsAccordion();
335
- essayResponsePage.steps.selectCustomizedFormattingOption(['Strikethrough', 'Subscript', 'Align Left', 'Align Right', 'Code Inline', 'Background Color', 'Text Color', 'Remove Format', 'Undo', 'Redo']);
186
+ essayResponsePage.steps.selectCustomizedFormattingOption(['Strikethrough', 'Superscript', 'Subscript', 'Align Left', 'Align Right', 'Code Inline', 'Remove Format']);
336
187
  essayResponsePage.steps.switchToPreviewTab();
337
- essayResponsePage.responseField()
338
- .type('Lorem Ipsum{selectAll}');
188
+ essayResponsePage.steps.enterInputInResponseField('Lorem Ipsum{selectAll}');
339
189
  });
340
190
 
341
191
  it('When the user has selected text in the response field and applies text formatting options - Bold, Italic, Underline, Strikethrough and clicks on the \'Remove format\' toolbar option, then all the text formatting should get removed and the text should be displayed in default format', () => {
@@ -343,12 +193,9 @@ describe('Create question page - Essay Response: Customize formatting options (f
343
193
  essayResponsePage.steps.selectPreviewTabToolbarOption('Italic (Ctrl+I)');
344
194
  essayResponsePage.steps.selectPreviewTabToolbarOption('Underline (Ctrl+U)');
345
195
  essayResponsePage.steps.selectPreviewTabToolbarOption('Strikethrough');
346
- essayResponsePage.responseField()
347
- .verifyInnerHTML('<p><s><u><em><strong>Lorem Ipsum</strong></em></u></s></p>');
348
- essayResponsePage.previewTabToolbarOption('Remove Format')
349
- .click();
350
- essayResponsePage.responseField()
351
- .verifyInnerHTML('<p>Lorem Ipsum</p>');
196
+ essayResponsePage.steps.verifyResponseFieldHTML('<p><s><u><em><strong>Lorem Ipsum</strong></em></u></s></p>');
197
+ essayResponsePage.steps.selectPreviewTabToolbarOption('Remove Format')
198
+ essayResponsePage.steps.verifyResponseFieldHTML('<p>Lorem Ipsum</p>');
352
199
  });
353
200
 
354
201
  essayResponsePage.tests.verifyUndoAndRedoFunctionalityForPreviewTabToolbarOption('Remove Format');
@@ -356,122 +203,70 @@ describe('Create question page - Essay Response: Customize formatting options (f
356
203
  it('When the user has selected text in the response field and applies text formatting options - Superscript, Subscript and clicks on the \'Remove format\' toolbar option, then all the text formatting should get removed and the text should be displayed in default format', () => {
357
204
  essayResponsePage.steps.selectPreviewTabToolbarOption('Superscript');
358
205
  essayResponsePage.steps.selectPreviewTabToolbarOption('Subscript');
359
- essayResponsePage.responseField()
360
- .verifyInnerHTML('<p><sub><sup>Lorem Ipsum</sup></sub></p>');
361
- essayResponsePage.previewTabToolbarOption('Remove Format')
362
- .click();
363
- essayResponsePage.responseField()
364
- .verifyInnerHTML('<p>Lorem Ipsum</p>');
365
- });
366
-
367
- it('When the user has selected text in the response field and applies text formatting options - Background color, Text color and clicks on the \'Remove format\' toolbar option, then all the text formatting should get removed and the text should be displayed in default format', () => {
368
- essayResponsePage.previewTabToolbarOption('Background Color')
369
- .click();
370
- essayResponsePage.steps.selectColorFromPopup('Strong Cyan');
371
- essayResponsePage.previewTabToolbarOption('Text Color')
372
- .click();
373
- essayResponsePage.steps.selectColorFromPopup('Emerald');
374
- essayResponsePage.responseField()
375
- .verifyInnerHTML('<p><span style=\"color:#2ecc71;\"><span style=\"background-color:#1abc9c;\">Lorem Ipsum</span></span></p>');
376
- essayResponsePage.previewTabToolbarOption('Remove Format')
377
- .click();
378
- essayResponsePage.responseField()
379
- .verifyInnerHTML('<p>Lorem Ipsum</p>');
206
+ essayResponsePage.steps.verifyResponseFieldHTML('<p><sub><sup>Lorem Ipsum</sup></sub></p>');
207
+ essayResponsePage.steps.selectPreviewTabToolbarOption('Remove Format')
208
+ essayResponsePage.steps.verifyResponseFieldHTML('<p>Lorem Ipsum</p>');
380
209
  });
381
210
 
382
211
  it('When the user has selected text in the response field and applies text formatting option - Align right/Center/Justify and clicks on the \'Remove format\' toolbar option, then all the text formatting should get removed and the text should be displayed in default format', () => {
383
212
  essayResponsePage.steps.selectPreviewTabToolbarOption('Align Right');
384
- essayResponsePage.responseField()
385
- .verifyInnerHTML('<p style=\"text-align: right;\">Lorem Ipsum</p>');
386
- essayResponsePage.previewTabToolbarOption('Remove Format')
387
- .click();
388
- essayResponsePage.responseField()
389
- .verifyInnerHTML('<p>Lorem Ipsum</p>');
213
+ essayResponsePage.steps.verifyResponseFieldHTML('<p style=\"text-align: right;\">Lorem Ipsum</p>');
214
+ essayResponsePage.steps.selectPreviewTabToolbarOption('Remove Format')
215
+ essayResponsePage.steps.verifyResponseFieldHTML('<p>Lorem Ipsum</p>');
390
216
  });
391
217
 
392
218
  it('When the user has selected text in the response field and applies text formatting option - Code inline and clicks on the \'Remove format\' toolbar option, then all the text formatting should get removed and the text should be displayed in default format', () => {
393
219
  essayResponsePage.steps.selectPreviewTabToolbarOption('Code Inline');
394
- essayResponsePage.responseField()
395
- .verifyInnerHTML('<p><code>Lorem Ipsum</code></p>');
396
- essayResponsePage.previewTabToolbarOption('Remove Format')
397
- .click();
398
- essayResponsePage.responseField()
399
- .verifyInnerHTML('<p>Lorem Ipsum</p>');
220
+ essayResponsePage.steps.verifyResponseFieldHTML('<p><code>Lorem Ipsum</code></p>');
221
+ essayResponsePage.steps.selectPreviewTabToolbarOption('Remove Format')
222
+ essayResponsePage.steps.verifyResponseFieldHTML('<p>Lorem Ipsum</p>');
400
223
  });
401
224
  });
402
225
 
403
- describe('Undo, Redo formatting toolbar options - Preview tab', () => {
226
+ describe('Undo, Redo Controls - Preview tab', () => {
404
227
  abortEarlySetup();
405
228
  before(() => {
406
229
  essayResponsePage.steps.navigateToCreateQuestion('essay response');
407
230
  cy.barsPreLoaderWait();
408
- essayResponsePage.steps.expandCustomizeFormattingOptionsAccordion();
409
- essayResponsePage.steps.selectCustomizedFormattingOption(['Undo', 'Redo']);
410
231
  essayResponsePage.steps.switchToPreviewTab();
411
232
  });
412
233
 
413
234
  it('When the user has not made any changes in the response field, the \'Undo\' and \'Redo\' toolbar options should be in disabled state', () => {
414
- essayResponsePage.previewTabToolbarOption('Undo (Ctrl+Z)')
415
- .should('have.attr', 'aria-disabled', 'true');
416
- essayResponsePage.previewTabToolbarOption('Redo (Ctrl+Y)')
417
- .should('have.attr', 'aria-disabled', 'true');
235
+ essayResponsePage.steps.verifyPreviewTabToolbarOptionDisabled('Undo (Ctrl+Z)')
236
+ essayResponsePage.steps.verifyPreviewTabToolbarOptionDisabled('Redo (Ctrl+Y)')
418
237
  });
419
238
 
420
239
  it('When the user makes any changes in the response field, the \'Undo\' toolbar option should get enabled but the \'Redo\' toolbar option should continue to stay in disabled state', () => {
421
- essayResponsePage.responseField()
422
- .type('Lorem Ipsum');
423
- essayResponsePage.previewTabToolbarOption('Undo (Ctrl+Z)')
424
- .should('have.attr', 'aria-disabled', 'false');
425
- essayResponsePage.previewTabToolbarOption('Redo (Ctrl+Y)')
426
- .should('have.attr', 'aria-disabled', 'true');
240
+ essayResponsePage.steps.enterInputInResponseField('Lorem ');
241
+ essayResponsePage.steps.focusOutOfResponseField();
242
+ essayResponsePage.steps.enterInputInResponseField('Ipsum')
243
+ essayResponsePage.steps.verifyPreviewTabToolbarOptionNotDisabled('Undo (Ctrl+Z)');
244
+ essayResponsePage.steps.verifyPreviewTabToolbarOptionDisabled('Redo (Ctrl+Y)')
427
245
  });
428
246
 
429
247
  it('When the user clicks on the \'Undo\' toolbar option, it should undo the latest action and when the user performs any undo action, the redo toolbar option should get enabled', () => {
430
- for (var i = 0; i < 2; i++) {
431
- essayResponsePage.previewTabToolbarOption('Undo (Ctrl+Z)')
432
- .click();
433
- }
434
- essayResponsePage.responseField()
435
- .verifyInnerHTML('<p>Lorem Ips</p>');
436
- essayResponsePage.previewTabToolbarOption('Redo (Ctrl+Y)')
437
- .should('have.attr', 'aria-disabled', 'false');
248
+ essayResponsePage.steps.selectPreviewTabToolbarOption('Undo (Ctrl+Z)')
249
+ essayResponsePage.steps.verifyResponseFieldHTML('<p>Lorem</p>');
250
+ essayResponsePage.steps.verifyPreviewTabToolbarOptionNotDisabled('Redo (Ctrl+Y)');
438
251
  });
439
252
 
440
253
  it('When the user has performed an undo action, the user should be able to redo it by clicking on the \'Redo\' toolbar option', () => {
441
- essayResponsePage.previewTabToolbarOption('Redo (Ctrl+Y)')
442
- .click();
443
- essayResponsePage.responseField()
444
- .verifyInnerHTML('<p>Lorem Ipsu</p>');
254
+ essayResponsePage.steps.selectPreviewTabToolbarOption('Redo (Ctrl+Y)')
255
+ essayResponsePage.steps.verifyResponseFieldHTML('<p>Lorem Ipsum</p>');
445
256
  });
446
257
 
447
258
  it('When the user reaches the initial state by performing undo actions, the \'Undo\' toolbar option should get disabled and when the user reaches the latest state by performing redo actions, the \'Redo\' toolbar option should get disabled', () => {
448
- for (var i = 0; i < 10; i++) {
449
- essayResponsePage.previewTabToolbarOption('Undo (Ctrl+Z)')
450
- .click();
451
- }
452
- essayResponsePage.previewTabToolbarOption('Undo (Ctrl+Z)')
453
- .should('have.attr', 'aria-disabled', 'true');
454
- for (var i = 0; i < 11; i++) {
455
- essayResponsePage.previewTabToolbarOption('Redo (Ctrl+Y)')
456
- .click();
457
- }
458
- essayResponsePage.previewTabToolbarOption('Redo (Ctrl+Y)')
459
- .should('have.attr', 'aria-disabled', 'true');
460
- essayResponsePage.responseField()
461
- .verifyInnerHTML('<p>Lorem Ipsum</p>');
259
+ essayResponsePage.steps.verifyPreviewTabToolbarOptionDisabled('Redo (Ctrl+Y)');
260
+ essayResponsePage.steps.verifyResponseFieldHTML('<p>Lorem Ipsum</p>');
462
261
  });
463
262
 
464
263
  it('The undo toolbar option should get disabled after a certain number of undo actions (18 times)', () => {
465
- essayResponsePage.responseField()
466
- .type(' dolor sit amet, consectetur adipiscing elit. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Donec tristique ipsum sit amet velit laoreet, eget dapibus mi placerat.');
264
+ essayResponsePage.steps.enterInputInResponseField(' dolor sit amet, consectetur adipiscing elit. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Donec tristique ipsum sit amet velit laoreet, eget dapibus mi placerat.');
467
265
  for (var i = 0; i < 19; i++) {
468
- essayResponsePage.previewTabToolbarOption('Undo (Ctrl+Z)')
469
- .click();
266
+ essayResponsePage.steps.selectPreviewTabToolbarOption('Undo (Ctrl+Z)');
470
267
  };
471
- essayResponsePage.previewTabToolbarOption('Undo (Ctrl+Z)')
472
- .should('have.attr', 'aria-disabled', 'true');
473
- essayResponsePage.responseField()
474
- .verifyInnerHTML('<p>Lorem Ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Donec tristique ipsum sit amet velit laoreet, eget d</p>');
268
+ essayResponsePage.steps.verifyPreviewTabToolbarOptionDisabled('Undo (Ctrl+Z)');
269
+ essayResponsePage.steps.verifyResponseFieldHTML('<p>Lorem Ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum ante ipsum primis in faucibus</p>');
475
270
  });
476
271
  });
477
272
 
@@ -481,31 +276,26 @@ describe('Create question page - Essay Response: Customize formatting options (f
481
276
  essayResponsePage.steps.navigateToCreateQuestion('essay response');
482
277
  cy.barsPreLoaderWait();
483
278
  essayResponsePage.steps.expandCustomizeFormattingOptionsAccordion();
484
- essayResponsePage.steps.selectCustomizedFormattingOption(['Text direction left to right', 'Text direction right to left', 'Undo', 'Redo']);
279
+ essayResponsePage.steps.selectCustomizedFormattingOption(['Text direction left to right', 'Text direction right to left']);
485
280
  essayResponsePage.steps.switchToPreviewTab();
486
281
  });
487
282
 
488
283
  it('When the user focuses in the response field, the \'Text direction left to right\' toolbar option should be selected by default and the text entered by the user should move left to right', () => {
489
- essayResponsePage.responseField()
490
- .click();
491
- essayResponsePage.previewTabToolbarOption('Text direction left to right')
492
- .should('have.attr', 'aria-pressed', 'true');
493
- essayResponsePage.responseField()
494
- .type('Lorem Ipsum')
495
- .verifyInnerHTML('<p>Lorem Ipsum</p>');
284
+ essayResponsePage.steps.focusInResponseField()
285
+ essayResponsePage.steps.verifyPreviewTabToolbarOptionSelected('Text direction left to right')
286
+ essayResponsePage.steps.enterInputInResponseField('Lorem Ipsum');
287
+ essayResponsePage.steps.verifyResponseFieldHTML('<p>Lorem Ipsum</p>');
496
288
  });
497
289
 
498
290
  //comment: here we are just checking the direction of the text, not the location of the cursor
499
291
  it('When the user selects the \'Text direction right to left\' the cursor should move to the right and the text entered by the user should have direction from right to left', () => {
500
292
  essayResponsePage.steps.selectPreviewTabToolbarOption('Text direction right to left');
501
- essayResponsePage.responseField()
502
- .verifyInnerHTML('<p dir=\"rtl\">Lorem Ipsum</p>');
293
+ essayResponsePage.steps.verifyResponseFieldHTML('<p dir=\"rtl\">Lorem Ipsum</p>');
503
294
  });
504
295
 
505
296
  it('When the user presses the \'Enter\' key, the cursor should move to the next line and the \'Text direction right to left\' toolbar option should be in selected state', () => {
506
- essayResponsePage.responseField()
507
- .type('{enter}')
508
- .verifyInnerHTML('<p dir=\"rtl\">Lorem Ipsum</p><p dir=\"rtl\"><br></p>');
297
+ essayResponsePage.steps.enterInputInResponseField('{enter}')
298
+ essayResponsePage.steps.verifyResponseFieldHTML('<p dir=\"rtl\">Lorem Ipsum</p><p dir=\"rtl\"><br></p>');
509
299
  });
510
300
 
511
301
  essayResponsePage.tests.verifyUndoAndRedoFunctionalityForPreviewTabToolbarOption('Text direction right to left');
@@ -514,9 +304,8 @@ describe('Create question page - Essay Response: Customize formatting options (f
514
304
  essayResponsePage.steps.resetPreviewTabResponseField();
515
305
  essayResponsePage.steps.selectPreviewTabToolbarOption('Text direction right to left');
516
306
  essayResponsePage.steps.selectPreviewTabToolbarOption('Insert/Remove Bulleted List');
517
- essayResponsePage.responseField()
518
- .type('Lorem Ipsum')
519
- .verifyInnerHTML('<ul dir=\"rtl\"><li>Lorem Ipsum</li></ul>');
307
+ essayResponsePage.steps.enterInputInResponseField('Lorem Ipsum')
308
+ essayResponsePage.steps.verifyResponseFieldHTML('<ul dir=\"rtl\"><li>Lorem Ipsum</li></ul>');
520
309
  });
521
310
  });
522
311
  });