itemengine-cypress-automation 1.0.579-IEI-7193-main-6a7df51.0 → 1.0.579
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: All or nothing with alternative answers', () => {
|
|
12
14
|
before(() => {
|
|
@@ -40,7 +42,25 @@ describe('Create item page - Fill in the gaps with dropdown: All or nothing with
|
|
|
40
42
|
fillInTheGapsDropdownPage.steps.switchToGradingView();
|
|
41
43
|
fillInTheGapsDropdownPage.steps.verifyDropdownNumerationPreviewTab();
|
|
42
44
|
fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
|
|
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: [['Petal'],['Leaves'],['Stem']],
|
|
54
|
+
points: ['(20 points)'],
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
correctAnswers: [['Flower'],['Leaf'],['Stem']],
|
|
58
|
+
points: ['(10 points)'],
|
|
59
|
+
}
|
|
60
|
+
]);
|
|
61
|
+
} else {
|
|
62
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(alternateAnswerArray);
|
|
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 with points specified for correct accordion (less than overall points) and on switching to \'Grading\' view, correct icons should be displayed beside all the correct dropdowns, a status message with text \'Your answer is correct\' and correct answer section should not be displayed', () => {
|
|
@@ -92,7 +112,25 @@ describe('Create item page - Fill in the gaps with dropdown: All or nothing with
|
|
|
92
112
|
fillInTheGapsDropdownPage.steps.verifyIncorrectOptionIcon(1);
|
|
93
113
|
fillInTheGapsDropdownPage.steps.verifyIncorrectOptionIcon(2);
|
|
94
114
|
fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
|
|
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: [['Petal'],['Leaves'],['Stem']],
|
|
124
|
+
points: ['(20 points)'],
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
correctAnswers: [['Flower'],['Leaf'],['Stem']],
|
|
128
|
+
points: ['(10 points)'],
|
|
129
|
+
}
|
|
130
|
+
]);
|
|
131
|
+
} else {
|
|
132
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(alternateAnswerArray);
|
|
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 correctly answered dropdowns, no icon should be displayed for unattempted dropdown, a status message with text \'Your answer is incorrect\' and correct answer section should not be displayed')
|
|
98
136
|
fillInTheGapsDropdownPage.steps.checkAnswer();
|
|
@@ -112,7 +150,25 @@ describe('Create item page - Fill in the gaps with dropdown: All or nothing with
|
|
|
112
150
|
fillInTheGapsDropdownPage.steps.verifyIncorrectOptionIcon(1);
|
|
113
151
|
fillInTheGapsDropdownPage.steps.verifyIncorrectOptionIcon(2);
|
|
114
152
|
fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
|
|
115
|
-
|
|
153
|
+
if (alternativeAnswerCheck) {
|
|
154
|
+
showAlternativeAnswersComponent.steps.verifyShowAlternativeAnswersToggleExists();
|
|
155
|
+
showAlternativeAnswersComponent.steps.disableShowAlternativeAnswersToggle();
|
|
156
|
+
showAlternativeAnswersComponent.steps.verifyShowAlternativeAnswersToggleUnchecked();
|
|
157
|
+
fillInTheGapsDropdownPage.steps.verifyAlternativeAnswersSectionNotExist();
|
|
158
|
+
showAlternativeAnswersComponent.steps.clickShowAlternativeAnswersToggle();
|
|
159
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectAnswerSectionWithAlternateAnswer([
|
|
160
|
+
{
|
|
161
|
+
correctAnswers: [['Petal'],['Leaves'],['Stem']],
|
|
162
|
+
points: ['(20 points)'],
|
|
163
|
+
},
|
|
164
|
+
{
|
|
165
|
+
correctAnswers: [['Flower'],['Leaf'],['Stem']],
|
|
166
|
+
points: ['(10 points)'],
|
|
167
|
+
}
|
|
168
|
+
]);
|
|
169
|
+
} else {
|
|
170
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(alternateAnswerArray);
|
|
171
|
+
}
|
|
116
172
|
fillInTheGapsDropdownPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
|
117
173
|
/*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 correctly answered dropdowns, no icon should be displayed for unattempted dropdown, a status message with text \'Your answer is incorrect\' and correct answer section should not be displayed')
|
|
118
174
|
fillInTheGapsDropdownPage.steps.checkAnswer();
|
|
@@ -132,7 +188,25 @@ describe('Create item page - Fill in the gaps with dropdown: All or nothing with
|
|
|
132
188
|
fillInTheGapsDropdownPage.steps.verifyCorrectOptionIcon(1);
|
|
133
189
|
fillInTheGapsDropdownPage.steps.verifyIncorrectOptionIcon(2);
|
|
134
190
|
fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
|
|
135
|
-
|
|
191
|
+
if (alternativeAnswerCheck) {
|
|
192
|
+
showAlternativeAnswersComponent.steps.verifyShowAlternativeAnswersToggleExists();
|
|
193
|
+
showAlternativeAnswersComponent.steps.disableShowAlternativeAnswersToggle();
|
|
194
|
+
showAlternativeAnswersComponent.steps.verifyShowAlternativeAnswersToggleUnchecked();
|
|
195
|
+
fillInTheGapsDropdownPage.steps.verifyAlternativeAnswersSectionNotExist();
|
|
196
|
+
showAlternativeAnswersComponent.steps.clickShowAlternativeAnswersToggle();
|
|
197
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectAnswerSectionWithAlternateAnswer([
|
|
198
|
+
{
|
|
199
|
+
correctAnswers: [['Petal'],['Leaves'],['Stem']],
|
|
200
|
+
points: ['(20 points)'],
|
|
201
|
+
},
|
|
202
|
+
{
|
|
203
|
+
correctAnswers: [['Flower'],['Leaf'],['Stem']],
|
|
204
|
+
points: ['(10 points)'],
|
|
205
|
+
}
|
|
206
|
+
]);
|
|
207
|
+
} else {
|
|
208
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(alternateAnswerArray);
|
|
209
|
+
}
|
|
136
210
|
fillInTheGapsDropdownPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
|
137
211
|
/*cy.log('When the user has attempted the question with partially correct with all the response correct as per the alternative accordion but one incomplete and clicks on \'Check answer\' button, then correct icon should be displayed besides the response from the correct accordion and no icon should be displayed for unattempted dropdown, a status message with text \'Your answer is incorrect\' and correct answer section should not be displayed')
|
|
138
212
|
fillInTheGapsDropdownPage.steps.checkAnswer();
|
|
@@ -152,7 +226,25 @@ describe('Create item page - Fill in the gaps with dropdown: All or nothing with
|
|
|
152
226
|
fillInTheGapsDropdownPage.steps.verifyCorrectOptionIcon(1);
|
|
153
227
|
fillInTheGapsDropdownPage.steps.verifyIncorrectOptionIcon(2);
|
|
154
228
|
fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
|
|
155
|
-
|
|
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: [['Petal'],['Leaves'],['Stem']],
|
|
238
|
+
points: ['(20 points)'],
|
|
239
|
+
},
|
|
240
|
+
{
|
|
241
|
+
correctAnswers: [['Flower'],['Leaf'],['Stem']],
|
|
242
|
+
points: ['(10 points)'],
|
|
243
|
+
}
|
|
244
|
+
]);
|
|
245
|
+
} else {
|
|
246
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(alternateAnswerArray);
|
|
247
|
+
}
|
|
156
248
|
fillInTheGapsDropdownPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
|
157
249
|
/*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 alternative accordion responses, incorrect icon should be displayed besides correct accordion responses a status message with text \'Your answer is incorrect\' and correct answer section should not be displayed')
|
|
158
250
|
fillInTheGapsDropdownPage.steps.checkAnswer();
|
|
@@ -172,7 +264,25 @@ describe('Create item page - Fill in the gaps with dropdown: All or nothing with
|
|
|
172
264
|
fillInTheGapsDropdownPage.steps.verifyIncorrectOptionIcon(1);
|
|
173
265
|
fillInTheGapsDropdownPage.steps.verifyCorrectOptionIcon(2);
|
|
174
266
|
fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
|
|
175
|
-
|
|
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: [['Petal'],['Leaves'],['Stem']],
|
|
276
|
+
points: ['(20 points)'],
|
|
277
|
+
},
|
|
278
|
+
{
|
|
279
|
+
correctAnswers: [['Flower'],['Leaf'],['Stem']],
|
|
280
|
+
points: ['(10 points)'],
|
|
281
|
+
}
|
|
282
|
+
]);
|
|
283
|
+
} else {
|
|
284
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(alternateAnswerArray);
|
|
285
|
+
}
|
|
176
286
|
fillInTheGapsDropdownPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
|
177
287
|
/*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 correctly answered dropdowns, no icon should be displayed for unattempted dropdown, a status message with text \'Your answer is incorrect\' and correct answer section should not be displayed')
|
|
178
288
|
fillInTheGapsDropdownPage.steps.checkAnswer();
|
|
@@ -192,7 +302,25 @@ describe('Create item page - Fill in the gaps with dropdown: All or nothing with
|
|
|
192
302
|
fillInTheGapsDropdownPage.steps.verifyIncorrectOptionIcon(1);
|
|
193
303
|
fillInTheGapsDropdownPage.steps.verifyIncorrectOptionIcon(2);
|
|
194
304
|
fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
|
|
195
|
-
|
|
305
|
+
if (alternativeAnswerCheck) {
|
|
306
|
+
showAlternativeAnswersComponent.steps.verifyShowAlternativeAnswersToggleExists();
|
|
307
|
+
showAlternativeAnswersComponent.steps.disableShowAlternativeAnswersToggle();
|
|
308
|
+
showAlternativeAnswersComponent.steps.verifyShowAlternativeAnswersToggleUnchecked();
|
|
309
|
+
fillInTheGapsDropdownPage.steps.verifyAlternativeAnswersSectionNotExist();
|
|
310
|
+
showAlternativeAnswersComponent.steps.clickShowAlternativeAnswersToggle();
|
|
311
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectAnswerSectionWithAlternateAnswer([
|
|
312
|
+
{
|
|
313
|
+
correctAnswers: [['Petal'],['Leaves'],['Stem']],
|
|
314
|
+
points: ['(20 points)'],
|
|
315
|
+
},
|
|
316
|
+
{
|
|
317
|
+
correctAnswers: [['Flower'],['Leaf'],['Stem']],
|
|
318
|
+
points: ['(10 points)'],
|
|
319
|
+
}
|
|
320
|
+
]);
|
|
321
|
+
} else {
|
|
322
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(alternateAnswerArray);
|
|
323
|
+
}
|
|
196
324
|
fillInTheGapsDropdownPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
|
197
325
|
/*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 for unattempted dropdown, a status message with text \'Your answer is incorrect\' and correct answer section should not be displayed')
|
|
198
326
|
fillInTheGapsDropdownPage.steps.checkAnswer();
|
|
@@ -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: All or nothing with alternative answers', () => {
|
|
12
14
|
before(() => {
|
|
@@ -39,7 +41,25 @@ describe('Create item page - Fill in the gaps with dropdown: All or nothing with
|
|
|
39
41
|
fillInTheGapsDropdownPage.steps.switchToGradingView();
|
|
40
42
|
fillInTheGapsDropdownPage.steps.verifyDropdownNumerationPreviewTab();
|
|
41
43
|
fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
|
|
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: ['(20 points)'],
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
correctAnswers: [['Petal'],['Leaves'],['Stem']],
|
|
57
|
+
points: ['(20 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, a status message with text \'Your answer is correct\' and correct answer section should not be displayed', () => {
|
|
@@ -91,7 +111,25 @@ describe('Create item page - Fill in the gaps with dropdown: All or nothing with
|
|
|
91
111
|
fillInTheGapsDropdownPage.steps.verifyIncorrectOptionIcon(1);
|
|
92
112
|
fillInTheGapsDropdownPage.steps.verifyIncorrectOptionIcon(2);
|
|
93
113
|
fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
|
|
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: ['(20 points)'],
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
correctAnswers: [['Petal'],['Leaves'],['Stem']],
|
|
127
|
+
points: ['(20 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 correctly answered dropdowns, no icon should be displayed beside unattempted dropdown, a status message with text \'Your answer is incorrect\' and correct answer section should not be displayed');
|
|
97
135
|
fillInTheGapsDropdownPage.steps.checkAnswer();
|
|
@@ -112,7 +150,25 @@ describe('Create item page - Fill in the gaps with dropdown: All or nothing with
|
|
|
112
150
|
fillInTheGapsDropdownPage.steps.verifyIncorrectOptionIcon(1);
|
|
113
151
|
fillInTheGapsDropdownPage.steps.verifyIncorrectOptionIcon(2);
|
|
114
152
|
fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
|
|
115
|
-
|
|
153
|
+
if (alternativeAnswerCheck) {
|
|
154
|
+
showAlternativeAnswersComponent.steps.verifyShowAlternativeAnswersToggleExists();
|
|
155
|
+
showAlternativeAnswersComponent.steps.disableShowAlternativeAnswersToggle();
|
|
156
|
+
showAlternativeAnswersComponent.steps.verifyShowAlternativeAnswersToggleUnchecked();
|
|
157
|
+
fillInTheGapsDropdownPage.steps.verifyAlternativeAnswersSectionNotExist();
|
|
158
|
+
showAlternativeAnswersComponent.steps.clickShowAlternativeAnswersToggle();
|
|
159
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectAnswerSectionWithAlternateAnswer([
|
|
160
|
+
{
|
|
161
|
+
correctAnswers: [['Flower'],['Leaf'],['Stem']],
|
|
162
|
+
points: ['(20 points)'],
|
|
163
|
+
},
|
|
164
|
+
{
|
|
165
|
+
correctAnswers: [['Petal'],['Leaves'],['Stem']],
|
|
166
|
+
points: ['(20 points)'],
|
|
167
|
+
}
|
|
168
|
+
]);
|
|
169
|
+
} else {
|
|
170
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(correctAnswerArray);
|
|
171
|
+
}
|
|
116
172
|
fillInTheGapsDropdownPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
|
117
173
|
/*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 correctly answered dropdowns, no icon should be displayed beside unattempted dropdown, a status message with text \'Your answer is incorrect\' and correct answer section should not be displayed');
|
|
118
174
|
fillInTheGapsDropdownPage.steps.checkAnswer();
|
|
@@ -133,7 +189,25 @@ describe('Create item page - Fill in the gaps with dropdown: All or nothing with
|
|
|
133
189
|
fillInTheGapsDropdownPage.steps.verifyCorrectOptionIcon(1);
|
|
134
190
|
fillInTheGapsDropdownPage.steps.verifyIncorrectOptionIcon(2);
|
|
135
191
|
fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
|
|
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: ['(20 points)'],
|
|
202
|
+
},
|
|
203
|
+
{
|
|
204
|
+
correctAnswers: [['Petal'],['Leaves'],['Stem']],
|
|
205
|
+
points: ['(20 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 partially correct with all the response correct as per the alternative accordion but one response incomplete and clicks on \'Check answer\' button, then correct icon should be displayed besides the response from the alternative accordion, incorrect icon should be displayed besides the empty response, a status message with text \'Your answer is incorrect\' 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: All or nothing with
|
|
|
153
227
|
fillInTheGapsDropdownPage.steps.verifyIncorrectOptionIcon(1);
|
|
154
228
|
fillInTheGapsDropdownPage.steps.verifyIncorrectOptionIcon(2);
|
|
155
229
|
fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
|
|
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: ['(20 points)'],
|
|
240
|
+
},
|
|
241
|
+
{
|
|
242
|
+
correctAnswers: [['Petal'],['Leaves'],['Stem']],
|
|
243
|
+
points: ['(20 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 dropdowns from correct and alternative accordion and clicks on \'Check answer\' button, then correct icon should be displayed besides the correctly answered dropdowns, incorrect icon should be displayed beside option from the alternative accordion a status message with text \'Your answer is incorrect\' 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: All or nothing with
|
|
|
173
265
|
fillInTheGapsDropdownPage.steps.verifyIncorrectOptionIcon(1);
|
|
174
266
|
fillInTheGapsDropdownPage.steps.verifyCorrectOptionIcon(2);
|
|
175
267
|
fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
|
|
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: ['(20 points)'],
|
|
278
|
+
},
|
|
279
|
+
{
|
|
280
|
+
correctAnswers: [['Petal'],['Leaves'],['Stem']],
|
|
281
|
+
points: ['(20 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 equal number of correct dropdowns from correct and alternative accordion and clicks on \'Check answer\' button, then correct icon should be displayed besides the correctly answered dropdowns, no icon should be displayed beside unattempted dropdown, a status message with text \'Your answer is incorrect\' 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: All or nothing with
|
|
|
193
303
|
fillInTheGapsDropdownPage.steps.verifyIncorrectOptionIcon(1);
|
|
194
304
|
fillInTheGapsDropdownPage.steps.verifyIncorrectOptionIcon(2);
|
|
195
305
|
fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
|
|
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: ['(20 points)'],
|
|
316
|
+
},
|
|
317
|
+
{
|
|
318
|
+
correctAnswers: [['Petal'],['Leaves'],['Stem']],
|
|
319
|
+
points: ['(20 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 icons should be displayed besides all incorrect dropdowns, a status message with text \'Your answer is incorrect\' and correct answer section should not be displayed');
|
|
199
327
|
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: All or nothing with alternative answers', () => {
|
|
15
16
|
before(() => {
|
|
@@ -42,8 +43,26 @@ describe('Create item page - Fill in the gaps with dropdown: All or nothing with
|
|
|
42
43
|
fillInTheGapsDropdownPage.steps.switchToGradingView();
|
|
43
44
|
fillInTheGapsDropdownPage.steps.verifyDropdownNumerationPreviewTab();
|
|
44
45
|
fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
|
|
45
|
-
|
|
46
|
-
|
|
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: ['(20 points)'],
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
correctAnswers: [['Petal'],['Leaves'],['Stem']],
|
|
59
|
+
points: ['(10 points)'],
|
|
60
|
+
}
|
|
61
|
+
]);
|
|
62
|
+
} else {
|
|
63
|
+
utilities.verifyInnerText(fillInTheGapsDropdownPage.correctAnswersLabel(), 'Correct answers');
|
|
64
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(correctAnswerArray);
|
|
65
|
+
}
|
|
47
66
|
});
|
|
48
67
|
|
|
49
68
|
it('CSS of correct answer section and dropdown numeration', { tags: 'css' }, () => {
|
|
@@ -144,7 +163,25 @@ describe('Create item page - Fill in the gaps with dropdown: All or nothing with
|
|
|
144
163
|
fillInTheGapsDropdownPage.steps.verifyIncorrectOptionIcon(1);
|
|
145
164
|
fillInTheGapsDropdownPage.steps.verifyIncorrectOptionIcon(2);
|
|
146
165
|
fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
|
|
147
|
-
|
|
166
|
+
if (alternativeAnswerCheck) {
|
|
167
|
+
showAlternativeAnswersComponent.steps.verifyShowAlternativeAnswersToggleExists();
|
|
168
|
+
showAlternativeAnswersComponent.steps.disableShowAlternativeAnswersToggle();
|
|
169
|
+
showAlternativeAnswersComponent.steps.verifyShowAlternativeAnswersToggleUnchecked();
|
|
170
|
+
fillInTheGapsDropdownPage.steps.verifyAlternativeAnswersSectionNotExist();
|
|
171
|
+
showAlternativeAnswersComponent.steps.clickShowAlternativeAnswersToggle();
|
|
172
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectAnswerSectionWithAlternateAnswer([
|
|
173
|
+
{
|
|
174
|
+
correctAnswers: [['Flower'],['Leaf'],['Stem']],
|
|
175
|
+
points: ['(20 points)'],
|
|
176
|
+
},
|
|
177
|
+
{
|
|
178
|
+
correctAnswers: [['Petal'],['Leaves'],['Stem']],
|
|
179
|
+
points: ['(10 points)'],
|
|
180
|
+
}
|
|
181
|
+
]);
|
|
182
|
+
} else {
|
|
183
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(correctAnswerArray);
|
|
184
|
+
}
|
|
148
185
|
fillInTheGapsDropdownPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
|
149
186
|
/*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, a status message with text \'Your answer is incorrect\' and correct answer section should not be displayed');
|
|
150
187
|
fillInTheGapsDropdownPage.steps.checkAnswer();
|
|
@@ -164,7 +201,25 @@ describe('Create item page - Fill in the gaps with dropdown: All or nothing with
|
|
|
164
201
|
fillInTheGapsDropdownPage.steps.verifyIncorrectOptionIcon(1);
|
|
165
202
|
fillInTheGapsDropdownPage.steps.verifyIncorrectOptionIcon(2);
|
|
166
203
|
fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
|
|
167
|
-
|
|
204
|
+
if (alternativeAnswerCheck) {
|
|
205
|
+
showAlternativeAnswersComponent.steps.verifyShowAlternativeAnswersToggleExists();
|
|
206
|
+
showAlternativeAnswersComponent.steps.disableShowAlternativeAnswersToggle();
|
|
207
|
+
showAlternativeAnswersComponent.steps.verifyShowAlternativeAnswersToggleUnchecked();
|
|
208
|
+
fillInTheGapsDropdownPage.steps.verifyAlternativeAnswersSectionNotExist();
|
|
209
|
+
showAlternativeAnswersComponent.steps.clickShowAlternativeAnswersToggle();
|
|
210
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectAnswerSectionWithAlternateAnswer([
|
|
211
|
+
{
|
|
212
|
+
correctAnswers: [['Flower'],['Leaf'],['Stem']],
|
|
213
|
+
points: ['(20 points)'],
|
|
214
|
+
},
|
|
215
|
+
{
|
|
216
|
+
correctAnswers: [['Petal'],['Leaves'],['Stem']],
|
|
217
|
+
points: ['(10 points)'],
|
|
218
|
+
}
|
|
219
|
+
]);
|
|
220
|
+
} else {
|
|
221
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(correctAnswerArray);
|
|
222
|
+
}
|
|
168
223
|
fillInTheGapsDropdownPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
|
169
224
|
/*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, a status message with text \'Your answer is incorrect\' and correct answer section should not be displayed');
|
|
170
225
|
fillInTheGapsDropdownPage.steps.checkAnswer();
|
|
@@ -184,7 +239,25 @@ describe('Create item page - Fill in the gaps with dropdown: All or nothing with
|
|
|
184
239
|
fillInTheGapsDropdownPage.steps.verifyCorrectOptionIcon(1);
|
|
185
240
|
fillInTheGapsDropdownPage.steps.verifyIncorrectOptionIcon(2);
|
|
186
241
|
fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
|
|
187
|
-
|
|
242
|
+
if (alternativeAnswerCheck) {
|
|
243
|
+
showAlternativeAnswersComponent.steps.verifyShowAlternativeAnswersToggleExists();
|
|
244
|
+
showAlternativeAnswersComponent.steps.disableShowAlternativeAnswersToggle();
|
|
245
|
+
showAlternativeAnswersComponent.steps.verifyShowAlternativeAnswersToggleUnchecked();
|
|
246
|
+
fillInTheGapsDropdownPage.steps.verifyAlternativeAnswersSectionNotExist();
|
|
247
|
+
showAlternativeAnswersComponent.steps.clickShowAlternativeAnswersToggle();
|
|
248
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectAnswerSectionWithAlternateAnswer([
|
|
249
|
+
{
|
|
250
|
+
correctAnswers: [['Flower'],['Leaf'],['Stem']],
|
|
251
|
+
points: ['(20 points)'],
|
|
252
|
+
},
|
|
253
|
+
{
|
|
254
|
+
correctAnswers: [['Petal'],['Leaves'],['Stem']],
|
|
255
|
+
points: ['(10 points)'],
|
|
256
|
+
}
|
|
257
|
+
]);
|
|
258
|
+
} else {
|
|
259
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(correctAnswerArray);
|
|
260
|
+
}
|
|
188
261
|
fillInTheGapsDropdownPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
|
189
262
|
/*cy.log('When the user has attempted the question with partially correct with all the response correct as per the alternative accordion but one response incomplete and clicks on \'Check answer\' button, then correct icon should be displayed besides the correct accordion response, incorrect icon should be displayed besides the alternative accordion response and no icon should be displayed beside unattempted dropdown, a status message with text \'Your answer is incorrect\' and correct answer section should not be displayed');
|
|
190
263
|
fillInTheGapsDropdownPage.steps.checkAnswer();
|
|
@@ -204,7 +277,25 @@ describe('Create item page - Fill in the gaps with dropdown: All or nothing with
|
|
|
204
277
|
fillInTheGapsDropdownPage.steps.verifyIncorrectOptionIcon(1);
|
|
205
278
|
fillInTheGapsDropdownPage.steps.verifyIncorrectOptionIcon(2);
|
|
206
279
|
fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
|
|
207
|
-
|
|
280
|
+
if (alternativeAnswerCheck) {
|
|
281
|
+
showAlternativeAnswersComponent.steps.verifyShowAlternativeAnswersToggleExists();
|
|
282
|
+
showAlternativeAnswersComponent.steps.disableShowAlternativeAnswersToggle();
|
|
283
|
+
showAlternativeAnswersComponent.steps.verifyShowAlternativeAnswersToggleUnchecked();
|
|
284
|
+
fillInTheGapsDropdownPage.steps.verifyAlternativeAnswersSectionNotExist();
|
|
285
|
+
showAlternativeAnswersComponent.steps.clickShowAlternativeAnswersToggle();
|
|
286
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectAnswerSectionWithAlternateAnswer([
|
|
287
|
+
{
|
|
288
|
+
correctAnswers: [['Flower'],['Leaf'],['Stem']],
|
|
289
|
+
points: ['(20 points)'],
|
|
290
|
+
},
|
|
291
|
+
{
|
|
292
|
+
correctAnswers: [['Petal'],['Leaves'],['Stem']],
|
|
293
|
+
points: ['(10 points)'],
|
|
294
|
+
}
|
|
295
|
+
]);
|
|
296
|
+
} else {
|
|
297
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(correctAnswerArray);
|
|
298
|
+
}
|
|
208
299
|
fillInTheGapsDropdownPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
|
209
300
|
/*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 correctly answered dropdowns, incorrect icon should be displayed beside alternative accordion responses, a status message with text \'Your answer is incorrect\' and correct answer section should not be displayed');
|
|
210
301
|
fillInTheGapsDropdownPage.steps.checkAnswer();
|
|
@@ -224,7 +315,25 @@ describe('Create item page - Fill in the gaps with dropdown: All or nothing with
|
|
|
224
315
|
fillInTheGapsDropdownPage.steps.verifyIncorrectOptionIcon(1);
|
|
225
316
|
fillInTheGapsDropdownPage.steps.verifyCorrectOptionIcon(2);
|
|
226
317
|
fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
|
|
227
|
-
|
|
318
|
+
if (alternativeAnswerCheck) {
|
|
319
|
+
showAlternativeAnswersComponent.steps.verifyShowAlternativeAnswersToggleExists();
|
|
320
|
+
showAlternativeAnswersComponent.steps.disableShowAlternativeAnswersToggle();
|
|
321
|
+
showAlternativeAnswersComponent.steps.verifyShowAlternativeAnswersToggleUnchecked();
|
|
322
|
+
fillInTheGapsDropdownPage.steps.verifyAlternativeAnswersSectionNotExist();
|
|
323
|
+
showAlternativeAnswersComponent.steps.clickShowAlternativeAnswersToggle();
|
|
324
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectAnswerSectionWithAlternateAnswer([
|
|
325
|
+
{
|
|
326
|
+
correctAnswers: [['Flower'],['Leaf'],['Stem']],
|
|
327
|
+
points: ['(20 points)'],
|
|
328
|
+
},
|
|
329
|
+
{
|
|
330
|
+
correctAnswers: [['Petal'],['Leaves'],['Stem']],
|
|
331
|
+
points: ['(10 points)'],
|
|
332
|
+
}
|
|
333
|
+
]);
|
|
334
|
+
} else {
|
|
335
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(correctAnswerArray);
|
|
336
|
+
}
|
|
228
337
|
fillInTheGapsDropdownPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
|
229
338
|
/*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 correctly answered dropdowns, no icon should be displayed beside unattempted dropdown, a status message with text \'Your answer is incorrect\' and correct answer section should not be displayed');
|
|
230
339
|
fillInTheGapsDropdownPage.steps.checkAnswer();
|
|
@@ -244,7 +353,25 @@ describe('Create item page - Fill in the gaps with dropdown: All or nothing with
|
|
|
244
353
|
fillInTheGapsDropdownPage.steps.verifyIncorrectOptionIcon(1);
|
|
245
354
|
fillInTheGapsDropdownPage.steps.verifyIncorrectOptionIcon(2);
|
|
246
355
|
fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
|
|
247
|
-
|
|
356
|
+
if (alternativeAnswerCheck) {
|
|
357
|
+
showAlternativeAnswersComponent.steps.verifyShowAlternativeAnswersToggleExists();
|
|
358
|
+
showAlternativeAnswersComponent.steps.disableShowAlternativeAnswersToggle();
|
|
359
|
+
showAlternativeAnswersComponent.steps.verifyShowAlternativeAnswersToggleUnchecked();
|
|
360
|
+
fillInTheGapsDropdownPage.steps.verifyAlternativeAnswersSectionNotExist();
|
|
361
|
+
showAlternativeAnswersComponent.steps.clickShowAlternativeAnswersToggle();
|
|
362
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectAnswerSectionWithAlternateAnswer([
|
|
363
|
+
{
|
|
364
|
+
correctAnswers: [['Flower'],['Leaf'],['Stem']],
|
|
365
|
+
points: ['(20 points)'],
|
|
366
|
+
},
|
|
367
|
+
{
|
|
368
|
+
correctAnswers: [['Petal'],['Leaves'],['Stem']],
|
|
369
|
+
points: ['(10 points)'],
|
|
370
|
+
}
|
|
371
|
+
]);
|
|
372
|
+
} else {
|
|
373
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(correctAnswerArray);
|
|
374
|
+
}
|
|
248
375
|
fillInTheGapsDropdownPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
|
249
376
|
/*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, a status message with text \'Your answer is incorrect\' and correct answer section should not be displayed');
|
|
250
377
|
fillInTheGapsDropdownPage.steps.checkAnswer();
|