itemengine-cypress-automation 1.0.31 → 1.0.36
Sign up to get free protection for your applications and to get access to all the features.
- package/cypress/e2e/ILC/FillInTheGapsDropdown/fillInTheGapsDropdownAdditionalSettings.js +1 -415
- package/cypress/e2e/ILC/FillInTheGapsDropdown/fillInTheGapsDropdownAdditionalSettingsBasic.js +423 -0
- package/cypress/e2e/ILC/FillInTheGapsDropdown/fillInTheGapsDropdownAllOrNothingScoring.js +48 -0
- package/cypress/e2e/ILC/FillInTheGapsDropdown/{fillInTheGapsDropdownAutoScoredScoring.js → fillInTheGapsDropdownAllOrNothingScoringWithAlternateAnswer.js} +1 -37
- package/cypress/e2e/ILC/FillInTheGapsDropdown/fillInTheGapsDropdownPartialDifferentWeights.js +59 -0
- package/cypress/e2e/ILC/FillInTheGapsDropdown/{fillInTheGapsDropdownScoringPartialDifferentWeights.js → fillInTheGapsDropdownPartialDifferentWeightsWithAlternateAnswer.js} +1 -47
- package/cypress/e2e/ILC/FillInTheGapsDropdown/fillInTheGapsDropdownPartialEqualWeights.js +1 -63
- package/cypress/e2e/ILC/FillInTheGapsDropdown/fillInTheGapsDropdownPartialEqualWeightsWithAlternateAnswer.js +73 -0
- package/cypress/e2e/ILC/ListMatching/listMatchingAdditionalSettingsAnswerNumerationAndResponseOptionPlacement.js +196 -0
- package/cypress/e2e/ILC/ListMatching/listMatchingAdditionalSettingsBasic.js +210 -0
- package/cypress/e2e/ILC/ListMatching/listMatchingAdditionalSettingsStemAndResponseColumnHeader.js +206 -0
- package/cypress/e2e/ILC/ListMatching/listMatchingAlternateAnswer.js +193 -0
- package/cypress/e2e/ILC/ListMatching/listMatchingClickAndDrop.js +644 -0
- package/cypress/e2e/ILC/ListMatching/listMatchingEditTabScoringTypes.js +105 -0
- package/cypress/e2e/ILC/ListMatching/listMatchingGroupedOptionsAllOrNothingScoring.js +117 -0
- package/cypress/e2e/ILC/ListMatching/listMatchingGroupedOptionsAllOrNothingScoringWithAlternateAnswer.js +30 -0
- package/cypress/e2e/ILC/ListMatching/listMatchingGroupedOptionsManualAndNonScoredScoring.js +49 -0
- package/cypress/e2e/ILC/ListMatching/listMatchingGroupedOptionsPartialDifferentScoringWithAlternateTab.js +36 -0
- package/cypress/e2e/ILC/ListMatching/listMatchingGroupedOptionsPartialDifferentScorings.js +49 -0
- package/cypress/e2e/ILC/ListMatching/listMatchingGroupedOptionsPartialEqualWeightsScoring.js +48 -0
- package/cypress/e2e/ILC/ListMatching/listMatchingGroupedOptionsPartialEqualWeightsScoringWithAlternateTab.js +36 -0
- package/cypress/e2e/ILC/ListMatching/listMatchingGroupedOptionsSection.js +207 -0
- package/cypress/e2e/ILC/ListMatching/listMatchingGroupedOptionsSetCorrectAnswersCheckboxesEditTab.js +139 -0
- package/cypress/e2e/ILC/ListMatching/listMatchingGroupedOptionsSetCorrectAnswersCheckboxesPreviewTab.js +227 -0
- package/cypress/e2e/ILC/ListMatching/listMatchingHeaderSection.js +95 -0
- package/cypress/e2e/ILC/ListMatching/listMatchingQuestionInstructionsAndStemsSection.js +246 -0
- package/cypress/e2e/ILC/ListMatching/listMatchingScoringSectionBasic.js +21 -0
- package/cypress/e2e/ILC/ListMatching/listMatchingSetCorrectAnswerSectionBasic.js +40 -0
- package/cypress/e2e/ILC/ListMatching/listMatchingStandardOptionsAllOrNothingScoring.js +113 -0
- package/cypress/e2e/ILC/ListMatching/listMatchingStandardOptionsAllOrNothingScoringWithAlternateAnswer.js +30 -0
- package/cypress/e2e/ILC/ListMatching/listMatchingStandardOptionsManualAndNonScoredScoring.js +48 -0
- package/cypress/e2e/ILC/ListMatching/listMatchingStandardOptionsPartialDIfferentScoring.js +49 -0
- package/cypress/e2e/ILC/ListMatching/listMatchingStandardOptionsPartialDifferentScoringWithAlternateAnswer.js +36 -0
- package/cypress/e2e/ILC/ListMatching/listMatchingStandardOptionsPartialEqualScoring.js +48 -0
- package/cypress/e2e/ILC/ListMatching/listMatchingStandardOptionsPartialEqualScoringWithAlternateAnswer.js +35 -0
- package/cypress/e2e/ILC/ListMatching/listMatchingStandardOptionsSection.js +233 -0
- package/cypress/e2e/ILC/ListMatching/listMatchingStandardOptionsSetCorrectAnswerCheckboxesEditTab.js +113 -0
- package/cypress/e2e/ILC/ListMatching/listMatchingStandardOptionsSetCorrectAnswerCheckboxesPreviewTab.js +185 -0
- package/cypress/e2e/ILC/ListMatching/listMatchingSwitchingCases.js +47 -0
- package/cypress/e2e/ILC/ListOrdering/listOrderingAdditionalSettingsAnswerNumerationAndOptionLabel.js +295 -0
- package/cypress/e2e/ILC/ListOrdering/listOrderingAdditionalSettingsBasic.js +300 -0
- package/cypress/e2e/ILC/ListOrdering/listOrderingAdditionalSettingsOptionStyleDropdown.js +302 -0
- package/cypress/e2e/ILC/ListOrdering/listOrderingAdditionalSettingsSetPointsPopup.js +273 -0
- package/cypress/e2e/ILC/ListOrdering/listOrderingAllOrNothingScoring.js +178 -0
- package/cypress/e2e/ILC/ListOrdering/listOrderingAllOrNothingScoringWithAlternateAnswer.js +712 -0
- package/cypress/e2e/ILC/ListOrdering/listOrderingEditTabBasicSection.js +316 -0
- package/cypress/e2e/ILC/ListOrdering/listOrderingEditTabScoringSection.js +256 -0
- package/cypress/e2e/ILC/ListOrdering/listOrderingHeaderSection.js +83 -0
- package/cypress/e2e/ILC/ListOrdering/listOrderingManuallyAndNonScoredScoring.js +160 -0
- package/cypress/e2e/ILC/ListOrdering/listOrderingPartialDifferentWeightsScoring.js +191 -0
- package/cypress/e2e/ILC/ListOrdering/listOrderingPartialDifferentWeightsScoringWithAlternateAnswer.js +895 -0
- package/cypress/e2e/ILC/ListOrdering/listOrderingPartialEqualWeightsScoring.js +191 -0
- package/cypress/e2e/ILC/ListOrdering/listOrderingPartialEqualWeightsScoringWithAlternateAnswer.js +807 -0
- package/cypress/e2e/ILC/ListOrdering/listOrderingSetCorrectAnswerCheckboxes.js +208 -0
- package/cypress/e2e/ILC/ListOrdering/listOrderingSetCorrectAnswerSection.js +172 -0
- package/cypress/e2e/ILC/ListSorting/listSortingAdditionalSettings.js +820 -0
- package/cypress/e2e/ILC/ListSorting/listSortingAutoScoredScoring.js +936 -0
- package/cypress/e2e/ILC/ListSorting/listSortingClickAndDrop.js +456 -0
- package/cypress/e2e/ILC/ListSorting/listSortingEditTabBasicSection.js +440 -0
- package/cypress/e2e/ILC/ListSorting/listSortingEditTabScoringSection.js +259 -0
- package/cypress/e2e/ILC/ListSorting/listSortingHeaderSection.js +89 -0
- package/cypress/e2e/ILC/ListSorting/listSortingManuallyAndNonScoredScoring.js +171 -0
- package/cypress/e2e/ILC/ListSorting/listSortingPartialDifferentWeightsScoring.js +1150 -0
- package/cypress/e2e/ILC/ListSorting/listSortingPartialEqualWeightsScoring.js +1055 -0
- package/cypress/e2e/ILC/ListSorting/listSortingSetCorrectAnswerCheckboxes.js +263 -0
- package/cypress/e2e/ILC/ListSorting/listSortingSetCorrectAnswerSection.js +168 -0
- package/package.json +1 -1
@@ -0,0 +1,259 @@
|
|
1
|
+
import { listSortingPage } from "../../../pages/listSortingPage";
|
2
|
+
import abortEarlySetup from "../../../support/helpers/abortEarly";
|
3
|
+
import utilities from "../../../support/helpers/utilities";
|
4
|
+
const css = Cypress.env('css');
|
5
|
+
|
6
|
+
let options = ['plant', 'sprout', 'flower', 'seed'];
|
7
|
+
|
8
|
+
describe('Create Item page - List sorting: Edit tab scoring types and set correct answer section (Correct answer tab)', () => {
|
9
|
+
before(() => {
|
10
|
+
cy.loginAs('admin');
|
11
|
+
});
|
12
|
+
|
13
|
+
describe('Scoring section contents', () => {
|
14
|
+
abortEarlySetup();
|
15
|
+
before(() => {
|
16
|
+
cy.log('Navigating to list sorting question type');
|
17
|
+
listSortingPage.steps.navigateToCreateQuestion('list sorting');
|
18
|
+
cy.barsPreLoaderWait()
|
19
|
+
});
|
20
|
+
|
21
|
+
listSortingPage.tests.verifyScoringTypeLabelAndDropdown('autoScored');
|
22
|
+
});
|
23
|
+
|
24
|
+
describe('Edit tab \'Set correct answer\' section (Correct answer tab) and \'Scoring\' section for Auto scored: All or Nothing scoring type', () => {
|
25
|
+
abortEarlySetup();
|
26
|
+
before(() => {
|
27
|
+
cy.log('Add question instructions, question stem, options and set correct answers');
|
28
|
+
listSortingPage.steps.navigateToCreateQuestion('list sorting');
|
29
|
+
cy.barsPreLoaderWait()
|
30
|
+
listSortingPage.steps.addQuestionInstructions();
|
31
|
+
listSortingPage.steps.addInputToOptionsInputField(options);
|
32
|
+
});
|
33
|
+
|
34
|
+
listSortingPage.tests.verifyAutoScoredAllOrNothingPointsAndMinimumScoreAwardedLabelAndInputField();
|
35
|
+
|
36
|
+
listSortingPage.tests.verifyAllContentsOfSetCorrectAnswerSectionForScoringType('All or nothing', options);
|
37
|
+
|
38
|
+
listSortingPage.tests.verifyPointsFieldErrorState(10);
|
39
|
+
|
40
|
+
listSortingPage.tests.verifyMinimumScoreIfAttemptedFieldErrorState(10, 20, 10);
|
41
|
+
});
|
42
|
+
|
43
|
+
describe('Edit tab \'Set correct answer\' section (Correct answer tab) and \'Scoring\' section for Auto scored: Partial equal weights scoring type', () => {
|
44
|
+
abortEarlySetup();
|
45
|
+
before(() => {
|
46
|
+
cy.log('Navigating to list sorting question type');
|
47
|
+
listSortingPage.steps.navigateToCreateQuestion('list sorting');
|
48
|
+
cy.barsPreLoaderWait()
|
49
|
+
listSortingPage.steps.addQuestionInstructions();
|
50
|
+
listSortingPage.steps.addInputToOptionsInputField(options);
|
51
|
+
});
|
52
|
+
|
53
|
+
it('When Scoring type dropdown has Auto scored selected then user should be able to select \'Partial - equal weights\' scoring type', () => {
|
54
|
+
utilities.verifyInnerText(listSortingPage.scoringTypeDropdown(), 'Auto scored')
|
55
|
+
listSortingPage.steps.selectPartialEqualWeightsCheckbox();
|
56
|
+
});
|
57
|
+
|
58
|
+
it('When the Points input field is empty and the user has switched to \'Partial - equal weights\' scoring, then \'Points per response\' label should be displayed and a \'-\' should be displayed besides column, \'Penalty Points\' and \'Minimum score awarded (if attempted)\' labels and input fields should be displayed and \'Round down score\' label and checkbox should be displayed and by default it should be checked', () => {
|
59
|
+
listSortingPage.steps.verifyDefaultPointsLabelAndInputField();
|
60
|
+
utilities.verifyInnerText(listSortingPage.pointsPerResponseLabel(), 'Points per response');
|
61
|
+
utilities.verifyElementVisibilityState(listSortingPage.pointsPerResponseLabel(), 'visible');
|
62
|
+
listSortingPage.steps.verifyPartialEqualWeightsPointsPerResponseScore('-');
|
63
|
+
listSortingPage.steps.verifyDefaultPenaltyPointsInputFieldAndLabel();
|
64
|
+
listSortingPage.steps.verifyDefaultMinimumScoreIfAttemptedLabelAndPointsField()
|
65
|
+
listSortingPage.steps.verifyDefaultRoundDownScoreCheckboxCheckedAndLabel();
|
66
|
+
});
|
67
|
+
|
68
|
+
it('When user gives a score input to \'Points\' input field, then the score should be equally divided and displayed besides each response under the \'Points per response\' label', () => {
|
69
|
+
listSortingPage.steps.allotPoints('20');
|
70
|
+
listSortingPage.steps.verifyPartialEqualWeightsPointsPerResponseScore('5');
|
71
|
+
});
|
72
|
+
|
73
|
+
listSortingPage.tests.verifyAllContentsOfSetCorrectAnswerSectionForScoringType('Partial equal weights', options);
|
74
|
+
|
75
|
+
it('When user adds a option then the Points per response should be updated accordingly', () => {
|
76
|
+
listSortingPage.steps.addOption();
|
77
|
+
listSortingPage.steps.verifyPartialEqualWeightsPointsPerResponseScore('4');
|
78
|
+
});
|
79
|
+
|
80
|
+
it('When user deletes a option then the Points per response should be updated accordingly', () => {
|
81
|
+
listSortingPage.steps.deleteOption(0);
|
82
|
+
listSortingPage.steps.verifyPartialEqualWeightsPointsPerResponseScore('5');
|
83
|
+
});
|
84
|
+
|
85
|
+
it('User should be able to enter points in \'Penalty Points\' and \'Minimum score awarded (if attempted)\' input fields', () => {
|
86
|
+
listSortingPage.steps.allotPenaltyPoints(2);
|
87
|
+
listSortingPage.steps.allotMinimumScoreAwardedIfAttempted(1);
|
88
|
+
});
|
89
|
+
|
90
|
+
it('CSS of \'Points per response\' label and its displayed score, \'Penalty Points\' and \'Minimum score awarded (if attempted)\' and \'Round down score\' checkbox', { tags: 'css' }, () => {
|
91
|
+
utilities.verifyCSS(listSortingPage.pointsPerResponseLabel(), {
|
92
|
+
'color': css.color.labels,
|
93
|
+
'font-size': css.fontSize.normal,
|
94
|
+
'font-weight': css.fontWeight.semibold
|
95
|
+
});
|
96
|
+
utilities.verifyCSS(listSortingPage.partialEqualWeightsPointsPerResponseScore(), {
|
97
|
+
'color': css.color.text,
|
98
|
+
'font-size': css.fontSize.default,
|
99
|
+
'font-weight': css.fontWeight.regular
|
100
|
+
});
|
101
|
+
utilities.verifyCSS(listSortingPage.minimumScoreIfAttemptedLabel(), {
|
102
|
+
'color': css.color.labels,
|
103
|
+
'font-size': css.fontSize.normal,
|
104
|
+
'font-weight': css.fontWeight.semibold
|
105
|
+
});
|
106
|
+
utilities.verifyCSS(listSortingPage.rounddownScoreCheckboxLabel(), {
|
107
|
+
'color': css.color.labelText,
|
108
|
+
'font-size': css.fontSize.normal,
|
109
|
+
'font-weight': css.fontWeight.regular
|
110
|
+
});
|
111
|
+
});
|
112
|
+
|
113
|
+
it('Accessibility of \'Penalty Points\' and \'Minimum score awarded (if attempted)\' input field and \'Round down score\' checkbox', { tags: 'a11y' }, () => {
|
114
|
+
cy.checkAccessibility(listSortingPage.penaltyPointsInputField().parents('.points-container'));
|
115
|
+
cy.checkAccessibility(listSortingPage.rounddownScoreCheckbox().parents('.round-down-score-wrapper'));
|
116
|
+
});
|
117
|
+
|
118
|
+
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', () => {
|
119
|
+
listSortingPage.steps.selectAllOrNothingCheckbox()
|
120
|
+
utilities.verifyElementVisibilityState(listSortingPage.pointsPerResponseLabel(), 'notExist');
|
121
|
+
utilities.verifyElementVisibilityState(listSortingPage.partialEqualWeightsPointsPerResponseScore(), 'notExist');
|
122
|
+
listSortingPage.steps.verifyPointsFieldValue('20');
|
123
|
+
});
|
124
|
+
|
125
|
+
it('When user has entered points in \'All or nothing\' scoring type and switches to \'Partial equal weights\' scoring type, then the score should be equally divided and displayed besides each response under the \'Points per response\' label', () => {
|
126
|
+
listSortingPage.steps.allotPoints('9');
|
127
|
+
listSortingPage.steps.selectPartialEqualWeightsCheckbox();
|
128
|
+
listSortingPage.steps.verifyPartialEqualWeightsPointsPerResponseScore('2.25');
|
129
|
+
});
|
130
|
+
});
|
131
|
+
|
132
|
+
describe('Edit tab \'Set correct answer\' section (Correct answer tab) and \'Scoring\' section for AutoScored: Partial different weights scoring type', () => {
|
133
|
+
abortEarlySetup();
|
134
|
+
before(() => {
|
135
|
+
cy.log('Navigating to list sorting question type');
|
136
|
+
listSortingPage.steps.navigateToCreateQuestion('list sorting');
|
137
|
+
cy.barsPreLoaderWait();
|
138
|
+
listSortingPage.steps.addQuestionInstructions();
|
139
|
+
listSortingPage.steps.addInputToOptionsInputField(options);
|
140
|
+
});
|
141
|
+
|
142
|
+
it('When Scoring type dropdown has Auto scored selected then then user should be able to select \'Partial - different weights\' scoring', () => {
|
143
|
+
utilities.verifyInnerText(listSortingPage.scoringTypeDropdown(), 'Auto scored');
|
144
|
+
listSortingPage.steps.selectPartialDifferentWeightsCheckbox();
|
145
|
+
});
|
146
|
+
|
147
|
+
it('When the user has switched to \'Partial - different weights\' scoring, then \'Points per response\' label should be displayed and a points input field should be displayed besides each response option, \'Penalty Points\' and \'Minimum score awarded (if attempted)\' labels and input fields should be displayed and \'Round down score\' checkbox should be displayed and by default it should be checked', () => {
|
148
|
+
utilities.verifyInnerText(listSortingPage.pointsPerResponseLabel(), 'Points per response');
|
149
|
+
utilities.verifyElementVisibilityState(listSortingPage.pointsPerResponseLabel(), 'visible');
|
150
|
+
listSortingPage.steps.verifyPartialDifferentWeightsPointsInputFieldIsEmptyAndEnabled();
|
151
|
+
listSortingPage.steps.verifyDefaultPenaltyPointsInputFieldAndLabel();
|
152
|
+
listSortingPage.steps.verifyDefaultMinimumScoreIfAttemptedLabelAndPointsField()
|
153
|
+
listSortingPage.steps.verifyDefaultRoundDownScoreCheckboxCheckedAndLabel();
|
154
|
+
});
|
155
|
+
|
156
|
+
it('CSS of disabled points input field', { tags: 'css' }, () => {
|
157
|
+
utilities.verifyCSS(listSortingPage.pointsInputField(), {
|
158
|
+
'opacity': '1',
|
159
|
+
});
|
160
|
+
utilities.verifyCSS(listSortingPage.pointsInputField().next('fieldset'), {
|
161
|
+
'color': css.color.text,
|
162
|
+
'font-size': css.fontSize.default,
|
163
|
+
'font-weight': css.fontWeight.regular
|
164
|
+
});
|
165
|
+
});
|
166
|
+
|
167
|
+
it('Accessibility of disabled Points field', { tags: 'a11y' }, () => {
|
168
|
+
cy.checkAccessibility(listSortingPage.pointsInputField().parents('.context-wrapper'));
|
169
|
+
});
|
170
|
+
|
171
|
+
listSortingPage.tests.verifyAllContentsOfSetCorrectAnswerSectionForScoringType('Partial different weights', options);
|
172
|
+
|
173
|
+
it('User should be able to give a score input to \'Points per response\' input fields', () => {
|
174
|
+
listSortingPage.steps.allotPartialDifferentWeightsToAllPointsFields([4.2, 1.8, 3.7, 2.3]);
|
175
|
+
});
|
176
|
+
|
177
|
+
it('User should be able to enter points in \'Penalty Points\' and \'Minimum score awarded (if attempted)\' input fields', () => {
|
178
|
+
listSortingPage.steps.allotPenaltyPoints(2);
|
179
|
+
listSortingPage.steps.allotMinimumScoreAwardedIfAttempted(1);
|
180
|
+
});
|
181
|
+
|
182
|
+
it('CSS of \'Points per response\' label, \'Penalty Points\' and \'Minimum score awarded (if attempted)\' and \'Round down score\' checkbox', { tags: 'css' }, () => {
|
183
|
+
utilities.verifyCSS(listSortingPage.pointsInputField().next('fieldset'), {
|
184
|
+
'color': css.color.text,
|
185
|
+
'font-size': css.fontSize.default,
|
186
|
+
'font-weight': css.fontWeight.regular
|
187
|
+
});
|
188
|
+
utilities.verifyCSS(listSortingPage.pointsPerResponseLabel(), {
|
189
|
+
'color': css.color.labels,
|
190
|
+
'font-size': css.fontSize.normal,
|
191
|
+
'font-weight': css.fontWeight.semibold
|
192
|
+
});
|
193
|
+
utilities.verifyCSS(listSortingPage.penaltyPointsLabel(), {
|
194
|
+
'color': css.color.labels,
|
195
|
+
'font-size': css.fontSize.normal,
|
196
|
+
'font-weight': css.fontWeight.semibold
|
197
|
+
});
|
198
|
+
utilities.verifyCSS(listSortingPage.minimumScoreIfAttemptedLabel(), {
|
199
|
+
'color': css.color.labels,
|
200
|
+
'font-size': css.fontSize.normal,
|
201
|
+
'font-weight': css.fontWeight.semibold
|
202
|
+
});
|
203
|
+
utilities.verifyCSS(listSortingPage.rounddownScoreCheckboxLabel(), {
|
204
|
+
'color': css.color.labelText,
|
205
|
+
'font-size': css.fontSize.normal,
|
206
|
+
'font-weight': css.fontWeight.regular
|
207
|
+
});
|
208
|
+
});
|
209
|
+
|
210
|
+
it('Accessibility of \'Points per response\', \'Penalty Points\' and \'Minimum score awarded (if attempted)\' input fields and \'Round down score\' checkbox', { tags: 'a11y' }, () => {
|
211
|
+
cy.checkAccessibility(listSortingPage.pointsInputField());
|
212
|
+
cy.checkAccessibility(listSortingPage.penaltyPointsInputField().parents('.points-container'));
|
213
|
+
cy.checkAccessibility(listSortingPage.rounddownScoreCheckbox().parents('.round-down-score-wrapper'));
|
214
|
+
});
|
215
|
+
|
216
|
+
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', () => {
|
217
|
+
listSortingPage.steps.selectAllOrNothingCheckbox()
|
218
|
+
utilities.verifyElementVisibilityState(listSortingPage.pointsPerResponseLabel(), 'notExist');
|
219
|
+
utilities.verifyElementCount(listSortingPage.pointsInputField(), 1);
|
220
|
+
listSortingPage.steps.verifyPointsFieldValue('12');
|
221
|
+
});
|
222
|
+
|
223
|
+
it('When user has entered points in \'All or nothing\' scoring type and switches to \'Partial different weights\' scoring type, then the points allocated should get equally divided between each correct response', () => {
|
224
|
+
listSortingPage.steps.clearPointsField();
|
225
|
+
listSortingPage.steps.allotPoints('8');
|
226
|
+
listSortingPage.steps.selectPartialDifferentWeightsCheckbox();
|
227
|
+
listSortingPage.steps.verifyPartialDifferentWeightsPointsInputFieldValue(['2', '2', '2', '2']);
|
228
|
+
});
|
229
|
+
});
|
230
|
+
|
231
|
+
describe('Edit tab \'Set correct answer\' section (Correct answer tab) and \'Scoring\' section for Manually Scored scoring type', () => {
|
232
|
+
abortEarlySetup();
|
233
|
+
before(() => {
|
234
|
+
cy.log('Navigating to list sorting question type');
|
235
|
+
listSortingPage.steps.navigateToCreateQuestion('list sorting');
|
236
|
+
cy.barsPreLoaderWait()
|
237
|
+
listSortingPage.steps.addQuestionInstructions();
|
238
|
+
listSortingPage.steps.addInputToOptionsInputField(options);
|
239
|
+
});
|
240
|
+
|
241
|
+
//Failing due to - https://redmine.zeuslearning.com/issues/540368
|
242
|
+
listSortingPage.tests.verifyManualScoringEditTabFunctionality();
|
243
|
+
});
|
244
|
+
|
245
|
+
describe('Edit tab \'Set correct answer\' section (Correct answer tab) and \'Scoring\' section for Non Scored scoring type', () => {
|
246
|
+
abortEarlySetup();
|
247
|
+
before(() => {
|
248
|
+
cy.log('Navigating to list sorting question type');
|
249
|
+
listSortingPage.steps.navigateToCreateQuestion('list sorting');
|
250
|
+
cy.barsPreLoaderWait()
|
251
|
+
listSortingPage.steps.addQuestionInstructions();
|
252
|
+
listSortingPage.steps.addInputToOptionsInputField(options);
|
253
|
+
});
|
254
|
+
|
255
|
+
listSortingPage.tests.verifyEditTabNonScoredScoringSectionContents();
|
256
|
+
|
257
|
+
listSortingPage.tests.verifyAllContentsOfSetCorrectAnswerSectionForScoringType('Non scored', options);
|
258
|
+
});
|
259
|
+
});
|
@@ -0,0 +1,89 @@
|
|
1
|
+
import { dialogBoxBase, listSortingPage } from "../../../pages";
|
2
|
+
import abortEarlySetup from "../../../support/helpers/abortEarly";
|
3
|
+
|
4
|
+
let options = ['sprout', 'seed', 'plant', 'flower'];
|
5
|
+
|
6
|
+
describe('Create question page - list sorting: Header section and Saving question', () => {
|
7
|
+
before(() => {
|
8
|
+
cy.loginAs('admin');
|
9
|
+
});
|
10
|
+
|
11
|
+
describe('Header section contents', () => {
|
12
|
+
abortEarlySetup();
|
13
|
+
before(() => {
|
14
|
+
cy.log('Navigating to list sorting question type');
|
15
|
+
listSortingPage.steps.navigateToCreateQuestion('list sorting')
|
16
|
+
});
|
17
|
+
|
18
|
+
listSortingPage.tests.verifyCreateQuestionPageQuestionTypeHeader('List sorting');
|
19
|
+
});
|
20
|
+
|
21
|
+
describe('Tabs section', () => {
|
22
|
+
abortEarlySetup();
|
23
|
+
before(() => {
|
24
|
+
cy.log('Navigating to list sorting question type');
|
25
|
+
listSortingPage.steps.navigateToCreateQuestion('list sorting')
|
26
|
+
});
|
27
|
+
|
28
|
+
listSortingPage.tests.verifyTabsSection();
|
29
|
+
});
|
30
|
+
|
31
|
+
describe('Cancel button', () => {
|
32
|
+
abortEarlySetup();
|
33
|
+
before(() => {
|
34
|
+
cy.log('Navigating to list sorting question type');
|
35
|
+
listSortingPage.steps.navigateToCreateQuestion('list sorting')
|
36
|
+
});
|
37
|
+
|
38
|
+
listSortingPage.tests.verifyCancelButton('list sorting');
|
39
|
+
});
|
40
|
+
|
41
|
+
describe('Save Question button', () => {
|
42
|
+
abortEarlySetup();
|
43
|
+
before(() => {
|
44
|
+
cy.log('Navigating to list sorting question type');
|
45
|
+
listSortingPage.steps.navigateToCreateQuestion('list sorting')
|
46
|
+
cy.barsPreLoaderWait();
|
47
|
+
});
|
48
|
+
|
49
|
+
describe('Validation error messages', () => {
|
50
|
+
dialogBoxBase.tests.verifyRequiredFieldsWarningPopupOnClickingSaveButton();
|
51
|
+
|
52
|
+
it('Validation error messages should be displayed below required input fields', () => {
|
53
|
+
listSortingPage.steps.verifyQuestionInstructionsErrorMessage()
|
54
|
+
for (let index = 0; index < 4; index++) {
|
55
|
+
listSortingPage.steps.verifyOptionsInputFieldErrorMessage(index)
|
56
|
+
}
|
57
|
+
listSortingPage.steps.verifyPointsFieldErrorMessage();
|
58
|
+
listSortingPage.steps.verifySetCorrectAnswerSectionErrorMessage();
|
59
|
+
listSortingPage.steps.verifySetCorrectAnswerErrorIconIsDisplayed();
|
60
|
+
});
|
61
|
+
|
62
|
+
it('Validation error messages should disappear when required input fields are filled', () => {
|
63
|
+
listSortingPage.steps.addQuestionInstructions();
|
64
|
+
listSortingPage.steps.verifyQuestionInstructionsErrorMessageIsNotDisplayed();
|
65
|
+
listSortingPage.steps.addInputToOptionsInputField(options)
|
66
|
+
for (let index = 0; index < 4; index++) {
|
67
|
+
listSortingPage.steps.verifyOptionsInputFieldErrorMessageDoesNotExist(index);
|
68
|
+
}
|
69
|
+
listSortingPage.steps.allotPoints(20);
|
70
|
+
listSortingPage.steps.verifyPointsFieldErrorMessageIsNotDisplayed();
|
71
|
+
listSortingPage.steps.clickAndDropOptionFromSourceToTargetInSetCorrectAnswerSection('seed', 0);
|
72
|
+
listSortingPage.steps.clickAndDropOptionFromSourceToTargetInSetCorrectAnswerSection('sprout', 1);
|
73
|
+
listSortingPage.steps.clickAndDropOptionFromSourceToTargetInSetCorrectAnswerSection('plant', 2);
|
74
|
+
listSortingPage.steps.clickAndDropOptionFromSourceToTargetInSetCorrectAnswerSection('flower', 3);
|
75
|
+
listSortingPage.steps.verifyErrorMessageIsNotDisplayed();
|
76
|
+
listSortingPage.steps.verifySetCorrectAnswerErrorIconIsNotDisplayed();
|
77
|
+
});
|
78
|
+
|
79
|
+
listSortingPage.tests.verifya11yOfCreateItemWrapperContents();
|
80
|
+
});
|
81
|
+
|
82
|
+
describe('Saving a question', () => {
|
83
|
+
it('When user has filled all the mandatory fields then on clicking on Save Question button the question should get saved and a snackbar with text \'Saved successfully!\' should be displayed', () => {
|
84
|
+
listSortingPage.steps.saveAQuestionAndVerifySnackbar();
|
85
|
+
});
|
86
|
+
listSortingPage.tests.verifySavedSuccessfullySnackbarCSSanda11y();
|
87
|
+
});
|
88
|
+
});
|
89
|
+
});
|
@@ -0,0 +1,171 @@
|
|
1
|
+
import { listSortingPage } from "../../../pages/listSortingPage";
|
2
|
+
import abortEarlySetup from "../../../support/helpers/abortEarly";
|
3
|
+
import utilities from "../../../support/helpers/utilities";
|
4
|
+
|
5
|
+
let options = ['plant', 'sprout', 'flower', 'seed'];
|
6
|
+
let correctAnswerArray = ['seed', 'sprout', 'plant', 'flower'];
|
7
|
+
|
8
|
+
describe('Create item page - List sorting: Preview tab \'Scoring\' section', () => {
|
9
|
+
before(() => {
|
10
|
+
cy.loginAs('admin');
|
11
|
+
});
|
12
|
+
|
13
|
+
describe('Question Preview: Manually Scored', () => {
|
14
|
+
abortEarlySetup();
|
15
|
+
before(() => {
|
16
|
+
cy.log('Navigating to list sorting question type');
|
17
|
+
listSortingPage.steps.navigateToCreateQuestion('list sorting');
|
18
|
+
cy.log('Adding question instructions, setting correct answer order and adding points for Autoscored scoring type and switching to Preview tab');
|
19
|
+
cy.barsPreLoaderWait();
|
20
|
+
listSortingPage.steps.addQuestionInstructions();
|
21
|
+
listSortingPage.steps.addInputToOptionsInputField(options);
|
22
|
+
listSortingPage.steps.clickAndDropOptionFromSourceToTargetInSetCorrectAnswerSection('seed', 0);
|
23
|
+
listSortingPage.steps.clickAndDropOptionFromSourceToTargetInSetCorrectAnswerSection('sprout', 1);
|
24
|
+
listSortingPage.steps.clickAndDropOptionFromSourceToTargetInSetCorrectAnswerSection('plant', 2);
|
25
|
+
listSortingPage.steps.clickAndDropOptionFromSourceToTargetInSetCorrectAnswerSection('flower', 3);
|
26
|
+
listSortingPage.steps.verifyTargetOptionsTextContentInSetCorrectAnswerSection(correctAnswerArray);
|
27
|
+
listSortingPage.steps.selectAScoringTypeFromScoringTypeDropdown('Manually scored');
|
28
|
+
listSortingPage.steps.switchToPreviewTab();
|
29
|
+
});
|
30
|
+
|
31
|
+
it('When user switches to the Preview tab, the question instruction should be displayed and the and options along with source and target option wrappers should be displayed in the preview tab', () => {
|
32
|
+
listSortingPage.steps.verifyQuestionInstructionsText();
|
33
|
+
listSortingPage.steps.verifySourceOptionsTextContentInPreviewTab(options);
|
34
|
+
for (let index = 0; index < 4; index++) {
|
35
|
+
listSortingPage.steps.verifyDragHandleButtonOfOptionInPreviewTab(index);
|
36
|
+
}
|
37
|
+
utilities.verifyElementCount(listSortingPage.previewTabOption(), 4);
|
38
|
+
utilities.verifyElementCount(listSortingPage.previewTabSourceOptionWrapper(), 4);
|
39
|
+
utilities.verifyElementCount(listSortingPage.previewTabTargetOptionWrapper(), 4);
|
40
|
+
utilities.verifyInnerText(listSortingPage.previewTabTargetOptionWrapper(), '');
|
41
|
+
});
|
42
|
+
|
43
|
+
listSortingPage.tests.verifyShowCorrectAnswerAndPointsNotDisplayedInPreviewTab();
|
44
|
+
});
|
45
|
+
|
46
|
+
describe('Question Preview: Non Scored', () => {
|
47
|
+
abortEarlySetup();
|
48
|
+
before(() => {
|
49
|
+
cy.log('Navigating to list sorting question type');
|
50
|
+
listSortingPage.steps.navigateToCreateQuestion('list sorting');
|
51
|
+
cy.log('Adding question instructions, setting correct answer order and adding points for Autoscored scoring type and switching to Preview tab');
|
52
|
+
cy.barsPreLoaderWait();
|
53
|
+
listSortingPage.steps.addQuestionInstructions();
|
54
|
+
listSortingPage.steps.addInputToOptionsInputField(options);
|
55
|
+
listSortingPage.steps.clickAndDropOptionFromSourceToTargetInSetCorrectAnswerSection('seed', 0);
|
56
|
+
listSortingPage.steps.clickAndDropOptionFromSourceToTargetInSetCorrectAnswerSection('sprout', 1);
|
57
|
+
listSortingPage.steps.clickAndDropOptionFromSourceToTargetInSetCorrectAnswerSection('plant', 2);
|
58
|
+
listSortingPage.steps.clickAndDropOptionFromSourceToTargetInSetCorrectAnswerSection('flower', 3);
|
59
|
+
listSortingPage.steps.verifyTargetOptionsTextContentInSetCorrectAnswerSection(correctAnswerArray);
|
60
|
+
listSortingPage.steps.selectAScoringTypeFromScoringTypeDropdown('Non scored');
|
61
|
+
listSortingPage.steps.expandAdditonalSettings();
|
62
|
+
listSortingPage.steps.checkAllowStudentsToCheckAnswerCheckbox();
|
63
|
+
listSortingPage.steps.switchToPreviewTab();
|
64
|
+
});
|
65
|
+
|
66
|
+
listSortingPage.tests.verifyShowCorrectAnswerLabelAndCheckboxExistAndPreviewScoreNotExistInPreviewTab();
|
67
|
+
|
68
|
+
it('When the user selects \'Show correct answer\' checkbox without attempting the question, correct/incorrect border or icons should not be displayed, a correct answer container with \'Correct answers:\' label and all correct answers with numeration should be displayed below the question preview', () => {
|
69
|
+
listSortingPage.steps.checkShowCorrectAnswerCheckbox();
|
70
|
+
listSortingPage.steps.verifyCorrectIncorrectBorderNotExists();
|
71
|
+
listSortingPage.steps.verifyCorrectIncorrectIconsDoesNotExist();
|
72
|
+
listSortingPage.steps.verifyCorrectAnswerContainerContents(correctAnswerArray, ['1', '2', '3', '4']);
|
73
|
+
utilities.verifyInnerText(listSortingPage.correctAnswerContainerCorrectAnswersLabel(), 'Correct answers:');
|
74
|
+
});
|
75
|
+
|
76
|
+
it('When user selects Check answer button without attempting the question, correct/incorrect answer border for the question and label should not be displayed below the question preview and correct answer container should not be displayed', () => {
|
77
|
+
cy.log('Pre-step: Deselect the show correct checkbox')
|
78
|
+
listSortingPage.steps.uncheckShowCorrectAnswerCheckbox()
|
79
|
+
listSortingPage.steps.checkAnswer();
|
80
|
+
listSortingPage.steps.verifyCorrectIncorrectBorderNotExists();
|
81
|
+
listSortingPage.steps.verifyCorrectIncorrectIconsDoesNotExist();
|
82
|
+
listSortingPage.steps.verifyCorrectAnswerContainerDoesNotExist();
|
83
|
+
});
|
84
|
+
|
85
|
+
it('When user attempts the question incorrectly then on selecting \'Show correct answer\' checkbox, the user should be awarded 0 points and red cross-mark icons should be displayed beside all the options, a label \'Incorrect answer\' and border should be displayed below the question preview and the correct answer container with all correct answers along with numeration should be displayed', () => {
|
86
|
+
listSortingPage.steps.clickAndDropOptionFromSourceToTargetInPreviewTab('flower', 0);
|
87
|
+
listSortingPage.steps.clickAndDropOptionFromSourceToTargetInPreviewTab('plant', 1);
|
88
|
+
listSortingPage.steps.clickAndDropOptionFromSourceToTargetInPreviewTab('seed', 2);
|
89
|
+
listSortingPage.steps.clickAndDropOptionFromSourceToTargetInPreviewTab('sprout', 3);
|
90
|
+
listSortingPage.steps.verifyTargetOptionsTextContentInPreviewTab(['flower', 'plant', 'seed', 'sprout']);
|
91
|
+
listSortingPage.steps.checkShowCorrectAnswerCheckbox();
|
92
|
+
listSortingPage.steps.verifyIncorrectOptionsCrossmarkIcon('flower');
|
93
|
+
listSortingPage.steps.verifyIncorrectOptionsCrossmarkIcon('plant');
|
94
|
+
listSortingPage.steps.verifyIncorrectOptionsCrossmarkIcon('sprout');
|
95
|
+
listSortingPage.steps.verifyIncorrectOptionsCrossmarkIcon('seed');
|
96
|
+
listSortingPage.steps.verifyIncorrectAttemptBorder();
|
97
|
+
listSortingPage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect');
|
98
|
+
listSortingPage.steps.verifyCorrectAnswerContainerContents(correctAnswerArray, ['1', '2', '3', '4']);
|
99
|
+
|
100
|
+
listSortingPage.steps.verifyQuestionPreviewStateWhenShowCorrectAnswerIsUnchecked();
|
101
|
+
|
102
|
+
cy.log('When user attempts the question incorrectly and clicks on the \'Check Answer\' button, then red cross-mark icons should be displayed beside all the options, a label \'Incorrect answer\' and border should be displayed below the question preview and the correct answer container should not be displayed')
|
103
|
+
listSortingPage.steps.checkAnswer();
|
104
|
+
listSortingPage.steps.verifyIncorrectOptionsCrossmarkIcon('flower');
|
105
|
+
listSortingPage.steps.verifyIncorrectOptionsCrossmarkIcon('plant');
|
106
|
+
listSortingPage.steps.verifyIncorrectOptionsCrossmarkIcon('sprout');
|
107
|
+
listSortingPage.steps.verifyIncorrectOptionsCrossmarkIcon('seed');
|
108
|
+
listSortingPage.steps.verifyIncorrectAttemptBorder();
|
109
|
+
listSortingPage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect');
|
110
|
+
listSortingPage.steps.verifyCorrectAnswerContainerDoesNotExist();
|
111
|
+
});
|
112
|
+
|
113
|
+
it('When user attempts the question partially correct with some options at the correct position and some at incorrect then on selecting \'Show correct answer\' checkbox, the user should be awarded 0 points, green check-mark icons should be displayed beside the options at the correct position, red cross-mark icons should be displayed beside the options at incorrect position, a label \'Incorrect answer\' and border should be displayed below the question preview and the correct answer container with all correct answers along with numeration should be displayed', () => {
|
114
|
+
listSortingPage.steps.resetQuestionPreview();
|
115
|
+
listSortingPage.steps.clickAndDropOptionFromSourceToTargetInPreviewTab('plant', 0);
|
116
|
+
listSortingPage.steps.clickAndDropOptionFromSourceToTargetInPreviewTab('sprout', 1);
|
117
|
+
listSortingPage.steps.clickAndDropOptionFromSourceToTargetInPreviewTab('seed', 2);
|
118
|
+
listSortingPage.steps.clickAndDropOptionFromSourceToTargetInPreviewTab('flower', 3);
|
119
|
+
listSortingPage.steps.verifyTargetOptionsTextContentInPreviewTab(['plant', 'sprout', 'seed', 'flower']);
|
120
|
+
listSortingPage.steps.checkShowCorrectAnswerCheckbox()
|
121
|
+
listSortingPage.steps.verifyIncorrectOptionsCrossmarkIcon('plant');
|
122
|
+
listSortingPage.steps.verifyCorrectOptionsCheckmarkIcon('sprout');
|
123
|
+
listSortingPage.steps.verifyIncorrectOptionsCrossmarkIcon('seed');
|
124
|
+
listSortingPage.steps.verifyCorrectOptionsCheckmarkIcon('flower');
|
125
|
+
listSortingPage.steps.verifyIncorrectAttemptBorder();
|
126
|
+
listSortingPage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect');
|
127
|
+
listSortingPage.steps.verifyCorrectAnswerContainerContents(['seed', 'plant'], ['1', '3']);
|
128
|
+
|
129
|
+
listSortingPage.steps.verifyQuestionPreviewStateWhenShowCorrectAnswerIsUnchecked();
|
130
|
+
|
131
|
+
cy.log('When user attempts the question partially correct and clicks on the \'Check Answer\' button, green check-mark icons should be displayed beside the options at the correct position, red cross-mark icons should be displayed beside the options at incorrect position,, a label \'Incorrect answer\' and border should be displayed below the question preview and the correct answer container should not be displayed')
|
132
|
+
listSortingPage.steps.checkAnswer()
|
133
|
+
listSortingPage.steps.verifyIncorrectOptionsCrossmarkIcon('plant');
|
134
|
+
listSortingPage.steps.verifyCorrectOptionsCheckmarkIcon('sprout');
|
135
|
+
listSortingPage.steps.verifyIncorrectOptionsCrossmarkIcon('seed');
|
136
|
+
listSortingPage.steps.verifyCorrectOptionsCheckmarkIcon('flower');
|
137
|
+
listSortingPage.steps.verifyIncorrectAttemptBorder();
|
138
|
+
listSortingPage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect');
|
139
|
+
listSortingPage.steps.verifyCorrectAnswerContainerDoesNotExist();
|
140
|
+
});
|
141
|
+
|
142
|
+
it('When user attempts the question correctly then on selecting \'Show correct answer\' checkbox, the user should be awarded full points and green check-mark icons should be displayed beside all the options, a label \'Correct answer\' and border should be displayed below the question preview and the correct answer container should not be displayed', () => {
|
143
|
+
listSortingPage.steps.resetQuestionPreview();
|
144
|
+
listSortingPage.steps.clickAndDropOptionFromSourceToTargetInPreviewTab('seed', 0);
|
145
|
+
listSortingPage.steps.clickAndDropOptionFromSourceToTargetInPreviewTab('sprout', 1);
|
146
|
+
listSortingPage.steps.clickAndDropOptionFromSourceToTargetInPreviewTab('plant', 2);
|
147
|
+
listSortingPage.steps.clickAndDropOptionFromSourceToTargetInPreviewTab('flower', 3);
|
148
|
+
listSortingPage.steps.verifyTargetOptionsTextContentInPreviewTab(correctAnswerArray);
|
149
|
+
listSortingPage.steps.checkShowCorrectAnswerCheckbox()
|
150
|
+
listSortingPage.steps.verifyCorrectOptionsCheckmarkIcon('sprout');
|
151
|
+
listSortingPage.steps.verifyCorrectOptionsCheckmarkIcon('seed');
|
152
|
+
listSortingPage.steps.verifyCorrectOptionsCheckmarkIcon('plant');
|
153
|
+
listSortingPage.steps.verifyCorrectOptionsCheckmarkIcon('flower');
|
154
|
+
listSortingPage.steps.verifyCorrectAttemptBorder();
|
155
|
+
listSortingPage.steps.verifyCorrectIncorrectAnswerLabel('Correct');
|
156
|
+
listSortingPage.steps.verifyCorrectAnswerContainerDoesNotExist();
|
157
|
+
|
158
|
+
listSortingPage.steps.verifyQuestionPreviewStateWhenShowCorrectAnswerIsUnchecked();
|
159
|
+
|
160
|
+
cy.log('When user attempts the question correctly and clicks on the \'Check Answer\' button, green check-mark icons should be displayed beside the options at the correct position, a label \'Correct answer\' and border should be displayed below the question preview and the correct answer container should not be displayed')
|
161
|
+
listSortingPage.steps.checkAnswer();
|
162
|
+
listSortingPage.steps.verifyCorrectOptionsCheckmarkIcon('sprout');
|
163
|
+
listSortingPage.steps.verifyCorrectOptionsCheckmarkIcon('seed');
|
164
|
+
listSortingPage.steps.verifyCorrectOptionsCheckmarkIcon('plant');
|
165
|
+
listSortingPage.steps.verifyCorrectOptionsCheckmarkIcon('flower');
|
166
|
+
listSortingPage.steps.verifyCorrectAttemptBorder();
|
167
|
+
listSortingPage.steps.verifyCorrectIncorrectAnswerLabel('Correct');
|
168
|
+
listSortingPage.steps.verifyCorrectAnswerContainerDoesNotExist();
|
169
|
+
});
|
170
|
+
});
|
171
|
+
});
|