itemengine-cypress-automation 1.0.72 → 1.0.73

Sign up to get free protection for your applications and to get access to all the features.
Files changed (90) hide show
  1. package/cypress/e2e/ILC/AudioResponse/{audioResponseMinimalPreviewSection.js → audioResponseMinimalPreviewSection.smoke.js} +263 -254
  2. package/cypress/e2e/ILC/AudioResponse/{audioResponseStandardPreviewSection.js → audioResponseStandardPreviewSection.smoke.js} +100 -97
  3. package/cypress/e2e/ILC/DragAndDropIntoCategories/dragAndDropIntoCategoriesScoring/groupedOptionsAllOrNothing.smoke.js +121 -0
  4. package/cypress/e2e/ILC/DragAndDropIntoCategories/dragAndDropIntoCategoriesScoring/{groupedOptionsPartialScoreForEachCell.js → groupedOptionsPartialScoreForEachCell.smoke.js} +1 -1
  5. package/cypress/e2e/ILC/DragAndDropIntoCategories/dragAndDropIntoCategoriesScoring/{groupedOptionsPartialScoreForEachResponse.js → groupedOptionsPartialScoreForEachResponse.smoke.js} +1 -1
  6. package/cypress/e2e/ILC/DragAndDropIntoCategories/dragAndDropIntoCategoriesScoring/standardAllOrNothing.smoke.js +164 -0
  7. package/cypress/e2e/ILC/DragAndDropIntoCategories/dragAndDropIntoCategoriesScoring/{standardTotalScoreDividedBetweenResponse.js → standardTotalScoreDividedBetweenResponse.smoke.js} +21 -18
  8. package/cypress/e2e/ILC/EditTabSettingPage/ItemPreviewSettingsTabContent.js +753 -0
  9. package/cypress/e2e/ILC/EssayResponse/essayResponseCreateCustomCategory.smoke.js +943 -0
  10. package/cypress/e2e/ILC/EssayResponse/{essayResponseCustomizeFormattingOptions1.js → essayResponseCustomizeFormattingOptions1.smoke.js} +113 -110
  11. package/cypress/e2e/ILC/EssayResponse/essayResponseEquationEditor.smoke.js +581 -0
  12. package/cypress/e2e/ILC/EssayResponse/essayResponseGradingViewAndCorrectAnswerViewContents.smoke.js +111 -0
  13. package/cypress/e2e/ILC/EssayResponse/{essayResponsePreviewContentsForAllViews.js → essayResponsePreviewContentsForAllViews.smoke.js} +6 -3
  14. package/cypress/e2e/ILC/FillInTheGapsDragAndDrop/fillInTheGapsDragAndDropGroupedEditTab.smoke.js +81 -0
  15. package/cypress/e2e/ILC/FillInTheGapsDragAndDrop/{fillInTheGapsDragAndDropGroupedOptionsAllOrNothingScoring.js → fillInTheGapsDragAndDropGroupedOptionsAllOrNothingScoring.smoke.js} +25 -22
  16. package/cypress/e2e/ILC/FillInTheGapsDropdown/{fillInTheGapsDropdownAllOrNothingScoring.js → fillInTheGapsDropdownAllOrNothingScoring.smoke.js} +16 -14
  17. package/cypress/e2e/ILC/{fillInTheGapsOverImageDropdown/fillInTheGapsOverImageDropdownAddResponseContainer.js → FillInTheGapsOverImageDropdown/fillInTheGapsOverImageDropdownAddResponseContainer.smoke.js} +80 -74
  18. package/cypress/e2e/ILC/FillInTheGapsOverImageDropdown/fillInTheGapsOverImageDropdownAllOrNothingScoring.smoke.js +361 -0
  19. package/cypress/e2e/ILC/FillInTheGapsOverImageDropdown/fillInTheGapsOverImageDropdownEditAriaLabelCheckbox.smoke.js +137 -0
  20. package/cypress/e2e/ILC/FillInTheGapsOverImageDropdown/fillInTheGapsOverImageDropdownImageProperties.smoke.js +171 -0
  21. package/cypress/e2e/ILC/{fillInTheGapsOverImageDropdown/fillInTheGapsOverImageDropdownPreviewTab.js → FillInTheGapsOverImageDropdown/fillInTheGapsOverImageDropdownPreviewTab.smoke.js} +1 -1
  22. package/cypress/e2e/ILC/FillInTheGapsOverImageText/{fillInTheGapsOverImageTextAllOrNothingScoring.js → fillInTheGapsOverImageTextAllOrNothingScoring.smoke.js} +32 -29
  23. package/cypress/e2e/ILC/FillInTheGapsOverImageText/{fillInTheGapsOverImageTextCheckAnswerForAllViews.js → fillInTheGapsOverImageTextCheckAnswerForAllViews.smoke.js} +5 -3
  24. package/cypress/e2e/ILC/FillInTheGapsOverImageText/fillInTheGapsOverImageTextEditAriaLabelCheckbox.smoke.js +137 -0
  25. package/cypress/e2e/ILC/FillInTheGapsOverImageText/fillInTheGapsOverImageTextEditTabBasicSection.smoke.js +146 -0
  26. package/cypress/e2e/ILC/FillInTheGapsOverImageText/{fillInTheGapsOverImageTextPreviewContentsForAllViews.js → fillInTheGapsOverImageTextPreviewContentsForAllViews.smoke.js} +5 -3
  27. package/cypress/e2e/ILC/FillInTheGapsOverImageText/{fillInTheGapsOverImageTextPreviewTab.js → fillInTheGapsOverImageTextPreviewTab.smoke.js} +1 -1
  28. package/cypress/e2e/ILC/FillInTheGapsOverImageText/{fillInTheGapsOverImageTextShowCorrectAnswerForAllView.js → fillInTheGapsOverImageTextShowCorrectAnswerForAllView.smoke.js} +6 -4
  29. package/cypress/e2e/ILC/FillInTheGapsText/{fillInTheGapsTextAutoScoredScoring.js → fillInTheGapsTextAutoScoredScoring.smoke.js} +12 -9
  30. package/cypress/e2e/ILC/Highlight/HighlightScoring/{allOrNothingScoring.js → allOrNothingScoring.smoke.js} +36 -34
  31. package/cypress/e2e/ILC/Highlight/HighlightScoring/highlightBasicScoringForTextSelectionTypes.smoke.js +462 -0
  32. package/cypress/e2e/ILC/Highlight/highlightColorLibraryFlyout.smoke.js +148 -0
  33. package/cypress/e2e/ILC/Highlight/highlightQuestionInstructionsAndQuestion.smoke.js +185 -0
  34. package/cypress/e2e/ILC/HighlightImage/highlightImageEditTabBasic.smoke.js +138 -0
  35. package/cypress/e2e/ILC/HighlightImage/{highlightImagePreviewTab.js → highlightImagePreviewTab.smoke.js} +1 -1
  36. package/cypress/e2e/ILC/HighlightImage/{highlightImageToolsFunctionalityPreviewTab.js → highlightImageToolsFunctionalityPreviewTab.smoke.js} +4 -4
  37. package/cypress/e2e/ILC/ListMatching/ListMatchingScoring/groupedOptionsAllOrNothingScoring.smoke.js +122 -0
  38. package/cypress/e2e/ILC/ListMatching/{listMatchingAlternateAnswer.js → listMatchingAlternateAnswer.smoke.js} +47 -43
  39. package/cypress/e2e/ILC/ListMatching/listMatchingGroupedOptionsSection.smoke.js +211 -0
  40. package/cypress/e2e/ILC/ListMatching/listMatchingQuestionInstructionsAndStemsSection.smoke.js +254 -0
  41. package/cypress/e2e/ILC/ListMatching/listMatchingStandardOptionsSetCorrectAnswerCheckboxesPreviewTab.smoke.js +191 -0
  42. package/cypress/e2e/ILC/ListOrdering/ListOrderingScoring/{allOrNothingScoring.js → allOrNothingScoring.smoke.js} +34 -32
  43. package/cypress/e2e/ILC/ListSorting/ListSortingScoring/{allOrNothingScoring.js → allOrNothingScoring.smoke.js} +41 -38
  44. package/cypress/e2e/ILC/ListSorting/listSortingSetCorrectAnswerCheckboxes.smoke.js +269 -0
  45. package/cypress/e2e/ILC/MultipleSelectionGrid/{multipleSelectionGridAutoScoredScoring.js → multipleSelectionGridAutoScoredScoring.smoke.js} +36 -34
  46. package/cypress/e2e/ILC/ShortTextResponse/shortTextResponseAutoScoredScoring.smoke.js +407 -0
  47. package/cypress/e2e/ILC/SingleSelectionGrid/{singleSelectionGridAutoScoredScoring.js → singleSelectionGridAutoScoredScoring.smoke.js} +32 -29
  48. package/cypress/e2e/ILC/UploadResponse/{uploadResponsePreview.js → uploadResponsePreview.smoke.js} +64 -59
  49. package/cypress/e2e/ILC/VideoResponse/{videoResponsePreviewTab.js → videoResponsePreviewTab.smoke.js} +290 -281
  50. package/cypress/pages/components/additionalSettingsPanel.js +0 -27
  51. package/cypress/pages/components/autoScoredSetCorrectAnswerSection.js +1 -1
  52. package/cypress/pages/components/autoScoredSpecifyCorrectAnswerSection.js +321 -0
  53. package/cypress/pages/components/createQuestionBasePage.js +1 -7
  54. package/cypress/pages/components/essayResponseCommonComponents.js +0 -6
  55. package/cypress/pages/components/fillInTheGapsCommonComponents.js +0 -13
  56. package/cypress/pages/components/index.js +2 -1
  57. package/cypress/pages/components/mcqAdditionalSettingsBase.js +0 -10
  58. package/cypress/pages/components/scoringSectionBase.js +3 -2
  59. package/cypress/pages/createItemPage.js +3 -79
  60. package/cypress/pages/dialogBoxBase.js +8 -23
  61. package/cypress/pages/index.js +1 -4
  62. package/cypress/pages/itemPreviewSettingsPage.js +446 -0
  63. package/cypress/pages/multipleSelectionPage.js +113 -64
  64. package/cypress/pages/selectQuestionResourceToolPage.js +0 -5
  65. package/cypress/pages/shortTextResponsePage.js +0 -6
  66. package/cypress/pages/singleSelectionPage.js +0 -1
  67. package/package.json +2 -2
  68. package/cypress/e2e/ILC/DragAndDropIntoCategories/dragAndDropIntoCategoriesScoring/groupedOptionsAllOrNothing.js +0 -116
  69. package/cypress/e2e/ILC/DragAndDropIntoCategories/dragAndDropIntoCategoriesScoring/standardAllOrNothing.js +0 -160
  70. package/cypress/e2e/ILC/EssayResponse/essayResponseCreateCustomCategory.js +0 -932
  71. package/cypress/e2e/ILC/EssayResponse/essayResponseEquationEditor.js +0 -572
  72. package/cypress/e2e/ILC/EssayResponse/essayResponseGradingViewAndCorrectAnswerViewContents.js +0 -106
  73. package/cypress/e2e/ILC/FillInTheGapsDragAndDrop/fillInTheGapsDragAndDropGroupedEditTab.js +0 -76
  74. package/cypress/e2e/ILC/FillInTheGapsOverImageText/fillInTheGapsOverImageTextEditAriaLabelCheckbox.js +0 -134
  75. package/cypress/e2e/ILC/FillInTheGapsOverImageText/fillInTheGapsOverImageTextEditTabBasicSection.js +0 -133
  76. package/cypress/e2e/ILC/Highlight/HighlightScoring/highlightBasicScoringForTextSelectionTypes.js +0 -457
  77. package/cypress/e2e/ILC/Highlight/highlightColorLibraryFlyout.js +0 -143
  78. package/cypress/e2e/ILC/Highlight/highlightQuestionInstructionsAndQuestion.js +0 -178
  79. package/cypress/e2e/ILC/HighlightImage/highlightImageEditTabBasic.js +0 -125
  80. package/cypress/e2e/ILC/ListMatching/ListMatchingScoring/groupedOptionsAllOrNothingScoring.js +0 -117
  81. package/cypress/e2e/ILC/ListMatching/listMatchingGroupedOptionsSection.js +0 -207
  82. package/cypress/e2e/ILC/ListMatching/listMatchingQuestionInstructionsAndStemsSection.js +0 -246
  83. package/cypress/e2e/ILC/ListMatching/listMatchingStandardOptionsSetCorrectAnswerCheckboxesPreviewTab.js +0 -185
  84. package/cypress/e2e/ILC/ListSorting/listSortingAdditionalSettings.js +0 -820
  85. package/cypress/e2e/ILC/ListSorting/listSortingAutoScoredScoring.js +0 -936
  86. package/cypress/e2e/ILC/ListSorting/listSortingSetCorrectAnswerCheckboxes.js +0 -263
  87. package/cypress/e2e/ILC/ShortTextResponse/shortTextResponseAutoScoredScoring.js +0 -402
  88. package/cypress/e2e/ILC/fillInTheGapsOverImageDropdown/fillInTheGapsOverImageDropdownAllOrNothingScoring.js +0 -356
  89. package/cypress/e2e/ILC/fillInTheGapsOverImageDropdown/fillInTheGapsOverImageDropdownEditAriaLabelCheckbox.js +0 -134
  90. package/cypress/e2e/ILC/fillInTheGapsOverImageDropdown/fillInTheGapsOverImageDropdownImageProperties.js +0 -156
@@ -1,572 +0,0 @@
1
- import { equationEditorCategoriesAndSymbols } from "../../../fixtures/equationEditorCategoriesAndSymbols ";
2
- import { commonComponents } from "../../../pages/components";
3
- import { equationEditorFlyout } from "../../../pages/components/equationEditorFlyout";
4
- import { essayResponsePage } from "../../../pages/essayResponsePage";
5
- import abortEarlySetup from "../../../support/helpers/abortEarly";
6
- const css = Cypress.env('css');
7
-
8
- const defaultSelectedCategories = ['Keypad', 'Basic', 'Greek', 'Operators', 'Relationships', 'Arrows', 'Delimiters', 'Misc'];
9
- const allCategories = Object.values(equationEditorCategoriesAndSymbols)
10
-
11
- describe('Create question page - Essay Response: Equation Editor functionality', () => {
12
- before(() => {
13
- cy.loginAs('admin');
14
- });
15
-
16
- describe('Preview tab \'Equation Editor\' flyout', () => {
17
- abortEarlySetup();
18
- before(() => {
19
- essayResponsePage.steps.navigateToCreateQuestion('essay response - rich text');
20
- essayResponsePage.steps.expandCustomizeFormattingOptionsAccordion();
21
- essayResponsePage.steps.selectCustomizedFormattingOption(['Equation Editor'])
22
- cy.barsPreLoaderWait();
23
- essayResponsePage.steps.switchToPreviewTab();
24
- });
25
-
26
- it('The \'Equation Editor\' icon should be displayed in the preview tab toolbar', () => {
27
- essayResponsePage.previewTabToolbarOption('Equation Editor')
28
- .should('have.attr', 'title', 'Equation Editor')
29
- .and('be.visible');
30
- });
31
-
32
- it('On hovering over the icon \'Insert Equation\' tooltip should be displayed and on clicking it a flyout should appear', () => {
33
- //TODO: Need to work on the tooltip for Insert equation
34
- essayResponsePage.previewTabToolbarOption('Equation Editor')
35
- .click();
36
- equationEditorFlyout.dialogBox()
37
- .should('be.visible');
38
- });
39
-
40
- it('The flyout should have title \'Equation Editor\'', () => {
41
- equationEditorFlyout.dialogBoxTitle()
42
- .verifyInnerText('Equation editor');
43
- });
44
-
45
- it('Ok button should be displayed at the bottom of the flyout', () => {
46
- equationEditorFlyout.dialogBox()
47
- .within(() => {
48
- equationEditorFlyout.buttonOk()
49
- .verifyInnerText('Ok')
50
- .should('be.visible');
51
- });
52
- });
53
-
54
- it('Equation Editor input field should be displayed and should have cursor by default', () => {
55
- equationEditorFlyout.previewInputField()
56
- .verifyInnerText('')
57
- .should('be.visible')
58
- .and('have.class', 'mq-focused');
59
- });
60
-
61
- it('All the default selected categories in the \'Equation Editor\' section should be displayed and first category must be selected by default in the \'Equation Editor\' flyout', () => {
62
- const equationCategoriesArray = Object.values(equationEditorCategoriesAndSymbols)
63
- equationEditorFlyout.categoryTab()
64
- .each(($el, index) => {
65
- cy.wrap($el)
66
- .verifyInnerText(equationCategoriesArray[index].displayName)
67
- .within(() => {
68
- equationEditorFlyout.categoryTabIcon()
69
- .should('exist');
70
- });
71
- });
72
- equationEditorFlyout.categoryTab()
73
- .eq(0)
74
- .within(() => {
75
- equationEditorFlyout.categoryTabTitle()
76
- .should('have.class', 'selected-tool-content-color')
77
- })
78
- });
79
-
80
- it('CSS of \'Equation Editor\' flyout', { tags: 'css' }, () => {
81
- equationEditorFlyout.dialogBoxTitle()
82
- .verifyCSS(css.color.secondaryBtn, css.fontSize.heading, css.fontWeight.bold);
83
- cy.log('CSS of selected category')
84
- equationEditorFlyout.categoryTab()
85
- .eq(0)
86
- .within(() => {
87
- equationEditorFlyout.categoryTabTitle()
88
- .verifyCSS(css.color.activeButtons, css.fontSize.small, css.fontWeight.regular);
89
- equationEditorFlyout.categoryTabIcon()
90
- .verifyCSS(css.color.activeButtons, css.fontSize.default, css.fontWeight.regular);
91
- });
92
- cy.log('CSS of unselected category')
93
- equationEditorFlyout.categoryTab()
94
- .eq(1)
95
- .within(() => {
96
- equationEditorFlyout.categoryTabTitle()
97
- .verifyCSS(css.color.secondaryBtn, css.fontSize.small, css.fontWeight.regular);
98
- equationEditorFlyout.categoryTabIcon()
99
- .verifyCSS(css.color.secondaryBtn, css.fontSize.default, css.fontWeight.regular);
100
- });
101
- equationEditorFlyout.previewInputField()
102
- .should('have.css', 'background-color', css.color.defaultBackground);
103
- equationEditorFlyout.buttonCancel()
104
- .verifyCSS(css.color.secondaryBtn, css.fontSize.default, css.fontWeight.semibold)
105
- .should('have.css', 'background-color', css.color.secondaryBtnBg)
106
- .and('have.css', 'border', `1px solid ${css.color.secondaryBtnBorder}`)
107
- equationEditorFlyout.buttonOk()
108
- .verifyCSS(css.color.primaryBtn, css.fontSize.default, css.fontWeight.semibold)
109
- .should('have.css', 'background-color', css.color.primaryBtnBg)
110
- .and('have.css', 'border', `1px solid ${css.color.primaryBtnBorder}`)
111
- });
112
-
113
- it('Accessibility of \'Equation Editor\' flyout', { tags: 'a11y' }, () => {
114
- cy.checkAccessibility(equationEditorFlyout.dialogBox())
115
- });
116
-
117
- it('Cancel button should be displayed in the flyout and when user clicks the \'Cancel\' button then the flyout should close', () => {
118
- equationEditorFlyout.buttonCancel()
119
- .click();
120
- equationEditorFlyout.dialogBox()
121
- .should('not.exist');
122
- });
123
- });
124
-
125
- describe('Equation Editor: Next and Previous button', () => {
126
- abortEarlySetup();
127
- before(() => {
128
- essayResponsePage.steps.navigateToCreateQuestion('essay response - rich text');
129
- essayResponsePage.steps.expandCustomizeFormattingOptionsAccordion();
130
- essayResponsePage.steps.selectCustomizedFormattingOption(['Equation Editor'])
131
- cy.barsPreLoaderWait();
132
- });
133
-
134
- it('When the selected number of equation categories fit the dialog box width then \'Next button\' and \'Previous button\' should not be displayed in the equation editor flyout', () => {
135
- cy.log('Pre step: Deselect one category from Equation Editor section')
136
- essayResponsePage.equationEditorSectionCategories()
137
- .contains(`${equationEditorCategoriesAndSymbols['keypad'].displayName}`)
138
- .click();
139
- cy.log('Switching to Preview tab')
140
- essayResponsePage.steps.switchToPreviewTab()
141
- essayResponsePage.previewTabToolbarOption('Equation Editor')
142
- .click();
143
- equationEditorFlyout.buttonNext()
144
- .should('not.exist');
145
- equationEditorFlyout.buttonPrevious()
146
- .should('not.exist');
147
- });
148
-
149
- it('When the selected number of equation categories do not fit the dialog box width then \'Next button\' and \'Previous button\' should be displayed in the equation editor flyout', () => {
150
- cy.log('Pre step: Switch to Edit tab and select all categories from the Equation Editor section')
151
- essayResponsePage.steps.switchToEditTab();
152
- essayResponsePage.steps.selectingCategories([`${equationEditorCategoriesAndSymbols['keypad'].displayName}`, `${equationEditorCategoriesAndSymbols['matrices'].displayName}`, `${equationEditorCategoriesAndSymbols['trigonometry'].displayName}`, `${equationEditorCategoriesAndSymbols['units'].displayName}`, `${equationEditorCategoriesAndSymbols['calculus'].displayName}`, `${equationEditorCategoriesAndSymbols['geometry'].displayName}`]);
153
- cy.log('Switching to Preview tab')
154
- essayResponsePage.steps.switchToPreviewTab()
155
- essayResponsePage.previewTabToolbarOption('Equation Editor')
156
- .click();
157
- equationEditorFlyout.buttonNext()
158
- .should('be.visible');
159
- equationEditorFlyout.buttonPrevious()
160
- .should('be.visible');
161
- });
162
-
163
- it('CSS of \'Next button\' and \'Previous button\'', { tags: 'css' }, () => {
164
- equationEditorFlyout.buttonPrevious()
165
- .find('svg')
166
- .should('have.css', 'background-color', css.color.defaultBackground)
167
- .find('path')
168
- .should('have.css', 'fill', css.color.nextPreviousButtonFill);
169
- equationEditorFlyout.buttonNext()
170
- .find('svg')
171
- .should('have.css', 'background-color', css.color.defaultBackground)
172
- .find('path')
173
- .should('have.css', 'fill', css.color.nextPreviousButtonFill);
174
- });
175
-
176
- it('Accessibility of \'Next button\' and \'Previous button\'', { tags: 'a11y' }, () => {
177
- cy.checkAccessibility(equationEditorFlyout.buttonPrevious());
178
- cy.checkAccessibility(equationEditorFlyout.buttonNext());
179
- });
180
-
181
- it('By default, the \'Previous button\' should be disabled and \'Next button\' should be enabled on opening the flyout as user is at the beginning of the tablist', () => {
182
- equationEditorFlyout.buttonPrevious()
183
- .should('have.class', 'disabled')
184
- .and('be.disabled');
185
- equationEditorFlyout.buttonNext()
186
- .should('not.have.class', 'disabled')
187
- .and('be.enabled');
188
- });
189
-
190
- it('When user clicks on the \'Next button\', the \'Previous button\' and the \'Next button\' both should get enabled, When the user reaches end of the tablist the \'Next button\' should get disabled and \'Previous button\' should remain enabled.', () => {
191
- equationEditorFlyout.buttonNext()
192
- .click();
193
- equationEditorFlyout.buttonNext()
194
- .should('not.have.class', 'disabled')
195
- .and('be.enabled');
196
- equationEditorFlyout.buttonPrevious()
197
- .should('not.have.class', 'disabled')
198
- .and('be.enabled');
199
- cy.log('Clicking on Next button to reach end of tablist')
200
- equationEditorFlyout.buttonNext()
201
- .click();
202
- equationEditorFlyout.buttonPrevious()
203
- .should('not.have.class', 'disabled')
204
- .and('be.enabled');
205
- equationEditorFlyout.buttonNext()
206
- .should('have.class', 'disabled')
207
- .and('be.disabled');
208
- });
209
-
210
- it('When user clicks on the \'Previous button\', and reaches the beginning of the tablist \'Previous button\' should become disabled and \'Next button\' should become enabled', () => {
211
- equationEditorFlyout.buttonPrevious()
212
- .dblclick();
213
- equationEditorFlyout.buttonPrevious()
214
- .should('have.class', 'disabled')
215
- .and('be.disabled');
216
- equationEditorFlyout.buttonNext()
217
- .should('not.have.class', 'disabled')
218
- .and('be.enabled');
219
- });
220
- });
221
-
222
- describe('Edit tab Equation Editor section', () => {
223
- abortEarlySetup();
224
- before(() => {
225
- essayResponsePage.steps.navigateToCreateQuestion('essay response - rich text');
226
- essayResponsePage.steps.expandCustomizeFormattingOptionsAccordion();
227
- essayResponsePage.steps.selectCustomizedFormattingOption(['Equation Editor'])
228
- });
229
-
230
- it('The \'Equation Editor\' should be displayed along with helper text \'Select the categories to display to the students in the equation editor.\' and \'Create custom category\' button should be displayed', () => {
231
- essayResponsePage.equationEditorSectionTitle()
232
- .verifyInnerText('Equation editor')
233
- .should('be.visible');
234
- essayResponsePage.equationEditorSectionHelperText()
235
- .verifyInnerText('Select the categories to display to the students in the equation editor.')
236
- .should('be.visible');
237
- essayResponsePage.createCustomCategoryButton()
238
- .verifyInnerText('Create custom category')
239
- .should('be.visible');
240
- });
241
-
242
- it('All the categories should be displayed with a drag icon should and an Edit icon should be displayed below all the categories irrespective of their selected state', () => {
243
- essayResponsePage.equationEditorSectionCategories()
244
- .each(($el, index) => {
245
- cy.wrap($el)
246
- .invoke('text')
247
- .then((textContent) => {
248
- const expectedValue = allCategories[index].displayName;
249
- expect(textContent.toLowerCase()).to.equal(expectedValue.toLowerCase())
250
- });
251
- cy.wrap($el)
252
- .parents('[id*="DraggableItem"]')
253
- .within(() => {
254
- essayResponsePage.equationEditorSectionCategoriesDragIcon()
255
- .should('be.visible');
256
- essayResponsePage.equationEditorSectionCategoriesEditIcon()
257
- .should('be.visible');
258
- });
259
- });
260
-
261
- });
262
-
263
- it('When user hovers on a category with a long name, then a tooltip should be displayed.', () => {
264
- let categoriesWithTooltip = [`${equationEditorCategoriesAndSymbols['relationships'].displayName}`, `${equationEditorCategoriesAndSymbols['trigonometry'].displayName}`, `${equationEditorCategoriesAndSymbols['calculus'].displayName}`, `${equationEditorCategoriesAndSymbols['geometry'].displayName}`];
265
- categoriesWithTooltip.forEach((categoryTooltipName) => {
266
- essayResponsePage.equationEditorSectionCategories()
267
- .contains(categoryTooltipName, { matchCase: false })
268
- .realHover();
269
- commonComponents.tooltipText()
270
- .verifyInnerText(categoryTooltipName);
271
- essayResponsePage.equationEditorSectionCategories()
272
- .contains(categoryTooltipName, { matchCase: false })
273
- .trigger('mouseout');
274
- commonComponents.tooltipText()
275
- .should('not.exist');
276
- });
277
- });
278
-
279
- it(`By default, ${defaultSelectedCategories.toString()} should be selected`, () => {
280
- defaultSelectedCategories.forEach((category) => {
281
- essayResponsePage.equationEditorSectionCategories()
282
- .contains(category)
283
- .parents('.icon-button-custom-format')
284
- .should('have.class', 'Mui-selected')
285
- .within(() => {
286
- essayResponsePage.equationEditorSectionTickIcon()
287
- .should('be.visible');
288
- });
289
- });
290
- });
291
-
292
- it('CSS of selected and deselected category', { tags: 'css' }, () => {
293
- cy.log('CSS of selected category')
294
- essayResponsePage.equationEditorSectionCategories()
295
- .first()
296
- .should('have.css', 'background-color', css.color.activeButtons)
297
- .within(() => {
298
- essayResponsePage.equationEditorSectionCategoryLabel()
299
- .verifyCSS(css.color.primaryBtn, css.fontSize.small, css.fontWeight.regular);
300
- essayResponsePage.equationEditorSectionTickIcon()
301
- .find('[data-name*="Icon"]')
302
- .should('have.css', 'fill', css.color.activeButtons);
303
- essayResponsePage.equationEditorSectionCategoriesDragIcon()
304
- .find('path')
305
- .should('have.css', 'fill', css.color.activeButtons);
306
- });
307
- cy.log('CSS of deselected category')
308
- essayResponsePage.equationEditorSectionCategories()
309
- .last()
310
- .should('have.css', 'background-color', css.color.primaryBtn)
311
- .within(() => {
312
- essayResponsePage.equationEditorSectionCategoryLabel()
313
- .verifyCSS(css.color.secondaryBtn, css.fontSize.small, css.fontWeight.regular);
314
- essayResponsePage.equationEditorSectionCategoriesDragIcon()
315
- .find('path')
316
- .should('have.css', 'fill', css.color.secondaryBtn)
317
- });
318
- });
319
-
320
- it('Accessibility of selected and deselected category', { tags: 'a11y' }, () => {
321
- cy.checkAccessibility(essayResponsePage.equationEditorSectionCategories().contains(`${equationEditorCategoriesAndSymbols['keypad'].displayName}`).parents('[class*="DraggableItemsGrid"]'))
322
- });
323
-
324
- it('User should be able select and deselect a category and it should be reflected in the Equation Editor flyout and the first category should be selected by default', () => {
325
- cy.log('Seelecting and deselecting a category')
326
- essayResponsePage.equationEditorSectionCategories()
327
- .contains(`${equationEditorCategoriesAndSymbols['keypad'].displayName}`)
328
- .click();
329
- essayResponsePage.equationEditorSectionCategories()
330
- .contains(`${equationEditorCategoriesAndSymbols['geometry'].displayName}`, { matchCase: false })
331
- .click();
332
- cy.log('Switching to Preview tab')
333
- essayResponsePage.steps.switchToPreviewTab();
334
- essayResponsePage.previewTabToolbarOption('Equation Editor')
335
- .click();
336
- equationEditorFlyout.categoryTab()
337
- .should('not.have.text', 'Keypad');
338
- equationEditorFlyout.categoryTab()
339
- .eq(0)
340
- .within(() => {
341
- equationEditorFlyout.categoryTabTitle()
342
- .verifyInnerText('Basic')
343
- .should('have.class', 'selected-tool-content-color');
344
- });
345
- equationEditorFlyout.buttonNext()
346
- .click();
347
- equationEditorFlyout.categoryTab()
348
- .eq(7)
349
- .verifyInnerText(`${equationEditorCategoriesAndSymbols['geometry'].displayName}`);
350
- });
351
-
352
- it('On deselecting all the categories an error message should be displayed \'Error: Please select a category.\' and the Equation Editor flyout should be empty', () => {
353
- cy.log('Pre step: Switching to Edit tab')
354
- essayResponsePage.steps.switchToEditTab();
355
- essayResponsePage.steps.selectingCategories([`${equationEditorCategoriesAndSymbols['basic'].displayName}`, `${equationEditorCategoriesAndSymbols['greek'].displayName}`, `${equationEditorCategoriesAndSymbols['operators'].displayName}`, `${equationEditorCategoriesAndSymbols['relationships'].displayName}`, `${equationEditorCategoriesAndSymbols['arrows'].displayName}`, `${equationEditorCategoriesAndSymbols['delimiters'].displayName}`, `${equationEditorCategoriesAndSymbols['misc'].displayName}`, `${equationEditorCategoriesAndSymbols['geometry'].displayName}`]);
356
- essayResponsePage.selectACategoryErrorMessage()
357
- .verifyInnerText('Error: Please select a category.')
358
- cy.log('Switching to Preview tab')
359
- essayResponsePage.steps.switchToPreviewTab();
360
- essayResponsePage.previewTabToolbarOption('Equation Editor')
361
- .click();
362
- equationEditorFlyout.dialogBox()
363
- .should('be.visible');
364
- equationEditorFlyout.categoryTabTitle()
365
- .should('not.exist');
366
- equationEditorFlyout.categoryCharactersWrapper()
367
- .should('not.exist');
368
- cy.log('Post step: Switching to Edit tab')
369
- essayResponsePage.steps.switchToEditTab();
370
- });
371
-
372
- //https://redmine.zeuslearning.com/issues/530205
373
- it('CSS of error message', { tags: 'css' }, () => {
374
- essayResponsePage.selectACategoryErrorMessage()
375
- .verifyCSS(css.color.errorText, css.fontSize.small, css.fontWeight.regular);
376
- });
377
-
378
- it('Accessibility of error message', { tags: 'a11y' }, () => {
379
- cy.checkAccessibility(essayResponsePage.selectACategoryErrorMessage());
380
- });
381
-
382
- it('When user selects any category then the error message should disappear', () => {
383
- essayResponsePage.equationEditorSectionCategories()
384
- .contains(`${equationEditorCategoriesAndSymbols['keypad'].displayName}`)
385
- .click();
386
- essayResponsePage.selectACategoryErrorMessage()
387
- .should('not.exist');
388
- });
389
-
390
- it('When user re-selects the Equation Editor icon then only the previously selected category category should appear in selected state', () => {
391
- essayResponsePage.customizeFormattingOptionsTiles('Equation Editor')
392
- .click();
393
- essayResponsePage.equationEditorSection()
394
- .should('not.exist');
395
- essayResponsePage.steps.selectCustomizedFormattingOption(['Equation Editor'])
396
- essayResponsePage.equationEditorSectionCategories()
397
- .each(($el, index) => {
398
- if (index == 0) {
399
- cy.wrap($el)
400
- .should('have.class', 'Mui-selected');
401
- } else {
402
- cy.wrap($el)
403
- .should('not.have.class', 'Mui-selected');
404
- }
405
- });
406
- });
407
- });
408
-
409
- describe('Adding and deleting equations', () => {
410
- abortEarlySetup();
411
- before(() => {
412
- essayResponsePage.steps.navigateToCreateQuestion('essay response - rich text');
413
- essayResponsePage.steps.expandCustomizeFormattingOptionsAccordion();
414
- essayResponsePage.steps.selectCustomizedFormattingOption(['Equation Editor'])
415
- cy.barsPreLoaderWait();
416
- essayResponsePage.steps.switchToPreviewTab();
417
- essayResponsePage.previewTabToolbarOption('Equation Editor')
418
- .click();
419
- });
420
-
421
- it('When user enters an equation in the Preview input field the word count should increase by 1 and the entered equation should have focus', () => {
422
- cy.log('Adding an equation using Basic and Greek category')
423
- equationEditorFlyout.categoryTab(`${equationEditorCategoriesAndSymbols['basic'].displayName}`)
424
- .parents('.tool-wrapper')
425
- .click();
426
- equationEditorFlyout.categoryCharacters(equationEditorCategoriesAndSymbols.basic.symbols.x.ariaLabel)
427
- .click();
428
- equationEditorFlyout.categoryCharacters(equationEditorCategoriesAndSymbols.basic.symbols.square.ariaLabel)
429
- .click();
430
- equationEditorFlyout.categoryCharacters(equationEditorCategoriesAndSymbols.basic.symbols.equalTo.ariaLabel)
431
- .click();
432
- equationEditorFlyout.categoryTab(`${equationEditorCategoriesAndSymbols['greek'].displayName}`)
433
- .parents('.tool-wrapper')
434
- .click();
435
- equationEditorFlyout.categoryCharacters(equationEditorCategoriesAndSymbols.greek.symbols.piUpper.ariaLabel)
436
- .click();
437
- cy.log('Clicking on Ok button to add the equation to Preview input field and checking word count')
438
- equationEditorFlyout.buttonOk()
439
- .click();
440
- essayResponsePage.responseField()
441
- .find('.cke_widget_wrapper')
442
- .should('have.class', 'cke_widget_focused');
443
- essayResponsePage.steps.verifyResponseFieldWordCount('1/10000')
444
- });
445
-
446
- it('When user enters another equation in the preview input field without adding any space the word count should remain the same', () => {
447
- cy.log('Prestep: Clicking on Equation editor button')
448
- essayResponsePage.responseField()
449
- .type('{rightarrow}');
450
- essayResponsePage.previewTabToolbarOption('Equation Editor')
451
- .click();
452
- equationEditorFlyout.categoryTab(`${equationEditorCategoriesAndSymbols['arrows'].displayName}`)
453
- .parents('.tool-wrapper')
454
- .click();
455
- equationEditorFlyout.categoryCharacters(equationEditorCategoriesAndSymbols.arrows.symbols.leftArrow.ariaLabel)
456
- .click();
457
- equationEditorFlyout.categoryCharacters(equationEditorCategoriesAndSymbols.arrows.symbols.leftRightHarpoons.ariaLabel)
458
- .click();
459
- equationEditorFlyout.buttonOk()
460
- .click();
461
- essayResponsePage.steps.verifyResponseFieldWordCount('1/10000')
462
- });
463
-
464
- it('When user enters another equation in the preview input field after adding a space the word count should increase by 1', () => {
465
- essayResponsePage.responseField()
466
- .type('{rightarrow} ');
467
- essayResponsePage.previewTabToolbarOption('Equation Editor')
468
- .click();
469
- equationEditorFlyout.categoryCharacters(equationEditorCategoriesAndSymbols.keypad.symbols.one.ariaLabel)
470
- .click();
471
- equationEditorFlyout.categoryCharacters(equationEditorCategoriesAndSymbols.keypad.symbols.add.ariaLabel)
472
- .click();
473
- equationEditorFlyout.categoryCharacters(equationEditorCategoriesAndSymbols.keypad.symbols.two.ariaLabel)
474
- .click();
475
- equationEditorFlyout.buttonOk()
476
- .click();
477
- essayResponsePage.steps.verifyResponseFieldWordCount('2/10000')
478
- });
479
-
480
- it('When user clicks backspace the entered equation should get deleted and the word count should decrease by 1', () => {
481
- essayResponsePage.responseField()
482
- .type('{backspace}{backspace}')
483
- .should('not.have.text', '1+2');
484
- essayResponsePage.steps.verifyResponseFieldWordCount('1/10000')
485
- });
486
- });
487
-
488
- describe('Edit equation', () => {
489
- abortEarlySetup();
490
- before(() => {
491
- essayResponsePage.steps.navigateToCreateQuestion('essay response - rich text');
492
- essayResponsePage.steps.expandCustomizeFormattingOptionsAccordion();
493
- essayResponsePage.steps.selectCustomizedFormattingOption(['Equation Editor'])
494
- cy.barsPreLoaderWait();
495
- essayResponsePage.steps.switchToPreviewTab();
496
- essayResponsePage.previewTabToolbarOption('Equation Editor')
497
- .click();
498
- cy.log('Adding an equation to preview input field')
499
- equationEditorFlyout.categoryTab(`${equationEditorCategoriesAndSymbols['relationships'].displayName}`)
500
- .parents('.tool-wrapper')
501
- .click();
502
- equationEditorFlyout.categoryCharacters(equationEditorCategoriesAndSymbols.relationships.symbols.simultaneousEquations.ariaLabel)
503
- .click();
504
- equationEditorFlyout.inputFieldCursor()
505
- .type('a');
506
- equationEditorFlyout.inputFieldFirstEmptyBox()
507
- .type('b');
508
- equationEditorFlyout.inputFieldFirstEmptyBox()
509
- .type('c');
510
- equationEditorFlyout.inputFieldFirstEmptyBox()
511
- .type('d');
512
- equationEditorFlyout.buttonOk()
513
- .click();
514
- essayResponsePage.responseField()
515
- .find('.cke_widget_element')
516
- .should('have.text', 'a+b=c+d=');
517
- });
518
-
519
- it('When user double clicks on an added equation in the preview input field, the Equation editor flyout should open', () => {
520
- essayResponsePage.responseField()
521
- .find('.cke_widget_element')
522
- .dblclick();
523
- equationEditorFlyout.dialogBox()
524
- .should('be.visible');
525
- });
526
-
527
- it(`In the equation editor flyout the ${allCategories[0].displayName} should be selected by default and the Equation editor input field should be prefilled with the added equation`, () => {
528
- equationEditorFlyout.categoryTab(`${equationEditorCategoriesAndSymbols['keypad'].displayName}`)
529
- .parents('.tool-wrapper')
530
- .within(() => {
531
- equationEditorFlyout.categoryTabTitle()
532
- .verifyInnerText(`${equationEditorCategoriesAndSymbols['keypad'].displayName}`)
533
- .should('have.class', 'selected-tool-content-color');
534
- });
535
- equationEditorFlyout.previewInputField()
536
- .contains('a+b=c+d=');
537
- });
538
-
539
- it('When user clicks on Cancel button the equation should be displayed in the preview input field without any changes', () => {
540
- equationEditorFlyout.buttonCancel()
541
- .click();
542
- essayResponsePage.responseField()
543
- .find('.cke_widget_element')
544
- .should('have.text', 'a+b=c+d=');
545
- });
546
-
547
- it('When user edits the added equation and clicks on Ok button, the edited equation should be displayed in the preview input field', () => {
548
- essayResponsePage.responseField()
549
- .find('.cke_widget_element')
550
- .dblclick();
551
- equationEditorFlyout.previewInputField()
552
- .click()
553
- .type('{backspace}{backspace}');
554
- equationEditorFlyout.categoryTab(`${equationEditorCategoriesAndSymbols['delimiters'].displayName}`)
555
- .parents('.tool-wrapper')
556
- .click();
557
- equationEditorFlyout.categoryCharacters(equationEditorCategoriesAndSymbols.delimiters.symbols.singleSquareOpen.ariaLabel)
558
- .click();
559
- equationEditorFlyout.inputFieldCursor()
560
- .type('a{rightarrow}');
561
- equationEditorFlyout.categoryCharacters(equationEditorCategoriesAndSymbols.delimiters.symbols.singleSquareClose.ariaLabel)
562
- .click();
563
- equationEditorFlyout.buttonOk()
564
- .click();
565
- essayResponsePage.responseField()
566
- .find('.cke_widget_element')
567
- .should('have.text', '[a]');
568
- essayResponsePage.responseField()
569
- .should('not.have.text', 'a+b=c+d=');
570
- });
571
- });
572
- });