itemengine-cypress-automation 1.0.86 → 1.0.88

Sign up to get free protection for your applications and to get access to all the features.
Files changed (48) hide show
  1. package/cypress/e2e/ILC/DrawingResponse/drawingResponseCustomizeAdditionalOptions.js +30 -30
  2. package/cypress/e2e/ILC/DrawingResponse/drawingResponseGradingViewAndCorrectAnswerViewContents.smoke.js +1 -1
  3. package/cypress/e2e/ILC/EssayResponse/createCustomCategory.smoke.js +568 -0
  4. package/cypress/e2e/ILC/EssayResponse/editAndPreviewTabScoringSection.js +86 -0
  5. package/cypress/e2e/ILC/EssayResponse/editTabBasicSections.js +389 -0
  6. package/cypress/e2e/ILC/EssayResponse/gradingViewAndCorrectAnswerViewContents.smoke.js +112 -0
  7. package/cypress/e2e/ILC/EssayResponse/headerSection.js +68 -0
  8. package/cypress/e2e/ILC/EssayResponse/previewAddTable.js +290 -0
  9. package/cypress/e2e/ILC/EssayResponse/previewContentsForAllViews.smoke.js +79 -0
  10. package/cypress/e2e/ILC/EssayResponse/previewEditTable.js +379 -0
  11. package/cypress/e2e/ILC/EssayResponseBasic/essayResponseBasicCustomizeFormattingOptions.js +207 -0
  12. package/cypress/e2e/ILC/EssayResponseBasic/gradingViewAndCorrectAnswerViewContents.smoke.js +115 -0
  13. package/cypress/e2e/ILC/EssayResponseBasic/previewContentsForAllViews.smoke.js +79 -0
  14. package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/FillInTheGapsOverImageDragAndDropScoring/partialDifferentWeightsBasic.js +159 -0
  15. package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/backgroundImageAndCanvasProperties.js +507 -29
  16. package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/previewContentsForAllViews.smoke.js +6 -0
  17. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/responseAnswersAndAcceptedStudentInput.js +272 -0
  18. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/specialCharactersSection.js +300 -0
  19. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/specifyCorrectAnswerSection.js +3 -3
  20. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/studentViewSettings.js +204 -0
  21. package/cypress/e2e/ILC/Protractor/protractorEditTabBasicsSection.js +4 -4
  22. package/cypress/e2e/ILC/Protractor/protractorEditTabFunctionality.js +1 -1
  23. package/cypress/e2e/ILC/Ruler/rulerEditTabBasicsSection.js +4 -4
  24. package/cypress/e2e/ILC/Ruler/rulerEditTabFunctionality.js +1 -1
  25. package/cypress/e2e/ILC/SingleSelection/editTabScoringSection.js +1 -3
  26. package/cypress/e2e/ILC/TextEntryMath/editTabBasicSection.js +205 -0
  27. package/cypress/e2e/ILC/TextEntryMath/editTabScoringSection.js +259 -0
  28. package/cypress/e2e/ILC/TextEntryMath/minimumScoringPenaltyPointsAndRoundingDropdown.js +202 -0
  29. package/cypress/e2e/ILC/TextEntryMath/responseEvaluationMethodsAndCustomSettings.js +613 -0
  30. package/cypress/e2e/ILC/TextEntryMath/specifyCorrectAnswerSection.js +71 -0
  31. package/cypress/fixtures/equationEditorCategoriesAndSymbols .js +318 -318
  32. package/cypress/fixtures/theme/ilc.json +3 -0
  33. package/cypress/pages/components/backgroundImageUploadComponent.js +1 -2
  34. package/cypress/pages/components/colorPopupComponent.js +26 -3
  35. package/cypress/pages/components/createCustomCategoryFlyout.js +351 -46
  36. package/cypress/pages/components/customizeSpecialCharacterComponent.js +165 -0
  37. package/cypress/pages/components/equationEditorFlyout.js +124 -0
  38. package/cypress/pages/components/essayResponseCommonComponents.js +3 -0
  39. package/cypress/pages/components/figOverImageCanvasComponent.js +316 -7
  40. package/cypress/pages/components/index.js +3 -1
  41. package/cypress/pages/components/opacityComponent.js +31 -4
  42. package/cypress/pages/components/specialAndCustomSpecialCharactersComponent.js +1 -0
  43. package/cypress/pages/components/specialCharactersFlyoutComponent.js +1 -0
  44. package/cypress/pages/drawingResponsePage.js +33 -138
  45. package/cypress/pages/essayResponsePage.js +612 -26
  46. package/cypress/pages/fillInTheGapsOverImageDragAndDropPage.js +48 -7
  47. package/cypress/pages/fillInTheGapsOverImageTextPage.js +267 -13
  48. package/package.json +1 -1
@@ -0,0 +1,259 @@
1
+ import { textEntryMathPage } from "../../../pages";
2
+ import abortEarlySetup from "../../../support/helpers/abortEarly";
3
+ import utilities from "../../../support/helpers/utilities";
4
+ const css = Cypress.env('css');
5
+
6
+ describe('Create item page - Text entry math: Scoring section', () => {
7
+ before(() => {
8
+ cy.loginAs('admin');
9
+ });
10
+
11
+ describe('Scoring section contents', () => {
12
+ abortEarlySetup();
13
+ before(() => {
14
+ textEntryMathPage.steps.navigateToCreateQuestion('Text Entry Math');
15
+ cy.barsPreLoaderWait();
16
+ });
17
+
18
+ textEntryMathPage.tests.verifyScoringTypeLabelAndDropdown('Auto scored');
19
+
20
+ textEntryMathPage.tests.verifyScoringSubtypeContentsForMultipleResponseTypeQuestion();
21
+ });
22
+
23
+ describe('Auto scored: All or nothing scoring - Scoring section', () => {
24
+ abortEarlySetup();
25
+ before(() => {
26
+ textEntryMathPage.steps.navigateToCreateQuestion('Text Entry Math');
27
+ cy.barsPreLoaderWait();
28
+ });
29
+
30
+ it('When the user has selected \'All or nothing\' scoring subtype, minimum scoring dropdown should be displayed in the scoring section', () => {
31
+ textEntryMathPage.steps.verifyMinimumScoringLabelAndDropdownDefaultState();
32
+ });
33
+ });
34
+
35
+ describe('Auto scored: All or nothing scoring - Specify correct answer section', () => {
36
+ abortEarlySetup();
37
+ before(() => {
38
+ textEntryMathPage.steps.navigateToCreateQuestion('Text Entry Math');
39
+ cy.barsPreLoaderWait();
40
+ });
41
+
42
+ textEntryMathPage.tests.verifyContentsOfSpecifyCorrectAnswerSection();
43
+
44
+ textEntryMathPage.tests.verifyPointsLabelAndInputField();
45
+ });
46
+
47
+ describe('Auto scored: Partial - equal weights scoring - Scoring section', () => {
48
+ abortEarlySetup();
49
+ before(() => {
50
+ textEntryMathPage.steps.navigateToCreateQuestion('Text Entry Math');
51
+ cy.barsPreLoaderWait();
52
+ });
53
+
54
+ it('User should be able to select \'Partial - equal weights\' scoring type', () => {
55
+ textEntryMathPage.steps.selectAutoScoredScoringSubtype('Partial equal weights');
56
+ });
57
+
58
+ it('When the user has switched to \'Partial - equal weights\' scoring, then \'Penalty scoring\', \'Minimum scoring\' and \'Rounding\' label and dropdown should be displayed in the \'Scoring\' section, \'Round negative scores to zero\' label and checkbox should not be displayed in the \'Scoring\' section', () => {
59
+ textEntryMathPage.steps.verifyMinimumScoringLabelAndDropdownDefaultState();
60
+ textEntryMathPage.steps.verifyPenaltyPointsLabelAndDropdownDefaultState();
61
+ textEntryMathPage.steps.verifyRoundingLabelAndDropdownDefaultState();
62
+ utilities.verifyElementVisibilityState(textEntryMathPage.roundNegativeScoresToZeroCheckbox(), 'notExist');
63
+ });
64
+ });
65
+
66
+ describe('Auto scored: Partial - equal weights scoring - Specify correct answer section', () => {
67
+ abortEarlySetup();
68
+ before(() => {
69
+ textEntryMathPage.steps.navigateToCreateQuestion('Text Entry Math');
70
+ cy.barsPreLoaderWait();
71
+ textEntryMathPage.steps.selectAutoScoredScoringSubtype('Partial equal weights');
72
+ });
73
+
74
+ textEntryMathPage.tests.verifyContentsOfSpecifyCorrectAnswerSection();
75
+
76
+ it('When no points are entered in the points input field, then points per response should not be displayed on the response accordion', () => {
77
+ utilities.verifyElementVisibilityState(textEntryMathPage.responseAccordionPointsWrapper(), 'notExist');
78
+ });
79
+
80
+ it('When the user gives a score input to \'Points\' input field, then the score should be equally divided and displayed on each response tab with a \'Points:\' label', () => {
81
+ textEntryMathPage.steps.allotPoints(4);
82
+ textEntryMathPage.steps.verifyPointsDisplayedOnResponseAccordion(0, 2);
83
+ textEntryMathPage.steps.verifyPointsDisplayedOnResponseAccordion(1, 2);
84
+ });
85
+
86
+ it('When the user adds one more response token, then points per response should get updated accordingly', () => {
87
+ textEntryMathPage.steps.addResponseToken();
88
+ textEntryMathPage.steps.verifyPointsDisplayedOnResponseAccordion(0, 1.33);
89
+ textEntryMathPage.steps.verifyPointsDisplayedOnResponseAccordion(1, 1.33);
90
+ textEntryMathPage.steps.verifyPointsDisplayedOnResponseAccordion(2, 1.33);
91
+ });
92
+
93
+ it('When the user deletes a response token, then points per response should get updated accordingly', () => {
94
+ textEntryMathPage.steps.deleteAResponseToken(0);
95
+ textEntryMathPage.steps.verifyPointsDisplayedOnResponseAccordion(0, 2);
96
+ textEntryMathPage.steps.verifyPointsDisplayedOnResponseAccordion(1, 2);
97
+ });
98
+
99
+ it('When user adds and alternate answer field in a response accordion, then the points per response accordion should not be updated', () => {
100
+ textEntryMathPage.steps.expandResponseAccordionSpecifyCorrectAnswer(0);
101
+ textEntryMathPage.steps.addAlternateAnswerInResponseAccordion(0);
102
+ textEntryMathPage.steps.verifyPointsDisplayedOnResponseAccordion(0, 2);
103
+ textEntryMathPage.steps.verifyPointsDisplayedOnResponseAccordion(1, 2);
104
+ });
105
+
106
+ it('When the user switches to \'All or nothing\' scoring, then the points on each response accordion should not be displayed a and the points displayed in \'Points\' input field should remain unchanged', () => {
107
+ textEntryMathPage.steps.selectAutoScoredScoringSubtype('All or nothing');
108
+ utilities.verifyElementVisibilityState(textEntryMathPage.responseAccordionPointsWrapper(), 'notExist');
109
+ textEntryMathPage.steps.verifyPointsFieldValue(4);
110
+ });
111
+
112
+ it('When the user updates the entered points in \'All or nothing\' scoring type and switches to \'Partial equal weights\' scoring type, then the points should be equally divided and displayed on each response accordion', () => {
113
+ textEntryMathPage.steps.allotPoints(9);
114
+ textEntryMathPage.steps.selectAutoScoredScoringSubtype('Partial equal weights');
115
+ textEntryMathPage.steps.verifyPointsDisplayedOnResponseAccordion(0, 4.5);
116
+ textEntryMathPage.steps.verifyPointsDisplayedOnResponseAccordion(1, 4.5);
117
+ });
118
+
119
+ it('CSS of \'Points:\' label and its displayed score', { tags: 'css' }, () => {
120
+ utilities.verifyCSS(textEntryMathPage.responseAccordionPointsLabel(), {
121
+ 'color': css.color.labels,
122
+ 'font-size': css.fontSize.normal,
123
+ 'font-weight': css.fontWeight.semibold
124
+ });
125
+ utilities.verifyCSS(textEntryMathPage.responseAccordionPointsScore(), {
126
+ 'color': css.color.text,
127
+ 'font-size': css.fontSize.default,
128
+ 'font-weight': css.fontWeight.regular
129
+ });
130
+ });
131
+ });
132
+
133
+ describe('Auto scored: Partial - different weights scoring - Scoring section', () => {
134
+ abortEarlySetup();
135
+ before(() => {
136
+ textEntryMathPage.steps.navigateToCreateQuestion('Text Entry Math');
137
+ cy.barsPreLoaderWait();
138
+ });
139
+
140
+ it('User should be able to select \'Partial - different weights\' scoring', () => {
141
+ textEntryMathPage.steps.selectAutoScoredScoringSubtype('Partial different weights');
142
+ });
143
+
144
+ it('When the user has switched to \'Partial - different weights\' scoring, then \'Penalty scoring\', \'Minimum scoring\' and \'Rounding\' labels and dropdowns, \'Round negative scores to zero\' label and checkbox should not be displayed in the \'Scoring\' section', () => {
145
+ textEntryMathPage.steps.verifyMinimumScoringLabelAndDropdownDefaultState();
146
+ textEntryMathPage.steps.verifyPenaltyPointsLabelAndDropdownDefaultState();
147
+ textEntryMathPage.steps.verifyRoundingLabelAndDropdownDefaultState();
148
+ utilities.verifyElementVisibilityState(textEntryMathPage.roundNegativeScoresToZeroCheckbox(), 'notExist');
149
+ });
150
+ });
151
+
152
+ describe('Auto scored: Partial - different weights scoring - Specify correct answer section', () => {
153
+ abortEarlySetup();
154
+ before(() => {
155
+ textEntryMathPage.steps.navigateToCreateQuestion('Text Entry Math');
156
+ cy.barsPreLoaderWait();
157
+ textEntryMathPage.steps.selectAutoScoredScoringSubtype('Partial different weights');
158
+ });
159
+
160
+ textEntryMathPage.tests.verifyContentsOfSpecifyCorrectAnswerSection();
161
+
162
+ it('When the user has switched to \'Partial - different weights\' scoring, then the correct answer tab points input field should not be displayed and individual empty points input field should be displayed in each response accordion', () => {
163
+ utilities.verifyElementVisibilityState(textEntryMathPage.pointsLabel(), 'hidden');
164
+ cy.log('Expand response accordions')
165
+ textEntryMathPage.steps.expandResponseAccordionSpecifyCorrectAnswer(0);
166
+ textEntryMathPage.steps.expandResponseAccordionSpecifyCorrectAnswer(1);
167
+ textEntryMathPage.steps.verifyPointsLabelAndInputFieldInResponseAccordion(0, '');
168
+ textEntryMathPage.steps.verifyPointsLabelAndInputFieldInResponseAccordion(1, '');
169
+ utilities.verifyElementCount(textEntryMathPage.pointsInputField(), 2);
170
+ });
171
+
172
+ it('User should be able to set points in the \'Points\' input fields', () => {
173
+ textEntryMathPage.steps.allotPointsInResponseAccordion(0, 1);
174
+ textEntryMathPage.steps.allotPointsInResponseAccordion(1, 3);
175
+ textEntryMathPage.steps.verifyPointsLabelAndInputFieldInResponseAccordion(0, 1);
176
+ textEntryMathPage.steps.verifyPointsLabelAndInputFieldInResponseAccordion(1, 3);
177
+ });
178
+
179
+ it('CSS of \'Points\' label and \'Points\' input field in response accordion', { tags: 'css' }, () => {
180
+ utilities.verifyCSS(utilities.getNthElement(textEntryMathPage.pointsLabel(), 0), {
181
+ 'color': css.color.labels,
182
+ 'font-size': css.fontSize.normal,
183
+ 'font-weight': css.fontWeight.semibold
184
+ });
185
+ utilities.verifyCSS(utilities.getNthElement(textEntryMathPage.pointsInputField(), 0), {
186
+ 'color': css.color.text,
187
+ 'font-size': css.fontSize.default,
188
+ 'font-weight': css.fontWeight.regular
189
+ });
190
+ });
191
+
192
+ it('When the user switches to \'All or nothing\' scoring, the points added for individual responses in Partial - different weights scoring should get summed up in the \'All or nothing scoring\' points input field', () => {
193
+ textEntryMathPage.steps.selectAutoScoredScoringSubtype('All or nothing');
194
+ textEntryMathPage.steps.verifyPointsFieldValue(4);
195
+ });
196
+
197
+ it('When the user updates the entered points in \'All or nothing\' scoring type and switches to \'Partial different weights\' scoring type, then the points should be equally divided and displayed besides each correct option', () => {
198
+ textEntryMathPage.steps.allotPoints(9);
199
+ textEntryMathPage.steps.selectAutoScoredScoringSubtype('Partial different weights');
200
+ textEntryMathPage.steps.verifyPointsLabelAndInputFieldInResponseAccordion(0, 4.5);
201
+ textEntryMathPage.steps.verifyPointsLabelAndInputFieldInResponseAccordion(1, 4.5);
202
+ });
203
+ });
204
+
205
+ describe('Manually scored scoring - Scoring section', () => {
206
+ abortEarlySetup();
207
+ before(() => {
208
+ textEntryMathPage.steps.navigateToCreateQuestion('Text Entry Math');
209
+ cy.barsPreLoaderWait();
210
+ });
211
+
212
+ it('User should be able to select \'Manually scored\' scoring type from scoring type dropdown', () => {
213
+ textEntryMathPage.steps.expandScoringTypeDropdown();
214
+ textEntryMathPage.steps.selectOptionFromScoringTypeDropdown('Manually scored');
215
+ });
216
+
217
+ it('When the user has selected \'Manually scored\' scoring type, then the specify correct answer section should not be displayed', () => {
218
+ utilities.verifyElementVisibilityState(textEntryMathPage.specifyCorrectAnswerLabel(), 'notExist');
219
+ utilities.verifyElementVisibilityState(textEntryMathPage.specifyCorrectAnswerSectionWrapper(), 'notExist');
220
+ });
221
+
222
+ textEntryMathPage.tests.verifyScoringSectionContentsForManuallyScoredScoringType();
223
+
224
+ textEntryMathPage.tests.verifyPointsFieldErrorState();
225
+
226
+ it('When user has selected \'Manually scored\' scoring type, then in scoring section \'Minimum scoring\' label and dropdown should be visible', () => {
227
+ textEntryMathPage.steps.verifyMinimumScoringLabelAndDropdownDefaultState();
228
+ });
229
+ });
230
+
231
+ describe('Non scored scoring - Scoring section', () => {
232
+ abortEarlySetup();
233
+ before(() => {
234
+ textEntryMathPage.steps.navigateToCreateQuestion('Text Entry Math');
235
+ cy.barsPreLoaderWait();
236
+ });
237
+
238
+ it('User should be able to select \'Non scored\' scoring type from scoring type dropdown', () => {
239
+ textEntryMathPage.steps.expandScoringTypeDropdown();
240
+ textEntryMathPage.steps.selectOptionFromScoringTypeDropdown('Non scored');
241
+ });
242
+
243
+ textEntryMathPage.tests.verifyScoringSectionContentsForNonScoredScoringType();
244
+ });
245
+
246
+ describe('Non scored scoring - Specify correct answer section', () => {
247
+ abortEarlySetup();
248
+ before(() => {
249
+ textEntryMathPage.steps.navigateToCreateQuestion('Text Entry Math');
250
+ cy.barsPreLoaderWait();
251
+ textEntryMathPage.steps.expandScoringTypeDropdown();
252
+ textEntryMathPage.steps.selectOptionFromScoringTypeDropdown('Non scored');
253
+ });
254
+
255
+ textEntryMathPage.tests.verifyContentsOfSpecifyCorrectAnswerSection();
256
+
257
+ textEntryMathPage.tests.verifyPointsLabelAndInputFieldForNonScoredScoringType();
258
+ });
259
+ });
@@ -0,0 +1,202 @@
1
+ import { textEntryMathPage } from "../../../pages";
2
+ import abortEarlySetup from "../../../support/helpers/abortEarly";
3
+ import utilities from "../../../support/helpers/utilities";
4
+ const css = Cypress.env('css');
5
+ const penaltyScoringTypeArray = ['No penalty points', 'Penalty points for the entire question', 'Penalty points for each incorrect option'];
6
+
7
+ describe('Create item page - Text entry math: Minimum scoring, Penalty scoring, Rounding - Edit tab', () => {
8
+ before(() => {
9
+ cy.loginAs('admin');
10
+ });
11
+
12
+ describe('Scoring section: Minimum scoring - Edit tab', () => {
13
+ abortEarlySetup();
14
+ before(() => {
15
+ textEntryMathPage.steps.navigateToCreateQuestion('Text Entry Math');
16
+ cy.barsPreLoaderWait();
17
+ textEntryMathPage.steps.allotPoints(10);
18
+ });
19
+
20
+ textEntryMathPage.tests.verifyMinimumScoringDropdown();
21
+
22
+ textEntryMathPage.tests.verifyMinimumPointsLabelAndInputField();
23
+
24
+ textEntryMathPage.tests.verifyMinimumPointsFieldErrorState();
25
+ });
26
+
27
+ describe('Scoring section: Penalty scoring - Edit tab', () => {
28
+ abortEarlySetup();
29
+ before(() => {
30
+ textEntryMathPage.steps.navigateToCreateQuestion('Text Entry Math');
31
+ cy.barsPreLoaderWait();
32
+ textEntryMathPage.steps.allotPoints(10);
33
+ textEntryMathPage.steps.expandResponseAccordionSpecifyCorrectAnswer(0);
34
+ textEntryMathPage.steps.expandResponseAccordionSpecifyCorrectAnswer(1);
35
+ textEntryMathPage.steps.addInputToResponseAnswerInputFieldSpecifyCorrectAnswer(0, 'a+b');
36
+ textEntryMathPage.steps.addInputToResponseAnswerInputFieldSpecifyCorrectAnswer(1, 'a-b');
37
+ textEntryMathPage.steps.selectAutoScoredScoringSubtype('Partial equal weights');
38
+ });
39
+
40
+ textEntryMathPage.tests.verifyPenaltyScoringDropdown(penaltyScoringTypeArray);
41
+
42
+ textEntryMathPage.tests.verifyPenaltyPointsLabelAndInputField();
43
+
44
+ textEntryMathPage.tests.verifyPenaltyPointsErrorState();
45
+
46
+ it('When the user selects \'Penalty points for each incorrect option\' from the penalty scoring dropdown, \'Automatically set penalty for each incorrect option to total points / no. of incorrect options\' label and checkbox should be displayed, by default the checkbox should be unchecked. Two radio buttons with labels - \'Specify total penalty points\' and \'Specify points for each incorrect option\' should be displayed. By default, \'Specify total penalty points\' radio button should be checked', () => {
47
+ textEntryMathPage.steps.expandPenaltyScoringDropdown();
48
+ textEntryMathPage.steps.selectOptionFromPenaltyScoringDropdown('Penalty points for each incorrect option');
49
+ utilities.verifyInnerText(textEntryMathPage.automaticallySetPenaltyPointsCheckboxLabel(), 'Automatically set penalty for each incorrect option to total points / no. of incorrect options');
50
+ utilities.verifyInnerText(textEntryMathPage.specifyTotalPenaltyPointsRadioButtonLabel(), 'Specify total penalty points');
51
+ utilities.verifyInnerText(textEntryMathPage.specifyPointsForEachIncorrectOptionRadioButtonLabel(), 'Specify points for each incorrect option');
52
+ textEntryMathPage.steps.verifyAutomaticallySetPenaltyPointsCheckboxUncheckedState();
53
+ textEntryMathPage.steps.verifySpecifyTotalPenaltyPointsRadioButtonCheckedState();
54
+ textEntryMathPage.steps.verifySpecifyPointsForEachIncorrectOptionRadioButtonUncheckedState();
55
+ });
56
+
57
+ it('When \'Specify total penalty points\' is selected, a penalty points detail section with \'Total penalty points\' label and empty input field, \'Penalty points for each incorrect option: -\' label should be displayed', () => {
58
+ utilities.verifyInnerText(textEntryMathPage.penaltyPointsDetailsSectionInputFieldLabel(), 'Total penalty points');
59
+ textEntryMathPage.steps.verifyTotalPenaltyPointsValue('');
60
+ utilities.verifyInnerText(textEntryMathPage.penaltyPointsDetailsSectionAllottedPointsLabel(), 'Penalty points for each incorrect option: -');
61
+ });
62
+
63
+ it('When the user allots total penalty points, then \'points for each incorrect option\' should get updated as per the count of incorrect options available', () => {
64
+ textEntryMathPage.steps.allotTotalPenaltyPoints(5);
65
+ textEntryMathPage.steps.verifyPenaltyPointsForEachIncorrectOption(2.5);
66
+ });
67
+
68
+ it('When the user adds a new option, then \'points for each incorrect option\' should get updated accordingly', () => {
69
+ textEntryMathPage.steps.addResponseToken();
70
+ textEntryMathPage.steps.expandResponseAccordionSpecifyCorrectAnswer(2);
71
+ textEntryMathPage.steps.addInputToResponseAnswerInputFieldSpecifyCorrectAnswer(2, 'a*b');
72
+ textEntryMathPage.steps.verifyPenaltyPointsForEachIncorrectOption(1.67);
73
+ });
74
+
75
+ it('When the user deletes an option, then \'points for each incorrect option\' should get updated accordingly', () => {
76
+ textEntryMathPage.steps.deleteAResponseToken(0);
77
+ textEntryMathPage.steps.verifyPenaltyPointsForEachIncorrectOption(2.5);
78
+ });
79
+
80
+ it('CSS of the penalty points section - Total penalty points', { tags: 'css' }, () => {
81
+ utilities.verifyCSS(textEntryMathPage.automaticallySetPenaltyPointsCheckboxLabel(), {
82
+ 'color': css.color.labelText,
83
+ 'font-size': css.fontSize.default,
84
+ 'font-weight': css.fontWeight.regular
85
+ });
86
+ utilities.verifyCSS(textEntryMathPage.automaticallySetPenaltyPointsCheckbox().parent().find('svg'), {
87
+ 'fill': css.color.uncheckedCheckbox
88
+ });
89
+ utilities.verifyCSS(textEntryMathPage.specifyTotalPenaltyPointsRadioButton().parent().find('svg'), {
90
+ 'fill': css.color.activeButtons
91
+ });
92
+ utilities.verifyCSS(textEntryMathPage.specifyPointsForEachIncorrectOptionRadioButton().parent().find('svg'), {
93
+ 'fill': css.color.uncheckedCheckbox
94
+ });
95
+ utilities.verifyCSS(textEntryMathPage.specifyTotalPenaltyPointsRadioButtonLabel(), {
96
+ 'color': css.color.labelText,
97
+ 'font-size': css.fontSize.default,
98
+ 'font-weight': css.fontWeight.regular
99
+ });
100
+ utilities.verifyCSS(textEntryMathPage.specifyPointsForEachIncorrectOptionRadioButtonLabel(), {
101
+ 'color': css.color.labelText,
102
+ 'font-size': css.fontSize.default,
103
+ 'font-weight': css.fontWeight.regular
104
+ });
105
+ utilities.verifyCSS(textEntryMathPage.penaltyPointsDetailsSectionInputFieldLabel(), {
106
+ 'color': css.color.labelText,
107
+ 'font-size': css.fontSize.default,
108
+ 'font-weight': css.fontWeight.regular
109
+ });
110
+ utilities.verifyCSS(textEntryMathPage.totalPenaltyPointsInputField(), {
111
+ 'color': css.color.text,
112
+ 'font-size': css.fontSize.default,
113
+ 'font-weight': css.fontWeight.regular
114
+ });
115
+ utilities.verifyCSS(textEntryMathPage.penaltyPointsDetailsSectionAllottedPointsLabel(), {
116
+ 'color': css.color.labelText,
117
+ 'font-size': css.fontSize.default,
118
+ 'font-weight': css.fontWeight.regular
119
+ });
120
+ });
121
+
122
+ it('Accessibility of the penalty points section - Total penalty points', { tags: 'a11y' }, () => {
123
+ cy.checkAccessibility(textEntryMathPage.automaticallySetPenaltyPointsCheckboxLabel().parents('.penalty-score-for-each-incorrect-wrapper'));
124
+ });
125
+
126
+ it('When the user selects \'Specify points for each incorrect answer\', a penalty points detail section with \'Penalty points for each incorrect option:\' label and empty input field, \'Total penalty points: -\' label should be displayed', () => {
127
+ cy.log('Pre-step: Clearing the total penalty points input field')
128
+ textEntryMathPage.steps.clearTotalPenaltyPointsInputField();
129
+ textEntryMathPage.steps.selectPenaltyPointsForEachIncorrectOptionType('Specify points for each incorrect option');
130
+ utilities.verifyInnerText(textEntryMathPage.penaltyPointsDetailsSectionInputFieldLabel(), 'Penalty points for each incorrect option');
131
+ textEntryMathPage.steps.verifyPenaltyPointsForEachIncorrectOptionValue('');
132
+ utilities.verifyInnerText(textEntryMathPage.penaltyPointsDetailsSectionAllottedPointsLabel(), 'Total penalty points: -');
133
+ });
134
+
135
+ it('When the user allots penalty points for each incorrect option, then \'Total penalty points\' should get updated as per the count of incorrect options available', () => {
136
+ textEntryMathPage.steps.allotPenaltyPointsForEachIncorrectOption(1);
137
+ textEntryMathPage.steps.verifyTotalPenaltyPoints(2);
138
+ });
139
+
140
+ it('When the user adds a new option, then \'Total penalty points\' should get updated accordingly', () => {
141
+ textEntryMathPage.steps.addResponseToken();
142
+ textEntryMathPage.steps.expandResponseAccordionSpecifyCorrectAnswer(2);
143
+ textEntryMathPage.steps.addInputToResponseAnswerInputFieldSpecifyCorrectAnswer(2, 'a*b');
144
+ textEntryMathPage.steps.verifyTotalPenaltyPoints(3);
145
+ });
146
+
147
+ it('When the user deletes an option, then \'points for each incorrect option\' should get updated accordingly', () => {
148
+ textEntryMathPage.steps.deleteAResponseToken(0);
149
+ textEntryMathPage.steps.verifyTotalPenaltyPoints(2);
150
+ });
151
+
152
+ it('CSS of the penalty points section - Penalty points for each incorrect option', { tags: 'css' }, () => {
153
+ utilities.verifyCSS(textEntryMathPage.penaltyPointsDetailsSectionInputFieldLabel(), {
154
+ 'color': css.color.labelText,
155
+ 'font-size': css.fontSize.default,
156
+ 'font-weight': css.fontWeight.regular
157
+ });
158
+ utilities.verifyCSS(textEntryMathPage.penaltyPointsForEachIncorrectOptionInputField(), {
159
+ 'color': css.color.text,
160
+ 'font-size': css.fontSize.default,
161
+ 'font-weight': css.fontWeight.regular
162
+ });
163
+ utilities.verifyCSS(textEntryMathPage.penaltyPointsDetailsSectionAllottedPointsLabel(), {
164
+ 'color': css.color.labelText,
165
+ 'font-size': css.fontSize.default,
166
+ 'font-weight': css.fontWeight.regular
167
+ });
168
+ });
169
+
170
+ it('Accessibility of the penalty points section - Penalty points for each incorrect option', { tags: 'a11y' }, () => {
171
+ cy.checkAccessibility(textEntryMathPage.automaticallySetPenaltyPointsCheckboxLabel().parents('.penalty-score-for-each-incorrect-wrapper'));
172
+ });
173
+
174
+ it('When the user switches to the \'Specify total penalty points\' option, the total penalty points input field should be filled as per the total penalty points in \'Specify points for each incorrect option\'', () => {
175
+ textEntryMathPage.steps.selectPenaltyPointsForEachIncorrectOptionType('Specify total penalty points');
176
+ textEntryMathPage.steps.verifyTotalPenaltyPointsValue(2);
177
+ utilities.verifyInnerText(textEntryMathPage.penaltyPointsDetailsSectionAllottedPointsLabel(), 'Penalty points for each incorrect option: 1');
178
+ });
179
+
180
+ it('When the user checks the \'Automatically set penalty for each incorrect option to total points / no. of incorrect options\' checkbox, both radio buttons should get disabled, \'Specify points for each incorrect option\' should get checked, in the penalty points details section, \'Penalty points for each incorrect option: #\' and \'Total penalty points: #\' should be displayed as per the alloted points and available incorrect options', () => {
181
+ textEntryMathPage.steps.checkAutomaticallySetPenaltyPointsCheckbox();
182
+ textEntryMathPage.steps.verifySpecifyTotalPenaltyPointsDisabledState();
183
+ textEntryMathPage.steps.verifySpecifyPointsForEachIncorrectOptionRadioButtonSelectedAndDisabledState();
184
+ utilities.verifyInnerText(utilities.getNthElement(textEntryMathPage.penaltyPointsDetailsSectionAllottedPointsLabel(), 0), 'Penalty points for each incorrect option: 5');
185
+ utilities.verifyInnerText(utilities.getNthElement(textEntryMathPage.penaltyPointsDetailsSectionAllottedPointsLabel(), 1), 'Total penalty points: 10');
186
+ });
187
+ });
188
+
189
+ describe('Scoring section: Rounding - Edit tab', () => {
190
+ abortEarlySetup();
191
+ before(() => {
192
+ textEntryMathPage.steps.navigateToCreateQuestion('Text Entry Math');
193
+ cy.barsPreLoaderWait();
194
+ textEntryMathPage.steps.allotPoints(10);
195
+ textEntryMathPage.steps.selectAutoScoredScoringSubtype('Partial equal weights')
196
+ });
197
+
198
+ textEntryMathPage.tests.verifyRoundingDropdown();
199
+
200
+ textEntryMathPage.tests.verifyRoundNegativeScoreToZeroLabelAndCheckbox();
201
+ });
202
+ });