itemengine-cypress-automation 1.0.28 → 1.0.29
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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,230 @@
|
|
1
|
+
import { dialogBoxBase, 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 optionsForThreeResponses = ['Response 1', 'Response 2', 'Response 3'];
|
6
|
+
|
7
|
+
describe('Create Item Page: Fill in the gaps - drag and drop: Edit tab scoring types and set correct answer section (Alternate answer tab)', () => {
|
8
|
+
before(() => {
|
9
|
+
cy.loginAs('admin');
|
10
|
+
});
|
11
|
+
|
12
|
+
describe('Alternate answer tab', () => {
|
13
|
+
abortEarlySetup();
|
14
|
+
before(() => {
|
15
|
+
fillInTheGapsDragAndDropPage.steps.navigateToCreateQuestion('fill in the gaps with drag and drop');
|
16
|
+
cy.barsPreLoaderWait();
|
17
|
+
fillInTheGapsDragAndDropPage.addOptionButton()
|
18
|
+
.click();
|
19
|
+
fillInTheGapsDragAndDropPage.steps.addInputToOptionsForDragAndDropFields(optionsForThreeResponses);
|
20
|
+
});
|
21
|
+
|
22
|
+
fillInTheGapsDragAndDropPage.tests.verifyAutoScoredAlternateAnswer();
|
23
|
+
|
24
|
+
it('When user has added points and set correct answer options in the \'Correct\' tab, then the user should be able to add alternate answer for the question using \'Add Alternate Answer\' button', () => {
|
25
|
+
fillInTheGapsDragAndDropPage.steps.setCorrectAnswerSectionClickAndDropDraggableOptionInResponseArea('Response 1', 0);
|
26
|
+
fillInTheGapsDragAndDropPage.steps.setCorrectAnswerSectionClickAndDropDraggableOptionInResponseArea('Response 2', 1);
|
27
|
+
fillInTheGapsDragAndDropPage.steps.allotPoints(20);
|
28
|
+
fillInTheGapsDragAndDropPage.steps.addAlternateTab(1);
|
29
|
+
});
|
30
|
+
|
31
|
+
it('When the user has added an alternate tab, the alternate tab should be displayed in active state', () => {
|
32
|
+
fillInTheGapsDragAndDropPage.alternateAnswerTab(1)
|
33
|
+
.should('have.attr', 'aria-selected', 'true');
|
34
|
+
});
|
35
|
+
|
36
|
+
it('CSS of alternate tab in active state', { tags: 'css' }, () => {
|
37
|
+
fillInTheGapsDragAndDropPage.alternateAnswerTab(1)
|
38
|
+
.verifyCSS(css.color.secondaryBtnActive, css.fontSize.default, css.fontWeight.bold)
|
39
|
+
fillInTheGapsDragAndDropPage.deleteAlternateTabButton()
|
40
|
+
.find('svg')
|
41
|
+
.should('have.css', 'fill', `${css.color.secondaryBtnActive}`);
|
42
|
+
});
|
43
|
+
|
44
|
+
fillInTheGapsDragAndDropPage.tests.verifyA11yOfAlternateAnswerTab();
|
45
|
+
|
46
|
+
it('When the user has added an alternate answer, \'Match from all responses\' functionality label and checkbox should get enabled and the checkbox should be in unchecked state', () => {
|
47
|
+
fillInTheGapsDragAndDropPage.matchFromAllResponsesLabel()
|
48
|
+
.should('not.have.class', 'Mui-disabled');
|
49
|
+
fillInTheGapsDragAndDropPage.matchFromAllResponsesCheckbox()
|
50
|
+
.should('not.be.disabled')
|
51
|
+
.and('not.be.checked');
|
52
|
+
});
|
53
|
+
|
54
|
+
it('When user clicks on Correct tab when all the mandatory fields are not filled in Alternate tab a warning popup should be displayed and on closing the popup user should be on the Alternate 1 tab.', () => {
|
55
|
+
fillInTheGapsDragAndDropPage.correctTab()
|
56
|
+
.click();
|
57
|
+
dialogBoxBase.steps.allFieldsRequiredWarningPopupContents();
|
58
|
+
dialogBoxBase.steps.closeWarningPopup();
|
59
|
+
fillInTheGapsDragAndDropPage.alternateAnswerTab(1)
|
60
|
+
.should('have.attr', 'aria-selected', 'true');
|
61
|
+
});
|
62
|
+
//TODO: will need to update the above case with verifyWarningPopupAndTabNavigationWhenNoPointsAddedInAlternateTab after updating the order of test cases in other files as well
|
63
|
+
|
64
|
+
it('When the user fills all the mandatory fields in the alternate tab, then user should be able to switch to correct tab', () => {
|
65
|
+
cy.log('Set correct answer and points in alternate 2 tab, then switching to Correct tab');
|
66
|
+
fillInTheGapsDragAndDropPage.steps.setCorrectAnswerSectionClickAndDropDraggableOptionInResponseArea('Response 2', 0);
|
67
|
+
fillInTheGapsDragAndDropPage.steps.setCorrectAnswerSectionClickAndDropDraggableOptionInResponseArea('Response 3', 1);
|
68
|
+
fillInTheGapsDragAndDropPage.steps.allotPoints(4);
|
69
|
+
fillInTheGapsDragAndDropPage.correctTab()
|
70
|
+
.click()
|
71
|
+
.should('have.attr', 'aria-selected', 'true');
|
72
|
+
cy.log('Verifying the points and answers set in the correct tab')
|
73
|
+
optionsForResponses.forEach((responseText, count) => {
|
74
|
+
fillInTheGapsDragAndDropPage.setCorrectAnswerResponseArea()
|
75
|
+
.eq(count)
|
76
|
+
.verifyInnerText(responseText);
|
77
|
+
});
|
78
|
+
fillInTheGapsDragAndDropPage.pointsInputField()
|
79
|
+
.should('have.value', 20);
|
80
|
+
});
|
81
|
+
|
82
|
+
it('User should be able to add another alternate answer for the question using \'Add Alternate Answer\' button and the name for this new tab should be \'Alternate 2\'', () => {
|
83
|
+
fillInTheGapsDragAndDropPage.steps.addAlternateTab(2);
|
84
|
+
});
|
85
|
+
|
86
|
+
it('User should be able to remove alternate correct answer by clicking on the Close icon button alongside alternate answer tab and the name of the alternate answer tabs should get updated accordingly', () => {
|
87
|
+
let optionsSetInAlternateTab2 = ['Response 1', 'Response 3'];
|
88
|
+
cy.log('Set correct answer and points in alternate 2 tab, then switching to alternate tab 1');
|
89
|
+
fillInTheGapsDragAndDropPage.steps.setCorrectAnswerSectionClickAndDropDraggableOptionInResponseArea('Response 1', 0);
|
90
|
+
fillInTheGapsDragAndDropPage.steps.setCorrectAnswerSectionClickAndDropDraggableOptionInResponseArea('Response 3', 1);
|
91
|
+
fillInTheGapsDragAndDropPage.steps.allotPoints(2);
|
92
|
+
fillInTheGapsDragAndDropPage.alternateAnswerTab(1)
|
93
|
+
.click();
|
94
|
+
fillInTheGapsDragAndDropPage.deleteAlternateTabButton()
|
95
|
+
.click();
|
96
|
+
fillInTheGapsDragAndDropPage.alternateAnswerTab(2)
|
97
|
+
.should('not.exist');
|
98
|
+
fillInTheGapsDragAndDropPage.alternateAnswerTab(1)
|
99
|
+
.verifyInnerText('Alternate 1');
|
100
|
+
cy.log('verifying the points and correct answer of the alternate tab')
|
101
|
+
optionsSetInAlternateTab2.forEach((responseText, count) => {
|
102
|
+
fillInTheGapsDragAndDropPage.setCorrectAnswerResponseArea()
|
103
|
+
.eq(count)
|
104
|
+
.verifyInnerText(responseText);
|
105
|
+
});
|
106
|
+
fillInTheGapsDragAndDropPage.pointsInputField()
|
107
|
+
.should('have.value', 2);
|
108
|
+
});
|
109
|
+
|
110
|
+
it('When the user removes all the \'Alternate\' tabs, \'Match from all responses\' functionality should get disabled', () => {
|
111
|
+
fillInTheGapsDragAndDropPage.deleteAlternateTabButton()
|
112
|
+
.click();
|
113
|
+
fillInTheGapsDragAndDropPage.alternateAnswerTab(1)
|
114
|
+
.should('not.exist');
|
115
|
+
fillInTheGapsDragAndDropPage.matchFromAllResponsesLabel()
|
116
|
+
.should('have.class', 'Mui-disabled');
|
117
|
+
fillInTheGapsDragAndDropPage.matchFromAllResponsesCheckbox()
|
118
|
+
.should('not.be.checked')
|
119
|
+
.and('be.disabled');
|
120
|
+
});
|
121
|
+
|
122
|
+
//TODO: Use fillInTheGapsDragAndDropPage.tests.verifyMatchFromAllResponsesGetsDisabledWhenAlternateTabsAreDeleted(); for above test case once common selectors are used for matchFromAllResponsesLabel, matchFromAllResponsesCheckbox, https://redmine.zeuslearning.com/issues/518498
|
123
|
+
});
|
124
|
+
|
125
|
+
describe('Edit tab \'Set correct answer\' section (Alternate answer tab) and \'Scoring\' section for Autoscored: All or Nothing scoring type', () => {
|
126
|
+
abortEarlySetup();
|
127
|
+
before(() => {
|
128
|
+
cy.log('Navigate to fill in the gaps - drag and drop question type');
|
129
|
+
fillInTheGapsDragAndDropPage.steps.navigateToCreateQuestion('fill in the gaps with drag and drop');
|
130
|
+
cy.barsPreLoaderWait();
|
131
|
+
cy.log('Adding options, allotting points and setting correct answers in response areas of correct tab')
|
132
|
+
fillInTheGapsDragAndDropPage.steps.addInputToOptionsForDragAndDropFields(optionsForResponses);
|
133
|
+
fillInTheGapsDragAndDropPage.steps.allotPoints(10);
|
134
|
+
fillInTheGapsDragAndDropPage.steps.setCorrectAnswerSectionClickAndDropDraggableOptionInResponseArea('Response 1', 0);
|
135
|
+
fillInTheGapsDragAndDropPage.steps.setCorrectAnswerSectionClickAndDropDraggableOptionInResponseArea('Response 2', 1);
|
136
|
+
cy.log('adding alternate tab')
|
137
|
+
fillInTheGapsDragAndDropPage.steps.addAlternateTab(1);
|
138
|
+
});
|
139
|
+
|
140
|
+
fillInTheGapsDragAndDropPage.tests.verifyAutoScoredAllOrNothingPointsAndMinimumScoreAwardedLabelAndInputField();
|
141
|
+
|
142
|
+
fillInTheGapsDragAndDropPage.tests.verifyDefaultResponseLabelAndResponseAreasInSetCorrectAnswerSection();
|
143
|
+
|
144
|
+
fillInTheGapsDragAndDropPage.tests.verifyDraggableOptionContentsInAlternateTab();
|
145
|
+
|
146
|
+
fillInTheGapsDragAndDropPage.tests.verifyPointsFieldErrorState(10);
|
147
|
+
|
148
|
+
fillInTheGapsDragAndDropPage.tests.verifyMinimumScoreIfAttemptedFieldErrorState(10, 20, 10);
|
149
|
+
});
|
150
|
+
|
151
|
+
describe('Edit tab \'Set correct answer\' section (Alternate answer tab) and \'Scoring\' section for AutoScored: Partial equal weights scoring type', () => {
|
152
|
+
abortEarlySetup();
|
153
|
+
before(() => {
|
154
|
+
cy.log('Navigate to fill in the gaps - drag and drop question type');
|
155
|
+
fillInTheGapsDragAndDropPage.steps.navigateToCreateQuestion('fill in the gaps with drag and drop');
|
156
|
+
cy.log('Adding options, allotting points and setting correct answers in response areas of correct tab')
|
157
|
+
fillInTheGapsDragAndDropPage.steps.addInputToOptionsForDragAndDropFields(optionsForResponses);
|
158
|
+
fillInTheGapsDragAndDropPage.steps.allotPoints(10);
|
159
|
+
fillInTheGapsDragAndDropPage.steps.setCorrectAnswerSectionClickAndDropDraggableOptionInResponseArea('Response 1', 0);
|
160
|
+
fillInTheGapsDragAndDropPage.steps.setCorrectAnswerSectionClickAndDropDraggableOptionInResponseArea('Response 2', 1);
|
161
|
+
cy.log('adding alternate tab')
|
162
|
+
fillInTheGapsDragAndDropPage.steps.addAlternateTab(1);
|
163
|
+
});
|
164
|
+
|
165
|
+
fillInTheGapsDragAndDropPage.tests.verifyAutoScoredPartialEqualWeightsScoringEditTabContents();
|
166
|
+
|
167
|
+
fillInTheGapsDragAndDropPage.tests.verifyDefaultResponseLabelAndResponseAreasInSetCorrectAnswerSection();
|
168
|
+
|
169
|
+
fillInTheGapsDragAndDropPage.tests.verifyDraggableOptionContentsInAlternateTab();
|
170
|
+
|
171
|
+
fillInTheGapsDragAndDropPage.tests.verifyScoreForPartialEqualWeightsWhenResponseTokenIsAdded();
|
172
|
+
|
173
|
+
fillInTheGapsDragAndDropPage.tests.verifyAutoScoredPartialEqualWeightsScoringEditTabFunctionality()
|
174
|
+
});
|
175
|
+
|
176
|
+
describe('Edit tab \'Set correct answer\' section (Alternate answer tab) and \'Scoring\' section for AutoScored: Partial different weights scoring type', () => {
|
177
|
+
abortEarlySetup();
|
178
|
+
before(() => {
|
179
|
+
cy.log('Navigate to fill in the gaps - drag and drop question type');
|
180
|
+
fillInTheGapsDragAndDropPage.steps.navigateToCreateQuestion('fill in the gaps with drag and drop');
|
181
|
+
cy.log('Adding options, allotting points and setting correct answers in response areas of correct tab')
|
182
|
+
fillInTheGapsDragAndDropPage.steps.addInputToOptionsForDragAndDropFields(optionsForResponses);
|
183
|
+
fillInTheGapsDragAndDropPage.steps.allotPoints(10);
|
184
|
+
fillInTheGapsDragAndDropPage.steps.setCorrectAnswerSectionClickAndDropDraggableOptionInResponseArea('Response 1', 0);
|
185
|
+
fillInTheGapsDragAndDropPage.steps.setCorrectAnswerSectionClickAndDropDraggableOptionInResponseArea('Response 2', 1);
|
186
|
+
cy.log('adding alternate tab')
|
187
|
+
fillInTheGapsDragAndDropPage.steps.addAlternateTab(1);
|
188
|
+
});
|
189
|
+
|
190
|
+
fillInTheGapsDragAndDropPage.tests.verifyAutoScoredPartialDifferentWeightsScoringEditTabContents();
|
191
|
+
|
192
|
+
fillInTheGapsDragAndDropPage.tests.verifyDefaultResponseLabelAndResponseAreasInSetCorrectAnswerSection();
|
193
|
+
|
194
|
+
fillInTheGapsDragAndDropPage.tests.verifyDraggableOptionContentsInAlternateTab();
|
195
|
+
|
196
|
+
it('When user sets an answer in the response area then the \'Points per response\' input field should be enabled', () => {
|
197
|
+
optionsForResponses.forEach((responseText, index) => {
|
198
|
+
fillInTheGapsDragAndDropPage.steps.setCorrectAnswerSectionClickAndDropDraggableOptionInResponseArea(responseText, index);
|
199
|
+
fillInTheGapsDragAndDropPage.pointsInputField()
|
200
|
+
.eq(index)
|
201
|
+
.should('be.enabled');
|
202
|
+
});
|
203
|
+
});
|
204
|
+
|
205
|
+
fillInTheGapsDragAndDropPage.tests.verifyAutoScoredPartialDifferentWeightsScoringEditTabFunctionality()
|
206
|
+
});
|
207
|
+
|
208
|
+
//Set correct answer section does not exist for Manually scored scoring, so not covering alternate answer tab cases here
|
209
|
+
|
210
|
+
describe('Edit tab \'Set correct answer\' section (Alternate answer tab) and \'Scoring\' section for Non Scored scoring type', () => {
|
211
|
+
abortEarlySetup();
|
212
|
+
before(() => {
|
213
|
+
cy.log('Navigate to fill in the gaps - dropdown question type');
|
214
|
+
fillInTheGapsDragAndDropPage.steps.navigateToCreateQuestion('fill in the gaps with drag and drop');
|
215
|
+
cy.log('Adding options, allotting points and setting correct answers in response areas of correct tab')
|
216
|
+
fillInTheGapsDragAndDropPage.steps.addInputToOptionsForDragAndDropFields(optionsForResponses);
|
217
|
+
fillInTheGapsDragAndDropPage.steps.allotPoints(10);
|
218
|
+
fillInTheGapsDragAndDropPage.steps.setCorrectAnswerSectionClickAndDropDraggableOptionInResponseArea('Response 1', 0);
|
219
|
+
fillInTheGapsDragAndDropPage.steps.setCorrectAnswerSectionClickAndDropDraggableOptionInResponseArea('Response 2', 1);
|
220
|
+
cy.log('adding alternate tab')
|
221
|
+
fillInTheGapsDragAndDropPage.steps.addAlternateTab(1);
|
222
|
+
});
|
223
|
+
|
224
|
+
fillInTheGapsDragAndDropPage.tests.verifyEditTabNonScoredScoringSectionContents();
|
225
|
+
|
226
|
+
fillInTheGapsDragAndDropPage.tests.verifyDefaultResponseLabelAndResponseAreasInSetCorrectAnswerSection();
|
227
|
+
|
228
|
+
fillInTheGapsDragAndDropPage.tests.verifyDraggableOptionContentsInAlternateTab();
|
229
|
+
});
|
230
|
+
});
|