itemengine-cypress-automation 1.0.579-IEI-7193-main-6a7df51.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/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/dataApi/fetchQuestion.js +0 -39
- package/cypress/e2e/ILC/dataApi/saveQuestions.js +0 -53
- package/cypress/pages/fillInTheGapsDropdownPage.js +47 -2
- 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 correct 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: [['Flower'],['Leaf'],['Stem']],
|
|
53
|
+
points: ['(15 points)', '(6 points)', '(4 points)', '(5 points)'],
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
correctAnswers: [['Petal'],['Leaves'],['Stem']],
|
|
57
|
+
points: ['(13 points)', '(7 points)', '(1 point)', '(5 points)'],
|
|
58
|
+
}
|
|
59
|
+
]);
|
|
60
|
+
} else {
|
|
61
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(correctAnswerArray);
|
|
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 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', () => {
|
|
@@ -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: [['Flower'],['Leaf'],['Stem']],
|
|
123
|
+
points: ['(15 points)', '(6 points)', '(4 points)', '(5 points)'],
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
correctAnswers: [['Petal'],['Leaves'],['Stem']],
|
|
127
|
+
points: ['(13 points)', '(7 points)', '(1 point)', '(5 points)'],
|
|
128
|
+
}
|
|
129
|
+
]);
|
|
130
|
+
} else {
|
|
131
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(correctAnswerArray);
|
|
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, correct/incorrect 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: [['Flower'],['Leaf'],['Stem']],
|
|
161
|
+
points: ['(15 points)', '(6 points)', '(4 points)', '(5 points)'],
|
|
162
|
+
},
|
|
163
|
+
{
|
|
164
|
+
correctAnswers: [['Petal'],['Leaves'],['Stem']],
|
|
165
|
+
points: ['(13 points)', '(7 points)', '(1 point)', '(5 points)'],
|
|
166
|
+
}
|
|
167
|
+
]);
|
|
168
|
+
} else {
|
|
169
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(correctAnswerArray);
|
|
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, correct/incorrect 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: [['Flower'],['Leaf'],['Stem']],
|
|
199
|
+
points: ['(15 points)', '(6 points)', '(4 points)', '(5 points)'],
|
|
200
|
+
},
|
|
201
|
+
{
|
|
202
|
+
correctAnswers: [['Petal'],['Leaves'],['Stem']],
|
|
203
|
+
points: ['(13 points)', '(7 points)', '(1 point)', '(5 points)'],
|
|
204
|
+
}
|
|
205
|
+
]);
|
|
206
|
+
} else {
|
|
207
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(correctAnswerArray);
|
|
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 icon should be displayed besides dropdown with alternative answer responses, incorrect icon should be displayed beside responses from the correct accordion, correct/incorrect 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: [['Flower'],['Leaf'],['Stem']],
|
|
237
|
+
points: ['(15 points)', '(6 points)', '(4 points)', '(5 points)'],
|
|
238
|
+
},
|
|
239
|
+
{
|
|
240
|
+
correctAnswers: [['Petal'],['Leaves'],['Stem']],
|
|
241
|
+
points: ['(13 points)', '(7 points)', '(1 point)', '(5 points)'],
|
|
242
|
+
}
|
|
243
|
+
]);
|
|
244
|
+
} else {
|
|
245
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(correctAnswerArray);
|
|
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 dropdown with correct accordion response, incorrect icon should be displayed beside responses from the alternative accordion, correct/incorrect 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: [['Flower'],['Leaf'],['Stem']],
|
|
275
|
+
points: ['(15 points)', '(6 points)', '(4 points)', '(5 points)'],
|
|
276
|
+
},
|
|
277
|
+
{
|
|
278
|
+
correctAnswers: [['Petal'],['Leaves'],['Stem']],
|
|
279
|
+
points: ['(13 points)', '(7 points)', '(1 point)', '(5 points)'],
|
|
280
|
+
}
|
|
281
|
+
]);
|
|
282
|
+
} else {
|
|
283
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(correctAnswerArray);
|
|
284
|
+
}
|
|
175
285
|
fillInTheGapsDropdownPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
|
176
286
|
/*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')
|
|
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: [['Flower'],['Leaf'],['Stem']],
|
|
313
|
+
points: ['(15 points)', '(6 points)', '(4 points)', '(5 points)'],
|
|
314
|
+
},
|
|
315
|
+
{
|
|
316
|
+
correctAnswers: [['Petal'],['Leaves'],['Stem']],
|
|
317
|
+
points: ['(13 points)', '(7 points)', '(1 point)', '(5 points)'],
|
|
318
|
+
}
|
|
319
|
+
]);
|
|
320
|
+
} else {
|
|
321
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(correctAnswerArray);
|
|
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 correct/incorrect 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: [['Flower'],['Leaf'],['Stem']],
|
|
357
|
+
points: ['(23 points)', '(11.4 points)', '(1.2 points)', '(10.4 points)'],
|
|
358
|
+
},
|
|
359
|
+
{
|
|
360
|
+
correctAnswers: [['Petal'],['Leaves'],['Roots']],
|
|
361
|
+
points: ['(5 points)', '(1.2 points)', '(2.2 points)', '(1.6 points)'],
|
|
362
|
+
}
|
|
363
|
+
]);
|
|
364
|
+
} else {
|
|
365
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(correctAnswerArray);
|
|
366
|
+
}
|
|
221
367
|
fillInTheGapsDropdownPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
|
222
368
|
/*cy.log('When user attempts the question correctly and clicks on the \'Check answer\' button, correct icon icons should be displayed beside the correct responses from the correct accordion, incorrect icons should be displayed beside the incorrectly answered dropdowns, correct/incorrect status message and correct answer section should not be displayed')
|
|
223
369
|
fillInTheGapsDropdownPage.steps.checkAnswer();
|
|
@@ -2,6 +2,7 @@ import { fillInTheGapsDropdownPage } from "../../../../pages";
|
|
|
2
2
|
import abortEarlySetup from "../../../../support/helpers/abortEarly";
|
|
3
3
|
import utilities from "../../../../support/helpers/utilities";
|
|
4
4
|
const css = Cypress.env('css');
|
|
5
|
+
import { showAlternativeAnswersComponent } from "../../../../pages/components";
|
|
5
6
|
|
|
6
7
|
const optionsForDropdown1 = ['Flower', 'Petal', 'Stem', 'Branch'];
|
|
7
8
|
const optionsForDropdown2 = ['Leaf', 'Leaves', 'Stem', 'Seed'];
|
|
@@ -9,6 +10,7 @@ const optionsForDropdown3 = ['Flower', 'Leaf', 'Stem', 'Roots']; //Common answe
|
|
|
9
10
|
const correctAnswerArray = ['Flower', 'Leaf', 'Stem'];
|
|
10
11
|
const alternateAnswerArray = ['Petal', 'Leaves', 'Stem'];
|
|
11
12
|
const incorrectAnswerArray = ['Branch', 'Seed', 'Roots'];
|
|
13
|
+
const alternativeAnswerCheck = Cypress.env('ENABLE_ALTERNATIVE_ANSWER_ENHANCEMENT') === 'true';
|
|
12
14
|
|
|
13
15
|
describe('Create item page - Fill in the gaps with dropdown: Partial equal weights with alternative answers', () => {
|
|
14
16
|
before(() => {
|
|
@@ -41,7 +43,25 @@ describe('Create item page - Fill in the gaps with dropdown: Partial equal weigh
|
|
|
41
43
|
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', () => {
|
|
42
44
|
fillInTheGapsDropdownPage.steps.switchToGradingView();
|
|
43
45
|
fillInTheGapsDropdownPage.steps.verifyDropdownNumerationPreviewTab();
|
|
44
|
-
|
|
46
|
+
if (alternativeAnswerCheck) {
|
|
47
|
+
showAlternativeAnswersComponent.steps.verifyShowAlternativeAnswersToggleExists();
|
|
48
|
+
showAlternativeAnswersComponent.steps.disableShowAlternativeAnswersToggle();
|
|
49
|
+
showAlternativeAnswersComponent.steps.verifyShowAlternativeAnswersToggleUnchecked();
|
|
50
|
+
fillInTheGapsDropdownPage.steps.verifyAlternativeAnswersSectionNotExist();
|
|
51
|
+
showAlternativeAnswersComponent.steps.clickShowAlternativeAnswersToggle();
|
|
52
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectAnswerSectionWithAlternateAnswer([
|
|
53
|
+
{
|
|
54
|
+
correctAnswers: [['Petal'],['Leaves'],['Stem']],
|
|
55
|
+
points: ['(15 points)', '(5 points)', '(5 points)', '(5 points)'],
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
correctAnswers: [['Flower'],['Leaf'],['Stem']],
|
|
59
|
+
points: ['(9 points)', '(3 points)', '(3 points)', '(3 points)'],
|
|
60
|
+
}
|
|
61
|
+
]);
|
|
62
|
+
} else {
|
|
63
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(alternateAnswerArray);
|
|
64
|
+
}
|
|
45
65
|
});
|
|
46
66
|
|
|
47
67
|
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, correct/incorrect status message and correct answer section should not be displayed', () => {
|
|
@@ -93,7 +113,25 @@ describe('Create item page - Fill in the gaps with dropdown: Partial equal weigh
|
|
|
93
113
|
fillInTheGapsDropdownPage.steps.verifyIncorrectOptionIcon(1);
|
|
94
114
|
fillInTheGapsDropdownPage.steps.verifyIncorrectOptionIcon(2);
|
|
95
115
|
fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
|
|
96
|
-
|
|
116
|
+
if (alternativeAnswerCheck) {
|
|
117
|
+
showAlternativeAnswersComponent.steps.verifyShowAlternativeAnswersToggleExists();
|
|
118
|
+
showAlternativeAnswersComponent.steps.disableShowAlternativeAnswersToggle();
|
|
119
|
+
showAlternativeAnswersComponent.steps.verifyShowAlternativeAnswersToggleUnchecked();
|
|
120
|
+
fillInTheGapsDropdownPage.steps.verifyAlternativeAnswersSectionNotExist();
|
|
121
|
+
showAlternativeAnswersComponent.steps.clickShowAlternativeAnswersToggle();
|
|
122
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectAnswerSectionWithAlternateAnswer([
|
|
123
|
+
{
|
|
124
|
+
correctAnswers: [['Petal'],['Leaves'],['Stem']],
|
|
125
|
+
points: ['(15 points)', '(5 points)', '(5 points)', '(5 points)'],
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
correctAnswers: [['Flower'],['Leaf'],['Stem']],
|
|
129
|
+
points: ['(9 points)', '(3 points)', '(3 points)', '(3 points)'],
|
|
130
|
+
}
|
|
131
|
+
]);
|
|
132
|
+
} else {
|
|
133
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(alternateAnswerArray);
|
|
134
|
+
}
|
|
97
135
|
fillInTheGapsDropdownPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
|
98
136
|
/*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 should not be displayed and correct answer section should not be displayed')
|
|
99
137
|
fillInTheGapsDropdownPage.steps.checkAnswer();
|
|
@@ -113,7 +151,25 @@ describe('Create item page - Fill in the gaps with dropdown: Partial equal weigh
|
|
|
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: [['Petal'],['Leaves'],['Stem']],
|
|
163
|
+
points: ['(15 points)', '(5 points)', '(5 points)', '(5 points)'],
|
|
164
|
+
},
|
|
165
|
+
{
|
|
166
|
+
correctAnswers: [['Flower'],['Leaf'],['Stem']],
|
|
167
|
+
points: ['(9 points)', '(3 points)', '(3 points)', '(3 points)'],
|
|
168
|
+
}
|
|
169
|
+
]);
|
|
170
|
+
} else {
|
|
171
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(alternateAnswerArray);
|
|
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 should not be displayed 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 equal weigh
|
|
|
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: [['Petal'],['Leaves'],['Stem']],
|
|
201
|
+
points: ['(15 points)', '(5 points)', '(5 points)', '(5 points)'],
|
|
202
|
+
},
|
|
203
|
+
{
|
|
204
|
+
correctAnswers: [['Flower'],['Leaf'],['Stem']],
|
|
205
|
+
points: ['(9 points)', '(3 points)', '(3 points)', '(3 points)'],
|
|
206
|
+
}
|
|
207
|
+
]);
|
|
208
|
+
} else {
|
|
209
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(alternateAnswerArray);
|
|
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 alternate accordion responses, incorrect icon should be displayed beside correct accordion responses, correct/incorrect status message should not be displayed 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 equal weigh
|
|
|
153
227
|
fillInTheGapsDropdownPage.steps.verifyIncorrectOptionIcon(1);
|
|
154
228
|
fillInTheGapsDropdownPage.steps.verifyCorrectOptionIcon(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: [['Petal'],['Leaves'],['Stem']],
|
|
239
|
+
points: ['(15 points)', '(5 points)', '(5 points)', '(5 points)'],
|
|
240
|
+
},
|
|
241
|
+
{
|
|
242
|
+
correctAnswers: [['Flower'],['Leaf'],['Stem']],
|
|
243
|
+
points: ['(9 points)', '(3 points)', '(3 points)', '(3 points)'],
|
|
244
|
+
}
|
|
245
|
+
]);
|
|
246
|
+
} else {
|
|
247
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(alternateAnswerArray);
|
|
248
|
+
}
|
|
157
249
|
fillInTheGapsDropdownPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
|
158
250
|
/*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 should not be displayed 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 equal weigh
|
|
|
173
265
|
fillInTheGapsDropdownPage.steps.verifyIncorrectOptionIcon(1);
|
|
174
266
|
fillInTheGapsDropdownPage.steps.verifyIncorrectOptionIcon(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: [['Petal'],['Leaves'],['Stem']],
|
|
277
|
+
points: ['(15 points)', '(5 points)', '(5 points)', '(5 points)'],
|
|
278
|
+
},
|
|
279
|
+
{
|
|
280
|
+
correctAnswers: [['Flower'],['Leaf'],['Stem']],
|
|
281
|
+
points: ['(9 points)', '(3 points)', '(3 points)', '(3 points)'],
|
|
282
|
+
}
|
|
283
|
+
]);
|
|
284
|
+
} else {
|
|
285
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(alternateAnswerArray);
|
|
286
|
+
}
|
|
177
287
|
fillInTheGapsDropdownPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
|
178
288
|
/*cy.log('When the user has attempted the question incorrectly and clicks on \'Check answer\' button, then incorrect icons should be displayed besides all incorrect dropdowns, no icon should be displayed beside unattempted dropdown, correct/incorrect status message should not be displayed and correct answer section should not be displayed')
|
|
179
289
|
fillInTheGapsDropdownPage.steps.checkAnswer();
|
|
@@ -199,7 +309,25 @@ describe('Create item page - Fill in the gaps with dropdown: Partial equal weigh
|
|
|
199
309
|
fillInTheGapsDropdownPage.steps.verifyIncorrectOptionIcon(1);
|
|
200
310
|
fillInTheGapsDropdownPage.steps.verifyCorrectOptionIcon(2);
|
|
201
311
|
fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
|
|
202
|
-
|
|
312
|
+
if (alternativeAnswerCheck) {
|
|
313
|
+
showAlternativeAnswersComponent.steps.verifyShowAlternativeAnswersToggleExists();
|
|
314
|
+
showAlternativeAnswersComponent.steps.disableShowAlternativeAnswersToggle();
|
|
315
|
+
showAlternativeAnswersComponent.steps.verifyShowAlternativeAnswersToggleUnchecked();
|
|
316
|
+
fillInTheGapsDropdownPage.steps.verifyAlternativeAnswersSectionNotExist();
|
|
317
|
+
showAlternativeAnswersComponent.steps.clickShowAlternativeAnswersToggle();
|
|
318
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectAnswerSectionWithAlternateAnswer([
|
|
319
|
+
{
|
|
320
|
+
correctAnswers: [['Petal'],['Leaves'],['Stem']],
|
|
321
|
+
points: ['(23 points)', '(7.67 points)', '(7.67 points)', '(7.67 points)'],
|
|
322
|
+
},
|
|
323
|
+
{
|
|
324
|
+
correctAnswers: [['Flower'],['Leaf'],['Roots']],
|
|
325
|
+
points: ['(5 points)', '(1.67 points)', '(1.67 points)', '(1.67 points)'],
|
|
326
|
+
}
|
|
327
|
+
]);
|
|
328
|
+
} else {
|
|
329
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(alternateAnswerArray);
|
|
330
|
+
}
|
|
203
331
|
fillInTheGapsDropdownPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
|
204
332
|
/*cy.log('When the user attempts the question with more number of correct responses from the alternative accordion than the correct accordion and clicks on the \'Check answer\' button, correct icons should be displayed for the dropdown with alternative accordion response, incorrect icon should be displayed for the dropdown with correct accordion responses, correct/incorrect answer status message, correct answer container should not be displayed')
|
|
205
333
|
fillInTheGapsDropdownPage.steps.checkAnswer();
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { fillInTheGapsDropdownPage } from "../../../../pages";
|
|
2
|
-
import { commonComponents } from "../../../../pages/components";
|
|
2
|
+
import { commonComponents, showAlternativeAnswersComponent } from "../../../../pages/components";
|
|
3
3
|
import abortEarlySetup from "../../../../support/helpers/abortEarly";
|
|
4
4
|
import utilities from "../../../../support/helpers/utilities";
|
|
5
5
|
const css = Cypress.env('css');
|
|
@@ -10,6 +10,7 @@ const optionsForDropdown3 = ['Flower', 'Leaf', 'Stem', 'Roots']; //Common answe
|
|
|
10
10
|
const correctAnswerArray = ['Flower', 'Leaf', 'Stem'];
|
|
11
11
|
const alternateAnswerArray = ['Petal', 'Leaves', 'Stem'];
|
|
12
12
|
const incorrectAnswerArray = ['Branch', 'Seed', 'Roots'];
|
|
13
|
+
const alternativeAnswerCheck = Cypress.env('ENABLE_ALTERNATIVE_ANSWER_ENHANCEMENT') === 'true';
|
|
13
14
|
|
|
14
15
|
describe('Create item page - Fill in the gaps with dropdown: Partial equal with alternative answers', () => {
|
|
15
16
|
before(() => {
|
|
@@ -42,7 +43,25 @@ describe('Create item page - Fill in the gaps with dropdown: Partial equal with
|
|
|
42
43
|
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 correct accordion and respective dropdown numeration', () => {
|
|
43
44
|
fillInTheGapsDropdownPage.steps.switchToGradingView();
|
|
44
45
|
fillInTheGapsDropdownPage.steps.verifyDropdownNumerationPreviewTab();
|
|
45
|
-
|
|
46
|
+
if (alternativeAnswerCheck) {
|
|
47
|
+
showAlternativeAnswersComponent.steps.verifyShowAlternativeAnswersToggleExists();
|
|
48
|
+
showAlternativeAnswersComponent.steps.disableShowAlternativeAnswersToggle();
|
|
49
|
+
showAlternativeAnswersComponent.steps.verifyShowAlternativeAnswersToggleUnchecked();
|
|
50
|
+
fillInTheGapsDropdownPage.steps.verifyAlternativeAnswersSectionNotExist();
|
|
51
|
+
showAlternativeAnswersComponent.steps.clickShowAlternativeAnswersToggle();
|
|
52
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectAnswerSectionWithAlternateAnswer([
|
|
53
|
+
{
|
|
54
|
+
correctAnswers: [['Flower'],['Leaf'],['Stem']],
|
|
55
|
+
points: ['(15 points)', '(5 points)', '(5 points)', '(5 points)'],
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
correctAnswers: [['Petal'],['Leaves'],['Stem']],
|
|
59
|
+
points: ['(15 points)', '(5 points)', '(5 points)', '(5 points)'],
|
|
60
|
+
}
|
|
61
|
+
]);
|
|
62
|
+
} else {
|
|
63
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(correctAnswerArray);
|
|
64
|
+
}
|
|
46
65
|
});
|
|
47
66
|
|
|
48
67
|
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', () => {
|
|
@@ -94,7 +113,25 @@ describe('Create item page - Fill in the gaps with dropdown: Partial equal with
|
|
|
94
113
|
fillInTheGapsDropdownPage.steps.verifyIncorrectOptionIcon(1);
|
|
95
114
|
fillInTheGapsDropdownPage.steps.verifyIncorrectOptionIcon(2);
|
|
96
115
|
fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
|
|
97
|
-
|
|
116
|
+
if (alternativeAnswerCheck) {
|
|
117
|
+
showAlternativeAnswersComponent.steps.verifyShowAlternativeAnswersToggleExists();
|
|
118
|
+
showAlternativeAnswersComponent.steps.disableShowAlternativeAnswersToggle();
|
|
119
|
+
showAlternativeAnswersComponent.steps.verifyShowAlternativeAnswersToggleUnchecked();
|
|
120
|
+
fillInTheGapsDropdownPage.steps.verifyAlternativeAnswersSectionNotExist();
|
|
121
|
+
showAlternativeAnswersComponent.steps.clickShowAlternativeAnswersToggle();
|
|
122
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectAnswerSectionWithAlternateAnswer([
|
|
123
|
+
{
|
|
124
|
+
correctAnswers: [['Flower'],['Leaf'],['Stem']],
|
|
125
|
+
points: ['(15 points)', '(5 points)', '(5 points)', '(5 points)'],
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
correctAnswers: [['Petal'],['Leaves'],['Stem']],
|
|
129
|
+
points: ['(15 points)', '(5 points)', '(5 points)', '(5 points)'],
|
|
130
|
+
}
|
|
131
|
+
]);
|
|
132
|
+
} else {
|
|
133
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(correctAnswerArray);
|
|
134
|
+
}
|
|
98
135
|
fillInTheGapsDropdownPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
|
99
136
|
/*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')
|
|
100
137
|
fillInTheGapsDropdownPage.steps.checkAnswer();
|
|
@@ -115,7 +152,25 @@ describe('Create item page - Fill in the gaps with dropdown: Partial equal with
|
|
|
115
152
|
fillInTheGapsDropdownPage.steps.verifyIncorrectOptionIcon(1);
|
|
116
153
|
fillInTheGapsDropdownPage.steps.verifyIncorrectOptionIcon(2);
|
|
117
154
|
fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
|
|
118
|
-
|
|
155
|
+
if (alternativeAnswerCheck) {
|
|
156
|
+
showAlternativeAnswersComponent.steps.verifyShowAlternativeAnswersToggleExists();
|
|
157
|
+
showAlternativeAnswersComponent.steps.disableShowAlternativeAnswersToggle();
|
|
158
|
+
showAlternativeAnswersComponent.steps.verifyShowAlternativeAnswersToggleUnchecked();
|
|
159
|
+
fillInTheGapsDropdownPage.steps.verifyAlternativeAnswersSectionNotExist();
|
|
160
|
+
showAlternativeAnswersComponent.steps.clickShowAlternativeAnswersToggle();
|
|
161
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectAnswerSectionWithAlternateAnswer([
|
|
162
|
+
{
|
|
163
|
+
correctAnswers: [['Flower'],['Leaf'],['Stem']],
|
|
164
|
+
points: ['(15 points)', '(5 points)', '(5 points)', '(5 points)'],
|
|
165
|
+
},
|
|
166
|
+
{
|
|
167
|
+
correctAnswers: [['Petal'],['Leaves'],['Stem']],
|
|
168
|
+
points: ['(15 points)', '(5 points)', '(5 points)', '(5 points)'],
|
|
169
|
+
}
|
|
170
|
+
]);
|
|
171
|
+
} else {
|
|
172
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(correctAnswerArray);
|
|
173
|
+
}
|
|
119
174
|
fillInTheGapsDropdownPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
|
120
175
|
/*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')
|
|
121
176
|
fillInTheGapsDropdownPage.steps.checkAnswer();
|
|
@@ -134,7 +189,25 @@ describe('Create item page - Fill in the gaps with dropdown: Partial equal with
|
|
|
134
189
|
fillInTheGapsDropdownPage.steps.verifyCorrectOptionIcon(0);
|
|
135
190
|
fillInTheGapsDropdownPage.steps.verifyIncorrectOptionIcon(1);
|
|
136
191
|
fillInTheGapsDropdownPage.steps.verifyIncorrectOptionIcon(2);
|
|
137
|
-
|
|
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)', '(5 points)', '(5 points)', '(5 points)'],
|
|
202
|
+
},
|
|
203
|
+
{
|
|
204
|
+
correctAnswers: [['Petal'],['Leaves'],['Stem']],
|
|
205
|
+
points: ['(15 points)', '(5 points)', '(5 points)', '(5 points)'],
|
|
206
|
+
}
|
|
207
|
+
]);
|
|
208
|
+
} else {
|
|
209
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(correctAnswerArray);
|
|
210
|
+
}
|
|
138
211
|
fillInTheGapsDropdownPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
|
139
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 dropdown with correct accordion response, incorrect icon should be displayed beside dropdown with the alternative accordion response, correct/incorrect status message and correct answer section should not be displayed')
|
|
140
213
|
fillInTheGapsDropdownPage.steps.checkAnswer();
|
|
@@ -153,7 +226,25 @@ describe('Create item page - Fill in the gaps with dropdown: Partial equal with
|
|
|
153
226
|
fillInTheGapsDropdownPage.steps.verifyIncorrectOptionIcon(1);
|
|
154
227
|
fillInTheGapsDropdownPage.steps.verifyCorrectOptionIcon(2);
|
|
155
228
|
fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
|
|
156
|
-
|
|
229
|
+
if (alternativeAnswerCheck) {
|
|
230
|
+
showAlternativeAnswersComponent.steps.verifyShowAlternativeAnswersToggleExists();
|
|
231
|
+
showAlternativeAnswersComponent.steps.disableShowAlternativeAnswersToggle();
|
|
232
|
+
showAlternativeAnswersComponent.steps.verifyShowAlternativeAnswersToggleUnchecked();
|
|
233
|
+
fillInTheGapsDropdownPage.steps.verifyAlternativeAnswersSectionNotExist();
|
|
234
|
+
showAlternativeAnswersComponent.steps.clickShowAlternativeAnswersToggle();
|
|
235
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectAnswerSectionWithAlternateAnswer([
|
|
236
|
+
{
|
|
237
|
+
correctAnswers: [['Flower'],['Leaf'],['Stem']],
|
|
238
|
+
points: ['(15 points)', '(5 points)', '(5 points)', '(5 points)'],
|
|
239
|
+
},
|
|
240
|
+
{
|
|
241
|
+
correctAnswers: [['Petal'],['Leaves'],['Stem']],
|
|
242
|
+
points: ['(15 points)', '(5 points)', '(5 points)', '(5 points)'],
|
|
243
|
+
}
|
|
244
|
+
]);
|
|
245
|
+
} else {
|
|
246
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(correctAnswerArray);
|
|
247
|
+
}
|
|
157
248
|
fillInTheGapsDropdownPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
|
158
249
|
/*cy.log('When the user has attempted the question with the common response between 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, correct/incorrect status message and correct answer section should not be displayed')
|
|
159
250
|
fillInTheGapsDropdownPage.steps.checkAnswer();
|
|
@@ -173,7 +264,25 @@ describe('Create item page - Fill in the gaps with dropdown: Partial equal with
|
|
|
173
264
|
fillInTheGapsDropdownPage.steps.verifyIncorrectOptionIcon(1);
|
|
174
265
|
fillInTheGapsDropdownPage.steps.verifyIncorrectOptionIcon(2);
|
|
175
266
|
fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
|
|
176
|
-
|
|
267
|
+
if (alternativeAnswerCheck) {
|
|
268
|
+
showAlternativeAnswersComponent.steps.verifyShowAlternativeAnswersToggleExists();
|
|
269
|
+
showAlternativeAnswersComponent.steps.disableShowAlternativeAnswersToggle();
|
|
270
|
+
showAlternativeAnswersComponent.steps.verifyShowAlternativeAnswersToggleUnchecked();
|
|
271
|
+
fillInTheGapsDropdownPage.steps.verifyAlternativeAnswersSectionNotExist();
|
|
272
|
+
showAlternativeAnswersComponent.steps.clickShowAlternativeAnswersToggle();
|
|
273
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectAnswerSectionWithAlternateAnswer([
|
|
274
|
+
{
|
|
275
|
+
correctAnswers: [['Flower'],['Leaf'],['Stem']],
|
|
276
|
+
points: ['(15 points)', '(5 points)', '(5 points)', '(5 points)'],
|
|
277
|
+
},
|
|
278
|
+
{
|
|
279
|
+
correctAnswers: [['Petal'],['Leaves'],['Stem']],
|
|
280
|
+
points: ['(15 points)', '(5 points)', '(5 points)', '(5 points)'],
|
|
281
|
+
}
|
|
282
|
+
]);
|
|
283
|
+
} else {
|
|
284
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(correctAnswerArray);
|
|
285
|
+
}
|
|
177
286
|
fillInTheGapsDropdownPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
|
178
287
|
/*cy.log('When the user has attempted the question incorrectly and clicks on \'Check answer\' button, then incorrect icons 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')
|
|
179
288
|
fillInTheGapsDropdownPage.steps.checkAnswer();
|