itemengine-cypress-automation 1.0.582-IEI-7178-6c816dc.0 → 1.0.583-IEI-7046-3e4646d.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/DragAndDropIntoCategoriesNew/Scoring/allOrNothingAlternativePointsGreaterThanCorrectPoints.js +123 -8
- package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/Scoring/allOrNothingCorrectPointsEqualToAlternativePoints.js +123 -8
- package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/Scoring/allOrNothingCorrectPointsGreaterThanAlternativePoints.js +131 -14
- package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/Scoring/perCorrectOptionAlternativePointsGreaterThanCorrectPoints.js +138 -9
- package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/Scoring/perCorrectOptionCorrectPointsEqualToAlternativePoints.js +138 -9
- package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/Scoring/perCorrectOptionCorrectPointsGreaterThanAlternativePoints.js +153 -10
- package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/Scoring/perDropzoneAlternativePointsGreaterThanCorrectPoints.js +138 -9
- package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/Scoring/perDropzoneCorrectPointsEqualToAlternativePoints.js +108 -7
- package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/Scoring/perDropzoneCorrectPointsGreaterThanAlternativePoints.js +138 -9
- package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/allOrNothingBasicForAllViews.smoke.js +272 -1
- package/cypress/pages/dragAndDropIntoCategoriesPage.js +38 -0
- package/package.json +1 -1
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { dragAndDropIntoCategoriesPage } from "../../../../pages";
|
|
2
2
|
import abortEarlySetup from "../../../../support/helpers/abortEarly";
|
|
3
|
+
import { showAlternativeAnswersComponent } from "../../../../pages/components";
|
|
4
|
+
|
|
5
|
+
const alternativeAnswerCheck = Cypress.env('ENABLE_ALTERNATIVE_ANSWER_ENHANCEMENT') === 'true';
|
|
3
6
|
|
|
4
7
|
describe('Create item page - Drag and drop into categories: Per dropzone with alternative answers', () => {
|
|
5
8
|
before(() => {
|
|
@@ -33,7 +36,21 @@ describe('Create item page - Drag and drop into categories: Per dropzone with al
|
|
|
33
36
|
//Failing due to https://redmine.zeuslearning.com/issues/574339
|
|
34
37
|
// dragAndDropIntoCategoriesPage.steps.verifyCorrectIncorrectIconsForDropzone({ 'incorrect': 0, 'incorrect': 1, 'incorrect': 2, 'incorrect': 3, 'incorrect': 4, 'correct': 5 });
|
|
35
38
|
dragAndDropIntoCategoriesPage.steps.verifyPreviewScore(0, 30);
|
|
36
|
-
|
|
39
|
+
if (alternativeAnswerCheck) {
|
|
40
|
+
showAlternativeAnswersComponent.steps.clickShowAlternativeAnswersToggle();
|
|
41
|
+
dragAndDropIntoCategoriesPage.steps.verifyCorrectAnswerResponsesInAlternateAnswerSection([
|
|
42
|
+
{
|
|
43
|
+
correctAnswers: [['Bat'], ['Eagle', 'Parrot'], ['Platypus'], ['Ostrich'], ['Whale'], []],
|
|
44
|
+
pointsText: '(Points per correct option - 5 points)',
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
correctAnswers: [['Flying squirrel'], ['Eagle', 'Peacock'], ['Ostrich'], ['Platypus'], ['Octopus'], []],
|
|
48
|
+
pointsText: '(Points per correct option - 3 points)',
|
|
49
|
+
}
|
|
50
|
+
]);
|
|
51
|
+
} else {
|
|
52
|
+
dragAndDropIntoCategoriesPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([['Bat'], ['Eagle', 'Parrot'], ['Platypus'], ['Ostrich'], ['Whale'], []], ['1', '2', '3', '4', '5', '6']);
|
|
53
|
+
}
|
|
37
54
|
});
|
|
38
55
|
|
|
39
56
|
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 responses, correct icons should be displayed for all correct dropzones proper icon should display beside empty dropzone, correct/incorrect answer status message should not be displayed and correct answer section should not be displayed', () => {
|
|
@@ -106,7 +123,21 @@ describe('Create item page - Drag and drop into categories: Per dropzone with al
|
|
|
106
123
|
dragAndDropIntoCategoriesPage.steps.verifyIncorrectIconForEmptyContainer(4);
|
|
107
124
|
dragAndDropIntoCategoriesPage.steps.verifyCorrectIconForEmptyContainer(5);
|
|
108
125
|
dragAndDropIntoCategoriesPage.steps.verifyCorrectIncorrectIconsForDropzone({ 'correct': 0, 'incorrect': 1, 'incorrect': 2, 'incorrect': 3, 'incorrect': 4, 'correct': 5 });
|
|
109
|
-
|
|
126
|
+
if (alternativeAnswerCheck) {
|
|
127
|
+
showAlternativeAnswersComponent.steps.clickShowAlternativeAnswersToggle();
|
|
128
|
+
dragAndDropIntoCategoriesPage.steps.verifyCorrectAnswerResponsesInAlternateAnswerSection([
|
|
129
|
+
{
|
|
130
|
+
correctAnswers: [['Bat'], ['Eagle', 'Parrot'], ['Platypus'], ['Ostrich'], ['Whale'], []],
|
|
131
|
+
pointsText: '(Points per correct option - 5 points)',
|
|
132
|
+
},
|
|
133
|
+
{
|
|
134
|
+
correctAnswers: [['Flying squirrel'], ['Eagle', 'Peacock'], ['Ostrich'], ['Platypus'], ['Octopus'], []],
|
|
135
|
+
pointsText: '(Points per correct option - 3 points)',
|
|
136
|
+
}
|
|
137
|
+
]);
|
|
138
|
+
} else {
|
|
139
|
+
dragAndDropIntoCategoriesPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([['Bat'], ['Eagle', 'Parrot'], ['Platypus'], ['Ostrich'], ['Whale'], []], ['1', '2', '3', '4', '5', '6']);
|
|
140
|
+
}
|
|
110
141
|
dragAndDropIntoCategoriesPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
|
|
111
142
|
dragAndDropIntoCategoriesPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
|
112
143
|
/*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 answer responses, correct icons should be displayed for all correct dropzones, incorrect icon should be displayed for incorrect dropzones, correct/incorrect answer status message and correct answer section should not be displayed')
|
|
@@ -131,7 +162,21 @@ describe('Create item page - Drag and drop into categories: Per dropzone with al
|
|
|
131
162
|
dragAndDropIntoCategoriesPage.steps.verifyIncorrectIconForEmptyContainer(4);
|
|
132
163
|
dragAndDropIntoCategoriesPage.steps.verifyCorrectIncorrectIconsForDropzone({ 'correct': 0, 'incorrect': 1, 'correct': 2, 'incorrect': 3, 'incorrect': 4, 'correct': 5 });
|
|
133
164
|
dragAndDropIntoCategoriesPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
|
|
134
|
-
|
|
165
|
+
if (alternativeAnswerCheck) {
|
|
166
|
+
showAlternativeAnswersComponent.steps.clickShowAlternativeAnswersToggle();
|
|
167
|
+
dragAndDropIntoCategoriesPage.steps.verifyCorrectAnswerResponsesInAlternateAnswerSection([
|
|
168
|
+
{
|
|
169
|
+
correctAnswers: [['Bat'], ['Eagle', 'Parrot'], ['Platypus'], ['Ostrich'], ['Whale'], []],
|
|
170
|
+
pointsText: '(Points per correct option - 5 points)',
|
|
171
|
+
},
|
|
172
|
+
{
|
|
173
|
+
correctAnswers: [['Flying squirrel'], ['Eagle', 'Peacock'], ['Ostrich'], ['Platypus'], ['Octopus'], []],
|
|
174
|
+
pointsText: '(Points per correct option - 3 points)',
|
|
175
|
+
}
|
|
176
|
+
]);
|
|
177
|
+
} else {
|
|
178
|
+
dragAndDropIntoCategoriesPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([['Bat'], ['Eagle', 'Parrot'], ['Platypus'], ['Ostrich'], ['Whale'], []], ['1', '2', '3', '4', '5', '6']);
|
|
179
|
+
}
|
|
135
180
|
dragAndDropIntoCategoriesPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
|
136
181
|
/*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 answer responses, correct icons should be displayed for all correct dropzones, incorrect icon should be displayed for incorrect dropzones, correct/incorrect answer status message and correct answer section should not be displayed')
|
|
137
182
|
dragAndDropIntoCategoriesPage.steps.checkAnswer();
|
|
@@ -156,7 +201,21 @@ describe('Create item page - Drag and drop into categories: Per dropzone with al
|
|
|
156
201
|
dragAndDropIntoCategoriesPage.steps.verifyCorrectIconForEmptyContainer(5);
|
|
157
202
|
dragAndDropIntoCategoriesPage.steps.verifyCorrectIncorrectIconsForDropzone({ 'incorrect': 0, 'incorrect': 1, 'incorrect': 2, 'incorrect': 3, 'incorrect': 4, 'correct': 5 });
|
|
158
203
|
dragAndDropIntoCategoriesPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
|
|
159
|
-
|
|
204
|
+
if (alternativeAnswerCheck) {
|
|
205
|
+
showAlternativeAnswersComponent.steps.clickShowAlternativeAnswersToggle();
|
|
206
|
+
dragAndDropIntoCategoriesPage.steps.verifyCorrectAnswerResponsesInAlternateAnswerSection([
|
|
207
|
+
{
|
|
208
|
+
correctAnswers: [['Bat'], ['Eagle', 'Parrot'], ['Platypus'], ['Ostrich'], ['Whale'], []],
|
|
209
|
+
pointsText: '(Points per correct option - 5 points)',
|
|
210
|
+
},
|
|
211
|
+
{
|
|
212
|
+
correctAnswers: [['Flying squirrel'], ['Eagle', 'Peacock'], ['Ostrich'], ['Platypus'], ['Octopus'], []],
|
|
213
|
+
pointsText: '(Points per correct option - 3 points)',
|
|
214
|
+
}
|
|
215
|
+
]);
|
|
216
|
+
} else {
|
|
217
|
+
dragAndDropIntoCategoriesPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([['Bat'], ['Eagle', 'Parrot'], ['Platypus'], ['Ostrich'], ['Whale'], []], ['1', '2', '3', '4', '5', '6']);
|
|
218
|
+
}
|
|
160
219
|
dragAndDropIntoCategoriesPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
|
161
220
|
/*cy.log('When the user has attempted the question with partially correct such that a dropzone is correctly attempted with both the correct and alternative answer options and clicks on \'Check answer\' button, then correct icon should be displayed besides correct accordion responses, incorrect icon should be displayed besides the alternative accordion responses, incorrect icon should be displayed for the dropzone containing options of alternative accordion and correct accordion in the same dropzone, correct/incorrect answer status message and correct answer section should not be displayed')
|
|
162
221
|
dragAndDropIntoCategoriesPage.steps.checkAnswer();
|
|
@@ -180,7 +239,21 @@ describe('Create item page - Drag and drop into categories: Per dropzone with al
|
|
|
180
239
|
dragAndDropIntoCategoriesPage.steps.verifyIncorrectIconForEmptyContainer(4);
|
|
181
240
|
dragAndDropIntoCategoriesPage.steps.verifyCorrectIncorrectIconsForDropzone({ 'incorrect': 0, 'incorrect': 1, 'correct': 2, 'incorrect': 3, 'incorrect': 4, 'incorrect': 5 });
|
|
182
241
|
dragAndDropIntoCategoriesPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
|
|
183
|
-
|
|
242
|
+
if (alternativeAnswerCheck) {
|
|
243
|
+
showAlternativeAnswersComponent.steps.clickShowAlternativeAnswersToggle();
|
|
244
|
+
dragAndDropIntoCategoriesPage.steps.verifyCorrectAnswerResponsesInAlternateAnswerSection([
|
|
245
|
+
{
|
|
246
|
+
correctAnswers: [['Bat'], ['Eagle', 'Parrot'], ['Platypus'], ['Ostrich'], ['Whale'], []],
|
|
247
|
+
pointsText: '(Points per correct option - 5 points)',
|
|
248
|
+
},
|
|
249
|
+
{
|
|
250
|
+
correctAnswers: [['Flying squirrel'], ['Eagle', 'Peacock'], ['Ostrich'], ['Platypus'], ['Octopus'], []],
|
|
251
|
+
pointsText: '(Points per correct option - 3 points)',
|
|
252
|
+
}
|
|
253
|
+
]);
|
|
254
|
+
} else {
|
|
255
|
+
dragAndDropIntoCategoriesPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([['Bat'], ['Eagle', 'Parrot'], ['Platypus'], ['Ostrich'], ['Whale'], []], ['1', '2', '3', '4', '5', '6']);
|
|
256
|
+
}
|
|
184
257
|
dragAndDropIntoCategoriesPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
|
185
258
|
/*cy.log('When the user has attempted the question partially correct such that one dropzone is correctly attempted as per the correct accordion and another dropzone is correctly attempted as per the alternative accordion and clicks on \'Check answer\' button, then correct icon should be displayed besides correct accordion responses, incorrect icon should be displayed besides the alternative accordion responses, correct icon should be displayed for correct dropzone, incorrect icon should be displayed for incorrect dropzone, correct/incorrect answer status message and correct answer section should not be displayed')
|
|
186
259
|
dragAndDropIntoCategoriesPage.steps.checkAnswer();
|
|
@@ -204,7 +277,21 @@ describe('Create item page - Drag and drop into categories: Per dropzone with al
|
|
|
204
277
|
dragAndDropIntoCategoriesPage.steps.verifyCorrectIconForEmptyContainer(5);
|
|
205
278
|
dragAndDropIntoCategoriesPage.steps.verifyCorrectIncorrectIconsForDropzone({ 'incorrect': 0, 'incorrect': 1, 'incorrect': 2, 'correct': 3, 'incorrect': 4, 'correct': 5 });
|
|
206
279
|
dragAndDropIntoCategoriesPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
|
|
207
|
-
|
|
280
|
+
if (alternativeAnswerCheck) {
|
|
281
|
+
showAlternativeAnswersComponent.steps.clickShowAlternativeAnswersToggle();
|
|
282
|
+
dragAndDropIntoCategoriesPage.steps.verifyCorrectAnswerResponsesInAlternateAnswerSection([
|
|
283
|
+
{
|
|
284
|
+
correctAnswers: [['Bat'], ['Eagle', 'Parrot'], ['Platypus'], ['Ostrich'], ['Whale'], []],
|
|
285
|
+
pointsText: '(Points per correct option - 5 points)',
|
|
286
|
+
},
|
|
287
|
+
{
|
|
288
|
+
correctAnswers: [['Flying squirrel'], ['Eagle', 'Peacock'], ['Ostrich'], ['Platypus'], ['Octopus'], []],
|
|
289
|
+
pointsText: '(Points per correct option - 3 points)',
|
|
290
|
+
}
|
|
291
|
+
]);
|
|
292
|
+
} else {
|
|
293
|
+
dragAndDropIntoCategoriesPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([['Bat'], ['Eagle', 'Parrot'], ['Platypus'], ['Ostrich'], ['Whale'], []], ['1', '2', '3', '4', '5', '6']);
|
|
294
|
+
}
|
|
208
295
|
dragAndDropIntoCategoriesPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
|
209
296
|
/*cy.log('When the user has attempted the question partially correct with only common options across both accordions and clicks on \'Check answer\' button, then correct icon should be displayed besides the correct answer responses, correct icon should be displayed for correct dropzone, incorrect icon should be displayed for incorrect dropzone. correct/incorrect answer status message and correct answer section should not be displayed')
|
|
210
297
|
dragAndDropIntoCategoriesPage.steps.checkAnswer();
|
|
@@ -228,7 +315,21 @@ describe('Create item page - Drag and drop into categories: Per dropzone with al
|
|
|
228
315
|
dragAndDropIntoCategoriesPage.steps.verifyCorrectIconForEmptyContainer(5);
|
|
229
316
|
dragAndDropIntoCategoriesPage.steps.verifyCorrectIncorrectIconsForDropzone({ 'incorrect': 0, 'correct': 1, 'incorrect': 2, 'correct': 3, 'incorrect': 4, 'correct': 5 });
|
|
230
317
|
dragAndDropIntoCategoriesPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
|
|
231
|
-
|
|
318
|
+
if (alternativeAnswerCheck) {
|
|
319
|
+
showAlternativeAnswersComponent.steps.clickShowAlternativeAnswersToggle();
|
|
320
|
+
dragAndDropIntoCategoriesPage.steps.verifyCorrectAnswerResponsesInAlternateAnswerSection([
|
|
321
|
+
{
|
|
322
|
+
correctAnswers: [['Bat'], ['Eagle', 'Parrot'], ['Platypus'], ['Ostrich'], ['Whale'], []],
|
|
323
|
+
pointsText: '(Points per correct option - 5 points)',
|
|
324
|
+
},
|
|
325
|
+
{
|
|
326
|
+
correctAnswers: [['Flying squirrel'], ['Eagle', 'Peacock'], ['Ostrich'], ['Platypus'], ['Octopus'], []],
|
|
327
|
+
pointsText: '(Points per correct option - 3 points)',
|
|
328
|
+
}
|
|
329
|
+
]);
|
|
330
|
+
} else {
|
|
331
|
+
dragAndDropIntoCategoriesPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([['Bat'], ['Eagle', 'Parrot'], ['Platypus'], ['Ostrich'], ['Whale'], []], ['1', '2', '3', '4', '5', '6']);
|
|
332
|
+
}
|
|
232
333
|
dragAndDropIntoCategoriesPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
|
233
334
|
/*cy.log('When the user has attempted the question partially correct such that equal number of dropzones are correct according to correct accordion and alternative accordion mappings and clicks on \'Check answer\' button, then correct icon should be displayed besides correct accordion responses, incorrect icon should be displayed besides alternative accordion responses, correct icon should be displayed for correct dropzone, incorrect icon should be displayed for incorrect dropzone. correct/incorrect answer status message and correct answer section should not be displayed')
|
|
234
335
|
dragAndDropIntoCategoriesPage.steps.checkAnswer();
|
|
@@ -256,7 +357,21 @@ describe('Create item page - Drag and drop into categories: Per dropzone with al
|
|
|
256
357
|
dragAndDropIntoCategoriesPage.steps.verifyIncorrectIconForEmptyContainer(3);
|
|
257
358
|
dragAndDropIntoCategoriesPage.steps.verifyCorrectIncorrectIconsForDropzone({ 'correct': 0, 'incorrect': 1, 'correct': 2, 'incorrect': 3, 'correct': 4, 'correct': 5 });
|
|
258
359
|
dragAndDropIntoCategoriesPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
|
|
259
|
-
|
|
360
|
+
if (alternativeAnswerCheck) {
|
|
361
|
+
showAlternativeAnswersComponent.steps.clickShowAlternativeAnswersToggle();
|
|
362
|
+
dragAndDropIntoCategoriesPage.steps.verifyCorrectAnswerResponsesInAlternateAnswerSection([
|
|
363
|
+
{
|
|
364
|
+
correctAnswers: [['Bat'], ['Eagle', 'Parrot'], ['Platypus'], ['Ostrich'], ['Whale'], []],
|
|
365
|
+
pointsText: '(Points per correct option - 5 points)',
|
|
366
|
+
},
|
|
367
|
+
{
|
|
368
|
+
correctAnswers: [['Flying squirrel'], ['Eagle', 'Peacock'], ['Ostrich'], ['Platypus'], ['Octopus'], []],
|
|
369
|
+
pointsText: '(Points per correct option - 3 points)',
|
|
370
|
+
}
|
|
371
|
+
]);
|
|
372
|
+
} else {
|
|
373
|
+
dragAndDropIntoCategoriesPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([['Bat'], ['Eagle', 'Parrot'], ['Platypus'], ['Ostrich'], ['Whale'], []], ['1', '2', '3', '4', '5', '6']);
|
|
374
|
+
}
|
|
260
375
|
dragAndDropIntoCategoriesPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
|
261
376
|
/*cy.log('When the user has attempted the question such that more number of dropzones are correct as per the alternative accordion mapping than the correct accordion mapping and points achieved from the alternative accordion mapping is more than the points achieved from correct accordion mapping and clicks on \'Check answer\' button, then correct icon should be displayed besides alternative accordion responses, incorrect icon should be displayed besides the correct accordion responses, correct icon should be displayed for correct dropzone, incorrect icon should be displayed for incorrect dropzone. correct/incorrect answer status message and correct answer section should not be displayed')
|
|
262
377
|
dragAndDropIntoCategoriesPage.steps.checkAnswer();
|
|
@@ -291,7 +406,21 @@ describe('Create item page - Drag and drop into categories: Per dropzone with al
|
|
|
291
406
|
dragAndDropIntoCategoriesPage.steps.verifyCorrectIconForEmptyContainer(5);
|
|
292
407
|
dragAndDropIntoCategoriesPage.steps.verifyCorrectIncorrectIconsForDropzone({ 'incorrect': 0, 'incorrect': 1, 'incorrect': 2, 'correct': 3, 'incorrect': 4, 'correct': 5 });
|
|
293
408
|
dragAndDropIntoCategoriesPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
|
|
294
|
-
|
|
409
|
+
if (alternativeAnswerCheck) {
|
|
410
|
+
showAlternativeAnswersComponent.steps.clickShowAlternativeAnswersToggle();
|
|
411
|
+
dragAndDropIntoCategoriesPage.steps.verifyCorrectAnswerResponsesInAlternateAnswerSection([
|
|
412
|
+
{
|
|
413
|
+
correctAnswers: [['Bat'], ['Eagle', 'Parrot'], ['Platypus'], ['Ostrich'], ['Whale'], []],
|
|
414
|
+
pointsText: '(Points per correct option - 5 points)',
|
|
415
|
+
},
|
|
416
|
+
{
|
|
417
|
+
correctAnswers: [['Flying squirrel'], ['Eagle', 'Peacock'], ['Ostrich'], ['Platypus'], ['Octopus'], []],
|
|
418
|
+
pointsText: '(Points per correct option - 3 points)',
|
|
419
|
+
}
|
|
420
|
+
]);
|
|
421
|
+
} else {
|
|
422
|
+
dragAndDropIntoCategoriesPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([['Bat'], ['Eagle', 'Parrot'], ['Platypus'], ['Ostrich'], ['Whale'], []], ['1', '2', '3', '4', '5', '6']);
|
|
423
|
+
}
|
|
295
424
|
dragAndDropIntoCategoriesPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
|
296
425
|
/*cy.log('When the user has attempted the question such that more number of dropzones are correct according to the alternative accordion mapping and points achieved from the correct accordion mapping is equal to the points achieved from alternative accordion mapping and clicks on \'Check answer\' button, then correct icon should be displayed besides correct accordion responses, incorrect icon should be displayed besides the alternative accordion responses, correct icon should be displayed for correct dropzone, incorrect icon should be displayed for incorrect dropzone. correct/incorrect answer status message and correct answer section should not be displayed')
|
|
297
426
|
dragAndDropIntoCategoriesPage.steps.checkAnswer();
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { dialogBoxBase, dragAndDropIntoCategoriesPage, gradingViewPage, itemPreviewPage, studentViewPage } from "../../../pages";
|
|
2
|
+
import { showAlternativeAnswersComponent } from "../../../pages/components";
|
|
2
3
|
import abortEarlySetup from "../../../support/helpers/abortEarly";
|
|
3
4
|
import utilities from "../../../support/helpers/utilities";
|
|
4
5
|
const grepTags = Cypress.env('grepTags');
|
|
5
6
|
let correctAnswerViews = ['Question preview', 'Item preview', 'Grading view'];
|
|
6
7
|
const views = utilities.getViews(correctAnswerViews);
|
|
7
8
|
let itemReferenceID = "";
|
|
9
|
+
const alternativeAnswerCheck = Cypress.env('ENABLE_ALTERNATIVE_ANSWER_ENHANCEMENT') === 'true';
|
|
8
10
|
|
|
9
11
|
describe('Create item page - Drag and drop into categories: All or nothing ', () => {
|
|
10
12
|
before(() => {
|
|
@@ -116,7 +118,11 @@ describe('Create item page - Drag and drop into categories: All or nothing ', ()
|
|
|
116
118
|
dragAndDropIntoCategoriesPage.steps.verifyPreviewTabPointsBackgroundForIncorrectOrPartiallyCorrectAnswer();
|
|
117
119
|
};
|
|
118
120
|
dragAndDropIntoCategoriesPage.steps.verifyDropzoneCellNumeration(['1', '2', '3', '4', '5', '6']);
|
|
119
|
-
|
|
121
|
+
if (alternativeAnswerCheck) {
|
|
122
|
+
showAlternativeAnswersComponent.steps.verifyCorrectAnswersLabelAndPointVisible('(20 points)');
|
|
123
|
+
} else {
|
|
124
|
+
utilities.verifyInnerText(dragAndDropIntoCategoriesPage.correctAnswersLabel(), 'Correct answers');
|
|
125
|
+
}
|
|
120
126
|
dragAndDropIntoCategoriesPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
|
|
121
127
|
dragAndDropIntoCategoriesPage.steps.verifyCorrectIncorrectIconsNotExist();
|
|
122
128
|
dragAndDropIntoCategoriesPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([['Bat'], ['Eagle', 'Parrot'], ['Platypus'], ['Ostrich'], ['Whale'], []], ['1', '2', '3', '4', '5', '6']);
|
|
@@ -242,6 +248,271 @@ describe('Create item page - Drag and drop into categories: All or nothing ', ()
|
|
|
242
248
|
});
|
|
243
249
|
});
|
|
244
250
|
|
|
251
|
+
if (alternativeAnswerCheck) {
|
|
252
|
+
views.forEach((view) => {
|
|
253
|
+
describe(`${view}: Auto scored - All or nothing scoring`, { tags: 'smoke' }, () => {
|
|
254
|
+
abortEarlySetup();
|
|
255
|
+
before(() => {
|
|
256
|
+
switch (view) {
|
|
257
|
+
case 'Question preview':
|
|
258
|
+
dragAndDropIntoCategoriesPage.steps.navigateToCreateQuestion('drag and drop into categories');
|
|
259
|
+
cy.barsPreLoaderWait();
|
|
260
|
+
dragAndDropIntoCategoriesPage.steps.addTextInQuestionInstructionsInputField('Drag and drop options in correct categories');
|
|
261
|
+
dragAndDropIntoCategoriesPage.steps.setRowsAndColumnsForQuestion();
|
|
262
|
+
dragAndDropIntoCategoriesPage.steps.addMultipleOptionFields(5);
|
|
263
|
+
dragAndDropIntoCategoriesPage.steps.allotPoints(20);
|
|
264
|
+
dragAndDropIntoCategoriesPage.steps.addInputToOptionsInputField(['Bat', 'Eagle', 'Parrot', 'Whale', 'Platypus', 'Ostrich', 'Flying squirrel']);
|
|
265
|
+
dragAndDropIntoCategoriesPage.steps.expandMaxCapacityPerDropzoneDropdown();
|
|
266
|
+
dragAndDropIntoCategoriesPage.steps.selectOptionFromMaxCapacityPerDropzoneDropdown('4');
|
|
267
|
+
dragAndDropIntoCategoriesPage.steps.clickAndDropOptionInDropzoneSpecifyCorrectAnswerSection({ 'Bat': 0, 'Eagle': 1, 'Parrot': 1, 'Platypus': 2, 'Ostrich': 3, 'Whale': 4 });
|
|
268
|
+
dragAndDropIntoCategoriesPage.steps.addAlternativeAnswerAccordion(1);
|
|
269
|
+
dragAndDropIntoCategoriesPage.steps.allotPoints(10);
|
|
270
|
+
dragAndDropIntoCategoriesPage.steps.clickAndDropOptionInDropzoneSpecifyCorrectAnswerSection({ 'Flying squirrel': 0, 'Eagle': 1, 'Parrot': 1, 'Ostrich': 3, 'Platypus': 4 });
|
|
271
|
+
dragAndDropIntoCategoriesPage.steps.switchToPreviewTab();
|
|
272
|
+
break;
|
|
273
|
+
case 'Item preview':
|
|
274
|
+
cy.visit(`/item-engine/demo/edit-item/${utilities.base64Encoding(itemReferenceID)}`);
|
|
275
|
+
itemPreviewPage.steps.switchToPreviewTab();
|
|
276
|
+
break;
|
|
277
|
+
case 'Grading view':
|
|
278
|
+
cy.visit(`/item-engine/demo/render-item/student-view/${utilities.base64Encoding(itemReferenceID)}`);
|
|
279
|
+
break;
|
|
280
|
+
};
|
|
281
|
+
});
|
|
282
|
+
|
|
283
|
+
beforeEach(() => {
|
|
284
|
+
switch (view) {
|
|
285
|
+
case 'Question preview':
|
|
286
|
+
dragAndDropIntoCategoriesPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
|
287
|
+
dragAndDropIntoCategoriesPage.steps.resetQuestionPreview();
|
|
288
|
+
break;
|
|
289
|
+
case 'Item preview':
|
|
290
|
+
dragAndDropIntoCategoriesPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
|
291
|
+
itemPreviewPage.steps.resetQuestionPreview();
|
|
292
|
+
break;
|
|
293
|
+
case 'Grading view':
|
|
294
|
+
cy.visit(`/item-engine/demo/render-item/student-view/${utilities.base64Encoding(itemReferenceID)}`);
|
|
295
|
+
break;
|
|
296
|
+
}
|
|
297
|
+
});
|
|
298
|
+
|
|
299
|
+
if (view === 'Question preview') {
|
|
300
|
+
after(() => {
|
|
301
|
+
dragAndDropIntoCategoriesPage.steps.clickOnSaveQuestionButton();
|
|
302
|
+
utilities.verifyElementVisibilityState(itemPreviewPage.referenceID(), 'visible');
|
|
303
|
+
itemReferenceID = itemPreviewPage.steps.getItemReferenceID();
|
|
304
|
+
});
|
|
305
|
+
};
|
|
306
|
+
|
|
307
|
+
it('When the user selects \'Grading\' view without attempting the question, cell numeration should be displayed, correct answers section should be displayed with correct answers, correct/incorrect status message should not be displayed and respective cell numeration', () => {
|
|
308
|
+
if (view === 'Grading view') {
|
|
309
|
+
studentViewPage.steps.submitResponse();
|
|
310
|
+
utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'visible');
|
|
311
|
+
studentViewPage.steps.clickOnGoToGradingViewButton();
|
|
312
|
+
gradingViewPage.steps.verifyGradingViewScore(0, 20);
|
|
313
|
+
};
|
|
314
|
+
if (view === 'Question preview' || view === 'Item preview') {
|
|
315
|
+
dragAndDropIntoCategoriesPage.steps.verifyPreviewScore(0, 20);
|
|
316
|
+
dragAndDropIntoCategoriesPage.steps.switchToGradingView();
|
|
317
|
+
dragAndDropIntoCategoriesPage.steps.verifyPreviewTabPointsBackgroundForIncorrectOrPartiallyCorrectAnswer();
|
|
318
|
+
};
|
|
319
|
+
dragAndDropIntoCategoriesPage.steps.verifyDropzoneCellNumeration(['1', '2', '3', '4', '5', '6']);
|
|
320
|
+
dragAndDropIntoCategoriesPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
|
|
321
|
+
dragAndDropIntoCategoriesPage.steps.verifyCorrectIncorrectIconsNotExist();
|
|
322
|
+
if (alternativeAnswerCheck) {
|
|
323
|
+
showAlternativeAnswersComponent.steps.clickShowAlternativeAnswersToggle();
|
|
324
|
+
dragAndDropIntoCategoriesPage.steps.verifyCorrectAnswerResponsesInAlternateAnswerSection([
|
|
325
|
+
{
|
|
326
|
+
correctAnswers: [['Bat'], ['Eagle', 'Parrot'], ['Platypus'], ['Ostrich'], ['Whale'], []],
|
|
327
|
+
pointsText: '(20 points)',
|
|
328
|
+
},
|
|
329
|
+
{
|
|
330
|
+
correctAnswers: [['Flying squirrel'], ['Eagle', 'Parrot'], ['Ostrich'], ['Platypus'], [], []],
|
|
331
|
+
pointsText: '(10 points)',
|
|
332
|
+
}
|
|
333
|
+
]);
|
|
334
|
+
} else {
|
|
335
|
+
dragAndDropIntoCategoriesPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([['Bat'], ['Eagle', 'Parrot'], ['Platypus'], ['Ostrich'], ['Whale'], []], ['1', '2', '3', '4', '5', '6']);
|
|
336
|
+
}
|
|
337
|
+
});
|
|
338
|
+
|
|
339
|
+
it('When the user attempts the question incorrectly, then the user should be awarded 0 points and on switching to \'Grading\' view, incorrect icons should be displayed besides all incorrect responses, a status message with text \'Your answer is incorrect\' and correct answer section with all correct answers along with dropzone cell numeration should be displayed', () => {
|
|
340
|
+
dragAndDropIntoCategoriesPage.steps.clickAndDropOptionInDropzonePreviewTab({ 'Platypus': 0 });
|
|
341
|
+
if (view === 'Grading view') {
|
|
342
|
+
studentViewPage.steps.submitResponse();
|
|
343
|
+
utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'visible');
|
|
344
|
+
studentViewPage.steps.clickOnGoToGradingViewButton();
|
|
345
|
+
gradingViewPage.steps.verifyGradingViewScore(0, 20);
|
|
346
|
+
};
|
|
347
|
+
if (view === 'Question preview' || view === 'Item preview') {
|
|
348
|
+
dragAndDropIntoCategoriesPage.steps.verifyPreviewScore(0, 20);
|
|
349
|
+
dragAndDropIntoCategoriesPage.steps.switchToGradingView();
|
|
350
|
+
};
|
|
351
|
+
dragAndDropIntoCategoriesPage.steps.verifyIncorrectOptionIcon(0);
|
|
352
|
+
dragAndDropIntoCategoriesPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
|
|
353
|
+
if (alternativeAnswerCheck) {
|
|
354
|
+
showAlternativeAnswersComponent.steps.clickShowAlternativeAnswersToggle();
|
|
355
|
+
dragAndDropIntoCategoriesPage.steps.verifyCorrectAnswerResponsesInAlternateAnswerSection([
|
|
356
|
+
{
|
|
357
|
+
correctAnswers: [['Bat'], ['Eagle', 'Parrot'], ['Platypus'], ['Ostrich'], ['Whale'], []],
|
|
358
|
+
pointsText: '(20 points)',
|
|
359
|
+
},
|
|
360
|
+
{
|
|
361
|
+
correctAnswers: [['Flying squirrel'], ['Eagle', 'Parrot'], ['Ostrich'], ['Platypus'], [], []],
|
|
362
|
+
pointsText: '(10 points)',
|
|
363
|
+
}
|
|
364
|
+
]);
|
|
365
|
+
} else {
|
|
366
|
+
dragAndDropIntoCategoriesPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([['Bat'], ['Eagle', 'Parrot'], ['Platypus'], ['Ostrich'], ['Whale'], []], ['1', '2', '3', '4', '5', '6']);
|
|
367
|
+
}
|
|
368
|
+
});
|
|
369
|
+
|
|
370
|
+
it('When the user attempts the question partially correct with some cells correct, some cells partially correct but incomplete, some cells partially correct with incorrect options, then the user should be awarded 0 points and on switching to \'Grading\' view, correct icon should be displayed besides the correct answer responses, incorrect icon should be displayed besides incorrect answer response, a status message with text \'Your answer is incorrect\' and correct answer section with all correct answers along with dropzone cell numeration should be displayed', () => {
|
|
371
|
+
if (view === 'Grading view') {
|
|
372
|
+
studentViewPage.steps.clearResponses();
|
|
373
|
+
};
|
|
374
|
+
dragAndDropIntoCategoriesPage.steps.clickAndDropOptionInDropzonePreviewTab({ 'Bat': 0, 'Eagle': 1, 'Parrot': 4, 'Whale': 4 });
|
|
375
|
+
if (view === 'Grading view') {
|
|
376
|
+
studentViewPage.steps.submitResponse();
|
|
377
|
+
utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'visible');
|
|
378
|
+
studentViewPage.steps.clickOnGoToGradingViewButton();
|
|
379
|
+
gradingViewPage.steps.verifyGradingViewScore(0, 20);
|
|
380
|
+
};
|
|
381
|
+
if (view === 'Question preview' || view === 'Item preview') {
|
|
382
|
+
dragAndDropIntoCategoriesPage.steps.verifyPreviewScore(0, 20);
|
|
383
|
+
dragAndDropIntoCategoriesPage.steps.switchToGradingView();
|
|
384
|
+
};
|
|
385
|
+
dragAndDropIntoCategoriesPage.steps.verifyCorrectOptionIcon(0);
|
|
386
|
+
dragAndDropIntoCategoriesPage.steps.verifyCorrectOptionIcon(1);
|
|
387
|
+
dragAndDropIntoCategoriesPage.steps.verifyIncorrectOptionIcon(2);
|
|
388
|
+
dragAndDropIntoCategoriesPage.steps.verifyCorrectOptionIcon(3);
|
|
389
|
+
dragAndDropIntoCategoriesPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
|
|
390
|
+
if (alternativeAnswerCheck) {
|
|
391
|
+
showAlternativeAnswersComponent.steps.clickShowAlternativeAnswersToggle();
|
|
392
|
+
dragAndDropIntoCategoriesPage.steps.verifyCorrectAnswerResponsesInAlternateAnswerSection([
|
|
393
|
+
{
|
|
394
|
+
correctAnswers: [['Bat'], ['Eagle', 'Parrot'], ['Platypus'], ['Ostrich'], ['Whale'], []],
|
|
395
|
+
pointsText: '(20 points)',
|
|
396
|
+
},
|
|
397
|
+
{
|
|
398
|
+
correctAnswers: [['Flying squirrel'], ['Eagle', 'Parrot'], ['Ostrich'], ['Platypus'], [], []],
|
|
399
|
+
pointsText: '(10 points)',
|
|
400
|
+
}
|
|
401
|
+
]);
|
|
402
|
+
} else {
|
|
403
|
+
dragAndDropIntoCategoriesPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([['Bat'], ['Eagle', 'Parrot'], ['Platypus'], ['Ostrich'], ['Whale'], []], ['1', '2', '3', '4', '5', '6']);
|
|
404
|
+
}
|
|
405
|
+
});
|
|
406
|
+
|
|
407
|
+
it('When the user attempts the question partially correct with all the cells correctly attempted but one cell incomplete, then the user should be awarded 0 points and on switching to \'Grading\' view, correct icon should be displayed besides the correct answer responses, incorrect icon should be displayed besides incorrect answer response, a status message with text \'Your answer is incorrect\' and correct answer section with all correct answers along with dropzone cell numeration should be displayed', () => {
|
|
408
|
+
if (view === 'Grading view') {
|
|
409
|
+
studentViewPage.steps.clearResponses();
|
|
410
|
+
};
|
|
411
|
+
dragAndDropIntoCategoriesPage.steps.clickAndDropOptionInDropzonePreviewTab({ 'Bat': 0, 'Eagle': 1, 'Platypus': 2, 'Ostrich': 3, 'Whale': 4 })
|
|
412
|
+
if (view === 'Grading view') {
|
|
413
|
+
studentViewPage.steps.submitResponse();
|
|
414
|
+
utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'visible');
|
|
415
|
+
studentViewPage.steps.clickOnGoToGradingViewButton();
|
|
416
|
+
gradingViewPage.steps.verifyGradingViewScore(0, 20);
|
|
417
|
+
};
|
|
418
|
+
if (view === 'Question preview' || view === 'Item preview') {
|
|
419
|
+
dragAndDropIntoCategoriesPage.steps.verifyPreviewScore(0, 20);
|
|
420
|
+
dragAndDropIntoCategoriesPage.steps.switchToGradingView();
|
|
421
|
+
};
|
|
422
|
+
dragAndDropIntoCategoriesPage.steps.verifyCorrectOptionIcon(0);
|
|
423
|
+
dragAndDropIntoCategoriesPage.steps.verifyCorrectOptionIcon(1);
|
|
424
|
+
dragAndDropIntoCategoriesPage.steps.verifyCorrectOptionIcon(2);
|
|
425
|
+
dragAndDropIntoCategoriesPage.steps.verifyCorrectOptionIcon(3);
|
|
426
|
+
dragAndDropIntoCategoriesPage.steps.verifyCorrectOptionIcon(4);
|
|
427
|
+
dragAndDropIntoCategoriesPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
|
|
428
|
+
if (alternativeAnswerCheck) {
|
|
429
|
+
showAlternativeAnswersComponent.steps.clickShowAlternativeAnswersToggle();
|
|
430
|
+
dragAndDropIntoCategoriesPage.steps.verifyCorrectAnswerResponsesInAlternateAnswerSection([
|
|
431
|
+
{
|
|
432
|
+
correctAnswers: [['Bat'], ['Eagle', 'Parrot'], ['Platypus'], ['Ostrich'], ['Whale'], []],
|
|
433
|
+
pointsText: '(20 points)',
|
|
434
|
+
},
|
|
435
|
+
{
|
|
436
|
+
correctAnswers: [['Flying squirrel'], ['Eagle', 'Parrot'], ['Ostrich'], ['Platypus'], [], []],
|
|
437
|
+
pointsText: '(10 points)',
|
|
438
|
+
}
|
|
439
|
+
]);
|
|
440
|
+
} else {
|
|
441
|
+
dragAndDropIntoCategoriesPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([['Bat'], ['Eagle', 'Parrot'], ['Platypus'], ['Ostrich'], ['Whale'], []], ['1', '2', '3', '4', '5', '6']);
|
|
442
|
+
}
|
|
443
|
+
});
|
|
444
|
+
|
|
445
|
+
it('When the user attempts the question partially correct with all the cells correctly attempted but with an extra option which is not set as correct answer, then the user should be awarded 0 points and on switching to \'Grading\' view, correct icon should be displayed besides the correct answer responses, incorrect icon should be displayed besides incorrect answer response, a status message with text \'Your answer is incorrect\' and correct answer section with all correct answers along with dropzone cell numeration should be displayed', () => {
|
|
446
|
+
if (view === 'Grading view') {
|
|
447
|
+
studentViewPage.steps.clearResponses();
|
|
448
|
+
};
|
|
449
|
+
dragAndDropIntoCategoriesPage.steps.clickAndDropOptionInDropzonePreviewTab({ 'Bat': 0, 'Eagle': 1, 'Parrot': 1, 'Platypus': 2, 'Ostrich': 3, 'Whale': 4, 'Flying squirrel': 4 });
|
|
450
|
+
if (view === 'Grading view') {
|
|
451
|
+
studentViewPage.steps.submitResponse();
|
|
452
|
+
utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'visible');
|
|
453
|
+
studentViewPage.steps.clickOnGoToGradingViewButton();
|
|
454
|
+
gradingViewPage.steps.verifyGradingViewScore(0, 20);
|
|
455
|
+
};
|
|
456
|
+
if (view === 'Question preview' || view === 'Item preview') {
|
|
457
|
+
dragAndDropIntoCategoriesPage.steps.verifyPreviewScore(0, 20);
|
|
458
|
+
dragAndDropIntoCategoriesPage.steps.switchToGradingView();
|
|
459
|
+
};
|
|
460
|
+
dragAndDropIntoCategoriesPage.steps.verifyCorrectOptionIcon(0);
|
|
461
|
+
dragAndDropIntoCategoriesPage.steps.verifyCorrectOptionIcon(1);
|
|
462
|
+
dragAndDropIntoCategoriesPage.steps.verifyCorrectOptionIcon(2);
|
|
463
|
+
dragAndDropIntoCategoriesPage.steps.verifyCorrectOptionIcon(3);
|
|
464
|
+
dragAndDropIntoCategoriesPage.steps.verifyCorrectOptionIcon(4);
|
|
465
|
+
dragAndDropIntoCategoriesPage.steps.verifyCorrectOptionIcon(5);
|
|
466
|
+
dragAndDropIntoCategoriesPage.steps.verifyIncorrectOptionIcon(6);
|
|
467
|
+
dragAndDropIntoCategoriesPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
|
|
468
|
+
if (alternativeAnswerCheck) {
|
|
469
|
+
showAlternativeAnswersComponent.steps.clickShowAlternativeAnswersToggle();
|
|
470
|
+
dragAndDropIntoCategoriesPage.steps.verifyCorrectAnswerResponsesInAlternateAnswerSection([
|
|
471
|
+
{
|
|
472
|
+
correctAnswers: [['Bat'], ['Eagle', 'Parrot'], ['Platypus'], ['Ostrich'], ['Whale'], []],
|
|
473
|
+
pointsText: '(20 points)',
|
|
474
|
+
},
|
|
475
|
+
{
|
|
476
|
+
correctAnswers: [['Flying squirrel'], ['Eagle', 'Parrot'], ['Ostrich'], ['Platypus'], [], []],
|
|
477
|
+
pointsText: '(10 points)',
|
|
478
|
+
}
|
|
479
|
+
]);
|
|
480
|
+
} else {
|
|
481
|
+
dragAndDropIntoCategoriesPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([['Bat'], ['Eagle', 'Parrot'], ['Platypus'], ['Ostrich'], ['Whale'], []], ['1', '2', '3', '4', '5', '6']);
|
|
482
|
+
}
|
|
483
|
+
});
|
|
484
|
+
|
|
485
|
+
it(`${view} - When user attempts the question correctly, the user should be awarded full points and on switching to 'Grading' view, then correct icons should be displayed beside all the correct responses, correct icon should be displayed besides the correct answer responses, a status message with text 'Your answer is correct' and correct answer section should not be displayed`, () => {
|
|
486
|
+
if (view === 'Grading view') {
|
|
487
|
+
studentViewPage.steps.clearResponses();
|
|
488
|
+
};
|
|
489
|
+
dragAndDropIntoCategoriesPage.steps.clickAndDropOptionInDropzonePreviewTab({ 'Bat': 0, 'Eagle': 1, 'Parrot': 1, 'Platypus': 2, 'Ostrich': 3, 'Whale': 4 });
|
|
490
|
+
if (view === 'Grading view') {
|
|
491
|
+
studentViewPage.steps.submitResponse();
|
|
492
|
+
utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'visible');
|
|
493
|
+
studentViewPage.steps.clickOnGoToGradingViewButton();
|
|
494
|
+
gradingViewPage.steps.verifyGradingViewScore(20, 20);
|
|
495
|
+
};
|
|
496
|
+
if (view === 'Question preview' || view === 'Item preview') {
|
|
497
|
+
dragAndDropIntoCategoriesPage.steps.verifyPreviewScore(20, 20);
|
|
498
|
+
dragAndDropIntoCategoriesPage.steps.switchToGradingView();
|
|
499
|
+
dragAndDropIntoCategoriesPage.steps.verifyPreviewTabPointsBackgroundForCorrectAnswer();
|
|
500
|
+
};
|
|
501
|
+
dragAndDropIntoCategoriesPage.steps.verifyCorrectOptionIcon(0);
|
|
502
|
+
dragAndDropIntoCategoriesPage.steps.verifyCorrectOptionIcon(1);
|
|
503
|
+
dragAndDropIntoCategoriesPage.steps.verifyCorrectOptionIcon(2);
|
|
504
|
+
dragAndDropIntoCategoriesPage.steps.verifyCorrectOptionIcon(3);
|
|
505
|
+
dragAndDropIntoCategoriesPage.steps.verifyCorrectOptionIcon(4);
|
|
506
|
+
dragAndDropIntoCategoriesPage.steps.verifyCorrectOptionIcon(5);
|
|
507
|
+
//Need to remove comment once https://redmine.zeuslearning.com/issues/577009 is resolved
|
|
508
|
+
// dragAndDropIntoCategoriesPage.steps.verifyCorrectIncorrectAnswerLabel('correct');
|
|
509
|
+
dragAndDropIntoCategoriesPage.steps.verifyCorrectAnswerSectionNotExists();
|
|
510
|
+
cy.eyesCheckWindow(`${view} - DND - Correct attempt`);
|
|
511
|
+
});
|
|
512
|
+
});
|
|
513
|
+
});
|
|
514
|
+
}
|
|
515
|
+
|
|
245
516
|
views.forEach((view) => {
|
|
246
517
|
//https://weldnorthed.atlassian.net/browse/IEI-4998
|
|
247
518
|
describe(`${view}: Drag and drop into categories - Manually scored`, { tags: 'smoke' }, () => {
|
|
@@ -39,6 +39,7 @@ const selectors = {
|
|
|
39
39
|
dropzoneCellPreviewTab: () => cy.get('[class*="question-preview-wrapper"] [class*="CellDropZonestyles__CellContainer"][class*="dropzone-cell"],[class*="question-preview-wrapper"] [class*="DropzoneCellstyles__StyledCell"]'),
|
|
40
40
|
dropzoneCellNumeration: () => cy.get('.answer-numeration-number-box'),
|
|
41
41
|
correctAnswerDropzoneCell: () => cy.get('[class*="Matrixstyles__AnswerCell"]'),
|
|
42
|
+
correctAnswerPointsLabel: () => cy.get('[class*="CorrectAnswerSectionstyle__CorrectAnswerLabelWrapper"] p'),
|
|
42
43
|
correctAnswerDropzoneCellTickIcon: () => cy.get('[class*="Matrixstyles__GreenBlock"]'),
|
|
43
44
|
correctAnswersLabel: () => cy.get('.correct-answers-label'),
|
|
44
45
|
correctAnswerOption: () => cy.get('[class*="Matrixstyles__AnswerWrapper"]'),
|
|
@@ -514,6 +515,43 @@ const steps = {
|
|
|
514
515
|
});
|
|
515
516
|
},
|
|
516
517
|
|
|
518
|
+
/**
|
|
519
|
+
* Verifies the content of each correct-answer dropzone in the Alternate Answer section.
|
|
520
|
+
*
|
|
521
|
+
* For every entry in `correctAnswersArray`, this function:
|
|
522
|
+
* - Iterates through each set of correct answers assigned to a dropzone.
|
|
523
|
+
* - Confirms that the dropzone displays the expected cell numeration.
|
|
524
|
+
* - Verifies each answer option inside the dropzone.
|
|
525
|
+
* - Validates that the points label for the group matches the expected value.
|
|
526
|
+
*
|
|
527
|
+
* @param {Object[]} correctAnswersArray - An array where each object represents
|
|
528
|
+
* a group of correct answers and its metadata.
|
|
529
|
+
* @param {string[][]} correctAnswersArray[].correctAnswers - A list of answer-option groups for each dropzone.
|
|
530
|
+
* @param {number[]} correctAnswersArray[].cellIndexArray - Expected numeration values for corresponding dropzones.
|
|
531
|
+
* @param {string} correctAnswersArray[].pointsText - Expected points label for this group of dropzones.
|
|
532
|
+
*/
|
|
533
|
+
verifyCorrectAnswerResponsesInAlternateAnswerSection: (correctAnswersArray) => {
|
|
534
|
+
let dropzoneCellIndex = 0;
|
|
535
|
+
correctAnswersArray.forEach(({
|
|
536
|
+
correctAnswers,
|
|
537
|
+
pointsText,
|
|
538
|
+
}, index) => {
|
|
539
|
+
correctAnswers.forEach((correctAnswer) => {
|
|
540
|
+
dragAndDropIntoCategoriesPage.correctAnswerDropzoneCell()
|
|
541
|
+
.eq(dropzoneCellIndex)
|
|
542
|
+
.within(() => {
|
|
543
|
+
correctAnswer.forEach((answerOption, optionIndex) => {
|
|
544
|
+
utilities.verifyTextContent(utilities.getNthElement(dragAndDropIntoCategoriesPage.correctAnswerOption(), optionIndex), answerOption);
|
|
545
|
+
});
|
|
546
|
+
});
|
|
547
|
+
dropzoneCellIndex += 1;
|
|
548
|
+
});
|
|
549
|
+
dragAndDropIntoCategoriesPage.correctAnswerPointsLabel()
|
|
550
|
+
.eq(index)
|
|
551
|
+
.should('have.text', pointsText);
|
|
552
|
+
});
|
|
553
|
+
},
|
|
554
|
+
|
|
517
555
|
/**
|
|
518
556
|
* Verifies the presence of an incorrect option icon for a specified option in the Preview Tab.
|
|
519
557
|
* @param {number} optionIndex - The index of the option to verify.
|