itemengine-cypress-automation 1.0.36 → 1.0.37
Sign up to get free protection for your applications and to get access to all the features.
- 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/listSortingEditTabBasicSection.js +1 -276
- package/cypress/e2e/ILC/ListSorting/listSortingOptionsSection.js +287 -0
- package/cypress/e2e/ILC/ListSorting/listSortingPartialDifferentWeightsScoring.js +1 -941
- package/cypress/e2e/ILC/ListSorting/listSortingPartialDifferentWeightsScoringWithAlternateTab.js +952 -0
- package/cypress/e2e/ILC/ListSorting/listSortingPartialEqualWeightsScoring.js +1 -849
- package/cypress/e2e/ILC/ListSorting/listSortingPartialEqualWeightsScoringWithAlternateAnswer.js +860 -0
- package/package.json +1 -1
@@ -4,9 +4,8 @@ import utilities from "../../../support/helpers/utilities";
|
|
4
4
|
const css = Cypress.env('css');
|
5
5
|
|
6
6
|
let options = ['seed', 'sprout', 'plant', 'flower'];
|
7
|
-
let correctAnswerArray = ['flower', 'plant', 'sprout', 'seed'];
|
8
7
|
|
9
|
-
describe('Create Item page - list sorting: Question Instructions,
|
8
|
+
describe('Create Item page - list sorting: Question Instructions, Set Correct Answer', () => {
|
10
9
|
before(() => {
|
11
10
|
cy.loginAs('admin');
|
12
11
|
});
|
@@ -31,280 +30,6 @@ describe('Create Item page - list sorting: Question Instructions, Options, Set C
|
|
31
30
|
listSortingPage.tests.verifyQuestionInstructionsInputFieldPreviewTab();
|
32
31
|
});
|
33
32
|
|
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
33
|
describe('Labels section - Edit tab contents', () => {
|
309
34
|
abortEarlySetup();
|
310
35
|
before(() => {
|
@@ -0,0 +1,287 @@
|
|
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: Options', () => {
|
10
|
+
before(() => {
|
11
|
+
cy.loginAs('admin');
|
12
|
+
});
|
13
|
+
|
14
|
+
describe('Options section - 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.verifyOptionSectionEditTabFunctionality();
|
22
|
+
});
|
23
|
+
|
24
|
+
describe('Options section - Set correct answer section for correct tab', () => {
|
25
|
+
abortEarlySetup();
|
26
|
+
before(() => {
|
27
|
+
cy.log('Navigating to list sorting question type');
|
28
|
+
listSortingPage.steps.navigateToCreateQuestion('list sorting');
|
29
|
+
cy.barsPreLoaderWait();
|
30
|
+
});
|
31
|
+
|
32
|
+
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', () => {
|
33
|
+
for (let index = 0; index < 4; index++) {
|
34
|
+
listSortingPage.steps.verifyDragHandleButtonOfOptionInSetCorrectAnswerSection(index)
|
35
|
+
}
|
36
|
+
utilities.verifyElementCount(listSortingPage.setCorrectAnswerSectionOption(), 4);
|
37
|
+
utilities.verifyElementCount(listSortingPage.setCorrectAnswerSectionSourceOptionWrapper(), 4);
|
38
|
+
utilities.verifyInnerText(listSortingPage.setCorrectAnswerSectionSourceOptionWrapper(), '');
|
39
|
+
utilities.verifyElementCount(listSortingPage.setCorrectAnswerSectionTargetOptionWrapper(), 4);
|
40
|
+
utilities.verifyInnerText(listSortingPage.setCorrectAnswerSectionTargetOptionWrapper(), '');
|
41
|
+
});
|
42
|
+
|
43
|
+
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', () => {
|
44
|
+
listSortingPage.steps.deleteOption(0);
|
45
|
+
for (let index = 0; index < 3; index++) {
|
46
|
+
listSortingPage.steps.verifyDragHandleButtonOfOptionInSetCorrectAnswerSection(index)
|
47
|
+
}
|
48
|
+
utilities.verifyElementCount(listSortingPage.setCorrectAnswerSectionOption(), 3);
|
49
|
+
utilities.verifyElementCount(listSortingPage.setCorrectAnswerSectionSourceOptionWrapper(), 3);
|
50
|
+
utilities.verifyElementCount(listSortingPage.setCorrectAnswerSectionTargetOptionWrapper(), 3);
|
51
|
+
});
|
52
|
+
|
53
|
+
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', () => {
|
54
|
+
listSortingPage.steps.addOption()
|
55
|
+
for (let index = 0; index < 4; index++) {
|
56
|
+
listSortingPage.steps.verifyDragHandleButtonOfOptionInSetCorrectAnswerSection(index)
|
57
|
+
}
|
58
|
+
utilities.verifyElementCount(listSortingPage.setCorrectAnswerSectionOption(), 4);
|
59
|
+
});
|
60
|
+
|
61
|
+
it('When user adds text to all the options input field, the added text should be displayed in the \'Set correct answer\' section', () => {
|
62
|
+
listSortingPage.steps.addInputToOptionsInputField(options)
|
63
|
+
listSortingPage.steps.verifySourceOptionsTextContentInSetCorrectAnswerSection(options);
|
64
|
+
});
|
65
|
+
|
66
|
+
it('When user edits an option in the \'Options\' section then the correct option should be updated in the source section', () => {
|
67
|
+
listSortingPage.steps.editOptionInputField(0, 'This is an edited option');
|
68
|
+
listSortingPage.steps.verifySourceOptionsTextContentInSetCorrectAnswerSection(['This is an edited option', 'sprout', 'plant', 'flower']);
|
69
|
+
})
|
70
|
+
|
71
|
+
//Need to update once https://redmine.zeuslearning.com/issues/539590 is resolved
|
72
|
+
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', () => {
|
73
|
+
listSortingPage.steps.clickAndDropOptionFromSourceToTargetInSetCorrectAnswerSection('flower', 0);
|
74
|
+
listSortingPage.steps.clickAndDropOptionFromSourceToTargetInSetCorrectAnswerSection('plant', 1);
|
75
|
+
listSortingPage.steps.clickAndDropOptionFromSourceToTargetInSetCorrectAnswerSection('sprout', 2);
|
76
|
+
listSortingPage.steps.clickAndDropOptionFromSourceToTargetInSetCorrectAnswerSection('This is an edited option', 3);
|
77
|
+
listSortingPage.steps.verifyTargetOptionsTextContentInSetCorrectAnswerSection(['flower', 'plant', 'sprout', 'This is an edited option']);
|
78
|
+
listSortingPage.steps.editOptionInputField(0, 'seed');
|
79
|
+
listSortingPage.steps.verifyTargetOptionsTextContentInSetCorrectAnswerSection(correctAnswerArray);
|
80
|
+
});
|
81
|
+
});
|
82
|
+
|
83
|
+
describe('Option section - Preview tab', () => {
|
84
|
+
abortEarlySetup();
|
85
|
+
before(() => {
|
86
|
+
cy.log('Navigating to list sorting question type');
|
87
|
+
listSortingPage.steps.navigateToCreateQuestion('list sorting');
|
88
|
+
cy.barsPreLoaderWait();
|
89
|
+
listSortingPage.steps.addQuestionInstructions();
|
90
|
+
listSortingPage.steps.switchToPreviewTab();
|
91
|
+
});
|
92
|
+
|
93
|
+
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\'', () => {
|
94
|
+
for (let index = 0; index < 4; index++) {
|
95
|
+
listSortingPage.steps.verifyDragHandleButtonOfOptionInPreviewTab(index)
|
96
|
+
}
|
97
|
+
utilities.verifyElementCount(listSortingPage.previewTabOption(), 4);
|
98
|
+
utilities.verifyElementCount(listSortingPage.previewTabSourceOptionWrapper(), 4);
|
99
|
+
utilities.verifyInnerText(listSortingPage.previewTabSourceOptionWrapper(), '');
|
100
|
+
utilities.verifyElementCount(listSortingPage.previewTabTargetOptionWrapper(), 4);
|
101
|
+
utilities.verifyInnerText(listSortingPage.previewTabTargetOptionWrapper(), '');
|
102
|
+
});
|
103
|
+
|
104
|
+
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', () => {
|
105
|
+
listSortingPage.steps.switchToEditTab();
|
106
|
+
listSortingPage.steps.deleteOption(0);
|
107
|
+
listSortingPage.steps.switchToPreviewTab();
|
108
|
+
for (let index = 0; index < 3; index++) {
|
109
|
+
listSortingPage.steps.verifyDragHandleButtonOfOptionInPreviewTab(index)
|
110
|
+
}
|
111
|
+
utilities.verifyElementCount(listSortingPage.previewTabOption(), 3);
|
112
|
+
utilities.verifyElementCount(listSortingPage.previewTabSourceOptionWrapper(), 3);
|
113
|
+
utilities.verifyElementCount(listSortingPage.previewTabTargetOptionWrapper(), 3);
|
114
|
+
});
|
115
|
+
|
116
|
+
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', () => {
|
117
|
+
listSortingPage.steps.switchToEditTab();
|
118
|
+
listSortingPage.steps.addOption();
|
119
|
+
listSortingPage.steps.switchToPreviewTab();
|
120
|
+
for (let index = 0; index < 4; index++) {
|
121
|
+
listSortingPage.steps.verifyDragHandleButtonOfOptionInPreviewTab(index);
|
122
|
+
}
|
123
|
+
utilities.verifyElementCount(listSortingPage.previewTabOption(), 4);
|
124
|
+
utilities.verifyElementCount(listSortingPage.previewTabSourceOptionWrapper(), 4);
|
125
|
+
utilities.verifyElementCount(listSortingPage.previewTabTargetOptionWrapper(), 4);
|
126
|
+
});
|
127
|
+
|
128
|
+
it('When user adds text to all the options input field, the added text should be displayed in the \'Preview tab\' section', () => {
|
129
|
+
listSortingPage.steps.switchToEditTab();
|
130
|
+
listSortingPage.steps.addInputToOptionsInputField(options);
|
131
|
+
listSortingPage.steps.switchToPreviewTab();
|
132
|
+
listSortingPage.steps.verifySourceOptionsTextContentInPreviewTab(options);
|
133
|
+
});
|
134
|
+
|
135
|
+
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', () => {
|
136
|
+
listSortingPage.steps.clickAndDropOptionFromSourceToTargetInPreviewTab('flower', 0);
|
137
|
+
listSortingPage.steps.clickAndDropOptionFromSourceToTargetInPreviewTab('plant', 1);
|
138
|
+
listSortingPage.steps.clickAndDropOptionFromSourceToTargetInPreviewTab('sprout', 2);
|
139
|
+
listSortingPage.steps.clickAndDropOptionFromSourceToTargetInPreviewTab('seed', 3);
|
140
|
+
listSortingPage.steps.verifyTargetOptionsTextContentInPreviewTab(correctAnswerArray);
|
141
|
+
});
|
142
|
+
});
|
143
|
+
|
144
|
+
describe('Option section contents with Image, Equation, Text and Link - Set correct answer section for correct tab', () => {
|
145
|
+
abortEarlySetup();
|
146
|
+
before(() => {
|
147
|
+
cy.log('Navigating to list sorting question type');
|
148
|
+
listSortingPage.steps.navigateToCreateQuestion('list sorting');
|
149
|
+
cy.log('Add Image to option input field')
|
150
|
+
listSortingPage.steps.focusInOptionsInputField(0);
|
151
|
+
listSortingPage.steps.selectImageOptionFromCKEditorToolbar()
|
152
|
+
listSortingPage.steps.addImageToInputField();
|
153
|
+
cy.log('Add equation to option input field')
|
154
|
+
listSortingPage.steps.focusInOptionsInputField(1);
|
155
|
+
listSortingPage.steps.selectEquationEditorOptionFromCKEditorToolbar();
|
156
|
+
listSortingPage.steps.addGenericEquationUsingEquationEditorToCKEditorInputField();
|
157
|
+
cy.log('Add link to option input field')
|
158
|
+
listSortingPage.steps.focusInOptionsInputField(2);
|
159
|
+
listSortingPage.steps.selectLinkOptionFromCKEditorToolbar();
|
160
|
+
listSortingPage.steps.addLinkToInputField()
|
161
|
+
cy.log('Add bold text to input field')
|
162
|
+
listSortingPage.steps.focusInOptionsInputField(3);
|
163
|
+
listSortingPage.steps.selectBoldOptionFromCKEditorToolbar();
|
164
|
+
listSortingPage.steps.addBoldTextInputToOptionsInputField(3);
|
165
|
+
});
|
166
|
+
|
167
|
+
listSortingPage.tests.verifyImageEquationLinkBoldTextInSetCorrectAnswerSection();
|
168
|
+
});
|
169
|
+
|
170
|
+
describe('Option section contents with Image, Equation, Text and Link - Set correct answer section for alternate tab', () => {
|
171
|
+
abortEarlySetup();
|
172
|
+
before(() => {
|
173
|
+
cy.log('Navigating to list sorting question type');
|
174
|
+
listSortingPage.steps.navigateToCreateQuestion('list sorting');
|
175
|
+
cy.log('Add Image to option input field')
|
176
|
+
listSortingPage.steps.focusInOptionsInputField(0);
|
177
|
+
listSortingPage.steps.selectImageOptionFromCKEditorToolbar()
|
178
|
+
listSortingPage.steps.addImageToInputField();
|
179
|
+
cy.log('Add equation to option input field')
|
180
|
+
listSortingPage.steps.focusInOptionsInputField(1);
|
181
|
+
listSortingPage.steps.selectEquationEditorOptionFromCKEditorToolbar();
|
182
|
+
listSortingPage.steps.addGenericEquationUsingEquationEditorToCKEditorInputField();
|
183
|
+
cy.log('Add link to option input field')
|
184
|
+
listSortingPage.steps.focusInOptionsInputField(2);
|
185
|
+
listSortingPage.steps.selectLinkOptionFromCKEditorToolbar();
|
186
|
+
listSortingPage.steps.addLinkToInputField()
|
187
|
+
cy.log('Add bold text to input field')
|
188
|
+
listSortingPage.steps.focusInOptionsInputField(3);
|
189
|
+
listSortingPage.steps.selectBoldOptionFromCKEditorToolbar();
|
190
|
+
listSortingPage.steps.addBoldTextInputToOptionsInputField(3);
|
191
|
+
listSortingPage.steps.clickAndDropOptionFromSourceIndexToTargetIndexInSetCorrectAnswerSection(0, 0);
|
192
|
+
listSortingPage.steps.clickAndDropOptionFromSourceIndexToTargetIndexInSetCorrectAnswerSection(1, 1);
|
193
|
+
listSortingPage.steps.clickAndDropOptionFromSourceIndexToTargetIndexInSetCorrectAnswerSection(2, 2);
|
194
|
+
listSortingPage.steps.clickAndDropOptionFromSourceIndexToTargetIndexInSetCorrectAnswerSection(3, 3);
|
195
|
+
listSortingPage.steps.allotPoints('20');
|
196
|
+
listSortingPage.steps.addAlternateTab(1);
|
197
|
+
});
|
198
|
+
|
199
|
+
listSortingPage.tests.verifyImageEquationLinkBoldTextInSetCorrectAnswerSection()
|
200
|
+
|
201
|
+
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', () => {
|
202
|
+
listSortingPage.steps.addOption()
|
203
|
+
for (let index = 0; index < 4; index++) {
|
204
|
+
listSortingPage.steps.verifyDragHandleButtonOfOptionInSetCorrectAnswerSection(index)
|
205
|
+
}
|
206
|
+
utilities.verifyElementCount(listSortingPage.setCorrectAnswerSectionOption(), 5);
|
207
|
+
utilities.verifyElementCount(listSortingPage.setCorrectAnswerSectionSourceOptionWrapper(), 5);
|
208
|
+
utilities.verifyElementCount(listSortingPage.setCorrectAnswerSectionTargetOptionWrapper(), 5);
|
209
|
+
listSortingPage.steps.deleteOption(4);
|
210
|
+
utilities.verifyElementCount(listSortingPage.setCorrectAnswerSectionOption(), 4);
|
211
|
+
utilities.verifyElementCount(listSortingPage.setCorrectAnswerSectionSourceOptionWrapper(), 4);
|
212
|
+
utilities.verifyElementCount(listSortingPage.setCorrectAnswerSectionTargetOptionWrapper(), 4);
|
213
|
+
});
|
214
|
+
});
|
215
|
+
|
216
|
+
describe('Option section contents with Image, Equation, Text and Link - Preview tab', () => {
|
217
|
+
abortEarlySetup();
|
218
|
+
before(() => {
|
219
|
+
cy.log('Navigating to list sorting question type');
|
220
|
+
listSortingPage.steps.navigateToCreateQuestion('list sorting');
|
221
|
+
cy.log('Add Image to option input field')
|
222
|
+
listSortingPage.steps.focusInOptionsInputField(0);
|
223
|
+
listSortingPage.steps.selectImageOptionFromCKEditorToolbar()
|
224
|
+
listSortingPage.steps.addImageToInputField();
|
225
|
+
cy.log('Add equation to option input field')
|
226
|
+
listSortingPage.steps.focusInOptionsInputField(1);
|
227
|
+
listSortingPage.steps.selectEquationEditorOptionFromCKEditorToolbar();
|
228
|
+
listSortingPage.steps.addGenericEquationUsingEquationEditorToCKEditorInputField();
|
229
|
+
cy.log('Add link to option input field')
|
230
|
+
listSortingPage.steps.focusInOptionsInputField(2);
|
231
|
+
listSortingPage.steps.selectLinkOptionFromCKEditorToolbar();
|
232
|
+
listSortingPage.steps.addLinkToInputField()
|
233
|
+
cy.log('Add bold text to input field')
|
234
|
+
listSortingPage.steps.focusInOptionsInputField(3);
|
235
|
+
listSortingPage.steps.selectBoldOptionFromCKEditorToolbar();
|
236
|
+
listSortingPage.steps.addBoldTextInputToOptionsInputField(3);
|
237
|
+
listSortingPage.steps.switchToPreviewTab()
|
238
|
+
});
|
239
|
+
|
240
|
+
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', () => {
|
241
|
+
for (let index = 0; index < 4; index++) {
|
242
|
+
listSortingPage.steps.verifyDragHandleButtonOfOptionInPreviewTab(index)
|
243
|
+
}
|
244
|
+
listSortingPage.steps.verifyImageEquationLinkBoldTextInPreviewTabSourceOption()
|
245
|
+
});
|
246
|
+
|
247
|
+
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', () => {
|
248
|
+
listSortingPage.steps.verifyDefaultAndActiveStateOfOptionInPreviewTab();
|
249
|
+
});
|
250
|
+
|
251
|
+
//Failing due to https://redmine.zeuslearning.com/issues/537907
|
252
|
+
it('CSS of \'Preview tab\' when image, equation and link are added', { tags: 'css' }, () => {
|
253
|
+
utilities.verifyCSS(listSortingPage.previewTabOption().eq(0).find('img'), {
|
254
|
+
'color': css.color.text,
|
255
|
+
'font-size': css.fontSize.default,
|
256
|
+
'font-weight': css.fontWeight.regular
|
257
|
+
});
|
258
|
+
utilities.verifyCSS(listSortingPage.previewTabOption().eq(1).find('.question-text-wrapper'), {
|
259
|
+
'color': css.color.text,
|
260
|
+
'font-size': css.fontSize.default,
|
261
|
+
'font-weight': css.fontWeight.regular
|
262
|
+
});
|
263
|
+
utilities.verifyCSS(listSortingPage.previewTabOption().eq(2).find('a'), {
|
264
|
+
'color': css.color.linkText,
|
265
|
+
'font-size': css.fontSize.default,
|
266
|
+
'font-weight': css.fontWeight.regular
|
267
|
+
});
|
268
|
+
utilities.verifyCSS(listSortingPage.previewTabOption().eq(3).find('.question-text-wrapper'), {
|
269
|
+
'color': css.color.text,
|
270
|
+
'font-size': css.fontSize.default,
|
271
|
+
'font-weight': css.fontWeight.regular
|
272
|
+
});
|
273
|
+
});
|
274
|
+
|
275
|
+
it('Accessibility of \'Preview tab\' when image, equation and link are added', { tags: 'a11y' }, () => {
|
276
|
+
cy.checkAccessibility(listSortingPage.previewTabQuestionWrapper());
|
277
|
+
});
|
278
|
+
|
279
|
+
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', () => {
|
280
|
+
listSortingPage.steps.clickAndDropOptionFromSourceIndexToTargetIndexInPreviewTab(0, 0);
|
281
|
+
listSortingPage.steps.clickAndDropOptionFromSourceIndexToTargetIndexInPreviewTab(1, 1);
|
282
|
+
listSortingPage.steps.clickAndDropOptionFromSourceIndexToTargetIndexInPreviewTab(2, 2);
|
283
|
+
listSortingPage.steps.clickAndDropOptionFromSourceIndexToTargetIndexInPreviewTab(3, 3);
|
284
|
+
listSortingPage.steps.verifyImageEquationLinkBoldTextInPreviewTabTargetOption();
|
285
|
+
});
|
286
|
+
});
|
287
|
+
});
|