itemengine-cypress-automation 1.0.579-IEI-7046-a317a6b.0 → 1.0.580-IEI-7040-1e744fc.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (43) hide show
  1. package/cypress/config-files/ilprod.json +2 -1
  2. package/cypress/config-files/ilqa.json +2 -1
  3. package/cypress/config-files/ilstage.json +2 -1
  4. package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/Scoring/allOrNothingAlternativePointsGreaterThanCorrectPoints.js +8 -123
  5. package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/Scoring/allOrNothingCorrectPointsEqualToAlternativePoints.js +8 -123
  6. package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/Scoring/allOrNothingCorrectPointsGreaterThanAlternativePoints.js +14 -131
  7. package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/Scoring/perCorrectOptionAlternativePointsGreaterThanCorrectPoints.js +9 -138
  8. package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/Scoring/perCorrectOptionCorrectPointsEqualToAlternativePoints.js +9 -138
  9. package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/Scoring/perCorrectOptionCorrectPointsGreaterThanAlternativePoints.js +10 -153
  10. package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/Scoring/perDropzoneAlternativePointsGreaterThanCorrectPoints.js +9 -138
  11. package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/Scoring/perDropzoneCorrectPointsEqualToAlternativePoints.js +7 -108
  12. package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/Scoring/perDropzoneCorrectPointsGreaterThanAlternativePoints.js +9 -138
  13. package/cypress/e2e/ILC/FillInTheGapsDropdownNew/Scoring/allOrNothingAlternativePointsGreaterThanCorrectPoints.js +135 -7
  14. package/cypress/e2e/ILC/FillInTheGapsDropdownNew/Scoring/allOrNothingCorrectPointsEqualToAlternativePoints.js +135 -7
  15. package/cypress/e2e/ILC/FillInTheGapsDropdownNew/Scoring/allOrNothingCorrectPointsGreaterThanAlternativePoints.js +136 -9
  16. package/cypress/e2e/ILC/FillInTheGapsDropdownNew/Scoring/checkScoringLabelBannerAndCorrectAnswer.js +7 -2
  17. package/cypress/e2e/ILC/FillInTheGapsDropdownNew/Scoring/partialDifferentWeightsAlternativePointsGreaterThanCorrectPoints.js +154 -8
  18. package/cypress/e2e/ILC/FillInTheGapsDropdownNew/Scoring/partialDifferentWeightsWithCorrectPointsEqualToAlternativePoints.js +154 -8
  19. package/cypress/e2e/ILC/FillInTheGapsDropdownNew/Scoring/partialDifferentWeightsWithCorrectPointsGreaterThanAlternativePoints.js +154 -8
  20. package/cypress/e2e/ILC/FillInTheGapsDropdownNew/Scoring/partialEqualWeightsWithAlternativePointsGreaterThanCorrectPoints.js +135 -7
  21. package/cypress/e2e/ILC/FillInTheGapsDropdownNew/Scoring/partialEqualWeightsWithCorrectPointsEqualToAlternativePoints.js +116 -7
  22. package/cypress/e2e/ILC/FillInTheGapsDropdownNew/Scoring/partialEqualWeightsWithCorrectPointsGreaterThanAlternativePoints.js +136 -8
  23. package/cypress/e2e/ILC/FillInTheGapsDropdownNew/Scoring/responseLevelAlternateAnswerBasicScoring.js +21 -2
  24. package/cypress/e2e/ILC/FillInTheGapsDropdownNew/allOrNothingForAllView.smoke.js +190 -2
  25. package/cypress/e2e/ILC/Matching/questionInstructionsAndPromptSection.js +17 -0
  26. package/cypress/e2e/ILC/MultipleSelection/previewContentsForAllViews.smoke.js +18 -0
  27. package/cypress/e2e/ILC/MultipleSelectionGridNew/previewContentsForAllViews.smoke.js +19 -0
  28. package/cypress/e2e/ILC/NumberLineLabel/editTabBasicSection.js +18 -0
  29. package/cypress/e2e/ILC/SingleSelection/previewContents.smoke.js +18 -0
  30. package/cypress/e2e/ILC/SingleSelectionGridNew/previewContentsForAllViews.smoke.js +19 -0
  31. package/cypress/e2e/ILC/TextEntryMath/editTabBasicSection.js +17 -0
  32. package/cypress/e2e/ILC/TextSelection/questionInstructionsAndQuestion.js +16 -0
  33. package/cypress/pages/components/ckEditorToolbar.js +20 -0
  34. package/cypress/pages/components/draggableOptionContainer.js +14 -0
  35. package/cypress/pages/components/gridQuestionCommonComponent.js +17 -1
  36. package/cypress/pages/components/optionsWrapperComponent.js +33 -2
  37. package/cypress/pages/components/questionInputFieldComponent.js +18 -2
  38. package/cypress/pages/dragAndDropIntoCategoriesPage.js +0 -38
  39. package/cypress/pages/fillInTheGapsDropdownPage.js +47 -2
  40. package/cypress/pages/matchingPage.js +18 -0
  41. package/cypress/pages/numberLineLabelPage.js +1 -0
  42. package/cypress/pages/textSelectionPage.js +17 -1
  43. package/package.json +1 -1
@@ -1,8 +1,5 @@
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';
6
3
 
7
4
  describe('Create item page - Drag and drop into categories: Per dropzone with alternative answers', () => {
8
5
  before(() => {
@@ -36,21 +33,7 @@ describe('Create item page - Drag and drop into categories: Per dropzone with al
36
33
  //Failing due to https://redmine.zeuslearning.com/issues/574339
37
34
  // dragAndDropIntoCategoriesPage.steps.verifyCorrectIncorrectIconsForDropzone({ 'incorrect': 0, 'incorrect': 1, 'incorrect': 2, 'incorrect': 3, 'incorrect': 4, 'correct': 5 });
38
35
  dragAndDropIntoCategoriesPage.steps.verifyPreviewScore(0, 30);
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
- }
36
+ dragAndDropIntoCategoriesPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([[], [], [], [], ['Bat'], ['Eagle', 'Parrot'], [], ['Platypus'], ['Ostrich'], [], ['Whale'], []], ['1', '2', '3', '4', '1', '2', '7', '3', '4', '10', '5', '6']);
54
37
  });
55
38
 
56
39
  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', () => {
@@ -123,21 +106,7 @@ describe('Create item page - Drag and drop into categories: Per dropzone with al
123
106
  dragAndDropIntoCategoriesPage.steps.verifyIncorrectIconForEmptyContainer(4);
124
107
  dragAndDropIntoCategoriesPage.steps.verifyCorrectIconForEmptyContainer(5);
125
108
  dragAndDropIntoCategoriesPage.steps.verifyCorrectIncorrectIconsForDropzone({ 'correct': 0, 'incorrect': 1, 'incorrect': 2, 'incorrect': 3, 'incorrect': 4, 'correct': 5 });
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
- }
109
+ dragAndDropIntoCategoriesPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([[], [], [], [], ['Bat'], ['Eagle', 'Parrot'], [], ['Platypus'], ['Ostrich'], [], ['Whale'], []], ['1', '2', '3', '4', '1', '2', '7', '3', '4', '10', '5', '6']);
141
110
  dragAndDropIntoCategoriesPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
142
111
  dragAndDropIntoCategoriesPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
143
112
  /*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')
@@ -162,21 +131,7 @@ describe('Create item page - Drag and drop into categories: Per dropzone with al
162
131
  dragAndDropIntoCategoriesPage.steps.verifyIncorrectIconForEmptyContainer(4);
163
132
  dragAndDropIntoCategoriesPage.steps.verifyCorrectIncorrectIconsForDropzone({ 'correct': 0, 'incorrect': 1, 'correct': 2, 'incorrect': 3, 'incorrect': 4, 'correct': 5 });
164
133
  dragAndDropIntoCategoriesPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
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
- }
134
+ dragAndDropIntoCategoriesPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([[], [], [], [], ['Bat'], ['Eagle', 'Parrot'], [], ['Platypus'], ['Ostrich'], [], ['Whale'], []], ['1', '2', '3', '4', '1', '2', '7', '3', '4', '10', '5', '6']);
180
135
  dragAndDropIntoCategoriesPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
181
136
  /*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')
182
137
  dragAndDropIntoCategoriesPage.steps.checkAnswer();
@@ -201,21 +156,7 @@ describe('Create item page - Drag and drop into categories: Per dropzone with al
201
156
  dragAndDropIntoCategoriesPage.steps.verifyCorrectIconForEmptyContainer(5);
202
157
  dragAndDropIntoCategoriesPage.steps.verifyCorrectIncorrectIconsForDropzone({ 'incorrect': 0, 'incorrect': 1, 'incorrect': 2, 'incorrect': 3, 'incorrect': 4, 'correct': 5 });
203
158
  dragAndDropIntoCategoriesPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
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
- }
159
+ dragAndDropIntoCategoriesPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([[], [], [], [], ['Bat'], ['Eagle', 'Parrot'], [], ['Platypus'], ['Ostrich'], [], ['Whale'], []], ['1', '2', '3', '4', '1', '2', '7', '3', '4', '10', '5', '6']);
219
160
  dragAndDropIntoCategoriesPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
220
161
  /*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')
221
162
  dragAndDropIntoCategoriesPage.steps.checkAnswer();
@@ -239,21 +180,7 @@ describe('Create item page - Drag and drop into categories: Per dropzone with al
239
180
  dragAndDropIntoCategoriesPage.steps.verifyIncorrectIconForEmptyContainer(4);
240
181
  dragAndDropIntoCategoriesPage.steps.verifyCorrectIncorrectIconsForDropzone({ 'incorrect': 0, 'incorrect': 1, 'correct': 2, 'incorrect': 3, 'incorrect': 4, 'incorrect': 5 });
241
182
  dragAndDropIntoCategoriesPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
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
- }
183
+ dragAndDropIntoCategoriesPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([[], [], [], [], ['Bat'], ['Eagle', 'Parrot'], [], ['Platypus'], ['Ostrich'], [], ['Whale'], []], ['1', '2', '3', '4', '1', '2', '7', '3', '4', '10', '5', '6']);
257
184
  dragAndDropIntoCategoriesPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
258
185
  /*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')
259
186
  dragAndDropIntoCategoriesPage.steps.checkAnswer();
@@ -277,21 +204,7 @@ describe('Create item page - Drag and drop into categories: Per dropzone with al
277
204
  dragAndDropIntoCategoriesPage.steps.verifyCorrectIconForEmptyContainer(5);
278
205
  dragAndDropIntoCategoriesPage.steps.verifyCorrectIncorrectIconsForDropzone({ 'incorrect': 0, 'incorrect': 1, 'incorrect': 2, 'correct': 3, 'incorrect': 4, 'correct': 5 });
279
206
  dragAndDropIntoCategoriesPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
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
- }
207
+ dragAndDropIntoCategoriesPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([[], [], [], [], ['Bat'], ['Eagle', 'Parrot'], [], ['Platypus'], ['Ostrich'], [], ['Whale'], []], ['1', '2', '3', '4', '1', '2', '7', '3', '4', '10', '5', '6']);
295
208
  dragAndDropIntoCategoriesPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
296
209
  /*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')
297
210
  dragAndDropIntoCategoriesPage.steps.checkAnswer();
@@ -315,21 +228,7 @@ describe('Create item page - Drag and drop into categories: Per dropzone with al
315
228
  dragAndDropIntoCategoriesPage.steps.verifyCorrectIconForEmptyContainer(5);
316
229
  dragAndDropIntoCategoriesPage.steps.verifyCorrectIncorrectIconsForDropzone({ 'incorrect': 0, 'correct': 1, 'incorrect': 2, 'correct': 3, 'incorrect': 4, 'correct': 5 });
317
230
  dragAndDropIntoCategoriesPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
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
- }
231
+ dragAndDropIntoCategoriesPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([[], [], [], [], ['Bat'], ['Eagle', 'Parrot'], [], ['Platypus'], ['Ostrich'], [], ['Whale'], []], ['1', '2', '3', '4', '1', '2', '7', '3', '4', '10', '5', '6']);
333
232
  dragAndDropIntoCategoriesPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
334
233
  /*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')
335
234
  dragAndDropIntoCategoriesPage.steps.checkAnswer();
@@ -357,21 +256,7 @@ describe('Create item page - Drag and drop into categories: Per dropzone with al
357
256
  dragAndDropIntoCategoriesPage.steps.verifyIncorrectIconForEmptyContainer(3);
358
257
  dragAndDropIntoCategoriesPage.steps.verifyCorrectIncorrectIconsForDropzone({ 'correct': 0, 'incorrect': 1, 'correct': 2, 'incorrect': 3, 'correct': 4, 'correct': 5 });
359
258
  dragAndDropIntoCategoriesPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
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
- }
259
+ dragAndDropIntoCategoriesPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([[], [], [], [], ['Bat'], ['Eagle', 'Parrot'], [], ['Platypus'], ['Ostrich'], [], ['Whale'], []], ['1', '2', '3', '4', '1', '2', '7', '3', '4', '10', '5', '6']);
375
260
  dragAndDropIntoCategoriesPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
376
261
  /*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')
377
262
  dragAndDropIntoCategoriesPage.steps.checkAnswer();
@@ -406,21 +291,7 @@ describe('Create item page - Drag and drop into categories: Per dropzone with al
406
291
  dragAndDropIntoCategoriesPage.steps.verifyCorrectIconForEmptyContainer(5);
407
292
  dragAndDropIntoCategoriesPage.steps.verifyCorrectIncorrectIconsForDropzone({ 'incorrect': 0, 'incorrect': 1, 'incorrect': 2, 'correct': 3, 'incorrect': 4, 'correct': 5 });
408
293
  dragAndDropIntoCategoriesPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
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
- }
294
+ dragAndDropIntoCategoriesPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([[], [], [], [], ['Bat'], ['Eagle', 'Parrot'], [], ['Platypus'], ['Ostrich'], [], ['Whale'], []], ['1', '2', '3', '4', '1', '2', '7', '3', '4', '10', '5', '6']);
424
295
  dragAndDropIntoCategoriesPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
425
296
  /*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')
426
297
  dragAndDropIntoCategoriesPage.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(() => {
@@ -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
- fillInTheGapsDropdownPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(alternateAnswerArray);
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
- fillInTheGapsDropdownPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(alternateAnswerArray);
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
- fillInTheGapsDropdownPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(alternateAnswerArray);
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
- fillInTheGapsDropdownPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(alternateAnswerArray);
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
- fillInTheGapsDropdownPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(alternateAnswerArray);
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
- fillInTheGapsDropdownPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(alternateAnswerArray);
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
- fillInTheGapsDropdownPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(alternateAnswerArray);
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();