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,456 @@
|
|
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: Click and drop cases in Set correct answer and Preview tab', () => {
|
9
|
+
before(() => {
|
10
|
+
cy.loginAs('admin');
|
11
|
+
});
|
12
|
+
|
13
|
+
describe('Click and drop cases for Set correct answer section', () => {
|
14
|
+
abortEarlySetup();
|
15
|
+
before(() => {
|
16
|
+
cy.log('Navigating to list sorting question type');
|
17
|
+
listSortingPage.steps.navigateToCreateQuestion('list sorting');
|
18
|
+
cy.barsPreLoaderWait();
|
19
|
+
listSortingPage.steps.addInputToOptionsInputField(options);
|
20
|
+
});
|
21
|
+
|
22
|
+
it('When the user has not selected any option in the \'Source\' section then the options and \'Target\' section options wrapper should be displayed in inactive state', () => {
|
23
|
+
for (let index = 0; index < 4; index++) {
|
24
|
+
listSortingPage.steps.verifyInactiveStateOfTargetOptionWrapperSetCorrectAnswerSection(index);
|
25
|
+
listSortingPage.steps.verifyInactiveStateOfSourceOptionWrapperSetCorrectAnswerSection(index);
|
26
|
+
}
|
27
|
+
listSortingPage.steps.verifySourceOptionsTextContentInSetCorrectAnswerSection(options);
|
28
|
+
});
|
29
|
+
|
30
|
+
it('CSS of inactive state of options and \'Target\' section options wrapper', { tags: 'css' }, () => {
|
31
|
+
utilities.verifyCSS(listSortingPage.setCorrectAnswerSectionTargetOptionWrapper().find('[class*="DroppableWrapper"]'), {
|
32
|
+
'border': `1px dashed ${css.color.figDefaultComponentBorder}`
|
33
|
+
});
|
34
|
+
});
|
35
|
+
|
36
|
+
//Note - a11y covered in Set correct answer section
|
37
|
+
|
38
|
+
it('When the user selects an option, it should get in selected state and all the \'Target\' section options wrapper should get in active state', () => {
|
39
|
+
listSortingPage.steps.selectSourceOptionSetCorrectAnswerSection(0);
|
40
|
+
listSortingPage.steps.verifyActiveStateOfSourceOptionSetCorrectAnswerSection(0);
|
41
|
+
for (let index = 0; index < 4; index++) {
|
42
|
+
listSortingPage.steps.verifyActiveStateOfTargetOptionWrapperSetCorrectAnswerSection(index)
|
43
|
+
}
|
44
|
+
for (let index = 1; index < 4; index++) {
|
45
|
+
listSortingPage.steps.verifyInactiveStateOfSourceOptionWrapperSetCorrectAnswerSection(index)
|
46
|
+
}
|
47
|
+
});
|
48
|
+
|
49
|
+
it('CSS of active state of options and \'Target\' section options wrapper', { tags: 'css' }, () => {
|
50
|
+
utilities.verifyCSS(listSortingPage.setCorrectAnswerSectionTargetOptionWrapper().find('[class*="DroppableWrapper"]'), {
|
51
|
+
'border': `1px solid ${css.color.activeComponentBorder}`
|
52
|
+
});
|
53
|
+
utilities.verifyCSS(listSortingPage.setCorrectAnswerSectionOption().eq(0), {
|
54
|
+
'border': `2px solid ${css.color.activeButtons}`
|
55
|
+
});
|
56
|
+
utilities.verifyCSS(listSortingPage.setCorrectAnswerSectionOption().eq(0).find('[class*="DragIcon"] svg'), {
|
57
|
+
'border': `2px solid ${css.color.activeButtons}`
|
58
|
+
});
|
59
|
+
});
|
60
|
+
|
61
|
+
it('Accessibility of active state of options and \'Target\' section options wrapper', { tags: 'a11y' }, () => {
|
62
|
+
cy.checkAccessibility(listSortingPage.setCorrectAnswerSectionOption().eq(0).parents('.list-sorting-response-container'))
|
63
|
+
});
|
64
|
+
|
65
|
+
it('When the user deselects the option, it should get in deselected state and the \'Target\' section options wrapper should return to the inactive state', () => {
|
66
|
+
listSortingPage.steps.selectSourceOptionSetCorrectAnswerSection(0);
|
67
|
+
listSortingPage.steps.verifyInactiveStateOfSourceOptionSetCorrectAnswerSection(0);
|
68
|
+
for (let index = 0; index < 4; index++) {
|
69
|
+
listSortingPage.steps.verifyInactiveStateOfTargetOptionWrapperSetCorrectAnswerSection(index)
|
70
|
+
listSortingPage.steps.verifyInactiveStateOfSourceOptionWrapperSetCorrectAnswerSection(index)
|
71
|
+
}
|
72
|
+
});
|
73
|
+
|
74
|
+
it('When the user moves an option in \'Target\' section, the option should get removed from the \'Source\' section, and the \'Target\' section options wrapper should return to inactive state', () => {
|
75
|
+
listSortingPage.steps.clickAndDropOptionFromSourceToTargetInSetCorrectAnswerSection('seed', 0);
|
76
|
+
for (let index = 0; index < 4; index++) {
|
77
|
+
listSortingPage.steps.verifyInactiveStateOfTargetOptionWrapperSetCorrectAnswerSection(index)
|
78
|
+
listSortingPage.steps.verifyInactiveStateOfSourceOptionWrapperSetCorrectAnswerSection(index)
|
79
|
+
}
|
80
|
+
listSortingPage.steps.verifySourceOptionsTextContentInSetCorrectAnswerSection(['plant', 'sprout', 'flower', '']);
|
81
|
+
listSortingPage.steps.verifyTargetOptionsTextContentInSetCorrectAnswerSection(['seed', '', '', '']);
|
82
|
+
});
|
83
|
+
|
84
|
+
it('When user selects another option from \'Source\' section then the empty \'Source\' section options wrapper and the empty \'Target\' section option wrapper should be displayed in active state', () => {
|
85
|
+
listSortingPage.steps.selectSourceOptionSetCorrectAnswerSection(1);
|
86
|
+
listSortingPage.steps.verifyActiveStateOfSourceOptionSetCorrectAnswerSection(1);
|
87
|
+
for (let index = 1; index < 4; index++) {
|
88
|
+
listSortingPage.steps.verifyActiveStateOfTargetOptionWrapperSetCorrectAnswerSection(index);
|
89
|
+
}
|
90
|
+
listSortingPage.steps.verifyInactiveStateOfTargetOptionWrapperSetCorrectAnswerSection(0);
|
91
|
+
for (let index = 0; index < 3; index++) {
|
92
|
+
listSortingPage.steps.verifyInactiveStateOfSourceOptionWrapperSetCorrectAnswerSection(index);
|
93
|
+
}
|
94
|
+
listSortingPage.steps.verifyActiveStateOfSourceOptionWrapperSetCorrectAnswerSection(3);
|
95
|
+
});
|
96
|
+
|
97
|
+
it('User should be able to reorder the options within the \'Source\' section', () => {
|
98
|
+
listSortingPage.steps.selectSourceOptionSetCorrectAnswerSection(0);
|
99
|
+
listSortingPage.steps.verifySourceOptionsTextContentInSetCorrectAnswerSection(['sprout', 'plant', 'flower', '']);
|
100
|
+
});
|
101
|
+
|
102
|
+
it('User should be able to move all options from \'Source\' section to \'Target\' section', () => {
|
103
|
+
listSortingPage.steps.clickAndDropOptionFromSourceToTargetInSetCorrectAnswerSection('sprout', 1);
|
104
|
+
listSortingPage.steps.clickAndDropOptionFromSourceToTargetInSetCorrectAnswerSection('plant', 2);
|
105
|
+
listSortingPage.steps.clickAndDropOptionFromSourceToTargetInSetCorrectAnswerSection('flower', 3);
|
106
|
+
listSortingPage.steps.verifyTargetOptionsTextContentInSetCorrectAnswerSection(['seed', 'sprout', 'plant', 'flower']);
|
107
|
+
});
|
108
|
+
|
109
|
+
it('When all the options are in \'Target\' section then user should be able to re-order the options in the \'Target\' section', () => {
|
110
|
+
listSortingPage.steps.selectTargetOptionSetCorrectAnswerSection(1);
|
111
|
+
listSortingPage.steps.selectTargetOptionSetCorrectAnswerSection(0);
|
112
|
+
listSortingPage.steps.verifyTargetOptionsTextContentInSetCorrectAnswerSection(['sprout', 'seed', 'plant', 'flower']);
|
113
|
+
utilities.verifyInnerText(listSortingPage.setCorrectAnswerSectionSourceOptionWrapper(), '');
|
114
|
+
});
|
115
|
+
|
116
|
+
it('CSS of inactive state of options and \'Source\' section options wrapper', { tags: 'css' }, () => {
|
117
|
+
utilities.verifyCSS(listSortingPage.setCorrectAnswerSectionTargetOptionWrapper().find('[class*="DroppableWrapper"]'), {
|
118
|
+
'border': `1px dashed ${css.color.figDefaultComponentBorder}`
|
119
|
+
});
|
120
|
+
});
|
121
|
+
|
122
|
+
it('Accessibility of inactive state of options and \'Source\' section options wrapper', { tags: 'a11y' }, () => {
|
123
|
+
cy.checkAccessibility(listSortingPage.setCorrectAnswerSectionOption().eq(0).parents('.list-sorting-response-container'))
|
124
|
+
});
|
125
|
+
|
126
|
+
it('When user selects an option then all \'Source\' options wrapper and the selected option should be displayed in active state', () => {
|
127
|
+
listSortingPage.steps.selectTargetOptionSetCorrectAnswerSection(0);
|
128
|
+
listSortingPage.steps.verifyActiveStateOfTargetOptionSetCorrectAnswerSection(0)
|
129
|
+
for (let index = 0; index < 4; index++) {
|
130
|
+
listSortingPage.steps.verifyActiveStateOfSourceOptionWrapperSetCorrectAnswerSection(index)
|
131
|
+
listSortingPage.steps.verifyInactiveStateOfTargetOptionWrapperSetCorrectAnswerSection(index)
|
132
|
+
}
|
133
|
+
});
|
134
|
+
|
135
|
+
it('CSS of active state of target options', { tags: 'css' }, () => {
|
136
|
+
utilities.verifyCSS(listSortingPage.setCorrectAnswerSectionOption().eq(0), {
|
137
|
+
'border': `2px solid ${css.color.activeButtons}`
|
138
|
+
});
|
139
|
+
utilities.verifyCSS(listSortingPage.setCorrectAnswerSectionOption().eq(0).find('[class*="DragIcon"] svg'), {
|
140
|
+
'border': `2px solid ${css.color.activeButtons}`
|
141
|
+
});
|
142
|
+
});
|
143
|
+
|
144
|
+
it('User should be able to move options from \'Target\' section to \'Source\' section', () => {
|
145
|
+
listSortingPage.steps.clickOnLeftArrowKeySetCorrectAnswerSection();
|
146
|
+
listSortingPage.steps.clickAndDropOptionFromTargetToSourceInSetCorrectAnswerSection('plant', 1);
|
147
|
+
listSortingPage.steps.clickAndDropOptionFromTargetToSourceInSetCorrectAnswerSection('flower', 2);
|
148
|
+
listSortingPage.steps.clickAndDropOptionFromTargetToSourceInSetCorrectAnswerSection('seed', 3);
|
149
|
+
listSortingPage.steps.verifySourceOptionsTextContentInSetCorrectAnswerSection(['sprout', 'plant', 'flower', 'seed']);
|
150
|
+
});
|
151
|
+
});
|
152
|
+
|
153
|
+
describe('Click and drop cases - Arrow buttons in set correct answer section', () => {
|
154
|
+
abortEarlySetup();
|
155
|
+
before(() => {
|
156
|
+
cy.log('Navigating to list sorting question type');
|
157
|
+
listSortingPage.steps.navigateToCreateQuestion('list sorting');
|
158
|
+
cy.barsPreLoaderWait();
|
159
|
+
listSortingPage.steps.addInputToOptionsInputField(options)
|
160
|
+
});
|
161
|
+
|
162
|
+
it('When user selects an option from the \'Source\' section then the right arrow button should be displayed in enabled state and left arrow buttons should be displayed in disabled state', () => {
|
163
|
+
listSortingPage.steps.selectSourceOptionSetCorrectAnswerSection(0);
|
164
|
+
listSortingPage.steps.verifyRightArrowEnabledSetCorrectAnswerSection();
|
165
|
+
listSortingPage.steps.verifyLeftArrowDisabledSetCorrectAnswerSection();
|
166
|
+
});
|
167
|
+
|
168
|
+
it('CSS of enabled right arrow button and disabled left arrow button', { tags: 'css' }, () => {
|
169
|
+
utilities.verifyCSS(listSortingPage.setCorrectAnswerSectionButtonRightArrow().find('svg path'), {
|
170
|
+
'stroke': css.color.secondaryBtnActive
|
171
|
+
});
|
172
|
+
utilities.verifyCSS(listSortingPage.setCorrectAnswerSectionButtonLeftArrow().find('svg path'), {
|
173
|
+
'stroke': css.color.secondaryBtnDisabled
|
174
|
+
});
|
175
|
+
});
|
176
|
+
|
177
|
+
it('Accessibility enabled right arrow button', { tags: 'a11y' }, () => {
|
178
|
+
cy.checkAccessibility(listSortingPage.setCorrectAnswerSectionButtonRightArrow().parents('.arrow-icon-container'));
|
179
|
+
});
|
180
|
+
|
181
|
+
it('When user selects the right arrow button then the selected option should move from \'Source\' section to first empty position in \'Target\' section', () => {
|
182
|
+
listSortingPage.steps.clickOnRightArrowKeySetCorrectAnswerSection();
|
183
|
+
listSortingPage.steps.verifyTargetOptionsTextContentInSetCorrectAnswerSection(['plant', '', '', '']);
|
184
|
+
listSortingPage.steps.verifySourceOptionsTextContentInSetCorrectAnswerSection(['', 'sprout', 'flower', 'seed']);
|
185
|
+
});
|
186
|
+
|
187
|
+
it('When user has moved the option to \'Target\' then the arrow buttons should be displayed in disabled state', () => {
|
188
|
+
listSortingPage.steps.verifyRightArrowDisabledSetCorrectAnswerSection();
|
189
|
+
listSortingPage.steps.verifyLeftArrowDisabledSetCorrectAnswerSection();
|
190
|
+
});
|
191
|
+
|
192
|
+
it('User should be able to move multiple options in the \'Target\' section and they should move to first empty position in \'Target\' section', () => {
|
193
|
+
listSortingPage.steps.selectSourceOptionSetCorrectAnswerSection(2);
|
194
|
+
listSortingPage.steps.clickOnRightArrowKeySetCorrectAnswerSection();
|
195
|
+
listSortingPage.steps.verifyTargetOptionsTextContentInSetCorrectAnswerSection(['plant', 'flower', '', '']);
|
196
|
+
listSortingPage.steps.verifySourceOptionsTextContentInSetCorrectAnswerSection(['', 'sprout', '', 'seed']);
|
197
|
+
});
|
198
|
+
|
199
|
+
it('When user selects an option from the \'Target\' section then the left arrow button should be displayed in enabled state and right arrow buttons should be displayed in disabled state', () => {
|
200
|
+
listSortingPage.steps.selectTargetOptionSetCorrectAnswerSection(0);
|
201
|
+
listSortingPage.steps.verifyRightArrowDisabledSetCorrectAnswerSection();
|
202
|
+
listSortingPage.steps.verifyLeftArrowEnabledSetCorrectAnswerSection();
|
203
|
+
});
|
204
|
+
|
205
|
+
it('CSS of enabled left arrow button and disabled right arrow button', { tags: 'css' }, () => {
|
206
|
+
utilities.verifyCSS(listSortingPage.setCorrectAnswerSectionButtonLeftArrow().find('svg path'), {
|
207
|
+
'stroke': css.color.secondaryBtnActive
|
208
|
+
});
|
209
|
+
utilities.verifyCSS(listSortingPage.setCorrectAnswerSectionButtonRightArrow().find('svg path'), {
|
210
|
+
'stroke': css.color.secondaryBtnDisabled
|
211
|
+
});
|
212
|
+
});
|
213
|
+
|
214
|
+
it('Accessibility enabled right arrow button', { tags: 'a11y' }, () => {
|
215
|
+
cy.checkAccessibility(listSortingPage.setCorrectAnswerSectionButtonLeftArrow().parents('.arrow-icon-container'));
|
216
|
+
});
|
217
|
+
|
218
|
+
it('When user selects the left arrow button then the selected option should move from \'Target\' section to first empty position in \'Source\' section', () => {
|
219
|
+
listSortingPage.steps.clickOnLeftArrowKeySetCorrectAnswerSection();
|
220
|
+
listSortingPage.steps.verifyTargetOptionsTextContentInSetCorrectAnswerSection(['', 'flower', '', '']);
|
221
|
+
listSortingPage.steps.verifySourceOptionsTextContentInSetCorrectAnswerSection(['plant', 'sprout', '', 'seed']);
|
222
|
+
});
|
223
|
+
|
224
|
+
it('User should be able to move multiple options in the \'Source\' section and they should move to first empty position in \'Source\' section', () => {
|
225
|
+
listSortingPage.steps.selectTargetOptionSetCorrectAnswerSection(1);
|
226
|
+
listSortingPage.steps.clickOnLeftArrowKeySetCorrectAnswerSection();
|
227
|
+
listSortingPage.steps.verifySourceOptionsTextContentInSetCorrectAnswerSection(['plant', 'sprout', 'flower', 'seed']);
|
228
|
+
utilities.verifyInnerText(listSortingPage.setCorrectAnswerSectionTargetOptionWrapper(), '');
|
229
|
+
});
|
230
|
+
});
|
231
|
+
|
232
|
+
describe('Click and drop cases for Preview tab', () => {
|
233
|
+
abortEarlySetup();
|
234
|
+
before(() => {
|
235
|
+
cy.log('Navigating to list sorting question type');
|
236
|
+
listSortingPage.steps.navigateToCreateQuestion('list sorting');
|
237
|
+
cy.barsPreLoaderWait();
|
238
|
+
listSortingPage.steps.addInputToOptionsInputField(options);
|
239
|
+
listSortingPage.steps.switchToPreviewTab();
|
240
|
+
});
|
241
|
+
|
242
|
+
it('When the user has not selected any option in the \'Source\' section then the options and \'Target\' section options wrapper should be displayed in inactive state', () => {
|
243
|
+
for (let index = 0; index < 4; index++) {
|
244
|
+
listSortingPage.steps.verifyInactiveStateOfTargetOptionWrapperPreviewTab(index);
|
245
|
+
listSortingPage.steps.verifyInactiveStateOfSourceOptionWrapperPreviewTab(index);
|
246
|
+
}
|
247
|
+
listSortingPage.steps.verifySourceOptionsTextContentInPreviewTab(options);
|
248
|
+
});
|
249
|
+
|
250
|
+
it('CSS of inactive state of options and \'Target\' section options wrapper', { tags: 'css' }, () => {
|
251
|
+
utilities.verifyCSS(listSortingPage.previewTabTargetOptionWrapper().find('[class*="DroppableWrapper"]'), {
|
252
|
+
'border': `1px dashed ${css.color.figDefaultComponentBorder}`
|
253
|
+
});
|
254
|
+
});
|
255
|
+
|
256
|
+
it('Accessibility of inactive state of options and \'Target\' section options wrapper', { tags: 'a11y' }, () => {
|
257
|
+
cy.checkAccessibility(listSortingPage.previewTabOption().eq(0).parents('[class*="ListSortingResponsestyles__ContextContainer"]'))
|
258
|
+
});
|
259
|
+
|
260
|
+
it('When the user selects an option, it should get in selected state and all the \'Target\' section options wrapper should get in active state', () => {
|
261
|
+
listSortingPage.steps.selectSourceOptionPreviewTab(0);
|
262
|
+
listSortingPage.steps.verifyActiveStateOfSourceOptionPreviewTab(0);
|
263
|
+
for (let index = 0; index < 4; index++) {
|
264
|
+
listSortingPage.steps.verifyActiveStateOfTargetOptionWrapperPreviewTab(index)
|
265
|
+
}
|
266
|
+
for (let index = 1; index < 4; index++) {
|
267
|
+
listSortingPage.steps.verifyInactiveStateOfSourceOptionWrapperPreviewTab(index)
|
268
|
+
}
|
269
|
+
});
|
270
|
+
|
271
|
+
it('CSS of active state of options and \'Target\' section options wrapper', { tags: 'css' }, () => {
|
272
|
+
utilities.verifyCSS(listSortingPage.previewTabTargetOptionWrapper().find('[class*="DroppableWrapper"]'), {
|
273
|
+
'border': `1px solid ${css.color.activeComponentBorder}`
|
274
|
+
});
|
275
|
+
utilities.verifyCSS(listSortingPage.previewTabOption().eq(0), {
|
276
|
+
'border': `2px solid ${css.color.activeButtons}`
|
277
|
+
});
|
278
|
+
utilities.verifyCSS(listSortingPage.previewTabOption().eq(0).find('[class*="DragIcon"] svg'), {
|
279
|
+
'border': `2px solid ${css.color.activeButtons}`
|
280
|
+
});
|
281
|
+
});
|
282
|
+
|
283
|
+
it('Accessibility of active state of options and \'Target\' section options wrapper', { tags: 'a11y' }, () => {
|
284
|
+
cy.checkAccessibility(listSortingPage.previewTabOption().eq(0).parents('[class*="ListSortingResponsestyles__ContextContainer"]'))
|
285
|
+
});
|
286
|
+
|
287
|
+
|
288
|
+
it('When the user deselects the option, it should get in deselected state and the \'Target\' section options wrapper should return to the inactive state', () => {
|
289
|
+
listSortingPage.steps.selectSourceOptionPreviewTab(0);
|
290
|
+
listSortingPage.steps.verifyInactiveStateOfSourceOptionPreviewTab(0);
|
291
|
+
for (let index = 0; index < 4; index++) {
|
292
|
+
listSortingPage.steps.verifyInactiveStateOfTargetOptionWrapperPreviewTab(index)
|
293
|
+
listSortingPage.steps.verifyInactiveStateOfSourceOptionWrapperPreviewTab(index)
|
294
|
+
}
|
295
|
+
});
|
296
|
+
|
297
|
+
it('When the user moves an option in \'Target\' section, the option should get removed from the \'Source\' section, and the \'Target\' section options wrapper should return to inactive state', () => {
|
298
|
+
listSortingPage.steps.clickAndDropOptionFromSourceToTargetInPreviewTab('seed', 0);
|
299
|
+
for (let index = 0; index < 4; index++) {
|
300
|
+
listSortingPage.steps.verifyInactiveStateOfTargetOptionWrapperPreviewTab(index)
|
301
|
+
listSortingPage.steps.verifyInactiveStateOfSourceOptionWrapperPreviewTab(index)
|
302
|
+
}
|
303
|
+
listSortingPage.steps.verifySourceOptionsTextContentInPreviewTab(['plant', 'sprout', 'flower', '']);
|
304
|
+
listSortingPage.steps.verifyTargetOptionsTextContentInPreviewTab(['seed', '', '', '']);
|
305
|
+
});
|
306
|
+
|
307
|
+
it('When user selects another option from \'Source\' section then the empty \'Source\' section options wrapper and the empty \'Target\' section option wrapper should be displayed in active state', () => {
|
308
|
+
listSortingPage.steps.selectSourceOptionPreviewTab(1);
|
309
|
+
listSortingPage.steps.verifyActiveStateOfSourceOptionPreviewTab(1);
|
310
|
+
for (let index = 1; index < 4; index++) {
|
311
|
+
listSortingPage.steps.verifyActiveStateOfTargetOptionWrapperPreviewTab(index);
|
312
|
+
}
|
313
|
+
listSortingPage.steps.verifyInactiveStateOfTargetOptionWrapperPreviewTab(0);
|
314
|
+
for (let index = 0; index < 3; index++) {
|
315
|
+
listSortingPage.steps.verifyInactiveStateOfSourceOptionWrapperPreviewTab(index);
|
316
|
+
}
|
317
|
+
listSortingPage.steps.verifyActiveStateOfSourceOptionWrapperPreviewTab(3);
|
318
|
+
});
|
319
|
+
|
320
|
+
it('User should be able to reorder the options within the \'Source\' section', () => {
|
321
|
+
listSortingPage.steps.selectSourceOptionPreviewTab(0);
|
322
|
+
listSortingPage.steps.verifySourceOptionsTextContentInPreviewTab(['sprout', 'plant', 'flower', '']);
|
323
|
+
});
|
324
|
+
|
325
|
+
it('User should be able to move all options from \'Source\' section to \'Target\' section', () => {
|
326
|
+
listSortingPage.steps.clickAndDropOptionFromSourceToTargetInPreviewTab('sprout', 1);
|
327
|
+
listSortingPage.steps.clickAndDropOptionFromSourceToTargetInPreviewTab('plant', 2);
|
328
|
+
listSortingPage.steps.clickAndDropOptionFromSourceToTargetInPreviewTab('flower', 3);
|
329
|
+
listSortingPage.steps.verifyTargetOptionsTextContentInPreviewTab(['seed', 'sprout', 'plant', 'flower']);
|
330
|
+
});
|
331
|
+
|
332
|
+
it('When all the options are in \'Target\' section then user should be able to re-order the options in the \'Target\' section', () => {
|
333
|
+
listSortingPage.steps.selectTargetOptionPreviewTab(1);
|
334
|
+
listSortingPage.steps.selectTargetOptionPreviewTab(0);
|
335
|
+
listSortingPage.steps.verifyTargetOptionsTextContentInPreviewTab(['sprout', 'seed', 'plant', 'flower']);
|
336
|
+
utilities.verifyInnerText(listSortingPage.previewTabSourceOptionWrapper(), '');
|
337
|
+
});
|
338
|
+
|
339
|
+
|
340
|
+
it('CSS of inactive state of options and \'Source\' section options wrapper', { tags: 'css' }, () => {
|
341
|
+
utilities.verifyCSS(listSortingPage.previewTabSourceOptionWrapper().find('[class*="DroppableWrapper"]'), {
|
342
|
+
'border': `1px dashed ${css.color.figDefaultComponentBorder}`
|
343
|
+
});
|
344
|
+
});
|
345
|
+
|
346
|
+
it('Accessibility of active state of options and \'Source\' section options wrapper', { tags: 'a11y' }, () => {
|
347
|
+
cy.checkAccessibility(listSortingPage.previewTabOption().eq(0).parents('[class*="ListSortingResponsestyles__ContextContainer"]'))
|
348
|
+
});
|
349
|
+
|
350
|
+
it('When user selects an option then all \'Source\' options wrapper and the selected option should be displayed in active state', () => {
|
351
|
+
listSortingPage.steps.selectTargetOptionPreviewTab(0);
|
352
|
+
listSortingPage.steps.verifyActiveStateOfTargetOptionPreviewTab(0)
|
353
|
+
for (let index = 0; index < 4; index++) {
|
354
|
+
listSortingPage.steps.verifyActiveStateOfSourceOptionWrapperPreviewTab(index)
|
355
|
+
listSortingPage.steps.verifyInactiveStateOfTargetOptionWrapperPreviewTab(index)
|
356
|
+
}
|
357
|
+
});
|
358
|
+
|
359
|
+
it('CSS of active state of target options', { tags: 'css' }, () => {
|
360
|
+
utilities.verifyCSS(listSortingPage.previewTabOption().eq(0), {
|
361
|
+
'border': `2px solid ${css.color.activeButtons}`
|
362
|
+
});
|
363
|
+
utilities.verifyCSS(listSortingPage.previewTabOption().eq(0).find('[class*="DragIcon"] svg'), {
|
364
|
+
'border': `2px solid ${css.color.activeButtons}`
|
365
|
+
});
|
366
|
+
});
|
367
|
+
|
368
|
+
it('User should be able to move options from \'Target\' section to \'Source\' section', () => {
|
369
|
+
listSortingPage.steps.clickOnLeftArrowKeyPreviewTab();
|
370
|
+
listSortingPage.steps.clickAndDropOptionFromTargetToSourceInPreviewTab('plant', 1);
|
371
|
+
listSortingPage.steps.clickAndDropOptionFromTargetToSourceInPreviewTab('flower', 2);
|
372
|
+
listSortingPage.steps.clickAndDropOptionFromTargetToSourceInPreviewTab('seed', 3);
|
373
|
+
listSortingPage.steps.verifySourceOptionsTextContentInPreviewTab(['sprout', 'plant', 'flower', 'seed']);
|
374
|
+
});
|
375
|
+
});
|
376
|
+
|
377
|
+
describe('Click and drop cases - Arrow buttons in Preview tab', () => {
|
378
|
+
abortEarlySetup();
|
379
|
+
before(() => {
|
380
|
+
cy.log('Navigating to list sorting question type');
|
381
|
+
listSortingPage.steps.navigateToCreateQuestion('list sorting');
|
382
|
+
cy.barsPreLoaderWait()
|
383
|
+
listSortingPage.steps.addInputToOptionsInputField(options);
|
384
|
+
listSortingPage.steps.switchToPreviewTab()
|
385
|
+
});
|
386
|
+
|
387
|
+
it('When user selects an option from the \'Source\' section then the right arrow button should be displayed in enabled state and left arrow buttons should be displayed in disabled state', () => {
|
388
|
+
listSortingPage.steps.selectSourceOptionPreviewTab(0);
|
389
|
+
listSortingPage.steps.verifyRightArrowEnabledPreviewTab();
|
390
|
+
listSortingPage.steps.verifyLeftArrowDisabledPreviewTab();
|
391
|
+
});
|
392
|
+
|
393
|
+
it('CSS of enabled right arrow button and disabled left arrow button', { tags: 'css' }, () => {
|
394
|
+
utilities.verifyCSS(listSortingPage.previewTabButtonRightArrow().find('svg path'), {
|
395
|
+
'stroke': css.color.secondaryBtnActive
|
396
|
+
});
|
397
|
+
utilities.verifyCSS(listSortingPage.previewTabButtonLeftArrow().find('svg path'), {
|
398
|
+
'stroke': css.color.secondaryBtnDisabled
|
399
|
+
});
|
400
|
+
});
|
401
|
+
|
402
|
+
it('Accessibility enabled right arrow button', { tags: 'a11y' }, () => {
|
403
|
+
cy.checkAccessibility(listSortingPage.previewTabButtonRightArrow().parents('.arrow-icon-container'));
|
404
|
+
});
|
405
|
+
|
406
|
+
it('When user selects the right arrow button then the selected option should move from \'Source\' section to first empty position in \'Target\' section', () => {
|
407
|
+
listSortingPage.steps.clickOnRightArrowKeyPreviewTab();
|
408
|
+
listSortingPage.steps.verifyTargetOptionsTextContentInPreviewTab(['plant', '', '', '']);
|
409
|
+
listSortingPage.steps.verifySourceOptionsTextContentInPreviewTab(['', 'sprout', 'flower', 'seed']);
|
410
|
+
});
|
411
|
+
|
412
|
+
it('When user has moved the option to \'Target\' then the arrow buttons should be displayed in disabled state', () => {
|
413
|
+
listSortingPage.steps.verifyRightArrowDisabledPreviewTab();
|
414
|
+
listSortingPage.steps.verifyLeftArrowDisabledPreviewTab();
|
415
|
+
});
|
416
|
+
|
417
|
+
it('User should be able to move multiple options in the \'Target\' section and they should move to first empty position in \'Target\' section', () => {
|
418
|
+
listSortingPage.steps.selectSourceOptionPreviewTab(2);
|
419
|
+
listSortingPage.steps.clickOnRightArrowKeyPreviewTab();
|
420
|
+
listSortingPage.steps.verifyTargetOptionsTextContentInPreviewTab(['plant', 'flower', '', '']);
|
421
|
+
listSortingPage.steps.verifySourceOptionsTextContentInPreviewTab(['', 'sprout', '', 'seed']);
|
422
|
+
});
|
423
|
+
|
424
|
+
it('When user selects an option from the \'Target\' section then the left arrow button should be displayed in enabled state and right arrow buttons should be displayed in disabled state', () => {
|
425
|
+
listSortingPage.steps.selectTargetOptionPreviewTab(0);
|
426
|
+
listSortingPage.steps.verifyRightArrowDisabledPreviewTab();
|
427
|
+
listSortingPage.steps.verifyLeftArrowEnabledPreviewTab();
|
428
|
+
});
|
429
|
+
|
430
|
+
it('CSS of enabled left arrow button and disabled right arrow button', { tags: 'css' }, () => {
|
431
|
+
utilities.verifyCSS(listSortingPage.previewTabButtonLeftArrow().find('svg path'), {
|
432
|
+
'stroke': css.color.secondaryBtnActive
|
433
|
+
});
|
434
|
+
utilities.verifyCSS(listSortingPage.previewTabButtonRightArrow().find('svg path'), {
|
435
|
+
'stroke': css.color.secondaryBtnDisabled
|
436
|
+
});
|
437
|
+
});
|
438
|
+
|
439
|
+
it('Accessibility enabled right arrow button', { tags: 'a11y' }, () => {
|
440
|
+
cy.checkAccessibility(listSortingPage.previewTabButtonLeftArrow().parents('.arrow-icon-container'));
|
441
|
+
});
|
442
|
+
|
443
|
+
it('When user selects the left arrow button then the selected option should move from \'Target\' section to first empty position in \'Source\' section', () => {
|
444
|
+
listSortingPage.steps.clickOnLeftArrowKeyPreviewTab();
|
445
|
+
listSortingPage.steps.verifyTargetOptionsTextContentInPreviewTab(['', 'flower', '', '']);
|
446
|
+
listSortingPage.steps.verifySourceOptionsTextContentInPreviewTab(['plant', 'sprout', '', 'seed']);
|
447
|
+
});
|
448
|
+
|
449
|
+
it('User should be able to move multiple options in the \'Source\' section and they should move to first empty position in \'Source\' section', () => {
|
450
|
+
listSortingPage.steps.selectTargetOptionPreviewTab(1);
|
451
|
+
listSortingPage.steps.clickOnLeftArrowKeyPreviewTab();
|
452
|
+
listSortingPage.steps.verifySourceOptionsTextContentInPreviewTab(['plant', 'sprout', 'flower', 'seed']);
|
453
|
+
utilities.verifyInnerText(listSortingPage.previewTabTargetOptionWrapper(), '');
|
454
|
+
});
|
455
|
+
});
|
456
|
+
});
|