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.
Files changed (22) hide show
  1. package/cypress/e2e/ILC/FillInTheGapsDragAndDrop/fillInTheGapsDragAndDropAdditionalSettings.js +648 -0
  2. package/cypress/e2e/ILC/FillInTheGapsDragAndDrop/fillInTheGapsDragAndDropClickAndDrop.js +278 -0
  3. package/cypress/e2e/ILC/FillInTheGapsDragAndDrop/fillInTheGapsDragAndDropEditTabBasic.js +198 -0
  4. package/cypress/e2e/ILC/FillInTheGapsDragAndDrop/fillInTheGapsDragAndDropEditTabScoringTypes.js +107 -0
  5. package/cypress/e2e/ILC/FillInTheGapsDragAndDrop/fillInTheGapsDragAndDropGroupedEditTab.js +76 -0
  6. package/cypress/e2e/ILC/FillInTheGapsDragAndDrop/fillInTheGapsDragAndDropGroupedOptionsAllOrNothingScoring.js +240 -0
  7. package/cypress/e2e/ILC/FillInTheGapsDragAndDrop/fillInTheGapsDragAndDropGroupedOptionsManualAndNonScoredScoring.js +83 -0
  8. package/cypress/e2e/ILC/FillInTheGapsDragAndDrop/fillInTheGapsDragAndDropGroupedOptionsPartialDifferentWeightsScoring.js +157 -0
  9. package/cypress/e2e/ILC/FillInTheGapsDragAndDrop/fillInTheGapsDragAndDropGroupedOptionsPartialEqualWeightsScoring.js +154 -0
  10. package/cypress/e2e/ILC/FillInTheGapsDragAndDrop/fillInTheGapsDragAndDropGroupedSetCorrectAnswerCheckboxes.js +282 -0
  11. package/cypress/e2e/ILC/FillInTheGapsDragAndDrop/fillInTheGapsDragAndDropHeaderSection.js +84 -0
  12. package/cypress/e2e/ILC/FillInTheGapsDragAndDrop/fillInTheGapsDragAndDropScoringSectionBasic.js +21 -0
  13. package/cypress/e2e/ILC/FillInTheGapsDragAndDrop/fillInTheGapsDragAndDropSetCorrectAnswerCheckboxes.js +293 -0
  14. package/cypress/e2e/ILC/FillInTheGapsDragAndDrop/fillInTheGapsDragAndDropSetCorrectAnswerSection.js +66 -0
  15. package/cypress/e2e/ILC/FillInTheGapsDragAndDrop/fillInTheGapsDragAndDropStandardOptionPartialDifferentWeightsScoring.js +129 -0
  16. package/cypress/e2e/ILC/FillInTheGapsDragAndDrop/fillInTheGapsDragAndDropStandardOptionsAutoScoredAllOrNothingScoring.js +200 -0
  17. package/cypress/e2e/ILC/FillInTheGapsDragAndDrop/fillInTheGapsDragAndDropStandardOptionsManualAndNonScoredScoring.js +60 -0
  18. package/cypress/e2e/ILC/FillInTheGapsDragAndDrop/fillInTheGapsDragAndDropStandardOptionsPartialEqualWeightsScoring.js +130 -0
  19. package/cypress/e2e/ILC/FillInTheGapsDragAndDrop/fillInTheGapsDragAndDropStandardOptionsSection.js +66 -0
  20. package/cypress/e2e/ILC/FillInTheGapsDragAndDrop/fillInTheGapsDragAndDropSwitchingCases.js +54 -0
  21. package/cypress/e2e/ILC/FillInTheGapsDragAndDrop/fillIntheGapsDragAndDropAlternateAnswer.js +230 -0
  22. package/package.json +1 -1
@@ -0,0 +1,293 @@
1
+ import { fillInTheGapsDragAndDropPage } from "../../../pages";
2
+ import abortEarlySetup from "../../../support/helpers/abortEarly";
3
+ let optionsForResponses = ['Response 1', 'Response 2', 'Response 3', 'Response 4'];
4
+ let optionsForResponses2 = ['Response 1', 'Response 2'];
5
+
6
+ describe('Create Item page - Fill in the gaps - drag and drop: Randomize options, Reuse options, Hide drag handle functionalities for \'Standard\' response option layout', () => {
7
+ before(() => {
8
+ cy.loginAs('admin');
9
+ });
10
+
11
+ describe('Randomize options - Functionality : Edit tab', () => {
12
+ abortEarlySetup();
13
+ before(() => {
14
+ cy.log('Navigate to Fill in the gaps - drag and drop question type');
15
+ fillInTheGapsDragAndDropPage.steps.navigateToCreateQuestion('fill in the gaps with drag and drop');
16
+ cy.barsPreLoaderWait();
17
+ cy.log('Adding two more option input fields')
18
+ fillInTheGapsDragAndDropPage.addOptionButton()
19
+ .click();
20
+ fillInTheGapsDragAndDropPage.addOptionButton()
21
+ .click();
22
+ fillInTheGapsDragAndDropPage.steps.addInputToOptionsForDragAndDropFields(optionsForResponses);
23
+ });
24
+
25
+ it('When the \'Randomize options\' functionality is disabled, the draggable options in the response container should be displayed in the order in which the user has set them in the \'Options for drag & drop\' section', () => {
26
+ fillInTheGapsDragAndDropPage.steps.verifyDraggableResponsesSetCorrectAnswer('fill in the gaps - drag and drop', optionsForResponses);
27
+ });
28
+
29
+ it('When the user enables the \'Randomize options\' functionality, then the draggable options in the response container should be in the order in which the user has set them in the \'Options for drag & drop\' section', () => {
30
+ fillInTheGapsDragAndDropPage.randomizeOptionsCheckbox()
31
+ .click()
32
+ .should('be.checked');
33
+ fillInTheGapsDragAndDropPage.steps.verifyDraggableResponsesSetCorrectAnswer('fill in the gaps - drag and drop', optionsForResponses);
34
+ });
35
+
36
+ fillInTheGapsDragAndDropPage.tests.verifyCSSAndA11yOfCheckedStateOfRandomizeOptionsCheckbox();
37
+ });
38
+
39
+ describe('Randomize options - Functionality : Preview tab', () => {
40
+ let randomizedOptionsString = '';
41
+ abortEarlySetup();
42
+ before(() => {
43
+ cy.log('Navigate to Fill in the gaps - drag and drop question type');
44
+ fillInTheGapsDragAndDropPage.steps.navigateToCreateQuestion('fill in the gaps with drag and drop');
45
+ cy.barsPreLoaderWait();
46
+ cy.log('Adding two more option input fields')
47
+ fillInTheGapsDragAndDropPage.addOptionButton()
48
+ .click();
49
+ fillInTheGapsDragAndDropPage.addOptionButton()
50
+ .click();
51
+ fillInTheGapsDragAndDropPage.steps.addInputToOptionsForDragAndDropFields(optionsForResponses);
52
+ fillInTheGapsDragAndDropPage.steps.switchToPreviewTab();
53
+ });
54
+
55
+ it('When the \'Randomize options\' functionality is disabled, then the draggable options in the response container should be displayed in the order in which the user has set them in the \'Options for drag & drop\' section', () => {
56
+ fillInTheGapsDragAndDropPage.steps.verifyDraggableResponsesPreviewTab('fill in the gaps - drag and drop', optionsForResponses);
57
+ });
58
+
59
+ it('When the user enables the \'Randomize options\' functionality, then the draggable options in the response container should be displayed in a random order', () => {
60
+ fillInTheGapsDragAndDropPage.steps.switchToEditTab();
61
+ fillInTheGapsDragAndDropPage.randomizeOptionsCheckbox()
62
+ .click()
63
+ .should('be.checked');
64
+ fillInTheGapsDragAndDropPage.steps.switchToPreviewTab();
65
+ fillInTheGapsDragAndDropPage.steps.verifyRandomizeOptionOrder(optionsForResponses, 'Fill in the gaps drag & drop');
66
+ });
67
+
68
+ it('When the user switches to \'Edit tab\' and does not modify any question properties, then the order of the draggable options should not change in the response container', () => {
69
+ fillInTheGapsDragAndDropPage.previewDraggableOptionsWrapper()
70
+ .then(($element) => {
71
+ randomizedOptionsString = $element.text();
72
+ fillInTheGapsDragAndDropPage.steps.switchToEditTab();
73
+ fillInTheGapsDragAndDropPage.steps.switchToPreviewTab();
74
+ fillInTheGapsDragAndDropPage.previewDraggableOptionsWrapper()
75
+ .should('have.text', randomizedOptionsString);
76
+ });
77
+ });
78
+
79
+ it('When the user switches to \'Edit tab\' and modifies any of question properties, then the order of the draggable options should change in the response container', () => {
80
+ fillInTheGapsDragAndDropPage.steps.switchToEditTab();
81
+ fillInTheGapsDragAndDropPage.steps.allotPoints(5);
82
+ fillInTheGapsDragAndDropPage.steps.switchToPreviewTab();
83
+ fillInTheGapsDragAndDropPage.steps.verifyRandomizeOptionOrder(optionsForResponses, 'Fill in the gaps drag & drop');
84
+ fillInTheGapsDragAndDropPage.previewDraggableOptionsWrapper()
85
+ .should('not.have.text', randomizedOptionsString);
86
+ });
87
+
88
+ it('When the user disables the \'Randomize options\' functionality, then the draggable options in the response container should be displayed in the order in which the user has set them in the \'Options for drag & drop\' section', () => {
89
+ fillInTheGapsDragAndDropPage.steps.switchToEditTab();
90
+ fillInTheGapsDragAndDropPage.randomizeOptionsCheckbox()
91
+ .click()
92
+ .should('not.be.checked');
93
+ fillInTheGapsDragAndDropPage.steps.switchToPreviewTab();
94
+ fillInTheGapsDragAndDropPage.steps.verifyDraggableResponsesPreviewTab('fill in the gaps - drag and drop', optionsForResponses);
95
+ });
96
+ });
97
+
98
+ describe('Reuse options - Functionality : Edit tab', () => {
99
+ abortEarlySetup();
100
+ before(() => {
101
+ cy.log('Navigate to Fill in the gaps - drag and drop question type');
102
+ fillInTheGapsDragAndDropPage.steps.navigateToCreateQuestion('fill in the gaps with drag and drop');
103
+ cy.barsPreLoaderWait();
104
+ fillInTheGapsDragAndDropPage.steps.addInputToOptionsForDragAndDropFields(optionsForResponses2);
105
+ });
106
+
107
+ it('When the \'Reuse options\' functionality is disabled, then on setting correct answer in the response area, the draggable options should get removed from the response container', () => {
108
+ fillInTheGapsDragAndDropPage.steps.setCorrectAnswerSectionClickAndDropDraggableOptionInResponseArea('Response 1', 0);
109
+ fillInTheGapsDragAndDropPage.steps.verifyFilledResponseAreaInSetCorrectAnswerSection(0, 'Response 1');
110
+ fillInTheGapsDragAndDropPage.setCorrectAnswerDraggableOptionsWrapper()
111
+ .within(() => {
112
+ fillInTheGapsDragAndDropPage.setCorrectAnswerDraggableOption()
113
+ .should('have.length', 1);
114
+ fillInTheGapsDragAndDropPage.setCorrectAnswerDraggableOption()
115
+ .contains('Response 1')
116
+ .should('not.exist');
117
+ });
118
+ });
119
+
120
+ it('When the user enables the \'Reuse options\' functionality, then on setting correct answer in the response area, the draggable options should persist in the response container', () => {
121
+ cy.log('Pre step: Removing the set correct answer option from the response area')
122
+ fillInTheGapsDragAndDropPage.setCorrectAnswerResponseArea()
123
+ .eq(0)
124
+ .click();
125
+ fillInTheGapsDragAndDropPage.setCorrectAnswerDraggableOptionsWrapper()
126
+ .click();
127
+ fillInTheGapsDragAndDropPage.setCorrectAnswerDraggableOption()
128
+ .should('have.length', 2);
129
+ cy.log('Checking the reuse option checkbox and setting the correct answer option')
130
+ fillInTheGapsDragAndDropPage.reuseOptionsCheckbox()
131
+ .click()
132
+ .should('be.checked');
133
+ fillInTheGapsDragAndDropPage.steps.setCorrectAnswerSectionClickAndDropDraggableOptionInResponseArea('Response 1', 0);
134
+ fillInTheGapsDragAndDropPage.steps.verifyFilledResponseAreaInSetCorrectAnswerSection(0, 'Response 1');
135
+ fillInTheGapsDragAndDropPage.setCorrectAnswerDraggableOptionsWrapper()
136
+ .within(() => {
137
+ fillInTheGapsDragAndDropPage.setCorrectAnswerDraggableOption()
138
+ .contains('Response 1')
139
+ .should('be.visible');
140
+ fillInTheGapsDragAndDropPage.setCorrectAnswerDraggableOption()
141
+ .should('have.length', 2);
142
+ });
143
+ });
144
+
145
+ fillInTheGapsDragAndDropPage.tests.verifyCSSAndA11yOfCheckedStateOfReuseOptionsCheckbox();
146
+
147
+ it('The user should be able to use the same draggable option for multiple response areas', () => {
148
+ fillInTheGapsDragAndDropPage.steps.setCorrectAnswerSectionClickAndDropDraggableOptionInResponseArea('Response 1', 1);
149
+ fillInTheGapsDragAndDropPage.steps.verifyFilledResponseAreaInSetCorrectAnswerSection(0, 'Response 1');
150
+ fillInTheGapsDragAndDropPage.steps.verifyFilledResponseAreaInSetCorrectAnswerSection(1, 'Response 1');
151
+ fillInTheGapsDragAndDropPage.setCorrectAnswerDraggableOptionsWrapper()
152
+ .within(() => {
153
+ fillInTheGapsDragAndDropPage.setCorrectAnswerDraggableOption()
154
+ .contains('Response 1')
155
+ .should('be.visible');
156
+ fillInTheGapsDragAndDropPage.setCorrectAnswerDraggableOption()
157
+ .should('have.length', 2);
158
+ });
159
+ });
160
+
161
+ it('When the user removes the draggable option and moves it into the response container, only one option should be displayed in the response container', () => {
162
+ fillInTheGapsDragAndDropPage.steps.clickAndDropDraggableOptionInResponseContainerOfSetCorrectAnswerSection('Response 1');
163
+ fillInTheGapsDragAndDropPage.steps.clickAndDropDraggableOptionInResponseContainerOfSetCorrectAnswerSection('Response 1');
164
+ fillInTheGapsDragAndDropPage.steps.verifyDraggableResponsesSetCorrectAnswer('fill in the gaps - drag and drop', ['Response 1', 'Response 2']);
165
+ });
166
+
167
+ it('When the user disables the \'Reuse options\' functionality, the duplicate answer set as correct answer should get removed from the response area and the draggable option should also not exist in the response container of the \'Set correct answer\' section', () => {
168
+ cy.log('Pre step: Setting identical options as correct responses')
169
+ fillInTheGapsDragAndDropPage.steps.setCorrectAnswerSectionClickAndDropDraggableOptionInResponseArea('Response 1', 0);
170
+ fillInTheGapsDragAndDropPage.steps.setCorrectAnswerSectionClickAndDropDraggableOptionInResponseArea('Response 1', 1);
171
+ fillInTheGapsDragAndDropPage.steps.uncheckReuseOptionsCheckbox();
172
+ fillInTheGapsDragAndDropPage.steps.verifyFilledResponseAreaInSetCorrectAnswerSection(0, 'Response 1');
173
+ fillInTheGapsDragAndDropPage.steps.verifyInactiveStateOfResponseAreaInSetCorrectAnswerSection(1);
174
+ fillInTheGapsDragAndDropPage.steps.verifyDraggableResponsesSetCorrectAnswer('fill in the gaps - drag and drop', ['Response 2']);
175
+ });
176
+ //https://redmine.zeuslearning.com/issues/531790
177
+ //https://redmine.zeuslearning.com/issues/531879
178
+ });
179
+
180
+ describe('Reuse options - Functionality: Preview tab', () => {
181
+ abortEarlySetup();
182
+ before(() => {
183
+ cy.log('Navigate to Fill in the gaps - drag and drop question type');
184
+ fillInTheGapsDragAndDropPage.steps.navigateToCreateQuestion('fill in the gaps with drag and drop');
185
+ cy.barsPreLoaderWait();
186
+ fillInTheGapsDragAndDropPage.steps.addInputToOptionsForDragAndDropFields(optionsForResponses2);
187
+ });
188
+
189
+ it('When the \'Reuse options\' functionality is disabled, then on attempting the question, the draggable options should get removed from the response container', () => {
190
+ fillInTheGapsDragAndDropPage.steps.switchToPreviewTab();
191
+ fillInTheGapsDragAndDropPage.steps.previewTabClickAndDropDraggableOptionInResponseArea('Response 1', 0);
192
+ fillInTheGapsDragAndDropPage.steps.verifyFilledResponseAreaInPreviewTab(0, 'Response 1');
193
+ fillInTheGapsDragAndDropPage.previewTabDraggableOption()
194
+ .contains('Response 1')
195
+ .should('not.exist');
196
+ fillInTheGapsDragAndDropPage.previewTabDraggableOption()
197
+ .should('have.length', 1);
198
+ });
199
+
200
+ it('When the \'Reuse options\' functionality is enabled, then on attempting the question, the draggable options should persist in the response container', () => {
201
+ fillInTheGapsDragAndDropPage.steps.switchToEditTab();
202
+ fillInTheGapsDragAndDropPage.reuseOptionsCheckbox()
203
+ .click()
204
+ .should('be.checked');
205
+ fillInTheGapsDragAndDropPage.steps.switchToPreviewTab();
206
+ fillInTheGapsDragAndDropPage.steps.previewTabClickAndDropDraggableOptionInResponseArea('Response 1', 0);
207
+ fillInTheGapsDragAndDropPage.steps.verifyFilledResponseAreaInPreviewTab(0, 'Response 1');
208
+ fillInTheGapsDragAndDropPage.previewTabDraggableOption()
209
+ .contains('Response 1')
210
+ .should('be.visible');
211
+ fillInTheGapsDragAndDropPage.previewTabDraggableOption()
212
+ .should('have.length', 2);
213
+ });
214
+
215
+ it('The user should be able to use the same draggable option for multiple response areas', () => {
216
+ fillInTheGapsDragAndDropPage.steps.previewTabClickAndDropDraggableOptionInResponseArea('Response 1', 1);
217
+ fillInTheGapsDragAndDropPage.steps.verifyFilledResponseAreaInPreviewTab(0, 'Response 1');
218
+ fillInTheGapsDragAndDropPage.steps.verifyFilledResponseAreaInPreviewTab(1, 'Response 1');
219
+ fillInTheGapsDragAndDropPage.previewTabDraggableOption()
220
+ .contains('Response 1')
221
+ .should('be.visible');
222
+ fillInTheGapsDragAndDropPage.previewTabDraggableOption()
223
+ .should('have.length', 2);
224
+ });
225
+
226
+ it('When the user removes the draggable option and moves it into the response container, only one option should be displayed in the response container', () => {
227
+ fillInTheGapsDragAndDropPage.steps.clickAndDropDraggableOptionInResponseContainerOfPreviewTab('Response 1');
228
+ fillInTheGapsDragAndDropPage.steps.clickAndDropDraggableOptionInResponseContainerOfPreviewTab('Response 1');
229
+ fillInTheGapsDragAndDropPage.steps.verifyDraggableResponsesPreviewTab('fill in the gaps - drag and drop', ['Response 1', 'Response 2']);
230
+ });
231
+
232
+ it('When the user disables the \'Reuse options\' functionality, then on attempting the question, the draggable options should get removed from the response container', () => {
233
+ fillInTheGapsDragAndDropPage.steps.switchToEditTab();
234
+ fillInTheGapsDragAndDropPage.reuseOptionsCheckbox()
235
+ .click()
236
+ .should('not.be.checked');
237
+ fillInTheGapsDragAndDropPage.steps.switchToPreviewTab();
238
+ fillInTheGapsDragAndDropPage.steps.previewTabClickAndDropDraggableOptionInResponseArea('Response 1', 0);
239
+ fillInTheGapsDragAndDropPage.steps.verifyFilledResponseAreaInPreviewTab(0, 'Response 1');
240
+ fillInTheGapsDragAndDropPage.previewTabDraggableOption()
241
+ .contains('Response 1')
242
+ .should('not.exist');
243
+ fillInTheGapsDragAndDropPage.previewTabDraggableOption()
244
+ .should('have.length', 1);
245
+ });
246
+
247
+ //https://redmine.zeuslearning.com/issues/531790
248
+ });
249
+
250
+ describe('Reuse options - Scoring', () => {
251
+ abortEarlySetup();
252
+ before(() => {
253
+ cy.log('Navigate to Fill in the gaps - drag and drop question type');
254
+ fillInTheGapsDragAndDropPage.steps.navigateToCreateQuestion('fill in the gaps with drag and drop');
255
+ cy.barsPreLoaderWait();
256
+ fillInTheGapsDragAndDropPage.steps.addInputToOptionsForDragAndDropFields(optionsForResponses2);
257
+ fillInTheGapsDragAndDropPage.reuseOptionsCheckbox()
258
+ .click();
259
+ fillInTheGapsDragAndDropPage.steps.setCorrectAnswerSectionClickAndDropDraggableOptionInResponseArea('Response 1', 0);
260
+ fillInTheGapsDragAndDropPage.steps.setCorrectAnswerSectionClickAndDropDraggableOptionInResponseArea('Response 1', 1);
261
+ fillInTheGapsDragAndDropPage.steps.allotPoints(5);
262
+ fillInTheGapsDragAndDropPage.steps.switchToPreviewTab();
263
+ });
264
+
265
+ fillInTheGapsDragAndDropPage.tests.verifyReuseOptionScoring();
266
+ });
267
+
268
+ describe('Hide drag handle - Functionality: Edit tab', () => {
269
+ abortEarlySetup();
270
+ before(() => {
271
+ cy.log('Navigate to Fill in the gaps - drag and drop question type');
272
+ fillInTheGapsDragAndDropPage.steps.navigateToCreateQuestion('fill in the gaps with drag and drop');
273
+ cy.barsPreLoaderWait();
274
+ });
275
+
276
+ fillInTheGapsDragAndDropPage.tests.verifyHideDragHandleFunctionalityInSetCorrectAnswerSection();
277
+
278
+
279
+ fillInTheGapsDragAndDropPage.tests.verifyCSSAndA11yOfCheckedStateOfHideDragHandleCheckbox();
280
+ });
281
+
282
+ describe('Hide drag handle - Functionality: Preview tab', () => {
283
+ abortEarlySetup();
284
+ before(() => {
285
+ cy.log('Navigate to Fill in the gaps - drag and drop question type');
286
+ fillInTheGapsDragAndDropPage.steps.navigateToCreateQuestion('fill in the gaps with drag and drop');
287
+ cy.barsPreLoaderWait();
288
+ fillInTheGapsDragAndDropPage.steps.switchToPreviewTab();
289
+ });
290
+
291
+ fillInTheGapsDragAndDropPage.tests.verifyHideDragHandleFunctionalityInPreviewTab();
292
+ });
293
+ });
@@ -0,0 +1,66 @@
1
+ import { fillInTheGapsDragAndDropPage } from "../../../pages";
2
+ import abortEarlySetup from "../../../support/helpers/abortEarly";
3
+ const css = Cypress.env('css');
4
+
5
+ describe('Create Item Page - Fill in the gaps - drag and drop: Set correct answer section, correct tab', () => {
6
+ before(() => {
7
+ cy.loginAs('admin');
8
+ });
9
+
10
+ describe('Set correct answer section', () => {
11
+ abortEarlySetup();
12
+ before(() => {
13
+ fillInTheGapsDragAndDropPage.steps.navigateToCreateQuestion('fill in the gaps with drag and drop');
14
+ });
15
+
16
+ fillInTheGapsDragAndDropPage.tests.verifyAutoScoredSetCorrectAnswerHeaderSectionContents('fill in the gaps - drag and drop');
17
+
18
+ it('CSS of correct response conditions section', { tags: 'css' }, () => {
19
+ const labels = [fillInTheGapsDragAndDropPage.randomizeOptionsLabel, fillInTheGapsDragAndDropPage.reuseOptionsLabel, fillInTheGapsDragAndDropPage.hideDragHandleLabel, fillInTheGapsDragAndDropPage.matchFromAllResponsesLabel]
20
+ const uncheckedCheckboxes = [fillInTheGapsDragAndDropPage.randomizeOptionsCheckbox, fillInTheGapsDragAndDropPage.reuseOptionsCheckbox, fillInTheGapsDragAndDropPage.hideDragHandleCheckbox, fillInTheGapsDragAndDropPage.matchFromAllResponsesCheckbox]
21
+ labels.forEach((checkinglabel) => {
22
+ checkinglabel()
23
+ .verifyCSS(css.color.labelText, css.fontSize.normal, css.fontWeight.regular);
24
+ });
25
+ uncheckedCheckboxes.forEach((uncheckedCheckbox) => {
26
+ uncheckedCheckbox()
27
+ .parent()
28
+ .find('svg')
29
+ .should('have.css', 'fill', css.color.uncheckedCheckbox);
30
+ });
31
+ });
32
+
33
+ it('\'Randomize options\' functionality label and checkbox should be displayed and by default it should be unchecked', () => {
34
+ fillInTheGapsDragAndDropPage.randomizeOptionsLabel()
35
+ .verifyInnerText('Randomize options')
36
+ .and('be.visible');
37
+ fillInTheGapsDragAndDropPage.randomizeOptionsCheckbox()
38
+ .should('not.be.checked');
39
+ });
40
+
41
+ it('\'Reuse options\' functionality label and checkbox should be displayed and by default it should be unchecked', () => {
42
+ fillInTheGapsDragAndDropPage.reuseOptionsLabel()
43
+ .verifyInnerText('Reuse options')
44
+ .and('be.visible');
45
+ fillInTheGapsDragAndDropPage.reuseOptionsCheckbox()
46
+ .should('not.be.checked');
47
+ });
48
+
49
+ it('\'Hide drag handle\' functionality label and checkbox should be displayed and by default it should be unchecked', () => {
50
+ fillInTheGapsDragAndDropPage.hideDragHandleLabel()
51
+ .verifyInnerText('Hide drag handle')
52
+ .and('be.visible');
53
+ fillInTheGapsDragAndDropPage.hideDragHandleCheckbox()
54
+ .should('not.be.checked');
55
+ });
56
+
57
+ it('\'Match from all responses\' functionality label and checkbox should be displayed and by default it should be unchecked and disabled', () => {
58
+ fillInTheGapsDragAndDropPage.matchFromAllResponsesLabel()
59
+ .verifyInnerText('Match from all responses')
60
+ .should('have.class', 'Mui-disabled');
61
+ fillInTheGapsDragAndDropPage.matchFromAllResponsesCheckbox()
62
+ .should('not.be.checked')
63
+ .and('be.disabled');
64
+ });
65
+ });
66
+ });
@@ -0,0 +1,129 @@
1
+ import { fillInTheGapsDragAndDropPage, fillInTheGapsScoring } from "../../../pages";
2
+ import abortEarlySetup from "../../../support/helpers/abortEarly";
3
+
4
+ describe('Create Item page - Fill in the Gaps: Drag and Drop - standard options layout - Partial different weights scoring', () => {
5
+ before(() => {
6
+ cy.loginAs('admin');
7
+ });
8
+
9
+ describe('Question Preview: AutoScored - Partial different weights - standard options layout', () => {
10
+ abortEarlySetup();
11
+ before(() => {
12
+ cy.log('Navigate to Fill in the gaps - drag and drop question type, fill the necessary details and points and switch to preview tab');
13
+ fillInTheGapsDragAndDropPage.steps.navigateToCreateQuestion('fill in the gaps with drag and drop');
14
+ cy.barsPreLoaderWait();
15
+ fillInTheGapsDragAndDropPage.addOptionButton()
16
+ .click();
17
+ fillInTheGapsDragAndDropPage.addOptionButton()
18
+ .click();
19
+ fillInTheGapsDragAndDropPage.steps.addInputToOptionsForDragAndDropFields(['Correct answer for response 1', 'Incorrect answer 1', 'Correct answer for response 2', 'Incorrect answer 2']);
20
+ fillInTheGapsDragAndDropPage.partialDifferentWeightsCheckbox()
21
+ .click();
22
+ fillInTheGapsDragAndDropPage.steps.setCorrectAnswerSectionClickAndDropDraggableOptionInResponseArea('Correct answer for response 1', 0);
23
+ fillInTheGapsDragAndDropPage.steps.setCorrectAnswerSectionClickAndDropDraggableOptionInResponseArea('Correct answer for response 2', 1);
24
+ fillInTheGapsDragAndDropPage.steps.addPartialDifferentWeightsPoints([5.4, 4.8]);
25
+ fillInTheGapsDragAndDropPage.steps.expandAdditonalSettings();
26
+ fillInTheGapsDragAndDropPage.allowStudentsToCheckAnswerCheckbox()
27
+ .click();
28
+ fillInTheGapsDragAndDropPage.rounddownScoreCheckbox()
29
+ .click();
30
+ fillInTheGapsDragAndDropPage.steps.switchToPreviewTab();
31
+ });
32
+
33
+ fillInTheGapsScoring.tests.verifyAutoScoredPartialDifferentWeightsScoring('fill in the gaps - drag and drop');
34
+ });
35
+
36
+ describe('Question Preview: AutoScored - Partial different weights standard options layout with alternate answer with \'Match from all responses property - \"false\"\'', () => {
37
+ abortEarlySetup();
38
+ before(() => {
39
+ cy.log('Navigate to Fill in the gaps - drag and drop question type, adding correct answer responses and alternate answer responses for autoscored - partial different weights scoring, adding points and switch to preview tab');
40
+ fillInTheGapsDragAndDropPage.steps.navigateToCreateQuestion('fill in the gaps with drag and drop');
41
+ cy.barsPreLoaderWait();
42
+ fillInTheGapsDragAndDropPage.addOptionButton()
43
+ .click();
44
+ fillInTheGapsDragAndDropPage.addOptionButton()
45
+ .click();
46
+ fillInTheGapsDragAndDropPage.addOptionButton()
47
+ .click();
48
+ fillInTheGapsDragAndDropPage.addOptionButton()
49
+ .click();
50
+ fillInTheGapsDragAndDropPage.steps.addInputToOptionsForDragAndDropFields(['Correct answer for response 1', 'Alternate answer for response 1', 'Incorrect answer 1', 'Correct answer for response 2', 'Alternate answer for response 2', 'Incorrect answer 2']);
51
+ fillInTheGapsDragAndDropPage.partialDifferentWeightsCheckbox()
52
+ .click();
53
+ fillInTheGapsDragAndDropPage.steps.setCorrectAnswerSectionClickAndDropDraggableOptionInResponseArea('Correct answer for response 1', 0);
54
+ fillInTheGapsDragAndDropPage.steps.setCorrectAnswerSectionClickAndDropDraggableOptionInResponseArea('Correct answer for response 2', 1);
55
+ fillInTheGapsDragAndDropPage.steps.addPartialDifferentWeightsPoints([5, 7]);
56
+ fillInTheGapsDragAndDropPage.alternateAnswerButton()
57
+ .click();
58
+ fillInTheGapsDragAndDropPage.steps.setCorrectAnswerSectionClickAndDropDraggableOptionInResponseArea('Alternate answer for response 1', 0);
59
+ fillInTheGapsDragAndDropPage.steps.setCorrectAnswerSectionClickAndDropDraggableOptionInResponseArea('Alternate answer for response 2', 1);
60
+ fillInTheGapsDragAndDropPage.steps.addPartialDifferentWeightsPoints([3, 6]);
61
+ fillInTheGapsDragAndDropPage.steps.expandAdditonalSettings();
62
+ fillInTheGapsDragAndDropPage.allowStudentsToCheckAnswerCheckbox()
63
+ .click();
64
+ fillInTheGapsDragAndDropPage.rounddownScoreCheckbox()
65
+ .click();
66
+ fillInTheGapsDragAndDropPage.steps.switchToPreviewTab();
67
+ });
68
+
69
+ fillInTheGapsScoring.tests.verifyAutoScoredPartialDifferentWeightsWithAlternateAnswerAndMatchFromAllResponsesFalse('fill in the gaps - drag and drop')
70
+ });
71
+
72
+ describe('Question Preview: AutoScored - Partial different weights standard options layout with alternate answer with \'Match from all responses property - \"true\"\'', () => {
73
+ abortEarlySetup();
74
+ before(() => {
75
+ cy.log('Navigate to Fill in the gaps - drag and drop question type, adding correct answer responses and alternate answer responses for autoscored - partial different weights scoring, adding points, check match for all responses checkbox and switch to preview tab');
76
+ fillInTheGapsDragAndDropPage.steps.navigateToCreateQuestion('fill in the gaps with drag and drop');
77
+ cy.barsPreLoaderWait();
78
+ fillInTheGapsDragAndDropPage.addOptionButton()
79
+ .click();
80
+ fillInTheGapsDragAndDropPage.addOptionButton()
81
+ .click();
82
+ fillInTheGapsDragAndDropPage.addOptionButton()
83
+ .click();
84
+ fillInTheGapsDragAndDropPage.addOptionButton()
85
+ .click();
86
+ fillInTheGapsDragAndDropPage.steps.addInputToOptionsForDragAndDropFields(['Correct answer for response 1', 'Alternate answer for response 1', 'Incorrect answer 1', 'Correct answer for response 2', 'Alternate answer for response 2', 'Incorrect answer 2']);
87
+ fillInTheGapsDragAndDropPage.partialDifferentWeightsCheckbox()
88
+ .click();
89
+ fillInTheGapsDragAndDropPage.steps.setCorrectAnswerSectionClickAndDropDraggableOptionInResponseArea('Correct answer for response 1', 0);
90
+ fillInTheGapsDragAndDropPage.steps.setCorrectAnswerSectionClickAndDropDraggableOptionInResponseArea('Correct answer for response 2', 1);
91
+ fillInTheGapsDragAndDropPage.steps.addPartialDifferentWeightsPoints([5, 7]);
92
+ fillInTheGapsDragAndDropPage.alternateAnswerButton()
93
+ .click();
94
+ fillInTheGapsDragAndDropPage.steps.setCorrectAnswerSectionClickAndDropDraggableOptionInResponseArea('Alternate answer for response 1', 0);
95
+ fillInTheGapsDragAndDropPage.steps.setCorrectAnswerSectionClickAndDropDraggableOptionInResponseArea('Alternate answer for response 2', 1);
96
+ fillInTheGapsDragAndDropPage.steps.addPartialDifferentWeightsPoints([3, 6]);
97
+ fillInTheGapsDragAndDropPage.steps.expandAdditonalSettings();
98
+ fillInTheGapsDragAndDropPage.allowStudentsToCheckAnswerCheckbox()
99
+ .click();
100
+ fillInTheGapsDragAndDropPage.matchFromAllResponsesCheckbox()
101
+ .click();
102
+ fillInTheGapsDragAndDropPage.rounddownScoreCheckbox()
103
+ .click();
104
+ fillInTheGapsDragAndDropPage.steps.switchToPreviewTab();
105
+
106
+ });
107
+
108
+ fillInTheGapsScoring.tests.verifyAutoScoredPartialDifferentWeightsWithAlternateAnswerAndMatchFromAllResponsesTrue('fill in the gaps - drag and drop')
109
+ });
110
+
111
+ describe('Partial Different Weights: Round down score - standard options layout', () => {
112
+ abortEarlySetup();
113
+ before(() => {
114
+ cy.log('Navigate to Fill in the gaps - drag and drop question type, adding question instructions and options, set correct answers, select partial - different weights scoring and add points (in decimals) for correct answer options');
115
+ fillInTheGapsDragAndDropPage.steps.navigateToCreateQuestion('fill in the gaps with drag and drop');
116
+ cy.barsPreLoaderWait();
117
+ fillInTheGapsDragAndDropPage.steps.addInputToOptionsForDragAndDropFields(['Correct answer for response 1', 'Correct answer for response 2']);
118
+ fillInTheGapsDragAndDropPage.partialDifferentWeightsCheckbox()
119
+ .click();
120
+ fillInTheGapsDragAndDropPage.steps.setCorrectAnswerSectionClickAndDropDraggableOptionInResponseArea('Correct answer for response 1', 0);
121
+ fillInTheGapsDragAndDropPage.steps.setCorrectAnswerSectionClickAndDropDraggableOptionInResponseArea('Correct answer for response 2', 1);
122
+ fillInTheGapsDragAndDropPage.steps.addPartialDifferentWeightsPoints([1.36, 2.89]);
123
+ fillInTheGapsDragAndDropPage.steps.switchToPreviewTab();
124
+ });
125
+
126
+ fillInTheGapsScoring.tests.verifyAutoScoredPartialDifferentWeightsRoundDownScore('fill in the gaps - drag and drop');
127
+ });
128
+ });
129
+