itemengine-cypress-automation 1.0.579-IEI-7046-a317a6b.0 → 1.0.580-IEI-7040-1e744fc.0
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/config-files/ilprod.json +2 -1
- package/cypress/config-files/ilqa.json +2 -1
- package/cypress/config-files/ilstage.json +2 -1
- package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/Scoring/allOrNothingAlternativePointsGreaterThanCorrectPoints.js +8 -123
- package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/Scoring/allOrNothingCorrectPointsEqualToAlternativePoints.js +8 -123
- package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/Scoring/allOrNothingCorrectPointsGreaterThanAlternativePoints.js +14 -131
- package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/Scoring/perCorrectOptionAlternativePointsGreaterThanCorrectPoints.js +9 -138
- package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/Scoring/perCorrectOptionCorrectPointsEqualToAlternativePoints.js +9 -138
- package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/Scoring/perCorrectOptionCorrectPointsGreaterThanAlternativePoints.js +10 -153
- package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/Scoring/perDropzoneAlternativePointsGreaterThanCorrectPoints.js +9 -138
- package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/Scoring/perDropzoneCorrectPointsEqualToAlternativePoints.js +7 -108
- package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/Scoring/perDropzoneCorrectPointsGreaterThanAlternativePoints.js +9 -138
- package/cypress/e2e/ILC/FillInTheGapsDropdownNew/Scoring/allOrNothingAlternativePointsGreaterThanCorrectPoints.js +135 -7
- package/cypress/e2e/ILC/FillInTheGapsDropdownNew/Scoring/allOrNothingCorrectPointsEqualToAlternativePoints.js +135 -7
- package/cypress/e2e/ILC/FillInTheGapsDropdownNew/Scoring/allOrNothingCorrectPointsGreaterThanAlternativePoints.js +136 -9
- package/cypress/e2e/ILC/FillInTheGapsDropdownNew/Scoring/checkScoringLabelBannerAndCorrectAnswer.js +7 -2
- package/cypress/e2e/ILC/FillInTheGapsDropdownNew/Scoring/partialDifferentWeightsAlternativePointsGreaterThanCorrectPoints.js +154 -8
- package/cypress/e2e/ILC/FillInTheGapsDropdownNew/Scoring/partialDifferentWeightsWithCorrectPointsEqualToAlternativePoints.js +154 -8
- package/cypress/e2e/ILC/FillInTheGapsDropdownNew/Scoring/partialDifferentWeightsWithCorrectPointsGreaterThanAlternativePoints.js +154 -8
- package/cypress/e2e/ILC/FillInTheGapsDropdownNew/Scoring/partialEqualWeightsWithAlternativePointsGreaterThanCorrectPoints.js +135 -7
- package/cypress/e2e/ILC/FillInTheGapsDropdownNew/Scoring/partialEqualWeightsWithCorrectPointsEqualToAlternativePoints.js +116 -7
- package/cypress/e2e/ILC/FillInTheGapsDropdownNew/Scoring/partialEqualWeightsWithCorrectPointsGreaterThanAlternativePoints.js +136 -8
- package/cypress/e2e/ILC/FillInTheGapsDropdownNew/Scoring/responseLevelAlternateAnswerBasicScoring.js +21 -2
- package/cypress/e2e/ILC/FillInTheGapsDropdownNew/allOrNothingForAllView.smoke.js +190 -2
- package/cypress/e2e/ILC/Matching/questionInstructionsAndPromptSection.js +17 -0
- package/cypress/e2e/ILC/MultipleSelection/previewContentsForAllViews.smoke.js +18 -0
- package/cypress/e2e/ILC/MultipleSelectionGridNew/previewContentsForAllViews.smoke.js +19 -0
- package/cypress/e2e/ILC/NumberLineLabel/editTabBasicSection.js +18 -0
- package/cypress/e2e/ILC/SingleSelection/previewContents.smoke.js +18 -0
- package/cypress/e2e/ILC/SingleSelectionGridNew/previewContentsForAllViews.smoke.js +19 -0
- package/cypress/e2e/ILC/TextEntryMath/editTabBasicSection.js +17 -0
- package/cypress/e2e/ILC/TextSelection/questionInstructionsAndQuestion.js +16 -0
- package/cypress/pages/components/ckEditorToolbar.js +20 -0
- package/cypress/pages/components/draggableOptionContainer.js +14 -0
- package/cypress/pages/components/gridQuestionCommonComponent.js +17 -1
- package/cypress/pages/components/optionsWrapperComponent.js +33 -2
- package/cypress/pages/components/questionInputFieldComponent.js +18 -2
- package/cypress/pages/dragAndDropIntoCategoriesPage.js +0 -38
- package/cypress/pages/fillInTheGapsDropdownPage.js +47 -2
- package/cypress/pages/matchingPage.js +18 -0
- package/cypress/pages/numberLineLabelPage.js +1 -0
- package/cypress/pages/textSelectionPage.js +17 -1
- package/package.json +1 -1
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { fillInTheGapsDropdownPage } from "../../../../pages";
|
|
2
2
|
import abortEarlySetup from "../../../../support/helpers/abortEarly";
|
|
3
|
+
import { showAlternativeAnswersComponent } from "../../../../pages/components";
|
|
3
4
|
|
|
4
5
|
const optionsForDropdown1 = ['Flower', 'Petal', 'Stem', 'Branch'];
|
|
5
6
|
const optionsForDropdown2 = ['Leaf', 'Leaves', 'Stem', 'Seed'];
|
|
@@ -7,6 +8,7 @@ const optionsForDropdown3 = ['Flower', 'Leaf', 'Stem', 'Roots']; //Common answe
|
|
|
7
8
|
const correctAnswerArray = ['Flower', 'Leaf', 'Stem'];
|
|
8
9
|
const alternateAnswerArray = ['Petal', 'Leaves', 'Stem'];
|
|
9
10
|
const incorrectAnswerArray = ['Branch', 'Seed', 'Roots'];
|
|
11
|
+
const alternativeAnswerCheck = Cypress.env('ENABLE_ALTERNATIVE_ANSWER_ENHANCEMENT') === 'true';
|
|
10
12
|
|
|
11
13
|
describe('Create item page - Fill in the gaps with dropdown: Partial different weights', () => {
|
|
12
14
|
before(() => {
|
|
@@ -39,7 +41,25 @@ describe('Create item page - Fill in the gaps with dropdown: Partial different w
|
|
|
39
41
|
it('When the user selects \'Grading\' view without attempting the question, dropdown numeration should be displayed, correct answers section should be displayed with correct answers from the alternative accordion and respective dropdown numeration', () => {
|
|
40
42
|
fillInTheGapsDropdownPage.steps.switchToGradingView();
|
|
41
43
|
fillInTheGapsDropdownPage.steps.verifyDropdownNumerationPreviewTab();
|
|
42
|
-
|
|
44
|
+
if (alternativeAnswerCheck) {
|
|
45
|
+
showAlternativeAnswersComponent.steps.verifyShowAlternativeAnswersToggleExists();
|
|
46
|
+
showAlternativeAnswersComponent.steps.disableShowAlternativeAnswersToggle();
|
|
47
|
+
showAlternativeAnswersComponent.steps.verifyShowAlternativeAnswersToggleUnchecked();
|
|
48
|
+
fillInTheGapsDropdownPage.steps.verifyAlternativeAnswersSectionNotExist();
|
|
49
|
+
showAlternativeAnswersComponent.steps.clickShowAlternativeAnswersToggle();
|
|
50
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectAnswerSectionWithAlternateAnswer([
|
|
51
|
+
{
|
|
52
|
+
correctAnswers: [['Petal'],['Leaves'],['Stem']],
|
|
53
|
+
points: ['(15 points)', '(6 points)', '(4 points)', '(5 points)'],
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
correctAnswers: [['Flower'],['Leaf'],['Stem']],
|
|
57
|
+
points: ['(13 points)', '(7 points)', '(1 point)', '(5 points)'],
|
|
58
|
+
}
|
|
59
|
+
]);
|
|
60
|
+
} else {
|
|
61
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(alternateAnswerArray);
|
|
62
|
+
}
|
|
43
63
|
});
|
|
44
64
|
|
|
45
65
|
it('When the user attempts the question with responses from the correct accordion, then the user should be awarded points of the correct accordion (less than full points) and on switching to \'Grading\' view, correct icons should be displayed beside all the correct dropdowns, status message and correct answer section should not be displayed', () => {
|
|
@@ -91,7 +111,25 @@ describe('Create item page - Fill in the gaps with dropdown: Partial different w
|
|
|
91
111
|
fillInTheGapsDropdownPage.steps.verifyCorrectOptionIcon(1);
|
|
92
112
|
fillInTheGapsDropdownPage.steps.verifyIncorrectOptionIcon(2);
|
|
93
113
|
fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
|
|
94
|
-
|
|
114
|
+
if (alternativeAnswerCheck) {
|
|
115
|
+
showAlternativeAnswersComponent.steps.verifyShowAlternativeAnswersToggleExists();
|
|
116
|
+
showAlternativeAnswersComponent.steps.disableShowAlternativeAnswersToggle();
|
|
117
|
+
showAlternativeAnswersComponent.steps.verifyShowAlternativeAnswersToggleUnchecked();
|
|
118
|
+
fillInTheGapsDropdownPage.steps.verifyAlternativeAnswersSectionNotExist();
|
|
119
|
+
showAlternativeAnswersComponent.steps.clickShowAlternativeAnswersToggle();
|
|
120
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectAnswerSectionWithAlternateAnswer([
|
|
121
|
+
{
|
|
122
|
+
correctAnswers: [['Petal'],['Leaves'],['Stem']],
|
|
123
|
+
points: ['(15 points)', '(6 points)', '(4 points)', '(5 points)'],
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
correctAnswers: [['Flower'],['Leaf'],['Stem']],
|
|
127
|
+
points: ['(13 points)', '(7 points)', '(1 point)', '(5 points)'],
|
|
128
|
+
}
|
|
129
|
+
]);
|
|
130
|
+
} else {
|
|
131
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(alternateAnswerArray);
|
|
132
|
+
}
|
|
95
133
|
fillInTheGapsDropdownPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
|
96
134
|
/*cy.log('When the user has attempted the question with partially correct options exclusively from the correct accordion and clicks on \'Check answer\' button, then correct icon should be displayed besides the correct dropdowns, status message and correct answer section should not be displayed')
|
|
97
135
|
fillInTheGapsDropdownPage.steps.checkAnswer();
|
|
@@ -111,7 +149,25 @@ describe('Create item page - Fill in the gaps with dropdown: Partial different w
|
|
|
111
149
|
fillInTheGapsDropdownPage.steps.verifyIncorrectOptionIcon(1);
|
|
112
150
|
fillInTheGapsDropdownPage.steps.verifyIncorrectOptionIcon(2);
|
|
113
151
|
fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
|
|
114
|
-
|
|
152
|
+
if (alternativeAnswerCheck) {
|
|
153
|
+
showAlternativeAnswersComponent.steps.verifyShowAlternativeAnswersToggleExists();
|
|
154
|
+
showAlternativeAnswersComponent.steps.disableShowAlternativeAnswersToggle();
|
|
155
|
+
showAlternativeAnswersComponent.steps.verifyShowAlternativeAnswersToggleUnchecked();
|
|
156
|
+
fillInTheGapsDropdownPage.steps.verifyAlternativeAnswersSectionNotExist();
|
|
157
|
+
showAlternativeAnswersComponent.steps.clickShowAlternativeAnswersToggle();
|
|
158
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectAnswerSectionWithAlternateAnswer([
|
|
159
|
+
{
|
|
160
|
+
correctAnswers: [['Petal'],['Leaves'],['Stem']],
|
|
161
|
+
points: ['(15 points)', '(6 points)', '(4 points)', '(5 points)'],
|
|
162
|
+
},
|
|
163
|
+
{
|
|
164
|
+
correctAnswers: [['Flower'],['Leaf'],['Stem']],
|
|
165
|
+
points: ['(13 points)', '(7 points)', '(1 point)', '(5 points)'],
|
|
166
|
+
}
|
|
167
|
+
]);
|
|
168
|
+
} else {
|
|
169
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(alternateAnswerArray);
|
|
170
|
+
}
|
|
115
171
|
fillInTheGapsDropdownPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
|
116
172
|
/*cy.log('When the user has attempted the question with partially correct options exclusively from the alternative accordion and clicks on \'Check answer\' button, then correct icon should be displayed besides the correct dropdowns, no icon should be displayed beside unattempted dropdown, status message and correct answer section should not be displayed')
|
|
117
173
|
fillInTheGapsDropdownPage.steps.checkAnswer();
|
|
@@ -131,7 +187,25 @@ describe('Create item page - Fill in the gaps with dropdown: Partial different w
|
|
|
131
187
|
fillInTheGapsDropdownPage.steps.verifyIncorrectOptionIcon(1);
|
|
132
188
|
fillInTheGapsDropdownPage.steps.verifyIncorrectOptionIcon(2);
|
|
133
189
|
fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
|
|
134
|
-
|
|
190
|
+
if (alternativeAnswerCheck) {
|
|
191
|
+
showAlternativeAnswersComponent.steps.verifyShowAlternativeAnswersToggleExists();
|
|
192
|
+
showAlternativeAnswersComponent.steps.disableShowAlternativeAnswersToggle();
|
|
193
|
+
showAlternativeAnswersComponent.steps.verifyShowAlternativeAnswersToggleUnchecked();
|
|
194
|
+
fillInTheGapsDropdownPage.steps.verifyAlternativeAnswersSectionNotExist();
|
|
195
|
+
showAlternativeAnswersComponent.steps.clickShowAlternativeAnswersToggle();
|
|
196
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectAnswerSectionWithAlternateAnswer([
|
|
197
|
+
{
|
|
198
|
+
correctAnswers: [['Petal'],['Leaves'],['Stem']],
|
|
199
|
+
points: ['(15 points)', '(6 points)', '(4 points)', '(5 points)'],
|
|
200
|
+
},
|
|
201
|
+
{
|
|
202
|
+
correctAnswers: [['Flower'],['Leaf'],['Stem']],
|
|
203
|
+
points: ['(13 points)', '(7 points)', '(1 point)', '(5 points)'],
|
|
204
|
+
}
|
|
205
|
+
]);
|
|
206
|
+
} else {
|
|
207
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(alternateAnswerArray);
|
|
208
|
+
}
|
|
135
209
|
fillInTheGapsDropdownPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
|
136
210
|
/*cy.log('When the user has attempted the question with equal number of correct responses from correct and alternative accordion and clicks on \'Check answer\' button, then correct icon should be displayed besides the dropdown with alternative answer responses, incorrect icon should be displayed beside dropdown with correct accordion response, status message and correct answer section should not be displayed')
|
|
137
211
|
fillInTheGapsDropdownPage.steps.checkAnswer();
|
|
@@ -151,7 +225,25 @@ describe('Create item page - Fill in the gaps with dropdown: Partial different w
|
|
|
151
225
|
fillInTheGapsDropdownPage.steps.verifyIncorrectOptionIcon(1);
|
|
152
226
|
fillInTheGapsDropdownPage.steps.verifyIncorrectOptionIcon(2);
|
|
153
227
|
fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
|
|
154
|
-
|
|
228
|
+
if (alternativeAnswerCheck) {
|
|
229
|
+
showAlternativeAnswersComponent.steps.verifyShowAlternativeAnswersToggleExists();
|
|
230
|
+
showAlternativeAnswersComponent.steps.disableShowAlternativeAnswersToggle();
|
|
231
|
+
showAlternativeAnswersComponent.steps.verifyShowAlternativeAnswersToggleUnchecked();
|
|
232
|
+
fillInTheGapsDropdownPage.steps.verifyAlternativeAnswersSectionNotExist();
|
|
233
|
+
showAlternativeAnswersComponent.steps.clickShowAlternativeAnswersToggle();
|
|
234
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectAnswerSectionWithAlternateAnswer([
|
|
235
|
+
{
|
|
236
|
+
correctAnswers: [['Petal'],['Leaves'],['Stem']],
|
|
237
|
+
points: ['(15 points)', '(6 points)', '(4 points)', '(5 points)'],
|
|
238
|
+
},
|
|
239
|
+
{
|
|
240
|
+
correctAnswers: [['Flower'],['Leaf'],['Stem']],
|
|
241
|
+
points: ['(13 points)', '(7 points)', '(1 point)', '(5 points)'],
|
|
242
|
+
}
|
|
243
|
+
]);
|
|
244
|
+
} else {
|
|
245
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(alternateAnswerArray);
|
|
246
|
+
}
|
|
155
247
|
fillInTheGapsDropdownPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
|
156
248
|
/*cy.log('When the user has attempted the question with equal number of correct responses from correct and alternative accordion and clicks on \'Check answer\' button, then correct icon icon should be displayed besides the correct dropdowns, incorrect icon should be displayed beside dropdown with alternative accordion response, status message and correct answer section should not be displayed')
|
|
157
249
|
fillInTheGapsDropdownPage.steps.checkAnswer();
|
|
@@ -171,7 +263,25 @@ describe('Create item page - Fill in the gaps with dropdown: Partial different w
|
|
|
171
263
|
fillInTheGapsDropdownPage.steps.verifyIncorrectOptionIcon(1);
|
|
172
264
|
fillInTheGapsDropdownPage.steps.verifyCorrectOptionIcon(2);
|
|
173
265
|
fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
|
|
174
|
-
|
|
266
|
+
if (alternativeAnswerCheck) {
|
|
267
|
+
showAlternativeAnswersComponent.steps.verifyShowAlternativeAnswersToggleExists();
|
|
268
|
+
showAlternativeAnswersComponent.steps.disableShowAlternativeAnswersToggle();
|
|
269
|
+
showAlternativeAnswersComponent.steps.verifyShowAlternativeAnswersToggleUnchecked();
|
|
270
|
+
fillInTheGapsDropdownPage.steps.verifyAlternativeAnswersSectionNotExist();
|
|
271
|
+
showAlternativeAnswersComponent.steps.clickShowAlternativeAnswersToggle();
|
|
272
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectAnswerSectionWithAlternateAnswer([
|
|
273
|
+
{
|
|
274
|
+
correctAnswers: [['Petal'],['Leaves'],['Stem']],
|
|
275
|
+
points: ['(15 points)', '(6 points)', '(4 points)', '(5 points)'],
|
|
276
|
+
},
|
|
277
|
+
{
|
|
278
|
+
correctAnswers: [['Flower'],['Leaf'],['Stem']],
|
|
279
|
+
points: ['(13 points)', '(7 points)', '(1 point)', '(5 points)'],
|
|
280
|
+
}
|
|
281
|
+
]);
|
|
282
|
+
} else {
|
|
283
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(alternateAnswerArray);
|
|
284
|
+
}
|
|
175
285
|
fillInTheGapsDropdownPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
|
176
286
|
/*cy.log('When the user has attempted the question with equal number of correct responses from correct and alternative accordion and clicks on \'Check answer\' button, then correct icon should be displayed besides the correct dropdown, no icon should be displayed beside unattempted dropdown, status message and correct answer section should not be displayed')
|
|
177
287
|
fillInTheGapsDropdownPage.steps.checkAnswer();
|
|
@@ -191,7 +301,25 @@ describe('Create item page - Fill in the gaps with dropdown: Partial different w
|
|
|
191
301
|
fillInTheGapsDropdownPage.steps.verifyIncorrectOptionIcon(1);
|
|
192
302
|
fillInTheGapsDropdownPage.steps.verifyIncorrectOptionIcon(2);
|
|
193
303
|
fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
|
|
194
|
-
|
|
304
|
+
if (alternativeAnswerCheck) {
|
|
305
|
+
showAlternativeAnswersComponent.steps.verifyShowAlternativeAnswersToggleExists();
|
|
306
|
+
showAlternativeAnswersComponent.steps.disableShowAlternativeAnswersToggle();
|
|
307
|
+
showAlternativeAnswersComponent.steps.verifyShowAlternativeAnswersToggleUnchecked();
|
|
308
|
+
fillInTheGapsDropdownPage.steps.verifyAlternativeAnswersSectionNotExist();
|
|
309
|
+
showAlternativeAnswersComponent.steps.clickShowAlternativeAnswersToggle();
|
|
310
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectAnswerSectionWithAlternateAnswer([
|
|
311
|
+
{
|
|
312
|
+
correctAnswers: [['Petal'],['Leaves'],['Stem']],
|
|
313
|
+
points: ['(15 points)', '(6 points)', '(4 points)', '(5 points)'],
|
|
314
|
+
},
|
|
315
|
+
{
|
|
316
|
+
correctAnswers: [['Flower'],['Leaf'],['Stem']],
|
|
317
|
+
points: ['(13 points)', '(7 points)', '(1 point)', '(5 points)'],
|
|
318
|
+
}
|
|
319
|
+
]);
|
|
320
|
+
} else {
|
|
321
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(alternateAnswerArray);
|
|
322
|
+
}
|
|
195
323
|
fillInTheGapsDropdownPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
|
196
324
|
/*cy.log('When the user has attempted the question incorrectly and clicks on \'Check answer\' button, then incorrect icon should be displayed besides all incorrect dropdowns, no icon should be displayed beside unattempted dropdown, status message and correct answer section should not be displayed')
|
|
197
325
|
fillInTheGapsDropdownPage.steps.checkAnswer();
|
|
@@ -217,7 +345,25 @@ describe('Create item page - Fill in the gaps with dropdown: Partial different w
|
|
|
217
345
|
fillInTheGapsDropdownPage.steps.verifyIncorrectOptionIcon(1);
|
|
218
346
|
fillInTheGapsDropdownPage.steps.verifyCorrectOptionIcon(2);
|
|
219
347
|
fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
|
|
220
|
-
|
|
348
|
+
if (alternativeAnswerCheck) {
|
|
349
|
+
showAlternativeAnswersComponent.steps.verifyShowAlternativeAnswersToggleExists();
|
|
350
|
+
showAlternativeAnswersComponent.steps.disableShowAlternativeAnswersToggle();
|
|
351
|
+
showAlternativeAnswersComponent.steps.verifyShowAlternativeAnswersToggleUnchecked();
|
|
352
|
+
fillInTheGapsDropdownPage.steps.verifyAlternativeAnswersSectionNotExist();
|
|
353
|
+
showAlternativeAnswersComponent.steps.clickShowAlternativeAnswersToggle();
|
|
354
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectAnswerSectionWithAlternateAnswer([
|
|
355
|
+
{
|
|
356
|
+
correctAnswers: [['Petal'],['Leaves'],['Stem']],
|
|
357
|
+
points: ['(23 points)', '(10.4 points)', '(1.2 points)', '(11.4 points)'],
|
|
358
|
+
},
|
|
359
|
+
{
|
|
360
|
+
correctAnswers: [['Flower'],['Leaf'],['Roots']],
|
|
361
|
+
points: ['(5 points)', '(1.2 points)', '(2.2 points)', '(1.6 points)'],
|
|
362
|
+
}
|
|
363
|
+
]);
|
|
364
|
+
} else {
|
|
365
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(alternateAnswerArray);
|
|
366
|
+
}
|
|
221
367
|
fillInTheGapsDropdownPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
|
222
368
|
/*cy.log('When the user attempts the question with more number of correct responses from the correct accordion than the alternative accordion but the score of the individual response selected from the alternative accordion overpowers the combined score of the correct accordion answers and clicks on the \'Check answer\' button, correct icon icons should be displayed beside the correct dropdowns from the correct accordion, incorrect icons should be displayed beside the incorrectly answered dropdowns, correct/incorrect answer status message, correct answer container should not be displayed')
|
|
223
369
|
fillInTheGapsDropdownPage.steps.checkAnswer();
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { fillInTheGapsDropdownPage } from "../../../../pages";
|
|
2
2
|
import abortEarlySetup from "../../../../support/helpers/abortEarly";
|
|
3
3
|
const css = Cypress.env('css');
|
|
4
|
+
import { showAlternativeAnswersComponent } from "../../../../pages/components";
|
|
4
5
|
|
|
5
6
|
const optionsForDropdown1 = ['Flower', 'Petal', 'Stem', 'Branch'];
|
|
6
7
|
const optionsForDropdown2 = ['Leaf', 'Leaves', 'Stem', 'Seed'];
|
|
@@ -8,6 +9,7 @@ const optionsForDropdown3 = ['Flower', 'Leaf', 'Stem', 'Roots']; //Common answe
|
|
|
8
9
|
const correctAnswerArray = ['Flower', 'Leaf', 'Stem'];
|
|
9
10
|
const alternateAnswerArray = ['Petal', 'Leaves', 'Stem'];
|
|
10
11
|
const incorrectAnswerArray = ['Branch', 'Seed', 'Roots'];
|
|
12
|
+
const alternativeAnswerCheck = Cypress.env('ENABLE_ALTERNATIVE_ANSWER_ENHANCEMENT') === 'true';
|
|
11
13
|
|
|
12
14
|
describe('Create item page - Fill in the gaps with dropdown: Partial different weights', () => {
|
|
13
15
|
before(() => {
|
|
@@ -40,7 +42,25 @@ describe('Create item page - Fill in the gaps with dropdown: Partial different w
|
|
|
40
42
|
it('When the user selects \'Grading\' view without attempting the question, dropdown numeration, correct answers section with correct answers from the correct accordion and respective dropdown numeration should be displayed', () => {
|
|
41
43
|
fillInTheGapsDropdownPage.steps.switchToGradingView();
|
|
42
44
|
fillInTheGapsDropdownPage.steps.verifyDropdownNumerationPreviewTab();
|
|
43
|
-
|
|
45
|
+
if (alternativeAnswerCheck) {
|
|
46
|
+
showAlternativeAnswersComponent.steps.verifyShowAlternativeAnswersToggleExists();
|
|
47
|
+
showAlternativeAnswersComponent.steps.disableShowAlternativeAnswersToggle();
|
|
48
|
+
showAlternativeAnswersComponent.steps.verifyShowAlternativeAnswersToggleUnchecked();
|
|
49
|
+
fillInTheGapsDropdownPage.steps.verifyAlternativeAnswersSectionNotExist();
|
|
50
|
+
showAlternativeAnswersComponent.steps.clickShowAlternativeAnswersToggle();
|
|
51
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectAnswerSectionWithAlternateAnswer([
|
|
52
|
+
{
|
|
53
|
+
correctAnswers: [['Flower'],['Leaf'],['Stem']],
|
|
54
|
+
points: ['(15 points)', '(6 points)', '(5 points)', '(4 points)'],
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
correctAnswers: [['Petal'],['Leaves'],['Stem']],
|
|
58
|
+
points: ['(15 points)', '(7 points)', '(5 points)', '(3 points)'],
|
|
59
|
+
}
|
|
60
|
+
]);
|
|
61
|
+
} else {
|
|
62
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(correctAnswerArray);
|
|
63
|
+
}
|
|
44
64
|
});
|
|
45
65
|
|
|
46
66
|
it('When the user attempts the question with responses from the correct accordion, then the user should be awarded full points and on switching to \'Grading\' view, correct icons should be displayed beside all the correct dropdowns, correct/incorrect status message and correct answer section should not be displayed', () => {
|
|
@@ -92,7 +112,25 @@ describe('Create item page - Fill in the gaps with dropdown: Partial different w
|
|
|
92
112
|
fillInTheGapsDropdownPage.steps.verifyCorrectOptionIcon(1);
|
|
93
113
|
fillInTheGapsDropdownPage.steps.verifyIncorrectOptionIcon(2);
|
|
94
114
|
fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
|
|
95
|
-
|
|
115
|
+
if (alternativeAnswerCheck) {
|
|
116
|
+
showAlternativeAnswersComponent.steps.verifyShowAlternativeAnswersToggleExists();
|
|
117
|
+
showAlternativeAnswersComponent.steps.disableShowAlternativeAnswersToggle();
|
|
118
|
+
showAlternativeAnswersComponent.steps.verifyShowAlternativeAnswersToggleUnchecked();
|
|
119
|
+
fillInTheGapsDropdownPage.steps.verifyAlternativeAnswersSectionNotExist();
|
|
120
|
+
showAlternativeAnswersComponent.steps.clickShowAlternativeAnswersToggle();
|
|
121
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectAnswerSectionWithAlternateAnswer([
|
|
122
|
+
{
|
|
123
|
+
correctAnswers: [['Flower'],['Leaf'],['Stem']],
|
|
124
|
+
points: ['(15 points)', '(6 points)', '(5 points)', '(4 points)'],
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
correctAnswers: [['Petal'],['Leaves'],['Stem']],
|
|
128
|
+
points: ['(15 points)', '(7 points)', '(5 points)', '(3 points)'],
|
|
129
|
+
}
|
|
130
|
+
]);
|
|
131
|
+
} else {
|
|
132
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(correctAnswerArray);
|
|
133
|
+
}
|
|
96
134
|
fillInTheGapsDropdownPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
|
97
135
|
/*cy.log('When the user has attempted the question with partially correct options exclusively from the correct accordion and clicks on \'Check answer\' button, then correct icon should be displayed besides the correct dropdowns, correct/incorrect status message and correct answer section should not be displayed')
|
|
98
136
|
fillInTheGapsDropdownPage.steps.checkAnswer();
|
|
@@ -113,7 +151,25 @@ describe('Create item page - Fill in the gaps with dropdown: Partial different w
|
|
|
113
151
|
fillInTheGapsDropdownPage.steps.verifyIncorrectOptionIcon(1);
|
|
114
152
|
fillInTheGapsDropdownPage.steps.verifyIncorrectOptionIcon(2);
|
|
115
153
|
fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
|
|
116
|
-
|
|
154
|
+
if (alternativeAnswerCheck) {
|
|
155
|
+
showAlternativeAnswersComponent.steps.verifyShowAlternativeAnswersToggleExists();
|
|
156
|
+
showAlternativeAnswersComponent.steps.disableShowAlternativeAnswersToggle();
|
|
157
|
+
showAlternativeAnswersComponent.steps.verifyShowAlternativeAnswersToggleUnchecked();
|
|
158
|
+
fillInTheGapsDropdownPage.steps.verifyAlternativeAnswersSectionNotExist();
|
|
159
|
+
showAlternativeAnswersComponent.steps.clickShowAlternativeAnswersToggle();
|
|
160
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectAnswerSectionWithAlternateAnswer([
|
|
161
|
+
{
|
|
162
|
+
correctAnswers: [['Flower'],['Leaf'],['Stem']],
|
|
163
|
+
points: ['(15 points)', '(6 points)', '(5 points)', '(4 points)'],
|
|
164
|
+
},
|
|
165
|
+
{
|
|
166
|
+
correctAnswers: [['Petal'],['Leaves'],['Stem']],
|
|
167
|
+
points: ['(15 points)', '(7 points)', '(5 points)', '(3 points)'],
|
|
168
|
+
}
|
|
169
|
+
]);
|
|
170
|
+
} else {
|
|
171
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(correctAnswerArray);
|
|
172
|
+
}
|
|
117
173
|
fillInTheGapsDropdownPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
|
118
174
|
/*cy.log('When the user has attempted the question with partially correct options exclusively from the alternative accordion and clicks on \'Check answer\' button, then correct icon should be displayed besides the correct dropdowns, no icon should be displayed beside unattempted dropdown, correct/incorrect status message and correct answer section should not be displayed')
|
|
119
175
|
fillInTheGapsDropdownPage.steps.checkAnswer();
|
|
@@ -133,7 +189,25 @@ describe('Create item page - Fill in the gaps with dropdown: Partial different w
|
|
|
133
189
|
fillInTheGapsDropdownPage.steps.verifyIncorrectOptionIcon(1);
|
|
134
190
|
fillInTheGapsDropdownPage.steps.verifyIncorrectOptionIcon(2);
|
|
135
191
|
fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
|
|
136
|
-
|
|
192
|
+
if (alternativeAnswerCheck) {
|
|
193
|
+
showAlternativeAnswersComponent.steps.verifyShowAlternativeAnswersToggleExists();
|
|
194
|
+
showAlternativeAnswersComponent.steps.disableShowAlternativeAnswersToggle();
|
|
195
|
+
showAlternativeAnswersComponent.steps.verifyShowAlternativeAnswersToggleUnchecked();
|
|
196
|
+
fillInTheGapsDropdownPage.steps.verifyAlternativeAnswersSectionNotExist();
|
|
197
|
+
showAlternativeAnswersComponent.steps.clickShowAlternativeAnswersToggle();
|
|
198
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectAnswerSectionWithAlternateAnswer([
|
|
199
|
+
{
|
|
200
|
+
correctAnswers: [['Flower'],['Leaf'],['Stem']],
|
|
201
|
+
points: ['(15 points)', '(6 points)', '(5 points)', '(4 points)'],
|
|
202
|
+
},
|
|
203
|
+
{
|
|
204
|
+
correctAnswers: [['Petal'],['Leaves'],['Stem']],
|
|
205
|
+
points: ['(15 points)', '(7 points)', '(5 points)', '(3 points)'],
|
|
206
|
+
}
|
|
207
|
+
]);
|
|
208
|
+
} else {
|
|
209
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(correctAnswerArray);
|
|
210
|
+
}
|
|
137
211
|
fillInTheGapsDropdownPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
|
138
212
|
/*cy.log('When the user has attempted the question with equal number of correct responses from correct and alternative accordion and clicks on \'Check answer\' button, then correct icon should be displayed besides the correct dropdowns, incorrect icon should be displayed beside responses from the alternative accordion, correct/incorrect status message and correct answer section should not be displayed')
|
|
139
213
|
fillInTheGapsDropdownPage.steps.checkAnswer();
|
|
@@ -153,7 +227,25 @@ describe('Create item page - Fill in the gaps with dropdown: Partial different w
|
|
|
153
227
|
fillInTheGapsDropdownPage.steps.verifyIncorrectOptionIcon(1);
|
|
154
228
|
fillInTheGapsDropdownPage.steps.verifyIncorrectOptionIcon(2);
|
|
155
229
|
fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
|
|
156
|
-
|
|
230
|
+
if (alternativeAnswerCheck) {
|
|
231
|
+
showAlternativeAnswersComponent.steps.verifyShowAlternativeAnswersToggleExists();
|
|
232
|
+
showAlternativeAnswersComponent.steps.disableShowAlternativeAnswersToggle();
|
|
233
|
+
showAlternativeAnswersComponent.steps.verifyShowAlternativeAnswersToggleUnchecked();
|
|
234
|
+
fillInTheGapsDropdownPage.steps.verifyAlternativeAnswersSectionNotExist();
|
|
235
|
+
showAlternativeAnswersComponent.steps.clickShowAlternativeAnswersToggle();
|
|
236
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectAnswerSectionWithAlternateAnswer([
|
|
237
|
+
{
|
|
238
|
+
correctAnswers: [['Flower'],['Leaf'],['Stem']],
|
|
239
|
+
points: ['(15 points)', '(6 points)', '(5 points)', '(4 points)'],
|
|
240
|
+
},
|
|
241
|
+
{
|
|
242
|
+
correctAnswers: [['Petal'],['Leaves'],['Stem']],
|
|
243
|
+
points: ['(15 points)', '(7 points)', '(5 points)', '(3 points)'],
|
|
244
|
+
}
|
|
245
|
+
]);
|
|
246
|
+
} else {
|
|
247
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(correctAnswerArray);
|
|
248
|
+
}
|
|
157
249
|
fillInTheGapsDropdownPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
|
158
250
|
/*cy.log('When the user has attempted the question with equal number of correct responses from correct and alternative accordion and clicks on \'Check answer\' button, then correct icon should be displayed besides the alternative responses, incorrect icon should be displayed beside correct accordion responses, correct/incorrect status message and correct answer section should not be displayed')
|
|
159
251
|
fillInTheGapsDropdownPage.steps.checkAnswer();
|
|
@@ -173,7 +265,25 @@ describe('Create item page - Fill in the gaps with dropdown: Partial different w
|
|
|
173
265
|
fillInTheGapsDropdownPage.steps.verifyIncorrectOptionIcon(1);
|
|
174
266
|
fillInTheGapsDropdownPage.steps.verifyCorrectOptionIcon(2);
|
|
175
267
|
fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
|
|
176
|
-
|
|
268
|
+
if (alternativeAnswerCheck) {
|
|
269
|
+
showAlternativeAnswersComponent.steps.verifyShowAlternativeAnswersToggleExists();
|
|
270
|
+
showAlternativeAnswersComponent.steps.disableShowAlternativeAnswersToggle();
|
|
271
|
+
showAlternativeAnswersComponent.steps.verifyShowAlternativeAnswersToggleUnchecked();
|
|
272
|
+
fillInTheGapsDropdownPage.steps.verifyAlternativeAnswersSectionNotExist();
|
|
273
|
+
showAlternativeAnswersComponent.steps.clickShowAlternativeAnswersToggle();
|
|
274
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectAnswerSectionWithAlternateAnswer([
|
|
275
|
+
{
|
|
276
|
+
correctAnswers: [['Flower'],['Leaf'],['Stem']],
|
|
277
|
+
points: ['(15 points)', '(6 points)', '(5 points)', '(4 points)'],
|
|
278
|
+
},
|
|
279
|
+
{
|
|
280
|
+
correctAnswers: [['Petal'],['Leaves'],['Stem']],
|
|
281
|
+
points: ['(15 points)', '(7 points)', '(5 points)', '(3 points)'],
|
|
282
|
+
}
|
|
283
|
+
]);
|
|
284
|
+
} else {
|
|
285
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(correctAnswerArray);
|
|
286
|
+
}
|
|
177
287
|
fillInTheGapsDropdownPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
|
178
288
|
/*cy.log('When the user has attempted the question with common response between correct and alternative accordion and clicks on \'Check answer\' button, then correct icon should be displayed besides the correct dropdowns, no icon should be displayed beside unattempted dropdown, correct/incorrect status message and correct answer section should not be displayed')
|
|
179
289
|
fillInTheGapsDropdownPage.steps.checkAnswer();
|
|
@@ -193,7 +303,25 @@ describe('Create item page - Fill in the gaps with dropdown: Partial different w
|
|
|
193
303
|
fillInTheGapsDropdownPage.steps.verifyIncorrectOptionIcon(1);
|
|
194
304
|
fillInTheGapsDropdownPage.steps.verifyIncorrectOptionIcon(2);
|
|
195
305
|
fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
|
|
196
|
-
|
|
306
|
+
if (alternativeAnswerCheck) {
|
|
307
|
+
showAlternativeAnswersComponent.steps.verifyShowAlternativeAnswersToggleExists();
|
|
308
|
+
showAlternativeAnswersComponent.steps.disableShowAlternativeAnswersToggle();
|
|
309
|
+
showAlternativeAnswersComponent.steps.verifyShowAlternativeAnswersToggleUnchecked();
|
|
310
|
+
fillInTheGapsDropdownPage.steps.verifyAlternativeAnswersSectionNotExist();
|
|
311
|
+
showAlternativeAnswersComponent.steps.clickShowAlternativeAnswersToggle();
|
|
312
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectAnswerSectionWithAlternateAnswer([
|
|
313
|
+
{
|
|
314
|
+
correctAnswers: [['Flower'],['Leaf'],['Stem']],
|
|
315
|
+
points: ['(15 points)', '(6 points)', '(5 points)', '(4 points)'],
|
|
316
|
+
},
|
|
317
|
+
{
|
|
318
|
+
correctAnswers: [['Petal'],['Leaves'],['Stem']],
|
|
319
|
+
points: ['(15 points)', '(7 points)', '(5 points)', '(3 points)'],
|
|
320
|
+
}
|
|
321
|
+
]);
|
|
322
|
+
} else {
|
|
323
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(correctAnswerArray);
|
|
324
|
+
}
|
|
197
325
|
fillInTheGapsDropdownPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
|
198
326
|
/*cy.log('When the user has attempted the question incorrectly and clicks on \'Check answer\' button, then incorrect icon should be displayed besides all incorrect dropdowns, no icon should be displayed beside unattempted dropdown, correct/incorrect status message and correct answer section should not be displayed')
|
|
199
327
|
fillInTheGapsDropdownPage.steps.checkAnswer();
|
|
@@ -219,7 +347,25 @@ describe('Create item page - Fill in the gaps with dropdown: Partial different w
|
|
|
219
347
|
fillInTheGapsDropdownPage.steps.verifyIncorrectOptionIcon(1);
|
|
220
348
|
fillInTheGapsDropdownPage.steps.verifyCorrectOptionIcon(2);
|
|
221
349
|
fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
|
|
222
|
-
|
|
350
|
+
if (alternativeAnswerCheck) {
|
|
351
|
+
showAlternativeAnswersComponent.steps.verifyShowAlternativeAnswersToggleExists();
|
|
352
|
+
showAlternativeAnswersComponent.steps.disableShowAlternativeAnswersToggle();
|
|
353
|
+
showAlternativeAnswersComponent.steps.verifyShowAlternativeAnswersToggleUnchecked();
|
|
354
|
+
fillInTheGapsDropdownPage.steps.verifyAlternativeAnswersSectionNotExist();
|
|
355
|
+
showAlternativeAnswersComponent.steps.clickShowAlternativeAnswersToggle();
|
|
356
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectAnswerSectionWithAlternateAnswer([
|
|
357
|
+
{
|
|
358
|
+
correctAnswers: [['Flower'],['Leaf'],['Stem']],
|
|
359
|
+
points: ['(15 points)', '(1.2 points)', '(1.2 points)', '(12.6 points)'],
|
|
360
|
+
},
|
|
361
|
+
{
|
|
362
|
+
correctAnswers: [['Petal'],['Leaves'],['Roots']],
|
|
363
|
+
points: ['(15 points)', '(4.1 points)', '(5.4 points)', '(5.5 points)'],
|
|
364
|
+
}
|
|
365
|
+
]);
|
|
366
|
+
} else {
|
|
367
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(correctAnswerArray);
|
|
368
|
+
}
|
|
223
369
|
fillInTheGapsDropdownPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
|
224
370
|
/*cy.log('When the user attempts the question with more number of correct responses from the alternative accordion than the correct accordion but the score of the individual response selected from the correct accordion overpowers the combined score of the alternative accordion answers and clicks on \'Check answer\' button, then correct icons should be displayed for the correct accordion response, incorrect icon should be displayed for the alternative accordion responses, correct/incorrect status message and correct answer section should not be displayed')
|
|
225
371
|
fillInTheGapsDropdownPage.steps.checkAnswer();
|