itemengine-cypress-automation 1.0.18 → 1.0.20
Sign up to get free protection for your applications and to get access to all the features.
- package/cypress/e2e/ILC/EssayResponse/essayResponseAdditionalSettings.js +555 -0
- package/cypress/e2e/ILC/EssayResponse/essayResponseCreateCustomCategory.js +932 -0
- package/cypress/e2e/ILC/EssayResponse/essayResponseCustomizeFormattingOptions1.js +333 -0
- package/cypress/e2e/ILC/EssayResponse/essayResponseCustomizeFormattingOptions2.js +332 -0
- package/cypress/e2e/ILC/EssayResponse/essayResponseCustomizeFormattingOptions3.js +522 -0
- package/cypress/e2e/ILC/EssayResponse/essayResponseEditCategoryFlyout.js +402 -0
- package/cypress/e2e/ILC/EssayResponse/essayResponseEditTabBasicSections.js +558 -0
- package/cypress/e2e/ILC/EssayResponse/essayResponseEquationEditor.js +1346 -0
- package/cypress/e2e/ILC/EssayResponse/essayResponseHeaderSection.js +80 -0
- package/cypress/e2e/ILC/EssayResponse/essayResponseMathCharacters.js +38 -0
- package/cypress/e2e/ILC/EssayResponse/essayResponseMathCreateItem.js +243 -0
- package/cypress/e2e/ILC/EssayResponse/essayResponsePreviewAddTable.js +412 -0
- package/cypress/e2e/ILC/EssayResponse/essayResponsePreviewEditTable.js +659 -0
- package/cypress/e2e/ILC/EssayResponse/essayResponsePreviewHyperlink.js +318 -0
- package/cypress/e2e/ILC/EssayResponse/essayResponseScoringSection.js +59 -0
- package/cypress/e2e/ILC/EssayResponse/essayResponseSpecialCharacters.js +33 -0
- package/cypress/e2e/ILC/MultipleSelectionGrid/multipleSelectionGridAdditionalSettingsBasic.js +255 -0
- package/cypress/e2e/ILC/MultipleSelectionGrid/multipleSelectionGridAllOrNothingWithAlternateAnswer.js +731 -0
- package/cypress/e2e/ILC/MultipleSelectionGrid/multipleSelectionGridAutoScoredScoring.js +0 -719
- package/cypress/e2e/ILC/MultipleSelectionGrid/multipleSelectionGridOptionsAdditionalSettings.js +351 -0
- package/cypress/e2e/ILC/MultipleSelectionGrid/multipleSelectionGridPartialDifferentWeights.js +0 -930
- package/cypress/e2e/ILC/MultipleSelectionGrid/multipleSelectionGridPartialDifferentWeightsWithAlternateAnswer.js +942 -0
- package/cypress/e2e/ILC/MultipleSelectionGrid/multipleSelectionGridPartialEqualWeights.js +0 -852
- package/cypress/e2e/ILC/MultipleSelectionGrid/multipleSelectionGridPartialEqualWeightsWithAlternateAnswer.js +864 -0
- package/cypress/e2e/ILC/MultipleSelectionGrid/multipleSelectionGridQuestionStemAdditionalSettings.js +261 -0
- package/package.json +1 -1
- package/cypress/e2e/ILC/MultipleSelectionGrid/multipleSelectionGridAdditionalSettings.js +0 -830
@@ -0,0 +1,80 @@
|
|
1
|
+
import abortEarlySetup from "../../../support/helpers/abortEarly";
|
2
|
+
import { essayResponsePage, dialogBoxBase } from "../../../pages";
|
3
|
+
import { commonComponents } from "../../../pages/components";
|
4
|
+
|
5
|
+
describe('Create question page - Essay response: Header section and Saving question', () => {
|
6
|
+
before(() => {
|
7
|
+
cy.loginAs('admin');
|
8
|
+
});
|
9
|
+
|
10
|
+
describe('Header section contents', () => {
|
11
|
+
abortEarlySetup();
|
12
|
+
before(() => {
|
13
|
+
essayResponsePage.steps.navigateToCreateQuestion('essay response - rich text');
|
14
|
+
});
|
15
|
+
|
16
|
+
essayResponsePage.tests.verifyCreateQuestionPageQuestionTypeHeader('Essay response - rich text');
|
17
|
+
});
|
18
|
+
|
19
|
+
describe('Tabs section', () => {
|
20
|
+
abortEarlySetup();
|
21
|
+
before(() => {
|
22
|
+
essayResponsePage.steps.navigateToCreateQuestion('essay response - rich text');
|
23
|
+
});
|
24
|
+
|
25
|
+
essayResponsePage.tests.verifyTabsSection();
|
26
|
+
});
|
27
|
+
|
28
|
+
describe('Cancel button', () => {
|
29
|
+
abortEarlySetup();
|
30
|
+
before(() => {
|
31
|
+
essayResponsePage.steps.navigateToCreateQuestion('essay response - rich text');
|
32
|
+
});
|
33
|
+
|
34
|
+
essayResponsePage.tests.verifyCancelButton('essay response - rich text');
|
35
|
+
});
|
36
|
+
|
37
|
+
describe('Save Question button', () => {
|
38
|
+
abortEarlySetup();
|
39
|
+
before(() => {
|
40
|
+
essayResponsePage.steps.navigateToCreateQuestion('essay response - rich text');
|
41
|
+
cy.barsPreLoaderWait();
|
42
|
+
});
|
43
|
+
|
44
|
+
describe('Validation error messages', () => {
|
45
|
+
dialogBoxBase.tests.verifyRequiredFieldsWarningPopupOnClickingSaveButton();
|
46
|
+
|
47
|
+
it('Validation error messages should be displayed below required input fields', () => {
|
48
|
+
essayResponsePage.questionInstructionsLabelEditTab()
|
49
|
+
.parents('.edit-question-instruction-wrapper')
|
50
|
+
.within(() => {
|
51
|
+
commonComponents.errorMessage()
|
52
|
+
.verifyInnerText('Error: Question instructions are required.')
|
53
|
+
.and('be.visible');
|
54
|
+
});
|
55
|
+
essayResponsePage.pleaseEnterPointsErrorMessage()
|
56
|
+
.verifyInnerText('Error: Please enter points.');
|
57
|
+
});
|
58
|
+
|
59
|
+
it('Validation error messages should disappear when required input fields are filled', () => {
|
60
|
+
essayResponsePage.steps.addQuestionInstructions();
|
61
|
+
essayResponsePage.questionInstructionsLabelEditTab()
|
62
|
+
.parents('.edit-question-instruction-wrapper')
|
63
|
+
.within(() => {
|
64
|
+
commonComponents.errorMessage()
|
65
|
+
.should('not.exist');
|
66
|
+
});
|
67
|
+
essayResponsePage.steps.allotPoints(20);
|
68
|
+
essayResponsePage.pleaseEnterPointsErrorMessage()
|
69
|
+
.should('not.exist');
|
70
|
+
});
|
71
|
+
});
|
72
|
+
|
73
|
+
describe('Saving a question', () => {
|
74
|
+
it('When user has filled all the mandatory fields then on clicking on Save Question button the question should get saved and a snackbar with text \'Saved successfully!\' should be displayed', () => {
|
75
|
+
essayResponsePage.steps.saveAQuestionAndVerifySnackbar();
|
76
|
+
});
|
77
|
+
essayResponsePage.tests.verifySavedSuccessfullySnackbarCSSanda11y();
|
78
|
+
});
|
79
|
+
});
|
80
|
+
});
|
@@ -0,0 +1,38 @@
|
|
1
|
+
import { essayResponsePage } from "../../../pages";
|
2
|
+
import abortEarlySetup from "../../../support/helpers/abortEarly";
|
3
|
+
|
4
|
+
describe('Essay Response: Math Characters popup', () => {
|
5
|
+
before(() => {
|
6
|
+
cy.loginAs('admin');
|
7
|
+
});
|
8
|
+
|
9
|
+
describe('Math Characters popup contents', () => {
|
10
|
+
abortEarlySetup();
|
11
|
+
before(() => {
|
12
|
+
cy.log('Navigate to Essay Response question type, selecting math characters from customize formatting options accordion and then switching to preview tab.');
|
13
|
+
essayResponsePage.steps.navigateToCreateQuestion('essay response - rich text');
|
14
|
+
cy.barsPreLoaderWait();
|
15
|
+
essayResponsePage.steps.expandCustomizeFormattingOptionsAccordion();
|
16
|
+
essayResponsePage.steps.selectCustomizedFormattingOption(['Math characters']);
|
17
|
+
essayResponsePage.steps.switchToPreviewTab();
|
18
|
+
});
|
19
|
+
|
20
|
+
essayResponsePage.tests.verifySpecialOrMathCharactersPopup('mathCharacters');
|
21
|
+
});
|
22
|
+
|
23
|
+
describe('Add math character symbols to the response field', () => {
|
24
|
+
abortEarlySetup();
|
25
|
+
before(() => {
|
26
|
+
cy.log('Navigate to Essay Response question type, selecting math characters from customize formatting options accordion, switching to preview tab and clicking on math characters toolbar option.');
|
27
|
+
essayResponsePage.steps.navigateToCreateQuestion('essay response - rich text');
|
28
|
+
cy.barsPreLoaderWait();
|
29
|
+
essayResponsePage.steps.expandCustomizeFormattingOptionsAccordion();
|
30
|
+
essayResponsePage.steps.selectCustomizedFormattingOption(['Math characters']);
|
31
|
+
essayResponsePage.steps.switchToPreviewTab();
|
32
|
+
essayResponsePage.previewTabToolbarOption('Math characters')
|
33
|
+
.click();
|
34
|
+
});
|
35
|
+
|
36
|
+
essayResponsePage.tests.addSpecialOrMathCharactersToResponseField('mathCharacters');
|
37
|
+
});
|
38
|
+
});
|
@@ -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
|
+
});
|