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,200 @@
1
+ import { fillInTheGapsDragAndDropPage, fillInTheGapsScoring } from "../../../pages";
2
+ import { previewScoringAndShowCorrectAnswerComponent } from "../../../pages/components";
3
+ import abortEarlySetup from "../../../support/helpers/abortEarly";
4
+
5
+ describe('Create Item page - Fill in the Gaps: Drag and Drop - standard options layout - All or nothing scoring', () => {
6
+ before(() => {
7
+ cy.loginAs('admin');
8
+ });
9
+
10
+ describe('Show correct answer', () => {
11
+ abortEarlySetup();
12
+ before(() => {
13
+ cy.log('Navigate to fill in the gaps - drag and drop question type and fill the option input fields in standard options layout');
14
+ fillInTheGapsDragAndDropPage.steps.navigateToCreateQuestion('fill in the gaps with drag and drop');
15
+ cy.barsPreLoaderWait();
16
+ fillInTheGapsDragAndDropPage.addOptionButton()
17
+ .click();
18
+ fillInTheGapsDragAndDropPage.addOptionButton()
19
+ .click();
20
+ fillInTheGapsDragAndDropPage.steps.addInputToOptionsForDragAndDropFields(['Correct answer for response 1', 'Correct answer for response 2', 'Incorrect answer 1', 'Incorrect answer 2']);
21
+ });
22
+
23
+ fillInTheGapsDragAndDropPage.tests.verifyShowCorrectAnswerAndPointsInPreviewTabWhenNoCorrectAnswerIsSet();
24
+
25
+ fillInTheGapsScoring.tests.verifyShowCorrectAnswerBasicFunctionality('fill in the gaps - drag and drop');
26
+ });
27
+
28
+ describe('Question Preview: AutoScored - All or Nothing - standard options layout', () => {
29
+ abortEarlySetup();
30
+ before(() => {
31
+ cy.log('Navigate to fill in the gaps - drag and drop question type, fill the necessary details and points and switch to preview tab');
32
+ fillInTheGapsDragAndDropPage.steps.navigateToCreateQuestion('fill in the gaps with drag and drop');
33
+ cy.barsPreLoaderWait();
34
+ fillInTheGapsDragAndDropPage.addOptionButton()
35
+ .click();
36
+ fillInTheGapsDragAndDropPage.addOptionButton()
37
+ .click();
38
+ fillInTheGapsDragAndDropPage.steps.addInputToOptionsForDragAndDropFields(['Correct answer for response 1', 'Correct answer for response 2', 'Incorrect answer 1', 'Incorrect answer 2']);
39
+ fillInTheGapsDragAndDropPage.steps.setCorrectAnswerSectionClickAndDropDraggableOptionInResponseArea('Correct answer for response 1', 0);
40
+ fillInTheGapsDragAndDropPage.steps.setCorrectAnswerSectionClickAndDropDraggableOptionInResponseArea('Correct answer for response 2', 1);
41
+ fillInTheGapsDragAndDropPage.steps.allotPoints(20);
42
+ fillInTheGapsDragAndDropPage.steps.expandAdditonalSettings();
43
+ fillInTheGapsDragAndDropPage.allowStudentsToCheckAnswerCheckbox()
44
+ .click();
45
+ fillInTheGapsDragAndDropPage.steps.switchToPreviewTab();
46
+ });
47
+
48
+ fillInTheGapsScoring.tests.verifyAutoScoredAllOrNothingScoring('fill in the gaps - drag and drop');
49
+ });
50
+
51
+ describe('Question Preview: AutoScored - All or Nothing standard options layout with alternate answer with \'Match from all responses property - \"false\"\'', () => {
52
+ abortEarlySetup();
53
+ before(() => {
54
+ cy.log('Navigate to fill in the gaps - drag and drop question type, adding correct answer responses and alternate answer responses for autoscored - all or nothing scoring, adding points and switch to preview tab');
55
+ fillInTheGapsDragAndDropPage.steps.navigateToCreateQuestion('fill in the gaps with drag and drop');
56
+ cy.barsPreLoaderWait();
57
+ fillInTheGapsDragAndDropPage.addOptionButton()
58
+ .click();
59
+ fillInTheGapsDragAndDropPage.addOptionButton()
60
+ .click();
61
+ fillInTheGapsDragAndDropPage.addOptionButton()
62
+ .click();
63
+ fillInTheGapsDragAndDropPage.addOptionButton()
64
+ .click();
65
+ 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']);
66
+ fillInTheGapsDragAndDropPage.steps.allotPoints(7);
67
+ fillInTheGapsDragAndDropPage.steps.setCorrectAnswerSectionClickAndDropDraggableOptionInResponseArea('Correct answer for response 1', 0);
68
+ fillInTheGapsDragAndDropPage.steps.setCorrectAnswerSectionClickAndDropDraggableOptionInResponseArea('Correct answer for response 2', 1);
69
+ fillInTheGapsDragAndDropPage.alternateAnswerButton()
70
+ .click();
71
+ fillInTheGapsDragAndDropPage.steps.setCorrectAnswerSectionClickAndDropDraggableOptionInResponseArea('Alternate answer for response 1', 0);
72
+ fillInTheGapsDragAndDropPage.steps.setCorrectAnswerSectionClickAndDropDraggableOptionInResponseArea('Alternate answer for response 2', 1);
73
+ fillInTheGapsDragAndDropPage.steps.allotPoints(3);
74
+ fillInTheGapsDragAndDropPage.steps.expandAdditonalSettings();
75
+ fillInTheGapsDragAndDropPage.allowStudentsToCheckAnswerCheckbox()
76
+ .click();
77
+ fillInTheGapsDragAndDropPage.steps.switchToPreviewTab();
78
+ });
79
+
80
+ fillInTheGapsScoring.tests.verifyAutoScoredAllOrNothingWithAlternateAnswerAndMatchFromAllResponsesFalse('fill in the gaps - drag and drop')
81
+ });
82
+
83
+ describe('Question Preview: AutoScored - All or Nothing standard options layout with alternate answer with \'Match from all responses property - \"true\"\'', () => {
84
+ abortEarlySetup();
85
+ before(() => {
86
+ cy.log('Navigate to fill in the gaps - drag and drop question type, adding correct answer responses and alternate answer responses for autoscored - all or nothing scoring, adding points, check match for all responses checkbox and switch to preview tab');
87
+ fillInTheGapsDragAndDropPage.steps.navigateToCreateQuestion('fill in the gaps with drag and drop');
88
+ cy.barsPreLoaderWait();
89
+ fillInTheGapsDragAndDropPage.addOptionButton()
90
+ .click();
91
+ fillInTheGapsDragAndDropPage.addOptionButton()
92
+ .click();
93
+ fillInTheGapsDragAndDropPage.addOptionButton()
94
+ .click();
95
+ fillInTheGapsDragAndDropPage.addOptionButton()
96
+ .click();
97
+ 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']);
98
+ fillInTheGapsDragAndDropPage.steps.allotPoints(7);
99
+ fillInTheGapsDragAndDropPage.steps.setCorrectAnswerSectionClickAndDropDraggableOptionInResponseArea('Correct answer for response 1', 0);
100
+ fillInTheGapsDragAndDropPage.steps.setCorrectAnswerSectionClickAndDropDraggableOptionInResponseArea('Correct answer for response 2', 1);
101
+ fillInTheGapsDragAndDropPage.alternateAnswerButton()
102
+ .click();
103
+ fillInTheGapsDragAndDropPage.matchFromAllResponsesCheckbox()
104
+ .click();
105
+ fillInTheGapsDragAndDropPage.steps.setCorrectAnswerSectionClickAndDropDraggableOptionInResponseArea('Alternate answer for response 1', 0);
106
+ fillInTheGapsDragAndDropPage.steps.setCorrectAnswerSectionClickAndDropDraggableOptionInResponseArea('Alternate answer for response 2', 1);
107
+ fillInTheGapsDragAndDropPage.steps.expandAdditonalSettings();
108
+ fillInTheGapsDragAndDropPage.allowStudentsToCheckAnswerCheckbox()
109
+ .click();
110
+ fillInTheGapsDragAndDropPage.steps.switchToPreviewTab();
111
+
112
+ });
113
+
114
+ fillInTheGapsScoring.tests.verifyAutoScoredAllOrNothingWithAlternateAnswerAndMatchFromAllResponsesTrue('fill in the gaps - drag and drop')
115
+ });
116
+
117
+ describe('Question Preview: AutoScored - All or Nothing standard options layout with identical draggable response options in preview tab', () => {
118
+ abortEarlySetup();
119
+ before(() => {
120
+ cy.log('Navigate to fill in the gaps - drag and drop question type, fill the necessary details and points and switch to preview tab');
121
+ fillInTheGapsDragAndDropPage.steps.navigateToCreateQuestion('fill in the gaps with drag and drop');
122
+ cy.barsPreLoaderWait();
123
+ fillInTheGapsDragAndDropPage.addOptionButton()
124
+ .click();
125
+ fillInTheGapsDragAndDropPage.steps.addInputToOptionsForDragAndDropFields(['Identical correct answer for response 1', 'Correct answer for response 2', 'Identical correct answer for response 1']);
126
+ fillInTheGapsDragAndDropPage.steps.setCorrectAnswerSectionClickAndDropDraggableOptionInResponseArea('Identical correct answer for response 1', 0);
127
+ fillInTheGapsDragAndDropPage.steps.setCorrectAnswerSectionClickAndDropDraggableOptionInResponseArea('Correct answer for response 2', 1);
128
+ fillInTheGapsDragAndDropPage.steps.allotPoints(20);
129
+ fillInTheGapsDragAndDropPage.steps.expandAdditonalSettings();
130
+ fillInTheGapsDragAndDropPage.allowStudentsToCheckAnswerCheckbox()
131
+ .click();
132
+ fillInTheGapsDragAndDropPage.steps.switchToPreviewTab();
133
+ });
134
+
135
+ it('Case: When user has identical options to give as input', () => {
136
+ cy.log('Both the identical options should be visible in the response options section and when user clicks on \'Show correct answer\' checkbox only one of the identical options should be displayed in the correct answer container as the correct answer');
137
+ fillInTheGapsDragAndDropPage.steps.verifyDraggableResponsesPreviewTab('fill in the gaps - drag and drop', ['Identical correct answer for response 1', 'Correct answer for response 2', 'Identical correct answer for response 1']);
138
+ fillInTheGapsDragAndDropPage.steps.checkShowCorrectAnswerCheckbox()
139
+ fillInTheGapsDragAndDropPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerContainerAndCount(['Identical correct answer for response 1', 'Correct answer for response 2'], ['1', '2']);
140
+
141
+ cy.log('Post-step: Unchecking show correct answer checkbox');
142
+ fillInTheGapsDragAndDropPage.steps.uncheckShowCorrectAnswerCheckbox()
143
+
144
+ cy.log('When the user gives the correct answer inputs and user selects the show correct answer checkbox, green check-mark icon should be displayed besides both the responses, correct answer container should not be displayed and user should be awarded with full points');
145
+ cy.log('Answering the response 1 with the correct identical option');
146
+ fillInTheGapsDragAndDropPage.previewTabDraggableOption()
147
+ .contains('Identical correct answer for response 1')
148
+ .click();
149
+ fillInTheGapsDragAndDropPage.previewTabResponseArea()
150
+ .eq(0)
151
+ .click();
152
+ cy.log('Answering the response 2 with the correct option');
153
+ fillInTheGapsDragAndDropPage.steps.previewTabClickAndDropDraggableOptionInResponseArea('Correct answer for response 2', 1);
154
+ fillInTheGapsDragAndDropPage.steps.checkShowCorrectAnswerCheckbox()
155
+ fillInTheGapsDragAndDropPage.steps.verifyCorrectOptionCheckmarkIcon(0);
156
+ fillInTheGapsDragAndDropPage.steps.verifyCorrectOptionCheckmarkIcon(1);
157
+ fillInTheGapsDragAndDropPage.previewTabCorrectAnswerContainer()
158
+ .should('not.exist');
159
+ fillInTheGapsDragAndDropPage.previewScoreText()
160
+ .verifyInnerText('20/20');
161
+ cy.log('Post-step: Unchecking show correct answer checkbox');
162
+ fillInTheGapsDragAndDropPage.steps.uncheckShowCorrectAnswerCheckbox()
163
+
164
+ cy.log('When user clicks on \'Check answer\' button, then green check-mark icon should be displayed besides responses and correct answer container should not be displayed');
165
+ fillInTheGapsDragAndDropPage.checkAnswerButton()
166
+ .click();
167
+ fillInTheGapsDragAndDropPage.steps.verifyCorrectOptionCheckmarkIcon(0);
168
+ fillInTheGapsDragAndDropPage.steps.verifyCorrectOptionCheckmarkIcon(1);
169
+ fillInTheGapsDragAndDropPage.previewTabCorrectAnswerContainer()
170
+ .should('not.exist');
171
+
172
+ cy.log('When the user gives correct input to the response but with a different identical option and user selects the show correct answer checkbox, then red cross-mark icon should be displayed besides the identical response, correct answer container be displayed with the correct answer and user should be awarded with zero points');
173
+ cy.log('Answering the response 1 with a different correct identical option');
174
+ fillInTheGapsDragAndDropPage.previewTabDraggableOption()
175
+ .contains('Identical correct answer for response 1')
176
+ .click();
177
+ fillInTheGapsDragAndDropPage.previewTabResponseArea()
178
+ .eq(0)
179
+ .click();
180
+ fillInTheGapsDragAndDropPage.steps.checkShowCorrectAnswerCheckbox()
181
+ fillInTheGapsDragAndDropPage.steps.verifyIncorrectOptionCrossmarkIcon(0);
182
+ fillInTheGapsDragAndDropPage.steps.verifyCorrectOptionCheckmarkIcon(1);
183
+ fillInTheGapsDragAndDropPage.previewScoreText()
184
+ .verifyInnerText('0/20');
185
+ fillInTheGapsDragAndDropPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerContainerAndCount(['Identical correct answer for response 1'], ['1']);
186
+
187
+ cy.log('Post-step: Unchecking show correct answer checkbox');
188
+ fillInTheGapsDragAndDropPage.steps.uncheckShowCorrectAnswerCheckbox();
189
+
190
+ cy.log('When user clicks on \'Check answer\' button, then red cross-mark icon should be displayed besides the identical response and correct answer container should not be displayed')
191
+ fillInTheGapsDragAndDropPage.checkAnswerButton()
192
+ .click();
193
+ fillInTheGapsDragAndDropPage.steps.verifyIncorrectOptionCrossmarkIcon(0);
194
+ fillInTheGapsDragAndDropPage.steps.verifyCorrectOptionCheckmarkIcon(1);
195
+ fillInTheGapsDragAndDropPage.previewTabCorrectAnswerContainer()
196
+ .should('not.exist');
197
+ });
198
+ });
199
+ });
200
+
@@ -0,0 +1,60 @@
1
+ import { fillInTheGapsScoring, fillInTheGapsDragAndDropPage } from "../../../pages";
2
+ import abortEarlySetup from "../../../support/helpers/abortEarly";
3
+
4
+ describe('Fill in the gaps - drag and drop Manually and Non scored scoring types - standard option layout', () => {
5
+ before(() => {
6
+ cy.loginAs('admin');
7
+ });
8
+
9
+ describe('Question Preview: Manually Scored - standard options layout', () => {
10
+ abortEarlySetup();
11
+ before(() => {
12
+ cy.log('Adding question instructions and options, select Manually Scored scoring type and add points for the question');
13
+ fillInTheGapsDragAndDropPage.steps.navigateToCreateQuestion('fill in the gaps with drag and drop');
14
+ cy.barsPreLoaderWait();
15
+ fillInTheGapsDragAndDropPage.steps.addQuestionInstructions();
16
+ fillInTheGapsDragAndDropPage.steps.addInputToOptionsForDragAndDropFields(['Correct answer for response 1', 'Correct answer for response 2']);
17
+ fillInTheGapsDragAndDropPage.steps.selectAScoringTypeFromScoringTypeDropdown('Manually scored')
18
+ fillInTheGapsDragAndDropPage.steps.switchToPreviewTab();
19
+ });
20
+
21
+ it('When the user switches to the Preview tab, the question instructions and question field text, two response fields and the draggable options section with two draggable options should be displayed', () => {
22
+ fillInTheGapsDragAndDropPage.steps.switchToPreviewTab()
23
+ fillInTheGapsDragAndDropPage.steps.verifyQuestionInstructionsText();
24
+ fillInTheGapsDragAndDropPage.questionInputField()
25
+ .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.');
26
+ fillInTheGapsDragAndDropPage.previewTabQuestionField()
27
+ .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.');
28
+ fillInTheGapsDragAndDropPage.previewTabResponseArea()
29
+ .should('have.length', 2)
30
+ .and('be.visible');
31
+ fillInTheGapsDragAndDropPage.previewDraggableOptionsWrapper()
32
+ .should('be.visible');
33
+ fillInTheGapsDragAndDropPage.steps.verifyDraggableResponsesPreviewTab('fill in the gaps - drag and drop', ['Correct answer for response 1', 'Correct answer for response 2'])
34
+ });
35
+
36
+ fillInTheGapsDragAndDropPage.tests.verifyShowCorrectAnswerAndPointsNotDisplayedInPreviewTab();
37
+ });
38
+
39
+ describe('Question Preview: Non Scored - standard options layout', () => {
40
+ abortEarlySetup();
41
+ before(() => {
42
+ cy.log('Adding question instructions and options, select Non Scored scoring type and and set correct answer');
43
+ fillInTheGapsDragAndDropPage.steps.navigateToCreateQuestion('fill in the gaps with drag and drop');
44
+ cy.barsPreLoaderWait();
45
+ fillInTheGapsDragAndDropPage.addOptionButton()
46
+ .click();
47
+ fillInTheGapsDragAndDropPage.addOptionButton()
48
+ .click();
49
+ fillInTheGapsDragAndDropPage.steps.addInputToOptionsForDragAndDropFields(['Correct answer for response 1', 'Correct answer for response 2', 'Incorrect answer 1', 'Incorrect answer 2']);
50
+ fillInTheGapsDragAndDropPage.steps.setCorrectAnswerSectionClickAndDropDraggableOptionInResponseArea('Correct answer for response 1', 0);
51
+ fillInTheGapsDragAndDropPage.steps.setCorrectAnswerSectionClickAndDropDraggableOptionInResponseArea('Correct answer for response 2', 1);
52
+ fillInTheGapsDragAndDropPage.steps.selectAScoringTypeFromScoringTypeDropdown('Non scored')
53
+ fillInTheGapsDragAndDropPage.steps.expandAdditonalSettings();
54
+ fillInTheGapsDragAndDropPage.steps.setMaximumCheckAnswerAttempts(10)
55
+ fillInTheGapsDragAndDropPage.steps.switchToPreviewTab();
56
+ });
57
+
58
+ fillInTheGapsScoring.tests.verifyNonScoredScoring('fill in the gaps - drag and drop');
59
+ });
60
+ });
@@ -0,0 +1,130 @@
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 equal weights scoring', () => {
5
+ before(() => {
6
+ cy.loginAs('admin');
7
+ });
8
+
9
+ describe('Question Preview: AutoScored - Partial equal 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.steps.allotPoints('10');
21
+ fillInTheGapsDragAndDropPage.steps.setCorrectAnswerSectionClickAndDropDraggableOptionInResponseArea('Correct answer for response 1', 0);
22
+ fillInTheGapsDragAndDropPage.steps.setCorrectAnswerSectionClickAndDropDraggableOptionInResponseArea('Correct answer for response 2', 1);
23
+ fillInTheGapsDragAndDropPage.partialEqualWeightsCheckbox()
24
+ .click();
25
+ fillInTheGapsDragAndDropPage.steps.expandAdditonalSettings();
26
+ fillInTheGapsDragAndDropPage.allowStudentsToCheckAnswerCheckbox()
27
+ .click();
28
+ fillInTheGapsDragAndDropPage.rounddownScoreCheckbox()
29
+ .click();
30
+ fillInTheGapsDragAndDropPage.steps.switchToPreviewTab();
31
+ });
32
+
33
+ fillInTheGapsScoring.tests.verifyAutoScoredPartialEqualWeightsScoring('fill in the gaps - drag and drop');
34
+ });
35
+
36
+ describe('Question Preview: AutoScored - Partial equal weights standard options layout with alternate answer and \'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 equal 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.steps.setCorrectAnswerSectionClickAndDropDraggableOptionInResponseArea('Correct answer for response 1', 0);
52
+ fillInTheGapsDragAndDropPage.steps.setCorrectAnswerSectionClickAndDropDraggableOptionInResponseArea('Correct answer for response 2', 1);
53
+ fillInTheGapsDragAndDropPage.steps.allotPoints('10');
54
+ fillInTheGapsDragAndDropPage.alternateAnswerButton()
55
+ .click();
56
+ fillInTheGapsDragAndDropPage.steps.setCorrectAnswerSectionClickAndDropDraggableOptionInResponseArea('Alternate answer for response 1', 0);
57
+ fillInTheGapsDragAndDropPage.steps.setCorrectAnswerSectionClickAndDropDraggableOptionInResponseArea('Alternate answer for response 2', 1);
58
+ fillInTheGapsDragAndDropPage.steps.allotPoints('6');
59
+ fillInTheGapsDragAndDropPage.partialEqualWeightsCheckbox()
60
+ .click();
61
+ fillInTheGapsDragAndDropPage.steps.expandAdditonalSettings();
62
+ fillInTheGapsDragAndDropPage.allowStudentsToCheckAnswerCheckbox()
63
+ .click();
64
+ fillInTheGapsDragAndDropPage.rounddownScoreCheckbox()
65
+ .click();
66
+ fillInTheGapsDragAndDropPage.steps.switchToPreviewTab();
67
+ });
68
+
69
+ fillInTheGapsScoring.tests.verifyAutoScoredPartialEqualWeightsWithAlternateAnswerAndMatchFromAllResponsesFalse('fill in the gaps - drag and drop')
70
+ });
71
+
72
+ describe('Question Preview: AutoScored - Partial equal 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 equal 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.steps.setCorrectAnswerSectionClickAndDropDraggableOptionInResponseArea('Correct answer for response 1', 0);
88
+ fillInTheGapsDragAndDropPage.steps.setCorrectAnswerSectionClickAndDropDraggableOptionInResponseArea('Correct answer for response 2', 1);
89
+ fillInTheGapsDragAndDropPage.steps.allotPoints('10');
90
+ fillInTheGapsDragAndDropPage.alternateAnswerButton()
91
+ .click();
92
+ fillInTheGapsDragAndDropPage.steps.setCorrectAnswerSectionClickAndDropDraggableOptionInResponseArea('Alternate answer for response 1', 0);
93
+ fillInTheGapsDragAndDropPage.steps.setCorrectAnswerSectionClickAndDropDraggableOptionInResponseArea('Alternate answer for response 2', 1);
94
+ fillInTheGapsDragAndDropPage.steps.allotPoints('6');
95
+ fillInTheGapsDragAndDropPage.partialEqualWeightsCheckbox()
96
+ .click();
97
+ fillInTheGapsDragAndDropPage.matchFromAllResponsesCheckbox()
98
+ .click();
99
+ fillInTheGapsDragAndDropPage.steps.expandAdditonalSettings();
100
+ fillInTheGapsDragAndDropPage.allowStudentsToCheckAnswerCheckbox()
101
+ .click();
102
+ fillInTheGapsDragAndDropPage.rounddownScoreCheckbox()
103
+ .click();
104
+ fillInTheGapsDragAndDropPage.steps.switchToPreviewTab();
105
+ });
106
+
107
+ fillInTheGapsScoring.tests.verifyAutoScoredPartialEqualWeightsWithAlternateAnswerAndMatchFromAllResponsesTrue('fill in the gaps - drag and drop')
108
+ });
109
+
110
+ describe('Partial Equal Weights: Round down score - standard options layout', () => {
111
+ abortEarlySetup();
112
+ before(() => {
113
+ cy.log('Navigate to Fill in the gaps - drag and drop question type, adding question instructions and options, set correct answers, select partial - equal weights scoring and add points (in decimals) for correct answer options');
114
+ fillInTheGapsDragAndDropPage.steps.navigateToCreateQuestion('fill in the gaps with drag and drop');
115
+ cy.barsPreLoaderWait();
116
+ fillInTheGapsDragAndDropPage.addOptionButton()
117
+ .click();
118
+ fillInTheGapsDragAndDropPage.addOptionButton()
119
+ .click();
120
+ fillInTheGapsDragAndDropPage.steps.addInputToOptionsForDragAndDropFields(['Correct answer for response 1', 'Incorrect answer 1', 'Correct answer for response 2', 'Incorrect answer 2']);
121
+ fillInTheGapsDragAndDropPage.partialEqualWeightsCheckbox()
122
+ .click();
123
+ fillInTheGapsDragAndDropPage.steps.setCorrectAnswerSectionClickAndDropDraggableOptionInResponseArea('Correct answer for response 1', 0);
124
+ fillInTheGapsDragAndDropPage.steps.setCorrectAnswerSectionClickAndDropDraggableOptionInResponseArea('Correct answer for response 2', 1);
125
+ fillInTheGapsDragAndDropPage.steps.allotPoints('8.5');
126
+ });
127
+
128
+ fillInTheGapsScoring.tests.verifyAutoScoredPartialEqualWeightsRoundDownScore('fill in the gaps - drag and drop');
129
+ });
130
+ });
@@ -0,0 +1,66 @@
1
+ import { fillInTheGapsDragAndDropPage } from "../../../pages";
2
+ import abortEarlySetup from "../../../support/helpers/abortEarly";
3
+ const css = Cypress.env('css');
4
+ let optionsForThreeResponses = ['Response 1', 'Response 2', 'Response 3'];
5
+
6
+ describe('Create Item page - Fill in the gaps - drag and drop: Options sections, Response options', () => {
7
+ before(() => {
8
+ cy.loginAs('admin');
9
+ });
10
+
11
+ describe('Response options and Response options layout dropdown', () => {
12
+ abortEarlySetup();
13
+ before(() => {
14
+ fillInTheGapsDragAndDropPage.steps.navigateToCreateQuestion('fill in the gaps with drag and drop');
15
+ cy.barsPreLoaderWait();
16
+ });
17
+
18
+ fillInTheGapsDragAndDropPage.tests.verifyResponseOptionsLayoutDropdownSection();
19
+ });
20
+
21
+ describe('Options - \'Standard\' response options - Edit tab section contents', () => {
22
+ abortEarlySetup();
23
+ before(() => {
24
+ fillInTheGapsDragAndDropPage.steps.navigateToCreateQuestion('fill in the gaps with drag and drop');
25
+ cy.barsPreLoaderWait();
26
+ });
27
+
28
+ fillInTheGapsDragAndDropPage.tests.verifyOptionsSectionContentAndFunctionality();
29
+ });
30
+
31
+ describe('\'Standard\' response options layout - Set correct answer section contents', () => {
32
+ abortEarlySetup();
33
+ before(() => {
34
+ fillInTheGapsDragAndDropPage.steps.navigateToCreateQuestion('fill in the gaps with drag and drop');
35
+ cy.barsPreLoaderWait();
36
+ });
37
+
38
+ fillInTheGapsDragAndDropPage.tests.verifyStandardResponseDraggableOptionsInSetCorrectAnswerSection('fill in the gaps - drag and drop');
39
+
40
+ it('When the user deletes an option, then the deleted option should get removed from the response options container as well as from the response areas (if any) in the \'Set Correct Answer\' section', () => {
41
+ const optionsAfterDeleting = optionsForThreeResponses.filter((el) => el !== 'Response 3');
42
+ cy.log('Setting a correct answer option')
43
+ fillInTheGapsDragAndDropPage.steps.setCorrectAnswerSectionClickAndDropDraggableOptionInResponseArea('Response 3', 0);
44
+ fillInTheGapsDragAndDropPage.deleteOptionButton()
45
+ .eq(2)
46
+ .click();
47
+ fillInTheGapsDragAndDropPage.steps.verifyErroredStateOfResponseAreaInSetCorrectAnswerSection(0);
48
+ cy.log('Checking the deleted option should not exist within the draggable answer responses under \'Set Correct Answer\' section')
49
+ fillInTheGapsDragAndDropPage.setCorrectAnswerDraggableOptionsWrapper()
50
+ .contains(`${optionsForThreeResponses[2]}`)
51
+ .should('not.exist');
52
+ fillInTheGapsDragAndDropPage.steps.verifyDraggableResponsesSetCorrectAnswer('fill in the gaps - drag and drop', optionsAfterDeleting);
53
+ });
54
+ });
55
+
56
+ describe('\'Standard\' Response options layout - Preview tab contents', () => {
57
+ abortEarlySetup();
58
+ before(() => {
59
+ fillInTheGapsDragAndDropPage.steps.navigateToCreateQuestion('fill in the gaps with drag and drop');
60
+ cy.barsPreLoaderWait();
61
+ fillInTheGapsDragAndDropPage.steps.switchToPreviewTab();
62
+ });
63
+
64
+ fillInTheGapsDragAndDropPage.tests.verifyStandardResponseDraggableOptionsInPreviewTab('fill in the gaps - drag and drop');
65
+ });
66
+ });
@@ -0,0 +1,54 @@
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
+ let optionsForResponses3 = ['Response 1', 'Response 2', 'Response 3', 'Response 4'];
7
+
8
+ describe('Create Item Page: Fill in the gaps - drag and drop: Switching cases between \'Standard\' and \'Grouped\' response layouts', () => {
9
+ before(() => {
10
+ cy.loginAs('admin');
11
+ });
12
+
13
+ describe('Fill in the gaps - drag and drop: Switching cases between \'Standard\' and \'Grouped\' response layouts: \'Response Options section\'', () => {
14
+ abortEarlySetup();
15
+ before(() => {
16
+ fillInTheGapsDragAndDropPage.steps.navigateToCreateQuestion('fill in the gaps with drag and drop');
17
+ cy.barsPreLoaderWait();
18
+ fillInTheGapsDragAndDropPage.steps.addInputToOptionsForDragAndDropFields(optionsForResponses);
19
+ });
20
+
21
+ it('When the user switches from \'Standard\' response layout to \'Grouped\', all the option input fields along with text should appear in the group options', () => {
22
+ fillInTheGapsDragAndDropPage.steps.selectResponseOptionsLayout('Grouped');
23
+ fillInTheGapsDragAndDropPage.steps.verifyOptionFieldContentsInOptionsSection(optionsForResponses);
24
+ cy.log('verifying draggable options in \'Set correct answer\' section')
25
+ fillInTheGapsDragAndDropPage.steps.verifyGroupedResponseContainerContentsInSetCorrectAnswerSection(0, optionsForResponses);
26
+ });
27
+
28
+ it('When the user creates more than one group of options and switches to \'Standard\' response layout, all the option input fields along with text should appear in the standard options', () => {
29
+ cy.log('Adding a new group and adding input to the option fields')
30
+ fillInTheGapsDragAndDropPage.addGroupButton()
31
+ .click();
32
+ fillInTheGapsDragAndDropPage.groupResponseContainer()
33
+ .eq(1)
34
+ .should('be.visible')
35
+ .within(() => {
36
+ fillInTheGapsDragAndDropPage.steps.addInputToOptionsForDragAndDropFields(optionsForResponses2);
37
+ });
38
+ fillInTheGapsDragAndDropPage.steps.selectResponseOptionsLayout('Standard');
39
+ fillInTheGapsDragAndDropPage.steps.verifyOptionFieldContentsInOptionsSection(optionsForResponses3);
40
+ cy.log('verifying draggable options in \'Set correct answer\' section')
41
+ fillInTheGapsDragAndDropPage.steps.verifyDraggableResponsesSetCorrectAnswer('fill in the gaps - drag and drop', optionsForResponses3);
42
+ });
43
+
44
+ it('On switching back to \'Grouped\' response layout, all option input fields should be present under Group A and no other group should exist', () => {
45
+ fillInTheGapsDragAndDropPage.steps.selectResponseOptionsLayout('Grouped');
46
+ fillInTheGapsDragAndDropPage.groupResponseContainer()
47
+ .eq(1)
48
+ .should('not.exist');
49
+ fillInTheGapsDragAndDropPage.steps.verifyOptionFieldContentsInOptionsSection(optionsForResponses3);
50
+ cy.log('verifying draggable options in \'Set correct answer\' section')
51
+ fillInTheGapsDragAndDropPage.steps.verifyGroupedResponseContainerContentsInSetCorrectAnswerSection(0, optionsForResponses3);
52
+ });
53
+ });
54
+ });