itemengine-cypress-automation 1.0.19 → 1.0.21

Sign up to get free protection for your applications and to get access to all the features.
Files changed (21) hide show
  1. package/cypress/e2e/ILC/EssayResponse/essayResponseAdditionalSettings.js +432 -0
  2. package/cypress/e2e/ILC/EssayResponse/essayResponseAdditionalSettingsBasic.js +134 -0
  3. package/cypress/e2e/ILC/EssayResponse/essayResponseCreateCustomCategory.js +932 -0
  4. package/cypress/e2e/ILC/EssayResponse/essayResponseCustomizeFormattingOptions1.js +333 -0
  5. package/cypress/e2e/ILC/EssayResponse/essayResponseCustomizeFormattingOptions2.js +332 -0
  6. package/cypress/e2e/ILC/EssayResponse/essayResponseCustomizeFormattingOptions3.js +522 -0
  7. package/cypress/e2e/ILC/EssayResponse/essayResponseEditCategoryFlyout.js +402 -0
  8. package/cypress/e2e/ILC/EssayResponse/essayResponseEditTabBasicSections.js +558 -0
  9. package/cypress/e2e/ILC/EssayResponse/essayResponseEquationEditor.js +572 -0
  10. package/cypress/e2e/ILC/EssayResponse/essayResponseEquationEditorCategories1.js +290 -0
  11. package/cypress/e2e/ILC/EssayResponse/essayResponseEquationEditorCategories2.js +514 -0
  12. package/cypress/e2e/ILC/EssayResponse/essayResponseHeaderSection.js +80 -0
  13. package/cypress/e2e/ILC/EssayResponse/essayResponsePreviewAddTable.js +412 -0
  14. package/cypress/e2e/ILC/EssayResponse/essayResponsePreviewEditTable.js +659 -0
  15. package/cypress/e2e/ILC/EssayResponse/essayResponsePreviewHyperlink.js +318 -0
  16. package/cypress/e2e/ILC/EssayResponse/essayResponseScoringSection.js +59 -0
  17. package/cypress/e2e/ILC/EssayResponse/essayResponseSpecialCharacters.js +33 -0
  18. package/cypress/e2e/ILC/EssayResponseBasic/essayResponseBasicCustomizeFormattingOptions.js +207 -0
  19. package/cypress/e2e/ILC/EssayResponseMath/essayResponseMathCharacters.js +38 -0
  20. package/cypress/e2e/ILC/EssayResponseMath/essayResponseMathCreateItem.js +243 -0
  21. package/package.json +1 -1
@@ -0,0 +1,243 @@
1
+ import abortEarlySetup from "../../../support/helpers/abortEarly";
2
+ import { essayResponseMathPage } from "../../../pages";
3
+ import { commonComponents } from "../../../pages/components";
4
+ import { equationEditorFlyout } from "../../../pages/components/equationEditorFlyout";
5
+ const css = Cypress.env('css');
6
+
7
+ describe('Create question page - Essay response - math', () => {
8
+ before(() => {
9
+ cy.loginAs('admin');
10
+ essayResponseMathPage.steps.navigateToCreateQuestion('essay response - math');
11
+ });
12
+
13
+ it('\'Essay response - math\' label should be displayed', () => {
14
+ essayResponseMathPage.tests.verifyCreateQuestionPageQuestionTypeHeader('Essay response - math');
15
+ });
16
+
17
+ it('When the user expands the \'Customize formatting options (for student player)\' accordion, the \'Equation Editor\' formatting option should be selected by default', () => {
18
+ essayResponseMathPage.steps.expandCustomizeFormattingOptionsAccordion()
19
+ essayResponseMathPage.customizeFormattingOptionsTiles('Equation Editor')
20
+ .should('have.attr', 'data-aria-pressed', 'true');
21
+ });
22
+
23
+ describe('Text to not be rendered as LaTex section contents', () => {
24
+ abortEarlySetup();
25
+ before(() => {
26
+ essayResponseMathPage.steps.navigateToCreateQuestion('essay response - math');
27
+ });
28
+
29
+ it('CSS of \'Text to not be rendered as LaTex section\' section', { tags: 'css' }, () => {
30
+ essayResponseMathPage.textToNotBeRenderedAsLaTexLabel()
31
+ .verifyCSS(css.color.sectionHeading, css.fontSize.default, css.fontWeight.semibold);
32
+ essayResponseMathPage.addTextButton()
33
+ .should('have.css', 'color', css.color.activeButtons)
34
+ .verifyPseudoClassBeforeProperty('color', css.color.activeButtons);
35
+ });
36
+
37
+ it('Accessibility of \'Text to not be rendered as LaTex section\' section', { tags: 'a11y' }, () => {
38
+ cy.checkAccessibility(essayResponseMathPage.textToNotBeRenderedAsLaTexLabel().parents('.text-not-latex-wrapper'));
39
+ });
40
+
41
+ it('\'Text to not be rendered as LaTex\' label along with an \'+Add text\' button should be displayed and the \'Text to not be rendered as LaTex\' input field should not be present ', () => {
42
+ essayResponseMathPage.textToNotBeRenderedAsLaTexLabel()
43
+ .verifyInnerText('Text to not be rendered as LaTex');
44
+ essayResponseMathPage.addTextButton()
45
+ .verifyInnerText('Add text')
46
+ .verifyPseudoClassBeforeProperty('content', '""');
47
+ });
48
+
49
+ it('When the user clicks on the \'+Add text\' button, an input field with \'1\' count and a delete button should appear. The user should be able to enter text into the input field', () => {
50
+ essayResponseMathPage.addTextButton()
51
+ .click();
52
+ essayResponseMathPage.textToNotBeRenderedAsLaTextInputFieldWrapper(0)
53
+ .should('be.visible')
54
+ .within(() => {
55
+ essayResponseMathPage.textToNotBeRenderedAsLaTextInputFieldCount()
56
+ .should('have.text', '1');
57
+ essayResponseMathPage.textToNotBeRenderedAsLaTextInputField()
58
+ .type('mm')
59
+ .should('have.value', 'mm');
60
+ });
61
+ essayResponseMathPage.deleteButton()
62
+ .should('be.visible');
63
+ });
64
+
65
+
66
+ it('CSS of \'Text to not be rendered as LaTex\' input field', { tags: 'css' }, () => {
67
+ essayResponseMathPage.textToNotBeRenderedAsLaTextInputField()
68
+ .should('have.css', 'color', css.color.text)
69
+ .parents('.input-field')
70
+ .should('have.css', 'background-color', css.color.defaultBackground);
71
+ essayResponseMathPage.deleteButton()
72
+ .verifyPseudoClassBeforeProperty('color', css.color.deleteIcon);
73
+ });
74
+
75
+ //Failing due to https://redmine.zeuslearning.com/issues/548514
76
+ it('Accessibility of \'Text to not be rendered as LaTex\' input field', { tags: 'a11y' }, () => {
77
+ cy.checkAccessibility(essayResponseMathPage.textToNotBeRenderedAsLaTextInputField().parents('.text-not-to-be-rendered-input'))
78
+ });
79
+
80
+ it('When the user clicks on the \'+Add text\' button, an input field with \'2\' count and a delete button should appear.', () => {
81
+ essayResponseMathPage.addTextButton()
82
+ .click();
83
+ essayResponseMathPage.textToNotBeRenderedAsLaTextInputFieldWrapper(1)
84
+ .should('be.visible')
85
+ .within(() => {
86
+ essayResponseMathPage.textToNotBeRenderedAsLaTextInputFieldCount()
87
+ .should('have.text', '2');
88
+ });
89
+ essayResponseMathPage.deleteButton()
90
+ .eq(1)
91
+ .should('be.visible');
92
+ });
93
+
94
+ it('When the user clicks on the delete button of the \'1\' input field, the \'1\' input field should get deleted and the count of the \'2\' input field should update to \'1\'', () => {
95
+ essayResponseMathPage.deleteButton()
96
+ .eq(0)
97
+ .click();
98
+ essayResponseMathPage.textToNotBeRenderedAsLaTextInputField()
99
+ .should('have.length', 1);
100
+ essayResponseMathPage.textToNotBeRenderedAsLaTextInputFieldWrapper(0)
101
+ .within(() => {
102
+ essayResponseMathPage.textToNotBeRenderedAsLaTextInputFieldCount()
103
+ .should('have.text', '1');
104
+ });
105
+ });
106
+ });
107
+
108
+ describe('Text to not be rendered as LaTex - functionality', () => {
109
+ abortEarlySetup();
110
+ before(() => {
111
+ essayResponseMathPage.steps.navigateToCreateQuestion('essay response - math');
112
+ cy.barsPreLoaderWait();
113
+ essayResponseMathPage.steps.expandCustomizeFormattingOptionsAccordion();
114
+ essayResponseMathPage.equationEditorSectionCategories()
115
+ .eq(10)
116
+ .click();
117
+ essayResponseMathPage.addTextButton()
118
+ .click();
119
+ essayResponseMathPage.steps.addTextToNotBeRenderedAsLatexEditTab(0, 'mm');
120
+ essayResponseMathPage.steps.switchToPreviewTab();
121
+ essayResponseMathPage.previewTabToolbarOption('Equation Editor')
122
+ .click();
123
+ });
124
+
125
+ it('When the user adds text in the input field of the equation editor flyout that is not set as text to not be rendered as LaTex, then that text should appear as a latex code and the text that is set to not be rendered as LaTex, should appear as text in regular format', () => {
126
+ equationEditorFlyout.previewInputField()
127
+ .type('80 mm Hg to 120 ');
128
+ equationEditorFlyout.categoryTab('Units')
129
+ .click();
130
+ equationEditorFlyout.categoryCharacters('Millimeter')
131
+ .click();
132
+ equationEditorFlyout.previewInputField()
133
+ .type(' Hg');
134
+ equationEditorFlyout.previewInputField()
135
+ .find('.mq-operator-name')
136
+ .each(($element) => {
137
+ expect($element).to.have.css('font-style', 'normal');
138
+ });
139
+ let latexCharacterIndexes = [2, 3, 4, 5]
140
+ equationEditorFlyout.previewInputField()
141
+ .within(() => {
142
+ latexCharacterIndexes.forEach((characterIndex) => {
143
+ essayResponseMathPage.inputFieldLatexCharacter()
144
+ .eq(characterIndex)
145
+ .should('have.css', 'font-style', 'italic');
146
+ });
147
+ });
148
+ cy.get('#textarea-value')
149
+ .should('have.text', '80 mm H of g t o 120 mm H of g')
150
+ });
151
+
152
+ it('When the user clicks on the\'Ok\' button on the equation editor flyout, the text should appear the same as it was displayed in the input field of the equation editor flyout', () => {
153
+ equationEditorFlyout.buttonOk()
154
+ .click()
155
+ essayResponseMathPage.responseField()
156
+ .find('.cke_widget_element')
157
+ .should('have.attr', 'aria-label', '80 mm H of g t o 120 mm H of g')
158
+ });
159
+
160
+ it('When the user has set multiple texts to not be rendered as LaTex, then those texts should appear in regular format in the input field of the equation editor flyout as well as in the response field', () => {
161
+ essayResponseMathPage.steps.switchToEditTab()
162
+ essayResponseMathPage.addTextButton()
163
+ .click();
164
+ essayResponseMathPage.steps.addTextToNotBeRenderedAsLatexEditTab(1, 'Hg');
165
+ essayResponseMathPage.steps.switchToPreviewTab()
166
+ essayResponseMathPage.previewTabToolbarOption('Equation Editor')
167
+ .click();
168
+ equationEditorFlyout.previewInputField()
169
+ .type('80 mmHg to 120 ');
170
+ equationEditorFlyout.categoryTab('Units')
171
+ .click();
172
+ equationEditorFlyout.categoryCharacters('Millimeter')
173
+ .click();
174
+ equationEditorFlyout.previewInputField()
175
+ .type('Hg');
176
+ equationEditorFlyout.previewInputField()
177
+ .find('.mq-operator-name')
178
+ .each(($element) => {
179
+ expect($element).to.have.css('font-style', 'normal');
180
+ });
181
+ let latexCharacterIndexes = [4, 5]
182
+ equationEditorFlyout.previewInputField()
183
+ .within(() => {
184
+ latexCharacterIndexes.forEach((characterIndex) => {
185
+ essayResponseMathPage.inputFieldLatexCharacter()
186
+ .eq(characterIndex)
187
+ .should('have.css', 'font-style', 'italic');
188
+ });
189
+ });
190
+ cy.get('#textarea-value')
191
+ .should('have.text', '80 mm Hg t o 120 mm Hg');
192
+ equationEditorFlyout.buttonOk()
193
+ .click();
194
+ essayResponseMathPage.responseField()
195
+ .find('.cke_widget_element')
196
+ .should('have.attr', 'aria-label', '80 mm Hg t o 120 mm Hg')
197
+ });
198
+
199
+ it('When the user has set any special character as \'text to not be rendered as LaTex\', then that special character should be rendered as LaTex code in the input field of the equation editor flyout as well as in the response field, it should NOT be rendered in regular format', () => {
200
+ essayResponseMathPage.steps.switchToEditTab()
201
+ essayResponseMathPage.addTextButton()
202
+ .click()
203
+ essayResponseMathPage.steps.addTextToNotBeRenderedAsLatexEditTab(2, '$');
204
+ essayResponseMathPage.steps.switchToPreviewTab()
205
+ essayResponseMathPage.previewTabToolbarOption('Equation Editor')
206
+ .click();
207
+ equationEditorFlyout.previewInputField()
208
+ .type('200$');
209
+ cy.get('span[mathquill-command-id]')
210
+ .each(($element) => {
211
+ expect($element).to.not.have.class('.mq-operator-name');
212
+ });
213
+ cy.get('#textarea-value')
214
+ .should('have.text', '200 Dollars');
215
+ equationEditorFlyout.buttonOk()
216
+ .click();
217
+ essayResponseMathPage.responseField()
218
+ .find('.cke_widget_element')
219
+ .should('have.attr', 'aria-label', '200 Dollars');
220
+ });
221
+
222
+ it('When the user deletes a text to not be rendered as latex option then the deleted option text should be displayed as a \'LaTex code\' in the \'Equation editor\' flyout as well as in the response field', () => {
223
+ essayResponseMathPage.steps.switchToEditTab()
224
+ essayResponseMathPage.deleteButton()
225
+ .eq(1)
226
+ .click();
227
+ essayResponseMathPage.steps.switchToPreviewTab()
228
+ essayResponseMathPage.previewTabToolbarOption('Equation Editor')
229
+ .click();
230
+ equationEditorFlyout.previewInputField()
231
+ .type('Hg');
232
+ essayResponseMathPage.inputFieldLatexCharacter()
233
+ .each(($element) => {
234
+ expect($element).to.not.have.class('.mq-operator-name');
235
+ });
236
+ equationEditorFlyout.buttonOk()
237
+ .click();
238
+ essayResponseMathPage.responseField()
239
+ .find('.cke_widget_element')
240
+ .should('have.attr', 'aria-label', 'H of g');
241
+ });
242
+ });
243
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "itemengine-cypress-automation",
3
- "version": "1.0.19",
3
+ "version": "1.0.21",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {