itemengine-cypress-automation 1.0.32 → 1.0.37
Sign up to get free protection for your applications and to get access to all the features.
- 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/listSortingAdditionalSettingsAnswerNumerationAndOptionStyleDropdown.js +319 -0
- package/cypress/e2e/ILC/ListSorting/listSortingAdditionalSettingsBasic.js +326 -0
- package/cypress/e2e/ILC/ListSorting/listSortingAdditionalSettingsOptionLabelSection.js +202 -0
- package/cypress/e2e/ILC/ListSorting/listSortingAllOrNothingScoring.js +188 -0
- package/cypress/e2e/ILC/ListSorting/listSortingAllOrNothingScoringWithAlternateAnswer.js +759 -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 +165 -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/listSortingOptionsSection.js +287 -0
- package/cypress/e2e/ILC/ListSorting/listSortingPartialDifferentWeightsScoring.js +210 -0
- package/cypress/e2e/ILC/ListSorting/listSortingPartialDifferentWeightsScoringWithAlternateTab.js +952 -0
- package/cypress/e2e/ILC/ListSorting/listSortingPartialEqualWeightsScoring.js +207 -0
- package/cypress/e2e/ILC/ListSorting/listSortingPartialEqualWeightsScoringWithAlternateAnswer.js +860 -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,208 @@
|
|
1
|
+
import { listOrderingPage } from "../../../pages/listOrderingPage";
|
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
|
+
let correctAnswerArray = ['seed', 'sprout', 'plant', 'flower'];
|
8
|
+
|
9
|
+
describe('Create Item page -List ordering: Randomize options functionality, Hide drag Handle functionality', () => {
|
10
|
+
before(() => {
|
11
|
+
cy.loginAs('admin');
|
12
|
+
});
|
13
|
+
|
14
|
+
describe('Randomize options - Functionality : Edit tab', () => {
|
15
|
+
abortEarlySetup();
|
16
|
+
before(() => {
|
17
|
+
cy.log('Navigating to list ordering question type');
|
18
|
+
listOrderingPage.steps.navigateToCreateQuestion('list ordering');
|
19
|
+
cy.log('Adding question instructions, setting correct answer order and adding points');
|
20
|
+
cy.barsPreLoaderWait();
|
21
|
+
listOrderingPage.steps.addQuestionInstructions();
|
22
|
+
listOrderingPage.steps.addInputToOptionsInputField(options);
|
23
|
+
listOrderingPage.steps.clickAndReorderOptionInSetCorrectAnswerSection('seed', 0);
|
24
|
+
listOrderingPage.steps.clickAndReorderOptionInSetCorrectAnswerSection('sprout', 1);
|
25
|
+
listOrderingPage.steps.verifyOptionsTextContentInSetCorrectAnswerSection(correctAnswerArray);
|
26
|
+
listOrderingPage.steps.allotPoints('20');
|
27
|
+
});
|
28
|
+
|
29
|
+
it('\'Randomize options\' checkbox and label should be displayed and by default it should be unchecked', () => {
|
30
|
+
utilities.verifyInnerText(listOrderingPage.randomizeOptionsCheckboxLabel(), 'Randomize options');
|
31
|
+
utilities.verifyElementVisibilityState(listOrderingPage.randomizeOptionsCheckboxLabel(), 'visible');
|
32
|
+
listOrderingPage.steps.verifyRandomizeOptionsCheckboxUnchecked();
|
33
|
+
});
|
34
|
+
|
35
|
+
it('CSS of \'Randomize options\'', { tags: 'css' }, () => {
|
36
|
+
utilities.verifyCSS(listOrderingPage.randomizeOptionsCheckboxLabel(), {
|
37
|
+
'color': css.color.labelText,
|
38
|
+
'font-size': css.fontSize.normal,
|
39
|
+
'font-weight': css.fontWeight.regular
|
40
|
+
});
|
41
|
+
});
|
42
|
+
|
43
|
+
it('Accessibility of \'Randomize options\'', { tags: 'a11y' }, () => {
|
44
|
+
cy.checkAccessibility(listOrderingPage.randomizeOptionsCheckbox());
|
45
|
+
});
|
46
|
+
|
47
|
+
it('When the \'Randomize options\' functionality is disabled, the options in the set correct answer section should be displayed in the order in which the user has set them in the \'Options\' section', () => {
|
48
|
+
listOrderingPage.steps.verifyRandomizeOptionsCheckboxUnchecked()
|
49
|
+
listOrderingPage.steps.verifyOptionsTextContentInSetCorrectAnswerSection(correctAnswerArray);
|
50
|
+
});
|
51
|
+
|
52
|
+
it('When the user enables the \'Randomize options\' functionality, then the options in the set correct answer section should be in the order in which the user has set them in the \'Options\' section', () => {
|
53
|
+
listOrderingPage.steps.checkRandomizeOptionsCheckbox()
|
54
|
+
listOrderingPage.steps.verifyOptionsTextContentInSetCorrectAnswerSection(correctAnswerArray);
|
55
|
+
});
|
56
|
+
|
57
|
+
it('CSS of \'Randomize options\' functionality - checked state', { tags: 'css' }, () => {
|
58
|
+
utilities.verifyCSS(listOrderingPage.randomizeOptionsCheckbox().parents('.ngie-checkbox').find('g').eq(1), {
|
59
|
+
'fill': css.color.activeButtons
|
60
|
+
});
|
61
|
+
});
|
62
|
+
|
63
|
+
it('Accessibility of \'Randomize options\' functionality - checked state', { tags: 'a11y' }, () => {
|
64
|
+
cy.checkAccessibility(listOrderingPage.randomizeOptionsCheckbox().parents('.ngie-checkbox'))
|
65
|
+
});
|
66
|
+
});
|
67
|
+
|
68
|
+
describe('Randomize options - Functionality : Preview tab', () => {
|
69
|
+
let optionsArray = [];
|
70
|
+
abortEarlySetup();
|
71
|
+
before(() => {
|
72
|
+
cy.log('Navigating to list ordering question type');
|
73
|
+
listOrderingPage.steps.navigateToCreateQuestion('list ordering');
|
74
|
+
cy.log('Adding question instructions, setting correct answer order and adding points');
|
75
|
+
cy.barsPreLoaderWait();
|
76
|
+
listOrderingPage.steps.addQuestionInstructions();
|
77
|
+
listOrderingPage.steps.addInputToOptionsInputField(options);
|
78
|
+
listOrderingPage.steps.clickAndReorderOptionInSetCorrectAnswerSection('seed', 0);
|
79
|
+
listOrderingPage.steps.clickAndReorderOptionInSetCorrectAnswerSection('sprout', 1);
|
80
|
+
listOrderingPage.steps.verifyOptionsTextContentInSetCorrectAnswerSection(correctAnswerArray);
|
81
|
+
listOrderingPage.steps.allotPoints('20');
|
82
|
+
});
|
83
|
+
|
84
|
+
it('When the \'Randomize options\' functionality is disabled, options in the preview tab should be displayed in the order in which the user has set them in the \'Options\' section', () => {
|
85
|
+
listOrderingPage.steps.verifyRandomizeOptionsCheckboxUnchecked()
|
86
|
+
listOrderingPage.steps.switchToPreviewTab();
|
87
|
+
listOrderingPage.steps.verifyTextContentOfOptionsInPreviewTab(options);
|
88
|
+
});
|
89
|
+
|
90
|
+
it('When the user enables the \'Randomize options\' functionality, then options in preview tab should be displayed in a random order', () => {
|
91
|
+
listOrderingPage.steps.switchToEditTab()
|
92
|
+
listOrderingPage.steps.checkRandomizeOptionsCheckbox()
|
93
|
+
listOrderingPage.steps.switchToPreviewTab();
|
94
|
+
listOrderingPage.steps.verifyRandomizeOptionOrder(options);
|
95
|
+
optionsArray = listOrderingPage.steps.getOptionsArray();
|
96
|
+
});
|
97
|
+
|
98
|
+
it('When the user switches to \'Edit tab\' and does not modify any question properties, then the order of the options should not change in the preview tab', () => {
|
99
|
+
listOrderingPage.steps.switchToEditTab();
|
100
|
+
listOrderingPage.steps.switchToPreviewTab();
|
101
|
+
listOrderingPage.steps.verifyRandomizeOptionOrder(options);
|
102
|
+
});
|
103
|
+
|
104
|
+
it('When the user switches to \'Edit tab\' and modifies any of question properties, then the order of the options should change and the options should be displayed in the order in which the user has set them in the preview tab', () => {
|
105
|
+
listOrderingPage.steps.switchToEditTab();
|
106
|
+
listOrderingPage.steps.clearPointsField();
|
107
|
+
listOrderingPage.steps.allotPoints(12);
|
108
|
+
listOrderingPage.steps.switchToPreviewTab();
|
109
|
+
listOrderingPage.steps.verifyRandomizeOptionOrder(options);
|
110
|
+
listOrderingPage.steps.verifyOptionsAreRerandomized(optionsArray);
|
111
|
+
});
|
112
|
+
|
113
|
+
it('When the user disables the \'Randomize options\' functionality, then the options in the preview tab should be displayed in the order in which the user has set them in the \'Options\' section', () => {
|
114
|
+
listOrderingPage.steps.switchToEditTab()
|
115
|
+
listOrderingPage.steps.uncheckRandomizeOptionsCheckbox()
|
116
|
+
listOrderingPage.steps.switchToPreviewTab();
|
117
|
+
listOrderingPage.steps.verifyTextContentOfOptionsInPreviewTab(options);
|
118
|
+
});
|
119
|
+
});
|
120
|
+
|
121
|
+
describe('Hide drag handle - Functionality: Edit tab', () => {
|
122
|
+
abortEarlySetup();
|
123
|
+
before(() => {
|
124
|
+
cy.log('Navigating to list ordering question type');
|
125
|
+
listOrderingPage.steps.navigateToCreateQuestion('list ordering');
|
126
|
+
cy.log('Adding question instructions, setting correct answer order and adding points');
|
127
|
+
cy.barsPreLoaderWait();
|
128
|
+
listOrderingPage.steps.addQuestionInstructions();
|
129
|
+
listOrderingPage.steps.addInputToOptionsInputField(options);
|
130
|
+
listOrderingPage.steps.clickAndReorderOptionInSetCorrectAnswerSection('seed', 0);
|
131
|
+
listOrderingPage.steps.clickAndReorderOptionInSetCorrectAnswerSection('sprout', 1);
|
132
|
+
listOrderingPage.steps.verifyOptionsTextContentInSetCorrectAnswerSection(correctAnswerArray);
|
133
|
+
listOrderingPage.steps.allotPoints('20');
|
134
|
+
});
|
135
|
+
|
136
|
+
it('When the \'Hide drag handle\' functionality is disabled, then the options displayed in response container of the \'Set correct answer\' section should have a drag handle', () => {
|
137
|
+
listOrderingPage.steps.verifyHideDragHandleCheckboxUnchecked();
|
138
|
+
for (let index = 0; index < 4; index++) {
|
139
|
+
listOrderingPage.steps.verifyDragHandleButtonOfOptionInSetCorrectAnswerSection(index)
|
140
|
+
}
|
141
|
+
});
|
142
|
+
|
143
|
+
it('When the user enables the \'Hide drag handle\' functionality, then the options displayed in response container of the \'Set correct answer\' section should not have a drag handle', () => {
|
144
|
+
listOrderingPage.steps.switchToEditTab();
|
145
|
+
listOrderingPage.steps.checkHideDragHandleCheckbox();
|
146
|
+
for (let index = 0; index < 4; index++) {
|
147
|
+
listOrderingPage.steps.verifyDragHandleButtonDoesNotExistInSetCorrectAnswerSection(index);
|
148
|
+
}
|
149
|
+
});
|
150
|
+
|
151
|
+
it('CSS of \'Hide drag handle\' functionality - checked state', { tags: 'css' }, () => {
|
152
|
+
utilities.verifyCSS(listOrderingPage.hideDragHandleCheckbox().parents('.ngie-checkbox').find('g').eq(1), {
|
153
|
+
'fill': css.color.activeButtons
|
154
|
+
});
|
155
|
+
});
|
156
|
+
|
157
|
+
it('Accessibility of \'Hide drag handle\' functionality - checked state', { tags: 'a11y' }, () => {
|
158
|
+
cy.checkAccessibility(listOrderingPage.hideDragHandleCheckbox());
|
159
|
+
});
|
160
|
+
|
161
|
+
it('When the \'Hide drag handle\' functionality is disabled again, then the options displayed in response container of the \'Set correct answer\' section should have a drag handle', () => {
|
162
|
+
listOrderingPage.steps.uncheckHideDragHandleCheckbox();
|
163
|
+
for (let index = 0; index < 4; index++) {
|
164
|
+
listOrderingPage.steps.verifyDragHandleButtonOfOptionInSetCorrectAnswerSection(index)
|
165
|
+
}
|
166
|
+
});
|
167
|
+
});
|
168
|
+
|
169
|
+
describe('Hide drag handle - Functionality: Preview tab', () => {
|
170
|
+
before(() => {
|
171
|
+
cy.log('Navigating to list ordering question type');
|
172
|
+
listOrderingPage.steps.navigateToCreateQuestion('list ordering');
|
173
|
+
cy.log('Adding question instructions, setting correct answer order and adding points');
|
174
|
+
cy.barsPreLoaderWait();
|
175
|
+
listOrderingPage.steps.addQuestionInstructions();
|
176
|
+
listOrderingPage.steps.addInputToOptionsInputField(options);
|
177
|
+
listOrderingPage.steps.clickAndReorderOptionInSetCorrectAnswerSection('seed', 0);
|
178
|
+
listOrderingPage.steps.clickAndReorderOptionInSetCorrectAnswerSection('sprout', 1);
|
179
|
+
listOrderingPage.steps.verifyOptionsTextContentInSetCorrectAnswerSection(correctAnswerArray);
|
180
|
+
listOrderingPage.steps.allotPoints('20');
|
181
|
+
});
|
182
|
+
|
183
|
+
it('When the \'Hide drag handle\' functionality is disabled, then the draggable options displayed in response container of the preview tab should have a drag handle', () => {
|
184
|
+
listOrderingPage.steps.switchToPreviewTab();
|
185
|
+
for (let index = 0; index < 4; index++) {
|
186
|
+
listOrderingPage.steps.verifyDragHandleButtonOfOptionInPreviewTab(index);
|
187
|
+
}
|
188
|
+
});
|
189
|
+
|
190
|
+
it('When the \'Hide drag handle\' functionality is enabled, then the draggable options displayed in response container of the preview tab should not have a drag handle', () => {
|
191
|
+
listOrderingPage.steps.switchToEditTab();
|
192
|
+
listOrderingPage.steps.checkHideDragHandleCheckbox();
|
193
|
+
listOrderingPage.steps.switchToPreviewTab();
|
194
|
+
for (let index = 0; index < 4; index++) {
|
195
|
+
listOrderingPage.steps.verifyDragHandleButtonDoesNotExistInPreviewTab(index);
|
196
|
+
}
|
197
|
+
});
|
198
|
+
|
199
|
+
it('When the \'Hide drag handle\' functionality is disabled again, then the options displayed in response container of the \'Preview tab\' section should have a drag handle', () => {
|
200
|
+
listOrderingPage.steps.switchToEditTab();
|
201
|
+
listOrderingPage.steps.uncheckHideDragHandleCheckbox();
|
202
|
+
listOrderingPage.steps.switchToPreviewTab();
|
203
|
+
for (let index = 0; index < 4; index++) {
|
204
|
+
listOrderingPage.steps.verifyDragHandleButtonOfOptionInPreviewTab(index)
|
205
|
+
}
|
206
|
+
});
|
207
|
+
});
|
208
|
+
});
|
@@ -0,0 +1,172 @@
|
|
1
|
+
import { dialogBoxBase } from "../../../pages/dialogBoxBase";
|
2
|
+
import { listOrderingPage } from "../../../pages/listOrderingPage";
|
3
|
+
import abortEarlySetup from "../../../support/helpers/abortEarly";
|
4
|
+
import utilities from "../../../support/helpers/utilities";
|
5
|
+
const css = Cypress.env('css');
|
6
|
+
|
7
|
+
let options = ['plant', 'sprout', 'flower', 'seed'];
|
8
|
+
|
9
|
+
describe('Create Item page - List ordering: Set correct answer, Alternate correct answer - Edit tab cases', () => {
|
10
|
+
before(() => {
|
11
|
+
cy.loginAs('admin');
|
12
|
+
});
|
13
|
+
|
14
|
+
describe('Set correct answer section', () => {
|
15
|
+
abortEarlySetup();
|
16
|
+
before(() => {
|
17
|
+
cy.log('Navigating to list ordering question type');
|
18
|
+
listOrderingPage.steps.navigateToCreateQuestion('list ordering');
|
19
|
+
listOrderingPage.steps.addQuestionInstructions();
|
20
|
+
listOrderingPage.steps.addInputToOptionsInputField(options);
|
21
|
+
});
|
22
|
+
|
23
|
+
listOrderingPage.tests.verifyAutoScoredSetCorrectAnswerHeaderSectionContents('list ordering');
|
24
|
+
|
25
|
+
it('By default, 4 \'Options\' should be displayed with Drag handle in \'Set correct answer\' section', () => {
|
26
|
+
for (let index = 0; index < 4; index++) {
|
27
|
+
listOrderingPage.steps.verifyDragHandleButtonOfOptionInSetCorrectAnswerSection(index)
|
28
|
+
}
|
29
|
+
utilities.verifyElementCount(listOrderingPage.setCorrectAnswerSectionOption(), 4);
|
30
|
+
});
|
31
|
+
|
32
|
+
it('When user clicks on Add alternate answer button without allotting points in the \'Set correct answer\' then a warning popup should be displayed', () => {
|
33
|
+
listOrderingPage.steps.clickOnAddAlternateAnswerButton();
|
34
|
+
utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'exist');
|
35
|
+
});
|
36
|
+
|
37
|
+
it('When user closes the warning popup \'Error: Please enter points\' error message should be displayed', () => {
|
38
|
+
dialogBoxBase.steps.closeWarningPopup();
|
39
|
+
listOrderingPage.steps.verifyPointsInputFieldErrorMessage()
|
40
|
+
listOrderingPage.steps.verifySetCorrectAnswerErrorIconIsDisplayed();
|
41
|
+
});
|
42
|
+
|
43
|
+
it('When user allots points the error message and error icon should disappear', () => {
|
44
|
+
listOrderingPage.steps.allotPoints(10);
|
45
|
+
listOrderingPage.steps.verifyErrorMessageIsNotDisplayed();
|
46
|
+
listOrderingPage.steps.verifySetCorrectAnswerErrorIconIsNotDisplayed();
|
47
|
+
cy.log('Post step: Clear points field')
|
48
|
+
listOrderingPage.steps.clearPointsField();
|
49
|
+
});
|
50
|
+
|
51
|
+
listOrderingPage.tests.verifyAutoScoredPointsErrorMessageWhenPointsFieldIsEmpty('Correct tab');
|
52
|
+
|
53
|
+
it('When user tries to \'Add alternate tab\' after allotting points without re-ordering the options then an error message should be displayed in the \'Set correct answer\' section', () => {
|
54
|
+
listOrderingPage.steps.clickOnAddAlternateAnswerButton();
|
55
|
+
utilities.verifyInnerText(listOrderingPage.errorMessage(), 'Error: The correct answer sequence matches the option sequence. Please either rearrange the options or select \'Randomize options\' to continue.');
|
56
|
+
utilities.verifyElementVisibilityState(listOrderingPage.errorMessage(), 'visible');
|
57
|
+
});
|
58
|
+
|
59
|
+
//Failing due to https://redmine.zeuslearning.com/issues/548289
|
60
|
+
listOrderingPage.tests.verifyCSSAnda11yOfErrorMessage();
|
61
|
+
|
62
|
+
it('When the user checks \'Randomize options\' then the error message should disappear', () => {
|
63
|
+
listOrderingPage.steps.checkRandomizeOptionsCheckbox();
|
64
|
+
listOrderingPage.steps.verifyErrorMessageIsNotDisplayed();
|
65
|
+
});
|
66
|
+
|
67
|
+
it('When the user unchecks the \'Randomize options\' checkbox and clicks on \'Add alternate tab\' the error message should be displayed and on re-ordering the options the error message should disappear', () => {
|
68
|
+
listOrderingPage.steps.uncheckRandomizeOptionsCheckbox();
|
69
|
+
listOrderingPage.steps.clickOnAddAlternateAnswerButton();
|
70
|
+
utilities.verifyElementVisibilityState(listOrderingPage.errorMessage(), 'visible');
|
71
|
+
listOrderingPage.steps.clickAndReorderOptionInSetCorrectAnswerSection('seed', 0);
|
72
|
+
listOrderingPage.steps.clickAndReorderOptionInSetCorrectAnswerSection('sprout', 1);
|
73
|
+
listOrderingPage.steps.verifyOptionsTextContentInSetCorrectAnswerSection(['seed', 'sprout', 'plant', 'flower']);
|
74
|
+
utilities.verifyElementVisibilityState(listOrderingPage.errorMessage(), 'notExist');
|
75
|
+
});
|
76
|
+
|
77
|
+
it('User should be able to add an alternate answer after ordering the options in the \'Set correct answer\' section when points are alloted', () => {
|
78
|
+
listOrderingPage.steps.addAlternateTab(1);
|
79
|
+
});
|
80
|
+
|
81
|
+
it('When user clicks on the \'Delete\' button then the alternate tab should be deleted', () => {
|
82
|
+
listOrderingPage.steps.deleteAlternateTab();
|
83
|
+
utilities.verifyElementVisibilityState(listOrderingPage.alternateAnswerTab(), 'notExist');
|
84
|
+
});
|
85
|
+
});
|
86
|
+
|
87
|
+
describe('Alternate correct answer', () => {
|
88
|
+
abortEarlySetup();
|
89
|
+
before(() => {
|
90
|
+
cy.log('Navigating to list ordering question type');
|
91
|
+
listOrderingPage.steps.navigateToCreateQuestion('list ordering');
|
92
|
+
listOrderingPage.steps.addQuestionInstructions();
|
93
|
+
listOrderingPage.steps.addInputToOptionsInputField(options);
|
94
|
+
listOrderingPage.steps.clickAndReorderOptionInSetCorrectAnswerSection('seed', 0);
|
95
|
+
listOrderingPage.steps.clickAndReorderOptionInSetCorrectAnswerSection('sprout', 1);
|
96
|
+
});
|
97
|
+
|
98
|
+
listOrderingPage.tests.verifyAutoScoredAlternateAnswer('list ordering');
|
99
|
+
|
100
|
+
it('When the user allots points to the \'Correct tab\' and has set correct answer order in the \'Set correct answer\' section then on clicking the \'Alternate tab\' button an alternate tab should be added', () => {
|
101
|
+
listOrderingPage.steps.allotPoints('10');
|
102
|
+
listOrderingPage.steps.verifyErrorMessageIsNotDisplayed();
|
103
|
+
listOrderingPage.steps.verifySetCorrectAnswerErrorIconIsNotDisplayed();
|
104
|
+
listOrderingPage.steps.verifyOptionsTextContentInSetCorrectAnswerSection(['seed', 'sprout', 'plant', 'flower']);
|
105
|
+
listOrderingPage.steps.addAlternateTab(1);
|
106
|
+
});
|
107
|
+
|
108
|
+
it('When the user adds an alternate tab then the options should be displayed in the same order as they appear in the \'Options\' section', () => {
|
109
|
+
listOrderingPage.steps.verifyOptionsTextContentInSetCorrectAnswerSection(options);
|
110
|
+
});
|
111
|
+
|
112
|
+
it('CSS of Alternate correct answer tab', { tags: 'css' }, () => {
|
113
|
+
utilities.verifyCSS(listOrderingPage.alternateAnswerTab(1), {
|
114
|
+
'color': css.color.secondaryBtnActive,
|
115
|
+
'font-size': css.fontSize.default,
|
116
|
+
'font-weight': css.fontWeight.bold
|
117
|
+
});
|
118
|
+
cy.log('CSS of inactive Correct answer tab')
|
119
|
+
utilities.verifyCSS(listOrderingPage.correctTab(), {
|
120
|
+
'color': css.color.labels,
|
121
|
+
'font-size': css.fontSize.default,
|
122
|
+
'font-weight': css.fontWeight.bold
|
123
|
+
});
|
124
|
+
});
|
125
|
+
|
126
|
+
it('Accessibility of Alternate correct answer tab', { tags: 'a11y' }, () => {
|
127
|
+
cy.checkAccessibility(listOrderingPage.correctTab().parents('[class*="AlternatePointsComponentstyles__AnswerTabWrapper"]'));
|
128
|
+
});
|
129
|
+
|
130
|
+
it('User should be able set correct answer in the \'Alternate tab\' by ordering the options in the \'Alternate tab\'', () => {
|
131
|
+
listOrderingPage.steps.allotPoints('5')
|
132
|
+
listOrderingPage.steps.clickAndReorderOptionInSetCorrectAnswerSection('seed', 0);
|
133
|
+
listOrderingPage.steps.clickAndReorderOptionInSetCorrectAnswerSection('plant', 3);
|
134
|
+
listOrderingPage.steps.clickAndReorderOptionInSetCorrectAnswerSection('flower', 1);
|
135
|
+
listOrderingPage.steps.verifyOptionsTextContentInSetCorrectAnswerSection(['seed', 'flower', 'sprout', 'plant']);
|
136
|
+
});
|
137
|
+
|
138
|
+
it('When user switches to the \'Correct tab\' from the \'Alternate tab\' the order of options set in the \'Correct tab\' should remain the same', () => {
|
139
|
+
listOrderingPage.steps.navigateToCorrectTab();
|
140
|
+
listOrderingPage.steps.verifyOptionsTextContentInSetCorrectAnswerSection(['seed', 'sprout', 'plant', 'flower']);
|
141
|
+
});
|
142
|
+
|
143
|
+
it('User should be able to add another alternate tab for the question using \'Add Alternate Answer\' button and the name for this new tab should be \'Alternate 2\'', () => {
|
144
|
+
listOrderingPage.steps.addAlternateTab(2);
|
145
|
+
});
|
146
|
+
|
147
|
+
it('When the user adds an alternate tab then the options should be displayed in the same order as they appear in the \'Options\' section', () => {
|
148
|
+
listOrderingPage.steps.verifyOptionsTextContentInSetCorrectAnswerSection(options);
|
149
|
+
});
|
150
|
+
|
151
|
+
listOrderingPage.tests.verifyWarningPopupAndTabNavigationWhenNoPointsAddedInAlternateTab();
|
152
|
+
|
153
|
+
it('When the user clicks on the \'Close\' button alongside alternate answer tab, alternate answer tab should get removed and the name of the alternate answer tabs should get updated and the order of the options should be displayed accordingly', () => {
|
154
|
+
cy.log('Set correct answer and points in alternate 2 tab, then switch to Alternate 1 tab and click delete icon button');
|
155
|
+
listOrderingPage.steps.allotPoints('2');
|
156
|
+
listOrderingPage.steps.navigateToAlternateTab(1);
|
157
|
+
listOrderingPage.steps.deleteAlternateTab();
|
158
|
+
utilities.verifyElementVisibilityState(listOrderingPage.alternateAnswerTab(2), 'notExist');
|
159
|
+
utilities.verifyInnerText(listOrderingPage.alternateAnswerTab(1), 'Alternate 1')
|
160
|
+
listOrderingPage.steps.verifyOptionsTextContentInSetCorrectAnswerSection(options);
|
161
|
+
});
|
162
|
+
|
163
|
+
it('When user deletes an option from the \'Options\' section the order should remain the same without the deleted option in the \'Correct tab\' and \'Alternate tab\' and no error message should be displayed', () => {
|
164
|
+
listOrderingPage.steps.navigateToCorrectTab();
|
165
|
+
listOrderingPage.steps.deleteOption(0);
|
166
|
+
listOrderingPage.steps.verifyErrorMessageIsNotDisplayed();
|
167
|
+
listOrderingPage.steps.verifyOptionsTextContentInSetCorrectAnswerSection(['seed', 'sprout', 'flower']);
|
168
|
+
listOrderingPage.steps.navigateToAlternateTab(1);
|
169
|
+
listOrderingPage.steps.verifyOptionsTextContentInSetCorrectAnswerSection(['sprout', 'flower', 'seed']);
|
170
|
+
});
|
171
|
+
});
|
172
|
+
});
|