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,11 +1,11 @@
1
1
  import abortEarlySetup from "../../../support/helpers/abortEarly";
2
2
  import { essayResponseBasicPage } from "../../../pages";
3
- import { commonComponents } from "../../../pages/components";
3
+ import utilities from "../../../support/helpers/utilities";
4
4
  const css = Cypress.env('css');
5
5
 
6
- const formattingOptions = [essayResponseBasicPage.cutCustomizeFormattingOption, essayResponseBasicPage.copyCustomizeFormattingOption, essayResponseBasicPage.pasteCustomizeFormattingOption, essayResponseBasicPage.specialCharacterCustomizeFormattingOption];
7
- const formattingOptionLabel = ['Cut', 'Copy', 'Paste', 'Special characters'];
8
- const stateOfFormattingOption = ['ngie-toggle-button-selected', 'ngie-toggle-button-selected', 'ngie-toggle-button-selected', 'ngie-toggle-button-not-selected'];
6
+ const customizeOptions = ['Bold', 'Italic', 'Underline', 'Bulleted List', 'Special Characters', 'Remove Format', 'Increase Indent', 'Decrease Indent'];
7
+ const stateOfFormattingOption = ['true', 'true', 'true', 'false', 'false', 'false', 'false', 'false'];
8
+ const customizeOptionsPreviewTab = ['Bold (Ctrl+B)', 'Italic (Ctrl+I)', 'Underline (Ctrl+U)', 'Insert/Remove Bulleted List', 'Special characters', 'Remove Format', 'Increase Indent', 'Decrease Indent'];
9
9
 
10
10
  describe('Create question page - Essay Response - Basic: Customize formatting options (for student player) section contents, toolbar options', () => {
11
11
  before(() => {
@@ -18,41 +18,46 @@ describe('Create question page - Essay Response - Basic: Customize formatting op
18
18
  essayResponseBasicPage.steps.navigateToCreateQuestion('essay response - basic');
19
19
  });
20
20
 
21
- it('\'Customize formatting options (for student player)\' label should be displayed and expand collapse icon should not be displayed beside the label. By default, following options should be in selected state - \'Cut, Copy, Paste\'. Special characters option should be in unselected state', () => {
22
- essayResponseBasicPage.customizeFormattingOptionsSectionLabel()
23
- .verifyInnerText('Customize formatting options (for student player)');
24
- essayResponseBasicPage.customizeFormattingOptionsSectionLabel()
25
- .find('.MuiExpansionPanelSummary-expandIcon')
26
- .should('not.exist');
27
- formattingOptions.forEach((button, count) => {
28
- button()
29
- .verifyInnerText(formattingOptionLabel[count])
30
- .and('have.class', stateOfFormattingOption[count]);
31
- });
21
+ it('User should be able to expand customize formatting options accordion', () => {
22
+ essayResponseBasicPage.steps.expandCustomizeFormattingOptionsAccordion();
23
+ });
24
+
25
+ it('\'Customize formatting options (for student player)\' label should be displayed and expand collapse icon should be displayed beside the label. By default, following options should be in selected state - \'Bold, Italic, Underline\'. Other options should be in unselected state', () => {
26
+ utilities.verifyInnerText(essayResponseBasicPage.customizeFormattingOptionsAccordionLabel(), 'Customize toolbar options and controls');
27
+ utilities.verifyElementVisibilityState(essayResponseBasicPage.customizeFormattingOptionsSectionExpandIcon(), 'exist');
28
+ essayResponseBasicPage.steps.verifyCustomizeFormattingOptionsAndSelectedState(customizeOptions, stateOfFormattingOption);
32
29
  });
33
30
 
34
31
  it('CSS of \'Customize formatting options (for student player)\' label and contents', { tags: 'css' }, () => {
35
32
  cy.log('CSS of Customize formatting options (for student player) label');
36
- essayResponseBasicPage.customizeFormattingOptionsSectionLabel()
37
- .verifyCSS(css.color.sectionHeading, css.fontSize.default, css.fontWeight.semibold);//Issue posted- https://redmine.zeuslearning.com/issues/525805
33
+ utilities.verifyCSS(essayResponseBasicPage.customizeFormattingOptionsAccordionLabel(), {
34
+ 'color': css.color.activeButtons,
35
+ 'font-size': css.fontSize.default,
36
+ 'font-weight': css.fontWeight.bold
37
+ });
38
+ utilities.verifyCSS(essayResponseBasicPage.customizeFormattingOptionsTiles('Bold'), {
39
+ 'background-color': css.color.activeButtons
40
+ });
38
41
  cy.log('CSS of selected toolbar formatting option')
39
- essayResponseBasicPage.cutCustomizeFormattingOption()
40
- .should('have.css', 'background-color', css.color.activeButtons)
41
- .within(() => {
42
- commonComponents.tickIconForOptionButtons()
43
- .should('have.css', 'color', css.color.defaultBackground);
44
- essayResponseBasicPage.customizeFormattingOptionsIcon()
45
- .should('have.css', 'color', css.color.defaultBackground);
46
- essayResponseBasicPage.customizeFormattingOptionsLabel()
47
- .verifyCSS(css.color.primaryBtn, css.fontSize.default, css.fontWeight.regular);
48
- });
49
- cy.log('CSS of unselected toolbar formatting option')
50
- essayResponseBasicPage.specialCharacterCustomizeFormattingOption()
51
- .should('have.css', 'background-color', css.color.secondaryBtnBg)
52
- .within(() => {
53
- essayResponseBasicPage.customizeFormattingOptionsLabel()
54
- .verifyCSS(css.color.secondaryBtn, css.fontSize.default, css.fontWeight.regular);
55
- });
42
+ utilities.verifyCSS(essayResponseBasicPage.tickIcon().eq(0), {
43
+ 'color': css.color.defaultBackground
44
+ });
45
+ utilities.verifyCSS(essayResponseBasicPage.customizeFormattingOptionsTiles('Bold').find('svg'), {
46
+ 'color': css.color.defaultBackground
47
+ });
48
+ utilities.verifyCSS(essayResponseBasicPage.customizeFormattingOptionsLabel().eq(0), {
49
+ 'color': css.color.primaryBtn,
50
+ 'font-size': css.fontSize.normal,
51
+ 'font-weight': css.fontWeight.bold
52
+ });
53
+ utilities.verifyCSS(essayResponseBasicPage.customizeFormattingOptionsLabel().eq(3), {
54
+ 'color': css.color.secondaryBtn,
55
+ 'font-size': css.fontSize.normal,
56
+ 'font-weight': css.fontWeight.bold,
57
+ });
58
+ utilities.verifyCSS(essayResponseBasicPage.customizeFormattingOptionsTiles('Special Characters'), {
59
+ 'background-color': css.color.secondaryBtnBg
60
+ });
56
61
  });
57
62
 
58
63
  it('Accessibility of \'Customize formatting options (for student player)\' label and contents', { tags: 'a11y' }, () => {
@@ -72,136 +77,117 @@ describe('Create question page - Essay Response - Basic: Customize formatting op
72
77
  essayResponseBasicPage.steps.resetPreviewTabResponseField();
73
78
  });
74
79
 
75
- it('When the user switches to Preview tab, then the following options should be displayed in the response field toolbar - \'Cut, Copy, Paste\'', () => {
76
- essayResponseBasicPage.previewTabToolbarWrapper()
77
- .within(() => {
78
- formattingOptionLabel.slice(0, 2).forEach((optionName, count) => {
79
- cy.get('.cke_button')
80
- .eq(count)
81
- .should('have.attr', 'title', optionName)
82
- .and('be.visible');
83
- });
84
- essayResponseBasicPage.previewTabToolbarOption('Special Characters')
85
- .should('not.exist');
86
- });
80
+ it('When the user switches to Preview tab, then the following options should be displayed in the response field toolbar - \'Bold, Italic, Underline\'', () => {
81
+ essayResponseBasicPage.steps.verifyPreviewTabToolbarOptions(customizeOptionsPreviewTab.slice(0, 2));
82
+ utilities.verifyElementVisibilityState(essayResponseBasicPage.previewTabToolbarOption('Special Characters'), 'notExist');
87
83
  });
88
84
 
89
85
  it('When the user selects all formatting options from the \'Customize formatting options (for student player)\' section, all formatting options should appear in the preview tab and all options should be in enabled sate', () => {
90
86
  cy.log('Switching to edit tab')
91
- essayResponseBasicPage.steps.switchToEditTab()
92
- essayResponseBasicPage.specialCharacterCustomizeFormattingOption()
93
- .click();
94
- essayResponseBasicPage.specialCharacterCustomizeFormattingOption()
95
- .should('have.class', 'ngie-toggle-button-selected');
87
+ essayResponseBasicPage.steps.switchToEditTab();
88
+ essayResponseBasicPage.steps.expandCustomizeFormattingOptionsAccordion();
89
+ essayResponseBasicPage.steps.selectCustomizedFormattingOption(['Bulleted List', 'Special Characters', 'Remove Format', 'Increase Indent', 'Decrease Indent']);
96
90
  essayResponseBasicPage.steps.switchToPreviewTab();
97
- essayResponseBasicPage.previewTabToolbarWrapper()
98
- .within(() => {
99
- formattingOptionLabel.forEach((optionName, count) => {
100
- cy.get('.cke_button')
101
- .eq(count)
102
- .should('have.attr', 'title', optionName)
103
- .and('be.visible');
104
- });
105
- });
91
+ essayResponseBasicPage.steps.verifyPreviewTabToolbarOptions(customizeOptionsPreviewTab);
106
92
  });
107
93
 
108
94
  it('CSS of formatting options in Preview tab', { tags: 'css' }, () => {
109
- essayResponseBasicPage.previewTabToolbarOption('Cut')
110
- .find('.cke_button_icon')
111
- .should('have.css', 'color', css.color.activeButtons);
95
+ utilities.verifyCSS(essayResponseBasicPage.previewTabToolbarOption('Bold (Ctrl+B)').find('.cke_button_icon'), {
96
+ 'color': css.color.activeButtons,
97
+ 'font-size': css.fontSize.default,
98
+ 'font-weight': css.fontWeight.regular
99
+ });
112
100
  });
113
101
 
114
102
  it('Accessibility of formatting options in Preview tab', { tags: 'a11y' }, () => {
115
- cy.checkAccessibility(essayResponseBasicPage.previewTabToolbarWrapper())
103
+ cy.checkAccessibility(essayResponseBasicPage.previewTabToolbarWrapper());
116
104
  });
117
105
 
118
106
  it('When the user deselects an option from \'Customize formatting options (for student player)\' section, then that option should not be displayed in the preview tab toolbar.', () => {
119
107
  cy.log('Switching to edit tab')
120
- essayResponseBasicPage.steps.switchToEditTab()
121
- essayResponseBasicPage.cutCustomizeFormattingOption()
122
- .click()
123
- .should('have.class', 'ngie-toggle-button-not-selected');
108
+ essayResponseBasicPage.steps.switchToEditTab();
109
+ essayResponseBasicPage.steps.deselectCustomizedFormattingOption(['Bold']);
124
110
  essayResponseBasicPage.steps.switchToPreviewTab();
125
- cy.barsPreLoaderWait();
126
- essayResponseBasicPage.previewTabToolbarWrapper()
127
- .within(() => {
128
- essayResponseBasicPage.previewTabToolbarOption('Cut')
129
- .should('not.exist');
130
- });
111
+ utilities.verifyElementVisibilityState(essayResponseBasicPage.previewTabToolbarOption('Bold'), 'notExist');
131
112
  });
132
113
  });
133
114
 
134
- describe('Cut, Copy, Paste formatting options - Preview tab', () => {
115
+ describe('Bold, Italic, Underline formatting options - Preview tab', () => {
135
116
  abortEarlySetup();
136
117
  before(() => {
137
118
  essayResponseBasicPage.steps.navigateToCreateQuestion('essay response - basic');
138
119
  cy.barsPreLoaderWait();
139
- essayResponseBasicPage.steps.setWordLimit(5);
140
- cy.log('Selecting \'Special Characters\' formatting option from Edit tab');
141
- essayResponseBasicPage.specialCharacterCustomizeFormattingOption()
142
- .click()
120
+ essayResponseBasicPage.steps.expandCustomizeFormattingOptionsAccordion();
143
121
  essayResponseBasicPage.steps.switchToPreviewTab();
144
- cy.barsPreLoaderWait();
145
122
  });
146
123
 
147
- afterEach(() => {
124
+ beforeEach(() => {
148
125
  essayResponseBasicPage.steps.resetPreviewTabResponseField();
149
126
  });
150
127
 
151
- it('When the user selects the text from the response field and clicks on the \'Cut\', then the text should get removed from the field and word count should update accordingly', () => {
152
- essayResponseBasicPage.responseField()
153
- .type('Lorem Ipsum dolor');
154
- essayResponseBasicPage.steps.cutTextFromResponseField();
155
- essayResponseBasicPage.responseField()
156
- .verifyInnerText('');
157
- essayResponseBasicPage.steps.verifyResponseFieldWordCount('0/5');
158
- });
159
-
160
- it('When the user has cut some text from response and clicks on the \'Paste\' option, the text that was cut should get pasted in the response field and the word count should increase accordingly', () => {
161
- essayResponseBasicPage.responseField()
162
- .type('Lorem Ipsum dolor');
163
- essayResponseBasicPage.steps.cutTextFromResponseField();
164
- essayResponseBasicPage.previewTabToolbarOption('Paste')
165
- .click();
166
- essayResponseBasicPage.responseField()
167
- .verifyInnerText('Lorem Ipsum dolor');
168
- essayResponseBasicPage.steps.verifyResponseFieldWordCount('3/5');
169
- });
170
-
171
- it('When the user enters text in the response field, selects the text and then clicks on the \'Copy\', the text should get copied and when the user clicks on the \'Paste\' toolbar option, then the copied text should get pasted in response field and the word count should increase accordingly', () => {
172
- essayResponseBasicPage.responseField()
173
- .type('Lorem Ipsum ');
174
- essayResponseBasicPage.steps.copyTextFromResponseField();
175
- essayResponseBasicPage.steps.verifyResponseFieldWordCount('2/5');
176
- essayResponseBasicPage.previewTabToolbarOption('Paste')
177
- .click();
178
- essayResponseBasicPage.responseField()
179
- .verifyInnerText('Lorem Ipsum\u00a0Lorem Ipsum\u00a0');
180
- essayResponseBasicPage.steps.verifyResponseFieldWordCount('4/5');
181
- });
182
-
183
- it('User should not be able to paste text more than max word limit.', () => {
184
- essayResponseBasicPage.responseField()
185
- .type('Lorem ipsum, dolor sit.');
186
- essayResponseBasicPage.steps.copyTextFromResponseField();
187
- essayResponseBasicPage.previewTabToolbarOption('Paste')
188
- .click();
189
- essayResponseBasicPage.responseField()
190
- .verifyInnerText('Lorem ipsum, dolor sit.');
191
- essayResponseBasicPage.steps.verifyResponseFieldWordCount('4/5');
192
- });
193
-
194
- it('When the user tries to paste a text and the word limit reaches after pasting, \'word limit reached\' warning message should be displayed beside word count.', () => {
195
- essayResponseBasicPage.responseField()
196
- .type('Lorem Ipsum dolor');
197
- essayResponseBasicPage.steps.copyTextFromResponseField();
198
- essayResponseBasicPage.previewTabToolbarOption('Paste')
199
- .click();
200
- essayResponseBasicPage.responseField()
201
- .verifyInnerText('Lorem Ipsum dolorLorem Ipsum dolor');
202
- essayResponseBasicPage.steps.verifyResponseFieldWordCount('5/5');
203
- essayResponseBasicPage.wordLimitReachedWarningMessage();
128
+ 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', () => {
129
+ essayResponseBasicPage.steps.selectPreviewTabToolbarOption('Bold (Ctrl+B)');
130
+ essayResponseBasicPage.steps.enterInputInResponseField('Lorem Ipsum');
131
+ essayResponseBasicPage.steps.verifyResponseFieldHTML('<p><strong>​​​​​​​Lorem Ipsum</strong><br></p>');
132
+ essayResponseBasicPage.steps.deselectPreviewTabToolbarOption('Bold (Ctrl+B)');
133
+ essayResponseBasicPage.steps.enterInputInResponseField(' dolor');
134
+ essayResponseBasicPage.steps.verifyResponseFieldHTML('<p><strong>Lorem Ipsum</strong>​​​​​​​ dolor<br></p>');
135
+ });
136
+
137
+ 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', () => {
138
+ essayResponseBasicPage.steps.enterInputInResponseField('Lorem Ipsum{selectAll}');
139
+ essayResponseBasicPage.steps.selectPreviewTabToolbarOption('Bold (Ctrl+B)');
140
+ essayResponseBasicPage.steps.verifyResponseFieldHTML('<p><strong>Lorem Ipsum</strong></p>');
141
+ essayResponseBasicPage.steps.deselectPreviewTabToolbarOption('Bold (Ctrl+B)');
142
+ essayResponseBasicPage.steps.verifyResponseFieldHTML('<p>Lorem Ipsum</p>');
143
+ });
144
+
145
+ essayResponseBasicPage.tests.verifyUndoAndRedoFunctionalityForPreviewTabToolbarOption('Bold (Ctrl+B)');
146
+
147
+ 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', () => {
148
+ essayResponseBasicPage.steps.selectPreviewTabToolbarOption('Italic (Ctrl+I)');
149
+ essayResponseBasicPage.steps.enterInputInResponseField('Lorem Ipsum');
150
+ essayResponseBasicPage.steps.verifyResponseFieldHTML('<p><em>​​​​​​​Lorem Ipsum</em><br></p>');
151
+ essayResponseBasicPage.steps.deselectPreviewTabToolbarOption('Italic (Ctrl+I)');
152
+ essayResponseBasicPage.steps.enterInputInResponseField(' dolor');
153
+ essayResponseBasicPage.steps.verifyResponseFieldHTML('<p><em>Lorem Ipsum</em>​​​​​​​ dolor<br></p>');
154
+ });
155
+
156
+ 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', () => {
157
+ essayResponseBasicPage.steps.enterInputInResponseField('Lorem Ipsum{selectAll}');
158
+ essayResponseBasicPage.steps.selectPreviewTabToolbarOption('Italic (Ctrl+I)');
159
+ essayResponseBasicPage.steps.verifyResponseFieldHTML('<p><em>Lorem Ipsum</em></p>');
160
+ essayResponseBasicPage.steps.deselectPreviewTabToolbarOption('Italic (Ctrl+I)');
161
+ essayResponseBasicPage.steps.verifyResponseFieldHTML('<p>Lorem Ipsum</p>');
162
+ });
163
+
164
+ essayResponseBasicPage.tests.verifyUndoAndRedoFunctionalityForPreviewTabToolbarOption('Italic (Ctrl+I)');
165
+
166
+ 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', () => {
167
+ essayResponseBasicPage.steps.selectPreviewTabToolbarOption('Underline (Ctrl+U)');
168
+ essayResponseBasicPage.steps.enterInputInResponseField('Lorem Ipsum');
169
+ essayResponseBasicPage.steps.verifyResponseFieldHTML('<p><u>​​​​​​​Lorem Ipsum</u><br></p>');
170
+ essayResponseBasicPage.steps.deselectPreviewTabToolbarOption('Underline (Ctrl+U)');
171
+ essayResponseBasicPage.steps.enterInputInResponseField(' dolor');
172
+ essayResponseBasicPage.steps.verifyResponseFieldHTML('<p><u>Lorem Ipsum</u>​​​​​​​ dolor<br></p>');
173
+ });
174
+
175
+ 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', () => {
176
+ essayResponseBasicPage.steps.enterInputInResponseField('Lorem Ipsum{selectAll}');
177
+ essayResponseBasicPage.steps.selectPreviewTabToolbarOption('Underline (Ctrl+U)');
178
+ essayResponseBasicPage.steps.verifyResponseFieldHTML('<p><u>Lorem Ipsum</u></p>');
179
+ essayResponseBasicPage.steps.deselectPreviewTabToolbarOption('Underline (Ctrl+U)');
180
+ essayResponseBasicPage.steps.verifyResponseFieldHTML('<p>Lorem Ipsum</p>');
181
+ });
182
+
183
+ essayResponseBasicPage.tests.verifyUndoAndRedoFunctionalityForPreviewTabToolbarOption('Underline (Ctrl+U)');
184
+
185
+ it('The user should be able to add a combination of \'Bold, Italic, Underline\' formatting options to the text in the response field', () => {
186
+ essayResponseBasicPage.steps.enterInputInResponseField('Lorem Ipsum{selectAll}');
187
+ essayResponseBasicPage.steps.selectPreviewTabToolbarOption('Bold (Ctrl+B)');
188
+ essayResponseBasicPage.steps.selectPreviewTabToolbarOption('Italic (Ctrl+I)');
189
+ essayResponseBasicPage.steps.selectPreviewTabToolbarOption('Underline (Ctrl+U)');
190
+ essayResponseBasicPage.steps.verifyResponseFieldHTML('<p><u><em><strong>Lorem Ipsum</strong></em></u></p>');
204
191
  });
205
192
  });
206
- //TO DO- Special characters flyout cases are pending
207
193
  });
@@ -0,0 +1,17 @@
1
+ import { essayResponseMathPage } from "../../../pages";
2
+
3
+ describe('Create question page - Essay response - math', () => {
4
+ before(() => {
5
+ cy.loginAs('admin');
6
+ essayResponseMathPage.steps.navigateToCreateQuestion('essay response - math');
7
+ });
8
+
9
+ it('\'Essay response - math\' label should be displayed', () => {
10
+ essayResponseMathPage.tests.verifyCreateQuestionPageQuestionTypeHeader('Essay response - math');
11
+ });
12
+
13
+ it('When the user expands the \'Customize formatting options (for student player)\' accordion, the \'Equation Editor\' formatting option should be selected by default', () => {
14
+ essayResponseMathPage.steps.expandCustomizeFormattingOptionsAccordion();
15
+ essayResponseMathPage.steps.verifyCustomizeFormattingOptionIsSelected('Equation Editor');
16
+ });
17
+ });
@@ -0,0 +1,203 @@
1
+ import { essayResponseMathPage } from "../../../pages";
2
+ import { mathCharacters } from "../../../fixtures/drawingToolbarOptionsAdditionalOptionsAndSpecialAndMathCharacters";
3
+ import abortEarlySetup from "../../../support/helpers/abortEarly";
4
+ import utilities from "../../../support/helpers/utilities";
5
+ const mathCharacterCategories = Object.values(mathCharacters.map((icon) => icon.categoryName));
6
+ const css = Cypress.env('css');
7
+
8
+ describe('Essay response math: Customize math characters', () => {
9
+ before(() => {
10
+ cy.loginAs('admin');
11
+ });
12
+
13
+ describe('Customize math characters', () => {
14
+ abortEarlySetup();
15
+ before(() => {
16
+ cy.log('Navigating to essay response - math question type');
17
+ essayResponseMathPage.steps.navigateToCreateQuestion('essay response - math');
18
+ cy.barsPreLoaderWait();
19
+ essayResponseMathPage.steps.expandCustomizeFormattingOptionsAccordion();
20
+ essayResponseMathPage.steps.selectCustomizedFormattingOption(['Math Characters']);
21
+ });
22
+
23
+ it('When user checks the \'Customize math characters\' checkbox, then \'Select math character languages\' label should be displayed. A \'Preview\' hyperlink should be displayed next to the label', () => {
24
+ essayResponseMathPage.steps.checkCustomizeMathCharactersCheckbox();
25
+ utilities.verifyElementVisibilityState(essayResponseMathPage.selectMathCharacterCategoryLabel(), 'visible');
26
+ utilities.verifyInnerText(essayResponseMathPage.selectMathCharacterCategoryLabel(), 'Select math character languages');
27
+ utilities.verifyElementVisibilityState(essayResponseMathPage.customizeMathCharactersPreviewButton(), 'visible');
28
+ utilities.verifyInnerText(essayResponseMathPage.customizeMathCharactersPreviewButton(), 'Preview');
29
+ });
30
+
31
+ it(`A total of ${mathCharacterCategories.length} options should be displayed - ${mathCharacterCategories.join('')}. By default all language options should be in selected state`, () => {
32
+ essayResponseMathPage.steps.verifyCustomizeMathCharactersCategoryTiles(mathCharacterCategories);
33
+ essayResponseMathPage.steps.verifySelectedCustomizeMathCharactersCategoryTiles(mathCharacterCategories);
34
+ });
35
+
36
+ it('When the user clicks on the \'Preview\' hyperlink, a math characters popup should be displayed with all the math characters segregated according to all the language options. The user should be able to close the popup by clicking on the \'Close[X]\' button', () => {
37
+ essayResponseMathPage.steps.clickOnCustomizeMathCharactersPreviewButton();
38
+ //Add this verification once https://redmine.zeuslearning.com/issues/555008 is resolved
39
+ // essayResponseMathPage.steps.verifyMathCharactersPreviewPopupInEditTab(mathCharacters);
40
+ cy.log('Post-step: Closing preview popup')
41
+ essayResponseMathPage.steps.closeWarningPopup();
42
+ });
43
+
44
+ it('When the user deselects any language option and opens the math characters popup by clicking on the \'Preview\' hyperlink, then the popup contents should get updated accordingly', () => {
45
+ let newSelectedCategoryList = mathCharacters.slice(1);
46
+ essayResponseMathPage.steps.clickOnMathCharactersCategoryTile(mathCharacters[0].categoryName);
47
+ essayResponseMathPage.steps.verifyMathCharacterCategoryTileIsNotSelected(mathCharacters[0].categoryName);
48
+ essayResponseMathPage.steps.clickOnCustomizeMathCharactersPreviewButton();
49
+ //Add this verification once https://redmine.zeuslearning.com/issues/555008 is resolved
50
+ // essayResponseMathPage.steps.verifyMathCharactersPreviewPopupInEditTab(newSelectedCategoryList);
51
+ cy.log('Post-step: Closing preview popup');
52
+ essayResponseMathPage.steps.closeWarningPopup();
53
+ });
54
+
55
+ it('When the user has deselected any language option and opens the math characters popup in the preview tab, then the popup contents should get updated accordingly', () => {
56
+ let newSelectedCategoryList = mathCharacters.slice(1);
57
+ essayResponseMathPage.steps.switchToPreviewTab();
58
+ essayResponseMathPage.steps.selectPreviewTabToolbarOption('Math characters');
59
+ essayResponseMathPage.steps.verifyMathCharactersPopupCategoriesAndSymbols(newSelectedCategoryList);
60
+ cy.log('Post-step: Switching to edit tab');
61
+ essayResponseMathPage.steps.switchToEditTab();
62
+ });
63
+
64
+ it('CSS of Customize math characters', { tags: 'css' }, () => {
65
+ utilities.verifyCSS(essayResponseMathPage.customizeMathCharactersLabel(), {
66
+ 'color': css.color.labels,
67
+ 'font-size': css.fontSize.normal,
68
+ 'font-weight': css.fontWeight.semibold
69
+ });
70
+ //checked state of customize math characters checkbox
71
+ utilities.verifyCSS(essayResponseMathPage.customizeMathCharactersCheckbox().parents('[data-ngie-testid="customize-math-characters-checkbox"]').find('rect').eq(1), {
72
+ 'fill': css.color.activeButtons
73
+ });
74
+ utilities.verifyCSS(essayResponseMathPage.selectSpecialCharacterLanguagesLabel(), {
75
+ 'color': css.color.labels,
76
+ 'font-size': css.fontSize.normal,
77
+ 'font-weight': css.fontWeight.semibold
78
+ });
79
+ //Category tiles in selected state
80
+ utilities.verifyCSS(essayResponseMathPage.mathCharacterTileIcon().eq(1).find('svg'), {
81
+ 'fill': css.color.defaultBackground
82
+ });
83
+ utilities.verifyCSS(essayResponseMathPage.customizeMathCharactersTickIcon().last().find('path[data-name*="Rectangle"]'), {
84
+ 'fill': css.color.defaultBackground
85
+ });
86
+ utilities.verifyCSS(essayResponseMathPage.customizeMathCharactersTickIcon().last().find('path[data-name*="feather-check"]'), {
87
+ 'fill': css.color.activeButtons
88
+ });
89
+ utilities.verifyCSS(essayResponseMathPage.mathCharacterTileSectionCategoriesDragIcon().eq(1).find('path'), {
90
+ 'fill': css.color.activeButtons
91
+ });
92
+ utilities.verifyCSS(essayResponseMathPage.mathCharacterTileSectionCategoriesDragIcon().eq(1).parent(), {
93
+ 'background-color': css.color.defaultBackground
94
+ });
95
+ utilities.verifyCSS(essayResponseMathPage.mathCharacterTileCategoryName().eq(1), {
96
+ 'color': css.color.whiteText,
97
+ 'font-size': css.fontSize.small,
98
+ 'font-weight': css.fontWeight.regular
99
+ });
100
+ utilities.verifyCSS(essayResponseMathPage.mathCharacterTiles().eq(1), {
101
+ 'background-color': css.color.primaryBtnBg
102
+ });
103
+ //Category tiles in de-selected state
104
+ utilities.verifyCSS(essayResponseMathPage.mathCharacterTileSectionCategoriesDragIcon().eq(0).find('svg path'), {
105
+ 'fill': css.color.secondaryBtn
106
+ });
107
+ utilities.verifyCSS(essayResponseMathPage.mathCharacterTileCategoryName().eq(0), {
108
+ 'color': css.color.secondaryBtn,
109
+ 'font-size': css.fontSize.small,
110
+ 'font-weight': css.fontWeight.regular
111
+ });
112
+ utilities.verifyCSS(essayResponseMathPage.mathCharacterTiles().eq(0), {
113
+ 'background-color': css.color.defaultBackground
114
+ });
115
+ cy.log('Opening preview popup');
116
+ essayResponseMathPage.steps.clickOnCustomizeMathCharactersPreviewButton();
117
+ utilities.verifyCSS(essayResponseMathPage.dialogBoxTitle(), {
118
+ 'color': css.color.flyoutTitle,
119
+ 'font-size': css.fontSize.heading,
120
+ 'font-weight': css.fontWeight.semibold
121
+ });
122
+ utilities.verifyCSS(essayResponseMathPage.mathCharactersPreviewPopupCategoryLabel().eq(0), {
123
+ 'color': css.color.text,
124
+ 'font-size': css.fontSize.normal,
125
+ 'font-weight': css.fontWeight.semibold
126
+ });
127
+ });
128
+
129
+ it('Accessibility of Customize special characters', { tags: 'a11y' }, () => {
130
+ cy.checkAccessibility(essayResponseMathPage.dialogBox());
131
+ cy.log('Closing preview popup');
132
+ essayResponseMathPage.steps.closeWarningPopup();
133
+ cy.checkAccessibility(essayResponseMathPage.customizeMathCharactersLabel().parent());
134
+ });
135
+ });
136
+
137
+ describe('Preview tab - toolbar option - \'Math characters\' - content and functionality', { tags: 'smoke' }, () => {
138
+ abortEarlySetup();
139
+ before(() => {
140
+ cy.log('Navigating to drawing response question type');
141
+ essayResponseMathPage.steps.navigateToCreateQuestion('essay response - math');
142
+ cy.barsPreLoaderWait();
143
+ });
144
+
145
+ it(`When Math characters option is not selected in edit tab, then in preview tab the Math characters toolbar option should not be displayed`, () => {
146
+ essayResponseMathPage.steps.switchToPreviewTab();
147
+ utilities.verifyElementVisibilityState(essayResponseMathPage.previewTabToolbarOption('Math characters'), 'notExist');
148
+ });
149
+
150
+ it(`When Math characters additional option is selected in edit tab, then in preview tab the Math characters toolbar option should be displayed`, () => {
151
+ essayResponseMathPage.steps.switchToEditTab();
152
+ essayResponseMathPage.steps.expandCustomizeFormattingOptionsAccordion();
153
+ essayResponseMathPage.steps.selectCustomizedFormattingOption(['Math Characters']);
154
+ essayResponseMathPage.steps.switchToPreviewTab();
155
+ utilities.verifyElementVisibilityState(essayResponseMathPage.previewTabToolbarOption('Math characters'), 'visible');
156
+ });
157
+
158
+ it('By default the \'Math characters\' toolbar option should be in deselected state', () => {
159
+ //Add here once https://redmine.zeuslearning.com/issues/554508 is resolved
160
+ });
161
+
162
+ it('When user clicks on \'Math characters\' toolbar option, then the \'Math characters\' popup should be displayed with \'Math characters\' title and a \'Close\' button', () => {
163
+ essayResponseMathPage.steps.selectPreviewTabToolbarOption('Math characters');
164
+ utilities.verifyElementVisibilityState(essayResponseMathPage.dialogBox(), 'visible');
165
+ utilities.verifyInnerText(essayResponseMathPage.dialogBoxTitle(), 'Math characters');
166
+ utilities.verifyElementVisibilityState(essayResponseMathPage.mathCharactersPopupCloseButton(), 'visible');
167
+ });
168
+
169
+ it('All categories and their respective title and symbols should be displayed in the popup', () => {
170
+ essayResponseMathPage.steps.verifyMathCharactersPopupCategoriesAndSymbols(mathCharacters);
171
+ });
172
+
173
+ it('When user clicks on any category icon, then the category flyout should stay open', () => {
174
+ essayResponseMathPage.steps.clickOnCharacterPopupSymbol(mathCharacters[0].symbols[0]);
175
+ utilities.verifyElementVisibilityState(essayResponseMathPage.dialogBox(), 'visible');
176
+ });
177
+
178
+ it('CSS of \'Math characters\' popup', { tags: 'css' }, () => {
179
+ utilities.verifyCSS(essayResponseMathPage.dialogBoxTitle(), {
180
+ 'color': css.color.flyoutTitle,
181
+ 'font-size': css.fontSize.heading,
182
+ 'font-weight': css.fontWeight.semibold,
183
+ });
184
+ utilities.verifyCSS(essayResponseMathPage.mathCharactersPopupCategoryTitle(), {
185
+ 'color': css.color.text,
186
+ 'font-size': css.fontSize.normal,
187
+ 'font-weight': css.fontWeight.semibold,
188
+ });
189
+ utilities.verifyCSS(essayResponseMathPage.mathCharactersPopupCharacterSymbol().find('path'), {
190
+ 'fill': css.color.activeButtons
191
+ });
192
+ });
193
+
194
+ it('Accessibility of Customize special characters', { tags: 'a11y' }, () => {
195
+ cy.checkAccessibility(essayResponseMathPage.dialogBox());
196
+ });
197
+
198
+ it('When user clicks on the \'Close\' button then the \'Math characters\' popup should be closed', () => {
199
+ essayResponseMathPage.steps.clickOnMathCharacterCloseButton();
200
+ utilities.verifyElementVisibilityState(essayResponseMathPage.dialogBox(), 'notExist');
201
+ });
202
+ });
203
+ });