itemengine-cypress-automation 1.0.28 → 1.0.29
Sign up to get free protection for your applications and to get access to all the features.
- package/cypress/e2e/ILC/FillInTheGapsDragAndDrop/fillInTheGapsDragAndDropAdditionalSettings.js +648 -0
- package/cypress/e2e/ILC/FillInTheGapsDragAndDrop/fillInTheGapsDragAndDropClickAndDrop.js +278 -0
- package/cypress/e2e/ILC/FillInTheGapsDragAndDrop/fillInTheGapsDragAndDropEditTabBasic.js +198 -0
- package/cypress/e2e/ILC/FillInTheGapsDragAndDrop/fillInTheGapsDragAndDropEditTabScoringTypes.js +107 -0
- package/cypress/e2e/ILC/FillInTheGapsDragAndDrop/fillInTheGapsDragAndDropGroupedEditTab.js +76 -0
- package/cypress/e2e/ILC/FillInTheGapsDragAndDrop/fillInTheGapsDragAndDropGroupedOptionsAllOrNothingScoring.js +240 -0
- package/cypress/e2e/ILC/FillInTheGapsDragAndDrop/fillInTheGapsDragAndDropGroupedOptionsManualAndNonScoredScoring.js +83 -0
- package/cypress/e2e/ILC/FillInTheGapsDragAndDrop/fillInTheGapsDragAndDropGroupedOptionsPartialDifferentWeightsScoring.js +157 -0
- package/cypress/e2e/ILC/FillInTheGapsDragAndDrop/fillInTheGapsDragAndDropGroupedOptionsPartialEqualWeightsScoring.js +154 -0
- package/cypress/e2e/ILC/FillInTheGapsDragAndDrop/fillInTheGapsDragAndDropGroupedSetCorrectAnswerCheckboxes.js +282 -0
- package/cypress/e2e/ILC/FillInTheGapsDragAndDrop/fillInTheGapsDragAndDropHeaderSection.js +84 -0
- package/cypress/e2e/ILC/FillInTheGapsDragAndDrop/fillInTheGapsDragAndDropScoringSectionBasic.js +21 -0
- package/cypress/e2e/ILC/FillInTheGapsDragAndDrop/fillInTheGapsDragAndDropSetCorrectAnswerCheckboxes.js +293 -0
- package/cypress/e2e/ILC/FillInTheGapsDragAndDrop/fillInTheGapsDragAndDropSetCorrectAnswerSection.js +66 -0
- package/cypress/e2e/ILC/FillInTheGapsDragAndDrop/fillInTheGapsDragAndDropStandardOptionPartialDifferentWeightsScoring.js +129 -0
- package/cypress/e2e/ILC/FillInTheGapsDragAndDrop/fillInTheGapsDragAndDropStandardOptionsAutoScoredAllOrNothingScoring.js +200 -0
- package/cypress/e2e/ILC/FillInTheGapsDragAndDrop/fillInTheGapsDragAndDropStandardOptionsManualAndNonScoredScoring.js +60 -0
- package/cypress/e2e/ILC/FillInTheGapsDragAndDrop/fillInTheGapsDragAndDropStandardOptionsPartialEqualWeightsScoring.js +130 -0
- package/cypress/e2e/ILC/FillInTheGapsDragAndDrop/fillInTheGapsDragAndDropStandardOptionsSection.js +66 -0
- package/cypress/e2e/ILC/FillInTheGapsDragAndDrop/fillInTheGapsDragAndDropSwitchingCases.js +54 -0
- package/cypress/e2e/ILC/FillInTheGapsDragAndDrop/fillIntheGapsDragAndDropAlternateAnswer.js +230 -0
- package/package.json +1 -1
@@ -0,0 +1,278 @@
|
|
1
|
+
import { fillInTheGapsDragAndDropPage } from "../../../pages";
|
2
|
+
import abortEarlySetup from "../../../support/helpers/abortEarly";
|
3
|
+
const css = Cypress.env('css');
|
4
|
+
let optionsForResponses = ['Response 1', 'Response 2'];
|
5
|
+
let optionsForResponses2 = ['Response 3', 'Response 4'];
|
6
|
+
|
7
|
+
describe('Create Item Page: Fill in the gaps - drag and drop: Click and drop cases for \'Standard\' and \'Grouped\' response options layouts in \'Set correct answer\' section and \'Preview tab\'', () => {
|
8
|
+
before(() => {
|
9
|
+
cy.loginAs('admin');
|
10
|
+
});
|
11
|
+
|
12
|
+
describe('Click and drop cases for \'Standard\' response options layout in \'Set correct answer\' section', () => {
|
13
|
+
abortEarlySetup();
|
14
|
+
before(() => {
|
15
|
+
fillInTheGapsDragAndDropPage.steps.navigateToCreateQuestion('fill in the gaps with drag and drop');
|
16
|
+
cy.barsPreLoaderWait();
|
17
|
+
fillInTheGapsDragAndDropPage.steps.addInputToOptionsForDragAndDropFields(optionsForResponses);
|
18
|
+
});
|
19
|
+
|
20
|
+
fillInTheGapsDragAndDropPage.tests.verifyInactiveStateOfResponseAreasAndDraggableOptionsWithCSSAndA11yInSetCorrectAnswerSection();
|
21
|
+
|
22
|
+
fillInTheGapsDragAndDropPage.tests.verifyActiveStateOfResponseAreaAndDraggableOptionsWithCSSAndA11yInSetCorrectAnswerSection();
|
23
|
+
|
24
|
+
fillInTheGapsDragAndDropPage.tests.verifyInactiveStateOfResponseAreaWhenDraggableOptionIsDeselectedInSetCorrectAnswerSection();
|
25
|
+
|
26
|
+
it('When the user drops a draggable option in one of the response areas, the draggable option should get removed from the response container, the response area should get filled with that option and the other response area should return to inactive state', () => {
|
27
|
+
fillInTheGapsDragAndDropPage.steps.setCorrectAnswerSectionClickAndDropDraggableOptionInResponseArea('Response 1', 0);
|
28
|
+
fillInTheGapsDragAndDropPage.steps.verifyFilledResponseAreaInSetCorrectAnswerSection(0, 'Response 1');
|
29
|
+
fillInTheGapsDragAndDropPage.setCorrectAnswerDraggableOptionsWrapper()
|
30
|
+
.within(() => {
|
31
|
+
fillInTheGapsDragAndDropPage.draggableOption()
|
32
|
+
.contains('Response 1')
|
33
|
+
.should('not.exist');
|
34
|
+
fillInTheGapsDragAndDropPage.draggableOption()
|
35
|
+
.should('have.length', 1);
|
36
|
+
});
|
37
|
+
fillInTheGapsDragAndDropPage.steps.verifyInactiveStateOfResponseAreaInSetCorrectAnswerSection(1);
|
38
|
+
});
|
39
|
+
|
40
|
+
fillInTheGapsDragAndDropPage.tests.verifyFilledResponseAreaWithCSSAndA11yInSetCorrectAnswerSection();
|
41
|
+
|
42
|
+
fillInTheGapsDragAndDropPage.tests.verifyStateOfPartiallyFilledResponseAreasWhenDraggableOptionsIsSelectedInSetCorrectAnswerSection();
|
43
|
+
|
44
|
+
it('When the user drops a draggable option on a filled response area, the existing draggable option should get removed from the response area, it should return in the response container and the response area should get filled with the new draggable option', () => {
|
45
|
+
fillInTheGapsDragAndDropPage.steps.setCorrectAnswerSectionClickAndDropDraggableOptionInResponseArea('Response 2', 0);
|
46
|
+
fillInTheGapsDragAndDropPage.steps.verifyFilledResponseAreaInSetCorrectAnswerSection(0, 'Response 2');
|
47
|
+
fillInTheGapsDragAndDropPage.steps.verifyInactiveStateOfResponseAreaInSetCorrectAnswerSection(1);
|
48
|
+
fillInTheGapsDragAndDropPage.setCorrectAnswerDraggableOptionsWrapper()
|
49
|
+
.within(() => {
|
50
|
+
fillInTheGapsDragAndDropPage.draggableOption()
|
51
|
+
.contains('Response 1')
|
52
|
+
.should('exist')
|
53
|
+
.and('be.visible');
|
54
|
+
fillInTheGapsDragAndDropPage.draggableOption()
|
55
|
+
.should('have.length', 1);
|
56
|
+
});
|
57
|
+
});
|
58
|
+
|
59
|
+
fillInTheGapsDragAndDropPage.tests.verifySelectedStateOfDraggableOptionInFilledResponseAreaWithCSSandA11yInSetCorrectAnswerSection();
|
60
|
+
|
61
|
+
fillInTheGapsDragAndDropPage.tests.verifyDeselectedStateOfDraggableOptionInFilledResponseAreaWithCSSandA11yInSetCorrectAnswerSection();
|
62
|
+
|
63
|
+
it('When the user selects a filled option and clicks in the response container, the selected draggable option should get back in the response container, the response area should get errored and \'Error: Please set a correct answer\' error message should be displayed', () => {
|
64
|
+
fillInTheGapsDragAndDropPage.setCorrectAnswerResponseArea()
|
65
|
+
.eq(0)
|
66
|
+
.click();
|
67
|
+
fillInTheGapsDragAndDropPage.setCorrectAnswerDraggableOptionsWrapper()
|
68
|
+
.should('have.class', 'isActiveForDropping')
|
69
|
+
.click();
|
70
|
+
fillInTheGapsDragAndDropPage.setCorrectAnswerDraggableOptionsWrapper()
|
71
|
+
.should('not.have.class', 'isActiveForDropping')
|
72
|
+
.within(() => {
|
73
|
+
fillInTheGapsDragAndDropPage.draggableOption()
|
74
|
+
.should('have.length', 2);
|
75
|
+
fillInTheGapsDragAndDropPage.draggableOption()
|
76
|
+
.contains('Response 2')
|
77
|
+
.should('be.visible');
|
78
|
+
});
|
79
|
+
fillInTheGapsDragAndDropPage.steps.verifyErroredStateOfResponseAreaInSetCorrectAnswerSection(0);
|
80
|
+
fillInTheGapsDragAndDropPage.errorMessage()
|
81
|
+
.verifyInnerText('Error: Please set a correct answer.')
|
82
|
+
.and('be.visible');
|
83
|
+
});
|
84
|
+
|
85
|
+
fillInTheGapsDragAndDropPage.tests.verifyErroredStateOfResponseAreaWithCSSAndA11yInSetCorrectAnswerSection();
|
86
|
+
});
|
87
|
+
|
88
|
+
describe('Click and drop cases for \'Standard\' response options layout in \'Preview tab\'', () => {
|
89
|
+
abortEarlySetup();
|
90
|
+
before(() => {
|
91
|
+
fillInTheGapsDragAndDropPage.steps.navigateToCreateQuestion('fill in the gaps with drag and drop');
|
92
|
+
cy.barsPreLoaderWait();
|
93
|
+
fillInTheGapsDragAndDropPage.steps.addInputToOptionsForDragAndDropFields(optionsForResponses);
|
94
|
+
fillInTheGapsDragAndDropPage.steps.switchToPreviewTab();
|
95
|
+
});
|
96
|
+
|
97
|
+
fillInTheGapsDragAndDropPage.tests.verifyInactiveStateOfResponseAreasAndDraggableOptionsWithCSSAndA11yInPreviewTab();
|
98
|
+
|
99
|
+
fillInTheGapsDragAndDropPage.tests.verifyActiveStateOfResponseAreaAndDraggableOptionsWithCSSAndA11yInPreviewTab();
|
100
|
+
|
101
|
+
fillInTheGapsDragAndDropPage.tests.verifyStateOfResponseAreaWhenDraggableOptionIsDeselectedInPreviewTab();
|
102
|
+
|
103
|
+
it('When the user drops a draggable option in one of the response areas, the draggable option should get removed from the response container, the response area should get filled with that option and the other response area should return to inactive state', () => {
|
104
|
+
fillInTheGapsDragAndDropPage.steps.previewTabClickAndDropDraggableOptionInResponseArea('Response 1', 0);
|
105
|
+
fillInTheGapsDragAndDropPage.steps.verifyFilledResponseAreaInPreviewTab(0, 'Response 1');
|
106
|
+
fillInTheGapsDragAndDropPage.previewTabDraggableOption()
|
107
|
+
.contains('Response 1')
|
108
|
+
.should('not.exist');
|
109
|
+
fillInTheGapsDragAndDropPage.previewTabDraggableOption()
|
110
|
+
.should('have.length', 1);
|
111
|
+
fillInTheGapsDragAndDropPage.steps.verifyInactiveStateOfResponseAreaInPreviewTab(1);
|
112
|
+
});
|
113
|
+
|
114
|
+
fillInTheGapsDragAndDropPage.tests.verifyFilledResponseAreaWithCSSAndA11yInPreviewTab();
|
115
|
+
|
116
|
+
fillInTheGapsDragAndDropPage.tests.verifyStateOfPartiallyFilledResponseAreasInPreviewTab();
|
117
|
+
|
118
|
+
it('When the user drops a draggable option on a filled response area, the existing draggable option should get removed from the response area, it should return in the response container and the response area should get filled with the new draggable option', () => {
|
119
|
+
fillInTheGapsDragAndDropPage.steps.previewTabClickAndDropDraggableOptionInResponseArea('Response 2', 0);
|
120
|
+
fillInTheGapsDragAndDropPage.steps.verifyFilledResponseAreaInPreviewTab(0, 'Response 2');
|
121
|
+
fillInTheGapsDragAndDropPage.steps.verifyInactiveStateOfResponseAreaInPreviewTab(1);
|
122
|
+
fillInTheGapsDragAndDropPage.previewTabDraggableOption()
|
123
|
+
.contains('Response 1')
|
124
|
+
.should('exist')
|
125
|
+
.and('be.visible');
|
126
|
+
fillInTheGapsDragAndDropPage.previewTabDraggableOption()
|
127
|
+
.should('have.length', 1);
|
128
|
+
});
|
129
|
+
|
130
|
+
fillInTheGapsDragAndDropPage.tests.verifyStateOfDraggableOptionInFilledResponseAreaWithCSSandA11yInPreviewTab();
|
131
|
+
|
132
|
+
it('When the user selects a filled option and clicks in the response container, the selected draggable option should get back in the response container', () => {
|
133
|
+
fillInTheGapsDragAndDropPage.previewTabResponseArea()
|
134
|
+
.eq(0)
|
135
|
+
.click();
|
136
|
+
fillInTheGapsDragAndDropPage.previewDraggableOptionsWrapper()
|
137
|
+
.click();
|
138
|
+
fillInTheGapsDragAndDropPage.previewTabDraggableOption()
|
139
|
+
.should('have.length', 2);
|
140
|
+
fillInTheGapsDragAndDropPage.previewTabDraggableOption()
|
141
|
+
.contains('Response 2')
|
142
|
+
.should('be.visible');
|
143
|
+
});
|
144
|
+
|
145
|
+
fillInTheGapsDragAndDropPage.tests.verifyMovingDraggableOptionFromOneResponseAreaToAnotherInPreviewTab();
|
146
|
+
});
|
147
|
+
|
148
|
+
describe('Click and drop cases for \'Grouped\' response options layout in \'Set correct answer\' section', () => {
|
149
|
+
abortEarlySetup();
|
150
|
+
before(() => {
|
151
|
+
fillInTheGapsDragAndDropPage.steps.navigateToCreateQuestion('fill in the gaps with drag and drop');
|
152
|
+
cy.barsPreLoaderWait();
|
153
|
+
fillInTheGapsDragAndDropPage.steps.selectResponseOptionsLayout('Grouped');
|
154
|
+
fillInTheGapsDragAndDropPage.steps.addGroupTitle(0, 'Group title A');
|
155
|
+
fillInTheGapsDragAndDropPage.steps.addInputToOptionsForDragAndDropFields(optionsForResponses);
|
156
|
+
fillInTheGapsDragAndDropPage.addGroupButton()
|
157
|
+
.click();
|
158
|
+
fillInTheGapsDragAndDropPage.steps.addGroupTitle(1, 'Group title B');
|
159
|
+
fillInTheGapsDragAndDropPage.groupResponseContainer()
|
160
|
+
.eq(1)
|
161
|
+
.within(() => {
|
162
|
+
fillInTheGapsDragAndDropPage.steps.addInputToOptionsForDragAndDropFields(optionsForResponses2);
|
163
|
+
});
|
164
|
+
});
|
165
|
+
|
166
|
+
fillInTheGapsDragAndDropPage.tests.verifyInactiveStateOfResponseAreasAndDraggableOptionsWithCSSAndA11yInSetCorrectAnswerSection();
|
167
|
+
|
168
|
+
fillInTheGapsDragAndDropPage.tests.verifyActiveStateOfResponseAreaAndDraggableOptionsWithCSSAndA11yInSetCorrectAnswerSection();
|
169
|
+
|
170
|
+
fillInTheGapsDragAndDropPage.tests.verifyInactiveStateOfResponseAreaWhenDraggableOptionIsDeselectedInSetCorrectAnswerSection();
|
171
|
+
|
172
|
+
it('When the user drops a draggable option in one of the response areas, the draggable option should get removed from the respective group of the response container, the response area should get filled with that option and the other response area should return to inactive state', () => {
|
173
|
+
fillInTheGapsDragAndDropPage.steps.setCorrectAnswerSectionClickAndDropDraggableOptionInResponseArea('Response 1', 0);
|
174
|
+
fillInTheGapsDragAndDropPage.steps.verifyFilledResponseAreaInSetCorrectAnswerSection(0, 'Response 1');
|
175
|
+
fillInTheGapsDragAndDropPage.steps.verifyGroupedResponseContainerContentsInSetCorrectAnswerSection(0, ['Response 2']);
|
176
|
+
fillInTheGapsDragAndDropPage.steps.verifyGroupedResponseContainerContentsInSetCorrectAnswerSection(1, optionsForResponses2);
|
177
|
+
fillInTheGapsDragAndDropPage.steps.verifyInactiveStateOfResponseAreaInSetCorrectAnswerSection(1);
|
178
|
+
});
|
179
|
+
|
180
|
+
fillInTheGapsDragAndDropPage.tests.verifyFilledResponseAreaWithCSSAndA11yInSetCorrectAnswerSection();
|
181
|
+
|
182
|
+
fillInTheGapsDragAndDropPage.tests.verifyStateOfPartiallyFilledResponseAreasWhenDraggableOptionsIsSelectedInSetCorrectAnswerSection();
|
183
|
+
|
184
|
+
it('When the user drops a draggable option on a filled response area, the existing draggable option should get removed from the response area, it should return in the respective group of the response container and the response area should get filled with the new draggable option', () => {
|
185
|
+
fillInTheGapsDragAndDropPage.steps.setCorrectAnswerSectionClickAndDropDraggableOptionInResponseArea('Response 3', 0);
|
186
|
+
fillInTheGapsDragAndDropPage.steps.verifyFilledResponseAreaInSetCorrectAnswerSection(0, 'Response 3');
|
187
|
+
fillInTheGapsDragAndDropPage.steps.verifyInactiveStateOfResponseAreaInSetCorrectAnswerSection(1);
|
188
|
+
fillInTheGapsDragAndDropPage.steps.verifyGroupedResponseContainerContentsInSetCorrectAnswerSection(0, optionsForResponses);
|
189
|
+
fillInTheGapsDragAndDropPage.steps.verifyGroupedResponseContainerContentsInSetCorrectAnswerSection(1, ['Response 4']);
|
190
|
+
});
|
191
|
+
|
192
|
+
fillInTheGapsDragAndDropPage.tests.verifySelectedStateOfDraggableOptionInFilledResponseAreaWithCSSandA11yInSetCorrectAnswerSection();
|
193
|
+
|
194
|
+
fillInTheGapsDragAndDropPage.tests.verifyDeselectedStateOfDraggableOptionInFilledResponseAreaWithCSSandA11yInSetCorrectAnswerSection();
|
195
|
+
|
196
|
+
it('When the user selects a filled option and clicks in the response container, the selected draggable option should get removed from the response area, it should return in the respective group of the response container, the response area should get errored and \'Error: Please set a correct answer\' error message should be displayed', () => {
|
197
|
+
fillInTheGapsDragAndDropPage.setCorrectAnswerResponseArea()
|
198
|
+
.eq(0)
|
199
|
+
.click();
|
200
|
+
fillInTheGapsDragAndDropPage.setCorrectAnswerDraggableOptionsWrapper()
|
201
|
+
.should('have.class', 'isActiveForDropping')
|
202
|
+
.click();
|
203
|
+
fillInTheGapsDragAndDropPage.setCorrectAnswerDraggableOptionsWrapper()
|
204
|
+
.should('not.have.class', 'isActiveForDropping');
|
205
|
+
fillInTheGapsDragAndDropPage.steps.verifyGroupedResponseContainerContentsInSetCorrectAnswerSection(0, optionsForResponses);
|
206
|
+
fillInTheGapsDragAndDropPage.steps.verifyGroupedResponseContainerContentsInSetCorrectAnswerSection(1, optionsForResponses2);
|
207
|
+
fillInTheGapsDragAndDropPage.steps.verifyErroredStateOfResponseAreaInSetCorrectAnswerSection(0);
|
208
|
+
fillInTheGapsDragAndDropPage.errorMessage()
|
209
|
+
.verifyInnerText('Error: Please set a correct answer.')
|
210
|
+
.and('be.visible');
|
211
|
+
});
|
212
|
+
|
213
|
+
fillInTheGapsDragAndDropPage.tests.verifyErroredStateOfResponseAreaWithCSSAndA11yInSetCorrectAnswerSection();
|
214
|
+
});
|
215
|
+
|
216
|
+
describe('Click and drop cases for \'Grouped\' response options layout in \'Preview tab\'', () => {
|
217
|
+
abortEarlySetup();
|
218
|
+
before(() => {
|
219
|
+
fillInTheGapsDragAndDropPage.steps.navigateToCreateQuestion('fill in the gaps with drag and drop');
|
220
|
+
cy.barsPreLoaderWait();
|
221
|
+
fillInTheGapsDragAndDropPage.steps.selectResponseOptionsLayout('Grouped');
|
222
|
+
fillInTheGapsDragAndDropPage.steps.addGroupTitle(0, 'Group title A');
|
223
|
+
fillInTheGapsDragAndDropPage.steps.addInputToOptionsForDragAndDropFields(optionsForResponses);
|
224
|
+
fillInTheGapsDragAndDropPage.addGroupButton()
|
225
|
+
.click();
|
226
|
+
fillInTheGapsDragAndDropPage.steps.addGroupTitle(1, 'Group title B');
|
227
|
+
fillInTheGapsDragAndDropPage.groupResponseContainer()
|
228
|
+
.eq(1)
|
229
|
+
.within(() => {
|
230
|
+
fillInTheGapsDragAndDropPage.steps.addInputToOptionsForDragAndDropFields(optionsForResponses2);
|
231
|
+
});
|
232
|
+
fillInTheGapsDragAndDropPage.steps.switchToPreviewTab();
|
233
|
+
});
|
234
|
+
|
235
|
+
fillInTheGapsDragAndDropPage.tests.verifyInactiveStateOfResponseAreasAndDraggableOptionsWithCSSAndA11yInPreviewTab();
|
236
|
+
|
237
|
+
fillInTheGapsDragAndDropPage.tests.verifyActiveStateOfResponseAreaAndDraggableOptionsWithCSSAndA11yInPreviewTab();
|
238
|
+
|
239
|
+
fillInTheGapsDragAndDropPage.tests.verifyStateOfResponseAreaWhenDraggableOptionIsDeselectedInPreviewTab();
|
240
|
+
|
241
|
+
it('When the user drops a draggable option in one of the response areas, the draggable option should get removed from the respective group of the response container, the response area should get filled with that option and the other response area should return to inactive state', () => {
|
242
|
+
fillInTheGapsDragAndDropPage.steps.previewTabClickAndDropDraggableOptionInResponseArea('Response 1', 0);
|
243
|
+
fillInTheGapsDragAndDropPage.steps.verifyFilledResponseAreaInPreviewTab(0, 'Response 1');
|
244
|
+
fillInTheGapsDragAndDropPage.steps.verifyGroupedResponseContainerContentsInPreviewTab(0, ['Response 2']);
|
245
|
+
fillInTheGapsDragAndDropPage.steps.verifyGroupedResponseContainerContentsInPreviewTab(1, optionsForResponses2);
|
246
|
+
fillInTheGapsDragAndDropPage.steps.verifyInactiveStateOfResponseAreaInPreviewTab(1);
|
247
|
+
});
|
248
|
+
|
249
|
+
fillInTheGapsDragAndDropPage.tests.verifyFilledResponseAreaWithCSSAndA11yInPreviewTab();
|
250
|
+
|
251
|
+
fillInTheGapsDragAndDropPage.tests.verifyStateOfPartiallyFilledResponseAreasInPreviewTab();
|
252
|
+
|
253
|
+
it('When the user drops a draggable option on a filled response area, the existing draggable option should get removed from the response area, it should return in the respective group of the response container and the response area should get filled with the new draggable option', () => {
|
254
|
+
fillInTheGapsDragAndDropPage.steps.previewTabClickAndDropDraggableOptionInResponseArea('Response 3', 0);
|
255
|
+
fillInTheGapsDragAndDropPage.steps.verifyFilledResponseAreaInPreviewTab(0, 'Response 3');
|
256
|
+
fillInTheGapsDragAndDropPage.steps.verifyInactiveStateOfResponseAreaInPreviewTab(1);
|
257
|
+
fillInTheGapsDragAndDropPage.steps.verifyGroupedResponseContainerContentsInPreviewTab(0, optionsForResponses);
|
258
|
+
fillInTheGapsDragAndDropPage.steps.verifyGroupedResponseContainerContentsInPreviewTab(1, ['Response 4']);
|
259
|
+
});
|
260
|
+
|
261
|
+
fillInTheGapsDragAndDropPage.tests.verifyStateOfDraggableOptionInFilledResponseAreaWithCSSandA11yInPreviewTab();
|
262
|
+
|
263
|
+
it('When the user selects a filled option and clicks in the response container, the selected draggable option should get removed from the response area and it should return in the respective group of the response container', () => {
|
264
|
+
fillInTheGapsDragAndDropPage.previewTabResponseArea()
|
265
|
+
.eq(0)
|
266
|
+
.click();
|
267
|
+
fillInTheGapsDragAndDropPage.previewTabDraggableOptionsWrapper('fill in the gaps - drag and drop')
|
268
|
+
.should('have.class', 'isActiveForDropping')
|
269
|
+
.click();
|
270
|
+
fillInTheGapsDragAndDropPage.previewTabDraggableOptionsWrapper('fill in the gaps - drag and drop')
|
271
|
+
.should('not.have.class', 'isActiveForDropping');
|
272
|
+
fillInTheGapsDragAndDropPage.steps.verifyGroupedResponseContainerContentsInPreviewTab(0, optionsForResponses);
|
273
|
+
fillInTheGapsDragAndDropPage.steps.verifyGroupedResponseContainerContentsInPreviewTab(1, optionsForResponses2);
|
274
|
+
});
|
275
|
+
|
276
|
+
fillInTheGapsDragAndDropPage.tests.verifyMovingDraggableOptionFromOneResponseAreaToAnotherInPreviewTab();
|
277
|
+
});
|
278
|
+
});
|
@@ -0,0 +1,198 @@
|
|
1
|
+
import { commonComponents } from "../../../pages/components";
|
2
|
+
import { fillInTheGapsDragAndDropPage } from "../../../pages";
|
3
|
+
import abortEarlySetup from "../../../support/helpers/abortEarly";
|
4
|
+
const css = Cypress.env('css');
|
5
|
+
|
6
|
+
describe('Create Item page - Fill in the gaps - drag and drop: Question Instructions, Question, Response options, Set Correct Answer', () => {
|
7
|
+
before(() => {
|
8
|
+
cy.loginAs('admin');
|
9
|
+
});
|
10
|
+
|
11
|
+
describe('Question Instructions input field - Edit tab', () => {
|
12
|
+
abortEarlySetup();
|
13
|
+
before(() => {
|
14
|
+
cy.log('Navigating to Fill in the gaps - drag and drop question type');
|
15
|
+
fillInTheGapsDragAndDropPage.steps.navigateToCreateQuestion('fill in the gaps with drag and drop');
|
16
|
+
});
|
17
|
+
|
18
|
+
fillInTheGapsDragAndDropPage.tests.verifyQuestionInstructionsInputFieldEditTab();
|
19
|
+
|
20
|
+
});
|
21
|
+
|
22
|
+
describe('Question Instructions input field - Preview tab', () => {
|
23
|
+
abortEarlySetup();
|
24
|
+
before(() => {
|
25
|
+
cy.log('Navigating to Fill in the gaps - drag and drop question type');
|
26
|
+
fillInTheGapsDragAndDropPage.steps.navigateToCreateQuestion('fill in the gaps with drag and drop');
|
27
|
+
});
|
28
|
+
|
29
|
+
fillInTheGapsDragAndDropPage.tests.verifyQuestionInstructionsInputFieldPreviewTab();
|
30
|
+
});
|
31
|
+
|
32
|
+
describe('Question input field', () => {
|
33
|
+
abortEarlySetup();
|
34
|
+
before(() => {
|
35
|
+
fillInTheGapsDragAndDropPage.steps.navigateToCreateQuestion('fill in the gaps with drag and drop');
|
36
|
+
cy.barsPreLoaderWait();
|
37
|
+
});
|
38
|
+
|
39
|
+
it('\'Question\' label and input field should be displayed and should be prefilled with the text- \"Sample \'Lorem Ipsum\' text along with two response tokens with text \'Response\' should be present', () => {
|
40
|
+
fillInTheGapsDragAndDropPage.questionLabel()
|
41
|
+
.verifyInnerText('Question');
|
42
|
+
fillInTheGapsDragAndDropPage.questionInputField()
|
43
|
+
.should('have.text', 'Lorem ipsum dolor sit amet, 1Responseclose onsectetur adipiscing elit. Ut pellentesque tincidunt ornare. Integer porttitor est quis urna porttitor,eget 2Responseclose tempus tellus dapibus.');
|
44
|
+
fillInTheGapsDragAndDropPage.responseToken()
|
45
|
+
.should('have.length', 2);
|
46
|
+
fillInTheGapsDragAndDropPage.responseToken()
|
47
|
+
.each(($element) => {
|
48
|
+
cy.wrap($element)
|
49
|
+
.find('content')
|
50
|
+
.should('have.text', 'Response');
|
51
|
+
});
|
52
|
+
});
|
53
|
+
|
54
|
+
it('The response tokens should be displayed with a numeric count along with a close button in the question input field', () => {
|
55
|
+
for (let index = 0; index < 2; index++) {
|
56
|
+
fillInTheGapsDragAndDropPage.steps.verifyResponseTokenIndexAndCloseButton(index)
|
57
|
+
};
|
58
|
+
});
|
59
|
+
|
60
|
+
it('When the user switches to the Preview tab, the sample \'Lorem Ipsum\' text along with two response fields should be displayed in the question field', () => {
|
61
|
+
fillInTheGapsDragAndDropPage.steps.switchToPreviewTab()
|
62
|
+
fillInTheGapsDragAndDropPage.previewTabQuestionField()
|
63
|
+
.verifyInnerText('Lorem ipsum dolor sit amet, \n onsectetur adipiscing elit. Ut pellentesque tincidunt ornare. Integer porttitor est quis urna porttitor,eget \n tempus tellus dapibus.');
|
64
|
+
fillInTheGapsDragAndDropPage.previewTabResponseArea()
|
65
|
+
.should('have.length', 2)
|
66
|
+
.and('be.visible');
|
67
|
+
});
|
68
|
+
|
69
|
+
it('When user hovers over the response areas, \'Response field #\' message should be displayed on a tooltip and the tooltip should disappear if focus is removed from the response field', () => {
|
70
|
+
fillInTheGapsDragAndDropPage.previewTabResponseArea()
|
71
|
+
.each(($element, count) => {
|
72
|
+
cy.wrap($element)
|
73
|
+
.verifyTooltip(`Response field ${count + 1}`);
|
74
|
+
});
|
75
|
+
});
|
76
|
+
|
77
|
+
it('When the user edits text in the question input field then the updated question should be displayed in the preview tab', () => {
|
78
|
+
cy.log('Switching to edit tab')
|
79
|
+
fillInTheGapsDragAndDropPage.steps.switchToEditTab();
|
80
|
+
fillInTheGapsDragAndDropPage.questionInputField()
|
81
|
+
.click()
|
82
|
+
.type(' Lorem Ipsum')
|
83
|
+
.should('have.text', 'Lorem ipsum dolor sit amet, 1Responseclose onsectetur adipiscing elit. Ut pellentesque tincidunt ornare. Integer porttitor est quis urna porttitor,eget 2Responseclose tempus tellus dapibus. Lorem Ipsum')
|
84
|
+
fillInTheGapsDragAndDropPage.steps.switchToPreviewTab();
|
85
|
+
fillInTheGapsDragAndDropPage.previewTabQuestionField()
|
86
|
+
.verifyInnerText('Lorem ipsum dolor sit amet, \n onsectetur adipiscing elit. Ut pellentesque tincidunt ornare. Integer porttitor est quis urna porttitor,eget \n tempus tellus dapibus. Lorem Ipsum');
|
87
|
+
});
|
88
|
+
|
89
|
+
it('When the user focuses in the question input field, the CKEditor toolbar should be displayed with a \'+Response\' button and when the user clicks on \'+Response\' button, a response token in the question input field, a response field along with \'Response #\' label in the \'Set correct answer\' section, a \'Response #\' accordion in the additional settings accordion and a new response field the \'Preview tab\' should get added', () => {
|
90
|
+
cy.log('Switching to edit tab')
|
91
|
+
fillInTheGapsDragAndDropPage.steps.switchToEditTab();
|
92
|
+
fillInTheGapsDragAndDropPage.questionInputField()
|
93
|
+
.click();
|
94
|
+
fillInTheGapsDragAndDropPage.ckEditorAddResponseButton()
|
95
|
+
.should('be.visible');
|
96
|
+
fillInTheGapsDragAndDropPage.ckEditorAddResponseButton()
|
97
|
+
.click();
|
98
|
+
cy.log('Checking if 3rd response token gets added in the question input field with \'3\' count and a close icon')
|
99
|
+
fillInTheGapsDragAndDropPage.steps.verifyResponseTokenIndexAndCloseButton(2)
|
100
|
+
cy.log('Checking if 3rd response field gets added in the set correct answer section with \'Response 3\' label and when user hovers on the response fields, then a \'Response field #\' message should be displayed on a tooltip and the tooltip should disappear if focus is removed from the response field')
|
101
|
+
fillInTheGapsDragAndDropPage.setCorrectAnswerResponseArea()
|
102
|
+
.eq(2)
|
103
|
+
.should('be.visible');
|
104
|
+
fillInTheGapsDragAndDropPage.setCorrectAnswerResponseFieldLabel()
|
105
|
+
.eq(2)
|
106
|
+
.verifyInnerText('Response 3')
|
107
|
+
.and('be.visible');
|
108
|
+
for (let index = 0; index < fillInTheGapsDragAndDropPage.setCorrectAnswerResponseArea().length; index++) {
|
109
|
+
fillInTheGapsDragAndDropPage.setCorrectAnswerResponseArea()
|
110
|
+
.eq(index)
|
111
|
+
.realHover();
|
112
|
+
fillInTheGapsDragAndDropPage.tooltipText()
|
113
|
+
.should('have.text', `Response field ${count + 1}`);
|
114
|
+
cy.log('Focusing away from the response area')
|
115
|
+
cy.get("body")
|
116
|
+
.realHover({ position: "topLeft" });
|
117
|
+
fillInTheGapsDragAndDropPage.tooltipText()
|
118
|
+
.should('not.exist');
|
119
|
+
}
|
120
|
+
cy.log('Checking if 3rd response accordion gets added in the additional settings panel with \'Response 3\' label')
|
121
|
+
fillInTheGapsDragAndDropPage.steps.expandAdditonalSettings();
|
122
|
+
fillInTheGapsDragAndDropPage.additionalSettingsResponseAccordion()
|
123
|
+
.eq(2)
|
124
|
+
.verifyInnerText('Response 3')
|
125
|
+
.and('be.visible');
|
126
|
+
fillInTheGapsDragAndDropPage.steps.switchToPreviewTab()
|
127
|
+
fillInTheGapsDragAndDropPage.previewTabResponseArea()
|
128
|
+
.should('have.length', 3)
|
129
|
+
.and('be.visible');
|
130
|
+
fillInTheGapsDragAndDropPage.previewTabQuestionField()
|
131
|
+
.verifyInnerText('Lorem ipsum dolor sit amet, \n onsectetur adipiscing elit. Ut pellentesque tincidunt ornare. Integer porttitor est quis urna porttitor,eget \n tempus tellus dapibus. Lorem Ipsum');
|
132
|
+
})
|
133
|
+
|
134
|
+
it('When the user clicks on the \'close\' button present on a response token, the response token in the question input field should get removed and the count of the response tokens present in the question input field should get updated accordingly, response field along with \'Response #\' label in the \'Set correct answer\' section, \'Response #\' accordion in the additional settings accordion and the respective response field in the \'Preview tab\' should also get removed', () => {
|
135
|
+
cy.log('Pre step: Switching to Edit tab and deleting a response')
|
136
|
+
fillInTheGapsDragAndDropPage.steps.switchToEditTab();
|
137
|
+
fillInTheGapsDragAndDropPage.steps.deleteAResponseToken(1);
|
138
|
+
cy.log('Checking if 3rd response token gets removed from the question input field and the numeric counts get updated')
|
139
|
+
fillInTheGapsDragAndDropPage.responseToken()
|
140
|
+
.eq(2)
|
141
|
+
.should('not.exist');
|
142
|
+
for (let index = 0; index < 2; index++) {
|
143
|
+
fillInTheGapsDragAndDropPage.steps.verifyResponseTokenIndexAndCloseButton(index)
|
144
|
+
};
|
145
|
+
fillInTheGapsDragAndDropPage.setCorrectAnswerResponseArea()
|
146
|
+
.eq(2)
|
147
|
+
.should('not.exist');
|
148
|
+
fillInTheGapsDragAndDropPage.setCorrectAnswerResponseFieldLabel()
|
149
|
+
.eq(2)
|
150
|
+
.should('not.exist');
|
151
|
+
fillInTheGapsDragAndDropPage.setCorrectAnswerResponseFieldLabel()
|
152
|
+
.each(($element, index) => {
|
153
|
+
cy.wrap($element)
|
154
|
+
.verifyInnerText(`Response ${index + 1}`);
|
155
|
+
});
|
156
|
+
fillInTheGapsDragAndDropPage.additionalSettingsResponseAccordion()
|
157
|
+
.eq(2)
|
158
|
+
.should('not.exist');
|
159
|
+
fillInTheGapsDragAndDropPage.additionalSettingsResponseAccordion()
|
160
|
+
.each(($element, index) => {
|
161
|
+
cy.wrap($element)
|
162
|
+
.verifyInnerText(`Response ${index + 1}`);
|
163
|
+
});
|
164
|
+
fillInTheGapsDragAndDropPage.steps.switchToPreviewTab()
|
165
|
+
fillInTheGapsDragAndDropPage.previewTabResponseArea()
|
166
|
+
.should('have.length', 2)
|
167
|
+
.and('be.visible');
|
168
|
+
fillInTheGapsDragAndDropPage.previewTabQuestionField()
|
169
|
+
.verifyInnerText('Lorem ipsum dolor sit amet, \n onsectetur adipiscing elit. Ut pellentesque tincidunt ornare. Integer porttitor est quis urna porttitor,eget tempus tellus dapibus. Lorem Ipsum');
|
170
|
+
});
|
171
|
+
|
172
|
+
it('CSS of Question input field contents', { tags: 'css' }, () => {
|
173
|
+
cy.log('Switching to edit tab')
|
174
|
+
fillInTheGapsDragAndDropPage.steps.switchToEditTab();
|
175
|
+
fillInTheGapsDragAndDropPage.questionInputField()
|
176
|
+
.verifyCSS(css.color.text, css.fontSize.default, css.fontWeight.regular);
|
177
|
+
fillInTheGapsDragAndDropPage.responseToken()
|
178
|
+
.verifyCSS(css.color.text, css.fontSize.default, css.fontWeight.regular)
|
179
|
+
fillInTheGapsDragAndDropPage.responseTokenCloseButton()
|
180
|
+
.should('have.css', 'border', `1px solid ${css.color.activeButtons}`);
|
181
|
+
});
|
182
|
+
|
183
|
+
it('When the user removes all response tokens from the question input field, an error message \'Error: Minimum one response token is required.\' should be displayed', () => {
|
184
|
+
cy.log('Switching to edit tab')
|
185
|
+
fillInTheGapsDragAndDropPage.steps.switchToEditTab();
|
186
|
+
fillInTheGapsDragAndDropPage.steps.deleteAResponseToken(0);
|
187
|
+
fillInTheGapsDragAndDropPage.steps.deleteAResponseToken(0);
|
188
|
+
fillInTheGapsDragAndDropPage.errorMessage()
|
189
|
+
.verifyInnerText('Error: Minimum one response token is required.');
|
190
|
+
});
|
191
|
+
|
192
|
+
commonComponents.tests.verifyCSSAnda11yOfErrorMessage()
|
193
|
+
|
194
|
+
fillInTheGapsDragAndDropPage.tests.addTokenAndVerifyMinimumOneTokenRequiredErrorMessageNotExist()
|
195
|
+
|
196
|
+
fillInTheGapsDragAndDropPage.tests.verifyQuestionInputFieldPlaceholderText();
|
197
|
+
});
|
198
|
+
});
|
package/cypress/e2e/ILC/FillInTheGapsDragAndDrop/fillInTheGapsDragAndDropEditTabScoringTypes.js
ADDED
@@ -0,0 +1,107 @@
|
|
1
|
+
import { fillInTheGapsDragAndDropPage } from "../../../pages";
|
2
|
+
import abortEarlySetup from "../../../support/helpers/abortEarly";
|
3
|
+
let optionsForResponses = ['Response 1', 'Response 2'];
|
4
|
+
|
5
|
+
describe('Create Item Page: Fill in the gaps - drag and drop: Edit tab scoring types and set correct answer section (Correct answer tab)', () => {
|
6
|
+
before(() => {
|
7
|
+
cy.loginAs('admin');
|
8
|
+
});
|
9
|
+
|
10
|
+
describe('Edit tab \'Set correct answer\' section (Correct answer tab) and \'Scoring\' section for Autoscored: All or Nothing scoring type', () => {
|
11
|
+
abortEarlySetup();
|
12
|
+
before(() => {
|
13
|
+
cy.log('Navigate to fill in the gaps - drag and drop question type');
|
14
|
+
fillInTheGapsDragAndDropPage.steps.navigateToCreateQuestion('fill in the gaps with drag and drop');
|
15
|
+
cy.barsPreLoaderWait();
|
16
|
+
});
|
17
|
+
|
18
|
+
fillInTheGapsDragAndDropPage.tests.verifyAutoScoredAllOrNothingPointsAndMinimumScoreAwardedLabelAndInputField();
|
19
|
+
|
20
|
+
fillInTheGapsDragAndDropPage.tests.verifyDefaultResponseLabelAndResponseAreasInSetCorrectAnswerSection();
|
21
|
+
|
22
|
+
fillInTheGapsDragAndDropPage.tests.verifyDefaultDraggableOptionsInSetCorrectAnswerSection();
|
23
|
+
|
24
|
+
fillInTheGapsDragAndDropPage.tests.verifyPointsFieldErrorState(10);
|
25
|
+
|
26
|
+
fillInTheGapsDragAndDropPage.tests.verifyMinimumScoreIfAttemptedFieldErrorState(10, 20, 10);
|
27
|
+
});
|
28
|
+
|
29
|
+
describe('Edit tab \'Set correct answer\' section (Correct answer tab) and \'Scoring\' section for AutoScored: Partial equal weights scoring type', () => {
|
30
|
+
abortEarlySetup();
|
31
|
+
before(() => {
|
32
|
+
cy.log('Navigate to fill in the gaps - drag and drop question type');
|
33
|
+
fillInTheGapsDragAndDropPage.steps.navigateToCreateQuestion('fill in the gaps with drag and drop');
|
34
|
+
cy.barsPreLoaderWait();
|
35
|
+
});
|
36
|
+
|
37
|
+
fillInTheGapsDragAndDropPage.tests.verifyAutoScoredPartialEqualWeightsScoringEditTabContents();
|
38
|
+
|
39
|
+
fillInTheGapsDragAndDropPage.tests.verifyDefaultResponseLabelAndResponseAreasInSetCorrectAnswerSection();
|
40
|
+
|
41
|
+
fillInTheGapsDragAndDropPage.tests.verifyDefaultDraggableOptionsInSetCorrectAnswerSection();
|
42
|
+
|
43
|
+
fillInTheGapsDragAndDropPage.tests.verifyScoreForPartialEqualWeightsWhenResponseTokenIsAdded();
|
44
|
+
|
45
|
+
fillInTheGapsDragAndDropPage.tests.verifyAutoScoredPartialEqualWeightsScoringEditTabFunctionality();
|
46
|
+
});
|
47
|
+
|
48
|
+
describe('Edit tab \'Set correct answer\' section (Correct answer tab) and \'Scoring\' section for AutoScored: Partial different weights scoring type', () => {
|
49
|
+
abortEarlySetup();
|
50
|
+
before(() => {
|
51
|
+
cy.log('Navigate to fill in the gaps - drag and drop question type');
|
52
|
+
fillInTheGapsDragAndDropPage.steps.navigateToCreateQuestion('fill in the gaps with drag and drop');
|
53
|
+
cy.barsPreLoaderWait();
|
54
|
+
});
|
55
|
+
|
56
|
+
fillInTheGapsDragAndDropPage.tests.verifyAutoScoredPartialDifferentWeightsScoringEditTabContents();
|
57
|
+
|
58
|
+
fillInTheGapsDragAndDropPage.tests.verifyDefaultResponseLabelAndResponseAreasInSetCorrectAnswerSection();
|
59
|
+
|
60
|
+
fillInTheGapsDragAndDropPage.tests.verifyDefaultDraggableOptionsInSetCorrectAnswerSection();
|
61
|
+
|
62
|
+
it('When user adds an answer in the response area then the \'Points per response\' input field should be enabled', () => {
|
63
|
+
cy.log('Pre step: adding input in the option fields')
|
64
|
+
fillInTheGapsDragAndDropPage.steps.addInputToOptionsForDragAndDropFields(optionsForResponses);
|
65
|
+
optionsForResponses.forEach((responseText, index) => {
|
66
|
+
fillInTheGapsDragAndDropPage.steps.setCorrectAnswerSectionClickAndDropDraggableOptionInResponseArea(responseText, index);
|
67
|
+
fillInTheGapsDragAndDropPage.pointsInputField()
|
68
|
+
.eq(index)
|
69
|
+
.should('be.enabled');
|
70
|
+
});
|
71
|
+
});
|
72
|
+
|
73
|
+
fillInTheGapsDragAndDropPage.tests.verifyAutoScoredPartialDifferentWeightsScoringEditTabFunctionality()
|
74
|
+
});
|
75
|
+
|
76
|
+
describe('Edit tab \'Set correct answer\' section (Correct answer tab) and \'Scoring\' section for Manually Scored scoring type', () => {
|
77
|
+
abortEarlySetup();
|
78
|
+
before(() => {
|
79
|
+
cy.log('Navigate to fill in the gaps - dropdown question type');
|
80
|
+
fillInTheGapsDragAndDropPage.steps.navigateToCreateQuestion('fill in the gaps with drag and drop');
|
81
|
+
cy.barsPreLoaderWait();
|
82
|
+
});
|
83
|
+
|
84
|
+
it('User should be able to select \'Manually scored\' scoring type from scoring type dropdown', () => {
|
85
|
+
fillInTheGapsDragAndDropPage.steps.selectAScoringTypeFromScoringTypeDropdown('Manually scored')
|
86
|
+
});
|
87
|
+
|
88
|
+
fillInTheGapsDragAndDropPage.tests.verifyManuallyScoredScoringContents()
|
89
|
+
fillInTheGapsDragAndDropPage.tests.verifyPointsFieldErrorState(10);
|
90
|
+
fillInTheGapsDragAndDropPage.tests.verifyMinimumScoreIfAttemptedFieldErrorState(10, 20, 10);
|
91
|
+
});
|
92
|
+
|
93
|
+
describe('Edit tab \'Set correct answer\' section (Correct answer tab) and \'Scoring\' section for Non Scored scoring type', () => {
|
94
|
+
abortEarlySetup();
|
95
|
+
before(() => {
|
96
|
+
cy.log('Navigate to fill in the gaps - dropdown question type');
|
97
|
+
fillInTheGapsDragAndDropPage.steps.navigateToCreateQuestion('fill in the gaps with drag and drop');
|
98
|
+
cy.barsPreLoaderWait();
|
99
|
+
});
|
100
|
+
|
101
|
+
fillInTheGapsDragAndDropPage.tests.verifyEditTabNonScoredScoringSectionContents();
|
102
|
+
|
103
|
+
fillInTheGapsDragAndDropPage.tests.verifyDefaultResponseLabelAndResponseAreasInSetCorrectAnswerSection();
|
104
|
+
|
105
|
+
fillInTheGapsDragAndDropPage.tests.verifyDefaultDraggableOptionsInSetCorrectAnswerSection();
|
106
|
+
});
|
107
|
+
});
|