itemengine-cypress-automation 1.0.209 → 1.0.210

Sign up to get free protection for your applications and to get access to all the features.
Files changed (25) hide show
  1. package/cypress/e2e/ILC/ChartsBar/additionalSettings.js +159 -0
  2. package/cypress/e2e/ILC/ChartsBar/editTabScoringSection.js +203 -0
  3. package/cypress/e2e/ILC/ChartsBar/minimumScoringPenaltyPointsAndRoundingDropdown.js +199 -0
  4. package/cypress/e2e/ILC/ChartsBar/questionInstruction.js +29 -0
  5. package/cypress/e2e/ILC/ChartsBar/specifyCorrectAnswerSection.js +2 -1
  6. package/cypress/e2e/ILC/ChartsLine/additionalSettings.js +153 -0
  7. package/cypress/e2e/ILC/ChartsLine/editTabScoringSection.js +210 -0
  8. package/cypress/e2e/ILC/ChartsLine/headerSection.js +109 -0
  9. package/cypress/e2e/ILC/ChartsLine/minimumScoringPenaltyPointsAndRoundingDropdown.js +200 -0
  10. package/cypress/e2e/ILC/ChartsLine/questionInstruction.js +31 -0
  11. package/cypress/e2e/ILC/ChartsLine/specifyCorrectAnswerSection.js +93 -0
  12. package/cypress/e2e/ILC/ChartsLine/toolSettings.js +77 -0
  13. package/cypress/e2e/ILC/FeedbackScaleNew/previewContentsForAllViews.smoke.js +1 -0
  14. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/previewContentsForAllViews.smoke.js +3 -1
  15. package/cypress/e2e/ILC/ImageHighlight/previewContentsForAllViews.smoke.js +28 -9
  16. package/cypress/e2e/ILC/chartsDotsPlot/editTabScoring.js +6 -6
  17. package/cypress/pages/chartsBarPage.js +31 -4
  18. package/cypress/pages/chartsDotPlotPage.js +0 -19
  19. package/cypress/pages/chartsLinePage.js +209 -3
  20. package/cypress/pages/components/autoScoredScoringSectionMultiResponseType.js +1 -0
  21. package/cypress/pages/components/barAndLineChartComponent.js +2 -1
  22. package/cypress/pages/components/chartsCommonComponent.js +18 -0
  23. package/cypress/pages/components/gridQuestionCommonComponent.js +11 -3
  24. package/cypress/pages/feedbackScalePage.js +2 -1
  25. package/package.json +1 -1
@@ -0,0 +1,159 @@
1
+ import { chartsBarPage } from "../../../pages";
2
+ import abortEarlySetup from "../../../support/helpers/abortEarly";
3
+ import utilities from "../../../support/helpers/utilities";
4
+ const css = Cypress.env('css');
5
+
6
+ const fontSizes = { 'Tiny': '12px', 'Small': '14px', 'Default': '16px', 'Normal': '18px', 'Big': '22px', 'Huge': '26px' };
7
+
8
+ describe('Create Item page : Charts - Line : Additional settings', () => {
9
+ before(() => {
10
+ cy.loginAs('admin');
11
+ });
12
+
13
+ describe('Additional Settings accordion', () => {
14
+ abortEarlySetup();
15
+ before(() => {
16
+ chartsBarPage.steps.navigateToCreateQuestion('charts');
17
+ cy.barsPreLoaderWait();
18
+ });
19
+
20
+ chartsBarPage.tests.verifyAdditionalSettingsAccordionProperties();
21
+ });
22
+
23
+ describe('Additional settings: Font size contents', () => {
24
+ abortEarlySetup();
25
+ before(() => {
26
+ chartsBarPage.steps.navigateToCreateQuestion('charts');
27
+ cy.barsPreLoaderWait();
28
+ chartsBarPage.steps.expandAdditionalSettings();
29
+ });
30
+
31
+ chartsBarPage.tests.verifyFontSizeSectionContents();
32
+ });
33
+
34
+ describe('Additional settings: Font size - Select chart type and Specify correct answer section', () => {
35
+ abortEarlySetup();
36
+ before(() => {
37
+ chartsBarPage.steps.navigateToCreateQuestion('charts');
38
+ cy.barsPreLoaderWait();
39
+ chartsBarPage.steps.addQuestionInstructions();
40
+ chartsBarPage.steps.allotPoints(10);
41
+ chartsBarPage.steps.expandAdditionalSettings();
42
+ });
43
+
44
+ Object.keys(fontSizes).forEach((option) => {
45
+ it(`When the user selects \'${option}\' option from the Font Size dropdown, then font size of the specify correct answer section should change to ${fontSizes[option]} accordingly`, () => {
46
+ chartsBarPage.steps.selectFontSizeOptionFromFontSizeDropdown(option);
47
+ utilities.verifyInnerText(chartsBarPage.fontSizeDropdown(), `${option}`);
48
+ utilities.verifyCSS(chartsBarPage.specifyCorrectAnswerBarLabel(), {
49
+ 'font-size': css.fontSize.default
50
+ });
51
+ utilities.verifyCSS(chartsBarPage.selectChartTypeBarLabel(), {
52
+ 'font-size': css.fontSize.default
53
+ });
54
+ utilities.verifyCSS(chartsBarPage.yAxisCoordinate(), {
55
+ 'font-size': css.fontSize.default
56
+ });
57
+ utilities.verifyCSS(chartsBarPage.yAxisCoordinateSpecifyCorrectAnswer(), {
58
+ 'font-size': css.fontSize.default
59
+ });
60
+ utilities.verifyCSS(chartsBarPage.selectChartTypeGraphTitleButton(), {
61
+ 'font-size': fontSizes[option]
62
+ });
63
+ utilities.verifyCSS(chartsBarPage.selectChartTypeXAxisLabelButton(), {
64
+ 'font-size': fontSizes[option]
65
+ });
66
+ utilities.verifyCSS(chartsBarPage.selectChartTypeYAxisLabelButton(), {
67
+ 'font-size': fontSizes[option]
68
+ });
69
+ utilities.verifyCSS(chartsBarPage.graphTitleSpecifyCorrectAnswer(), {
70
+ 'font-size': fontSizes[option]
71
+ });
72
+ utilities.verifyCSS(chartsBarPage.xAxisLabelSpecifyCorrectAnswer(), {
73
+ 'font-size': fontSizes[option]
74
+ });
75
+ utilities.verifyCSS(chartsBarPage.yAxisLabelSpecifyCorrectAnswer(), {
76
+ 'font-size': fontSizes[option]
77
+ });
78
+ });
79
+ });
80
+ });
81
+
82
+ describe('Additional settings: Font size - preview tab', () => {
83
+ abortEarlySetup();
84
+ before(() => {
85
+ chartsBarPage.steps.navigateToCreateQuestion('charts');
86
+ cy.barsPreLoaderWait();
87
+ chartsBarPage.steps.addQuestionInstructions();
88
+ chartsBarPage.steps.setBarValueInSelectChartTypeSection({ barIndex: 0, value: 1, range: 10 });
89
+ chartsBarPage.steps.allotPoints(10);
90
+ chartsBarPage.steps.expandAdditionalSettings();
91
+ });
92
+
93
+ Object.keys(fontSizes).forEach((option) => {
94
+ it(`When the user selects \'${option}\' option from the Font Size dropdown, then font size of the preview tab should change to ${fontSizes[option]} accordingly`, () => {
95
+ chartsBarPage.steps.selectFontSizeOptionFromFontSizeDropdown(option);
96
+ utilities.verifyInnerText(chartsBarPage.fontSizeDropdown(), `${option}`);
97
+ chartsBarPage.steps.switchToPreviewTab();
98
+ utilities.verifyCSS(chartsBarPage.questionInstructionsText(), {
99
+ 'font-size': fontSizes[option]
100
+ });
101
+ utilities.verifyCSS(chartsBarPage.previewTabBarLabel(), {
102
+ 'font-size': css.fontSize.default
103
+ });
104
+ utilities.verifyCSS(chartsBarPage.previewTabYAxisCoordinate(), {
105
+ 'font-size': css.fontSize.default
106
+ });
107
+ utilities.verifyCSS(chartsBarPage.previewTabGraphTitle(), {
108
+ 'font-size': fontSizes[option]
109
+ });
110
+ utilities.verifyCSS(chartsBarPage.previewTabXAxisLabelButton(), {
111
+ 'font-size': fontSizes[option]
112
+ });
113
+ utilities.verifyCSS(chartsBarPage.previewTabYAxisLabelButton(), {
114
+ 'font-size': fontSizes[option]
115
+ });
116
+ chartsBarPage.steps.switchToGradingView();
117
+ utilities.verifyCSS(chartsBarPage.graphTitleCorrectAnswerSection(), {
118
+ 'font-size': fontSizes[option]
119
+ });
120
+ utilities.verifyCSS(chartsBarPage.xAxisLabelCorrectAnswerSection(), {
121
+ 'font-size': fontSizes[option]
122
+ });
123
+ utilities.verifyCSS(chartsBarPage.yAxisLabelCorrectAnswerSection(), {
124
+ 'font-size': fontSizes[option]
125
+ });
126
+ utilities.verifyCSS(chartsBarPage.correctAnswersLabel(), {
127
+ 'font-size': fontSizes[option]
128
+ });
129
+ utilities.verifyCSS(chartsBarPage.correctIncorrectStatusMessageText(), {
130
+ 'font-size': fontSizes[option]
131
+ });
132
+ chartsBarPage.steps.switchToStudentView();
133
+ chartsBarPage.steps.switchToEditTab();
134
+ });
135
+ });
136
+ });
137
+
138
+ describe('Setting tab: Accessibility section', () => {
139
+ abortEarlySetup();
140
+ before(() => {
141
+ chartsBarPage.steps.navigateToCreateQuestion('charts');
142
+ cy.barsPreLoaderWait();
143
+ chartsBarPage.steps.expandAdditionalSettings();
144
+ });
145
+
146
+ chartsBarPage.tests.verifyAdditionalSettingsAccessibilitySection();
147
+ });
148
+
149
+ describe('Additional Settings: Details section', () => {
150
+ abortEarlySetup();
151
+ before(() => {
152
+ chartsBarPage.steps.navigateToCreateQuestion('charts');
153
+ cy.barsPreLoaderWait();
154
+ chartsBarPage.steps.expandAdditionalSettings();
155
+ });
156
+
157
+ chartsBarPage.tests.verifyDetailsSection();
158
+ });
159
+ });
@@ -0,0 +1,203 @@
1
+ import { chartsBarPage } 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 - Charts - Bar: Scoring section', () => {
7
+ before(() => {
8
+ cy.loginAs('admin');
9
+ });
10
+
11
+ describe('Scoring section contents', () => {
12
+ abortEarlySetup();
13
+ before(() => {
14
+ chartsBarPage.steps.navigateToCreateQuestion('charts');
15
+ cy.barsPreLoaderWait();
16
+ });
17
+
18
+ chartsBarPage.tests.verifyScoringTypeLabelAndDropdown('Auto scored');
19
+
20
+ chartsBarPage.tests.verifyScoringSubtypeContentsForMultipleResponseTypeQuestion();
21
+ });
22
+
23
+ describe('Auto scored: All or nothing scoring - Scoring section', () => {
24
+ abortEarlySetup();
25
+ before(() => {
26
+ chartsBarPage.steps.navigateToCreateQuestion('charts');
27
+ cy.barsPreLoaderWait();
28
+ chartsBarPage.steps.allotPoints(10);
29
+ });
30
+
31
+ it('When the user has selected \'All or nothing\' scoring subtype, minimum scoring dropdown and penalty scoring dropdown should be displayed in the scoring section', () => {
32
+ chartsBarPage.steps.verifyMinimumScoringLabelAndDropdownDefaultState();
33
+ chartsBarPage.steps.verifyPenaltyPointsLabelAndDropdownDefaultState();
34
+ });
35
+
36
+ chartsBarPage.tests.verifyToleranceThresholdLabelAndInputField();
37
+ });
38
+
39
+ describe('Auto scored: All or nothing scoring - Specify correct answer section', () => {
40
+ abortEarlySetup();
41
+ before(() => {
42
+ chartsBarPage.steps.navigateToCreateQuestion('charts');
43
+ cy.barsPreLoaderWait();
44
+ chartsBarPage.steps.addTextInQuestionInstructionsInputField('Bar');
45
+ });
46
+
47
+ chartsBarPage.tests.verifyContentsOfSpecifyCorrectAnswerSection();
48
+
49
+ chartsBarPage.tests.verifyPointsLabelAndInputField();
50
+ });
51
+
52
+ describe('Auto scored: Partial - equal weights scoring - Scoring section', () => {
53
+ abortEarlySetup();
54
+ before(() => {
55
+ chartsBarPage.steps.navigateToCreateQuestion('charts');
56
+ cy.barsPreLoaderWait();
57
+ chartsBarPage.steps.addTextInQuestionInstructionsInputField('Bar');
58
+ });
59
+
60
+ it('User should be able to select \'Partial - equal weights\' scoring type', () => {
61
+ chartsBarPage.steps.selectAutoScoredScoringSubtype('Partial equal weights');
62
+ });
63
+
64
+ 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', () => {
65
+ chartsBarPage.steps.verifyPointsPerResponseLabel();
66
+ chartsBarPage.steps.verifyMinimumScoringLabelAndDropdownDefaultState();
67
+ chartsBarPage.steps.verifyPenaltyPointsLabelAndDropdownDefaultState();
68
+ chartsBarPage.steps.verifyRoundingLabelAndDropdownDefaultState();
69
+ utilities.verifyElementVisibilityState(chartsBarPage.roundNegativeScoresToZeroCheckbox(), 'notExist');
70
+ });
71
+
72
+ chartsBarPage.tests.verifyToleranceThresholdLabelAndInputField();
73
+ });
74
+
75
+ describe('Auto scored: Partial equal weights scoring - Specify correct answer section', () => {
76
+ abortEarlySetup();
77
+ before(() => {
78
+ chartsBarPage.steps.navigateToCreateQuestion('charts');
79
+ cy.barsPreLoaderWait();
80
+ chartsBarPage.steps.addTextInQuestionInstructionsInputField('Bar');
81
+ chartsBarPage.steps.selectAutoScoredScoringSubtype('Partial equal weights');
82
+ });
83
+
84
+ chartsBarPage.tests.verifyContentsOfSpecifyCorrectAnswerSection();
85
+
86
+ it('\'Points per response\' label should be displayed and a \'-\' should be displayed besides each response in the \'Specify correct answer\' section', () => {
87
+ chartsBarPage.steps.verifyPointsPerResponseLabel();
88
+ });
89
+
90
+ it('When the user gives a score input to \'Points\' input field, then the score should be equally divided among the dropzone \'Points per response\' label', () => {
91
+ chartsBarPage.steps.allotPoints(12);
92
+ chartsBarPage.steps.verifyPartialEqualWeightsPointsPerResponseScore('4');
93
+ });
94
+
95
+ it('When the user adds one more bar, then points per response should get updated accordingly', () => {
96
+ chartsBarPage.steps.addBarOrPointInChartInSelectChartTypeSection();
97
+ chartsBarPage.steps.verifyPartialEqualWeightsPointsPerResponseScore('3');
98
+ });
99
+
100
+ it('When the user sets a bar value then the points per response should not be updated', () => {
101
+ chartsBarPage.steps.setBarValueInSpecifyCorrectAnswerSection({ barIndex: 0, value: 1, range: 10});
102
+ chartsBarPage.steps.verifyPartialEqualWeightsPointsPerResponseScore('3');
103
+ });
104
+
105
+ it('When the user switches to \'All or nothing\' scoring, the \'Points per response\' label and the points displayed for individual responses should not be displayed and the points displayed in \'Points\' input field should remain unchanged', () => {
106
+ chartsBarPage.steps.selectAutoScoredScoringSubtype('All or nothing');
107
+ utilities.verifyElementVisibilityState(chartsBarPage.pointsPerResponseLabel(), 'notExist');
108
+ chartsBarPage.steps.verifyPointsFieldValue(12);
109
+ });
110
+
111
+ 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 besides each correct option', () => {
112
+ chartsBarPage.steps.allotPoints(20);
113
+ chartsBarPage.steps.selectAutoScoredScoringSubtype('Partial equal weights');
114
+ chartsBarPage.steps.verifyPartialEqualWeightsPointsPerResponseScore('5');
115
+ });
116
+
117
+ it('CSS of \'Points per response\' label and its displayed score', { tags: 'css' }, () => {
118
+ utilities.verifyCSS(chartsBarPage.pointsPerResponseLabel(), {
119
+ 'color': css.color.labels,
120
+ 'font-size': css.fontSize.normal,
121
+ 'font-weight': css.fontWeight.regular
122
+ });
123
+ });
124
+ });
125
+
126
+ describe('Auto scored: Partial - different weights scoring - Scoring section', () => {
127
+ abortEarlySetup();
128
+ before(() => {
129
+ chartsBarPage.steps.navigateToCreateQuestion('charts');
130
+ cy.barsPreLoaderWait();
131
+ chartsBarPage.steps.addTextInQuestionInstructionsInputField('Bar');
132
+ });
133
+
134
+ it('User should be able to select \'Partial - different weights\' scoring', () => {
135
+ chartsBarPage.steps.selectAutoScoredScoringSubtype('Partial different weights');
136
+ });
137
+
138
+ 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', () => {
139
+ chartsBarPage.steps.verifyMinimumScoringLabelAndDropdownDefaultState();
140
+ chartsBarPage.steps.verifyPenaltyPointsLabelAndDropdownDefaultState();
141
+ chartsBarPage.steps.verifyRoundingLabelAndDropdownDefaultState();
142
+ utilities.verifyElementVisibilityState(chartsBarPage.roundNegativeScoresToZeroCheckbox(), 'notExist');
143
+ });
144
+
145
+ chartsBarPage.tests.verifyToleranceThresholdLabelAndInputField();
146
+ });
147
+
148
+ describe('Auto scored: Partial - different weights scoring - Specify correct answer section', () => {
149
+ abortEarlySetup();
150
+ before(() => {
151
+ chartsBarPage.steps.navigateToCreateQuestion('charts');
152
+ cy.barsPreLoaderWait();
153
+ chartsBarPage.steps.addTextInQuestionInstructionsInputField('Bar');
154
+ chartsBarPage.steps.selectAutoScoredScoringSubtype('Partial different weights');
155
+ });
156
+
157
+ chartsBarPage.tests.verifyContentsOfSpecifyCorrectAnswerSection();
158
+
159
+ it('When the user has switched to \'Partial - different weights\' scoring, then dot columns numeration labels should be displayed and input field should be displayed below each label', () => {
160
+ utilities.verifyInnerText(utilities.getNthElement(chartsBarPage.partialDifferentWeightsPointsInputFieldLabel(), 0), 'Bar 1');
161
+ utilities.verifyInnerText(utilities.getNthElement(chartsBarPage.partialDifferentWeightsPointsInputFieldLabel(), 1), 'Bar 2');
162
+ utilities.verifyInnerText(utilities.getNthElement(chartsBarPage.partialDifferentWeightsPointsInputFieldLabel(), 2), 'Bar 3');
163
+ utilities.verifyElementCount(chartsBarPage.partialDifferentWeightsPointsInputFieldLabel(), 3);
164
+ utilities.verifyElementCount(chartsBarPage.pointsInputField(), 3);
165
+ });
166
+
167
+ it('When user adds one more bar, then points input field should be added with the respective label', () => {
168
+ chartsBarPage.steps.addBarOrPointInChartInSelectChartTypeSection();
169
+ utilities.verifyInnerText(utilities.getNthElement(chartsBarPage.partialDifferentWeightsPointsInputFieldLabel(), 3), 'Bar 4');
170
+ utilities.verifyElementVisibilityState(utilities.getNthElement(chartsBarPage.pointsInputField(), 3), 'visible');
171
+ chartsBarPage.steps.verifyPartialDifferentWeightsPointsInputFieldIsEmpty();
172
+ });
173
+
174
+ it('User should be able to set points in the \'Points\' input fields', () => {
175
+ chartsBarPage.steps.allotPartialDifferentWeightsPoints([1, 2, 3, 4]);
176
+ });
177
+
178
+ it('CSS of \'Points\' label and \'Points\' input fields', { tags: 'css' }, () => {
179
+ utilities.verifyCSS(chartsBarPage.pointsLabel(), {
180
+ 'color': css.color.labels,
181
+ 'font-size': css.fontSize.normal,
182
+ 'font-weight': css.fontWeight.semibold
183
+ });
184
+ utilities.verifyCSS(chartsBarPage.pointsInputField(), {
185
+ 'color': css.color.text,
186
+ 'font-size': css.fontSize.default,
187
+ 'font-weight': css.fontWeight.regular
188
+ });
189
+ });
190
+
191
+ 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', () => {
192
+ chartsBarPage.steps.selectAutoScoredScoringSubtype('All or nothing');
193
+ chartsBarPage.steps.verifyPointsFieldValue(10);
194
+ });
195
+
196
+ 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', () => {
197
+ chartsBarPage.steps.allotPoints(12);
198
+ cy.wait(250)
199
+ chartsBarPage.steps.selectAutoScoredScoringSubtype('Partial different weights');
200
+ chartsBarPage.steps.verifyPartialDifferentWeightsPointsInputFieldValue([3, 3, 3, 3]);
201
+ });
202
+ });
203
+ });
@@ -0,0 +1,199 @@
1
+ import { chartsBarPage } 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 bar'];
6
+
7
+ describe('Create item page - Charts - Bar: 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
+ chartsBarPage.steps.navigateToCreateQuestion('charts');
16
+ cy.barsPreLoaderWait();
17
+ chartsBarPage.steps.allotPoints(10);
18
+ });
19
+
20
+ chartsBarPage.tests.verifyMinimumScoringDropdown();
21
+
22
+ chartsBarPage.tests.verifyMinimumPointsLabelAndInputField();
23
+
24
+ chartsBarPage.tests.verifyMinimumPointsFieldErrorState();
25
+ });
26
+
27
+ describe('Scoring section: Penalty scoring - Edit tab', () => {
28
+ abortEarlySetup();
29
+ before(() => {
30
+ chartsBarPage.steps.navigateToCreateQuestion('charts');
31
+ cy.barsPreLoaderWait();
32
+ chartsBarPage.steps.addBarOrPointInChartInSelectChartTypeSection();
33
+ chartsBarPage.steps.allotPoints(16);
34
+ chartsBarPage.steps.selectAutoScoredScoringSubtype('Partial equal weights');
35
+ });
36
+
37
+ chartsBarPage.tests.verifyPenaltyScoringDropdown(penaltyScoringTypeArray);
38
+
39
+ chartsBarPage.tests.verifyPenaltyPointsLabelAndInputField();
40
+
41
+ chartsBarPage.tests.verifyPenaltyPointsErrorState();
42
+
43
+ it('When the user selects \'Penalty points for each incorrect bar\' from the penalty scoring dropdown, \'Automatically set penalty for each incorrect bar to total points / no. of incorrect dot bars\' 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 bar\' should be displayed. By default, \'Specify total penalty points\' radio button should be checked', () => {
44
+ chartsBarPage.steps.expandPenaltyScoringDropdown();
45
+ chartsBarPage.steps.selectOptionFromPenaltyScoringDropdown('Penalty points for each incorrect bar');
46
+ utilities.verifyInnerText(chartsBarPage.automaticallySetPenaltyPointsCheckboxLabel(), 'Automatically set penalty for each incorrect bar to total points / no. of incorrect bars');
47
+ utilities.verifyInnerText(chartsBarPage.specifyTotalPenaltyPointsRadioButtonLabel(), 'Specify total penalty points');
48
+ utilities.verifyInnerText(chartsBarPage.specifyPointsForEachIncorrectOptionRadioButtonLabel(), 'Specify points for each incorrect bar');
49
+ chartsBarPage.steps.verifyAutomaticallySetPenaltyPointsCheckboxUncheckedState();
50
+ chartsBarPage.steps.verifySpecifyTotalPenaltyPointsRadioButtonCheckedState();
51
+ chartsBarPage.steps.verifySpecifyPointsForEachIncorrectOptionRadioButtonUncheckedState();
52
+ });
53
+
54
+ 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 bar: -\' label should be displayed', () => {
55
+ utilities.verifyInnerText(chartsBarPage.penaltyPointsDetailsSectionInputFieldLabel(), 'Total penalty points');
56
+ chartsBarPage.steps.verifyTotalPenaltyPointsValue('');
57
+ utilities.verifyInnerText(chartsBarPage.penaltyPointsDetailsSectionAllottedPointsLabel(), 'Penalty points for each incorrect bar: -');
58
+ });
59
+
60
+ it('When the user allots total penalty points, then \'points for each incorrect option\' should get updated as per the count of incorrect dot column available', () => {
61
+ chartsBarPage.steps.allotTotalPenaltyPoints(4);
62
+ chartsBarPage.steps.verifyPenaltyPointsForEachIncorrectBar(1);
63
+ });
64
+
65
+ it('When the user removes a bar, then \'points for each incorrect option\' should get updated accordingly', () => {
66
+ chartsBarPage.steps.setBarValueInSelectChartTypeSection({ barIndex: 0, value: 2, range: 10 }); //Not able to hover and then delete due to bar not visible
67
+ chartsBarPage.steps.deleteBarInSelectChartType(0);
68
+ chartsBarPage.steps.verifyPenaltyPointsForEachIncorrectBar(1.33);
69
+ });
70
+
71
+ it('When the user adds a bar, then \'points for each incorrect option\' should get updated accordingly', () => {
72
+ chartsBarPage.steps.addBarOrPointInChartInSelectChartTypeSection();
73
+ chartsBarPage.steps.addBarOrPointInChartInSelectChartTypeSection();
74
+ chartsBarPage.steps.verifyPenaltyPointsForEachIncorrectBar(0.8);
75
+ });
76
+
77
+ it('CSS of the penalty points section - Total penalty points', { tags: 'css' }, () => {
78
+ utilities.verifyCSS(chartsBarPage.automaticallySetPenaltyPointsCheckboxLabel(), {
79
+ 'color': css.color.labels,
80
+ 'font-size': css.fontSize.default,
81
+ 'font-weight': css.fontWeight.regular
82
+ });
83
+ utilities.verifyCSS(chartsBarPage.automaticallySetPenaltyPointsCheckbox().parent().find('svg'), {
84
+ 'fill': css.color.uncheckedCheckbox
85
+ });
86
+ utilities.verifyCSS(chartsBarPage.specifyTotalPenaltyPointsRadioButton().parent().find('svg'), {
87
+ 'fill': css.color.activeButtons
88
+ });
89
+ utilities.verifyCSS(chartsBarPage.specifyPointsForEachIncorrectOptionRadioButton().parent().find('svg path'), {
90
+ 'fill': css.color.uncheckedCheckbox
91
+ });
92
+ utilities.verifyCSS(chartsBarPage.specifyTotalPenaltyPointsRadioButtonLabel(), {
93
+ 'color': css.color.labelText,
94
+ 'font-size': css.fontSize.default,
95
+ 'font-weight': css.fontWeight.regular
96
+ });
97
+ utilities.verifyCSS(chartsBarPage.specifyPointsForEachIncorrectOptionRadioButtonLabel(), {
98
+ 'color': css.color.labelText,
99
+ 'font-size': css.fontSize.default,
100
+ 'font-weight': css.fontWeight.regular
101
+ });
102
+ utilities.verifyCSS(chartsBarPage.penaltyPointsDetailsSectionInputFieldLabel(), {
103
+ 'color': css.color.labelText,
104
+ 'font-size': css.fontSize.default,
105
+ 'font-weight': css.fontWeight.regular
106
+ });
107
+ utilities.verifyCSS(chartsBarPage.totalPenaltyPointsInputField(), {
108
+ 'color': css.color.text,
109
+ 'font-size': css.fontSize.default,
110
+ 'font-weight': css.fontWeight.regular
111
+ });
112
+ utilities.verifyCSS(chartsBarPage.penaltyPointsDetailsSectionAllottedPointsLabel(), {
113
+ 'color': css.color.labelText,
114
+ 'font-size': css.fontSize.default,
115
+ 'font-weight': css.fontWeight.regular
116
+ });
117
+ });
118
+
119
+ it('Accessibility of the penalty points section - Total penalty points', { tags: 'a11y' }, () => {
120
+ cy.checkAccessibility(chartsBarPage.automaticallySetPenaltyPointsCheckboxLabel().parents('.penalty-score-for-each-incorrect-wrapper'));
121
+ });
122
+
123
+ it('When the user selects \'Specify points for each incorrect answer\', a penalty points detail section with \'Penalty points for each incorrect bar:\' label and empty input field, \'Total penalty points: -\' label should be displayed', () => {
124
+ cy.log('Pre-step: Clearing the total penalty points input field')
125
+ chartsBarPage.steps.clearTotalPenaltyPointsInputField();
126
+ cy.wait(250);
127
+ chartsBarPage.steps.selectPenaltyPointsForEachIncorrectOptionType('Specify points for each incorrect bar');
128
+ utilities.verifyInnerText(chartsBarPage.penaltyPointsDetailsSectionInputFieldLabel(), 'Penalty points for each incorrect bar');
129
+ chartsBarPage.steps.verifyPenaltyPointsForEachIncorrectOptionValue('');
130
+ utilities.verifyInnerText(chartsBarPage.penaltyPointsDetailsSectionAllottedPointsLabel(), 'Total penalty points: -');
131
+ });
132
+
133
+ it('When the user allots Penalty points for each incorrect bar, then \'Total penalty points\' should get updated as per the count of incorrect options available', () => {
134
+ chartsBarPage.steps.allotPenaltyPointsForEachIncorrectOption(1);
135
+ chartsBarPage.steps.verifyTotalPenaltyPoints(5);
136
+ });
137
+
138
+ it('When the user removes a bar, then \'Total penalty points\' should get updated accordingly', () => {
139
+ chartsBarPage.steps.setBarValueInSelectChartTypeSection({ barIndex: 0, value: 2, range: 10 }); //Not able to hover and then delete due to bar not visible
140
+ chartsBarPage.steps.deleteBarInSelectChartType(0);
141
+ chartsBarPage.steps.verifyTotalPenaltyPoints(4);
142
+ });
143
+
144
+ it('When the user adds a bar, then \'Total penalty points\' should get updated accordingly', () => {
145
+ chartsBarPage.steps.addBarOrPointInChartInSelectChartTypeSection();
146
+ chartsBarPage.steps.verifyTotalPenaltyPoints(5);
147
+ });
148
+
149
+ it('CSS of the penalty points section - Penalty points for each incorrect bar', { tags: 'css' }, () => {
150
+ utilities.verifyCSS(chartsBarPage.penaltyPointsDetailsSectionInputFieldLabel(), {
151
+ 'color': css.color.labels,
152
+ 'font-size': css.fontSize.default,
153
+ 'font-weight': css.fontWeight.regular
154
+ });
155
+ utilities.verifyCSS(chartsBarPage.penaltyPointsForEachIncorrectOptionInputField(), {
156
+ 'color': css.color.text,
157
+ 'font-size': css.fontSize.default,
158
+ 'font-weight': css.fontWeight.regular
159
+ });
160
+ utilities.verifyCSS(chartsBarPage.penaltyPointsDetailsSectionAllottedPointsLabel(), {
161
+ 'color': css.color.labelText,
162
+ 'font-size': css.fontSize.default,
163
+ 'font-weight': css.fontWeight.regular
164
+ });
165
+ });
166
+
167
+ it('Accessibility of the penalty points section - Penalty points for each incorrect bar', { tags: 'a11y' }, () => {
168
+ cy.checkAccessibility(chartsBarPage.automaticallySetPenaltyPointsCheckboxLabel().parents('.penalty-score-for-each-incorrect-wrapper'));
169
+ });
170
+
171
+ 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 bar\'', () => {
172
+ chartsBarPage.steps.selectPenaltyPointsForEachIncorrectOptionType('Specify total penalty points');
173
+ chartsBarPage.steps.verifyTotalPenaltyPointsValue(5);
174
+ utilities.verifyInnerText(chartsBarPage.penaltyPointsDetailsSectionAllottedPointsLabel(), 'Penalty points for each incorrect bar: 1');
175
+ });
176
+
177
+ it('When the user checks the \'Automatically set penalty for each incorrect bar to total points / no. of incorrect dot bars\' checkbox, both radio buttons should get disabled, \'Specify points for each incorrect bar\' should get checked, in the penalty points details section, \'Penalty points for each incorrect bar: #\' and \'Total penalty points: #\' should be displayed as per the alloted points and available incorrect options', () => {
178
+ chartsBarPage.steps.checkAutomaticallySetPenaltyPointsCheckbox();
179
+ chartsBarPage.steps.verifySpecifyTotalPenaltyPointsDisabledState();
180
+ chartsBarPage.steps.verifySpecifyPointsForEachIncorrectOptionRadioButtonSelectedAndDisabledState();
181
+ utilities.verifyInnerText(utilities.getNthElement(chartsBarPage.penaltyPointsDetailsSectionAllottedPointsLabel(), 0), 'Penalty points for each incorrect bar: 3.2');
182
+ utilities.verifyInnerText(utilities.getNthElement(chartsBarPage.penaltyPointsDetailsSectionAllottedPointsLabel(), 1), 'Total penalty points: 16');
183
+ });
184
+ });
185
+
186
+ describe('Scoring section: Rounding - Edit tab', () => {
187
+ abortEarlySetup();
188
+ before(() => {
189
+ chartsBarPage.steps.navigateToCreateQuestion('charts');
190
+ cy.barsPreLoaderWait();
191
+ chartsBarPage.steps.allotPoints(10);
192
+ chartsBarPage.steps.selectAutoScoredScoringSubtype('Partial equal weights')
193
+ });
194
+
195
+ chartsBarPage.tests.verifyRoundingDropdown();
196
+
197
+ chartsBarPage.tests.verifyRoundNegativeScoreToZeroLabelAndCheckbox();
198
+ });
199
+ });
@@ -0,0 +1,29 @@
1
+ import { chartsBarPage } from "../../../pages";
2
+ import abortEarlySetup from "../../../support/helpers/abortEarly";
3
+ const css = Cypress.env('css');
4
+
5
+ describe('Create Item page - Charts - Bar : Question instructions', () => {
6
+ before(() => {
7
+ cy.loginAs('admin');
8
+ });
9
+
10
+ describe('Question instructions input field - Edit tab', () => {
11
+ abortEarlySetup();
12
+ before(() => {
13
+ chartsBarPage.steps.navigateToCreateQuestion('charts');
14
+ cy.barsPreLoaderWait();
15
+ });
16
+
17
+ chartsBarPage.tests.verifyQuestionInstructionsInputFieldEditTab();
18
+ });
19
+
20
+ describe('Question instructions input field - Preview tab', () => {
21
+ abortEarlySetup();
22
+ before(() => {
23
+ chartsBarPage.steps.navigateToCreateQuestion('charts');
24
+ cy.barsPreLoaderWait();
25
+ });
26
+
27
+ chartsBarPage.tests.verifyQuestionInstructionsInputFieldPreviewTab();
28
+ });
29
+ });
@@ -33,7 +33,8 @@ describe('Create Item page - Charts - Bar chart: Specify correct answer, Alterna
33
33
  it('\'+ Add alternative answer\' button should be present', () => {
34
34
  utilities.verifyInnerText(chartsBarPage.alternativeAnswerButton(), 'Add alternative answer');
35
35
  utilities.verifyElementVisibilityState(chartsBarPage.alternativeAnswerButton(), 'visible');
36
- chartsBarPage.alternativeAnswerButton().verifyPseudoClassBeforeProperty('content', '""');
36
+ chartsBarPage.alternativeAnswerButton()
37
+ .verifyPseudoClassBeforeProperty('content', '""');
37
38
  });
38
39
 
39
40
  it('CSS of \'Add Alternative answer\' button', { tags: 'css' }, () => {