itemengine-cypress-automation 1.0.210-1stJulyFixes-e873781.0 → 1.0.211-2ndJulyFixes-2aec8c8.0
Sign up to get free protection for your applications and to get access to all the features.
- package/cypress/e2e/ILC/ChartsBar/additionalSettings.js +159 -0
- package/cypress/e2e/ILC/ChartsBar/editTabScoringSection.js +203 -0
- package/cypress/e2e/ILC/ChartsBar/minimumScoringPenaltyPointsAndRoundingDropdown.js +199 -0
- package/cypress/e2e/ILC/ChartsBar/questionInstruction.js +29 -0
- package/cypress/e2e/ILC/ChartsBar/specifyCorrectAnswerSection.js +2 -1
- package/cypress/e2e/ILC/ChartsLine/additionalSettings.js +153 -0
- package/cypress/e2e/ILC/ChartsLine/editTabScoringSection.js +210 -0
- package/cypress/e2e/ILC/ChartsLine/headerSection.js +109 -0
- package/cypress/e2e/ILC/ChartsLine/minimumScoringPenaltyPointsAndRoundingDropdown.js +200 -0
- package/cypress/e2e/ILC/ChartsLine/questionInstruction.js +31 -0
- package/cypress/e2e/ILC/ChartsLine/specifyCorrectAnswerSection.js +93 -0
- package/cypress/e2e/ILC/ChartsLine/toolSettings.js +77 -0
- package/cypress/e2e/ILC/FeedbackScaleNew/previewContentsForAllViews.smoke.js +1 -0
- package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/previewContentsForAllViews.smoke.js +3 -1
- package/cypress/e2e/ILC/ImageHighlight/previewContentsForAllViews.smoke.js +28 -9
- package/cypress/e2e/ILC/chartsDotsPlot/editTabScoring.js +6 -6
- package/cypress/pages/chartsBarPage.js +31 -4
- package/cypress/pages/chartsDotPlotPage.js +0 -19
- package/cypress/pages/chartsLinePage.js +209 -3
- package/cypress/pages/components/autoScoredScoringSectionMultiResponseType.js +1 -0
- package/cypress/pages/components/barAndLineChartComponent.js +2 -1
- package/cypress/pages/components/chartsCommonComponent.js +18 -0
- package/cypress/pages/components/gridQuestionCommonComponent.js +11 -3
- package/cypress/pages/feedbackScalePage.js +2 -1
- package/package.json +1 -1
@@ -0,0 +1,153 @@
|
|
1
|
+
import { chartsLinePage } 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
|
+
//Note : Covered 'Additional Settings accordion' in Bar charts.
|
14
|
+
|
15
|
+
describe('Additional settings: Font size contents', () => {
|
16
|
+
abortEarlySetup();
|
17
|
+
before(() => {
|
18
|
+
chartsLinePage.steps.navigateToCreateQuestion('charts');
|
19
|
+
cy.barsPreLoaderWait();
|
20
|
+
chartsLinePage.steps.selectLineButton();
|
21
|
+
chartsLinePage.steps.expandAdditionalSettings();
|
22
|
+
});
|
23
|
+
|
24
|
+
chartsLinePage.tests.verifyFontSizeSectionContents();
|
25
|
+
});
|
26
|
+
|
27
|
+
describe('Additional settings: Font size - Select chart type and Specify correct answer section', () => {
|
28
|
+
abortEarlySetup();
|
29
|
+
before(() => {
|
30
|
+
chartsLinePage.steps.navigateToCreateQuestion('charts');
|
31
|
+
cy.barsPreLoaderWait();
|
32
|
+
chartsLinePage.steps.selectLineButton();
|
33
|
+
chartsLinePage.steps.addQuestionInstructions();
|
34
|
+
chartsLinePage.steps.allotPoints(10);
|
35
|
+
chartsLinePage.steps.expandAdditionalSettings();
|
36
|
+
});
|
37
|
+
|
38
|
+
Object.keys(fontSizes).forEach((option) => {
|
39
|
+
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`, () => {
|
40
|
+
chartsLinePage.steps.selectFontSizeOptionFromFontSizeDropdown(option);
|
41
|
+
utilities.verifyInnerText(chartsLinePage.fontSizeDropdown(), `${option}`);
|
42
|
+
utilities.verifyCSS(chartsLinePage.specifyCorrectAnswerPointLabel(), {
|
43
|
+
'font-size': css.fontSize.default
|
44
|
+
});
|
45
|
+
utilities.verifyCSS(chartsLinePage.yAxisCoordinate(), {
|
46
|
+
'font-size': css.fontSize.default
|
47
|
+
});
|
48
|
+
utilities.verifyCSS(chartsLinePage.yAxisCoordinateSpecifyCorrectAnswer(), {
|
49
|
+
'font-size': css.fontSize.default
|
50
|
+
});
|
51
|
+
utilities.verifyCSS(chartsLinePage.selectChartTypeGraphTitleButton(), {
|
52
|
+
'font-size': fontSizes[option]
|
53
|
+
});
|
54
|
+
utilities.verifyCSS(chartsLinePage.selectChartTypeXAxisLabelButton(), {
|
55
|
+
'font-size': fontSizes[option]
|
56
|
+
});
|
57
|
+
utilities.verifyCSS(chartsLinePage.selectChartTypeYAxisLabelButton(), {
|
58
|
+
'font-size': fontSizes[option]
|
59
|
+
});
|
60
|
+
utilities.verifyCSS(chartsLinePage.graphTitleSpecifyCorrectAnswer(), {
|
61
|
+
'font-size': fontSizes[option]
|
62
|
+
});
|
63
|
+
utilities.verifyCSS(chartsLinePage.xAxisLabelSpecifyCorrectAnswer(), {
|
64
|
+
'font-size': fontSizes[option]
|
65
|
+
});
|
66
|
+
utilities.verifyCSS(chartsLinePage.yAxisLabelSpecifyCorrectAnswer(), {
|
67
|
+
'font-size': fontSizes[option]
|
68
|
+
});
|
69
|
+
});
|
70
|
+
});
|
71
|
+
});
|
72
|
+
|
73
|
+
describe('Additional settings: Font size - preview tab', () => {
|
74
|
+
abortEarlySetup();
|
75
|
+
before(() => {
|
76
|
+
chartsLinePage.steps.navigateToCreateQuestion('charts');
|
77
|
+
cy.barsPreLoaderWait();
|
78
|
+
chartsLinePage.steps.selectLineButton();
|
79
|
+
chartsLinePage.steps.addQuestionInstructions();
|
80
|
+
chartsLinePage.steps.setPointValueInSelectChartTypeSection({ pointIndex: 0, value: 1, range: 10 });
|
81
|
+
chartsLinePage.steps.allotPoints(10);
|
82
|
+
chartsLinePage.steps.expandAdditionalSettings();
|
83
|
+
});
|
84
|
+
|
85
|
+
Object.keys(fontSizes).forEach((option) => {
|
86
|
+
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`, () => {
|
87
|
+
chartsLinePage.steps.selectFontSizeOptionFromFontSizeDropdown(option);
|
88
|
+
utilities.verifyInnerText(chartsLinePage.fontSizeDropdown(), `${option}`);
|
89
|
+
chartsLinePage.steps.switchToPreviewTab();
|
90
|
+
utilities.verifyCSS(chartsLinePage.questionInstructionsText(), {
|
91
|
+
'font-size': fontSizes[option]
|
92
|
+
});
|
93
|
+
utilities.verifyCSS(chartsLinePage.previewTabPointLabel(), {
|
94
|
+
'font-size': css.fontSize.default
|
95
|
+
});
|
96
|
+
utilities.verifyCSS(chartsLinePage.previewTabYAxisCoordinate(), {
|
97
|
+
'font-size': css.fontSize.default
|
98
|
+
});
|
99
|
+
utilities.verifyCSS(chartsLinePage.previewTabGraphTitle(), {
|
100
|
+
'font-size': fontSizes[option]
|
101
|
+
});
|
102
|
+
utilities.verifyCSS(chartsLinePage.previewTabXAxisLabelButton(), {
|
103
|
+
'font-size': fontSizes[option]
|
104
|
+
});
|
105
|
+
utilities.verifyCSS(chartsLinePage.previewTabYAxisLabelButton(), {
|
106
|
+
'font-size': fontSizes[option]
|
107
|
+
});
|
108
|
+
chartsLinePage.steps.switchToGradingView();
|
109
|
+
utilities.verifyCSS(chartsLinePage.graphTitleCorrectAnswerSection(), {
|
110
|
+
'font-size': fontSizes[option]
|
111
|
+
});
|
112
|
+
utilities.verifyCSS(chartsLinePage.xAxisLabelCorrectAnswerSection(), {
|
113
|
+
'font-size': fontSizes[option]
|
114
|
+
});
|
115
|
+
utilities.verifyCSS(chartsLinePage.yAxisLabelCorrectAnswerSection(), {
|
116
|
+
'font-size': fontSizes[option]
|
117
|
+
});
|
118
|
+
utilities.verifyCSS(chartsLinePage.correctAnswersLabel(), {
|
119
|
+
'font-size': fontSizes[option]
|
120
|
+
});
|
121
|
+
utilities.verifyCSS(chartsLinePage.correctIncorrectStatusMessageText(), {
|
122
|
+
'font-size': fontSizes[option]
|
123
|
+
});
|
124
|
+
chartsLinePage.steps.switchToStudentView();
|
125
|
+
chartsLinePage.steps.switchToEditTab();
|
126
|
+
});
|
127
|
+
});
|
128
|
+
});
|
129
|
+
|
130
|
+
describe('Setting tab: Accessibility section', () => {
|
131
|
+
abortEarlySetup();
|
132
|
+
before(() => {
|
133
|
+
chartsLinePage.steps.navigateToCreateQuestion('charts');
|
134
|
+
cy.barsPreLoaderWait();
|
135
|
+
chartsLinePage.steps.selectLineButton();
|
136
|
+
chartsLinePage.steps.expandAdditionalSettings();
|
137
|
+
});
|
138
|
+
|
139
|
+
chartsLinePage.tests.verifyAdditionalSettingsAccessibilitySection();
|
140
|
+
});
|
141
|
+
|
142
|
+
describe('Additional Settings: Details section', () => {
|
143
|
+
abortEarlySetup();
|
144
|
+
before(() => {
|
145
|
+
chartsLinePage.steps.navigateToCreateQuestion('charts');
|
146
|
+
cy.barsPreLoaderWait();
|
147
|
+
chartsLinePage.steps.selectLineButton();
|
148
|
+
chartsLinePage.steps.expandAdditionalSettings();
|
149
|
+
});
|
150
|
+
|
151
|
+
chartsLinePage.tests.verifyDetailsSection();
|
152
|
+
});
|
153
|
+
});
|
@@ -0,0 +1,210 @@
|
|
1
|
+
import { chartsLinePage } 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 - Line: Scoring section', () => {
|
7
|
+
before(() => {
|
8
|
+
cy.loginAs('admin');
|
9
|
+
});
|
10
|
+
|
11
|
+
describe('Scoring section contents', () => {
|
12
|
+
abortEarlySetup();
|
13
|
+
before(() => {
|
14
|
+
chartsLinePage.steps.navigateToCreateQuestion('charts');
|
15
|
+
cy.barsPreLoaderWait();
|
16
|
+
chartsLinePage.steps.selectLineButton();
|
17
|
+
});
|
18
|
+
|
19
|
+
chartsLinePage.tests.verifyScoringTypeLabelAndDropdown('Auto scored');
|
20
|
+
|
21
|
+
chartsLinePage.tests.verifyScoringSubtypeContentsForMultipleResponseTypeQuestion();
|
22
|
+
});
|
23
|
+
|
24
|
+
describe('Auto scored: All or nothing scoring - Scoring section', () => {
|
25
|
+
abortEarlySetup();
|
26
|
+
before(() => {
|
27
|
+
chartsLinePage.steps.navigateToCreateQuestion('charts');
|
28
|
+
cy.barsPreLoaderWait();
|
29
|
+
chartsLinePage.steps.selectLineButton();
|
30
|
+
chartsLinePage.steps.allotPoints(10);
|
31
|
+
});
|
32
|
+
|
33
|
+
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', () => {
|
34
|
+
chartsLinePage.steps.verifyMinimumScoringLabelAndDropdownDefaultState();
|
35
|
+
chartsLinePage.steps.verifyPenaltyPointsLabelAndDropdownDefaultState();
|
36
|
+
});
|
37
|
+
|
38
|
+
chartsLinePage.tests.verifyToleranceThresholdLabelAndInputField();
|
39
|
+
});
|
40
|
+
|
41
|
+
describe('Auto scored: All or nothing scoring - Specify correct answer section', () => {
|
42
|
+
abortEarlySetup();
|
43
|
+
before(() => {
|
44
|
+
chartsLinePage.steps.navigateToCreateQuestion('charts');
|
45
|
+
cy.barsPreLoaderWait();
|
46
|
+
chartsLinePage.steps.selectLineButton();
|
47
|
+
chartsLinePage.steps.addTextInQuestionInstructionsInputField('Line');
|
48
|
+
});
|
49
|
+
|
50
|
+
chartsLinePage.tests.verifyContentsOfSpecifyCorrectAnswerSection();
|
51
|
+
|
52
|
+
chartsLinePage.tests.verifyPointsLabelAndInputField();
|
53
|
+
});
|
54
|
+
|
55
|
+
describe('Auto scored: Partial - equal weights scoring - Scoring section', () => {
|
56
|
+
abortEarlySetup();
|
57
|
+
before(() => {
|
58
|
+
chartsLinePage.steps.navigateToCreateQuestion('charts');
|
59
|
+
cy.barsPreLoaderWait();
|
60
|
+
chartsLinePage.steps.selectLineButton();
|
61
|
+
chartsLinePage.steps.addTextInQuestionInstructionsInputField('Line');
|
62
|
+
});
|
63
|
+
|
64
|
+
it('User should be able to select \'Partial - equal weights\' scoring type', () => {
|
65
|
+
chartsLinePage.steps.selectAutoScoredScoringSubtype('Partial equal weights');
|
66
|
+
});
|
67
|
+
|
68
|
+
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', () => {
|
69
|
+
chartsLinePage.steps.verifyPointsPerResponseLabel();
|
70
|
+
chartsLinePage.steps.verifyMinimumScoringLabelAndDropdownDefaultState();
|
71
|
+
chartsLinePage.steps.verifyPenaltyPointsLabelAndDropdownDefaultState();
|
72
|
+
chartsLinePage.steps.verifyRoundingLabelAndDropdownDefaultState();
|
73
|
+
utilities.verifyElementVisibilityState(chartsLinePage.roundNegativeScoresToZeroCheckbox(), 'notExist');
|
74
|
+
});
|
75
|
+
|
76
|
+
chartsLinePage.tests.verifyToleranceThresholdLabelAndInputField();
|
77
|
+
});
|
78
|
+
|
79
|
+
describe('Auto scored: Partial equal weights scoring - Specify correct answer section', () => {
|
80
|
+
abortEarlySetup();
|
81
|
+
before(() => {
|
82
|
+
chartsLinePage.steps.navigateToCreateQuestion('charts');
|
83
|
+
cy.barsPreLoaderWait();
|
84
|
+
chartsLinePage.steps.selectLineButton();
|
85
|
+
chartsLinePage.steps.addTextInQuestionInstructionsInputField('Line');
|
86
|
+
chartsLinePage.steps.selectAutoScoredScoringSubtype('Partial equal weights');
|
87
|
+
});
|
88
|
+
|
89
|
+
chartsLinePage.tests.verifyContentsOfSpecifyCorrectAnswerSection();
|
90
|
+
|
91
|
+
it('\'Points per response\' label should be displayed and a \'-\' should be displayed besides each response in the \'Specify correct answer\' section', () => {
|
92
|
+
chartsLinePage.steps.verifyPointsPerResponseLabel();
|
93
|
+
});
|
94
|
+
|
95
|
+
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', () => {
|
96
|
+
chartsLinePage.steps.allotPoints(12);
|
97
|
+
chartsLinePage.steps.verifyPartialEqualWeightsPointsPerResponseScore('4');
|
98
|
+
});
|
99
|
+
|
100
|
+
it('When the user adds one more point, then points per response should get updated accordingly', () => {
|
101
|
+
chartsLinePage.steps.addBarOrPointInChartInSelectChartTypeSection();
|
102
|
+
chartsLinePage.steps.verifyPartialEqualWeightsPointsPerResponseScore('3');
|
103
|
+
});
|
104
|
+
|
105
|
+
it('When the user sets a point value then the points per response should not be updated', () => {
|
106
|
+
chartsLinePage.steps.setPointValueInSpecifyCorrectAnswerSection({ pointIndex: 0, value: 1, range: 10});
|
107
|
+
chartsLinePage.steps.verifyPartialEqualWeightsPointsPerResponseScore('3');
|
108
|
+
});
|
109
|
+
|
110
|
+
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', () => {
|
111
|
+
chartsLinePage.steps.selectAutoScoredScoringSubtype('All or nothing');
|
112
|
+
utilities.verifyElementVisibilityState(chartsLinePage.pointsPerResponseLabel(), 'notExist');
|
113
|
+
chartsLinePage.steps.verifyPointsFieldValue(12);
|
114
|
+
});
|
115
|
+
|
116
|
+
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', () => {
|
117
|
+
chartsLinePage.steps.allotPoints(20);
|
118
|
+
chartsLinePage.steps.selectAutoScoredScoringSubtype('Partial equal weights');
|
119
|
+
chartsLinePage.steps.verifyPartialEqualWeightsPointsPerResponseScore('5');
|
120
|
+
});
|
121
|
+
|
122
|
+
it('CSS of \'Points per response\' label and its displayed score', { tags: 'css' }, () => {
|
123
|
+
utilities.verifyCSS(chartsLinePage.pointsPerResponseLabel(), {
|
124
|
+
'color': css.color.labels,
|
125
|
+
'font-size': css.fontSize.normal,
|
126
|
+
'font-weight': css.fontWeight.regular
|
127
|
+
});
|
128
|
+
});
|
129
|
+
});
|
130
|
+
|
131
|
+
describe('Auto scored: Partial - different weights scoring - Scoring section', () => {
|
132
|
+
abortEarlySetup();
|
133
|
+
before(() => {
|
134
|
+
chartsLinePage.steps.navigateToCreateQuestion('charts');
|
135
|
+
cy.barsPreLoaderWait();
|
136
|
+
chartsLinePage.steps.selectLineButton();
|
137
|
+
chartsLinePage.steps.addTextInQuestionInstructionsInputField('Line');
|
138
|
+
});
|
139
|
+
|
140
|
+
it('User should be able to select \'Partial - different weights\' scoring', () => {
|
141
|
+
chartsLinePage.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
|
+
chartsLinePage.steps.verifyMinimumScoringLabelAndDropdownDefaultState();
|
146
|
+
chartsLinePage.steps.verifyPenaltyPointsLabelAndDropdownDefaultState();
|
147
|
+
chartsLinePage.steps.verifyRoundingLabelAndDropdownDefaultState();
|
148
|
+
utilities.verifyElementVisibilityState(chartsLinePage.roundNegativeScoresToZeroCheckbox(), 'notExist');
|
149
|
+
});
|
150
|
+
|
151
|
+
chartsLinePage.tests.verifyToleranceThresholdLabelAndInputField();
|
152
|
+
});
|
153
|
+
|
154
|
+
describe('Auto scored: Partial - different weights scoring - Specify correct answer section', () => {
|
155
|
+
abortEarlySetup();
|
156
|
+
before(() => {
|
157
|
+
chartsLinePage.steps.navigateToCreateQuestion('charts');
|
158
|
+
cy.barsPreLoaderWait();
|
159
|
+
chartsLinePage.steps.selectLineButton();
|
160
|
+
chartsLinePage.steps.addTextInQuestionInstructionsInputField('Line');
|
161
|
+
chartsLinePage.steps.selectAutoScoredScoringSubtype('Partial different weights');
|
162
|
+
});
|
163
|
+
|
164
|
+
chartsLinePage.tests.verifyContentsOfSpecifyCorrectAnswerSection();
|
165
|
+
|
166
|
+
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', () => {
|
167
|
+
utilities.verifyInnerText(utilities.getNthElement(chartsLinePage.partialDifferentWeightsPointsInputFieldLabel(), 0), 'Bar 1');
|
168
|
+
utilities.verifyInnerText(utilities.getNthElement(chartsLinePage.partialDifferentWeightsPointsInputFieldLabel(), 1), 'Bar 2');
|
169
|
+
utilities.verifyInnerText(utilities.getNthElement(chartsLinePage.partialDifferentWeightsPointsInputFieldLabel(), 2), 'Bar 3');
|
170
|
+
utilities.verifyElementCount(chartsLinePage.partialDifferentWeightsPointsInputFieldLabel(), 3);
|
171
|
+
utilities.verifyElementCount(chartsLinePage.pointsInputField(), 3);
|
172
|
+
});
|
173
|
+
|
174
|
+
it('When user adds one more point, then points input field should be added with the respective label', () => {
|
175
|
+
chartsLinePage.steps.addBarOrPointInChartInSelectChartTypeSection();
|
176
|
+
utilities.verifyInnerText(utilities.getNthElement(chartsLinePage.partialDifferentWeightsPointsInputFieldLabel(), 3), 'Bar 4');
|
177
|
+
utilities.verifyElementVisibilityState(utilities.getNthElement(chartsLinePage.pointsInputField(), 3), 'visible');
|
178
|
+
chartsLinePage.steps.verifyPartialDifferentWeightsPointsInputFieldIsEmpty();
|
179
|
+
});
|
180
|
+
|
181
|
+
it('User should be able to set points in the \'Points\' input fields', () => {
|
182
|
+
chartsLinePage.steps.allotPartialDifferentWeightsPoints([1, 2, 3, 4]);
|
183
|
+
});
|
184
|
+
|
185
|
+
it('CSS of \'Points\' label and \'Points\' input fields', { tags: 'css' }, () => {
|
186
|
+
utilities.verifyCSS(chartsLinePage.pointsLabel(), {
|
187
|
+
'color': css.color.labels,
|
188
|
+
'font-size': css.fontSize.normal,
|
189
|
+
'font-weight': css.fontWeight.semibold
|
190
|
+
});
|
191
|
+
utilities.verifyCSS(chartsLinePage.pointsInputField(), {
|
192
|
+
'color': css.color.text,
|
193
|
+
'font-size': css.fontSize.default,
|
194
|
+
'font-weight': css.fontWeight.regular
|
195
|
+
});
|
196
|
+
});
|
197
|
+
|
198
|
+
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', () => {
|
199
|
+
chartsLinePage.steps.selectAutoScoredScoringSubtype('All or nothing');
|
200
|
+
chartsLinePage.steps.verifyPointsFieldValue(10);
|
201
|
+
});
|
202
|
+
|
203
|
+
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', () => {
|
204
|
+
chartsLinePage.steps.allotPoints(12);
|
205
|
+
cy.wait(250)
|
206
|
+
chartsLinePage.steps.selectAutoScoredScoringSubtype('Partial different weights');
|
207
|
+
chartsLinePage.steps.verifyPartialDifferentWeightsPointsInputFieldValue([3, 3, 3, 3]);
|
208
|
+
});
|
209
|
+
});
|
210
|
+
});
|
@@ -0,0 +1,109 @@
|
|
1
|
+
import abortEarlySetup from "../../../support/helpers/abortEarly";
|
2
|
+
import { chartsLinePage } from "../../../pages";
|
3
|
+
import utilities from "../../../support/helpers/utilities";
|
4
|
+
const css = Cypress.env('css');
|
5
|
+
|
6
|
+
describe('Create item page - Charts - Bar: Header section and saving question', () => {
|
7
|
+
before(() => {
|
8
|
+
cy.loginAs('admin');
|
9
|
+
});
|
10
|
+
|
11
|
+
describe('Header section contents', () => {
|
12
|
+
abortEarlySetup();
|
13
|
+
before(() => {
|
14
|
+
chartsLinePage.steps.navigateToCreateQuestion('charts');
|
15
|
+
cy.barsPreLoaderWait();
|
16
|
+
chartsLinePage.steps.selectLineButton();
|
17
|
+
});
|
18
|
+
|
19
|
+
chartsLinePage.tests.verifyCreateQuestionPageQuestionTypeHeader('Charts');
|
20
|
+
});
|
21
|
+
|
22
|
+
describe('Tabs section', () => {
|
23
|
+
abortEarlySetup();
|
24
|
+
before(() => {
|
25
|
+
chartsLinePage.steps.navigateToCreateQuestion('charts');
|
26
|
+
cy.barsPreLoaderWait();
|
27
|
+
chartsLinePage.steps.selectLineButton();
|
28
|
+
});
|
29
|
+
|
30
|
+
chartsLinePage.tests.verifyTabsSection();
|
31
|
+
});
|
32
|
+
|
33
|
+
describe('Cancel button', () => {
|
34
|
+
abortEarlySetup();
|
35
|
+
before(() => {
|
36
|
+
chartsLinePage.steps.navigateToCreateQuestion('charts');
|
37
|
+
cy.barsPreLoaderWait();
|
38
|
+
chartsLinePage.steps.selectLineButton();
|
39
|
+
});
|
40
|
+
|
41
|
+
it('When user has made some edits/changes and clicks on cancel button, a popup should be displayed with message \'Are you sure you want to leave this page? Your changes have not been saved.\'', () => {
|
42
|
+
chartsLinePage.steps.addTextInQuestionInstructionsInputField('Edited');
|
43
|
+
chartsLinePage.steps.allotPoints(20);
|
44
|
+
chartsLinePage.steps.clickOnCancelButton();
|
45
|
+
utilities.verifyElementVisibilityState(chartsLinePage.dialogBox(), 'visible');
|
46
|
+
utilities.verifyInnerText(chartsLinePage.dialogBoxContentText(), 'Are you sure you want to leave this page? Your changes have not been saved.');
|
47
|
+
utilities.verifyInnerText(chartsLinePage.buttonAccept(), 'Yes, I want to leave this page');
|
48
|
+
utilities.verifyInnerText(chartsLinePage.buttonReject(), 'No, I\'d like to go back');
|
49
|
+
});
|
50
|
+
|
51
|
+
it('CSS of popup', { tags: 'css' }, () => {
|
52
|
+
utilities.verifyCSS(chartsLinePage.dialogBox(), {
|
53
|
+
'background-color': css.color.defaultBackground
|
54
|
+
})
|
55
|
+
|
56
|
+
utilities.verifyCSS(chartsLinePage.dialogBoxContent(), {
|
57
|
+
'color': css.color.sectionHeading,
|
58
|
+
'font-size': css.fontSize.default,
|
59
|
+
'font-weight': css.fontWeight.regular
|
60
|
+
});
|
61
|
+
utilities.verifyCSS(chartsLinePage.buttonAccept(), {
|
62
|
+
'color': css.color.primaryBtn,
|
63
|
+
'font-size': css.fontSize.default,
|
64
|
+
'font-weight': css.fontWeight.semibold,
|
65
|
+
'background-color': css.color.primaryBtnBg
|
66
|
+
});
|
67
|
+
utilities.verifyCSS(chartsLinePage.buttonReject(), {
|
68
|
+
'color': css.color.secondaryBtn,
|
69
|
+
'font-size': css.fontSize.default,
|
70
|
+
'font-weight': css.fontWeight.semibold,
|
71
|
+
'background-color': css.color.transparent
|
72
|
+
});
|
73
|
+
});
|
74
|
+
|
75
|
+
it('Accessibility of popup', { tags: 'a11y' }, () => {
|
76
|
+
cy.checkAccessibility(chartsLinePage.dialogBox());
|
77
|
+
});
|
78
|
+
|
79
|
+
it(`Clicking on \'No, I'd like to go back\' button should close the popup and user should remain on the edit interface of the question`, () => {
|
80
|
+
chartsLinePage.steps.clickOnRejectButtonInDialogBox();
|
81
|
+
chartsLinePage.steps.verifyEditTabSelectedState();
|
82
|
+
utilities.verifyTextContent(chartsLinePage.questionInstructionsInputField(), 'Edited');
|
83
|
+
});
|
84
|
+
|
85
|
+
it(`Clicking on \'Yes, I want to leave this page\' button should should discard all changes and direct the user to the \'Select a question\' page.`, () => {
|
86
|
+
chartsLinePage.steps.clickOnCancelButton();
|
87
|
+
chartsLinePage.steps.clickOnAcceptButtonInDialogBox();
|
88
|
+
utilities.verifyElementVisibilityState(chartsLinePage.selectAQuestionHeaderText(), 'visible');
|
89
|
+
utilities.verifyElementVisibilityState(chartsLinePage.questionTypeOptionTitle(), 'visible');
|
90
|
+
});
|
91
|
+
});
|
92
|
+
|
93
|
+
describe('Save Question button', () => {
|
94
|
+
abortEarlySetup();
|
95
|
+
before(() => {
|
96
|
+
chartsLinePage.steps.navigateToCreateQuestion('charts');
|
97
|
+
cy.barsPreLoaderWait();
|
98
|
+
chartsLinePage.steps.selectLineButton();
|
99
|
+
});
|
100
|
+
|
101
|
+
chartsLinePage.tests.verifyCreateItemWrapperContentsA11y();
|
102
|
+
|
103
|
+
it('When user clicks on "Save question" button, then the question should get saved and a snackbar with text \'Saved successfully!\' should be displayed', () => {
|
104
|
+
chartsLinePage.steps.saveAQuestionAndVerifySnackbar();
|
105
|
+
});
|
106
|
+
|
107
|
+
chartsLinePage.tests.verifySavedSuccessfullySnackbarCSSAndA11y();
|
108
|
+
});
|
109
|
+
});
|