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,137 +1,113 @@
1
1
  import abortEarlySetup from "../../../support/helpers/abortEarly";
2
2
  import { essayResponsePage } from "../../../pages";
3
+ import utilities from "../../../support/helpers/utilities";
4
+ import { equationEditorFlyout } from "../../../pages/components";
3
5
  const css = Cypress.env('css');
4
6
  const grepTags = Cypress.env('grepTags');
5
7
 
6
- const formattingOptions = ['Bold', 'Italic', 'Underline', 'Division', 'Superscript', 'Bulleted List', 'Numbered List', 'Insert Hyperlink', 'Insert Image', 'Special Characters', 'Insert Table', 'Equation Editor', 'Division', 'Code Inline', 'Code Editor', 'Strikethrough', 'Background Color', 'Text Color', 'Subscript', 'Remove Format', 'Division', 'Align Left', 'Align Center', 'Align Right', 'Align Justify', 'Division', 'Increase Indent', 'Decrease Indent', 'Division', 'Text direction left to right', 'Text direction right to left', 'Insert Horizontal Line', 'Block Quote', 'Math characters', 'Division', 'Undo', 'Redo', 'Division'];
7
- const defaultSelectedFormattingOptions = ['Bold', 'Italic', 'Underline', 'Division', 'Superscript', 'Bulleted List', 'Numbered List', 'Insert Hyperlink', 'Insert Image', 'Special Characters', 'Insert Table'];
8
- const defaultFormattingOptionsPreviewTab = ['Bold (Ctrl+B)', 'Italic (Ctrl+I)', 'Underline (Ctrl+U)', 'Superscript', 'Insert/Remove Bulleted List', 'Insert/Remove Numbered List', 'Insert Hyperlink', 'Insert Image', 'Special characters', 'Insert Table'];
9
- const formattingOptionsPreviewTab = ['Bold (Ctrl+B)', 'Italic (Ctrl+I)', 'Underline (Ctrl+U)', 'Superscript', 'Insert/Remove Bulleted List', 'Insert/Remove Numbered List', 'Insert Hyperlink', 'Insert Image', 'Special characters', 'Insert Table', 'Equation Editor', 'Code Inline', 'Code Editor', 'Strikethrough', 'Background Color', 'Text Color', 'Subscript', 'Remove Format', 'Align Left', 'Align Center', 'Align Right', 'Align Justify', 'Increase Indent', 'Decrease Indent', 'Text direction left to right', 'Text direction right to left', 'Insert Horizontal Line', 'Block Quote', 'Math characters', 'Undo (Ctrl+Z)', 'Redo (Ctrl+Y)'];
8
+ const formattingOptions = ['Bold', 'Italic', 'Underline', 'Bulleted List', 'Numbered List', 'Insert Table', 'Increase Indent', 'Decrease Indent', 'Equation Editor', 'Insert Image', 'Strikethrough', 'Subscript', 'Superscript', 'Special Characters', 'Math Characters', 'Insert Hyperlink', 'Block Quote', 'Remove Format', 'Code Inline', 'Code Editor', 'Align Left', 'Align Center', 'Align Right', 'Align Justify', 'Text direction left to right', 'Text direction right to left', 'Insert Horizontal Line', 'Font size', 'Font Color', 'Highlight Text'];
9
+ const defaultSelectedFormattingOptions = ['Bold', 'Italic', 'Underline', 'Bulleted List', 'Numbered List', 'Insert Table', 'Increase Indent', 'Decrease Indent'];
10
+ const defaultFormattingOptionsPreviewTab = ['Bold (Ctrl+B)', 'Italic (Ctrl+I)', 'Underline (Ctrl+U)', 'Insert/Remove Bulleted List', 'Insert/Remove Numbered List', 'Insert Table', 'Increase Indent', 'Decrease Indent'];
11
+ const formattingOptionsPreviewTab = ['Bold (Ctrl+B)', 'Italic (Ctrl+I)', 'Underline (Ctrl+U)', 'Insert/Remove Bulleted List', 'Insert/Remove Numbered List', 'Insert Table', 'Increase Indent', 'Decrease Indent', 'Equation Editor', 'Insert Image', 'Strikethrough', 'Subscript', 'Superscript', 'Special characters', 'Math characters', 'Insert Hyperlink', 'Block Quote', 'Remove Format', 'Code Inline', 'Code Editor', 'Align Left', 'Align Center', 'Align Right', 'Align Justify', 'Text direction left to right', 'Text direction right to left', 'Insert Horizontal Line', 'Font Size', 'Text Color', 'Highlight Text', 'Undo (Ctrl+Z)', 'Redo (Ctrl+Y)'];
12
+
10
13
  describe('Create question page - Essay Response: Customize formatting options (for student player) accordion contents, toolbar options', () => {
11
14
  before(() => {
12
15
  cy.loginAs('admin');
13
16
  });
14
17
 
15
- //Failing due to https://redmine.zeuslearning.com/issues/530059, https://redmine.zeuslearning.com/issues/525223
16
- describe('Customize formatting options (for student player) accordion contents', { tags: 'smoke' }, () => {
18
+ describe('Customize formatting options accordion contents', { tags: 'smoke' }, () => {
17
19
  abortEarlySetup();
18
20
  before(() => {
19
21
  essayResponsePage.steps.navigateToCreateQuestion('essay response');
20
22
  });
21
23
 
22
- it('By default \'Customize formatting options (for student player)\' accordion should be collapsed and by clicking on the \'Customize formatting options (for student player)\' accordion, user should be able to expand the accordion', () => {
23
- essayResponsePage.customizeFormattingOptionsAccordion()
24
- .verifyInnerText('Customize formatting options (for student player)')
25
- .should('have.attr', 'aria-expanded', 'false');
26
- essayResponsePage.customizeFormattingOptionsAccordion()
27
- .click()
28
- .should('have.attr', 'aria-expanded', 'true');
24
+ it('By default \'Customize formatting options\' accordion should be collapsed and by clicking on the \'Customize formatting options (for student player)\' accordion, user should be able to expand the accordion', () => {
25
+ utilities.verifyInnerText(essayResponsePage.customizeFormattingOptionsAccordionLabel(), 'Customize toolbar options and controls');
26
+ utilities.verifyElementVisibilityState(essayResponsePage.customizeFormattingOptionsSectionExpandIcon(), 'exist');
27
+ essayResponsePage.steps.expandCustomizeFormattingOptionsAccordion();
29
28
  });
30
29
 
31
30
  it('CSS of \'Customize formatting options (for student player)\' accordion and contents', { tags: 'css' }, () => {
32
31
  cy.log('CSS of accordion label and chevron icon')
33
- essayResponsePage.customizeFormattingOptionsAccordionLabel()
34
- .verifyCSS(css.color.accordionLabel, css.fontSize.default, css.fontWeight.bold);
35
- essayResponsePage.customizeFormattingOptionsAccordion()
36
- .find('svg')
37
- .should('have.css', 'fill', css.color.activeButtons);
32
+ utilities.verifyCSS(essayResponsePage.customizeFormattingOptionsAccordionLabel(), {
33
+ 'color': css.color.accordionLabel,
34
+ 'font-size': css.fontSize.default,
35
+ 'font-weight': css.fontWeight.bold
36
+ });
37
+ utilities.verifyCSS(essayResponsePage.customizeFormattingOptionsAccordion().find('svg'), {
38
+ 'fill': css.color.activeButtons
39
+ });
38
40
  cy.log('CSS of selected toolbar formatting option')
39
- essayResponsePage.customizeFormattingOptionsTiles('Bold')
40
- .should('have.css', 'background-color', css.color.primaryBtnBg)
41
+ utilities.verifyCSS(essayResponsePage.customizeFormattingOptionsTiles('Bold'), {
42
+ 'background-color': css.color.primaryBtnBg
43
+ });
41
44
  cy.log('CSS of tick icon of selected toolbar formatting option')
42
- essayResponsePage.customizeFormattingOptionsTiles('Bold')
43
- .find('[data-name="Icon feather-check"]')
44
- .should('have.css', 'fill', css.color.activeButtons);
45
+ utilities.verifyCSS(essayResponsePage.customizeFormattingOptionsTiles('Bold').find('[data-name="Icon feather-check"]'), {
46
+ 'fill': css.color.activeButtons
47
+ });
45
48
  cy.log('CSS of background of tick icon of selected toolbar formatting option')
46
- essayResponsePage.customizeFormattingOptionsTiles('Bold')
47
- .find('[data-name*="Rectangle"]')
48
- .should('have.css', 'fill', css.color.defaultBackground);
49
+ utilities.verifyCSS(essayResponsePage.customizeFormattingOptionsTiles('Bold').find('[data-name*="Rectangle"]'), {
50
+ 'fill': css.color.defaultBackground
51
+ });
49
52
  cy.log('CSS of icon of selected toolbar formatting option')
50
- essayResponsePage.customizeFormattingOptionsTiles('Bold')
51
- .find('.drag-item-flex-wrapper svg')
52
- .should('have.css', 'fill', css.color.primaryBtn);
53
+ utilities.verifyCSS(essayResponsePage.customizeFormattingOptionsTiles('Bold').find('.drag-item-flex-wrapper svg'), {
54
+ 'fill': css.color.primaryBtn
55
+ });
53
56
  cy.log('CSS of drag handle of selected toolbar formatting option')
54
- essayResponsePage.customizeFormattingOptionsTiles('Bold')
55
- .find('.drag-icon-button-custom-format svg path')
56
- .eq(1)
57
- .should('have.css', 'color', css.color.activeButtons);
57
+ utilities.verifyCSS(essayResponsePage.customizeFormattingOptionsTiles('Bold').find('.drag-icon-button-custom-format svg path').eq(1), {
58
+ 'color': css.color.activeButtons
59
+ });
58
60
  cy.log('CSS of unselected toolbar formatting option')
59
- essayResponsePage.customizeFormattingOptionsTiles('Code Inline')
60
- .should('have.css', 'background-color', css.color.secondaryBtnBg);
61
+ utilities.verifyCSS(essayResponsePage.customizeFormattingOptionsTiles('Code Inline'), {
62
+ 'background-color': css.color.secondaryBtnBg
63
+ });
61
64
  cy.log('CSS of icon of unselected toolbar formatting option')
62
- essayResponsePage.customizeFormattingOptionsTiles('Code Inline')
63
- .find('.drag-item-flex-wrapper path')
64
- .eq(1)
65
- .should('have.css', 'fill', css.color.secondaryBtn);
65
+ utilities.verifyCSS(essayResponsePage.customizeFormattingOptionsTiles('Code Inline').find('.drag-item-flex-wrapper path').eq(1), {
66
+ 'fill': css.color.secondaryBtn
67
+ });
66
68
  cy.log('CSS of drag handle of unselected toolbar formatting option')
67
- essayResponsePage.customizeFormattingOptionsTiles('Code Inline')
68
- .find('.drag-icon-button-custom-format svg path')
69
- .eq(1)
70
- .should('have.css', 'fill', css.color.secondaryBtn);
69
+ utilities.verifyCSS(essayResponsePage.customizeFormattingOptionsTiles('Code Inline').find('.drag-icon-button-custom-format svg path').eq(1), {
70
+ 'fill': css.color.secondaryBtn
71
+ });
71
72
  });
72
73
 
73
74
  it('Accessibility of \'Customize formatting options (for student player)\' accordion and contents', { tags: 'a11y' }, () => {
74
- cy.checkAccessibility(essayResponsePage.customizeFormattingOptionsAccordion().parents('.Mui-expanded'));
75
+ cy.checkAccessibility(essayResponsePage.customizeFormattingOptionsWrapper());
75
76
  });
76
77
 
77
78
  it('When \'Customize formatting options (for student player)\' accordion is in expanded state, then all the formatting options should be displayed along with drag handle.', () => {
78
- formattingOptions.forEach((optionName, count) => {
79
- cy.get('.icon-button-custom-format')
80
- .eq(count)
81
- .should('have.attr', 'title', optionName)
82
- .within(() => {
83
- essayResponsePage.customizeFormattingOptionsdragHandleButton()
84
- .should('be.visible');
85
- });
86
- });
79
+ essayResponsePage.steps.verifyCustomizeToolbarOptions(formattingOptions);
80
+ utilities.verifyElementCount(essayResponsePage.customizeFormattingOptionsDragHandleButton(), 30);
87
81
  });
88
82
 
89
- it('When the \'Customize formatting options (for student player)\' accordion is in expanded state, then the following options should be in selected state by default - \'Bold, Italic, Underline, Division, Superscript, Bulleted list, Numbered list, Link, Insert Image, Special Characterss, Table\'. All the other options should be in unselected state.', () => {
90
- defaultSelectedFormattingOptions.forEach((option, count) => {
91
- cy.get('.icon-button-custom-format')
92
- .eq(count)
93
- .should('have.attr', 'data-aria-pressed', 'true');
83
+ it(`When the \'Customize formatting options (for student player)\' accordion is in expanded state, then the following options should be in selected state by default - ${defaultSelectedFormattingOptions}. All the other options should be in unselected state.`, () => {
84
+ defaultSelectedFormattingOptions.forEach((option) => {
85
+ essayResponsePage.steps.verifyCustomizeFormattingOptionIsSelected(option);
86
+ });
87
+ formattingOptions.splice(8, formattingOptions.length).forEach((option) => {
88
+ essayResponsePage.steps.verifyCustomizeFormattingOptionNotSelected(option);
94
89
  });
95
- for (let index = 11; index < formattingOptions.length; index++) {
96
- cy.get('.icon-button-custom-format')
97
- .eq(index)
98
- .should('have.attr', 'data-aria-pressed', 'false');
99
- };
100
90
  });
101
91
 
102
92
  it('User should be able to unselect any default selected formatting option and should be able to select any default unselected formatting option and the changes should be reflected in the toolbar in the preview tab', () => {
103
- essayResponsePage.customizeFormattingOptionsTiles('Superscript')
104
- .click()
105
- .should('have.attr', 'data-aria-pressed', 'false');
106
- essayResponsePage.customizeFormattingOptionsTiles('Strikethrough')
107
- .click()
108
- .should('have.attr', 'data-aria-pressed', 'true');
93
+ essayResponsePage.steps.deselectCustomizedFormattingOption(['Increase Indent']);
94
+ essayResponsePage.steps.selectCustomizedFormattingOption(['Strikethrough']);
109
95
  essayResponsePage.steps.switchToPreviewTab();
110
- essayResponsePage.previewTabToolbarOption('Strikethrough')
111
- .should('be.visible');
112
- essayResponsePage.previewTabToolbarOption('Superscript')
113
- .should('not.exist');
96
+ utilities.verifyElementVisibilityState(essayResponsePage.previewTabToolbarOption('Strikethrough'), 'visible');
97
+ utilities.verifyElementVisibilityState(essayResponsePage.previewTabToolbarOption('Increase Indent'), 'notExist');
114
98
  });
115
99
 
116
100
  it('When the user selects the \'Equation editor\' formatting option, the \'Equation editor\' section should be displayed below the formatting options. On deselecting \'Equation editor\' formatting option, \'Equation editor\' section should disappear', () => {
117
101
  cy.log('Switching to edit tab')
118
102
  essayResponsePage.steps.switchToEditTab();
119
- essayResponsePage.customizeFormattingOptionsTiles('Equation Editor')
120
- .click()
121
- .should('have.attr', 'data-aria-pressed', 'true');
122
- essayResponsePage.equationEditorOptionsWrapper()
123
- .should('be.visible');
124
- essayResponsePage.customizeFormattingOptionsTiles('Equation Editor')
125
- .click()
126
- .should('have.attr', 'data-aria-pressed', 'false');
127
- essayResponsePage.equationEditorOptionsWrapper()
128
- .should('not.exist');
103
+ essayResponsePage.steps.selectCustomizedFormattingOption(['Equation Editor']);
104
+ utilities.verifyElementVisibilityState(essayResponsePage.equationEditorSectionCategories(), 'visible');
105
+ essayResponsePage.steps.deselectCustomizedFormattingOption(['Equation Editor']);
106
+ utilities.verifyElementVisibilityState(essayResponsePage.equationEditorSectionWrapper(), 'notExist');
129
107
  });
130
108
 
131
109
  it('User should be able to collapse \'Customize formatting options (for student player)\' accordion.', () => {
132
- essayResponsePage.customizeFormattingOptionsAccordion()
133
- .click()
134
- .should('have.attr', 'aria-expanded', 'false');
110
+ essayResponsePage.steps.collapseCustomizeFormattingOptionsAccordion();
135
111
  });
136
112
  });
137
113
 
@@ -139,71 +115,35 @@ describe('Create question page - Essay Response: Customize formatting options (f
139
115
  abortEarlySetup();
140
116
  before(() => {
141
117
  essayResponsePage.steps.navigateToCreateQuestion('essay response');
142
- cy.barsPreLoaderWait();
143
- essayResponsePage.steps.switchToPreviewTab();
144
118
  });
145
119
 
146
- it('When the user switches to Preview tab, then the following options should be displayed in the response field toolbar - \'Bold, Italic, Underline, Superscript, Bulleted list, Numbered list, Link, Insert Image, Special Characters, Table\' along with a separator after \'Underline\' option', () => {
147
- essayResponsePage.previewTabToolbarWrapper()
148
- .within(() => {
149
- defaultFormattingOptionsPreviewTab.forEach((optionName, count) => {
150
- cy.get('.cke_button')
151
- .eq(count)
152
- .should('have.attr', 'title', optionName)
153
- .and('be.visible');
154
- });
155
- });
156
- essayResponsePage.previewTabToolbarOption('Underline (Ctrl+U)')
157
- .next()
158
- .should('have.attr', 'role', 'separator')
159
- .should('be.visible');
120
+ it(`When the user switches to Preview tab, then the following options should be displayed in the response field toolbar - ${defaultFormattingOptionsPreviewTab}`, () => {
121
+ essayResponsePage.steps.switchToPreviewTab();
122
+ essayResponsePage.steps.verifyPreviewTabToolbarOptions(defaultFormattingOptionsPreviewTab);
160
123
  });
161
124
 
162
- it('When the user selects all formatting options from the \'Customize formatting options (for student player)\' accordion, all formatting options should appear in the preview tab along with separator after \'Underline\', \'Equation Editor\', \'Remove Format\', \'Justify\', \'Decrease indent\', \'Math characters\' options', () => {
163
- let separatorInToolbarContents = ['Underline (Ctrl+U)', 'Equation Editor', 'Remove Format', 'Align Justify', 'Decrease Indent', 'Math characters']
164
- essayResponsePage.steps.switchToEditTab()
125
+ it('When the user selects all formatting options from the \'Customize formatting options\' accordion, all formatting options should appear in the preview tab', () => {
126
+ essayResponsePage.steps.switchToEditTab();
165
127
  essayResponsePage.steps.expandCustomizeFormattingOptionsAccordion();
166
- for (let index = 11; index < formattingOptions.length; index++) {
167
- cy.get('.icon-button-custom-format')
168
- .eq(index)
169
- .click()
170
- .should('have.attr', 'data-aria-pressed', 'true');
171
- };
172
- essayResponsePage.steps.switchToPreviewTab();
173
- essayResponsePage.previewTabToolbarWrapper()
174
- .within(() => {
175
- formattingOptionsPreviewTab.forEach((optionName, count) => {
176
- cy.get('.cke_button')
177
- .eq(count)
178
- .should('have.attr', 'title', optionName)
179
- .and('be.visible');
180
- });
181
- });
182
- separatorInToolbarContents.forEach((toolbarOption) => {
183
- essayResponsePage.previewTabToolbarOption(toolbarOption)
184
- .next()
185
- .should('have.attr', 'role', 'separator')
186
- .should('be.visible');
128
+ essayResponsePage.steps.selectCustomizedFormattingOption(formattingOptions.splice(8, formattingOptions.length));
129
+ formattingOptions.forEach((option) => {
130
+ essayResponsePage.steps.verifyCustomizeFormattingOptionIsSelected(option);
187
131
  });
132
+ essayResponsePage.steps.switchToPreviewTab();
133
+ essayResponsePage.steps.verifyPreviewTabToolbarOptions(formattingOptionsPreviewTab);
188
134
  });
189
135
 
190
- it('In the customized formatting options menu, if the user has selected a divider line at the end, then that line should not be present in the essay response toolbar', () => {
191
- essayResponsePage.previewTabToolbarSeperator()
192
- .should('have.length', 6);
193
- });
194
-
195
- it('All options should be in enabled state except \'Left indent\', \'Undo\', \'Redo\' options which should be in disabled state', () => {
136
+ it('All options should be in enabled state except \'Decrease Indent\', \'Undo\', \'Redo\' options which should be in disabled state', () => {
196
137
  let disabledOptions = ['Decrease Indent', 'Undo (Ctrl+Z)', 'Redo (Ctrl+Y)']
197
138
  disabledOptions.forEach((optionName) => {
198
- essayResponsePage.previewTabToolbarOption(optionName)
199
- .should('have.attr', 'aria-disabled', 'true');
139
+ essayResponsePage.steps.verifyPreviewTabToolbarOptionDisabled(optionName)
200
140
  });
201
141
  });
202
142
 
203
143
  it('CSS of formatting options in Preview tab', { tags: 'css' }, () => {
204
- essayResponsePage.previewTabToolbarOption('Bold (Ctrl+B)')
205
- .find('.cke_button_icon')
206
- .should('have.css', 'color', css.color.activeButtons);
144
+ utilities.verifyCSS(essayResponsePage.previewTabToolbarOption('Bold (Ctrl+B)'), {
145
+ 'color': css.color.activeButtons
146
+ });
207
147
  });
208
148
 
209
149
  it('Accessibility of formatting options in Preview tab', { tags: 'a11y' }, () => {
@@ -218,7 +158,7 @@ describe('Create question page - Essay Response: Customize formatting options (f
218
158
  essayResponsePage.steps.navigateToCreateQuestion('essay response');
219
159
  cy.barsPreLoaderWait();
220
160
  essayResponsePage.steps.expandCustomizeFormattingOptionsAccordion();
221
- essayResponsePage.steps.selectCustomizedFormattingOption(['Strikethrough', 'Undo', 'Redo']);
161
+ essayResponsePage.steps.selectCustomizedFormattingOption(['Strikethrough']);
222
162
  essayResponsePage.steps.switchToPreviewTab();
223
163
  });
224
164
 
@@ -228,108 +168,86 @@ describe('Create question page - Essay Response: Customize formatting options (f
228
168
 
229
169
  it('When the user selects the \'Bold\' toolbar option and enters text in the response field, then the text should be displayed in bold and if the user deselects the \'Bold\' toolbar option and continues to types, then the entered text should be displayed in default format', () => {
230
170
  essayResponsePage.steps.selectPreviewTabToolbarOption('Bold (Ctrl+B)');
231
- essayResponsePage.responseField()
232
- .type('Lorem Ipsum')
233
- .verifyInnerHTML('<p><strong>​​​​​​​Lorem Ipsum</strong><br></p>');
171
+ essayResponsePage.steps.enterInputInResponseField('Lorem Ipsum');
172
+ essayResponsePage.steps.verifyResponseFieldHTML('<p><strong>​​​​​​​Lorem Ipsum</strong><br></p>');
234
173
  essayResponsePage.steps.deselectPreviewTabToolbarOption('Bold (Ctrl+B)');
235
- essayResponsePage.responseField()
236
- .type(' dolor')
237
- .verifyInnerHTML('<p><strong>Lorem Ipsum</strong>​​​​​​​ dolor<br></p>');
174
+ essayResponsePage.steps.enterInputInResponseField(' dolor');
175
+ essayResponsePage.steps.verifyResponseFieldHTML('<p><strong>Lorem Ipsum</strong>​​​​​​​ dolor<br></p>');
238
176
  });
239
177
 
240
178
  it('When the user enters text in the response field, selects the text and then selects the \'Bold\' toolbar option, then the should be displayed in bold and if the user deselects the \'Bold\' toolbar option, then the entered text should be displayed in default format', () => {
241
- essayResponsePage.responseField()
242
- .type('Lorem Ipsum{selectAll}');
179
+ essayResponsePage.steps.enterInputInResponseField('Lorem Ipsum{selectAll}');
243
180
  essayResponsePage.steps.selectPreviewTabToolbarOption('Bold (Ctrl+B)');
244
- essayResponsePage.responseField()
245
- .verifyInnerHTML('<p><strong>Lorem Ipsum</strong></p>');
181
+ essayResponsePage.steps.verifyResponseFieldHTML('<p><strong>Lorem Ipsum</strong></p>');
246
182
  essayResponsePage.steps.deselectPreviewTabToolbarOption('Bold (Ctrl+B)');
247
- essayResponsePage.responseField()
248
- .verifyInnerHTML('<p>Lorem Ipsum</p>');
183
+ essayResponsePage.steps.verifyResponseFieldHTML('<p>Lorem Ipsum</p>');
249
184
  });
250
185
 
251
186
  essayResponsePage.tests.verifyUndoAndRedoFunctionalityForPreviewTabToolbarOption('Bold (Ctrl+B)');
252
187
 
253
188
  it('When the user selects the \'Italic\' toolbar option and enters text in the response field, then the text should be displayed in italic and if the user deselects the \'Italic\' toolbar option and continues to types, then the entered text should be displayed in default format', () => {
254
189
  essayResponsePage.steps.selectPreviewTabToolbarOption('Italic (Ctrl+I)');
255
- essayResponsePage.responseField()
256
- .type('Lorem Ipsum')
257
- .verifyInnerHTML('<p><em>​​​​​​​Lorem Ipsum</em><br></p>');
190
+ essayResponsePage.steps.enterInputInResponseField('Lorem Ipsum');
191
+ essayResponsePage.steps.verifyResponseFieldHTML('<p><em>​​​​​​​Lorem Ipsum</em><br></p>');
258
192
  essayResponsePage.steps.deselectPreviewTabToolbarOption('Italic (Ctrl+I)');
259
- essayResponsePage.responseField()
260
- .type(' dolor')
261
- .verifyInnerHTML('<p><em>Lorem Ipsum</em>​​​​​​​ dolor<br></p>');
193
+ essayResponsePage.steps.enterInputInResponseField(' dolor');
194
+ essayResponsePage.steps.verifyResponseFieldHTML('<p><em>Lorem Ipsum</em>​​​​​​​ dolor<br></p>');
262
195
  });
263
196
 
264
197
  it('When the user enters text in the response field, selects the text and then selects the \'Italic\' toolbar option, then the should be displayed in italic and if the user deselects the \'Italic\' toolbar option, then the entered text should be displayed in default format', () => {
265
- essayResponsePage.responseField()
266
- .type('Lorem Ipsum{selectAll}');
198
+ essayResponsePage.steps.enterInputInResponseField('Lorem Ipsum{selectAll}');
267
199
  essayResponsePage.steps.selectPreviewTabToolbarOption('Italic (Ctrl+I)');
268
- essayResponsePage.responseField()
269
- .verifyInnerHTML('<p><em>Lorem Ipsum</em></p>');
200
+ essayResponsePage.steps.verifyResponseFieldHTML('<p><em>Lorem Ipsum</em></p>');
270
201
  essayResponsePage.steps.deselectPreviewTabToolbarOption('Italic (Ctrl+I)');
271
- essayResponsePage.responseField()
272
- .verifyInnerHTML('<p>Lorem Ipsum</p>');
202
+ essayResponsePage.steps.verifyResponseFieldHTML('<p>Lorem Ipsum</p>');
273
203
  });
274
204
 
275
205
  essayResponsePage.tests.verifyUndoAndRedoFunctionalityForPreviewTabToolbarOption('Italic (Ctrl+I)');
276
206
 
277
207
  it('When the user selects the \'Underline\' toolbar option and enters text in the response field, then the text should get underlined and if the user deselects the \'Underline\' toolbar option and continues to types, then the entered text should be displayed in default format', () => {
278
208
  essayResponsePage.steps.selectPreviewTabToolbarOption('Underline (Ctrl+U)');
279
- essayResponsePage.responseField()
280
- .type('Lorem Ipsum')
281
- .verifyInnerHTML('<p><u>​​​​​​​Lorem Ipsum</u><br></p>');
209
+ essayResponsePage.steps.enterInputInResponseField('Lorem Ipsum');
210
+ essayResponsePage.steps.verifyResponseFieldHTML('<p><u>​​​​​​​Lorem Ipsum</u><br></p>');
282
211
  essayResponsePage.steps.deselectPreviewTabToolbarOption('Underline (Ctrl+U)');
283
- essayResponsePage.responseField()
284
- .type(' dolor')
285
- .verifyInnerHTML('<p><u>Lorem Ipsum</u>​​​​​​​ dolor<br></p>');
212
+ essayResponsePage.steps.enterInputInResponseField(' dolor');
213
+ essayResponsePage.steps.verifyResponseFieldHTML('<p><u>Lorem Ipsum</u>​​​​​​​ dolor<br></p>');
286
214
  });
287
215
 
288
216
  it('When the user enters text in the response field, selects the text and then selects the \'Underline\' toolbar option, then the should get underlined and if the user deselects the \'Underline\' toolbar option, then the entered text should be displayed in default format', () => {
289
- essayResponsePage.responseField()
290
- .type('Lorem Ipsum{selectAll}');
217
+ essayResponsePage.steps.enterInputInResponseField('Lorem Ipsum{selectAll}');
291
218
  essayResponsePage.steps.selectPreviewTabToolbarOption('Underline (Ctrl+U)');
292
- essayResponsePage.responseField()
293
- .verifyInnerHTML('<p><u>Lorem Ipsum</u></p>');
219
+ essayResponsePage.steps.verifyResponseFieldHTML('<p><u>Lorem Ipsum</u></p>');
294
220
  essayResponsePage.steps.deselectPreviewTabToolbarOption('Underline (Ctrl+U)');
295
- essayResponsePage.responseField()
296
- .verifyInnerHTML('<p>Lorem Ipsum</p>');
221
+ essayResponsePage.steps.verifyResponseFieldHTML('<p>Lorem Ipsum</p>');
297
222
  });
298
223
 
299
224
  essayResponsePage.tests.verifyUndoAndRedoFunctionalityForPreviewTabToolbarOption('Underline (Ctrl+U)');
300
225
 
301
226
  it('When the user selects the \'Strikethrough\' toolbar option and enters text in the response field, then the text should get striked through and if the user deselects the \'Strikethrough\' toolbar option and continues to types, then the entered text should be displayed in default format', () => {
302
227
  essayResponsePage.steps.selectPreviewTabToolbarOption('Strikethrough');
303
- essayResponsePage.responseField()
304
- .type('Lorem Ipsum')
305
- .verifyInnerHTML('<p><s>​​​​​​​Lorem Ipsum</s><br></p>');
228
+ essayResponsePage.steps.enterInputInResponseField('Lorem Ipsum');
229
+ essayResponsePage.steps.verifyResponseFieldHTML('<p><s>​​​​​​​Lorem Ipsum</s><br></p>');
306
230
  essayResponsePage.steps.deselectPreviewTabToolbarOption('Strikethrough');
307
- essayResponsePage.responseField()
308
- .type(' dolor')
309
- .verifyInnerHTML('<p><s>Lorem Ipsum</s>​​​​​​​ dolor<br></p>');
231
+ essayResponsePage.steps.enterInputInResponseField(' dolor');
232
+ essayResponsePage.steps.verifyResponseFieldHTML('<p><s>Lorem Ipsum</s>​​​​​​​ dolor<br></p>');
310
233
  });
311
234
 
312
235
  it('When the user enters text in the response field, selects the text and then selects the \'Strikethrough\' toolbar option, then the should get striked through and if the user deselects the \'Strikethrough\' toolbar option, then the entered text should be displayed in default format', () => {
313
- essayResponsePage.responseField()
314
- .type('Lorem Ipsum{selectAll}');
236
+ essayResponsePage.steps.enterInputInResponseField('Lorem Ipsum{selectAll}');
315
237
  essayResponsePage.steps.selectPreviewTabToolbarOption('Strikethrough');
316
- essayResponsePage.responseField()
317
- .verifyInnerHTML('<p><s>Lorem Ipsum</s></p>');
238
+ essayResponsePage.steps.verifyResponseFieldHTML('<p><s>Lorem Ipsum</s></p>');
318
239
  essayResponsePage.steps.deselectPreviewTabToolbarOption('Strikethrough');
319
- essayResponsePage.responseField()
320
- .verifyInnerHTML('<p>Lorem Ipsum</p>');
240
+ essayResponsePage.steps.verifyResponseFieldHTML('<p>Lorem Ipsum</p>');
321
241
  });
322
242
 
323
243
  essayResponsePage.tests.verifyUndoAndRedoFunctionalityForPreviewTabToolbarOption('Strikethrough');
324
244
 
325
245
  it('The user should be able to add a combination of \'Bold, Italic, Underline\' formatting options to the text in the response field', () => {
326
- essayResponsePage.responseField()
327
- .type('Lorem Ipsum{selectAll}');
246
+ essayResponsePage.steps.enterInputInResponseField('Lorem Ipsum{selectAll}');
328
247
  essayResponsePage.steps.selectPreviewTabToolbarOption('Bold (Ctrl+B)');
329
248
  essayResponsePage.steps.selectPreviewTabToolbarOption('Italic (Ctrl+I)');
330
249
  essayResponsePage.steps.selectPreviewTabToolbarOption('Underline (Ctrl+U)');
331
- essayResponsePage.responseField()
332
- .verifyInnerHTML('<p><u><em><strong>Lorem Ipsum</strong></em></u></p>');
250
+ essayResponsePage.steps.verifyResponseFieldHTML('<p><u><em><strong>Lorem Ipsum</strong></em></u></p>');
333
251
  });
334
252
  });
335
253
  }