itemengine-cypress-automation 1.0.32 → 1.0.36
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/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,440 @@
|
|
1
|
+
import { listSortingPage } from "../../../pages";
|
2
|
+
import abortEarlySetup from "../../../support/helpers/abortEarly";
|
3
|
+
import utilities from "../../../support/helpers/utilities";
|
4
|
+
const css = Cypress.env('css');
|
5
|
+
|
6
|
+
let options = ['seed', 'sprout', 'plant', 'flower'];
|
7
|
+
let correctAnswerArray = ['flower', 'plant', 'sprout', 'seed'];
|
8
|
+
|
9
|
+
describe('Create Item page - list sorting: Question Instructions, Options, Set Correct Answer', () => {
|
10
|
+
before(() => {
|
11
|
+
cy.loginAs('admin');
|
12
|
+
});
|
13
|
+
|
14
|
+
describe('Question Instructions input field - Edit tab', () => {
|
15
|
+
abortEarlySetup();
|
16
|
+
before(() => {
|
17
|
+
cy.log('Navigating to list sorting question type');
|
18
|
+
listSortingPage.steps.navigateToCreateQuestion('list sorting');
|
19
|
+
});
|
20
|
+
|
21
|
+
listSortingPage.tests.verifyQuestionInstructionsInputFieldEditTab();
|
22
|
+
});
|
23
|
+
|
24
|
+
describe('Question Instructions input field - Preview tab', () => {
|
25
|
+
abortEarlySetup();
|
26
|
+
before(() => {
|
27
|
+
cy.log('Navigating to list sorting question type');
|
28
|
+
listSortingPage.steps.navigateToCreateQuestion('list sorting');
|
29
|
+
});
|
30
|
+
|
31
|
+
listSortingPage.tests.verifyQuestionInstructionsInputFieldPreviewTab();
|
32
|
+
});
|
33
|
+
|
34
|
+
describe('Options section - Edit tab', () => {
|
35
|
+
abortEarlySetup();
|
36
|
+
before(() => {
|
37
|
+
cy.log('Navigating to list sorting question type');
|
38
|
+
listSortingPage.steps.navigateToCreateQuestion('list sorting');
|
39
|
+
});
|
40
|
+
|
41
|
+
listSortingPage.tests.verifyOptionSectionEditTabFunctionality();
|
42
|
+
});
|
43
|
+
|
44
|
+
describe('Options section - Set correct answer section for correct tab', () => {
|
45
|
+
abortEarlySetup();
|
46
|
+
before(() => {
|
47
|
+
cy.log('Navigating to list sorting question type');
|
48
|
+
listSortingPage.steps.navigateToCreateQuestion('list sorting');
|
49
|
+
cy.barsPreLoaderWait();
|
50
|
+
});
|
51
|
+
|
52
|
+
it('By default, 4 \'Options\' should be displayed in the source options section with drag handle and 4 empty options should be displayed in the target section in set correct answer section', () => {
|
53
|
+
for (let index = 0; index < 4; index++) {
|
54
|
+
listSortingPage.steps.verifyDragHandleButtonOfOptionInSetCorrectAnswerSection(index)
|
55
|
+
}
|
56
|
+
utilities.verifyElementCount(listSortingPage.setCorrectAnswerSectionOption(), 4);
|
57
|
+
utilities.verifyElementCount(listSortingPage.setCorrectAnswerSectionSourceOptionWrapper(), 4);
|
58
|
+
utilities.verifyInnerText(listSortingPage.setCorrectAnswerSectionSourceOptionWrapper(), '');
|
59
|
+
utilities.verifyElementCount(listSortingPage.setCorrectAnswerSectionTargetOptionWrapper(), 4);
|
60
|
+
utilities.verifyInnerText(listSortingPage.setCorrectAnswerSectionTargetOptionWrapper(), '');
|
61
|
+
});
|
62
|
+
|
63
|
+
it('When user clicks on the \'Delete\' option button then the source and target option wrapper and the option should get removed from the \'Set correct answer\' section', () => {
|
64
|
+
listSortingPage.steps.deleteOption(0);
|
65
|
+
for (let index = 0; index < 3; index++) {
|
66
|
+
listSortingPage.steps.verifyDragHandleButtonOfOptionInSetCorrectAnswerSection(index)
|
67
|
+
}
|
68
|
+
utilities.verifyElementCount(listSortingPage.setCorrectAnswerSectionOption(), 3);
|
69
|
+
utilities.verifyElementCount(listSortingPage.setCorrectAnswerSectionSourceOptionWrapper(), 3);
|
70
|
+
utilities.verifyElementCount(listSortingPage.setCorrectAnswerSectionTargetOptionWrapper(), 3);
|
71
|
+
});
|
72
|
+
|
73
|
+
it('When user adds an option using the \'Add option\' button then source and target option wrapper and the option should be added in the \'Set correct answer\' section', () => {
|
74
|
+
listSortingPage.steps.addOption()
|
75
|
+
for (let index = 0; index < 4; index++) {
|
76
|
+
listSortingPage.steps.verifyDragHandleButtonOfOptionInSetCorrectAnswerSection(index)
|
77
|
+
}
|
78
|
+
utilities.verifyElementCount(listSortingPage.setCorrectAnswerSectionOption(), 4);
|
79
|
+
});
|
80
|
+
|
81
|
+
it('When user adds text to all the options input field, the added text should be displayed in the \'Set correct answer\' section', () => {
|
82
|
+
listSortingPage.steps.addInputToOptionsInputField(options)
|
83
|
+
listSortingPage.steps.verifySourceOptionsTextContentInSetCorrectAnswerSection(options);
|
84
|
+
});
|
85
|
+
|
86
|
+
it('When user edits an option in the \'Options\' section then the correct option should be updated in the source section', () => {
|
87
|
+
listSortingPage.steps.editOptionInputField(0, 'This is an edited option');
|
88
|
+
listSortingPage.steps.verifySourceOptionsTextContentInSetCorrectAnswerSection(['This is an edited option', 'sprout', 'plant', 'flower']);
|
89
|
+
})
|
90
|
+
|
91
|
+
//Need to update once https://redmine.zeuslearning.com/issues/539590 is resolved
|
92
|
+
it('When user sets the order in the target section of the \'Set correct answer\' section and edits an option in the \'Options\' section then the correct option should be updated', () => {
|
93
|
+
listSortingPage.steps.clickAndDropOptionFromSourceToTargetInSetCorrectAnswerSection('flower', 0);
|
94
|
+
listSortingPage.steps.clickAndDropOptionFromSourceToTargetInSetCorrectAnswerSection('plant', 1);
|
95
|
+
listSortingPage.steps.clickAndDropOptionFromSourceToTargetInSetCorrectAnswerSection('sprout', 2);
|
96
|
+
listSortingPage.steps.clickAndDropOptionFromSourceToTargetInSetCorrectAnswerSection('This is an edited option', 3);
|
97
|
+
listSortingPage.steps.verifyTargetOptionsTextContentInSetCorrectAnswerSection(['flower', 'plant', 'sprout', 'This is an edited option']);
|
98
|
+
listSortingPage.steps.editOptionInputField(0, 'seed');
|
99
|
+
listSortingPage.steps.verifyTargetOptionsTextContentInSetCorrectAnswerSection(correctAnswerArray);
|
100
|
+
});
|
101
|
+
});
|
102
|
+
|
103
|
+
describe('Option section - Preview tab', () => {
|
104
|
+
abortEarlySetup();
|
105
|
+
before(() => {
|
106
|
+
cy.log('Navigating to list sorting question type');
|
107
|
+
listSortingPage.steps.navigateToCreateQuestion('list sorting');
|
108
|
+
cy.barsPreLoaderWait();
|
109
|
+
listSortingPage.steps.addQuestionInstructions();
|
110
|
+
listSortingPage.steps.switchToPreviewTab();
|
111
|
+
});
|
112
|
+
|
113
|
+
it('By default, 4 \'Options\' should be displayed in the source options section with drag handle and 4 empty options should be displayed in the target section in \'Preview tab\'', () => {
|
114
|
+
for (let index = 0; index < 4; index++) {
|
115
|
+
listSortingPage.steps.verifyDragHandleButtonOfOptionInPreviewTab(index)
|
116
|
+
}
|
117
|
+
utilities.verifyElementCount(listSortingPage.previewTabOption(), 4);
|
118
|
+
utilities.verifyElementCount(listSortingPage.previewTabSourceOptionWrapper(), 4);
|
119
|
+
utilities.verifyInnerText(listSortingPage.previewTabSourceOptionWrapper(), '');
|
120
|
+
utilities.verifyElementCount(listSortingPage.previewTabTargetOptionWrapper(), 4);
|
121
|
+
utilities.verifyInnerText(listSortingPage.previewTabTargetOptionWrapper(), '');
|
122
|
+
});
|
123
|
+
|
124
|
+
it('When user clicks on the \'Delete\' option button then the source and target option wrapper and the option should get removed from the \'Preview tab\' section', () => {
|
125
|
+
listSortingPage.steps.switchToEditTab();
|
126
|
+
listSortingPage.steps.deleteOption(0);
|
127
|
+
listSortingPage.steps.switchToPreviewTab();
|
128
|
+
for (let index = 0; index < 3; index++) {
|
129
|
+
listSortingPage.steps.verifyDragHandleButtonOfOptionInPreviewTab(index)
|
130
|
+
}
|
131
|
+
utilities.verifyElementCount(listSortingPage.previewTabOption(), 3);
|
132
|
+
utilities.verifyElementCount(listSortingPage.previewTabSourceOptionWrapper(), 3);
|
133
|
+
utilities.verifyElementCount(listSortingPage.previewTabTargetOptionWrapper(), 3);
|
134
|
+
});
|
135
|
+
|
136
|
+
it('When user adds an option using the \'Add option\' button then source and target option wrapper and the option should be added in the \'Preview tab\' section', () => {
|
137
|
+
listSortingPage.steps.switchToEditTab();
|
138
|
+
listSortingPage.steps.addOption();
|
139
|
+
listSortingPage.steps.switchToPreviewTab();
|
140
|
+
for (let index = 0; index < 4; index++) {
|
141
|
+
listSortingPage.steps.verifyDragHandleButtonOfOptionInPreviewTab(index);
|
142
|
+
}
|
143
|
+
utilities.verifyElementCount(listSortingPage.previewTabOption(), 4);
|
144
|
+
utilities.verifyElementCount(listSortingPage.previewTabSourceOptionWrapper(), 4);
|
145
|
+
utilities.verifyElementCount(listSortingPage.previewTabTargetOptionWrapper(), 4);
|
146
|
+
});
|
147
|
+
|
148
|
+
it('When user adds text to all the options input field, the added text should be displayed in the \'Preview tab\' section', () => {
|
149
|
+
listSortingPage.steps.switchToEditTab();
|
150
|
+
listSortingPage.steps.addInputToOptionsInputField(options);
|
151
|
+
listSortingPage.steps.switchToPreviewTab();
|
152
|
+
listSortingPage.steps.verifySourceOptionsTextContentInPreviewTab(options);
|
153
|
+
});
|
154
|
+
|
155
|
+
it('When user sets the order in the target section of the \'Set correct answer\' section and edits an option in the \'Options\' section then the correct option should be updated', () => {
|
156
|
+
listSortingPage.steps.clickAndDropOptionFromSourceToTargetInPreviewTab('flower', 0);
|
157
|
+
listSortingPage.steps.clickAndDropOptionFromSourceToTargetInPreviewTab('plant', 1);
|
158
|
+
listSortingPage.steps.clickAndDropOptionFromSourceToTargetInPreviewTab('sprout', 2);
|
159
|
+
listSortingPage.steps.clickAndDropOptionFromSourceToTargetInPreviewTab('seed', 3);
|
160
|
+
listSortingPage.steps.verifyTargetOptionsTextContentInPreviewTab(correctAnswerArray);
|
161
|
+
});
|
162
|
+
});
|
163
|
+
|
164
|
+
describe('Option section contents with Image, Equation, Text and Link - Set correct answer section for correct tab', () => {
|
165
|
+
abortEarlySetup();
|
166
|
+
before(() => {
|
167
|
+
cy.log('Navigating to list sorting question type');
|
168
|
+
listSortingPage.steps.navigateToCreateQuestion('list sorting');
|
169
|
+
cy.log('Add Image to option input field')
|
170
|
+
listSortingPage.steps.focusInOptionsInputField(0);
|
171
|
+
listSortingPage.steps.selectImageOptionFromCKEditorToolbar()
|
172
|
+
listSortingPage.steps.addImageToInputField();
|
173
|
+
cy.log('Add equation to option input field')
|
174
|
+
listSortingPage.steps.focusInOptionsInputField(1);
|
175
|
+
listSortingPage.steps.selectEquationEditorOptionFromCKEditorToolbar();
|
176
|
+
listSortingPage.steps.addGenericEquationUsingEquationEditorToCKEditorInputField();
|
177
|
+
cy.log('Add link to option input field')
|
178
|
+
listSortingPage.steps.focusInOptionsInputField(2);
|
179
|
+
listSortingPage.steps.selectLinkOptionFromCKEditorToolbar();
|
180
|
+
listSortingPage.steps.addLinkToInputField()
|
181
|
+
cy.log('Add bold text to input field')
|
182
|
+
listSortingPage.steps.focusInOptionsInputField(3);
|
183
|
+
listSortingPage.steps.selectBoldOptionFromCKEditorToolbar();
|
184
|
+
listSortingPage.steps.addBoldTextInputToOptionsInputField(3);
|
185
|
+
});
|
186
|
+
|
187
|
+
listSortingPage.tests.verifyImageEquationLinkBoldTextInSetCorrectAnswerSection();
|
188
|
+
});
|
189
|
+
|
190
|
+
describe('Option section contents with Image, Equation, Text and Link - Set correct answer section for alternate tab', () => {
|
191
|
+
abortEarlySetup();
|
192
|
+
before(() => {
|
193
|
+
cy.log('Navigating to list sorting question type');
|
194
|
+
listSortingPage.steps.navigateToCreateQuestion('list sorting');
|
195
|
+
cy.log('Add Image to option input field')
|
196
|
+
listSortingPage.steps.focusInOptionsInputField(0);
|
197
|
+
listSortingPage.steps.selectImageOptionFromCKEditorToolbar()
|
198
|
+
listSortingPage.steps.addImageToInputField();
|
199
|
+
cy.log('Add equation to option input field')
|
200
|
+
listSortingPage.steps.focusInOptionsInputField(1);
|
201
|
+
listSortingPage.steps.selectEquationEditorOptionFromCKEditorToolbar();
|
202
|
+
listSortingPage.steps.addGenericEquationUsingEquationEditorToCKEditorInputField();
|
203
|
+
cy.log('Add link to option input field')
|
204
|
+
listSortingPage.steps.focusInOptionsInputField(2);
|
205
|
+
listSortingPage.steps.selectLinkOptionFromCKEditorToolbar();
|
206
|
+
listSortingPage.steps.addLinkToInputField()
|
207
|
+
cy.log('Add bold text to input field')
|
208
|
+
listSortingPage.steps.focusInOptionsInputField(3);
|
209
|
+
listSortingPage.steps.selectBoldOptionFromCKEditorToolbar();
|
210
|
+
listSortingPage.steps.addBoldTextInputToOptionsInputField(3);
|
211
|
+
listSortingPage.steps.clickAndDropOptionFromSourceIndexToTargetIndexInSetCorrectAnswerSection(0, 0);
|
212
|
+
listSortingPage.steps.clickAndDropOptionFromSourceIndexToTargetIndexInSetCorrectAnswerSection(1, 1);
|
213
|
+
listSortingPage.steps.clickAndDropOptionFromSourceIndexToTargetIndexInSetCorrectAnswerSection(2, 2);
|
214
|
+
listSortingPage.steps.clickAndDropOptionFromSourceIndexToTargetIndexInSetCorrectAnswerSection(3, 3);
|
215
|
+
listSortingPage.steps.allotPoints('20');
|
216
|
+
listSortingPage.steps.addAlternateTab(1);
|
217
|
+
});
|
218
|
+
|
219
|
+
listSortingPage.tests.verifyImageEquationLinkBoldTextInSetCorrectAnswerSection()
|
220
|
+
|
221
|
+
it('When user adds an option using \'Add option\' button then source and target option wrapper and the option should be added and on deleting the option, the source and target option wrapper and the option should get removed', () => {
|
222
|
+
listSortingPage.steps.addOption()
|
223
|
+
for (let index = 0; index < 4; index++) {
|
224
|
+
listSortingPage.steps.verifyDragHandleButtonOfOptionInSetCorrectAnswerSection(index)
|
225
|
+
}
|
226
|
+
utilities.verifyElementCount(listSortingPage.setCorrectAnswerSectionOption(), 5);
|
227
|
+
utilities.verifyElementCount(listSortingPage.setCorrectAnswerSectionSourceOptionWrapper(), 5);
|
228
|
+
utilities.verifyElementCount(listSortingPage.setCorrectAnswerSectionTargetOptionWrapper(), 5);
|
229
|
+
listSortingPage.steps.deleteOption(4);
|
230
|
+
utilities.verifyElementCount(listSortingPage.setCorrectAnswerSectionOption(), 4);
|
231
|
+
utilities.verifyElementCount(listSortingPage.setCorrectAnswerSectionSourceOptionWrapper(), 4);
|
232
|
+
utilities.verifyElementCount(listSortingPage.setCorrectAnswerSectionTargetOptionWrapper(), 4);
|
233
|
+
});
|
234
|
+
});
|
235
|
+
|
236
|
+
describe('Option section contents with Image, Equation, Text and Link - Preview tab', () => {
|
237
|
+
abortEarlySetup();
|
238
|
+
before(() => {
|
239
|
+
cy.log('Navigating to list sorting question type');
|
240
|
+
listSortingPage.steps.navigateToCreateQuestion('list sorting');
|
241
|
+
cy.log('Add Image to option input field')
|
242
|
+
listSortingPage.steps.focusInOptionsInputField(0);
|
243
|
+
listSortingPage.steps.selectImageOptionFromCKEditorToolbar()
|
244
|
+
listSortingPage.steps.addImageToInputField();
|
245
|
+
cy.log('Add equation to option input field')
|
246
|
+
listSortingPage.steps.focusInOptionsInputField(1);
|
247
|
+
listSortingPage.steps.selectEquationEditorOptionFromCKEditorToolbar();
|
248
|
+
listSortingPage.steps.addGenericEquationUsingEquationEditorToCKEditorInputField();
|
249
|
+
cy.log('Add link to option input field')
|
250
|
+
listSortingPage.steps.focusInOptionsInputField(2);
|
251
|
+
listSortingPage.steps.selectLinkOptionFromCKEditorToolbar();
|
252
|
+
listSortingPage.steps.addLinkToInputField()
|
253
|
+
cy.log('Add bold text to input field')
|
254
|
+
listSortingPage.steps.focusInOptionsInputField(3);
|
255
|
+
listSortingPage.steps.selectBoldOptionFromCKEditorToolbar();
|
256
|
+
listSortingPage.steps.addBoldTextInputToOptionsInputField(3);
|
257
|
+
listSortingPage.steps.switchToPreviewTab()
|
258
|
+
});
|
259
|
+
|
260
|
+
it('When user adds an image, equation, text and link to the options input they should be displayed in the \'Preview tab\' along with drag handles', () => {
|
261
|
+
for (let index = 0; index < 4; index++) {
|
262
|
+
listSortingPage.steps.verifyDragHandleButtonOfOptionInPreviewTab(index)
|
263
|
+
}
|
264
|
+
listSortingPage.steps.verifyImageEquationLinkBoldTextInPreviewTabSourceOption()
|
265
|
+
});
|
266
|
+
|
267
|
+
it('When user hovers on the option it should be displayed in active state and on removing the focus the option should return to the default state', () => {
|
268
|
+
listSortingPage.steps.verifyDefaultAndActiveStateOfOptionInPreviewTab();
|
269
|
+
});
|
270
|
+
|
271
|
+
//Failing due to https://redmine.zeuslearning.com/issues/537907
|
272
|
+
it('CSS of \'Preview tab\' when image, equation and link are added', { tags: 'css' }, () => {
|
273
|
+
utilities.verifyCSS(listSortingPage.previewTabOption().eq(0).find('img'), {
|
274
|
+
'color': css.color.text,
|
275
|
+
'font-size': css.fontSize.default,
|
276
|
+
'font-weight': css.fontWeight.regular
|
277
|
+
});
|
278
|
+
utilities.verifyCSS(listSortingPage.previewTabOption().eq(1).find('.question-text-wrapper'), {
|
279
|
+
'color': css.color.text,
|
280
|
+
'font-size': css.fontSize.default,
|
281
|
+
'font-weight': css.fontWeight.regular
|
282
|
+
});
|
283
|
+
utilities.verifyCSS(listSortingPage.previewTabOption().eq(2).find('a'), {
|
284
|
+
'color': css.color.linkText,
|
285
|
+
'font-size': css.fontSize.default,
|
286
|
+
'font-weight': css.fontWeight.regular
|
287
|
+
});
|
288
|
+
utilities.verifyCSS(listSortingPage.previewTabOption().eq(3).find('.question-text-wrapper'), {
|
289
|
+
'color': css.color.text,
|
290
|
+
'font-size': css.fontSize.default,
|
291
|
+
'font-weight': css.fontWeight.regular
|
292
|
+
});
|
293
|
+
});
|
294
|
+
|
295
|
+
it('Accessibility of \'Preview tab\' when image, equation and link are added', { tags: 'a11y' }, () => {
|
296
|
+
cy.checkAccessibility(listSortingPage.previewTabQuestionWrapper());
|
297
|
+
});
|
298
|
+
|
299
|
+
it('When user sets the order in target section then the options should be displayed in the target section of the Set correct answer section', () => {
|
300
|
+
listSortingPage.steps.clickAndDropOptionFromSourceIndexToTargetIndexInPreviewTab(0, 0);
|
301
|
+
listSortingPage.steps.clickAndDropOptionFromSourceIndexToTargetIndexInPreviewTab(1, 1);
|
302
|
+
listSortingPage.steps.clickAndDropOptionFromSourceIndexToTargetIndexInPreviewTab(2, 2);
|
303
|
+
listSortingPage.steps.clickAndDropOptionFromSourceIndexToTargetIndexInPreviewTab(3, 3);
|
304
|
+
listSortingPage.steps.verifyImageEquationLinkBoldTextInPreviewTabTargetOption();
|
305
|
+
});
|
306
|
+
});
|
307
|
+
|
308
|
+
describe('Labels section - Edit tab contents', () => {
|
309
|
+
abortEarlySetup();
|
310
|
+
before(() => {
|
311
|
+
cy.log('Navigating to list sorting question type');
|
312
|
+
listSortingPage.steps.navigateToCreateQuestion('list sorting');
|
313
|
+
listSortingPage.steps.addQuestionInstructions();
|
314
|
+
listSortingPage.steps.addInputToOptionsInputField(options);
|
315
|
+
});
|
316
|
+
|
317
|
+
it('\'Labels\' label should be displayed', () => {
|
318
|
+
utilities.verifyInnerText(listSortingPage.labelsLabel(), 'Labels');
|
319
|
+
utilities.verifyElementVisibilityState(listSortingPage.labelsLabel(), 'visible');
|
320
|
+
});
|
321
|
+
|
322
|
+
it('\'Unsorted column\' and \'Sorted column\' label should be displayed with input fields', () => {
|
323
|
+
utilities.verifyInnerText(listSortingPage.unsortedColumnLabel(), 'Unsorted column');
|
324
|
+
utilities.verifyElementVisibilityState(listSortingPage.unsortedColumnLabel(), 'visible');
|
325
|
+
utilities.verifyElementVisibilityState(listSortingPage.unsortedColumnInputField(), 'visible');
|
326
|
+
utilities.verifyInnerText(listSortingPage.sortedColumnLabel(), 'Sorted column');
|
327
|
+
utilities.verifyElementVisibilityState(listSortingPage.sortedColumnLabel(), 'visible');
|
328
|
+
utilities.verifyElementVisibilityState(listSortingPage.sortedColumnInputField(), 'visible');
|
329
|
+
});
|
330
|
+
|
331
|
+
it('By default, the unsorted column input field should be prefilled with \'Source\' and it should be displayed in the Set correct answer section', () => {
|
332
|
+
listSortingPage.steps.verifyUnsortedColumnInputField('Source');
|
333
|
+
utilities.verifyInnerText(listSortingPage.setCorrectAnswerSectionUnsortedColumnHeader(), 'Source');
|
334
|
+
utilities.verifyElementVisibilityState(listSortingPage.setCorrectAnswerSectionUnsortedColumnHeader(), 'visible');
|
335
|
+
});
|
336
|
+
|
337
|
+
it('By default, the sorted column input field should be prefilled with \'Target\' and it should be displayed in the Set correct answer section', () => {
|
338
|
+
listSortingPage.steps.verifySortedColumnInputField('Target');
|
339
|
+
utilities.verifyInnerText(listSortingPage.setCorrectAnswerSectionSortedColumnHeader(), 'Target');
|
340
|
+
utilities.verifyElementVisibilityState(listSortingPage.setCorrectAnswerSectionSortedColumnHeader(), 'visible');
|
341
|
+
});
|
342
|
+
|
343
|
+
it('CSS of \'Labels\' section', { tags: 'css' }, () => {
|
344
|
+
utilities.verifyCSS(listSortingPage.labelsLabel(), {
|
345
|
+
'color': css.color.labels,
|
346
|
+
'font-size': css.fontSize.default,
|
347
|
+
'font-weight': css.fontWeight.semibold
|
348
|
+
});
|
349
|
+
utilities.verifyCSS(listSortingPage.unsortedColumnLabel(), {
|
350
|
+
'color': css.color.labels,
|
351
|
+
'font-size': css.fontSize.normal,
|
352
|
+
'font-weight': css.fontWeight.semibold
|
353
|
+
});
|
354
|
+
utilities.verifyCSS(listSortingPage.sortedColumnLabel(), {
|
355
|
+
'color': css.color.labels,
|
356
|
+
'font-size': css.fontSize.normal,
|
357
|
+
'font-weight': css.fontWeight.semibold
|
358
|
+
});
|
359
|
+
utilities.verifyCSS(listSortingPage.sortedColumnInputField(), {
|
360
|
+
'color': css.color.text,
|
361
|
+
'font-size': css.fontSize.default,
|
362
|
+
'font-weight': css.fontWeight.regular
|
363
|
+
});
|
364
|
+
utilities.verifyCSS(listSortingPage.unsortedColumnInputField(), {
|
365
|
+
'color': css.color.text,
|
366
|
+
'font-size': css.fontSize.default,
|
367
|
+
'font-weight': css.fontWeight.regular
|
368
|
+
});
|
369
|
+
});
|
370
|
+
|
371
|
+
it('Accessbility of \'Labels\' section', { tags: 'a11y' }, () => {
|
372
|
+
cy.checkAccessibility(listSortingPage.labelsLabel().parents('[class*="ListSortingstyle__LabelsWrapper"]'));
|
373
|
+
});
|
374
|
+
|
375
|
+
it('When user removes unsorted column and sorted column input fields then an error message \'Error: Please enter label.\' should be displayed and lables should not be displayed in Set correct answer section', () => {
|
376
|
+
listSortingPage.steps.clearSortedColumnInputField();
|
377
|
+
listSortingPage.steps.clearUnsortedColumnInputField();
|
378
|
+
listSortingPage.steps.verifyUnsortedColumnInputFieldErrorMessage();
|
379
|
+
listSortingPage.steps.verifySortedColumnInputFieldErrorMessage();
|
380
|
+
utilities.verifyElementVisibilityState(listSortingPage.setCorrectAnswerSectionSortedColumnHeader(), 'hidden');
|
381
|
+
utilities.verifyElementVisibilityState(listSortingPage.setCorrectAnswerSectionUnsortedColumnHeader(), 'hidden');
|
382
|
+
});
|
383
|
+
|
384
|
+
it('CSS of \'Labels\' section error message', { tags: 'css' }, () => {
|
385
|
+
utilities.verifyCSS(listSortingPage.errorMessage().eq(0), {
|
386
|
+
'color': css.color.errorText,
|
387
|
+
'font-size': css.fontSize.small,
|
388
|
+
'font-weight': css.fontWeight.regular
|
389
|
+
})
|
390
|
+
});
|
391
|
+
|
392
|
+
it('Accessbility of \'Labels\' section error message', { tags: 'a11y' }, () => {
|
393
|
+
cy.checkAccessibility(listSortingPage.errorMessage())
|
394
|
+
});
|
395
|
+
|
396
|
+
it('When user adds input to the unsorted column and sorted column input fields then the error message should disappear and updated updated headers should be displayed in the Set correct answer section', () => {
|
397
|
+
listSortingPage.steps.addInputToUnsortedColumnInputField('Unsorted label');
|
398
|
+
listSortingPage.steps.addInputToSortedColumnInputField('Sorted label');
|
399
|
+
utilities.verifyElementVisibilityState(listSortingPage.errorMessage(), 'notExist');
|
400
|
+
utilities.verifyInnerText(listSortingPage.setCorrectAnswerSectionUnsortedColumnHeader(), 'Unsorted label');
|
401
|
+
utilities.verifyInnerText(listSortingPage.setCorrectAnswerSectionSortedColumnHeader(), 'Sorted label');
|
402
|
+
});
|
403
|
+
});
|
404
|
+
|
405
|
+
describe('Labels section - Preview tab', () => {
|
406
|
+
abortEarlySetup();
|
407
|
+
before(() => {
|
408
|
+
cy.log('Navigating to list sorting question type');
|
409
|
+
listSortingPage.steps.navigateToCreateQuestion('list sorting');
|
410
|
+
listSortingPage.steps.addQuestionInstructions();
|
411
|
+
listSortingPage.steps.addInputToOptionsInputField(options);
|
412
|
+
listSortingPage.steps.switchToPreviewTab()
|
413
|
+
});
|
414
|
+
|
415
|
+
it('By default, \'Source\' and \'Target\' label should be displayed in the \'Preview tab\'', () => {
|
416
|
+
utilities.verifyInnerText(listSortingPage.previewTabUnsortedColumnHeader(), 'Source');
|
417
|
+
utilities.verifyElementVisibilityState(listSortingPage.previewTabUnsortedColumnHeader(), 'visible');
|
418
|
+
utilities.verifyInnerText(listSortingPage.previewTabSortedColumnHeader(), 'Target');
|
419
|
+
utilities.verifyElementVisibilityState(listSortingPage.previewTabSortedColumnHeader(), 'visible');
|
420
|
+
});
|
421
|
+
|
422
|
+
it('When user removes unsorted column and sorted column input fields then no labels should be displayed in the \'Preview tab\' section', () => {
|
423
|
+
listSortingPage.steps.switchToEditTab();
|
424
|
+
listSortingPage.steps.clearSortedColumnInputField();
|
425
|
+
listSortingPage.steps.clearUnsortedColumnInputField();
|
426
|
+
listSortingPage.steps.switchToPreviewTab()
|
427
|
+
utilities.verifyElementVisibilityState(listSortingPage.previewTabSortedColumnHeader(), 'hidden');
|
428
|
+
utilities.verifyElementVisibilityState(listSortingPage.previewTabUnsortedColumnHeader(), 'hidden');
|
429
|
+
});
|
430
|
+
|
431
|
+
it('When user adds input to the unsorted column and sorted column input fields then the labels should be displayed in the \'Preview tab\' section', () => {
|
432
|
+
listSortingPage.steps.switchToEditTab();
|
433
|
+
listSortingPage.steps.addInputToUnsortedColumnInputField('Unsorted label');
|
434
|
+
listSortingPage.steps.addInputToSortedColumnInputField('Sorted label');
|
435
|
+
listSortingPage.steps.switchToPreviewTab();
|
436
|
+
utilities.verifyInnerText(listSortingPage.previewTabUnsortedColumnHeader(), 'Unsorted label');
|
437
|
+
utilities.verifyInnerText(listSortingPage.previewTabSortedColumnHeader(), 'Sorted label');
|
438
|
+
});
|
439
|
+
});
|
440
|
+
});
|