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.
- 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,200 @@
|
|
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
|
+
const penaltyScoringTypeArray = ['No penalty points', 'Penalty points for the entire question', 'Penalty points for each incorrect point'];
|
6
|
+
|
7
|
+
describe('Create item page - Charts - Line: 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
|
+
chartsLinePage.steps.navigateToCreateQuestion('charts');
|
16
|
+
cy.barsPreLoaderWait();
|
17
|
+
chartsLinePage.steps.selectLineButton();
|
18
|
+
chartsLinePage.steps.allotPoints(10);
|
19
|
+
});
|
20
|
+
|
21
|
+
chartsLinePage.tests.verifyMinimumScoringDropdown();
|
22
|
+
|
23
|
+
chartsLinePage.tests.verifyMinimumPointsLabelAndInputField();
|
24
|
+
|
25
|
+
chartsLinePage.tests.verifyMinimumPointsFieldErrorState();
|
26
|
+
});
|
27
|
+
|
28
|
+
describe('Scoring section: Penalty scoring - Edit tab', () => {
|
29
|
+
abortEarlySetup();
|
30
|
+
before(() => {
|
31
|
+
chartsLinePage.steps.navigateToCreateQuestion('charts');
|
32
|
+
cy.barsPreLoaderWait();
|
33
|
+
chartsLinePage.steps.selectLineButton();
|
34
|
+
chartsLinePage.steps.addBarOrPointInChartInSelectChartTypeSection();
|
35
|
+
chartsLinePage.steps.allotPoints(16);
|
36
|
+
chartsLinePage.steps.selectAutoScoredScoringSubtype('Partial equal weights');
|
37
|
+
});
|
38
|
+
|
39
|
+
chartsLinePage.tests.verifyPenaltyScoringDropdown(penaltyScoringTypeArray);
|
40
|
+
|
41
|
+
chartsLinePage.tests.verifyPenaltyPointsLabelAndInputField();
|
42
|
+
|
43
|
+
chartsLinePage.tests.verifyPenaltyPointsErrorState();
|
44
|
+
|
45
|
+
it('When the user selects \'Penalty points for each incorrect point\' from the penalty scoring dropdown, \'Automatically set penalty for each incorrect point to total points / no. of incorrect dot points\' 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 point\' should be displayed. By default, \'Specify total penalty points\' radio button should be checked', () => {
|
46
|
+
chartsLinePage.steps.expandPenaltyScoringDropdown();
|
47
|
+
chartsLinePage.steps.selectOptionFromPenaltyScoringDropdown('Penalty points for each incorrect point');
|
48
|
+
utilities.verifyInnerText(chartsLinePage.automaticallySetPenaltyPointsCheckboxLabel(), 'Automatically set penalty for each incorrect point to total points / no. of incorrect points');
|
49
|
+
utilities.verifyInnerText(chartsLinePage.specifyTotalPenaltyPointsRadioButtonLabel(), 'Specify total penalty points');
|
50
|
+
utilities.verifyInnerText(chartsLinePage.specifyPointsForEachIncorrectOptionRadioButtonLabel(), 'Specify points for each incorrect point');
|
51
|
+
chartsLinePage.steps.verifyAutomaticallySetPenaltyPointsCheckboxUncheckedState();
|
52
|
+
chartsLinePage.steps.verifySpecifyTotalPenaltyPointsRadioButtonCheckedState();
|
53
|
+
chartsLinePage.steps.verifySpecifyPointsForEachIncorrectOptionRadioButtonUncheckedState();
|
54
|
+
});
|
55
|
+
|
56
|
+
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 point: -\' label should be displayed', () => {
|
57
|
+
utilities.verifyInnerText(chartsLinePage.penaltyPointsDetailsSectionInputFieldLabel(), 'Total penalty points');
|
58
|
+
chartsLinePage.steps.verifyTotalPenaltyPointsValue('');
|
59
|
+
utilities.verifyInnerText(chartsLinePage.penaltyPointsDetailsSectionAllottedPointsLabel(), 'Penalty points for each incorrect point: -');
|
60
|
+
});
|
61
|
+
|
62
|
+
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', () => {
|
63
|
+
chartsLinePage.steps.allotTotalPenaltyPoints(4);
|
64
|
+
chartsLinePage.steps.verifyPenaltyPointsForEachIncorrectPoint(1);
|
65
|
+
});
|
66
|
+
|
67
|
+
it('When the user removes a point, then \'points for each incorrect option\' should get updated accordingly', () => {
|
68
|
+
chartsLinePage.steps.deletePointInSelectChartType(0);
|
69
|
+
chartsLinePage.steps.verifyPenaltyPointsForEachIncorrectPoint(1.33);
|
70
|
+
});
|
71
|
+
|
72
|
+
it('When the user adds a point, then \'points for each incorrect option\' should get updated accordingly', () => {
|
73
|
+
chartsLinePage.steps.addBarOrPointInChartInSelectChartTypeSection();
|
74
|
+
chartsLinePage.steps.addBarOrPointInChartInSelectChartTypeSection();
|
75
|
+
chartsLinePage.steps.verifyPenaltyPointsForEachIncorrectPoint(0.8);
|
76
|
+
});
|
77
|
+
|
78
|
+
it('CSS of the penalty points section - Total penalty points', { tags: 'css' }, () => {
|
79
|
+
utilities.verifyCSS(chartsLinePage.automaticallySetPenaltyPointsCheckboxLabel(), {
|
80
|
+
'color': css.color.labels,
|
81
|
+
'font-size': css.fontSize.default,
|
82
|
+
'font-weight': css.fontWeight.regular
|
83
|
+
});
|
84
|
+
utilities.verifyCSS(chartsLinePage.automaticallySetPenaltyPointsCheckbox().parent().find('svg'), {
|
85
|
+
'fill': css.color.uncheckedCheckbox
|
86
|
+
});
|
87
|
+
utilities.verifyCSS(chartsLinePage.specifyTotalPenaltyPointsRadioButton().parent().find('svg'), {
|
88
|
+
'fill': css.color.activeButtons
|
89
|
+
});
|
90
|
+
utilities.verifyCSS(chartsLinePage.specifyPointsForEachIncorrectOptionRadioButton().parent().find('svg path'), {
|
91
|
+
'fill': css.color.uncheckedCheckbox
|
92
|
+
});
|
93
|
+
utilities.verifyCSS(chartsLinePage.specifyTotalPenaltyPointsRadioButtonLabel(), {
|
94
|
+
'color': css.color.labelText,
|
95
|
+
'font-size': css.fontSize.default,
|
96
|
+
'font-weight': css.fontWeight.regular
|
97
|
+
});
|
98
|
+
utilities.verifyCSS(chartsLinePage.specifyPointsForEachIncorrectOptionRadioButtonLabel(), {
|
99
|
+
'color': css.color.labelText,
|
100
|
+
'font-size': css.fontSize.default,
|
101
|
+
'font-weight': css.fontWeight.regular
|
102
|
+
});
|
103
|
+
utilities.verifyCSS(chartsLinePage.penaltyPointsDetailsSectionInputFieldLabel(), {
|
104
|
+
'color': css.color.labelText,
|
105
|
+
'font-size': css.fontSize.default,
|
106
|
+
'font-weight': css.fontWeight.regular
|
107
|
+
});
|
108
|
+
utilities.verifyCSS(chartsLinePage.totalPenaltyPointsInputField(), {
|
109
|
+
'color': css.color.text,
|
110
|
+
'font-size': css.fontSize.default,
|
111
|
+
'font-weight': css.fontWeight.regular
|
112
|
+
});
|
113
|
+
utilities.verifyCSS(chartsLinePage.penaltyPointsDetailsSectionAllottedPointsLabel(), {
|
114
|
+
'color': css.color.labelText,
|
115
|
+
'font-size': css.fontSize.default,
|
116
|
+
'font-weight': css.fontWeight.regular
|
117
|
+
});
|
118
|
+
});
|
119
|
+
|
120
|
+
it('Accessibility of the penalty points section - Total penalty points', { tags: 'a11y' }, () => {
|
121
|
+
cy.checkAccessibility(chartsLinePage.automaticallySetPenaltyPointsCheckboxLabel().parents('.penalty-score-for-each-incorrect-wrapper'));
|
122
|
+
});
|
123
|
+
|
124
|
+
it('When the user selects \'Specify points for each incorrect answer\', a penalty points detail section with \'Penalty points for each incorrect point:\' label and empty input field, \'Total penalty points: -\' label should be displayed', () => {
|
125
|
+
cy.log('Pre-step: Clearing the total penalty points input field')
|
126
|
+
chartsLinePage.steps.clearTotalPenaltyPointsInputField();
|
127
|
+
cy.wait(250);
|
128
|
+
chartsLinePage.steps.selectPenaltyPointsForEachIncorrectOptionType('Specify points for each incorrect point');
|
129
|
+
utilities.verifyInnerText(chartsLinePage.penaltyPointsDetailsSectionInputFieldLabel(), 'Penalty points for each incorrect point');
|
130
|
+
chartsLinePage.steps.verifyPenaltyPointsForEachIncorrectOptionValue('');
|
131
|
+
utilities.verifyInnerText(chartsLinePage.penaltyPointsDetailsSectionAllottedPointsLabel(), 'Total penalty points: -');
|
132
|
+
});
|
133
|
+
|
134
|
+
it('When the user allots Penalty points for each incorrect point, then \'Total penalty points\' should get updated as per the count of incorrect options available', () => {
|
135
|
+
chartsLinePage.steps.allotPenaltyPointsForEachIncorrectOption(1);
|
136
|
+
chartsLinePage.steps.verifyTotalPenaltyPoints(5);
|
137
|
+
});
|
138
|
+
|
139
|
+
it('When the user removes a point, then \'Total penalty points\' should get updated accordingly', () => {
|
140
|
+
chartsLinePage.steps.deletePointInSelectChartType(0);
|
141
|
+
chartsLinePage.steps.verifyTotalPenaltyPoints(4);
|
142
|
+
});
|
143
|
+
|
144
|
+
it('When the user adds a point, then \'Total penalty points\' should get updated accordingly', () => {
|
145
|
+
chartsLinePage.steps.addBarOrPointInChartInSelectChartTypeSection();
|
146
|
+
chartsLinePage.steps.verifyTotalPenaltyPoints(5);
|
147
|
+
});
|
148
|
+
|
149
|
+
it('CSS of the penalty points section - Penalty points for each incorrect point', { tags: 'css' }, () => {
|
150
|
+
utilities.verifyCSS(chartsLinePage.penaltyPointsDetailsSectionInputFieldLabel(), {
|
151
|
+
'color': css.color.labels,
|
152
|
+
'font-size': css.fontSize.default,
|
153
|
+
'font-weight': css.fontWeight.regular
|
154
|
+
});
|
155
|
+
utilities.verifyCSS(chartsLinePage.penaltyPointsForEachIncorrectOptionInputField(), {
|
156
|
+
'color': css.color.text,
|
157
|
+
'font-size': css.fontSize.default,
|
158
|
+
'font-weight': css.fontWeight.regular
|
159
|
+
});
|
160
|
+
utilities.verifyCSS(chartsLinePage.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 point', { tags: 'a11y' }, () => {
|
168
|
+
cy.checkAccessibility(chartsLinePage.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 point\'', () => {
|
172
|
+
chartsLinePage.steps.selectPenaltyPointsForEachIncorrectOptionType('Specify total penalty points');
|
173
|
+
chartsLinePage.steps.verifyTotalPenaltyPointsValue(5);
|
174
|
+
utilities.verifyInnerText(chartsLinePage.penaltyPointsDetailsSectionAllottedPointsLabel(), 'Penalty points for each incorrect point: 1');
|
175
|
+
});
|
176
|
+
|
177
|
+
it('When the user checks the \'Automatically set penalty for each incorrect point to total points / no. of incorrect dot points\' checkbox, both radio buttons should get disabled, \'Specify points for each incorrect point\' should get checked, in the penalty points details section, \'Penalty points for each incorrect point: #\' and \'Total penalty points: #\' should be displayed as per the alloted points and available incorrect options', () => {
|
178
|
+
chartsLinePage.steps.checkAutomaticallySetPenaltyPointsCheckbox();
|
179
|
+
chartsLinePage.steps.verifySpecifyTotalPenaltyPointsDisabledState();
|
180
|
+
chartsLinePage.steps.verifySpecifyPointsForEachIncorrectOptionRadioButtonSelectedAndDisabledState();
|
181
|
+
utilities.verifyInnerText(utilities.getNthElement(chartsLinePage.penaltyPointsDetailsSectionAllottedPointsLabel(), 0), 'Penalty points for each incorrect point: 3.2');
|
182
|
+
utilities.verifyInnerText(utilities.getNthElement(chartsLinePage.penaltyPointsDetailsSectionAllottedPointsLabel(), 1), 'Total penalty points: 16');
|
183
|
+
});
|
184
|
+
});
|
185
|
+
|
186
|
+
describe('Scoring section: Rounding - Edit tab', () => {
|
187
|
+
abortEarlySetup();
|
188
|
+
before(() => {
|
189
|
+
chartsLinePage.steps.navigateToCreateQuestion('charts');
|
190
|
+
cy.barsPreLoaderWait();
|
191
|
+
chartsLinePage.steps.selectLineButton();
|
192
|
+
chartsLinePage.steps.allotPoints(10);
|
193
|
+
chartsLinePage.steps.selectAutoScoredScoringSubtype('Partial equal weights')
|
194
|
+
});
|
195
|
+
|
196
|
+
chartsLinePage.tests.verifyRoundingDropdown();
|
197
|
+
|
198
|
+
chartsLinePage.tests.verifyRoundNegativeScoreToZeroLabelAndCheckbox();
|
199
|
+
});
|
200
|
+
});
|
@@ -0,0 +1,31 @@
|
|
1
|
+
import { chartsLinePage } from "../../../pages";
|
2
|
+
import abortEarlySetup from "../../../support/helpers/abortEarly";
|
3
|
+
const css = Cypress.env('css');
|
4
|
+
|
5
|
+
describe('Create Item page - Charts - Line : Question instructions', () => {
|
6
|
+
before(() => {
|
7
|
+
cy.loginAs('admin');
|
8
|
+
});
|
9
|
+
|
10
|
+
describe('Question instructions input field - Edit tab', () => {
|
11
|
+
abortEarlySetup();
|
12
|
+
before(() => {
|
13
|
+
chartsLinePage.steps.navigateToCreateQuestion('charts');
|
14
|
+
cy.barsPreLoaderWait();
|
15
|
+
chartsLinePage.steps.selectLineButton();
|
16
|
+
});
|
17
|
+
|
18
|
+
chartsLinePage.tests.verifyQuestionInstructionsInputFieldEditTab();
|
19
|
+
});
|
20
|
+
|
21
|
+
describe('Question instructions input field - Preview tab', () => {
|
22
|
+
abortEarlySetup();
|
23
|
+
before(() => {
|
24
|
+
chartsLinePage.steps.navigateToCreateQuestion('charts');
|
25
|
+
cy.barsPreLoaderWait();
|
26
|
+
chartsLinePage.steps.selectLineButton();
|
27
|
+
});
|
28
|
+
|
29
|
+
chartsLinePage.tests.verifyQuestionInstructionsInputFieldPreviewTab();
|
30
|
+
});
|
31
|
+
});
|
@@ -0,0 +1,93 @@
|
|
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 chart: Specify correct answer, Alternative correct answer', () => {
|
7
|
+
before(() => {
|
8
|
+
cy.loginAs('admin');
|
9
|
+
});
|
10
|
+
|
11
|
+
describe('Specify correct answer section - \'Correct\' accordion', () => {
|
12
|
+
abortEarlySetup();
|
13
|
+
before(() => {
|
14
|
+
chartsLinePage.steps.navigateToCreateQuestion('charts');
|
15
|
+
chartsLinePage.steps.selectLineButton();
|
16
|
+
cy.barsPreLoaderWait();
|
17
|
+
});
|
18
|
+
|
19
|
+
chartsLinePage.tests.verifyAutoScoredSpecifyCorrectAnswerHeaderSectionContents('charts');
|
20
|
+
|
21
|
+
chartsLinePage.tests.verifySpecifyCorrectAnswerAccordionContentsAndFunctionality('Correct');
|
22
|
+
});
|
23
|
+
|
24
|
+
describe('Specify correct answer section - \'Alternative\' accordion', () => {
|
25
|
+
abortEarlySetup();
|
26
|
+
before(() => {
|
27
|
+
chartsLinePage.steps.navigateToCreateQuestion('charts');
|
28
|
+
cy.barsPreLoaderWait();
|
29
|
+
chartsLinePage.steps.selectLineButton();
|
30
|
+
chartsLinePage.steps.setPointValueInSelectChartTypeSection({ pointIndex: 0, value: 2, range: 10 });
|
31
|
+
chartsLinePage.steps.lockPoint(0);
|
32
|
+
});
|
33
|
+
|
34
|
+
it('\'+ Add alternative answer\' button should be present', () => {
|
35
|
+
utilities.verifyInnerText(chartsLinePage.alternativeAnswerButton(), 'Add alternative answer');
|
36
|
+
utilities.verifyElementVisibilityState(chartsLinePage.alternativeAnswerButton(), 'visible');
|
37
|
+
chartsLinePage.alternativeAnswerButton()
|
38
|
+
.verifyPseudoClassBeforeProperty('content', '""');
|
39
|
+
});
|
40
|
+
|
41
|
+
it('CSS of \'Add Alternative answer\' button', { tags: 'css' }, () => {
|
42
|
+
utilities.verifyCSS(chartsLinePage.alternativeAnswerButton().find('p'), {
|
43
|
+
'color': css.color.activeButtons,
|
44
|
+
'font-size': css.fontSize.default,
|
45
|
+
'font-weight': css.fontWeight.regular
|
46
|
+
});
|
47
|
+
chartsLinePage.alternativeAnswerButton()
|
48
|
+
.verifyPseudoClassBeforeProperty('color', css.color.activeButtons);
|
49
|
+
});
|
50
|
+
|
51
|
+
it('When user have not set correct answer in correct accordion, and clicks on \'+ Add alternative answer\' button then alternative accordion should be added and error message should not be displayed', () => {
|
52
|
+
chartsLinePage.steps.addAlternativeAnswerAccordion(1);
|
53
|
+
utilities.verifyElementVisibilityState(chartsLinePage.errorMessage(), 'notExist');
|
54
|
+
utilities.verifyElementVisibilityState(chartsLinePage.dialogBox(), 'notExist');
|
55
|
+
});
|
56
|
+
|
57
|
+
it('When user has added an alternative answer accordion, then the newly added alternative answer accordion should be in expanded state and the correct answer accordion should be in collapsed state', () => {
|
58
|
+
chartsLinePage.steps.verifyCorrectAnswerAccordionIsCollapsed();
|
59
|
+
chartsLinePage.steps.verifyAlternateAnswerAccordionIsExpanded(0);
|
60
|
+
});
|
61
|
+
|
62
|
+
chartsLinePage.tests.verifySpecifyCorrectAnswerAccordionContentsAndFunctionality('Alternative');
|
63
|
+
|
64
|
+
it('Locked dot column should be displayed in alternative accordion', () => {
|
65
|
+
chartsLinePage.steps.verifyLockedPointInSpecifyCorrectAnswer({ pointIndex: 0, pointValue: 2, range: 10 });
|
66
|
+
chartsLinePage.steps.verifyLockedPointIsNotEditableInSpecifyCorrectAnswer(0);
|
67
|
+
});
|
68
|
+
|
69
|
+
it('User should be able to add another alternative answer for the question using \'Add alternative answer\' button and the label for this new accordion should be \'Alternative 2\'', () => {
|
70
|
+
chartsLinePage.steps.addAlternativeAnswerAccordion(1);
|
71
|
+
});
|
72
|
+
|
73
|
+
it('User should be able to remove alternative correct answer by clicking on the \'Delete\' icon button alongside alternative answer accordion and the label of the alternative answer accordions should get updated accordingly', () => {
|
74
|
+
cy.log('Set correct answer and points in alternative 2 accordion, then switch to alternative 1 accordion and click delete icon button');
|
75
|
+
chartsLinePage.steps.setPointValueInSpecifyCorrectAnswerSection({ pointIndex: 1, value: 2, range: 10 })
|
76
|
+
chartsLinePage.steps.allotPoints(5);
|
77
|
+
chartsLinePage.steps.deleteAlternativeAnswerAccordion(0);
|
78
|
+
chartsLinePage.steps.verifyAlternativeAnswerAccordionNotExists(1);
|
79
|
+
chartsLinePage.steps.verifyAlternativeAnswerAccordionLabel(0);
|
80
|
+
});
|
81
|
+
|
82
|
+
it('When correct answers and points are set in alternative answer and user clicks on correct answer accordion, then correct answer accordion should be expanded and the alternative answer accordion should be collapsed', () => {
|
83
|
+
chartsLinePage.steps.expandCorrectAnswerAccordion();
|
84
|
+
chartsLinePage.steps.verifyAlternateAnswerAccordionIsCollapsed(0);
|
85
|
+
});
|
86
|
+
|
87
|
+
it('When user deletes a point in correct accordion then it should be deleted and points in alternate accordion should remain the same', () => {
|
88
|
+
chartsLinePage.steps.deletePointInSpecifyCorrectAnswer(0);
|
89
|
+
chartsLinePage.steps.expandAlternativeAnswerAccordion(0);
|
90
|
+
utilities.verifyElementCount(chartsLinePage.specifyCorrectAnswerPoint(), 3);
|
91
|
+
});
|
92
|
+
});
|
93
|
+
});
|
@@ -0,0 +1,77 @@
|
|
1
|
+
import { toolSettingsComponent } from "../../../pages/components";
|
2
|
+
import abortEarlySetup from "../../../support/helpers/abortEarly";
|
3
|
+
import utilities from "../../../support/helpers/utilities";
|
4
|
+
import { dialogBoxBase, chartsLinePage, rulerPage } from "../../../pages";
|
5
|
+
|
6
|
+
const css = Cypress.env('css');
|
7
|
+
|
8
|
+
describe('Create Item page: Tool settings', () => {
|
9
|
+
before(() => {
|
10
|
+
cy.loginAs('admin');
|
11
|
+
});
|
12
|
+
|
13
|
+
describe('Tool settings: Contents', () => {
|
14
|
+
abortEarlySetup();
|
15
|
+
before(() => {
|
16
|
+
chartsLinePage.steps.navigateToCreateQuestion('charts');
|
17
|
+
cy.barsPreLoaderWait();
|
18
|
+
chartsLinePage.steps.selectLineButton();
|
19
|
+
});
|
20
|
+
|
21
|
+
toolSettingsComponent.tests.verifyToolSettingsContent();
|
22
|
+
});
|
23
|
+
|
24
|
+
describe('Tool settings: Edit tool settings', () => {
|
25
|
+
abortEarlySetup();
|
26
|
+
before(() => {
|
27
|
+
chartsLinePage.steps.navigateToCreateQuestion('charts');
|
28
|
+
cy.barsPreLoaderWait();
|
29
|
+
chartsLinePage.steps.selectLineButton();
|
30
|
+
toolSettingsComponent.steps.expandToolSettingsAccordion();
|
31
|
+
});
|
32
|
+
|
33
|
+
it('When user clicks on edit icon for ruler tool, then popup for ruler tool settings should be displayed', () => {
|
34
|
+
toolSettingsComponent.steps.clickOnToolEditIcon(0);
|
35
|
+
utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'visible');
|
36
|
+
});
|
37
|
+
|
38
|
+
it('When user modifies the settings for the ruler tool and clicks the \'Ok\' button, then ruler tool should enter selected state.', () => {
|
39
|
+
rulerPage.steps.expandUnitOfMeasurementDropdown();
|
40
|
+
rulerPage.steps.selectOptionFromUnitOfMeasurementDropdown('Inch');
|
41
|
+
rulerPage.steps.selectOptionFromLengthOfRulerOptions('12 in');
|
42
|
+
rulerPage.steps.selectColorBlock(1);
|
43
|
+
rulerPage.steps.expandRotationDropdown();
|
44
|
+
rulerPage.steps.selectOptionFromRotationDropdown('Allow rotation and display angle');
|
45
|
+
rulerPage.steps.enterInputToOpacityInputField(60);
|
46
|
+
rulerPage.steps.checkAddShowHideButtonCheckbox();
|
47
|
+
toolSettingsComponent.steps.clickOnOkButton();
|
48
|
+
utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'notExist');
|
49
|
+
toolSettingsComponent.steps.verifyToolSelectedState(0);
|
50
|
+
});
|
51
|
+
|
52
|
+
it('When user has made changes for ruler tool in edit tab then changes should be reflected in the ruler tool in the preview tab', () => {
|
53
|
+
cy.log('Switching to Preview Tab');
|
54
|
+
rulerPage.steps.switchToPreviewTab();
|
55
|
+
rulerPage.steps.verifyPreviewTabRulerVisibilityButtonLabel('Show');
|
56
|
+
rulerPage.steps.clickOnRulerVisibilityButton();
|
57
|
+
utilities.verifyElementVisibilityState(rulerPage.rulerPreviewTab(), 'visible');
|
58
|
+
rulerPage.steps.verifyLengthOfRulerInPreview('12in');
|
59
|
+
rulerPage.steps.verifyColorOfRulerInPreview(1);
|
60
|
+
rulerPage.steps.verifyRulerOpacityInPreview('0.6');
|
61
|
+
rulerPage.steps.verifyRotationButtonWithDegreeVisible();
|
62
|
+
});
|
63
|
+
|
64
|
+
it('CSS of the \'Hide ruler\' button', { tags: 'css' }, () => {
|
65
|
+
utilities.verifyCSS(rulerPage.rulerVisibilityButtonPreviewTab(), {
|
66
|
+
'border': `1px solid ${css.color.activeButtons}`,
|
67
|
+
'background-color': css.color.defaultBackground,
|
68
|
+
'font-size': css.fontSize.normal,
|
69
|
+
'font-weight': css.fontWeight.semibold
|
70
|
+
});
|
71
|
+
});
|
72
|
+
|
73
|
+
it('Accessibility of \'Hide ruler\' button', { tags: 'a11y' }, () => {
|
74
|
+
cy.checkAccessibility(rulerPage.rulerVisibilityButtonPreviewTab().parents('[class*="ItemEnginestyles__MainWrapper"]'));
|
75
|
+
});
|
76
|
+
});
|
77
|
+
});
|
@@ -45,6 +45,7 @@ describe('Create item page: Feedback scale - Preview tab contents in all views f
|
|
45
45
|
feedbackScalePage.steps.addLegendText(1, optionsContentForTextLayout[1].legendText);
|
46
46
|
feedbackScalePage.steps.expandOptionAccordion(2);
|
47
47
|
feedbackScalePage.steps.addLegendText(2, optionsContentForTextLayout[2].legendText);
|
48
|
+
cy.wait(2000);
|
48
49
|
feedbackScalePage.steps.switchToPreviewTab();
|
49
50
|
break;
|
50
51
|
case 'Item view':
|
@@ -35,7 +35,9 @@ describe('Preview tab contents for all views', () => {
|
|
35
35
|
fillInTheGapsDragAndDropPage.steps.focusInOptionsInputField(1);
|
36
36
|
fillInTheGapsDragAndDropPage.steps.selectBoldOptionFromCKEditorToolbar();
|
37
37
|
fillInTheGapsDragAndDropPage.steps.addBoldTextInputToOptionsInputField(1);
|
38
|
-
fillInTheGapsDragAndDropPage.steps.clickAndDropOptionInDropzoneSpecifyCorrectAnswerSection({ '
|
38
|
+
fillInTheGapsDragAndDropPage.steps.clickAndDropOptionInDropzoneSpecifyCorrectAnswerSection({ 'Petals': 2 });
|
39
|
+
fillInTheGapsDragAndDropPage.steps.clickAndDropOptionInDropzoneSpecifyCorrectAnswerSection({ 'Solve the following': 1 });
|
40
|
+
fillInTheGapsDragAndDropPage.steps.clickAndDropOptionInDropzoneSpecifyCorrectAnswerSection({ 'This is a bold option': 0 });
|
39
41
|
fillInTheGapsDragAndDropPage.steps.allotPoints(10);
|
40
42
|
fillInTheGapsDragAndDropPage.steps.switchToPreviewTab();
|
41
43
|
break;
|
@@ -74,17 +74,20 @@ describe('Create item page - Image highlight - Preview contents in all views', (
|
|
74
74
|
utilities.verifyElementVisibilityState(imageHighlightPage.questionInstructionsText(), 'visible');
|
75
75
|
});
|
76
76
|
|
77
|
-
it('The uploaded image should be displayed
|
77
|
+
it('The uploaded image should be displayed in the preview tab', () => {
|
78
78
|
imageHighlightPage.steps.verifyImageUploadedPreviewTab();
|
79
79
|
imageHighlightPage.steps.verifyHighlightRegionCountInPreviewTab(3);
|
80
80
|
imageHighlightPage.steps.verifyImageUploadedAltTextPreviewTab('Image alternative text');
|
81
81
|
imageHighlightPage.steps.verifyImageUploadedWidthAndHeightPreviewTab('768', '432');
|
82
|
-
imageHighlightPage.steps.verifyHighlightRegionsInPreviewTab(0, flowerHighlightRegion);
|
83
|
-
imageHighlightPage.steps.verifyHighlightRegionsInPreviewTab(1, branchesHighlightRegion);
|
84
|
-
imageHighlightPage.steps.verifyHighlightRegionsInPreviewTab(2, leafHighlightRegion);
|
85
82
|
});
|
86
83
|
|
87
84
|
if (view !== 'Grading view' && view !== 'Correct answer view') {
|
85
|
+
it('The highlighted regions should be displayed', () => {
|
86
|
+
imageHighlightPage.steps.verifyHighlightRegionsInPreviewTab(0, flowerHighlightRegion);
|
87
|
+
imageHighlightPage.steps.verifyHighlightRegionsInPreviewTab(1, branchesHighlightRegion);
|
88
|
+
imageHighlightPage.steps.verifyHighlightRegionsInPreviewTab(2, leafHighlightRegion);
|
89
|
+
});
|
90
|
+
|
88
91
|
it('By default the highlighted sections should be hidden and when the user hovers over any highlighted section it should be visible', () => {
|
89
92
|
imageHighlightPage.steps.verifyHiddenHighlightRegion(0);
|
90
93
|
imageHighlightPage.steps.verifyHiddenHighlightRegion(1);
|
@@ -104,11 +107,22 @@ describe('Create item page - Image highlight - Preview contents in all views', (
|
|
104
107
|
imageHighlightPage.steps.verifyRegionIsNotHighlightedPreviewTab(0);
|
105
108
|
imageHighlightPage.steps.verifySelectedHighlightRegionInPreviewTab(1);
|
106
109
|
imageHighlightPage.steps.verifyRegionIsNotHighlightedPreviewTab(2);
|
110
|
+
imageHighlightPage.steps.removeHighlightOfARegionInPreviewTab(1);
|
107
111
|
});
|
108
112
|
} else if (view === 'Grading view') {
|
109
|
-
it('The
|
110
|
-
imageHighlightPage.steps.
|
111
|
-
imageHighlightPage.steps.
|
113
|
+
it('The highlighted regions should be displayed', () => {
|
114
|
+
imageHighlightPage.steps.verifyHighlightRegionsInPreviewTab(0, flowerHighlightRegion);
|
115
|
+
imageHighlightPage.steps.verifyHighlightRegionsInPreviewTab(1, leafHighlightRegion);
|
116
|
+
imageHighlightPage.steps.verifyHighlightRegionsInPreviewTab(2, branchesHighlightRegion);
|
117
|
+
});
|
118
|
+
|
119
|
+
it('The highlight regions should be displayed with correct border', () => {
|
120
|
+
utilities.verifyCSS(utilities.getNthElement(imageHighlightPage.highlightPolygonPreviewTab(), 0), {
|
121
|
+
'stroke': css.color.correctAnswer
|
122
|
+
});
|
123
|
+
utilities.verifyCSS(utilities.getNthElement(imageHighlightPage.highlightPolygonPreviewTab(), 1), {
|
124
|
+
'stroke': css.color.correctAnswer
|
125
|
+
});
|
112
126
|
});
|
113
127
|
|
114
128
|
it('User should not be able to select, de-select any highlight sections', () => {
|
@@ -118,10 +132,15 @@ describe('Create item page - Image highlight - Preview contents in all views', (
|
|
118
132
|
imageHighlightPage.steps.verifyRegionIsNotHighlightedPreviewTab(2);
|
119
133
|
});
|
120
134
|
} else {
|
135
|
+
it('The highlighted regions should be displayed', () => {
|
136
|
+
imageHighlightPage.steps.verifyHighlightRegionsInPreviewTab(0, flowerHighlightRegion);
|
137
|
+
imageHighlightPage.steps.verifyHighlightRegionsInPreviewTab(1, leafHighlightRegion);
|
138
|
+
imageHighlightPage.steps.verifyHighlightRegionsInPreviewTab(2, branchesHighlightRegion);
|
139
|
+
});
|
140
|
+
|
121
141
|
it('The highlight regions should be displayed with correct answers', () => {
|
122
142
|
imageHighlightPage.steps.verifyCorrectHighlightRegion(0);
|
123
|
-
imageHighlightPage.steps.
|
124
|
-
imageHighlightPage.steps.verifyCorrectHighlightRegion(2);
|
143
|
+
imageHighlightPage.steps.verifyCorrectHighlightRegion(1);
|
125
144
|
});
|
126
145
|
}
|
127
146
|
|
@@ -177,17 +177,17 @@ describe('Create item page - Charts - Dot plot: Scoring section', () => {
|
|
177
177
|
chartsDotPlotPage.tests.verifyContentsOfSpecifyCorrectAnswerSection();
|
178
178
|
|
179
179
|
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', () => {
|
180
|
-
utilities.verifyInnerText(utilities.getNthElement(chartsDotPlotPage.
|
181
|
-
utilities.verifyInnerText(utilities.getNthElement(chartsDotPlotPage.
|
182
|
-
utilities.verifyInnerText(utilities.getNthElement(chartsDotPlotPage.
|
183
|
-
utilities.verifyInnerText(utilities.getNthElement(chartsDotPlotPage.
|
184
|
-
utilities.verifyElementCount(chartsDotPlotPage.
|
180
|
+
utilities.verifyInnerText(utilities.getNthElement(chartsDotPlotPage.partialDifferentWeightsPointsInputFieldLabel(), 0), '1');
|
181
|
+
utilities.verifyInnerText(utilities.getNthElement(chartsDotPlotPage.partialDifferentWeightsPointsInputFieldLabel(), 1), '2');
|
182
|
+
utilities.verifyInnerText(utilities.getNthElement(chartsDotPlotPage.partialDifferentWeightsPointsInputFieldLabel(), 2), '3');
|
183
|
+
utilities.verifyInnerText(utilities.getNthElement(chartsDotPlotPage.partialDifferentWeightsPointsInputFieldLabel(), 3), '4')
|
184
|
+
utilities.verifyElementCount(chartsDotPlotPage.partialDifferentWeightsPointsInputFieldLabel(), 4);
|
185
185
|
utilities.verifyElementCount(chartsDotPlotPage.pointsInputField(), 4);
|
186
186
|
});
|
187
187
|
|
188
188
|
it('When user adds one more label on number line axis, then label for newly added label should be displayed with input field', () => {
|
189
189
|
chartsDotPlotPage.steps.enterTextInMaxInputField(5);
|
190
|
-
utilities.verifyInnerText(utilities.getNthElement(chartsDotPlotPage.
|
190
|
+
utilities.verifyInnerText(utilities.getNthElement(chartsDotPlotPage.partialDifferentWeightsPointsInputFieldLabel(), 4), '5');
|
191
191
|
utilities.verifyElementVisibilityState(utilities.getNthElement(chartsDotPlotPage.pointsInputField(), 4), 'visible');
|
192
192
|
chartsDotPlotPage.steps.verifyPartialDifferentWeightsPointsInputFieldIsEmpty();
|
193
193
|
});
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import utilities from "../support/helpers/utilities"
|
2
|
-
import { barAndLineChartComponent, chartsCommonComponent, createQuestionBasePage, questionInstructionsComponent, resetPopupComponent, scoringSectionBaseEditTab, commonComponents, autoScoredStudentViewSettings, autoScoredScoringPreviewTab, autoScoredScoringSectionMultiResponseType, autoScoredSpecifyCorrectAnswerSection, correctIncorrectAnswerLabelComponent, studentViewSettingsLabelComponent, layoutSectionComponent } from "./components";
|
2
|
+
import { barAndLineChartComponent, chartsCommonComponent, createQuestionBasePage, questionInstructionsComponent, resetPopupComponent, scoringSectionBaseEditTab, commonComponents, autoScoredStudentViewSettings, autoScoredScoringPreviewTab, autoScoredScoringSectionMultiResponseType, autoScoredSpecifyCorrectAnswerSection, correctIncorrectAnswerLabelComponent, studentViewSettingsLabelComponent, layoutSectionComponent, additionalSettingsPanel, additionalSettingsAccessibilitySectionComponent } from "./components";
|
3
3
|
import { dialogBoxBase } from "./dialogBoxBase";
|
4
4
|
import { selectQuestionResourceToolPage } from "./selectQuestionResourceToolPage";
|
5
5
|
const css = Cypress.env('css');
|
@@ -13,10 +13,12 @@ const selectors = {
|
|
13
13
|
...autoScoredScoringPreviewTab,
|
14
14
|
...autoScoredScoringPreviewTab,
|
15
15
|
...correctIncorrectAnswerLabelComponent,
|
16
|
-
...chartsCommonComponent,
|
17
16
|
...autoScoredSpecifyCorrectAnswerSection,
|
18
17
|
...layoutSectionComponent,
|
18
|
+
...additionalSettingsPanel,
|
19
19
|
...selectQuestionResourceToolPage,
|
20
|
+
...autoScoredScoringSectionMultiResponseType,
|
21
|
+
...chartsCommonComponent,
|
20
22
|
|
21
23
|
barDragHandle: () => cy.get('.bar-drag-handle'),
|
22
24
|
bar: () => cy.get('.ngie-chart-point'),
|
@@ -86,6 +88,7 @@ const steps = {
|
|
86
88
|
...layoutSectionComponent.steps,
|
87
89
|
...chartsCommonComponent.steps,
|
88
90
|
...dialogBoxBase.steps,
|
91
|
+
...additionalSettingsPanel.steps,
|
89
92
|
...selectQuestionResourceToolPage.steps,
|
90
93
|
/**
|
91
94
|
* @description set the bar height/value in the select chart type section chart
|
@@ -1203,6 +1206,14 @@ const steps = {
|
|
1203
1206
|
chartsBarPage.selectChartTypeMaxXAndYInputField()
|
1204
1207
|
.should('have.value', value);
|
1205
1208
|
},
|
1209
|
+
|
1210
|
+
/**
|
1211
|
+
* verify the displayed penalty points for each incorrect bar
|
1212
|
+
* @param {number} penaltyPoints displayed penalty points
|
1213
|
+
*/
|
1214
|
+
verifyPenaltyPointsForEachIncorrectBar: (penaltyPoints) => {
|
1215
|
+
utilities.verifyInnerText(autoScoredScoringSectionMultiResponseType.penaltyPointsDetailsSectionAllottedPointsLabel(), `Penalty points for each incorrect bar: ${penaltyPoints}`);
|
1216
|
+
},
|
1206
1217
|
}
|
1207
1218
|
|
1208
1219
|
const tests = {
|
@@ -1214,7 +1225,13 @@ const tests = {
|
|
1214
1225
|
...layoutSectionComponent.tests,
|
1215
1226
|
...createQuestionBasePage.tests,
|
1216
1227
|
...commonComponents.tests,
|
1217
|
-
|
1228
|
+
...layoutSectionComponent.tests,
|
1229
|
+
...additionalSettingsPanel.tests,
|
1230
|
+
...additionalSettingsAccessibilitySectionComponent.tests,
|
1231
|
+
...questionInstructionsComponent.tests,
|
1232
|
+
...scoringSectionBaseEditTab.tests,
|
1233
|
+
...autoScoredScoringSectionMultiResponseType.tests,
|
1234
|
+
...chartsCommonComponent.tests,
|
1218
1235
|
/**
|
1219
1236
|
* Verify bar tooltip contents with css and a11y in preview tab
|
1220
1237
|
* @param {number} barIndex index of the bar
|
@@ -1321,7 +1338,7 @@ const tests = {
|
|
1321
1338
|
});
|
1322
1339
|
|
1323
1340
|
it('Accessibility of \'Correct\' accordion contents', { tags: 'a11y' }, () => {
|
1324
|
-
cy.checkAccessibility(
|
1341
|
+
cy.checkAccessibility(chartsBarPage.specifyCorrectAnswerBar().parents('.ngie-accordion-detail'));
|
1325
1342
|
});
|
1326
1343
|
},
|
1327
1344
|
|
@@ -1422,6 +1439,16 @@ const tests = {
|
|
1422
1439
|
utilities.verifyElementVisibilityState(chartsBarPage.barAndPointTooltipWrapper(), 'notExist');
|
1423
1440
|
});
|
1424
1441
|
},
|
1442
|
+
|
1443
|
+
verifyContentsOfSpecifyCorrectAnswerSection: () => {
|
1444
|
+
it('When user selects a scoring type then in the \'Correct\' accordion, all the contents should be displayed', () => {
|
1445
|
+
chartsCommonComponent.steps.verifyGraphTitleInSpecifyCorrectAnswer('Graph title');
|
1446
|
+
chartsCommonComponent.steps.verifyXAxisLabelInSpecifyCorrectAnswer('Label');
|
1447
|
+
utilities.verifyTextContent(barAndLineChartComponent.yAxisLabelSpecifyCorrectAnswer(), 'Label');
|
1448
|
+
utilities.verifyElementVisibilityState(chartsBarPage.barDragHandle(), 'exist');
|
1449
|
+
utilities.verifyTextContent(utilities.getNthElement(barAndLineChartComponent.yAxisCoordinateSpecifyCorrectAnswer(), 0), '10');
|
1450
|
+
});
|
1451
|
+
},
|
1425
1452
|
}
|
1426
1453
|
|
1427
1454
|
export const chartsBarPage = {
|