itemengine-cypress-automation 1.0.86 → 1.0.88
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cypress/e2e/ILC/DrawingResponse/drawingResponseCustomizeAdditionalOptions.js +30 -30
- package/cypress/e2e/ILC/DrawingResponse/drawingResponseGradingViewAndCorrectAnswerViewContents.smoke.js +1 -1
- package/cypress/e2e/ILC/EssayResponse/createCustomCategory.smoke.js +568 -0
- package/cypress/e2e/ILC/EssayResponse/editAndPreviewTabScoringSection.js +86 -0
- package/cypress/e2e/ILC/EssayResponse/editTabBasicSections.js +389 -0
- package/cypress/e2e/ILC/EssayResponse/gradingViewAndCorrectAnswerViewContents.smoke.js +112 -0
- package/cypress/e2e/ILC/EssayResponse/headerSection.js +68 -0
- package/cypress/e2e/ILC/EssayResponse/previewAddTable.js +290 -0
- package/cypress/e2e/ILC/EssayResponse/previewContentsForAllViews.smoke.js +79 -0
- package/cypress/e2e/ILC/EssayResponse/previewEditTable.js +379 -0
- package/cypress/e2e/ILC/EssayResponseBasic/essayResponseBasicCustomizeFormattingOptions.js +207 -0
- package/cypress/e2e/ILC/EssayResponseBasic/gradingViewAndCorrectAnswerViewContents.smoke.js +115 -0
- package/cypress/e2e/ILC/EssayResponseBasic/previewContentsForAllViews.smoke.js +79 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/FillInTheGapsOverImageDragAndDropScoring/partialDifferentWeightsBasic.js +159 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/backgroundImageAndCanvasProperties.js +507 -29
- package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/previewContentsForAllViews.smoke.js +6 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/responseAnswersAndAcceptedStudentInput.js +272 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/specialCharactersSection.js +300 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/specifyCorrectAnswerSection.js +3 -3
- package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/studentViewSettings.js +204 -0
- package/cypress/e2e/ILC/Protractor/protractorEditTabBasicsSection.js +4 -4
- package/cypress/e2e/ILC/Protractor/protractorEditTabFunctionality.js +1 -1
- package/cypress/e2e/ILC/Ruler/rulerEditTabBasicsSection.js +4 -4
- package/cypress/e2e/ILC/Ruler/rulerEditTabFunctionality.js +1 -1
- package/cypress/e2e/ILC/SingleSelection/editTabScoringSection.js +1 -3
- package/cypress/e2e/ILC/TextEntryMath/editTabBasicSection.js +205 -0
- package/cypress/e2e/ILC/TextEntryMath/editTabScoringSection.js +259 -0
- package/cypress/e2e/ILC/TextEntryMath/minimumScoringPenaltyPointsAndRoundingDropdown.js +202 -0
- package/cypress/e2e/ILC/TextEntryMath/responseEvaluationMethodsAndCustomSettings.js +613 -0
- package/cypress/e2e/ILC/TextEntryMath/specifyCorrectAnswerSection.js +71 -0
- package/cypress/fixtures/equationEditorCategoriesAndSymbols .js +318 -318
- package/cypress/fixtures/theme/ilc.json +3 -0
- package/cypress/pages/components/backgroundImageUploadComponent.js +1 -2
- package/cypress/pages/components/colorPopupComponent.js +26 -3
- package/cypress/pages/components/createCustomCategoryFlyout.js +351 -46
- package/cypress/pages/components/customizeSpecialCharacterComponent.js +165 -0
- package/cypress/pages/components/equationEditorFlyout.js +124 -0
- package/cypress/pages/components/essayResponseCommonComponents.js +3 -0
- package/cypress/pages/components/figOverImageCanvasComponent.js +316 -7
- package/cypress/pages/components/index.js +3 -1
- package/cypress/pages/components/opacityComponent.js +31 -4
- package/cypress/pages/components/specialAndCustomSpecialCharactersComponent.js +1 -0
- package/cypress/pages/components/specialCharactersFlyoutComponent.js +1 -0
- package/cypress/pages/drawingResponsePage.js +33 -138
- package/cypress/pages/essayResponsePage.js +612 -26
- package/cypress/pages/fillInTheGapsOverImageDragAndDropPage.js +48 -7
- package/cypress/pages/fillInTheGapsOverImageTextPage.js +267 -13
- package/package.json +1 -1
@@ -0,0 +1,613 @@
|
|
1
|
+
import { textEntryMathPage } from "../../../pages";
|
2
|
+
import { customSettingsIds, evaluationMethods, syntaxDropdown, thousandsSeparatorForCommaDecimalSeparator, thousandsSeparatorForDotDecimalSeparator, typeOfExpression } from "../../../fixtures/evaluationMethodsAndCustomSettings";
|
3
|
+
import utilities from "../../../support/helpers/utilities";
|
4
|
+
import abortEarlySetup from "../../../support/helpers/abortEarly";
|
5
|
+
import { commonComponents } from "../../../pages/components";
|
6
|
+
const css = Cypress.env('css');
|
7
|
+
|
8
|
+
describe('Create Item page - Text entry math: Response evaluation methods and custom settings', () => {
|
9
|
+
before(() => {
|
10
|
+
cy.loginAs('admin');
|
11
|
+
});
|
12
|
+
|
13
|
+
describe('Evaluation method blocks - Contents', () => {
|
14
|
+
abortEarlySetup();
|
15
|
+
before(() => {
|
16
|
+
textEntryMathPage.steps.navigateToCreateQuestion('Text Entry Math');
|
17
|
+
cy.barsPreLoaderWait();
|
18
|
+
textEntryMathPage.steps.deleteAResponseToken(1);
|
19
|
+
textEntryMathPage.steps.expandResponseAccordionSpecifyCorrectAnswer(0);
|
20
|
+
});
|
21
|
+
|
22
|
+
textEntryMathPage.tests.verifyEvaluationTabEvaluationMethodContainers();
|
23
|
+
|
24
|
+
it('CSS of evaluation method blocks', { tags: 'css' }, () => {
|
25
|
+
utilities.verifyCSS(utilities.getNthElement(textEntryMathPage.evaluationContainerTitle(), 0), {
|
26
|
+
'color': css.color.unSelectedEvaluationMethodTitle,
|
27
|
+
'font-size': css.fontSize.normal,
|
28
|
+
'font-weight': css.fontWeight.semibold
|
29
|
+
});
|
30
|
+
utilities.verifyCSS(utilities.getNthElement(textEntryMathPage.evaluationContainerContent(), 0), {
|
31
|
+
'color': css.color.text,
|
32
|
+
'font-size': css.fontSize.small,
|
33
|
+
'font-weight': css.fontWeight.regular
|
34
|
+
});
|
35
|
+
utilities.verifyCSS(utilities.getNthElement(textEntryMathPage.evaluationContainer(), 0), {
|
36
|
+
'background-color': css.color.defaultBackground,
|
37
|
+
'border': `1px solid ${css.color.evaluationMethodContainerBorder}`
|
38
|
+
});
|
39
|
+
utilities.verifyCSS(utilities.getNthElement(textEntryMathPage.evaluationContainerTitle(), 3), {
|
40
|
+
'color': css.color.whiteText,
|
41
|
+
'font-size': css.fontSize.normal,
|
42
|
+
'font-weight': css.fontWeight.semibold
|
43
|
+
});
|
44
|
+
utilities.verifyCSS(utilities.getNthElement(textEntryMathPage.evaluationContainerContent(), 3), {
|
45
|
+
'color': css.color.whiteText,
|
46
|
+
'font-size': css.fontSize.small,
|
47
|
+
'font-weight': css.fontWeight.regular
|
48
|
+
});
|
49
|
+
utilities.verifyCSS(utilities.getNthElement(textEntryMathPage.evaluationContainer(), 3), {
|
50
|
+
'background-color': css.color.selectedEvaluationMethodContainerBg,
|
51
|
+
'border': `1px solid ${css.color.evaluationMethodContainerBorder}`
|
52
|
+
});
|
53
|
+
});
|
54
|
+
});
|
55
|
+
|
56
|
+
describe('Evaluation method blocks - Add and delete evaluation method tabs', () => {
|
57
|
+
abortEarlySetup();
|
58
|
+
before(() => {
|
59
|
+
textEntryMathPage.steps.navigateToCreateQuestion('Text Entry Math');
|
60
|
+
cy.barsPreLoaderWait();
|
61
|
+
textEntryMathPage.steps.deleteAResponseToken(1);
|
62
|
+
textEntryMathPage.steps.expandResponseAccordionSpecifyCorrectAnswer(0);
|
63
|
+
});
|
64
|
+
|
65
|
+
it('In response 1 accordion, only one evaluation tab i.e. \'Evaluation 1\' should be in active state and should be displayed without a close button', () => {
|
66
|
+
utilities.verifyInnerText(textEntryMathPage.evaluationTab(), 'Evaluation 1');
|
67
|
+
utilities.verifyElementVisibilityState(textEntryMathPage.evaluationTab(), 'visible');
|
68
|
+
utilities.verifyElementCount(textEntryMathPage.evaluationTab(), 1);
|
69
|
+
textEntryMathPage.steps.verifyEvaluationTabActiveState(0);
|
70
|
+
});
|
71
|
+
|
72
|
+
it('Add evaluation button should be displayed in the response accordion in specify correct answer section', () => {
|
73
|
+
utilities.verifyElementVisibilityState(textEntryMathPage.addEvaluationButton(), 'visible');
|
74
|
+
utilities.verifyInnerText(textEntryMathPage.addEvaluationButton(), 'Add evaluation');
|
75
|
+
});
|
76
|
+
|
77
|
+
it('When user clicks on \'Add evaluation\' button, then a tab \'Evaluation 2\' should be added in the response accordion', () => {
|
78
|
+
textEntryMathPage.steps.clickOnAddEvaluationButton();
|
79
|
+
utilities.verifyInnerText(utilities.getNthElement(textEntryMathPage.evaluationTab(), 1), 'Evaluation 2');
|
80
|
+
utilities.verifyElementCount(textEntryMathPage.evaluationTab(), 2);
|
81
|
+
utilities.verifyElementVisibilityState(utilities.getNthElement(textEntryMathPage.evaluationTab(), 1), 'visible');
|
82
|
+
});
|
83
|
+
|
84
|
+
it('When user has added a new evaluation tab \'Evaluation 2\', then the newly added evaluation tab should be displayed in active state with a close button and Evaluation 1 tab should be in inactive state', () => {
|
85
|
+
textEntryMathPage.steps.verifyEvaluationTabActiveState(1);
|
86
|
+
textEntryMathPage.steps.verifyEvaluationTabInactiveState(0);
|
87
|
+
textEntryMathPage.steps.verifyCloseButtonIsDisplayedInEvaluationTab(1);
|
88
|
+
});
|
89
|
+
|
90
|
+
textEntryMathPage.tests.verifyEvaluationTabEvaluationMethodContainers();
|
91
|
+
|
92
|
+
it('User should be able to add another evaluation method for the response using \'Add evaluation\' button and the name for this new evaluation tab should be \'Evaluation 3\'', () => {
|
93
|
+
textEntryMathPage.steps.clickOnAddEvaluationButton();
|
94
|
+
utilities.verifyInnerText(utilities.getNthElement(textEntryMathPage.evaluationTab(), 2), 'Evaluation 3');
|
95
|
+
utilities.verifyElementCount(textEntryMathPage.evaluationTab(), 3);
|
96
|
+
});
|
97
|
+
|
98
|
+
it('When user clicks on the Evaluation 2 tab close button, then evaluation 2 tab should be removed and the numeration of remaining evaluation tabs should be updated', () => {
|
99
|
+
textEntryMathPage.steps.navigateToEvaluationTab(1);
|
100
|
+
textEntryMathPage.steps.clickOnEvaluationTabCloseButton();
|
101
|
+
utilities.verifyElementCount(textEntryMathPage.evaluationTab(), 2);
|
102
|
+
utilities.verifyInnerText(utilities.getNthElement(textEntryMathPage.evaluationTab(), 0), 'Evaluation 1');
|
103
|
+
utilities.verifyInnerText(utilities.getNthElement(textEntryMathPage.evaluationTab(), 1), 'Evaluation 2');
|
104
|
+
});
|
105
|
+
|
106
|
+
it('When user selects a new evaluation method in \'Evaluation 2\' tab and switches to \'Evaluation 1\' tab then in \'Evaluation 1\' tab the previously selected evaluation method should persist', () => {
|
107
|
+
textEntryMathPage.steps.navigateToEvaluationTab(1);
|
108
|
+
textEntryMathPage.steps.selectEvaluationMethod(evaluationMethods[4].name);
|
109
|
+
textEntryMathPage.steps.navigateToEvaluationTab(0);
|
110
|
+
textEntryMathPage.steps.verifyEvaluationMethodActiveState(evaluationMethods[1].name);
|
111
|
+
});
|
112
|
+
|
113
|
+
it('CSS of evaluation tabs', { tags: 'css' }, () => {
|
114
|
+
cy.log('Pre-step: Navigate to evaluation tab 2');
|
115
|
+
textEntryMathPage.steps.navigateToEvaluationTab(1);
|
116
|
+
utilities.verifyCSS(utilities.getNthElement(textEntryMathPage.evaluationTab(), 1), {
|
117
|
+
'color': css.color.activeButtons,
|
118
|
+
'font-size': css.fontSize.normal,
|
119
|
+
'font-weight': css.fontWeight.bold,
|
120
|
+
});
|
121
|
+
utilities.verifyCSS(utilities.getNthElement(textEntryMathPage.evaluationTab(), 1).parent().find('[class*="MuiTabs-indicator"]'), {
|
122
|
+
'background-color': css.color.activeComponentBorder
|
123
|
+
});
|
124
|
+
utilities.verifyCSS(textEntryMathPage.evaluationTabCloseButton().find('svg'), {
|
125
|
+
'fill': css.color.activeButtons
|
126
|
+
});
|
127
|
+
utilities.verifyCSS(utilities.getNthElement(textEntryMathPage.evaluationTab(), 0), {
|
128
|
+
'color': css.color.labels,
|
129
|
+
'font-size': css.fontSize.normal,
|
130
|
+
'font-weight': css.fontWeight.bold,
|
131
|
+
});
|
132
|
+
utilities.verifyCSS(textEntryMathPage.addEvaluationButton(), {
|
133
|
+
'color': css.color.activeButtons,
|
134
|
+
'font-size': css.fontSize.normal,
|
135
|
+
'font-weight': css.fontWeight.medium,
|
136
|
+
});
|
137
|
+
textEntryMathPage.addEvaluationButton()
|
138
|
+
.verifyPseudoClassBeforeProperty('color', css.color.activeButtons);
|
139
|
+
});
|
140
|
+
|
141
|
+
it('Accessibility of evaluation tabs', { tags: 'a11y' }, () => {
|
142
|
+
cy.checkAccessibility(textEntryMathPage.responseAccordion());
|
143
|
+
});
|
144
|
+
});
|
145
|
+
|
146
|
+
describe('Evaluation methods - Answer input field and \'Add alternate\' button', () => {
|
147
|
+
abortEarlySetup();
|
148
|
+
before(() => {
|
149
|
+
textEntryMathPage.steps.navigateToCreateQuestion('Text Entry Math');
|
150
|
+
cy.barsPreLoaderWait();
|
151
|
+
textEntryMathPage.steps.deleteAResponseToken(1);
|
152
|
+
textEntryMathPage.steps.expandResponseAccordionSpecifyCorrectAnswer(0);
|
153
|
+
});
|
154
|
+
|
155
|
+
it('In response accordion \'Answers\' label and one empty answer input field should be displayed', () => {
|
156
|
+
utilities.verifyInnerText(textEntryMathPage.answersLabel(), 'Answers');
|
157
|
+
utilities.verifyElementVisibilityState(textEntryMathPage.answersLabel(), 'visible');
|
158
|
+
utilities.verifyInnerText(textEntryMathPage.answersInputField(), '\n');
|
159
|
+
utilities.verifyElementVisibilityState(textEntryMathPage.answersInputField(), 'visible');
|
160
|
+
utilities.verifyElementCount(textEntryMathPage.answersInputField(), 1);
|
161
|
+
});
|
162
|
+
|
163
|
+
it('When there is a single answer input field, then input field numeration and its delete button should not be displayed', () => {
|
164
|
+
textEntryMathPage.steps.verifyAnswerInputFieldNumerationAndDeleteButtonNotExists();
|
165
|
+
});
|
166
|
+
|
167
|
+
it('\'Add alternate\' button should be displayed', () => {
|
168
|
+
utilities.verifyElementVisibilityState(textEntryMathPage.responseAccordionAddAlternateButton(), 'visible');
|
169
|
+
utilities.verifyElementVisibilityState(textEntryMathPage.responseAccordionAddAlternateButton(), 'Add alternate');
|
170
|
+
});
|
171
|
+
|
172
|
+
it('When single answer input field is present in blank state and user clicks on \'Add alternate\' button, then error message \'Error: Answer is required.\' should be displayed and new answer field should not be added', () => {
|
173
|
+
textEntryMathPage.steps.addAlternateAnswerInResponseAccordion(0);
|
174
|
+
utilities.verifyInnerText(commonComponents.errorMessage(), 'Error: Answer is required.');
|
175
|
+
utilities.verifyElementVisibilityState(commonComponents.errorMessage(), 'visible');
|
176
|
+
utilities.verifyElementCount(textEntryMathPage.answersInputField(), 1);
|
177
|
+
});
|
178
|
+
|
179
|
+
it('When user gives an input to \'Answer\' input field,then error message should disappear', () => {
|
180
|
+
textEntryMathPage.steps.addInputToResponseAnswerInputFieldSpecifyCorrectAnswer(0, '(a+b)(a-b)');
|
181
|
+
commonComponents.steps.verifyErrorMessageIsNotDisplayed();
|
182
|
+
});
|
183
|
+
|
184
|
+
it('When user clicks on \'Add alternate\' button, then one more answer input field should be displayed', () => {
|
185
|
+
textEntryMathPage.steps.addAlternateAnswerInResponseAccordion(0);
|
186
|
+
utilities.verifyElementCount(textEntryMathPage.answersInputField(), 2);
|
187
|
+
});
|
188
|
+
|
189
|
+
it('When more than one answer input fields are present, then answer field numeration and input field delete buttons should be displayed for both input fields', () => {
|
190
|
+
textEntryMathPage.steps.verifyAnswerInputFieldNumerationAndDeleteButtonIsVisible(0);
|
191
|
+
textEntryMathPage.steps.verifyAnswerInputFieldNumerationAndDeleteButtonIsVisible(1);
|
192
|
+
});
|
193
|
+
|
194
|
+
it('When no input is provided in answer input field, then placeholder text \'Enter text #\' should be displayed in the answer input field', () => {
|
195
|
+
textEntryMathPage.steps.verifyAnswerInputFieldPlaceholder(0);
|
196
|
+
});
|
197
|
+
|
198
|
+
it('When input is provided in answer input field, then placeholder text should not be displayed in the answer input field', () => {
|
199
|
+
textEntryMathPage.steps.addInputToAnswerInputField(0, '(a+b)*2');
|
200
|
+
textEntryMathPage.steps.verifyAnswerInputFieldPlaceholderNotExists(0);
|
201
|
+
});
|
202
|
+
|
203
|
+
it('CSS of answer input field', { tags: 'css' }, () => {
|
204
|
+
utilities.verifyCSS(textEntryMathPage.answersLabel(), {
|
205
|
+
'color': css.color.labels,
|
206
|
+
'font-size': css.fontSize.normal,
|
207
|
+
'font-weight': css.fontWeight.semibold,
|
208
|
+
});
|
209
|
+
utilities.verifyCSS(utilities.getNthElement(textEntryMathPage.answersInputField(), 1), {
|
210
|
+
'color': css.color.text,
|
211
|
+
'font-size': css.fontSize.default,
|
212
|
+
'font-weight': css.fontWeight.regular,
|
213
|
+
});
|
214
|
+
utilities.verifyCSS(utilities.getNthElement(textEntryMathPage.answersInputFieldNumeration(), 1), {
|
215
|
+
'color': css.color.labels,
|
216
|
+
'font-size': css.fontSize.default,
|
217
|
+
'font-weight': css.fontWeight.semibold,
|
218
|
+
});
|
219
|
+
utilities.getNthElement(textEntryMathPage.answersInputFieldDeleteButton(), 1)
|
220
|
+
.find('button')
|
221
|
+
.verifyPseudoClassBeforeProperty('color', css.color.deleteIcon);
|
222
|
+
});
|
223
|
+
|
224
|
+
//Accessibility covered in previous describes
|
225
|
+
|
226
|
+
it('When provided input is cleared from answer input field, then placeholder text should be displayed again in the answer input field', () => {
|
227
|
+
textEntryMathPage.steps.clearAnswerInputField(0);
|
228
|
+
textEntryMathPage.steps.verifyAnswerInputFieldPlaceholder(0);
|
229
|
+
});
|
230
|
+
|
231
|
+
it('When user clicks on answer input field delete button, then the respective answer field should be deleted and the numeration of remaining answer input fields should be updated accordingly', () => {
|
232
|
+
cy.log('Pre-step: Add one more answer input field');
|
233
|
+
textEntryMathPage.steps.addAlternateAnswerInResponseAccordion(0);
|
234
|
+
textEntryMathPage.steps.clickOnAnswerInputDeleteButton(0);
|
235
|
+
utilities.verifyElementCount(textEntryMathPage.answersInputField(), 2);
|
236
|
+
textEntryMathPage.steps.verifyAnswerInputFieldNumerationAndDeleteButtonIsVisible(0);
|
237
|
+
textEntryMathPage.steps.verifyAnswerInputFieldNumerationAndDeleteButtonIsVisible(1);
|
238
|
+
});
|
239
|
+
|
240
|
+
it('When number of answer input fields is reduced to 1, then input field numeration and its delete button should not be displayed', () => {
|
241
|
+
cy.log('Pre-step: Reduce number of answer input fields to 1');
|
242
|
+
textEntryMathPage.steps.clickOnAnswerInputDeleteButton(0);
|
243
|
+
utilities.verifyElementCount(textEntryMathPage.answersInputField(), 1);
|
244
|
+
textEntryMathPage.steps.verifyAnswerInputFieldNumerationAndDeleteButtonNotExists();
|
245
|
+
});
|
246
|
+
});
|
247
|
+
|
248
|
+
describe('Evaluation methods - Custom settings for each evaluation method', () => {
|
249
|
+
abortEarlySetup();
|
250
|
+
before(() => {
|
251
|
+
textEntryMathPage.steps.navigateToCreateQuestion('Text Entry Math');
|
252
|
+
cy.barsPreLoaderWait();
|
253
|
+
textEntryMathPage.steps.deleteAResponseToken(1);
|
254
|
+
textEntryMathPage.steps.expandResponseAccordionSpecifyCorrectAnswer(0);
|
255
|
+
});
|
256
|
+
|
257
|
+
it('By default for the custom settings accordion should be in collapsed state', () => {
|
258
|
+
textEntryMathPage.steps.verifyCustomSettingsAccordionIsCollapsed();
|
259
|
+
});
|
260
|
+
|
261
|
+
evaluationMethods.forEach((evaluationMethod) => {
|
262
|
+
it(`When user clicks on the custom settings accordion for ${evaluationMethod.name}, then the custom settings accordion should be expanded`, () => {
|
263
|
+
cy.log(`Pre-step: Selecting ${evaluationMethod.name} evaluation method`);
|
264
|
+
textEntryMathPage.steps.selectEvaluationMethod(evaluationMethod.name);
|
265
|
+
textEntryMathPage.steps.clickOnCustomSettingsAccordion();
|
266
|
+
textEntryMathPage.steps.verifyCustomSettingsAccordionIsExpanded();
|
267
|
+
});
|
268
|
+
|
269
|
+
it(`For ${evaluationMethod.name} evaluation method, the following custom settings should be displayed - ${evaluationMethod.customSettings.join(', ')}`, () => {
|
270
|
+
if (evaluationMethod.answerInputField === 'true') {
|
271
|
+
utilities.verifyElementVisibilityState(textEntryMathPage.answerInputFieldWrapper(), 'visible');
|
272
|
+
} else {
|
273
|
+
utilities.verifyElementVisibilityState(textEntryMathPage.answerInputFieldWrapper(), 'notExist');
|
274
|
+
}
|
275
|
+
if (evaluationMethod.customSettings.includes('Case sensitive')) {
|
276
|
+
utilities.verifyElementVisibilityState(textEntryMathPage.customSettingsCheckboxContainer(customSettingsIds.caseSensitive), 'visible');
|
277
|
+
textEntryMathPage.steps.verifyCustomSettingsCheckboxIsUnchecked(customSettingsIds.caseSensitive);
|
278
|
+
textEntryMathPage.steps.verifyCustomSettingsCheckboxLabel(customSettingsIds.caseSensitive, 'Case sensitive');
|
279
|
+
} else {
|
280
|
+
utilities.verifyElementVisibilityState(textEntryMathPage.customSettingsCheckboxContainer(customSettingsIds.caseSensitive), 'notExist');
|
281
|
+
}
|
282
|
+
if (evaluationMethod.customSettings.includes('Accept interval notation')) {
|
283
|
+
utilities.verifyElementVisibilityState(textEntryMathPage.customSettingsCheckboxContainer(customSettingsIds.acceptIntervalNotation), 'visible');
|
284
|
+
textEntryMathPage.steps.verifyCustomSettingsCheckboxIsUnchecked(customSettingsIds.acceptIntervalNotation);
|
285
|
+
textEntryMathPage.steps.verifyCustomSettingsCheckboxLabel(customSettingsIds.acceptIntervalNotation, 'Accept interval notation');
|
286
|
+
} else {
|
287
|
+
utilities.verifyElementVisibilityState(textEntryMathPage.customSettingsCheckboxContainer(customSettingsIds.acceptIntervalNotation), 'notExist');
|
288
|
+
}
|
289
|
+
if (evaluationMethod.customSettings.includes('Exclude LaTeX text from validation')) {
|
290
|
+
utilities.verifyElementVisibilityState(textEntryMathPage.customSettingsCheckboxContainer(customSettingsIds.excludeLatexTextFromValidation), 'visible');
|
291
|
+
textEntryMathPage.steps.verifyCustomSettingsCheckboxIsUnchecked(customSettingsIds.excludeLatexTextFromValidation);
|
292
|
+
textEntryMathPage.steps.verifyCustomSettingsCheckboxLabel(customSettingsIds.excludeLatexTextFromValidation, 'Exclude LaTeX text from validation');
|
293
|
+
} else {
|
294
|
+
utilities.verifyElementVisibilityState(textEntryMathPage.customSettingsCheckboxContainer(customSettingsIds.excludeLatexTextFromValidation), 'notExist');
|
295
|
+
}
|
296
|
+
if (evaluationMethod.customSettings.includes('Check for equality across sides')) {
|
297
|
+
utilities.verifyElementVisibilityState(textEntryMathPage.customSettingsCheckboxContainer(customSettingsIds.checkForEqualityAcrossSides), 'visible');
|
298
|
+
textEntryMathPage.steps.verifyCustomSettingsCheckboxIsUnchecked(customSettingsIds.checkForEqualityAcrossSides);
|
299
|
+
textEntryMathPage.steps.verifyCustomSettingsCheckboxLabel(customSettingsIds.checkForEqualityAcrossSides, 'Check for equality across sides');
|
300
|
+
} else {
|
301
|
+
utilities.verifyElementVisibilityState(textEntryMathPage.customSettingsCheckboxContainer(customSettingsIds.checkForEqualityAcrossSides), 'notExist');
|
302
|
+
}
|
303
|
+
if (evaluationMethod.customSettings.includes('Interpret alphabets as variables')) {
|
304
|
+
utilities.verifyElementVisibilityState(textEntryMathPage.customSettingsCheckboxContainer(customSettingsIds.interpretAlphabetsAsVariables), 'visible');
|
305
|
+
textEntryMathPage.steps.verifyCustomSettingsCheckboxIsUnchecked(customSettingsIds.interpretAlphabetsAsVariables);
|
306
|
+
textEntryMathPage.steps.verifyCustomSettingsCheckboxLabel(customSettingsIds.interpretAlphabetsAsVariables, 'Interpret alphabets as variables');
|
307
|
+
} else {
|
308
|
+
utilities.verifyElementVisibilityState(textEntryMathPage.customSettingsCheckboxContainer(customSettingsIds.interpretAlphabetsAsVariables), 'notExist');
|
309
|
+
}
|
310
|
+
if (evaluationMethod.customSettings.includes('Interpret e as Euler\'s number')) {
|
311
|
+
utilities.verifyElementVisibilityState(textEntryMathPage.customSettingsCheckboxContainer(customSettingsIds.interpretEAsEulerNumber), 'visible');
|
312
|
+
textEntryMathPage.steps.verifyCustomSettingsCheckboxIsUnchecked(customSettingsIds.interpretEAsEulerNumber);
|
313
|
+
textEntryMathPage.steps.verifyCustomSettingsCheckboxLabel(customSettingsIds.interpretEAsEulerNumber, 'Interpret e as Euler\'s number');
|
314
|
+
} else {
|
315
|
+
utilities.verifyElementVisibilityState(textEntryMathPage.customSettingsCheckboxContainer(customSettingsIds.interpretEAsEulerNumber), 'notExist');
|
316
|
+
}
|
317
|
+
if (evaluationMethod.customSettings.includes('Interpret i as imaginary')) {
|
318
|
+
utilities.verifyElementVisibilityState(textEntryMathPage.customSettingsCheckboxContainer(customSettingsIds.interpretIAsImaginary), 'visible');
|
319
|
+
textEntryMathPage.steps.verifyCustomSettingsCheckboxIsUnchecked(customSettingsIds.interpretIAsImaginary);
|
320
|
+
textEntryMathPage.steps.verifyCustomSettingsCheckboxLabel(customSettingsIds.interpretIAsImaginary, 'Interpret i as imaginary');
|
321
|
+
} else {
|
322
|
+
utilities.verifyElementVisibilityState(textEntryMathPage.customSettingsCheckboxContainer(customSettingsIds.interpretIAsImaginary), 'notExist');
|
323
|
+
}
|
324
|
+
if (evaluationMethod.customSettings.includes('Interpret i as imaginary')) {
|
325
|
+
utilities.verifyElementVisibilityState(textEntryMathPage.customSettingsCheckboxContainer(customSettingsIds.interpretIAsImaginary), 'visible');
|
326
|
+
textEntryMathPage.steps.verifyCustomSettingsCheckboxIsUnchecked(customSettingsIds.interpretIAsImaginary);
|
327
|
+
textEntryMathPage.steps.verifyCustomSettingsCheckboxLabel(customSettingsIds.interpretIAsImaginary, 'Interpret i as imaginary');
|
328
|
+
} else {
|
329
|
+
utilities.verifyElementVisibilityState(textEntryMathPage.customSettingsCheckboxContainer(customSettingsIds.interpretIAsImaginary), 'notExist');
|
330
|
+
}
|
331
|
+
if (evaluationMethod.customSettings.includes('Ignore order')) {
|
332
|
+
utilities.verifyElementVisibilityState(textEntryMathPage.customSettingsCheckboxContainer(customSettingsIds.acceptExpressionsInAnyOrder), 'visible');
|
333
|
+
textEntryMathPage.steps.verifyCustomSettingsCheckboxIsUnchecked(customSettingsIds.acceptExpressionsInAnyOrder);
|
334
|
+
textEntryMathPage.steps.verifyCustomSettingsCheckboxLabel(customSettingsIds.acceptExpressionsInAnyOrder, 'Ignore order');
|
335
|
+
} else {
|
336
|
+
utilities.verifyElementVisibilityState(textEntryMathPage.customSettingsCheckboxContainer(customSettingsIds.acceptExpressionsInAnyOrder), 'notExist');
|
337
|
+
}
|
338
|
+
if (evaluationMethod.customSettings.includes('Inverse result')) {
|
339
|
+
utilities.verifyElementVisibilityState(textEntryMathPage.customSettingsCheckboxContainer(customSettingsIds.excludeFromPossibleCorrectAnswers), 'visible');
|
340
|
+
textEntryMathPage.steps.verifyCustomSettingsCheckboxIsUnchecked(customSettingsIds.excludeFromPossibleCorrectAnswers);
|
341
|
+
textEntryMathPage.steps.verifyCustomSettingsCheckboxLabel(customSettingsIds.excludeFromPossibleCorrectAnswers, 'Inverse result');
|
342
|
+
} else {
|
343
|
+
utilities.verifyElementVisibilityState(textEntryMathPage.customSettingsCheckboxContainer(customSettingsIds.excludeFromPossibleCorrectAnswers), 'notExist');
|
344
|
+
}
|
345
|
+
if (evaluationMethod.customSettings.includes('Ignore trailing zeros')) {
|
346
|
+
utilities.verifyElementVisibilityState(textEntryMathPage.customSettingsCheckboxContainer(customSettingsIds.ignoreZerosAfterDecimal), 'visible');
|
347
|
+
textEntryMathPage.steps.verifyCustomSettingsCheckboxIsUnchecked(customSettingsIds.ignoreZerosAfterDecimal);
|
348
|
+
textEntryMathPage.steps.verifyCustomSettingsCheckboxLabel(customSettingsIds.ignoreZerosAfterDecimal, 'Ignore trailing zeros');
|
349
|
+
} else {
|
350
|
+
utilities.verifyElementVisibilityState(textEntryMathPage.customSettingsCheckboxContainer(customSettingsIds.ignoreZerosAfterDecimal), 'notExist');
|
351
|
+
}
|
352
|
+
if (evaluationMethod.customSettings.includes('Ignore coefficient of 1')) {
|
353
|
+
utilities.verifyElementVisibilityState(textEntryMathPage.customSettingsCheckboxContainer(customSettingsIds.ignoreUnitCoefficient), 'visible');
|
354
|
+
textEntryMathPage.steps.verifyCustomSettingsCheckboxIsUnchecked(customSettingsIds.ignoreUnitCoefficient);
|
355
|
+
textEntryMathPage.steps.verifyCustomSettingsCheckboxLabel(customSettingsIds.ignoreUnitCoefficient, 'Ignore coefficient of 1');
|
356
|
+
} else {
|
357
|
+
utilities.verifyElementVisibilityState(textEntryMathPage.customSettingsCheckboxContainer(customSettingsIds.ignoreUnitCoefficient), 'notExist');
|
358
|
+
}
|
359
|
+
if (evaluationMethod.customSettings.includes('Check for parenthesis grouping')) {
|
360
|
+
utilities.verifyElementVisibilityState(textEntryMathPage.customSettingsCheckboxContainer(customSettingsIds.checkForParenthesisGrouping), 'visible');
|
361
|
+
textEntryMathPage.steps.verifyCustomSettingsCheckboxIsUnchecked(customSettingsIds.checkForParenthesisGrouping);
|
362
|
+
textEntryMathPage.steps.verifyCustomSettingsCheckboxLabel(customSettingsIds.checkForParenthesisGrouping, 'Check for parenthesis grouping');
|
363
|
+
} else {
|
364
|
+
utilities.verifyElementVisibilityState(textEntryMathPage.customSettingsCheckboxContainer(customSettingsIds.checkForParenthesisGrouping), 'notExist');
|
365
|
+
}
|
366
|
+
if (evaluationMethod.customSettings.includes('Ignore spaces before and after')) {
|
367
|
+
utilities.verifyElementVisibilityState(textEntryMathPage.customSettingsCheckboxContainer(customSettingsIds.ignoreSpacesBeforeAndAfter), 'visible');
|
368
|
+
textEntryMathPage.steps.verifyCustomSettingsCheckboxIsUnchecked(customSettingsIds.ignoreSpacesBeforeAndAfter);
|
369
|
+
textEntryMathPage.steps.verifyCustomSettingsCheckboxLabel(customSettingsIds.ignoreSpacesBeforeAndAfter, 'Ignore spaces before and after');
|
370
|
+
} else {
|
371
|
+
utilities.verifyElementVisibilityState(textEntryMathPage.customSettingsCheckboxContainer(customSettingsIds.ignoreSpacesBeforeAndAfter), 'notExist');
|
372
|
+
}
|
373
|
+
if (evaluationMethod.customSettings.includes('Ignore extra spaces')) {
|
374
|
+
utilities.verifyElementVisibilityState(textEntryMathPage.customSettingsCheckboxContainer(customSettingsIds.ignoreExtraSpaces), 'visible');
|
375
|
+
textEntryMathPage.steps.verifyCustomSettingsCheckboxIsUnchecked(customSettingsIds.ignoreExtraSpaces);
|
376
|
+
textEntryMathPage.steps.verifyCustomSettingsCheckboxLabel(customSettingsIds.ignoreExtraSpaces, 'Ignore extra spaces');
|
377
|
+
} else {
|
378
|
+
utilities.verifyElementVisibilityState(textEntryMathPage.customSettingsCheckboxContainer(customSettingsIds.ignoreExtraSpaces), 'notExist');
|
379
|
+
}
|
380
|
+
if (evaluationMethod.customSettings.includes('Decimal separator')) {
|
381
|
+
textEntryMathPage.steps.verifyDecimalSeparatorsContents();
|
382
|
+
} else {
|
383
|
+
utilities.verifyElementVisibilityState(textEntryMathPage.decimalSeparatorWrapper(), 'notExist');
|
384
|
+
}
|
385
|
+
if (evaluationMethod.customSettings.includes('Thousands separator')) {
|
386
|
+
textEntryMathPage.steps.verifyThousandsSeparatorsContents(thousandsSeparatorForDotDecimalSeparator);
|
387
|
+
} else {
|
388
|
+
utilities.verifyElementVisibilityState(textEntryMathPage.thousandsSeparatorWrapper(), 'notExist');
|
389
|
+
}
|
390
|
+
if (evaluationMethod.customSettings.includes('Decimal places to be compared')) {
|
391
|
+
textEntryMathPage.steps.verifyDecimalPlacesToBeComparedSectionContents();
|
392
|
+
} else {
|
393
|
+
utilities.verifyElementVisibilityState(textEntryMathPage.decimalPlacesToBeComparedInputField(), 'notExist');
|
394
|
+
utilities.verifyElementVisibilityState(textEntryMathPage.decimalPlacesToBeComparedLabel(), 'notExist');
|
395
|
+
}
|
396
|
+
if (evaluationMethod.customSettings.includes('Tolerance')) {
|
397
|
+
textEntryMathPage.steps.verifyToleranceSectionContents();
|
398
|
+
} else {
|
399
|
+
utilities.verifyElementVisibilityState(textEntryMathPage.toleranceInputField(), 'notExist');
|
400
|
+
utilities.verifyElementVisibilityState(textEntryMathPage.toleranceLabel(), 'notExist');
|
401
|
+
}
|
402
|
+
if (evaluationMethod.customSettings.includes('Type of expression')) {
|
403
|
+
utilities.verifyElementVisibilityState(textEntryMathPage.typeOfExpressionLabel(), 'visible');
|
404
|
+
utilities.verifyInnerText(textEntryMathPage.typeOfExpressionLabel(), 'Type of expression');
|
405
|
+
utilities.verifyElementVisibilityState(textEntryMathPage.typeOfExpressionDropdown(), 'visible');
|
406
|
+
utilities.verifyInnerText(textEntryMathPage.typeOfExpressionDropdown(), 'Integer');
|
407
|
+
cy.log(`When user expands \'Type of Expression\' dropdown, then the followings options should be displayed ${typeOfExpression.join(', ')}`);
|
408
|
+
cy.log('Pre-step: Expanding \'Type of Expression\' dropdown');
|
409
|
+
textEntryMathPage.steps.expandTypeOfExpressionDropdown();
|
410
|
+
typeOfExpression.forEach((type, index) => {
|
411
|
+
utilities.verifyInnerText(utilities.getNthElement(textEntryMathPage.typeOfExpressionDropdownOption(), index), type);
|
412
|
+
});
|
413
|
+
textEntryMathPage.steps.verifyTypeOfExpressionDropdownListOptionActiveState(0);
|
414
|
+
textEntryMathPage.steps.verifyTypeOfExpressionDropdownListOptionInactiveState(1);
|
415
|
+
textEntryMathPage.steps.verifyTypeOfExpressionDropdownListOptionInactiveState(2);
|
416
|
+
cy.log('When user selects a different option in \'Type of Expression\' dropdown, then the dropdown should be collapsed and the selected option should be displayed in the dropdown');
|
417
|
+
textEntryMathPage.steps.selectTypeOfExpressionDropdownListOption(1);
|
418
|
+
textEntryMathPage.steps.verifyTypeOfExpressionDropdownIsCollapsed();
|
419
|
+
utilities.verifyInnerText(textEntryMathPage.typeOfExpressionDropdown(), 'Real');
|
420
|
+
} else {
|
421
|
+
utilities.verifyElementVisibilityState(textEntryMathPage.typeOfExpressionLabel(), 'notExist');
|
422
|
+
utilities.verifyElementVisibilityState(textEntryMathPage.typeOfExpressionDropdown(), 'notExist');
|
423
|
+
}
|
424
|
+
if (evaluationMethod.customSettings.includes('Syntax')) {
|
425
|
+
utilities.verifyElementVisibilityState(textEntryMathPage.syntaxLabel(), 'visible');
|
426
|
+
utilities.verifyInnerText(textEntryMathPage.syntaxLabel(), 'Type of expression');
|
427
|
+
utilities.verifyElementVisibilityState(textEntryMathPage.syntaxDropdown(), 'visible');
|
428
|
+
utilities.verifyInnerText(textEntryMathPage.syntaxDropdown(), 'Number');
|
429
|
+
cy.log(`When user expands \'Syntax\' dropdown, then the followings options should be displayed ${syntaxDropdown.join(', ')}`);
|
430
|
+
cy.log('Pre-step: Expanding \'Type of Expression\' dropdown');
|
431
|
+
textEntryMathPage.steps.expandSyntaxDropdown();
|
432
|
+
syntaxDropdown.forEach((type, index) => {
|
433
|
+
utilities.verifyInnerText(utilities.getNthElement(textEntryMathPage.syntaxDropdownOption(), index), type);
|
434
|
+
});
|
435
|
+
textEntryMathPage.steps.verifySyntaxDropdownListOptionActiveState(0);
|
436
|
+
for (let index = 0; index < syntaxDropdown.length; index++) {
|
437
|
+
textEntryMathPage.steps.verifySyntaxDropdownListOptionInactiveState(index);
|
438
|
+
};
|
439
|
+
cy.log('When user selects a different option in \'Syntax\' dropdown, then the dropdown should be collapsed and the selected option should be displayed in the dropdown');
|
440
|
+
textEntryMathPage.steps.selectSyntaxDropdownListOption(1);
|
441
|
+
textEntryMathPage.steps.verifySyntaxDropdownIsCollapsed();
|
442
|
+
utilities.verifyInnerText(textEntryMathPage.syntaxDropdown(), 'Integer');
|
443
|
+
} else {
|
444
|
+
utilities.verifyElementVisibilityState(textEntryMathPage.syntaxLabel(), 'notExist');
|
445
|
+
utilities.verifyElementVisibilityState(textEntryMathPage.syntaxDropdown(), 'notExist');
|
446
|
+
}
|
447
|
+
});
|
448
|
+
|
449
|
+
it(`When user clicks on the expanded custom settings accordion for ${evaluationMethod.name}, then the custom settings accordion should be collpased`, () => {
|
450
|
+
textEntryMathPage.steps.clickOnCustomSettingsAccordion();
|
451
|
+
textEntryMathPage.steps.verifyCustomSettingsAccordionIsCollapsed();
|
452
|
+
});
|
453
|
+
});
|
454
|
+
|
455
|
+
it('CSS of custom settings accordion and contents', { tags: 'css' }, () => {
|
456
|
+
utilities.verifyCSS(textEntryMathPage.customSettingsLabel(), {
|
457
|
+
'color': css.color.accordionLabel,
|
458
|
+
'font-size': css.fontSize.default,
|
459
|
+
'font-weight': css.fontWeight.bold,
|
460
|
+
});
|
461
|
+
utilities.verifyCSS(textEntryMathPage.customSettingsChevronButton().find('svg'), {
|
462
|
+
'fill': css.color.activeButtons
|
463
|
+
});
|
464
|
+
cy.log('Pre-step: Selecting \'Value is equivalent\' evaluation method');
|
465
|
+
textEntryMathPage.steps.selectEvaluationMethod(evaluationMethods[1].name);
|
466
|
+
utilities.verifyCSS(textEntryMathPage.customSettingsCheckboxContainer(customSettingsIds.caseSensitive).find('[class*="MuiFormControlLabel-label"]'), {
|
467
|
+
'color': css.color.customSettingsCheckboxLabel,
|
468
|
+
'font-size': css.fontSize.normal,
|
469
|
+
'font-weight': css.fontWeight.regular,
|
470
|
+
});
|
471
|
+
utilities.verifyCSS(textEntryMathPage.decimalPlacesToBeComparedLabel, {
|
472
|
+
'color': css.color.labels,
|
473
|
+
'font-size': css.fontSize.normal,
|
474
|
+
'font-weight': css.fontWeight.semibold,
|
475
|
+
});
|
476
|
+
utilities.verifyCSS(textEntryMathPage.decimalPlacesToBeComparedInputField, {
|
477
|
+
'color': css.color.text,
|
478
|
+
'font-size': css.fontSize.default,
|
479
|
+
'font-weight': css.fontWeight.regular,
|
480
|
+
});
|
481
|
+
cy.log('Pre-step: Selecting \'Equivalent structure\' evaluation method');
|
482
|
+
textEntryMathPage.steps.selectEvaluationMethod(evaluationMethods[3].name);
|
483
|
+
utilities.verifyCSS(textEntryMathPage.syntaxLabel(), {
|
484
|
+
'color': css.color.labels,
|
485
|
+
'font-size': css.fontSize.normal,
|
486
|
+
'font-weight': css.fontWeight.semibold,
|
487
|
+
});
|
488
|
+
utilities.verifyCSS(textEntryMathPage.syntaxDropdown(), {
|
489
|
+
'color': css.color.liText,
|
490
|
+
'font-size': css.fontSize.default,
|
491
|
+
'font-weight': css.fontWeight.regular,
|
492
|
+
});
|
493
|
+
cy.log('Expand syntax dropdown');
|
494
|
+
textEntryMathPage.steps.expandSyntaxDropdown();
|
495
|
+
utilities.verifyCSS(utilities.getNthElement(textEntryMathPage.syntaxDropdownOption(), 0), {
|
496
|
+
'color': css.color.labels,
|
497
|
+
'font-size': css.fontSize.normal,
|
498
|
+
'font-weight': css.fontWeight.semibold,
|
499
|
+
'background-color': css.color.liTextSelectedBg
|
500
|
+
});
|
501
|
+
utilities.verifyCSS(utilities.getNthElement(textEntryMathPage.syntaxDropdownOption(), 1), {
|
502
|
+
'color': css.color.liText,
|
503
|
+
'font-size': css.fontSize.default,
|
504
|
+
'font-weight': css.fontWeight.regular
|
505
|
+
});
|
506
|
+
cy.log('Post-step: Collapse dropdown');
|
507
|
+
textEntryMathPage.steps.selectSyntaxDropdownListOption(1);
|
508
|
+
cy.log('Pre-step: Selecting \'Factored form\' evaluation method');
|
509
|
+
textEntryMathPage.steps.selectEvaluationMethod(evaluationMethods[6].name);
|
510
|
+
utilities.verifyCSS(textEntryMathPage.typeOfExpressionLabel(), {
|
511
|
+
'color': css.color.labels,
|
512
|
+
'font-size': css.fontSize.normal,
|
513
|
+
'font-weight': css.fontWeight.semibold,
|
514
|
+
});
|
515
|
+
utilities.verifyCSS(textEntryMathPage.typeOfExpressionDropdown(), {
|
516
|
+
'color': css.color.liText,
|
517
|
+
'font-size': css.fontSize.default,
|
518
|
+
'font-weight': css.fontWeight.regular,
|
519
|
+
});
|
520
|
+
cy.log('Expand type of expression dropdown');
|
521
|
+
textEntryMathPage.steps.expandTypeOfExpressionDropdown();
|
522
|
+
utilities.verifyCSS(utilities.getNthElement(textEntryMathPage.typeOfExpressionDropdownOption(), 0), {
|
523
|
+
'color': css.color.labels,
|
524
|
+
'font-size': css.fontSize.normal,
|
525
|
+
'font-weight': css.fontWeight.semibold,
|
526
|
+
'background-color': css.color.liTextSelectedBg
|
527
|
+
});
|
528
|
+
utilities.verifyCSS(utilities.getNthElement(textEntryMathPage.typeOfExpressionDropdownOption(), 1), {
|
529
|
+
'color': css.color.liText,
|
530
|
+
'font-size': css.fontSize.default,
|
531
|
+
'font-weight': css.fontWeight.regular
|
532
|
+
});
|
533
|
+
cy.log('Post-step: Collapse dropdown');
|
534
|
+
textEntryMathPage.steps.selectTypeOfExpressionDropdownListOption(1);
|
535
|
+
});
|
536
|
+
|
537
|
+
it('Accessibility of custom settings accordion and contents', { tags: 'a11y' }, () => {
|
538
|
+
cy.checkAccessibility(textEntryMathPage.responseAccordion());
|
539
|
+
cy.log('Expand type of expression dropdown');
|
540
|
+
textEntryMathPage.steps.expandTypeOfExpressionDropdown();
|
541
|
+
cy.checkAccessibility(utilities.getNthElement(textEntryMathPage.typeOfExpressionDropdownOption(), 0).parents('ul'));
|
542
|
+
cy.log('Post-step: Collapse dropdown');
|
543
|
+
textEntryMathPage.steps.selectTypeOfExpressionDropdownListOption(1);
|
544
|
+
cy.log('Expand syntax dropdown');
|
545
|
+
textEntryMathPage.steps.expandSyntaxDropdown();
|
546
|
+
cy.checkAccessibility(utilities.getNthElement(textEntryMathPage.syntaxDropdownOption(), 0).parents('ul'));
|
547
|
+
cy.log('Post-step: Collapse dropdown');
|
548
|
+
textEntryMathPage.steps.selectSyntaxDropdownListOption(1);
|
549
|
+
});
|
550
|
+
});
|
551
|
+
|
552
|
+
describe('Evaluation methods - Decimal separator and Thousand separator', () => {
|
553
|
+
abortEarlySetup();
|
554
|
+
before(() => {
|
555
|
+
textEntryMathPage.steps.navigateToCreateQuestion('Text Entry Math');
|
556
|
+
cy.barsPreLoaderWait();
|
557
|
+
textEntryMathPage.steps.deleteAResponseToken(1);
|
558
|
+
textEntryMathPage.steps.expandResponseAccordionSpecifyCorrectAnswer(0);
|
559
|
+
textEntryMathPage.steps.clickOnCustomSettingsAccordion();
|
560
|
+
});
|
561
|
+
|
562
|
+
it('For \'Decimal separator\' custom settings by default \'Dot\' should be selected', () => {
|
563
|
+
textEntryMathPage.steps.verifyDecimalSeparatorOptionActive(0);
|
564
|
+
});
|
565
|
+
|
566
|
+
it(`When decimal separator is set to \'Dot\', then the following should be the displayed options for thousands separator - ${thousandsSeparatorForDotDecimalSeparator.join(', ')}`, () => {
|
567
|
+
textEntryMathPage.steps.verifyThousandsSeparatorsContents(thousandsSeparatorForDotDecimalSeparator);
|
568
|
+
});
|
569
|
+
|
570
|
+
it('User should be able to select \'Comma\' as \'Decimal separator\'', () => {
|
571
|
+
textEntryMathPage.steps.selectDecimalSeparatorOption(1);
|
572
|
+
textEntryMathPage.steps.verifyDecimalSeparatorOptionActive(1);
|
573
|
+
textEntryMathPage.steps.verifyDecimalSeparatorOptionInactive(0);
|
574
|
+
});
|
575
|
+
|
576
|
+
it(`When decimal separator is set to \'Comma\', then the following should be the displayed options for thousands separator - ${thousandsSeparatorForCommaDecimalSeparator.join(', ')}`, () => {
|
577
|
+
textEntryMathPage.steps.verifyThousandsSeparatorsContents(thousandsSeparatorForCommaDecimalSeparator);
|
578
|
+
});
|
579
|
+
|
580
|
+
it('For \'Thousands separator\' custom settings by default \'None\' should be selected', () => {
|
581
|
+
textEntryMathPage.steps.verifyThousandSeparatorOptionActive(0);
|
582
|
+
});
|
583
|
+
|
584
|
+
it('User should be able to select a different \'Thousands separator\'', () => {
|
585
|
+
textEntryMathPage.steps.selectThousandSeparatorOption(1);
|
586
|
+
textEntryMathPage.steps.verifyThousandSeparatorOptionActive(1);
|
587
|
+
textEntryMathPage.steps.verifyThousandSeparatorOptionInactive(0);
|
588
|
+
textEntryMathPage.steps.verifyThousandSeparatorOptionInactive(2);
|
589
|
+
textEntryMathPage.steps.verifyThousandSeparatorOptionInactive(3);
|
590
|
+
});
|
591
|
+
|
592
|
+
it('CSS of custom settings accordion and contents', { tags: 'css' }, () => {
|
593
|
+
utilities.verifyCSS(utilities.getNthElement(textEntryMathPage.separatorsTitle(), 0), {
|
594
|
+
'color': css.color.labels,
|
595
|
+
'font-size': css.fontSize.normal,
|
596
|
+
'font-weight': css.fontWeight.semibold
|
597
|
+
});
|
598
|
+
utilities.verifyCSS(utilities.getNthElement(textEntryMathPage.separatorsOptionsMenuOptions(), 0), {
|
599
|
+
'color': css.color.separatorsUnselectedOption,
|
600
|
+
'font-size': css.fontSize.normal,
|
601
|
+
'font-weight': css.fontWeight.bold
|
602
|
+
});
|
603
|
+
utilities.verifyCSS(utilities.getNthElement(textEntryMathPage.separatorsOptionsMenuOptions(), 1), {
|
604
|
+
'color': css.color.whiteText,
|
605
|
+
'font-size': css.fontSize.normal,
|
606
|
+
'font-weight': css.fontWeight.bold,
|
607
|
+
'background-color': css.color.activeButtons
|
608
|
+
});
|
609
|
+
});
|
610
|
+
|
611
|
+
//Accessibility already covered in above describes
|
612
|
+
});
|
613
|
+
});
|