itemengine-cypress-automation 1.0.255 → 1.0.256-updatedRepo18thNov-3c7b396.0
Sign up to get free protection for your applications and to get access to all the features.
- package/cypress/e2e/ILC/CkEditorAudioPlayer/audioPlayerPreviewTab.js +21 -21
- package/cypress/e2e/ILC/CkEditorAudioPlayer/audioPlayerPreviewTabSupportedFileTypes.js +6 -6
- package/cypress/e2e/ILC/CkEditorAudioPlayer/audioPlayerPreviewTabTranscript.js +4 -4
- package/cypress/e2e/ILC/CkEditorEquationEditor/equationEditorBasicFile.js +86 -5
- package/cypress/e2e/ILC/CkEditorEquationEditor/selectModeEditorBasic.js +114 -0
- package/cypress/e2e/ILC/CkEditorInsertImage/imageInfo.js +160 -0
- package/cypress/e2e/ILC/CkEditorInsertImage/insertImageBasicFile.js +83 -0
- package/cypress/e2e/ILC/CkEditorInsertImage/upload.js +53 -0
- package/cypress/e2e/ILC/CkEditorLink/linkBasic.js +85 -0
- package/cypress/e2e/ILC/CkEditorLink/linkInfoSection.js +94 -0
- package/cypress/e2e/ILC/CkEditorLink/linkPreview.js +38 -0
- package/cypress/e2e/ILC/CkEditorLink/uploadSection.js +59 -0
- package/cypress/e2e/ILC/EssayResponse/equationEditor.smoke.js +14 -279
- package/cypress/e2e/ILC/EssayResponse/equationEditorCategories1.js +78 -0
- package/cypress/e2e/ILC/FillInTheGapsTextNew/additionalSettingsForAnswerInputFields.js +2 -2
- package/cypress/e2e/ILC/Graphing/acceptRepeatedPoints.js +75 -0
- package/cypress/e2e/ILC/TextEntryMath/additionalSettingsBasic.js +84 -0
- package/cypress/e2e/ILC/TextEntryMath/additionalSettingsForAnswerInputFields.js +286 -0
- package/cypress/e2e/ILC/TextEntryMath/customSettingsSeparators.ts +107 -0
- package/cypress/e2e/ILC/TextEntryMath/equationEditor.smoke.js +99 -0
- package/cypress/fixtures/equationEditorCategoriesAndSymbols .js +336 -0
- package/cypress/pages/components/ariaLabelSectionComponent.js +1 -1
- package/cypress/pages/components/ckEditorAudioPlayerComponent.js +0 -11
- package/cypress/pages/components/ckEditorEquationEditorComponent.js +175 -7
- package/cypress/pages/components/ckEditorInsertImageComponent.js +272 -0
- package/cypress/pages/components/ckEditorLinkComponent.js +142 -0
- package/cypress/pages/components/customSettingsSeparatorsComponent.ts +97 -0
- package/cypress/pages/components/equationEditorSectionCommonComponent.js +528 -0
- package/cypress/pages/components/gradingViewEnumerationComponent.js +11 -6
- package/cypress/pages/components/index.js +2 -1
- package/cypress/pages/components/questionInstructionsComponent.js +10 -0
- package/cypress/pages/essayResponsePage.js +4 -121
- package/cypress/pages/graphingPage.js +24 -2
- package/cypress/pages/multipleSelectionPage.js +8 -0
- package/cypress/pages/textEntryMathPage.js +125 -18
- package/cypress/support/index.d.ts +7 -0
- package/cypress/tsconfig.json +11 -0
- package/package.json +1 -1
@@ -0,0 +1,286 @@
|
|
1
|
+
import { textEntryMathPage } from "../../../pages";
|
2
|
+
import { equationEditorFlyout } from "../../../pages/components";
|
3
|
+
import abortEarlySetup from "../../../support/helpers/abortEarly";
|
4
|
+
import utilities from "../../../support/helpers/utilities";
|
5
|
+
const enumerationOptions = {
|
6
|
+
'Numerical': ['1', '2'],
|
7
|
+
'Alphabet (uppercase)': ['A', 'B'],
|
8
|
+
'Alphabet (lowercase)': ['a', 'b'],
|
9
|
+
'Roman numeral (uppercase)': ['I', 'II'],
|
10
|
+
'Roman numeral (lowercase)': ['i', 'ii'],
|
11
|
+
};
|
12
|
+
const css = Cypress.env('css');
|
13
|
+
|
14
|
+
describe('Text Entry Math - Additional settings : Grading view, ARIA label for text containers', () => {
|
15
|
+
before(() => {
|
16
|
+
cy.loginAs('admin');
|
17
|
+
});
|
18
|
+
|
19
|
+
describe('Additional Settings: Grading view - Contents in edit tab', () => {
|
20
|
+
abortEarlySetup();
|
21
|
+
before(() => {
|
22
|
+
textEntryMathPage.steps.navigateToCreateQuestion('Text Entry Math');
|
23
|
+
cy.barsPreLoaderWait();
|
24
|
+
textEntryMathPage.steps.expandAdditionalSettings();
|
25
|
+
});
|
26
|
+
|
27
|
+
textEntryMathPage.tests.verifyGradingViewEnumerationSectionContents('');
|
28
|
+
|
29
|
+
it('When the user selects "Without enumeration" radio button, the identifiers section should disappear', () => {
|
30
|
+
textEntryMathPage.steps.selectEnumerationType('without enumeration');
|
31
|
+
utilities.verifyElementVisibilityState(textEntryMathPage.identifiersLabel(), 'notExist');
|
32
|
+
utilities.verifyElementVisibilityState(textEntryMathPage.numericalToggleButton(), 'notExist');
|
33
|
+
});
|
34
|
+
|
35
|
+
it('When the user selects "With enumeration" radio button again, the identifiers section should appear again', () => {
|
36
|
+
textEntryMathPage.steps.selectEnumerationType('with enumeration');
|
37
|
+
utilities.verifyElementVisibilityState(textEntryMathPage.identifiersLabel(), 'notExist');
|
38
|
+
utilities.verifyElementVisibilityState(textEntryMathPage.numericalToggleButton(), 'visible');
|
39
|
+
})
|
40
|
+
});
|
41
|
+
|
42
|
+
describe('Additional settings: Grading view - functionality in preview tab', () => {
|
43
|
+
abortEarlySetup();
|
44
|
+
before(() => {
|
45
|
+
textEntryMathPage.steps.navigateToCreateQuestion('Text Entry Math');
|
46
|
+
cy.barsPreLoaderWait();
|
47
|
+
textEntryMathPage.steps.addResponseArea();
|
48
|
+
textEntryMathPage.steps.addResponseArea();
|
49
|
+
textEntryMathPage.steps.expandResponseAccordionSpecifyCorrectAnswer(0);
|
50
|
+
textEntryMathPage.steps.focusInResponseAnswerInputFieldSpecifyCorrectAnswerSection(0);
|
51
|
+
textEntryMathPage.steps.enterTextInPreviewInputField('9one');
|
52
|
+
equationEditorFlyout.steps.clickOnOkButton();
|
53
|
+
textEntryMathPage.steps.expandResponseAccordionSpecifyCorrectAnswer(1);
|
54
|
+
textEntryMathPage.steps.focusInResponseAnswerInputFieldSpecifyCorrectAnswerSection(1);
|
55
|
+
textEntryMathPage.steps.enterTextInPreviewInputField('5Two');
|
56
|
+
equationEditorFlyout.steps.clickOnOkButton();
|
57
|
+
textEntryMathPage.steps.expandAdditionalSettings();
|
58
|
+
});
|
59
|
+
|
60
|
+
Object.keys(enumerationOptions).forEach(option => {
|
61
|
+
it(`When "${option}" toggle button is selected in the text container identifiers section, then on switching to the preview tab text container numeration should not be displayed`, () => {
|
62
|
+
textEntryMathPage.steps.selectIdentifierToggleButton(option);
|
63
|
+
textEntryMathPage.steps.switchToPreviewTab();
|
64
|
+
textEntryMathPage.steps.verifyResponseAreaNumerationNotExists();
|
65
|
+
});
|
66
|
+
|
67
|
+
it(`When the user switches to the "Grading view", then the "${option}" numeration should be displayed in the answer input fields as well as correct answer options in the correct answer section`, () => {
|
68
|
+
textEntryMathPage.steps.switchToGradingView();
|
69
|
+
textEntryMathPage.steps.verifyAnswerInputFieldEnumeration(enumerationOptions[option]);
|
70
|
+
textEntryMathPage.steps.verifyCorrectAnswerResponsesEnumeration(enumerationOptions[option]);
|
71
|
+
cy.log('Post step: Switch to Edit tab')
|
72
|
+
textEntryMathPage.steps.switchToEditTab();
|
73
|
+
});
|
74
|
+
});
|
75
|
+
|
76
|
+
it('When the user selects "without enumeration" radio button, then in the "Grading view", numeration should not be displayed for answer input fields and in the correct answer section, the entire question preview should be displayed with correct answers', () => {
|
77
|
+
textEntryMathPage.steps.selectEnumerationType('without enumeration');
|
78
|
+
textEntryMathPage.steps.switchToPreviewTab();
|
79
|
+
textEntryMathPage.steps.switchToGradingView();
|
80
|
+
textEntryMathPage.steps.verifyResponseAreaNumerationNotExists();
|
81
|
+
utilities.verifyElementVisibilityState(textEntryMathPage.correctAnswersContainerResponseNumeration(), 'notExist');
|
82
|
+
textEntryMathPage.steps.switchToEditTab();
|
83
|
+
textEntryMathPage.steps.selectEnumerationType('with enumeration');
|
84
|
+
textEntryMathPage.steps.switchToPreviewTab();
|
85
|
+
textEntryMathPage.steps.switchToGradingView();
|
86
|
+
});
|
87
|
+
|
88
|
+
it('CSS of correct answer section', { tags: 'css' }, () => {
|
89
|
+
utilities.verifyCSS(textEntryMathPage.correctAnswersContainerResponseNumeration(), {
|
90
|
+
'color': css.color.text,
|
91
|
+
'font-size': css.fontSize.default,
|
92
|
+
'font-weight': css.fontWeight.regular,
|
93
|
+
'border': `1px solid ${css.color.activeComponentBorder}`,
|
94
|
+
});
|
95
|
+
});
|
96
|
+
|
97
|
+
//Remove skip once https://redmine.zeuslearning.com/issues/584938 is resolved
|
98
|
+
it.skip('Accessibility of correct answer section', { tags: 'a11y' }, () => {
|
99
|
+
cy.checkAccessibility(textEntryMathPage.correctAnswersContainerResponseNumeration().parents('.cloze-math-correct-answer-wrapper'));
|
100
|
+
});
|
101
|
+
});
|
102
|
+
|
103
|
+
describe('Additional settings: ARIA label for text containers - Contents in edit tab', () => {
|
104
|
+
abortEarlySetup();
|
105
|
+
before(() => {
|
106
|
+
textEntryMathPage.steps.navigateToCreateQuestion('Text Entry Math');
|
107
|
+
cy.barsPreLoaderWait();
|
108
|
+
textEntryMathPage.steps.expandAdditionalSettings();
|
109
|
+
});
|
110
|
+
|
111
|
+
it('By default the aria label text input fields should not be visible', () => {
|
112
|
+
utilities.verifyElementVisibilityState(textEntryMathPage.ariaLabelInputField(), 'notExist');
|
113
|
+
});
|
114
|
+
|
115
|
+
it('When the users adds text container, then the aria label text input fields should not be visible', () => {
|
116
|
+
textEntryMathPage.steps.addResponseArea();
|
117
|
+
textEntryMathPage.steps.addResponseArea();
|
118
|
+
utilities.verifyElementVisibilityState(textEntryMathPage.ariaLabelInputField(), 'visible');
|
119
|
+
});
|
120
|
+
|
121
|
+
textEntryMathPage.tests.verifyAriaLabelSectionContents('text containers');
|
122
|
+
|
123
|
+
it('When the users adds a new text container, the count of the aria label text input fields should update accordingly', () => {
|
124
|
+
textEntryMathPage.steps.addResponseArea();
|
125
|
+
utilities.verifyElementCount(textEntryMathPage.ariaLabelInputField(), 3);
|
126
|
+
textEntryMathPage.steps.verifyAriaLabelTextInputFields(2);
|
127
|
+
});
|
128
|
+
|
129
|
+
it('When the user deletes any text container, the count of the aria label texts input fields should update accordingly', () => {
|
130
|
+
textEntryMathPage.steps.deleteAResponseArea(1);
|
131
|
+
utilities.verifyElementCount(textEntryMathPage.ariaLabelInputField(), 2);
|
132
|
+
textEntryMathPage.steps.verifyAriaLabelTextInputFields(0);
|
133
|
+
textEntryMathPage.steps.verifyAriaLabelTextInputFields(1);
|
134
|
+
});
|
135
|
+
|
136
|
+
it('When the user sets aria label, then in the answer input fields of the specify correct answer section, the aria labels should not change', () => {
|
137
|
+
textEntryMathPage.steps.enterTextInAriaLabelInputField(0, 'Add answer for response 1');
|
138
|
+
textEntryMathPage.steps.verifyAnswerInputFieldAriaLabelSpecifyCorrectAnswerSection(0, 'Enter answer');
|
139
|
+
textEntryMathPage.steps.verifyAnswerInputFieldAriaLabelSpecifyCorrectAnswerSection(1, 'Enter answer');
|
140
|
+
});
|
141
|
+
});
|
142
|
+
|
143
|
+
describe('Additional settings: ARIA label for text containers - functionality in preview tab', () => {
|
144
|
+
abortEarlySetup();
|
145
|
+
before(() => {
|
146
|
+
textEntryMathPage.steps.navigateToCreateQuestion('Text Entry Math');
|
147
|
+
cy.barsPreLoaderWait();
|
148
|
+
textEntryMathPage.steps.addResponseArea();
|
149
|
+
textEntryMathPage.steps.addResponseArea();
|
150
|
+
textEntryMathPage.steps.expandAdditionalSettings();
|
151
|
+
textEntryMathPage.steps.switchToPreviewTab();
|
152
|
+
});
|
153
|
+
|
154
|
+
it('When the user has not set \'ARIA label\' input field, then default aria labels should be present for the answer input fields in the preview tab', () => {
|
155
|
+
textEntryMathPage.steps.verifyAnswerInputFieldAriaLabelPreviewTab(0, 'Add answer for response 1');
|
156
|
+
textEntryMathPage.steps.verifyAnswerInputFieldAriaLabelPreviewTab(1, 'Add answer for response 2');
|
157
|
+
});
|
158
|
+
|
159
|
+
it('When the user has set \'ARIA label\', then it should be present for the answer input fields in the preview tab', () => {
|
160
|
+
textEntryMathPage.steps.switchToEditTab();
|
161
|
+
textEntryMathPage.steps.enterTextInAriaLabelInputField(0, 'Correct response 1');
|
162
|
+
textEntryMathPage.steps.switchToPreviewTab();
|
163
|
+
textEntryMathPage.steps.verifyAnswerInputFieldAriaLabelPreviewTab(0, 'Correct response 1');
|
164
|
+
textEntryMathPage.steps.verifyAnswerInputFieldAriaLabelPreviewTab(1, 'Add answer for response 2');
|
165
|
+
});
|
166
|
+
|
167
|
+
//Remove skip once https://redmine.zeuslearning.com/issues/584938 is resolved
|
168
|
+
it.skip('Accessibility of input field in preview tab when custom \'ARIA label\' is set', () => {
|
169
|
+
cy.checkAccessibility(textEntryMathPage.answerInputFieldPreviewTab().parents('.edit-question-preview-wrapper'));
|
170
|
+
});
|
171
|
+
|
172
|
+
it('When the user clears the set value in the \'ARIA label\' input field, then the default aria labels should be present for the answer input fields in the preview tab', () => {
|
173
|
+
textEntryMathPage.steps.switchToEditTab();
|
174
|
+
textEntryMathPage.steps.clearTextInAriaLabelInputField(0);
|
175
|
+
textEntryMathPage.steps.switchToPreviewTab();
|
176
|
+
textEntryMathPage.steps.verifyAnswerInputFieldAriaLabelPreviewTab(0, 'Add answer for response 1');
|
177
|
+
textEntryMathPage.steps.verifyAnswerInputFieldAriaLabelPreviewTab(1, 'Add answer for response 2');
|
178
|
+
});
|
179
|
+
});
|
180
|
+
|
181
|
+
describe('Visibility Type content', () => {
|
182
|
+
abortEarlySetup();
|
183
|
+
before(() => {
|
184
|
+
textEntryMathPage.steps.navigateToCreateQuestion('Text Entry Math');
|
185
|
+
cy.barsPreLoaderWait();
|
186
|
+
textEntryMathPage.steps.addResponseArea();
|
187
|
+
textEntryMathPage.steps.expandAdditionalSettings();
|
188
|
+
});
|
189
|
+
|
190
|
+
it('\'Visibility Type\'label should be visible', () => {
|
191
|
+
utilities.verifyElementVisibilityState(textEntryMathPage.visibilityTypeLabel(), 'visible');
|
192
|
+
utilities.verifyInnerText(textEntryMathPage.visibilityTypeLabel(), 'Visibility Type');
|
193
|
+
});
|
194
|
+
|
195
|
+
it('Two buttons \'Inline\' and \'Modal\' should be visible and by default \'Inline\' button should be selected ', () => {
|
196
|
+
utilities.verifyElementVisibilityState(textEntryMathPage.inlineToggleButton(), 'visible');
|
197
|
+
utilities.verifyElementVisibilityState(textEntryMathPage.modalToggleButton(), 'visible');
|
198
|
+
utilities.verifyInnerText(textEntryMathPage.inlineToggleButton(), 'Inline');
|
199
|
+
utilities.verifyInnerText(textEntryMathPage.modalToggleButton(), 'Modal');
|
200
|
+
textEntryMathPage.steps.verifyByDefaultInlineToggleButtonIsSelected();
|
201
|
+
textEntryMathPage.steps.switchToPreviewTab();
|
202
|
+
});
|
203
|
+
|
204
|
+
it('When \'Inline\' button is selected,then drag handle,cancel Button and input button should not be visible in previewTab', () => {
|
205
|
+
textEntryMathPage.steps.focusInResponseAnswerInputFieldPreviewTab(0);
|
206
|
+
utilities.verifyElementVisibilityState(textEntryMathPage.dragHandleIcon(), 'notExist');
|
207
|
+
utilities.verifyElementVisibilityState(textEntryMathPage.cancelButton(), 'notExist');
|
208
|
+
utilities.verifyElementVisibilityState(textEntryMathPage.equationEditorInputField(), 'notExist');
|
209
|
+
});
|
210
|
+
|
211
|
+
it('When the user click on the \'Modal\' button is selected,then drag handle,cancel Button and input button should be visible in previewTab', () => {
|
212
|
+
textEntryMathPage.steps.switchToEditTab();
|
213
|
+
textEntryMathPage.steps.clickOnModalButton();
|
214
|
+
textEntryMathPage.steps.switchToPreviewTab();
|
215
|
+
textEntryMathPage.steps.focusInResponseAnswerInputFieldPreviewTab(0);
|
216
|
+
utilities.verifyElementVisibilityState(textEntryMathPage.dragHandleIcon(), 'visible');
|
217
|
+
utilities.verifyElementVisibilityState(textEntryMathPage.cancelButton(), 'visible');
|
218
|
+
utilities.verifyElementVisibilityState(textEntryMathPage.equationEditorInputField(), 'visible');
|
219
|
+
});
|
220
|
+
});
|
221
|
+
|
222
|
+
describe('Additional settings: Text to not be rendered as LaTex', () => {
|
223
|
+
abortEarlySetup();
|
224
|
+
before(() => {
|
225
|
+
textEntryMathPage.steps.navigateToCreateQuestion('Text Entry Math');
|
226
|
+
cy.barsPreLoaderWait();
|
227
|
+
textEntryMathPage.steps.addResponseArea();
|
228
|
+
textEntryMathPage.steps.addResponseArea();
|
229
|
+
textEntryMathPage.steps.expandResponseAccordionSpecifyCorrectAnswer(0);
|
230
|
+
textEntryMathPage.steps.focusInResponseAnswerInputFieldSpecifyCorrectAnswerSection(0);
|
231
|
+
textEntryMathPage.steps.enterTextInPreviewInputField('10');
|
232
|
+
equationEditorFlyout.steps.clickOnOkButton();
|
233
|
+
textEntryMathPage.steps.expandResponseAccordionSpecifyCorrectAnswer(1);
|
234
|
+
textEntryMathPage.steps.focusInResponseAnswerInputFieldSpecifyCorrectAnswerSection(1);
|
235
|
+
textEntryMathPage.steps.enterTextInPreviewInputField('20');
|
236
|
+
equationEditorFlyout.steps.clickOnOkButton();
|
237
|
+
textEntryMathPage.steps.expandAdditionalSettings();
|
238
|
+
});
|
239
|
+
|
240
|
+
it('\'Text to not be rendered as LaTex\' label and helper text should be visible', () => {
|
241
|
+
utilities.verifyElementVisibilityState(textEntryMathPage.textToNotBeRenderAsLaTexLabel(), 'visible');
|
242
|
+
utilities.verifyTextContent(textEntryMathPage.textToNotBeRenderAsLaTexLabel(), 'Text to not be rendered as LaTex');
|
243
|
+
utilities.verifyElementVisibilityState(textEntryMathPage.helperTextLabel(), 'visible');
|
244
|
+
utilities.verifyTextContent(textEntryMathPage.helperTextLabel(), 'Optionally provide acceptable units to avoid penalizing students for including/excluding');
|
245
|
+
});
|
246
|
+
|
247
|
+
it('Text to not be rendered as LaTex input field should be visible and default input field text value is empty ', () => {
|
248
|
+
utilities.verifyElementVisibilityState(textEntryMathPage.latexInputField(), 'visible');
|
249
|
+
utilities.verifyElementVisibilityState(textEntryMathPage.latexInputFieldText(), 'notExist');
|
250
|
+
});
|
251
|
+
|
252
|
+
it('When the user insert value inside the latex input field,then the latex input field text should be visible ', () => {
|
253
|
+
textEntryMathPage.steps.insertLatexInputFieldValue('cm');
|
254
|
+
utilities.verifyTextContent(utilities.getNthElement(textEntryMathPage.latexInputFieldText(), 0), 'cm');
|
255
|
+
textEntryMathPage.steps.insertLatexInputFieldValue('centimeters');
|
256
|
+
utilities.verifyTextContent(utilities.getNthElement(textEntryMathPage.latexInputFieldText(), 1), 'centimeters');
|
257
|
+
});
|
258
|
+
|
259
|
+
//Remove skip and re visit this once https://redmine.zeuslearning.com/issues/584973 is resolved
|
260
|
+
it.skip('When the user set an answer and attempt the question and add unit from the latex input field list,then in grading view correct icons should be visible beside the correct answer', () => {
|
261
|
+
textEntryMathPage.steps.focusInResponseAnswerInputFieldPreviewTab(0);
|
262
|
+
equationEditorFlyout.steps.enterTextInPreviewInputField('10cm');
|
263
|
+
equationEditorFlyout.steps.clickOnOkButton();
|
264
|
+
textEntryMathPage.steps.focusInResponseAnswerInputFieldPreviewTab(0);
|
265
|
+
equationEditorFlyout.steps.enterTextInPreviewInputField('20centimeters');
|
266
|
+
equationEditorFlyout.steps.clickOnOkButton();
|
267
|
+
textEntryMathPage.steps.switchToGradingView();
|
268
|
+
textEntryMathPage.steps.verifyCorrectResponseIcon(0);
|
269
|
+
textEntryMathPage.steps.verifyCorrectResponseIcon(1);
|
270
|
+
});
|
271
|
+
|
272
|
+
//Remove skip and re visit this once https://redmine.zeuslearning.com/issues/584973 is resolved
|
273
|
+
it.skip('When the user set an answer and attempt the question and add some unit which is not in the latex input field,then in grading view incorrect icons should be visible beside the correct answer', () => {
|
274
|
+
textEntryMathPage.steps.resetQuestionPreview();
|
275
|
+
textEntryMathPage.steps.focusInResponseAnswerInputFieldPreviewTab(0);
|
276
|
+
equationEditorFlyout.steps.enterTextInPreviewInputField('10cm');
|
277
|
+
equationEditorFlyout.steps.clickOnOkButton();
|
278
|
+
textEntryMathPage.steps.focusInResponseAnswerInputFieldPreviewTab(0);
|
279
|
+
equationEditorFlyout.steps.enterTextInPreviewInputField('20centimeters');
|
280
|
+
equationEditorFlyout.steps.clickOnOkButton();
|
281
|
+
textEntryMathPage.steps.switchToGradingView();
|
282
|
+
textEntryMathPage.steps.verifyIncorrectResponseIcon(0);
|
283
|
+
textEntryMathPage.steps.verifyIncorrectResponseIcon(1);
|
284
|
+
});
|
285
|
+
});
|
286
|
+
});
|
@@ -0,0 +1,107 @@
|
|
1
|
+
import { textEntryMathPage } from "../../../pages";
|
2
|
+
|
3
|
+
const evaluationMethods = [
|
4
|
+
{
|
5
|
+
method: 'Symbols are equivalent',
|
6
|
+
decimalSeparator: ['Dot', 'Comma'],
|
7
|
+
thousandsSeparator: ['None', 'Comma or space', 'Comma', 'Space'],
|
8
|
+
additionalOptions: ['Decimal places to be compared']
|
9
|
+
},
|
10
|
+
{
|
11
|
+
method: 'Value is equivalent',
|
12
|
+
decimalSeparator: ['Dot', 'Comma'],
|
13
|
+
thousandsSeparator: ['None', 'Comma or space', 'Comma', 'Space'],
|
14
|
+
additionalOptions: ['Decimal places to be compared', 'Tolerance']
|
15
|
+
},
|
16
|
+
{
|
17
|
+
method: 'Match value',
|
18
|
+
decimalSeparator: ['Dot', 'Comma'],
|
19
|
+
thousandsSeparator: ['None', 'Comma or space', 'Comma', 'Space'],
|
20
|
+
additionalOptions: []
|
21
|
+
},
|
22
|
+
{
|
23
|
+
method: 'Equivalent structure',
|
24
|
+
decimalSeparator: [],
|
25
|
+
thousandsSeparator: [],
|
26
|
+
additionalOptions: []
|
27
|
+
},
|
28
|
+
{
|
29
|
+
method: 'Response is true',
|
30
|
+
decimalSeparator: ['Dot', 'Comma'],
|
31
|
+
thousandsSeparator: ['None', 'Comma or space', 'Comma', 'Space'],
|
32
|
+
additionalOptions: ['Decimal places to be compared']
|
33
|
+
},
|
34
|
+
{
|
35
|
+
method: 'Expanded form',
|
36
|
+
decimalSeparator: ['Dot', 'Comma'],
|
37
|
+
thousandsSeparator: ['None', 'Comma or space', 'Comma', 'Space'],
|
38
|
+
additionalOptions: []
|
39
|
+
},
|
40
|
+
{
|
41
|
+
method: 'Simplified version',
|
42
|
+
decimalSeparator: ['Dot', 'Comma'],
|
43
|
+
thousandsSeparator: ['None', 'Comma or space', 'Comma', 'Space'],
|
44
|
+
additionalOptions: []
|
45
|
+
},
|
46
|
+
{
|
47
|
+
method: 'Match exact',
|
48
|
+
decimalSeparator: [],
|
49
|
+
thousandsSeparator: [],
|
50
|
+
additionalOptions: []
|
51
|
+
}
|
52
|
+
];
|
53
|
+
|
54
|
+
describe('Custom Settings Separators for Text Entry Math', () => {
|
55
|
+
before(() => {
|
56
|
+
cy.loginAs('admin');
|
57
|
+
});
|
58
|
+
|
59
|
+
describe('Edit tab contents', () => {
|
60
|
+
before(() => {
|
61
|
+
textEntryMathPage.steps.navigateToCreateQuestion('Text Entry Math');
|
62
|
+
cy.barsPreLoaderWait();
|
63
|
+
textEntryMathPage.steps.addResponseArea();
|
64
|
+
textEntryMathPage.steps.expandResponseAccordionSpecifyCorrectAnswer(0);
|
65
|
+
textEntryMathPage.steps.clickOnCustomSettingsAccordion();
|
66
|
+
});
|
67
|
+
|
68
|
+
evaluationMethods.forEach(({ method, decimalSeparator, thousandsSeparator, additionalOptions }) => {
|
69
|
+
it(`When user selects ${method} then correct separator options should be displayed`, () => {
|
70
|
+
textEntryMathPage.steps.selectEvaluationMethod(method);
|
71
|
+
if (decimalSeparator.length > 0) {
|
72
|
+
textEntryMathPage.steps.verifyLabelDecimalSeparatorLabel('Decimal separator');
|
73
|
+
decimalSeparator.forEach(option => {
|
74
|
+
textEntryMathPage.steps.verifyDecimalSeparatorOptions(option);
|
75
|
+
});
|
76
|
+
} else {
|
77
|
+
textEntryMathPage.steps.verifyDecimalAndThousandSeparatorDoesNotExist();
|
78
|
+
}
|
79
|
+
if (thousandsSeparator.length > 0) {
|
80
|
+
textEntryMathPage.steps.verifyLabelThousandSeparatorLabel('Thousands separator');
|
81
|
+
thousandsSeparator.forEach(option => {
|
82
|
+
textEntryMathPage.steps.verifyThousandSeparatorOptions(option);
|
83
|
+
});
|
84
|
+
} else {
|
85
|
+
textEntryMathPage.steps.verifyDecimalAndThousandSeparatorDoesNotExist();
|
86
|
+
}
|
87
|
+
additionalOptions.forEach(option => {
|
88
|
+
if (option === 'Decimal places to be compared') {
|
89
|
+
textEntryMathPage.steps.verifyVisibilityOfDecimalPlacesToBeComparedSection();
|
90
|
+
} else if (option === 'Tolerance') {
|
91
|
+
textEntryMathPage.steps.verifyVisibilityOfToleranceSection();
|
92
|
+
}
|
93
|
+
});
|
94
|
+
});
|
95
|
+
|
96
|
+
if (decimalSeparator.length > 0) {
|
97
|
+
it('When user selects comma option from decimal separator then thousand separator options should change to \'None\', \'Dot or space\', \'Dot\' and \'Space\'', () => {
|
98
|
+
textEntryMathPage.steps.selectDecimalSeparatorOption('Comma');
|
99
|
+
textEntryMathPage.steps.verifyLabelThousandSeparatorLabel('Thousands separator');
|
100
|
+
['None', 'Dot or space', 'Dot', 'Space'].forEach(option => {
|
101
|
+
textEntryMathPage.steps.verifyThousandSeparatorOptions(option)
|
102
|
+
});
|
103
|
+
});
|
104
|
+
}
|
105
|
+
});
|
106
|
+
});
|
107
|
+
});
|
@@ -0,0 +1,99 @@
|
|
1
|
+
import { equationEditorCategoriesAndSymbols } from "../../../fixtures/equationEditorCategoriesAndSymbols ";
|
2
|
+
import { equationEditorFlyout } from "../../../pages/components/equationEditorFlyout";
|
3
|
+
import { textEntryMathPage } from "../../../pages/textEntryMathPage";
|
4
|
+
import { createCustomCategoryFlyout } from "../../../pages/components/createCustomCategoryFlyout";
|
5
|
+
import abortEarlySetup from "../../../support/helpers/abortEarly";
|
6
|
+
import utilities from "../../../support/helpers/utilities";
|
7
|
+
const grepTags = Cypress.env('grepTags');
|
8
|
+
|
9
|
+
describe('Create question page - Text Entry Math: Equation Editor functionality', () => {
|
10
|
+
before(() => {
|
11
|
+
cy.loginAs('admin');
|
12
|
+
});
|
13
|
+
|
14
|
+
describe('Preview tab \'Equation Editor\' flyout', { tags: 'smoke' }, () => {
|
15
|
+
abortEarlySetup();
|
16
|
+
before(() => {
|
17
|
+
textEntryMathPage.steps.navigateToCreateQuestion('Text Entry Math');
|
18
|
+
cy.barsPreLoaderWait();
|
19
|
+
textEntryMathPage.steps.addResponseArea();
|
20
|
+
textEntryMathPage.steps.expandAdditionalSettings();
|
21
|
+
textEntryMathPage.steps.clickOnModalButton();
|
22
|
+
textEntryMathPage.steps.switchToPreviewTab();
|
23
|
+
textEntryMathPage.steps.focusInResponseAnswerInputFieldPreviewTab(0);
|
24
|
+
});
|
25
|
+
|
26
|
+
textEntryMathPage.tests.equationEditorFlyoutInPreviewTab()
|
27
|
+
});
|
28
|
+
|
29
|
+
if (!grepTags || !grepTags.includes('smoke')) {
|
30
|
+
describe('Equation Editor: Next and Previous button', () => {
|
31
|
+
abortEarlySetup();
|
32
|
+
before(() => {
|
33
|
+
textEntryMathPage.steps.navigateToCreateQuestion('Text Entry Math');
|
34
|
+
cy.barsPreLoaderWait();
|
35
|
+
textEntryMathPage.steps.addResponseArea();
|
36
|
+
textEntryMathPage.steps.expandAdditionalSettings();
|
37
|
+
textEntryMathPage.steps.clickOnModalButton();
|
38
|
+
textEntryMathPage.steps.deselectCategoryInEquationEditorSectionEditTab(equationEditorCategoriesAndSymbols['algebra'].displayName);
|
39
|
+
textEntryMathPage.steps.deselectCategoryInEquationEditorSectionEditTab(equationEditorCategoriesAndSymbols['geo'].displayName);
|
40
|
+
textEntryMathPage.steps.deselectCategoryInEquationEditorSectionEditTab(equationEditorCategoriesAndSymbols['compare'].displayName);
|
41
|
+
textEntryMathPage.steps.deselectCategoryInEquationEditorSectionEditTab(equationEditorCategoriesAndSymbols['matrices'].displayName);
|
42
|
+
textEntryMathPage.steps.deselectCategoryInEquationEditorSectionEditTab(equationEditorCategoriesAndSymbols['keyPad'].displayName);
|
43
|
+
textEntryMathPage.steps.switchToPreviewTab();
|
44
|
+
});
|
45
|
+
|
46
|
+
textEntryMathPage.tests.verifyNextAndPreviewButtonInPreviewTab()
|
47
|
+
});
|
48
|
+
}
|
49
|
+
|
50
|
+
if (!grepTags || !grepTags.includes('smoke')) {
|
51
|
+
describe('Edit tab Equation Editor section', () => {
|
52
|
+
abortEarlySetup();
|
53
|
+
before(() => {
|
54
|
+
textEntryMathPage.steps.navigateToCreateQuestion('Text Entry Math');
|
55
|
+
cy.barsPreLoaderWait();
|
56
|
+
textEntryMathPage.steps.addResponseArea();
|
57
|
+
textEntryMathPage.steps.expandAdditionalSettings();
|
58
|
+
textEntryMathPage.steps.clickOnModalButton();
|
59
|
+
});
|
60
|
+
|
61
|
+
it('The \'Equation Editor\' label text \'Display equation editor instead of native keyboard on touch devices.\' label and checkbox ,\'Categories\' label and \'Create custom category\' button should be displayed', () => {
|
62
|
+
utilities.verifyElementVisibilityState(textEntryMathPage.equationEditorSectionTitle(), 'visible');
|
63
|
+
utilities.verifyInnerText(textEntryMathPage.equationEditorSectionTitle(), 'Equation editor');
|
64
|
+
utilities.verifyElementVisibilityState(textEntryMathPage.displayNativeKeyboardLabel(), 'visible');
|
65
|
+
utilities.verifyInnerText(textEntryMathPage.displayNativeKeyboardLabel(), 'Display equation editor instead of native keyboard on touch devices');
|
66
|
+
utilities.verifyElementVisibilityState(textEntryMathPage.displayNativeKeyboardCheckbox(), 'exist');
|
67
|
+
utilities.verifyElementVisibilityState(textEntryMathPage.equationEditorSectionCategoryLabel(), 'visible');
|
68
|
+
utilities.verifyInnerText(textEntryMathPage.categoryLabel(), 'Categories');
|
69
|
+
utilities.verifyElementVisibilityState(createCustomCategoryFlyout.createCustomCategoryButton(), 'visible');
|
70
|
+
utilities.verifyInnerText(createCustomCategoryFlyout.createCustomCategoryButton(), 'Create custom category');
|
71
|
+
});
|
72
|
+
|
73
|
+
textEntryMathPage.tests.verifyEquationEditorSection();
|
74
|
+
|
75
|
+
textEntryMathPage.tests.verifyFunctionalityOfEquationEditorSection();
|
76
|
+
});
|
77
|
+
}
|
78
|
+
|
79
|
+
if (!grepTags || !grepTags.includes('smoke')) {
|
80
|
+
describe('Edit equation', () => {
|
81
|
+
abortEarlySetup();
|
82
|
+
before(() => {
|
83
|
+
textEntryMathPage.steps.navigateToCreateQuestion('Text Entry Math');
|
84
|
+
cy.barsPreLoaderWait();
|
85
|
+
textEntryMathPage.steps.addResponseArea();
|
86
|
+
textEntryMathPage.steps.expandAdditionalSettings();
|
87
|
+
textEntryMathPage.steps.clickOnModalButton();
|
88
|
+
textEntryMathPage.steps.switchToPreviewTab();
|
89
|
+
textEntryMathPage.steps.focusInResponseAnswerInputFieldPreviewTab(0);
|
90
|
+
cy.log('Adding an equation to preview input field')
|
91
|
+
equationEditorFlyout.steps.enterEquation([{ categoryName: 'intermediate', symbolName: ['x'] }, { categoryName: 'numPad', symbolName: ['add', 'five', 'equalTo', 'one'] }]);
|
92
|
+
equationEditorFlyout.steps.clickOnOkButton();
|
93
|
+
textEntryMathPage.steps.verifyResponseFieldEquationTextNew(0, 'x+5=1');
|
94
|
+
});
|
95
|
+
|
96
|
+
textEntryMathPage.tests.editEquationInPreviewTab('text entry math');
|
97
|
+
});
|
98
|
+
}
|
99
|
+
});
|