itemengine-cypress-automation 1.0.581-IEI-7178-328dd33.0 → 1.0.581-IEI-7046-ec54625.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.
Files changed (20) hide show
  1. package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/Scoring/allOrNothingAlternativePointsGreaterThanCorrectPoints.js +123 -8
  2. package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/Scoring/allOrNothingCorrectPointsEqualToAlternativePoints.js +123 -8
  3. package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/Scoring/allOrNothingCorrectPointsGreaterThanAlternativePoints.js +131 -14
  4. package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/Scoring/perCorrectOptionAlternativePointsGreaterThanCorrectPoints.js +138 -9
  5. package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/Scoring/perCorrectOptionCorrectPointsEqualToAlternativePoints.js +138 -9
  6. package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/Scoring/perCorrectOptionCorrectPointsGreaterThanAlternativePoints.js +153 -10
  7. package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/Scoring/perDropzoneAlternativePointsGreaterThanCorrectPoints.js +138 -9
  8. package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/Scoring/perDropzoneCorrectPointsEqualToAlternativePoints.js +108 -7
  9. package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/Scoring/perDropzoneCorrectPointsGreaterThanAlternativePoints.js +138 -9
  10. package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/allOrNothingBasicForAllViews.smoke.js +272 -1
  11. package/cypress/e2e/ILC/ShortTextResponseNew/Scoring/allOrNothingAlternativePointsGreaterThanCorrectPoints.js +2 -30
  12. package/cypress/e2e/ILC/ShortTextResponseNew/Scoring/allOrNothingCorrectPointsEqualToAlternativePoints.js +2 -30
  13. package/cypress/e2e/ILC/ShortTextResponseNew/Scoring/allOrNothingCorrectPointsGreaterThanAlternativePoints.js +2 -30
  14. package/cypress/e2e/ILC/ShortTextResponseNew/Scoring/allOrNothingWeightsBasic.js +7 -7
  15. package/cypress/e2e/ILC/ShortTextResponseNew/allOrNothingBasicForAllViews.smoke.js +3 -130
  16. package/cypress/e2e/ILC/dataApi/fetchQuestion.js +39 -0
  17. package/cypress/e2e/ILC/dataApi/saveQuestions.js +53 -0
  18. package/cypress/pages/dragAndDropIntoCategoriesPage.js +38 -0
  19. package/cypress/pages/shortTextResponsePage.js +6 -20
  20. 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, 'correct': 2, 'incorrect': 3, 'incorrect': 4, 'incorrect': 5 });
35
38
  dragAndDropIntoCategoriesPage.steps.verifyPreviewScore(0, 30);
36
- dragAndDropIntoCategoriesPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([[], [], [], [], ['Flying squirrel'], ['Eagle', 'Peacock'], [], [], ['Ostrich'], [], ['Platypus'], ['Octopus']], ['1', '2', '3', '4', '1', '2', '7', '3', '4', '10', '5', '6']);
39
+ if (alternativeAnswerCheck) {
40
+ showAlternativeAnswersComponent.steps.clickShowAlternativeAnswersToggle();
41
+ dragAndDropIntoCategoriesPage.steps.verifyCorrectAnswerResponsesInAlternateAnswerSection([
42
+ {
43
+ correctAnswers: [['Flying squirrel'], ['Eagle', 'Peacock'], ['Ostrich'], ['Platypus'], ['Octopus'], []],
44
+ pointsText: '(Points per correct option - 5 points)',
45
+ },
46
+ {
47
+ correctAnswers: [['Bat'], ['Eagle', 'Parrot'], ['Platypus'], ['Ostrich'], ['Whale'], []],
48
+ pointsText: '(Points per correct option - 3 points)',
49
+ }
50
+ ]);
51
+ } else {
52
+ dragAndDropIntoCategoriesPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([['Flying squirrel'], ['Eagle', 'Peacock'], ['Ostrich'], ['Platypus'], ['Octopus'], []], ['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 with points specified for correct accordion (less than full points) and on switching to \'Grading\' view, correct icons should be displayed beside all the correct responses and proper icon should display beside empty dropzones, correct icons should be displayed for all correct dropzones, 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
- dragAndDropIntoCategoriesPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([[], [], [], [], ['Flying squirrel'], ['Eagle', 'Peacock'], [], [], ['Ostrich'], [], ['Platypus'], ['Octopus']], ['1', '2', '3', '4', '1', '2', '7', '3', '4', '10', '5', '6']);
126
+ if (alternativeAnswerCheck) {
127
+ showAlternativeAnswersComponent.steps.clickShowAlternativeAnswersToggle();
128
+ dragAndDropIntoCategoriesPage.steps.verifyCorrectAnswerResponsesInAlternateAnswerSection([
129
+ {
130
+ correctAnswers: [['Flying squirrel'], ['Eagle', 'Peacock'], ['Ostrich'], ['Platypus'], ['Octopus'], []],
131
+ pointsText: '(Points per correct option - 5 points)',
132
+ },
133
+ {
134
+ correctAnswers: [['Bat'], ['Eagle', 'Parrot'], ['Platypus'], ['Ostrich'], ['Whale'], []],
135
+ pointsText: '(Points per correct option - 3 points)',
136
+ }
137
+ ]);
138
+ } else {
139
+ dragAndDropIntoCategoriesPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([['Flying squirrel'], ['Eagle', 'Peacock'], ['Ostrich'], ['Platypus'], ['Octopus'], []], ['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(5);
132
163
  dragAndDropIntoCategoriesPage.steps.verifyCorrectIncorrectIconsForDropzone({ 'correct': 0, 'incorrect': 1, 'correct': 2, 'incorrect': 3, 'incorrect': 4, 'incorrect': 5 });
133
164
  dragAndDropIntoCategoriesPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
134
- dragAndDropIntoCategoriesPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([[], [], [], [], ['Flying squirrel'], ['Eagle', 'Peacock'], [], [], ['Ostrich'], [], ['Platypus'], ['Octopus']], ['1', '2', '3', '4', '1', '2', '7', '3', '4', '10', '5', '6']);
165
+ if (alternativeAnswerCheck) {
166
+ showAlternativeAnswersComponent.steps.clickShowAlternativeAnswersToggle();
167
+ dragAndDropIntoCategoriesPage.steps.verifyCorrectAnswerResponsesInAlternateAnswerSection([
168
+ {
169
+ correctAnswers: [['Flying squirrel'], ['Eagle', 'Peacock'], ['Ostrich'], ['Platypus'], ['Octopus'], []],
170
+ pointsText: '(Points per correct option - 5 points)',
171
+ },
172
+ {
173
+ correctAnswers: [['Bat'], ['Eagle', 'Parrot'], ['Platypus'], ['Ostrich'], ['Whale'], []],
174
+ pointsText: '(Points per correct option - 3 points)',
175
+ }
176
+ ]);
177
+ } else {
178
+ dragAndDropIntoCategoriesPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([['Flying squirrel'], ['Eagle', 'Peacock'], ['Ostrich'], ['Platypus'], ['Octopus'], []], ['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();
@@ -155,7 +200,21 @@ describe('Create item page - Drag and drop into categories: Per dropzone with al
155
200
  dragAndDropIntoCategoriesPage.steps.verifyIncorrectIconForEmptyContainer(5);
156
201
  dragAndDropIntoCategoriesPage.steps.verifyCorrectIncorrectIconsForDropzone({ 'incorrect': 0, 'incorrect': 1, 'correct': 2, 'incorrect': 3, 'incorrect': 4, 'incorrect': 5 });
157
202
  dragAndDropIntoCategoriesPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
158
- dragAndDropIntoCategoriesPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([[], [], [], [], ['Flying squirrel'], ['Eagle', 'Peacock'], [], [], ['Ostrich'], [], ['Platypus'], ['Octopus']], ['1', '2', '3', '4', '1', '2', '7', '3', '4', '10', '5', '6']);
203
+ if (alternativeAnswerCheck) {
204
+ showAlternativeAnswersComponent.steps.clickShowAlternativeAnswersToggle();
205
+ dragAndDropIntoCategoriesPage.steps.verifyCorrectAnswerResponsesInAlternateAnswerSection([
206
+ {
207
+ correctAnswers: [['Flying squirrel'], ['Eagle', 'Peacock'], ['Ostrich'], ['Platypus'], ['Octopus'], []],
208
+ pointsText: '(Points per correct option - 5 points)',
209
+ },
210
+ {
211
+ correctAnswers: [['Bat'], ['Eagle', 'Parrot'], ['Platypus'], ['Ostrich'], ['Whale'], []],
212
+ pointsText: '(Points per correct option - 3 points)',
213
+ }
214
+ ]);
215
+ } else {
216
+ dragAndDropIntoCategoriesPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([['Flying squirrel'], ['Eagle', 'Peacock'], ['Ostrich'], ['Platypus'], ['Octopus'], []], ['1', '2', '3', '4', '5', '6']);
217
+ }
159
218
  dragAndDropIntoCategoriesPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
160
219
  /*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 alternative accordion responses, incorrect icon should be displayed besides the correct 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')
161
220
  dragAndDropIntoCategoriesPage.steps.checkAnswer();
@@ -178,7 +237,21 @@ describe('Create item page - Drag and drop into categories: Per dropzone with al
178
237
  dragAndDropIntoCategoriesPage.steps.verifyCorrectIconForEmptyContainer(5);
179
238
  dragAndDropIntoCategoriesPage.steps.verifyCorrectIncorrectIconsForDropzone({ 'incorrect': 0, 'incorrect': 1, 'incorrect': 2, 'incorrect': 3, 'incorrect': 4, 'correct': 5 });
180
239
  dragAndDropIntoCategoriesPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
181
- dragAndDropIntoCategoriesPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([[], [], [], [], ['Flying squirrel'], ['Eagle', 'Peacock'], [], [], ['Ostrich'], [], ['Platypus'], ['Octopus']], ['1', '2', '3', '4', '1', '2', '7', '3', '4', '10', '5', '6']);
240
+ if (alternativeAnswerCheck) {
241
+ showAlternativeAnswersComponent.steps.clickShowAlternativeAnswersToggle();
242
+ dragAndDropIntoCategoriesPage.steps.verifyCorrectAnswerResponsesInAlternateAnswerSection([
243
+ {
244
+ correctAnswers: [['Flying squirrel'], ['Eagle', 'Peacock'], ['Ostrich'], ['Platypus'], ['Octopus'], []],
245
+ pointsText: '(Points per correct option - 5 points)',
246
+ },
247
+ {
248
+ correctAnswers: [['Bat'], ['Eagle', 'Parrot'], ['Platypus'], ['Ostrich'], ['Whale'], []],
249
+ pointsText: '(Points per correct option - 3 points)',
250
+ }
251
+ ]);
252
+ } else {
253
+ dragAndDropIntoCategoriesPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([['Flying squirrel'], ['Eagle', 'Peacock'], ['Ostrich'], ['Platypus'], ['Octopus'], []], ['1', '2', '3', '4', '5', '6']);
254
+ }
182
255
  dragAndDropIntoCategoriesPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
183
256
  /*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 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')
184
257
  dragAndDropIntoCategoriesPage.steps.checkAnswer();
@@ -201,7 +274,21 @@ describe('Create item page - Drag and drop into categories: Per dropzone with al
201
274
  dragAndDropIntoCategoriesPage.steps.verifyIncorrectIconForEmptyContainer(5);
202
275
  dragAndDropIntoCategoriesPage.steps.verifyCorrectIncorrectIconsForDropzone({ 'incorrect': 0, 'incorrect': 1, 'correct': 2, 'correct': 3, 'incorrect': 4, 'incorrect': 5 });
203
276
  dragAndDropIntoCategoriesPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
204
- dragAndDropIntoCategoriesPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([[], [], [], [], ['Flying squirrel'], ['Eagle', 'Peacock'], [], [], ['Ostrich'], [], ['Platypus'], ['Octopus']], ['1', '2', '3', '4', '1', '2', '7', '3', '4', '10', '5', '6']);
277
+ if (alternativeAnswerCheck) {
278
+ showAlternativeAnswersComponent.steps.clickShowAlternativeAnswersToggle();
279
+ dragAndDropIntoCategoriesPage.steps.verifyCorrectAnswerResponsesInAlternateAnswerSection([
280
+ {
281
+ correctAnswers: [['Flying squirrel'], ['Eagle', 'Peacock'], ['Ostrich'], ['Platypus'], ['Octopus'], []],
282
+ pointsText: '(Points per correct option - 5 points)',
283
+ },
284
+ {
285
+ correctAnswers: [['Bat'], ['Eagle', 'Parrot'], ['Platypus'], ['Ostrich'], ['Whale'], []],
286
+ pointsText: '(Points per correct option - 3 points)',
287
+ }
288
+ ]);
289
+ } else {
290
+ dragAndDropIntoCategoriesPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([['Flying squirrel'], ['Eagle', 'Peacock'], ['Ostrich'], ['Platypus'], ['Octopus'], []], ['1', '2', '3', '4', '5', '6']);
291
+ }
205
292
  dragAndDropIntoCategoriesPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
206
293
  /*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')
207
294
  dragAndDropIntoCategoriesPage.steps.checkAnswer();
@@ -225,7 +312,21 @@ describe('Create item page - Drag and drop into categories: Per dropzone with al
225
312
  dragAndDropIntoCategoriesPage.steps.verifyIncorrectIconForEmptyContainer(5);
226
313
  dragAndDropIntoCategoriesPage.steps.verifyCorrectIncorrectIconsForDropzone({ 'correct': 0, 'incorrect': 1, 'correct': 2, 'correct': 3, 'incorrect': 4, 'incorrect': 5 });
227
314
  dragAndDropIntoCategoriesPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
228
- dragAndDropIntoCategoriesPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([[], [], [], [], ['Flying squirrel'], ['Eagle', 'Peacock'], [], [], ['Ostrich'], [], ['Platypus'], ['Octopus']], ['1', '2', '3', '4', '1', '2', '7', '3', '4', '10', '5', '6']);
315
+ if (alternativeAnswerCheck) {
316
+ showAlternativeAnswersComponent.steps.clickShowAlternativeAnswersToggle();
317
+ dragAndDropIntoCategoriesPage.steps.verifyCorrectAnswerResponsesInAlternateAnswerSection([
318
+ {
319
+ correctAnswers: [['Flying squirrel'], ['Eagle', 'Peacock'], ['Ostrich'], ['Platypus'], ['Octopus'], []],
320
+ pointsText: '(Points per correct option - 5 points)',
321
+ },
322
+ {
323
+ correctAnswers: [['Bat'], ['Eagle', 'Parrot'], ['Platypus'], ['Ostrich'], ['Whale'], []],
324
+ pointsText: '(Points per correct option - 3 points)',
325
+ }
326
+ ]);
327
+ } else {
328
+ dragAndDropIntoCategoriesPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([['Flying squirrel'], ['Eagle', 'Peacock'], ['Ostrich'], ['Platypus'], ['Octopus'], []], ['1', '2', '3', '4', '5', '6']);
329
+ }
229
330
  dragAndDropIntoCategoriesPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
230
331
  /*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 alternative accordion responses, incorrect icon should be displayed besides 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')
231
332
  dragAndDropIntoCategoriesPage.steps.checkAnswer();
@@ -252,7 +353,21 @@ describe('Create item page - Drag and drop into categories: Per dropzone with al
252
353
  dragAndDropIntoCategoriesPage.steps.verifyIncorrectIconForEmptyContainer(3);
253
354
  dragAndDropIntoCategoriesPage.steps.verifyCorrectIncorrectIconsForDropzone({ 'correct': 0, 'correct': 1, 'correct': 2, 'incorrect': 3, 'correct': 4, 'incorrect': 5 });
254
355
  dragAndDropIntoCategoriesPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
255
- dragAndDropIntoCategoriesPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([[], [], [], [], ['Flying squirrel'], ['Eagle', 'Peacock'], [], [], ['Ostrich'], [], ['Platypus'], ['Octopus']], ['1', '2', '3', '4', '1', '2', '7', '3', '4', '10', '5', '6']);
356
+ if (alternativeAnswerCheck) {
357
+ showAlternativeAnswersComponent.steps.clickShowAlternativeAnswersToggle();
358
+ dragAndDropIntoCategoriesPage.steps.verifyCorrectAnswerResponsesInAlternateAnswerSection([
359
+ {
360
+ correctAnswers: [['Flying squirrel'], ['Eagle', 'Peacock'], ['Ostrich'], ['Platypus'], ['Octopus'], []],
361
+ pointsText: '(Points per correct option - 5 points)',
362
+ },
363
+ {
364
+ correctAnswers: [['Bat'], ['Eagle', 'Parrot'], ['Platypus'], ['Ostrich'], ['Whale'], []],
365
+ pointsText: '(Points per correct option - 3 points)',
366
+ }
367
+ ]);
368
+ } else {
369
+ dragAndDropIntoCategoriesPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([['Flying squirrel'], ['Eagle', 'Peacock'], ['Ostrich'], ['Platypus'], ['Octopus'], []], ['1', '2', '3', '4', '5', '6']);
370
+ }
256
371
  dragAndDropIntoCategoriesPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
257
372
  /*cy.log('When the user has attempted the question such that more number of dropzones are correct as per the correct accordion mapping (3 dropzones- one exclusively correct as per the correct accordion, one correct for both the accordions and one containing correct options from both the accordions) than the alternative accordion mapping (2 dropzones- one correct for both the accordions and one containing correct options from both the accordions) 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')
258
373
  dragAndDropIntoCategoriesPage.steps.checkAnswer();
@@ -285,7 +400,21 @@ describe('Create item page - Drag and drop into categories: Per dropzone with al
285
400
  dragAndDropIntoCategoriesPage.steps.verifyIncorrectIconForEmptyContainer(5);
286
401
  dragAndDropIntoCategoriesPage.steps.verifyCorrectIncorrectIconsForDropzone({ 'incorrect': 0, 'incorrect': 1, 'correct': 2, 'correct': 3, 'incorrect': 4, 'incorrect': 5 });
287
402
  dragAndDropIntoCategoriesPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
288
- dragAndDropIntoCategoriesPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([[], [], [], [], ['Flying squirrel'], ['Eagle', 'Peacock'], [], [], ['Ostrich'], [], ['Platypus'], ['Octopus']], ['1', '2', '3', '4', '1', '2', '7', '3', '4', '10', '5', '6']);
403
+ if (alternativeAnswerCheck) {
404
+ showAlternativeAnswersComponent.steps.clickShowAlternativeAnswersToggle();
405
+ dragAndDropIntoCategoriesPage.steps.verifyCorrectAnswerResponsesInAlternateAnswerSection([
406
+ {
407
+ correctAnswers: [['Flying squirrel'], ['Eagle', 'Peacock'], ['Ostrich'], ['Platypus'], ['Octopus'], []],
408
+ pointsText: '(Points per correct option - 5 points)',
409
+ },
410
+ {
411
+ correctAnswers: [['Bat'], ['Eagle', 'Parrot'], ['Platypus'], ['Ostrich'], ['Whale'], []],
412
+ pointsText: '(Points per correct option - 3 points)',
413
+ }
414
+ ]);
415
+ } else {
416
+ dragAndDropIntoCategoriesPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([['Flying squirrel'], ['Eagle', 'Peacock'], ['Ostrich'], ['Platypus'], ['Octopus'], []], ['1', '2', '3', '4', '5', '6']);
417
+ }
289
418
  dragAndDropIntoCategoriesPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
290
419
  /*cy.log('When the user has attempted the question such that more number of dropzones are correct according to the correct 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 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')
291
420
  dragAndDropIntoCategoriesPage.steps.checkAnswer();
@@ -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
- dragAndDropIntoCategoriesPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([[], [], [], [], ['Bat'], ['Eagle', 'Parrot'], [], ['Platypus'], ['Ostrich'], [], ['Whale'], []], ['1', '2', '3', '4', '1', '2', '7', '3', '4', '10', '5', '6']);
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 - 5 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 and proper icon should display beside empty container, correct icons should be displayed for all correct dropzones, 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
- dragAndDropIntoCategoriesPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([[], [], [], [], ['Bat'], ['Eagle', 'Parrot'], [], ['Platypus'], ['Ostrich'], [], ['Whale'], []], ['1', '2', '3', '4', '1', '2', '7', '3', '4', '10', '5', '6']);
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 - 5 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')
@@ -155,7 +186,21 @@ describe('Create item page - Drag and drop into categories: Per dropzone with al
155
186
  dragAndDropIntoCategoriesPage.steps.verifyCorrectIconForEmptyContainer(5);
156
187
  dragAndDropIntoCategoriesPage.steps.verifyCorrectIncorrectIconsForDropzone({ 'incorrect': 0, 'incorrect': 1, 'incorrect': 2, 'incorrect': 3, 'incorrect': 4, 'correct': 5 });
157
188
  dragAndDropIntoCategoriesPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
158
- dragAndDropIntoCategoriesPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([[], [], [], [], ['Bat'], ['Eagle', 'Parrot'], [], ['Platypus'], ['Ostrich'], [], ['Whale'], []], ['1', '2', '3', '4', '1', '2', '7', '3', '4', '10', '5', '6']);
189
+ if (alternativeAnswerCheck) {
190
+ showAlternativeAnswersComponent.steps.clickShowAlternativeAnswersToggle();
191
+ dragAndDropIntoCategoriesPage.steps.verifyCorrectAnswerResponsesInAlternateAnswerSection([
192
+ {
193
+ correctAnswers: [['Bat'], ['Eagle', 'Parrot'], ['Platypus'], ['Ostrich'], ['Whale'], []],
194
+ pointsText: '(Points per correct option - 5 points)',
195
+ },
196
+ {
197
+ correctAnswers: [['Flying squirrel'], ['Eagle', 'Peacock'], ['Ostrich'], ['Platypus'], ['Octopus'], []],
198
+ pointsText: '(Points per correct option - 5 points)',
199
+ }
200
+ ]);
201
+ } else {
202
+ dragAndDropIntoCategoriesPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([['Bat'], ['Eagle', 'Parrot'], ['Platypus'], ['Ostrich'], ['Whale'], []], ['1', '2', '3', '4', '5', '6']);
203
+ }
159
204
  dragAndDropIntoCategoriesPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
160
205
  /*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')
161
206
  dragAndDropIntoCategoriesPage.steps.checkAnswer();
@@ -179,7 +224,21 @@ describe('Create item page - Drag and drop into categories: Per dropzone with al
179
224
  dragAndDropIntoCategoriesPage.steps.verifyCorrectIconForEmptyContainer(5);
180
225
  dragAndDropIntoCategoriesPage.steps.verifyCorrectIncorrectIconsForDropzone({ 'incorrect': 0, 'incorrect': 1, 'correct': 2, 'incorrect': 3, 'incorrect': 4, 'correct': 5 });
181
226
  dragAndDropIntoCategoriesPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
182
- dragAndDropIntoCategoriesPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([[], [], [], [], ['Bat'], ['Eagle', 'Parrot'], [], ['Platypus'], ['Ostrich'], [], ['Whale'], []], ['1', '2', '3', '4', '1', '2', '7', '3', '4', '10', '5', '6']);
227
+ if (alternativeAnswerCheck) {
228
+ showAlternativeAnswersComponent.steps.clickShowAlternativeAnswersToggle();
229
+ dragAndDropIntoCategoriesPage.steps.verifyCorrectAnswerResponsesInAlternateAnswerSection([
230
+ {
231
+ correctAnswers: [['Bat'], ['Eagle', 'Parrot'], ['Platypus'], ['Ostrich'], ['Whale'], []],
232
+ pointsText: '(Points per correct option - 5 points)',
233
+ },
234
+ {
235
+ correctAnswers: [['Flying squirrel'], ['Eagle', 'Peacock'], ['Ostrich'], ['Platypus'], ['Octopus'], []],
236
+ pointsText: '(Points per correct option - 5 points)',
237
+ }
238
+ ]);
239
+ } else {
240
+ dragAndDropIntoCategoriesPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([['Bat'], ['Eagle', 'Parrot'], ['Platypus'], ['Ostrich'], ['Whale'], []], ['1', '2', '3', '4', '5', '6']);
241
+ }
183
242
  dragAndDropIntoCategoriesPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
184
243
  /*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')
185
244
  dragAndDropIntoCategoriesPage.steps.checkAnswer();
@@ -203,7 +262,21 @@ describe('Create item page - Drag and drop into categories: Per dropzone with al
203
262
  dragAndDropIntoCategoriesPage.steps.verifyCorrectIconForEmptyContainer(5);
204
263
  dragAndDropIntoCategoriesPage.steps.verifyCorrectIncorrectIconsForDropzone({ 'incorrect': 0, 'incorrect': 1, 'incorrect': 2, 'correct': 3, 'incorrect': 4, 'correct': 5 });
205
264
  dragAndDropIntoCategoriesPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
206
- dragAndDropIntoCategoriesPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([[], [], [], [], ['Bat'], ['Eagle', 'Parrot'], [], ['Platypus'], ['Ostrich'], [], ['Whale'], []], ['1', '2', '3', '4', '1', '2', '7', '3', '4', '10', '5', '6']);
265
+ if (alternativeAnswerCheck) {
266
+ showAlternativeAnswersComponent.steps.clickShowAlternativeAnswersToggle();
267
+ dragAndDropIntoCategoriesPage.steps.verifyCorrectAnswerResponsesInAlternateAnswerSection([
268
+ {
269
+ correctAnswers: [['Bat'], ['Eagle', 'Parrot'], ['Platypus'], ['Ostrich'], ['Whale'], []],
270
+ pointsText: '(Points per correct option - 5 points)',
271
+ },
272
+ {
273
+ correctAnswers: [['Flying squirrel'], ['Eagle', 'Peacock'], ['Ostrich'], ['Platypus'], ['Octopus'], []],
274
+ pointsText: '(Points per correct option - 5 points)',
275
+ }
276
+ ]);
277
+ } else {
278
+ dragAndDropIntoCategoriesPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([['Bat'], ['Eagle', 'Parrot'], ['Platypus'], ['Ostrich'], ['Whale'], []], ['1', '2', '3', '4', '5', '6']);
279
+ }
207
280
  dragAndDropIntoCategoriesPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
208
281
  /*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')
209
282
  dragAndDropIntoCategoriesPage.steps.checkAnswer();
@@ -227,7 +300,21 @@ describe('Create item page - Drag and drop into categories: Per dropzone with al
227
300
  dragAndDropIntoCategoriesPage.steps.verifyCorrectIconForEmptyContainer(5);
228
301
  dragAndDropIntoCategoriesPage.steps.verifyCorrectIncorrectIconsForDropzone({ 'incorrect': 0, 'correct': 1, 'incorrect': 2, 'correct': 3, 'incorrect': 4, 'correct': 5 });
229
302
  dragAndDropIntoCategoriesPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
230
- dragAndDropIntoCategoriesPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([[], [], [], [], ['Bat'], ['Eagle', 'Parrot'], [], ['Platypus'], ['Ostrich'], [], ['Whale'], []], ['1', '2', '3', '4', '1', '2', '7', '3', '4', '10', '5', '6']);
303
+ if (alternativeAnswerCheck) {
304
+ showAlternativeAnswersComponent.steps.clickShowAlternativeAnswersToggle();
305
+ dragAndDropIntoCategoriesPage.steps.verifyCorrectAnswerResponsesInAlternateAnswerSection([
306
+ {
307
+ correctAnswers: [['Bat'], ['Eagle', 'Parrot'], ['Platypus'], ['Ostrich'], ['Whale'], []],
308
+ pointsText: '(Points per correct option - 5 points)',
309
+ },
310
+ {
311
+ correctAnswers: [['Flying squirrel'], ['Eagle', 'Peacock'], ['Ostrich'], ['Platypus'], ['Octopus'], []],
312
+ pointsText: '(Points per correct option - 5 points)',
313
+ }
314
+ ]);
315
+ } else {
316
+ dragAndDropIntoCategoriesPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([['Bat'], ['Eagle', 'Parrot'], ['Platypus'], ['Ostrich'], ['Whale'], []], ['1', '2', '3', '4', '5', '6']);
317
+ }
231
318
  dragAndDropIntoCategoriesPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
232
319
  /*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')
233
320
  dragAndDropIntoCategoriesPage.steps.checkAnswer();
@@ -255,7 +342,21 @@ describe('Create item page - Drag and drop into categories: Per dropzone with al
255
342
  dragAndDropIntoCategoriesPage.steps.verifyIncorrectIconForEmptyContainer(3);
256
343
  dragAndDropIntoCategoriesPage.steps.verifyCorrectIncorrectIconsForDropzone({ 'correct': 0, 'incorrect': 1, 'correct': 2, 'incorrect': 3, 'correct': 4, 'correct': 5 });
257
344
  dragAndDropIntoCategoriesPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
258
- dragAndDropIntoCategoriesPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([[], [], [], [], ['Flying squirrel'], ['Eagle', 'Peacock'], [], [], ['Ostrich'], [], ['Platypus'], ['Octopus']], ['1', '2', '3', '4', '1', '2', '7', '3', '4', '10', '5', '6']);
345
+ if (alternativeAnswerCheck) {
346
+ showAlternativeAnswersComponent.steps.clickShowAlternativeAnswersToggle();
347
+ dragAndDropIntoCategoriesPage.steps.verifyCorrectAnswerResponsesInAlternateAnswerSection([
348
+ {
349
+ correctAnswers: [['Bat'], ['Eagle', 'Parrot'], ['Platypus'], ['Ostrich'], ['Whale'], []],
350
+ pointsText: '(Points per correct option - 5 points)',
351
+ },
352
+ {
353
+ correctAnswers: [['Flying squirrel'], ['Eagle', 'Peacock'], ['Ostrich'], ['Platypus'], ['Octopus'], []],
354
+ pointsText: '(Points per correct option - 5 points)',
355
+ }
356
+ ]);
357
+ } else {
358
+ dragAndDropIntoCategoriesPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([['Bat'], ['Eagle', 'Parrot'], ['Platypus'], ['Ostrich'], ['Whale'], []], ['1', '2', '3', '4', '5', '6']);
359
+ }
259
360
  dragAndDropIntoCategoriesPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
260
361
  /*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 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')
261
362
  dragAndDropIntoCategoriesPage.steps.checkAnswer();