itemengine-cypress-automation 1.0.583 → 1.0.584-IEI-7048-098328c.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 (89) hide show
  1. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/Scoring/allOrNothingGroupedScoring.js +1 -4
  2. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/Scoring/allOrNothingWithAlternativePointsGreaterThanCorrectPoints.js +8 -109
  3. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/Scoring/allOrNothingWithCorrectPointsEqualToAlternativePoints.js +8 -109
  4. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/Scoring/allOrNothingWithCorrectPointsGreaterThanAlternativePoints.js +8 -109
  5. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/Scoring/blankResponseScoring.js +2 -7
  6. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/Scoring/partialDifferentWeightsAlternativePointsGreaterThanCorrectPoints.js +10 -139
  7. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/Scoring/partialDifferentWeightsBasic.js +1 -4
  8. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/Scoring/partialDifferentWeightsWithCorrectPointsEqualToAlternativePoints.js +9 -124
  9. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/Scoring/partialDifferentWeightsWithCorrectPointsGreaterThanAlternativePoints.js +10 -139
  10. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/Scoring/partialEqualWeightsBasic.js +1 -4
  11. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/Scoring/partialEqualWeightsWithAlternativePointsGreaterThanCorrectPoints.js +9 -124
  12. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/Scoring/partialEqualWeightsWithCorrectPointsEqualToAlternativePoints.js +8 -109
  13. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/Scoring/partialEqualWeightsWithCorrectPointsGreaterThanAlternativePoints.js +9 -124
  14. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/allOrNothingForAllViews.smoke.js +2 -243
  15. package/cypress/e2e/ILC/ListOrderingDropdown/Scoring/allOrNothingAlternativePointsGreaterThanCorrectPoints.js +77 -0
  16. package/cypress/e2e/ILC/ListOrderingDropdown/Scoring/allOrNothingCorrectPointsEqualToAlternativePoints.js +78 -1
  17. package/cypress/e2e/ILC/ListOrderingDropdown/Scoring/allOrNothingCorrectPointsGreaterThanAlternativePoints.js +78 -1
  18. package/cypress/e2e/ILC/ListOrderingDropdown/Scoring/partialDifferentWeightsAlternativePointsGreaterThanCorrectPoints.js +104 -9
  19. package/cypress/e2e/ILC/ListOrderingDropdown/Scoring/partialDifferentWeightsBasic.js +4 -0
  20. package/cypress/e2e/ILC/ListOrderingDropdown/Scoring/partialDifferentWeightsCorrectPointsEqualToAlternativePoints.js +95 -0
  21. package/cypress/e2e/ILC/ListOrderingDropdown/Scoring/partialDifferentWeightsCorrectPointsGreaterThanAlternativePoints.js +95 -0
  22. package/cypress/e2e/ILC/ListOrderingDropdown/Scoring/partialEqualWeightsAlternativePointsGreaterThanCorrectPoints.js +84 -0
  23. package/cypress/e2e/ILC/ListOrderingDropdown/Scoring/partialEqualWeightsBasic.js +4 -0
  24. package/cypress/e2e/ILC/ListOrderingDropdown/Scoring/partialEqualWeightsCorrectPointsEqualToAlternativePoints.js +73 -0
  25. package/cypress/e2e/ILC/ListOrderingDropdown/Scoring/partialEqualWeightsCorrectPointsGreaterThanAlternativePoints.js +84 -0
  26. package/cypress/e2e/ILC/ListOrderingDropdown/allOrNothingForAllViews.smoke.js +187 -2
  27. package/cypress/e2e/ILC/ListOrderingNew/Scoring/allOrNothingAlternativePointsGreaterThanCorrectPoints.js +79 -1
  28. package/cypress/e2e/ILC/ListOrderingNew/Scoring/allOrNothingCorrectPointsEqualToAlternativePoints.js +79 -0
  29. package/cypress/e2e/ILC/ListOrderingNew/Scoring/allOrNothingCorrectPointsGreaterThanAlternativePoints.js +79 -0
  30. package/cypress/e2e/ILC/ListOrderingNew/Scoring/manuallyAndNonScored.js +4 -0
  31. package/cypress/e2e/ILC/ListOrderingNew/Scoring/partialDifferentWeightsAlternativePointsGreaterThanCorrectPoints.js +103 -0
  32. package/cypress/e2e/ILC/ListOrderingNew/Scoring/partialDifferentWeightsBasic.js +4 -0
  33. package/cypress/e2e/ILC/ListOrderingNew/Scoring/partialDifferentWeightsCorrectPointsEqualToAlternativePoints.js +103 -0
  34. package/cypress/e2e/ILC/ListOrderingNew/Scoring/partialDifferentWeightsCorrectPointsGreaterThanAlternativePoints.js +103 -0
  35. package/cypress/e2e/ILC/ListOrderingNew/Scoring/partialEqualWeightsAlternativePointsGreaterThanCorrectPoints.js +91 -0
  36. package/cypress/e2e/ILC/ListOrderingNew/Scoring/partialEqualWeightsBasic.js +4 -0
  37. package/cypress/e2e/ILC/ListOrderingNew/Scoring/partialEqualWeightsCorrectPointsEqualToAlternativePoints.js +79 -0
  38. package/cypress/e2e/ILC/ListOrderingNew/Scoring/partialEqualWeightsCorrectPointsGreaterThanAlternativePoints.js +91 -0
  39. package/cypress/e2e/ILC/ListOrderingNew/allOrNothingForAllViews.smoke.js +209 -5
  40. package/cypress/e2e/ILC/ListOrderingNew/horizontalOrientationAllOrNothingForAllViews.smoke.js +195 -1
  41. package/cypress/e2e/ILC/ListOrderingReorderAsASeperateList/HorizontalOrientation/partialDifferentWeightsCorrectPointsGreaterThanAlternativePoints.js +103 -0
  42. package/cypress/e2e/ILC/ListOrderingReorderAsASeperateList/Scoring/allOrNothingAlternativePointsGreaterThanCorrectPoints.js +85 -0
  43. package/cypress/e2e/ILC/ListOrderingReorderAsASeperateList/Scoring/allOrNothingCorrectPointsEqualToAlternativePoints.js +82 -0
  44. package/cypress/e2e/ILC/ListOrderingReorderAsASeperateList/Scoring/allOrNothingCorrectPointsGreaterThanAlternativePoints.js +85 -0
  45. package/cypress/e2e/ILC/ListOrderingReorderAsASeperateList/Scoring/partialDifferentWeightsAlternativePointsGreaterThanCorrectPoints.js +109 -6
  46. package/cypress/e2e/ILC/ListOrderingReorderAsASeperateList/Scoring/partialDifferentWeightsBasic.js +4 -0
  47. package/cypress/e2e/ILC/ListOrderingReorderAsASeperateList/Scoring/partialDifferentWeightsCorrectPointsEqualToAlternativePoints.js +103 -0
  48. package/cypress/e2e/ILC/ListOrderingReorderAsASeperateList/Scoring/partialDifferentWeightsCorrectPointsGreaterThanAlternativePoints.js +103 -0
  49. package/cypress/e2e/ILC/ListOrderingReorderAsASeperateList/Scoring/partialEqualWeightsAlternativePointsGreaterThanCorrectPoints.js +91 -0
  50. package/cypress/e2e/ILC/ListOrderingReorderAsASeperateList/Scoring/partialEqualWeightsBasic.js +4 -0
  51. package/cypress/e2e/ILC/ListOrderingReorderAsASeperateList/Scoring/partialEqualWeightsCorrectPointsEqualToAlternativePoints.js +79 -0
  52. package/cypress/e2e/ILC/ListOrderingReorderAsASeperateList/Scoring/partialEqualWeightsCorrectPointsGreaterThanAlternativePoints.js +91 -0
  53. package/cypress/e2e/ILC/ListOrderingReorderAsASeperateList/allOrNothingForAllViews.smoke.js +207 -3
  54. package/cypress/e2e/ILC/Matching/Scoring/allOrNothingGroupedScoring.js +9 -1
  55. package/cypress/e2e/ILC/Matching/Scoring/allOrNothingWithAlternativePointsGreaterThanCorrectPoints.js +102 -2
  56. package/cypress/e2e/ILC/Matching/Scoring/allOrNothingWithCorrectPointsEqualToAlternativePoints.js +102 -2
  57. package/cypress/e2e/ILC/Matching/Scoring/allOrNothingWithCorrectPointsGreaterThanAlternativePoints.js +107 -2
  58. package/cypress/e2e/ILC/Matching/Scoring/blankResponseScoring.js +36 -2
  59. package/cypress/e2e/ILC/Matching/Scoring/checkScoringLabelBannerAndCorrectAnswerSection.js +5 -0
  60. package/cypress/e2e/ILC/Matching/Scoring/manuallyAndNonScored.js +1 -0
  61. package/cypress/e2e/ILC/Matching/Scoring/partialDifferentWeightsScoringBasic.js +10 -1
  62. package/cypress/e2e/ILC/Matching/Scoring/partialDifferentWeightsWithAlternativePointsGreaterThanCorrectPoints.js +128 -2
  63. package/cypress/e2e/ILC/Matching/Scoring/partialDifferentWeightsWithCorrectPointsEqualToAlternativePoints.js +115 -2
  64. package/cypress/e2e/ILC/Matching/Scoring/partialDifferentWeightsWithCorrectPointsGreaterThanAlternativePoints.js +128 -2
  65. package/cypress/e2e/ILC/Matching/Scoring/partialEqualWeightsBasic.js +9 -1
  66. package/cypress/e2e/ILC/Matching/Scoring/partialEqualWeightsWithAlternativePointsGreaterThanCorrectPoints.js +115 -2
  67. package/cypress/e2e/ILC/Matching/Scoring/partialEqualWeightsWithCorrectPointsEqualToAlternativePoints.js +102 -2
  68. package/cypress/e2e/ILC/Matching/Scoring/partialEqualWeightsWithCorrectPointsGreaterThanAlternativePoints.js +115 -2
  69. package/cypress/e2e/ILC/Matching/allOrNothingScoringForAllViews.smoke.js +226 -2
  70. package/cypress/e2e/ILC/Matching/maximumCapacityPerDropzoneSection.js +9 -1
  71. package/cypress/e2e/ILC/MatchingDropdown/Scoring/allOrNothingWithAlternativePointsGreaterThanCorrectPoints.js +102 -2
  72. package/cypress/e2e/ILC/MatchingDropdown/Scoring/allOrNothingWithCorrectPointsEqualToAlternativePoints.js +102 -2
  73. package/cypress/e2e/ILC/MatchingDropdown/Scoring/allOrNothingWithCorrectPointsGreaterThanAlternativePoints.js +102 -2
  74. package/cypress/e2e/ILC/MatchingDropdown/Scoring/blankResponseScoring.js +32 -5
  75. package/cypress/e2e/ILC/MatchingDropdown/Scoring/manuallyAndNonScored.js +3 -0
  76. package/cypress/e2e/ILC/MatchingDropdown/Scoring/partialDifferentWeightsScoringBasic.js +10 -1
  77. package/cypress/e2e/ILC/MatchingDropdown/Scoring/partialDifferentWeightsWithAlternativePointsGreaterThanCorrectPoints.js +128 -2
  78. package/cypress/e2e/ILC/MatchingDropdown/Scoring/partialDifferentWeightsWithCorrectPointsEqualToAlternatePoints.js +115 -2
  79. package/cypress/e2e/ILC/MatchingDropdown/Scoring/partialDifferentWeightsWithCorrectPointsGreaterThanAlternatePoints.js +128 -2
  80. package/cypress/e2e/ILC/MatchingDropdown/Scoring/partialEqualWeightsBasic.js +9 -1
  81. package/cypress/e2e/ILC/MatchingDropdown/Scoring/partialEqualWeightsWithAlternativePointsGreaterThanCorrectPoints.js +115 -2
  82. package/cypress/e2e/ILC/MatchingDropdown/Scoring/partialEqualWeightsWithCorrectPointsEqualToAlternativePoints.js +102 -2
  83. package/cypress/e2e/ILC/MatchingDropdown/Scoring/partialEqualWeightsWithCorrectPointsGreaterThanAlternativePoints.js +115 -2
  84. package/cypress/e2e/ILC/MatchingDropdown/allOrNothingScoringForAllViews.smoke.js +216 -2
  85. package/cypress/pages/components/correctIncorrectAnswerLabelComponent.js +18 -1
  86. package/cypress/pages/components/fillInTheGapsDragAndDropCommonComponents.js +1 -25
  87. package/cypress/pages/listOrderingPage.js +60 -1
  88. package/cypress/pages/matchingPage.js +23 -1
  89. package/package.json +1 -1
@@ -1,9 +1,6 @@
1
1
  import { fillInTheGapsDragAndDropPage } from "../../../../pages";
2
2
  import abortEarlySetup from "../../../../support/helpers/abortEarly";
3
3
  import utilities from "../../../../support/helpers/utilities";
4
- import { showAlternativeAnswersComponent } from "../../../../pages/components";
5
-
6
- const alternativeAnswerCheck = Cypress.env('ENABLE_ALTERNATIVE_ANSWER_ENHANCEMENT') === 'true';
7
4
  const css = Cypress.env('css');
8
5
 
9
6
  describe('Create item page - Fill in the gaps with drag and drop: Partial equal with alternative answers', () => {
@@ -32,22 +29,8 @@ describe('Create item page - Fill in the gaps with drag and drop: Partial equal
32
29
  it('When the user selects \'Grading\' view without attempting the question, cell numeration should be displayed, correct answers section with a label \'Correct answers\' should be displayed with correct answers from the correct accordion and respective cell numeration', () => {
33
30
  fillInTheGapsDragAndDropPage.steps.switchToGradingView();
34
31
  fillInTheGapsDragAndDropPage.steps.verifyDropzoneNumeration();
35
- if (alternativeAnswerCheck) {
36
- showAlternativeAnswersComponent.steps.clickShowAlternativeAnswersToggle();
37
- fillInTheGapsDragAndDropPage.steps.verifyCorrectAnswerSectionWithAlternateAnswers([
38
- {
39
- correctAnswers: [['Petals'], ['Flower'], ['Leaves']],
40
- points: ['(15 points)', '(5 points)', '(5 points)', '(5 points)'],
41
- },
42
- {
43
- correctAnswers: [['Petals'], ['Stem'], ['Seed']],
44
- points: ['(9 points)', '(3 points)', '(3 points)', '(3 points)'],
45
- }
46
- ]);
47
- } else {
48
- utilities.verifyInnerText(fillInTheGapsDragAndDropPage.correctAnswersLabel(), 'Correct answers');
49
- fillInTheGapsDragAndDropPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([['Petals'], ['Flower'], ['Leaves']]);
50
- }
32
+ utilities.verifyInnerText(fillInTheGapsDragAndDropPage.correctAnswersLabel(), 'Correct answers');
33
+ fillInTheGapsDragAndDropPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([['Petals'], ['Flower'], ['Leaves']]);
51
34
  });
52
35
 
53
36
  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, a status message and correct answer section should not be displayed', () => {
@@ -99,21 +82,7 @@ describe('Create item page - Fill in the gaps with drag and drop: Partial equal
99
82
  fillInTheGapsDragAndDropPage.steps.verifyCorrectOptionIcon(1);
100
83
  fillInTheGapsDragAndDropPage.steps.verifyCorrectOptionIcon(2);
101
84
  fillInTheGapsDragAndDropPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
102
- if (alternativeAnswerCheck) {
103
- showAlternativeAnswersComponent.steps.clickShowAlternativeAnswersToggle();
104
- fillInTheGapsDragAndDropPage.steps.verifyCorrectAnswerSectionWithAlternateAnswers([
105
- {
106
- correctAnswers: [['Petals'], ['Flower'], ['Leaves']],
107
- points: ['(15 points)', '(5 points)', '(5 points)', '(5 points)'],
108
- },
109
- {
110
- correctAnswers: [['Petals'], ['Stem'], ['Seed']],
111
- points: ['(9 points)', '(3 points)', '(3 points)', '(3 points)'],
112
- }
113
- ]);
114
- } else {
115
- fillInTheGapsDragAndDropPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([['Petals'], ['Flower'], ['Leaves']]);
116
- }
85
+ fillInTheGapsDragAndDropPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([['Petals'], ['Flower'], ['Leaves']]);
117
86
  fillInTheGapsDragAndDropPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
118
87
  /*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, a status message should not be displayed and correct answer section should not be displayed')
119
88
  fillInTheGapsDragAndDropPage.steps.checkAnswer();
@@ -133,21 +102,7 @@ describe('Create item page - Fill in the gaps with drag and drop: Partial equal
133
102
  fillInTheGapsDragAndDropPage.steps.verifyCorrectOptionIcon(1);
134
103
  fillInTheGapsDragAndDropPage.steps.verifyCorrectOptionIcon(2);
135
104
  fillInTheGapsDragAndDropPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
136
- if (alternativeAnswerCheck) {
137
- showAlternativeAnswersComponent.steps.clickShowAlternativeAnswersToggle();
138
- fillInTheGapsDragAndDropPage.steps.verifyCorrectAnswerSectionWithAlternateAnswers([
139
- {
140
- correctAnswers: [['Petals'], ['Flower'], ['Leaves']],
141
- points: ['(15 points)', '(5 points)', '(5 points)', '(5 points)'],
142
- },
143
- {
144
- correctAnswers: [['Petals'], ['Stem'], ['Seed']],
145
- points: ['(9 points)', '(3 points)', '(3 points)', '(3 points)'],
146
- }
147
- ]);
148
- } else {
149
- fillInTheGapsDragAndDropPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([['Petals'], ['Flower'], ['Leaves']]);
150
- }
105
+ fillInTheGapsDragAndDropPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([['Petals'], ['Flower'], ['Leaves']]);
151
106
  fillInTheGapsDragAndDropPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
152
107
  /*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, no icon should be displayed beside unattempted response a status message should not be displayed and correct answer section should not be displayed')
153
108
  fillInTheGapsDragAndDropPage.steps.checkAnswer();
@@ -167,21 +122,7 @@ describe('Create item page - Fill in the gaps with drag and drop: Partial equal
167
122
  fillInTheGapsDragAndDropPage.steps.verifyCorrectOptionIcon(1);
168
123
  fillInTheGapsDragAndDropPage.steps.verifyIncorrectOptionIcon(2);
169
124
  fillInTheGapsDragAndDropPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
170
- if (alternativeAnswerCheck) {
171
- showAlternativeAnswersComponent.steps.clickShowAlternativeAnswersToggle();
172
- fillInTheGapsDragAndDropPage.steps.verifyCorrectAnswerSectionWithAlternateAnswers([
173
- {
174
- correctAnswers: [['Petals'], ['Flower'], ['Leaves']],
175
- points: ['(15 points)', '(5 points)', '(5 points)', '(5 points)'],
176
- },
177
- {
178
- correctAnswers: [['Petals'], ['Stem'], ['Seed']],
179
- points: ['(9 points)', '(3 points)', '(3 points)', '(3 points)'],
180
- }
181
- ]);
182
- } else {
183
- fillInTheGapsDragAndDropPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([['Petals'], ['Flower'], ['Leaves']]);
184
- }
125
+ fillInTheGapsDragAndDropPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([['Petals'], ['Flower'], ['Leaves']]);
185
126
  fillInTheGapsDragAndDropPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
186
127
  /*cy.log('When the user has attempted the question with partially correct with all the response correct as per the alternative accordion but one response incomplete and clicks on \'Check answer\' button, then correct icon should be displayed besides the response from the correct accordion, incorrect icon should be displayed besides the responses from the alternative accordion and no icon should be displayed beside unattempted response, a status message should not be displayed and correct answer section should not be displayed')
187
128
  fillInTheGapsDragAndDropPage.steps.checkAnswer();
@@ -201,21 +142,7 @@ describe('Create item page - Fill in the gaps with drag and drop: Partial equal
201
142
  fillInTheGapsDragAndDropPage.steps.verifyCorrectOptionIcon(1);
202
143
  fillInTheGapsDragAndDropPage.steps.verifyIncorrectOptionIcon(2);
203
144
  fillInTheGapsDragAndDropPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
204
- if (alternativeAnswerCheck) {
205
- showAlternativeAnswersComponent.steps.clickShowAlternativeAnswersToggle();
206
- fillInTheGapsDragAndDropPage.steps.verifyCorrectAnswerSectionWithAlternateAnswers([
207
- {
208
- correctAnswers: [['Petals'], ['Flower'], ['Leaves']],
209
- points: ['(15 points)', '(5 points)', '(5 points)', '(5 points)'],
210
- },
211
- {
212
- correctAnswers: [['Petals'], ['Stem'], ['Seed']],
213
- points: ['(9 points)', '(3 points)', '(3 points)', '(3 points)'],
214
- }
215
- ]);
216
- } else {
217
- fillInTheGapsDragAndDropPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([['Petals'], ['Flower'], ['Leaves']]);
218
- }
145
+ fillInTheGapsDragAndDropPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([['Petals'], ['Flower'], ['Leaves']]);
219
146
  fillInTheGapsDragAndDropPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
220
147
  /*cy.log('When the user has attempted the question with equal number of correct responses from correct and alternative accordion and clicks on \'Check answer\' button, then correct icon should be displayed besides the correct answer responses, incorrect icon should be displayed beside empty responses a status message should not be displayed and correct answer section should not be displayed')
221
148
  fillInTheGapsDragAndDropPage.steps.checkAnswer();
@@ -235,21 +162,7 @@ describe('Create item page - Fill in the gaps with drag and drop: Partial equal
235
162
  fillInTheGapsDragAndDropPage.steps.verifyIncorrectOptionIcon(1);
236
163
  fillInTheGapsDragAndDropPage.steps.verifyIncorrectOptionIcon(2);
237
164
  fillInTheGapsDragAndDropPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
238
- if (alternativeAnswerCheck) {
239
- showAlternativeAnswersComponent.steps.clickShowAlternativeAnswersToggle();
240
- fillInTheGapsDragAndDropPage.steps.verifyCorrectAnswerSectionWithAlternateAnswers([
241
- {
242
- correctAnswers: [['Petals'], ['Flower'], ['Leaves']],
243
- points: ['(15 points)', '(5 points)', '(5 points)', '(5 points)'],
244
- },
245
- {
246
- correctAnswers: [['Petals'], ['Stem'], ['Seed']],
247
- points: ['(9 points)', '(3 points)', '(3 points)', '(3 points)'],
248
- }
249
- ]);
250
- } else {
251
- fillInTheGapsDragAndDropPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([['Petals'], ['Flower'], ['Leaves']]);
252
- }
165
+ fillInTheGapsDragAndDropPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([['Petals'], ['Flower'], ['Leaves']]);
253
166
  fillInTheGapsDragAndDropPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
254
167
  /*cy.log('When the user has attempted the question with equal number of correct responses from correct and alternative accordion and clicks on \'Check answer\' button, then correct icon should be displayed besides the correct answer responses, no icon should be displayed beside unattempted response a status message should not be displayed and correct answer section should not be displayed')
255
168
  fillInTheGapsDragAndDropPage.steps.checkAnswer();
@@ -269,21 +182,7 @@ describe('Create item page - Fill in the gaps with drag and drop: Partial equal
269
182
  fillInTheGapsDragAndDropPage.steps.verifyIncorrectOptionIcon(1);
270
183
  fillInTheGapsDragAndDropPage.steps.verifyIncorrectOptionIcon(2);
271
184
  fillInTheGapsDragAndDropPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
272
- if (alternativeAnswerCheck) {
273
- showAlternativeAnswersComponent.steps.clickShowAlternativeAnswersToggle();
274
- fillInTheGapsDragAndDropPage.steps.verifyCorrectAnswerSectionWithAlternateAnswers([
275
- {
276
- correctAnswers: [['Petals'], ['Flower'], ['Leaves']],
277
- points: ['(15 points)', '(5 points)', '(5 points)', '(5 points)'],
278
- },
279
- {
280
- correctAnswers: [['Petals'], ['Stem'], ['Seed']],
281
- points: ['(9 points)', '(3 points)', '(3 points)', '(3 points)'],
282
- }
283
- ]);
284
- } else {
285
- fillInTheGapsDragAndDropPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([['Petals'], ['Flower'], ['Leaves']]);
286
- }
185
+ fillInTheGapsDragAndDropPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([['Petals'], ['Flower'], ['Leaves']]);
287
186
  fillInTheGapsDragAndDropPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
288
187
  /*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 responses, no icon should be displayed beside unattempted response a status message should not be displayed and correct answer section should not be displayed')
289
188
  fillInTheGapsDragAndDropPage.steps.checkAnswer();
@@ -311,21 +210,7 @@ describe('Create item page - Fill in the gaps with drag and drop: Partial equal
311
210
  fillInTheGapsDragAndDropPage.steps.verifyIncorrectOptionIcon(1);
312
211
  fillInTheGapsDragAndDropPage.steps.verifyCorrectOptionIcon(2);
313
212
  fillInTheGapsDragAndDropPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
314
- if (alternativeAnswerCheck) {
315
- showAlternativeAnswersComponent.steps.clickShowAlternativeAnswersToggle();
316
- fillInTheGapsDragAndDropPage.steps.verifyCorrectAnswerSectionWithAlternateAnswers([
317
- {
318
- correctAnswers: [['Petals'], ['Flower'], ['Leaves']],
319
- points: ['(23 points)', '(7.67 points)', '(7.67 points)', '(7.67 points)'],
320
- },
321
- {
322
- correctAnswers: [['Roots'], ['Stem'], ['Seed']],
323
- points: ['(5 points)', '(1.67 points)', '(1.67 points)', '(1.67 points)'],
324
- }
325
- ]);
326
- } else {
327
- fillInTheGapsDragAndDropPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([['Petals'], ['Flower'], ['Leaves']]);
328
- }
213
+ fillInTheGapsDragAndDropPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([['Petals'], ['Flower'], ['Leaves']]);
329
214
  fillInTheGapsDragAndDropPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
330
215
  /*cy.log('When user attempts the question correctly and clicks on the \'Check answer\' button, green check-mark icons should be displayed beside the correct responses from the correct accordion, red cross-mark icons should be displayed beside the incorrectly answered responses, correct/incorrect answer label and its border, correct answer container should not be displayed')
331
216
  fillInTheGapsDragAndDropPage.steps.checkAnswer();
@@ -1,12 +1,10 @@
1
1
  import { dialogBoxBase, fillInTheGapsDragAndDropPage, gradingViewPage, itemPreviewPage, studentViewPage } from "../../../pages";
2
- import { showAlternativeAnswersComponent } from "../../../pages/components";
3
2
  import abortEarlySetup from "../../../support/helpers/abortEarly";
4
3
  import utilities from "../../../support/helpers/utilities";
5
4
  const grepTags = Cypress.env('grepTags');
6
5
  let correctAnswerViews = ['Question preview', 'Item preview', 'Grading view'];
7
6
  const views = utilities.getViews(correctAnswerViews);
8
7
  let itemReferenceID = "";
9
- const alternativeAnswerCheck = Cypress.env('ENABLE_ALTERNATIVE_ANSWER_ENHANCEMENT') === 'true';
10
8
 
11
9
  describe('Create item page - Fill in the gaps - drag and drop: All or nothing ', () => {
12
10
  before(() => {
@@ -109,9 +107,7 @@ describe('Create item page - Fill in the gaps - drag and drop: All or nothing ',
109
107
  fillInTheGapsDragAndDropPage.steps.verifyPreviewTabPointsBackgroundForIncorrectOrPartiallyCorrectAnswer();
110
108
  };
111
109
  fillInTheGapsDragAndDropPage.steps.verifyDropzoneNumeration();
112
- if (!alternativeAnswerCheck) {
113
- utilities.verifyInnerText(fillInTheGapsDragAndDropPage.correctAnswersLabel(), 'Correct answers');
114
- }
110
+ utilities.verifyInnerText(fillInTheGapsDragAndDropPage.correctAnswersLabel(), 'Correct answers');
115
111
  fillInTheGapsDragAndDropPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
116
112
  fillInTheGapsDragAndDropPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([['Petals'], ['Leaves'], ['Stem']]);
117
113
  });
@@ -226,241 +222,6 @@ describe('Create item page - Fill in the gaps - drag and drop: All or nothing ',
226
222
  });
227
223
  });
228
224
 
229
- if (alternativeAnswerCheck) {
230
- views.forEach((view) => {
231
- describe.only(`${view}: Auto scored - All or nothing scoring`, { tags: 'smoke' }, () => {
232
- abortEarlySetup();
233
- before(() => {
234
- switch (view) {
235
- case 'Question preview':
236
- fillInTheGapsDragAndDropPage.steps.navigateToCreateQuestion('fill in the gaps with drag and drop');
237
- cy.barsPreLoaderWait();
238
- fillInTheGapsDragAndDropPage.steps.addTextInQuestionInstructionsInputField('Drag and drop options into correct dropzone');
239
- fillInTheGapsDragAndDropPage.steps.addMultipleOptionFields(4);
240
- fillInTheGapsDragAndDropPage.steps.addResponseArea();
241
- fillInTheGapsDragAndDropPage.steps.addInputToOptionsInputField(['Petals', 'Leaves', 'Roots', 'Stem', 'Flower', 'Seed']);
242
- fillInTheGapsDragAndDropPage.steps.allotPoints(20);
243
- fillInTheGapsDragAndDropPage.steps.clickAndDropOptionInDropzoneSpecifyCorrectAnswerSection({ 'Petals': 0, 'Flower': 1, 'Leaves': 2 });
244
- fillInTheGapsDragAndDropPage.steps.addAlternativeAnswerAccordion(1);
245
- fillInTheGapsDragAndDropPage.steps.allotPoints(10);
246
- fillInTheGapsDragAndDropPage.steps.clickAndDropOptionInDropzoneSpecifyCorrectAnswerSection({ 'Petals': 0, 'Stem': 1, 'Seed': 2 });
247
- fillInTheGapsDragAndDropPage.steps.switchToPreviewTab();
248
- break;
249
- case 'Item preview':
250
- cy.visit(`/item-engine/demo/edit-item/${utilities.base64Encoding(itemReferenceID)}`);
251
- itemPreviewPage.steps.switchToPreviewTab();
252
- break;
253
- case 'Grading view':
254
- cy.visit(`/item-engine/demo/render-item/student-view/${utilities.base64Encoding(itemReferenceID)}`);
255
- break;
256
- };
257
- });
258
-
259
- beforeEach(() => {
260
- switch (view) {
261
- case 'Question preview':
262
- fillInTheGapsDragAndDropPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
263
- fillInTheGapsDragAndDropPage.steps.resetQuestionPreview();
264
- break;
265
- case 'Item preview':
266
- fillInTheGapsDragAndDropPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
267
- itemPreviewPage.steps.resetQuestionPreview();
268
- break;
269
- case 'Grading view':
270
- cy.visit(`/item-engine/demo/render-item/student-view/${utilities.base64Encoding(itemReferenceID)}`);
271
- break;
272
- }
273
- });
274
-
275
- if (view === 'Question preview') {
276
- after(() => {
277
- fillInTheGapsDragAndDropPage.steps.clickOnSaveQuestionButton();
278
- utilities.verifyElementVisibilityState(itemPreviewPage.referenceID(), 'visible');
279
- itemReferenceID = itemPreviewPage.steps.getItemReferenceID();
280
- });
281
- };
282
-
283
- it('When the user selects \'Grading\' view without attempting the question, dropzone numeration should be displayed, correct/incorrect status message should not be displayed, correct answers section with a label \'Correct answers\' should be displayed and respective option numeration', () => {
284
- if (view === 'Grading view') {
285
- studentViewPage.steps.submitResponse();
286
- utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'visible');
287
- studentViewPage.steps.clickOnGoToGradingViewButton();
288
- gradingViewPage.steps.verifyGradingViewScore(0, 20);
289
- };
290
- if (view === 'Question preview' || view === 'Item preview') {
291
- fillInTheGapsDragAndDropPage.steps.verifyPreviewScore(0, 20);
292
- fillInTheGapsDragAndDropPage.steps.switchToGradingView();
293
- fillInTheGapsDragAndDropPage.steps.verifyPreviewTabPointsBackgroundForIncorrectOrPartiallyCorrectAnswer();
294
- };
295
- fillInTheGapsDragAndDropPage.steps.verifyDropzoneNumeration();
296
- if (!alternativeAnswerCheck) {
297
- utilities.verifyInnerText(fillInTheGapsDragAndDropPage.correctAnswersLabel(), 'Correct answers');
298
- }
299
- fillInTheGapsDragAndDropPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
300
- showAlternativeAnswersComponent.steps.clickShowAlternativeAnswersToggle();
301
- fillInTheGapsDragAndDropPage.steps.verifyCorrectAnswerSectionWithAlternateAnswers([
302
- {
303
- correctAnswers: [['Petals'], ['Flower'], ['Leaves']],
304
- points: ['(20 points)'],
305
- },
306
- {
307
- correctAnswers: [['Petals'], ['Stem'], ['Seed']],
308
- points: ['(10 points)'],
309
- }
310
- ]);
311
- });
312
-
313
- 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 numeration should be displayed', () => {
314
- fillInTheGapsDragAndDropPage.steps.clickAndDropOptionInDropzonePreviewTab({ 'Leaves': 0, 'Petals': 1, 'Roots': 2 });
315
- if (view === 'Grading view') {
316
- studentViewPage.steps.submitResponse();
317
- utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'visible');
318
- studentViewPage.steps.clickOnGoToGradingViewButton();
319
- gradingViewPage.steps.verifyGradingViewScore(0, 20);
320
- };
321
- if (view === 'Question preview' || view === 'Item preview') {
322
- fillInTheGapsDragAndDropPage.steps.verifyPreviewScore(0, 20);
323
- fillInTheGapsDragAndDropPage.steps.switchToGradingView();
324
- };
325
- fillInTheGapsDragAndDropPage.steps.verifyIncorrectOptionIcon(0);
326
- fillInTheGapsDragAndDropPage.steps.verifyIncorrectOptionIcon(1);
327
- fillInTheGapsDragAndDropPage.steps.verifyIncorrectOptionIcon(2);
328
- fillInTheGapsDragAndDropPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
329
- showAlternativeAnswersComponent.steps.clickShowAlternativeAnswersToggle();
330
- fillInTheGapsDragAndDropPage.steps.verifyCorrectAnswerSectionWithAlternateAnswers([
331
- {
332
- correctAnswers: [['Petals'], ['Flower'], ['Leaves']],
333
- points: ['(20 points)'],
334
- },
335
- {
336
- correctAnswers: [['Petals'], ['Stem'], ['Seed']],
337
- points: ['(10 points)'],
338
- }
339
- ]);
340
- });
341
-
342
- it('When the user attempts the question partially correct with some correct, some incomplete, some 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 numeration should be displayed', () => {
343
- if (view === 'Grading view') {
344
- studentViewPage.steps.clearResponses();
345
- };
346
- fillInTheGapsDragAndDropPage.steps.clickAndDropOptionInDropzonePreviewTab({ 'Petals': 0, 'Roots': 2 });
347
- if (view === 'Grading view') {
348
- studentViewPage.steps.submitResponse();
349
- utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'visible');
350
- studentViewPage.steps.clickOnGoToGradingViewButton();
351
- gradingViewPage.steps.verifyGradingViewScore(0, 20);
352
- };
353
- if (view === 'Question preview' || view === 'Item preview') {
354
- fillInTheGapsDragAndDropPage.steps.verifyPreviewScore(0, 20);
355
- fillInTheGapsDragAndDropPage.steps.switchToGradingView();
356
- };
357
- fillInTheGapsDragAndDropPage.steps.verifyCorrectOptionIcon(0);
358
- fillInTheGapsDragAndDropPage.steps.verifyIncorrectOptionIcon(1);
359
- fillInTheGapsDragAndDropPage.steps.verifyIncorrectOptionIcon(2);
360
- fillInTheGapsDragAndDropPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
361
- showAlternativeAnswersComponent.steps.clickShowAlternativeAnswersToggle();
362
- fillInTheGapsDragAndDropPage.steps.verifyCorrectAnswerSectionWithAlternateAnswers([
363
- {
364
- correctAnswers: [['Petals'], ['Flower'], ['Leaves']],
365
- points: ['(20 points)'],
366
- },
367
- {
368
- correctAnswers: [['Petals'], ['Stem'], ['Seed']],
369
- points: ['(10 points)'],
370
- }
371
- ]);
372
- });
373
-
374
- it('When the user attempts the question partially correct with all the dropzone correctly attempted but one dropzone 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 numeration should be displayed', () => {
375
- if (view === 'Grading view') {
376
- studentViewPage.steps.clearResponses();
377
- };
378
- fillInTheGapsDragAndDropPage.steps.clickAndDropOptionInDropzonePreviewTab({ 'Leaves': 1, 'Stem': 2 })
379
- if (view === 'Grading view') {
380
- studentViewPage.steps.submitResponse();
381
- utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'visible');
382
- studentViewPage.steps.clickOnGoToGradingViewButton();
383
- gradingViewPage.steps.verifyGradingViewScore(0, 20);
384
- };
385
- if (view === 'Question preview' || view === 'Item preview') {
386
- fillInTheGapsDragAndDropPage.steps.verifyPreviewScore(0, 20);
387
- fillInTheGapsDragAndDropPage.steps.switchToGradingView();
388
- };
389
- fillInTheGapsDragAndDropPage.steps.verifyIncorrectOptionIcon(0);
390
- fillInTheGapsDragAndDropPage.steps.verifyIncorrectOptionIcon(1);
391
- fillInTheGapsDragAndDropPage.steps.verifyIncorrectOptionIcon(2);
392
- fillInTheGapsDragAndDropPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
393
- showAlternativeAnswersComponent.steps.clickShowAlternativeAnswersToggle();
394
- fillInTheGapsDragAndDropPage.steps.verifyCorrectAnswerSectionWithAlternateAnswers([
395
- {
396
- correctAnswers: [['Petals'], ['Flower'], ['Leaves']],
397
- points: ['(20 points)'],
398
- },
399
- {
400
- correctAnswers: [['Petals'], ['Stem'], ['Seed']],
401
- points: ['(10 points)'],
402
- }
403
- ]);
404
- });
405
-
406
- it('When the user attempts the question partially correct with all the dropzone 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 should be displayed along with numeration', () => {
407
- if (view === 'Grading view') {
408
- studentViewPage.steps.clearResponses();
409
- };
410
- fillInTheGapsDragAndDropPage.steps.clickAndDropOptionInDropzonePreviewTab({ 'Petals': 0, 'Leaves': 1, 'Roots': 1, 'Stem': 2 });
411
- if (view === 'Grading view') {
412
- studentViewPage.steps.submitResponse();
413
- utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'visible');
414
- studentViewPage.steps.clickOnGoToGradingViewButton();
415
- gradingViewPage.steps.verifyGradingViewScore(0, 20);
416
- };
417
- if (view === 'Question preview' || view === 'Item preview') {
418
- fillInTheGapsDragAndDropPage.steps.verifyPreviewScore(0, 20);
419
- fillInTheGapsDragAndDropPage.steps.switchToGradingView();
420
- };
421
- fillInTheGapsDragAndDropPage.steps.verifyCorrectOptionIcon(0);
422
- fillInTheGapsDragAndDropPage.steps.verifyIncorrectOptionIcon(1);
423
- fillInTheGapsDragAndDropPage.steps.verifyIncorrectOptionIcon(2);
424
- fillInTheGapsDragAndDropPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
425
- showAlternativeAnswersComponent.steps.clickShowAlternativeAnswersToggle();
426
- fillInTheGapsDragAndDropPage.steps.verifyCorrectAnswerSectionWithAlternateAnswers([
427
- {
428
- correctAnswers: [['Petals'], ['Flower'], ['Leaves']],
429
- points: ['(20 points)'],
430
- },
431
- {
432
- correctAnswers: [['Petals'], ['Stem'], ['Seed']],
433
- points: ['(10 points)'],
434
- }
435
- ]);
436
- });
437
-
438
- it('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', () => {
439
- if (view === 'Grading view') {
440
- studentViewPage.steps.clearResponses();
441
- };
442
- fillInTheGapsDragAndDropPage.steps.clickAndDropOptionInDropzonePreviewTab({ 'Petals': 0, 'Flower': 1, 'Leaves': 2 });
443
- if (view === 'Grading view') {
444
- studentViewPage.steps.submitResponse();
445
- utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'visible');
446
- studentViewPage.steps.clickOnGoToGradingViewButton();
447
- gradingViewPage.steps.verifyGradingViewScore(20, 20);
448
- };
449
- if (view === 'Question preview' || view === 'Item preview') {
450
- fillInTheGapsDragAndDropPage.steps.verifyPreviewScore(20, 20);
451
- fillInTheGapsDragAndDropPage.steps.switchToGradingView();
452
- fillInTheGapsDragAndDropPage.steps.verifyPreviewTabPointsBackgroundForCorrectAnswer();
453
- };
454
- fillInTheGapsDragAndDropPage.steps.verifyCorrectOptionIcon(0);
455
- fillInTheGapsDragAndDropPage.steps.verifyCorrectOptionIcon(1);
456
- fillInTheGapsDragAndDropPage.steps.verifyCorrectOptionIcon(2);
457
- fillInTheGapsDragAndDropPage.steps.verifyCorrectIncorrectAnswerLabel('correct');
458
- fillInTheGapsDragAndDropPage.steps.verifyCorrectAnswerSectionNotExists();
459
- });
460
- });
461
- });
462
- }
463
-
464
225
  views.forEach((view) => {
465
226
  describe(`Fill in the Gaps with drag and drop - Manually scored: ${view}`, { tags: 'smoke' }, () => {
466
227
  abortEarlySetup();
@@ -600,9 +361,7 @@ describe('Create item page - Fill in the gaps - drag and drop: All or nothing ',
600
361
  fillInTheGapsDragAndDropPage.steps.switchToGradingView();
601
362
  fillInTheGapsDragAndDropPage.steps.verifyPreviewTabPointsBackgroundForIncorrectOrPartiallyCorrectAnswer();
602
363
  };
603
- if (!alternativeAnswerCheck) {
604
- utilities.verifyInnerText(fillInTheGapsDragAndDropPage.correctAnswersLabel(), 'Correct answers');
605
- }
364
+ utilities.verifyInnerText(fillInTheGapsDragAndDropPage.correctAnswersLabel(), 'Correct answers');
606
365
  fillInTheGapsDragAndDropPage.steps.verifyCorrectIncorrectIconsNotExist();
607
366
  fillInTheGapsDragAndDropPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([['Petals'], ['Leaves'], ['Stem']]);
608
367
  });
@@ -1,6 +1,8 @@
1
1
  import { listOrderingPage } from "../../../../pages/listOrderingPage";
2
2
  import abortEarlySetup from "../../../../support/helpers/abortEarly";
3
3
 
4
+ const alternativeAnswerCheck = Cypress.env('ENABLE_ALTERNATIVE_ANSWER_ENHANCEMENT');
5
+
4
6
  let options = ['sprout', 'plant', 'flower', 'seed'];
5
7
 
6
8
  describe('Create item page - List ordering: All or nothing scoring with alternative answer - When alternative answer points are more than correct answer points', () => {
@@ -34,6 +36,17 @@ describe('Create item page - List ordering: All or nothing scoring with alternat
34
36
  listOrderingPage.steps.verifyCorrectIncorrectOptionIconDropdownLayoutNotExists(3);
35
37
  listOrderingPage.steps.verifyCorrectIncorrectAnswerLabelNotExist();
36
38
  listOrderingPage.steps.verifyOptionsPositionInCorrectAnswerSection(options, ['3', '4', '2', '1']);
39
+ if (alternativeAnswerCheck === 'true') {
40
+ listOrderingPage.steps.verifyAnswerLabelAndPoints('Correct answer', '(25 points)', 0);
41
+ listOrderingPage.steps.verifyShowAlternativeAnswersToggleExists();
42
+ listOrderingPage.steps.disableShowAlternativeAnswersToggle();
43
+ listOrderingPage.steps.verifyShowAlternativeAnswersToggleUnchecked();
44
+ listOrderingPage.steps.verifyAlternativeAnswersSectionNotExist();
45
+ listOrderingPage.steps.clickShowAlternativeAnswersToggle();
46
+ listOrderingPage.steps.verifyShowAlternativeAnswersToggleChecked();
47
+ listOrderingPage.steps.verifyAnswerLabelAndPoints('Alternative answer', '(20 points)', 1);
48
+ listOrderingPage.steps.verifyOptionsPositionInAlternativeAnswerSection(1, options, ['2', '3', '4', '1']);
49
+ }
37
50
  });
38
51
 
39
52
  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, a status message with text \'Your answer is correct\' and correct answer section should not be displayed', () => {
@@ -47,6 +60,9 @@ describe('Create item page - List ordering: All or nothing scoring with alternat
47
60
  listOrderingPage.steps.verifyCorrectOptionIconDropdownLayout(3);
48
61
  listOrderingPage.steps.verifyCorrectIncorrectAnswerLabel('correct');
49
62
  listOrderingPage.steps.verifyCorrectAnswerSectionNotExists();
63
+ if (alternativeAnswerCheck === 'true') {
64
+ listOrderingPage.steps.verifyShowAlternativeAnswersToggleNotExists();
65
+ }
50
66
  listOrderingPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
51
67
  /*cy.log('When the user has attempted the question with responses from the correct accordion and clicks on \'Check answer\' button, then 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')
52
68
  listOrderingPage.steps.checkAnswer();
@@ -69,6 +85,9 @@ describe('Create item page - List ordering: All or nothing scoring with alternat
69
85
  listOrderingPage.steps.verifyCorrectOptionIconDropdownLayout(3);
70
86
  listOrderingPage.steps.verifyCorrectIncorrectAnswerLabel('correct');
71
87
  listOrderingPage.steps.verifyCorrectAnswerSectionNotExists();
88
+ if (alternativeAnswerCheck === 'true') {
89
+ listOrderingPage.steps.verifyShowAlternativeAnswersToggleNotExists();
90
+ }
72
91
  listOrderingPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
73
92
  /*cy.log('When the user has attempted the question with responses from the alternative accordion and clicks on \'Check answer\' button, then 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')
74
93
  listOrderingPage.steps.checkAnswer();
@@ -91,6 +110,17 @@ describe('Create item page - List ordering: All or nothing scoring with alternat
91
110
  listOrderingPage.steps.verifyIncorrectOptionIconDropdownLayout(3);
92
111
  listOrderingPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
93
112
  listOrderingPage.steps.verifyOptionsPositionInCorrectAnswerSection(options, ['3', '4', '2', '1']);
113
+ if (alternativeAnswerCheck === 'true') {
114
+ listOrderingPage.steps.verifyAnswerLabelAndPoints('Correct answer', '(25 points)', 0);
115
+ listOrderingPage.steps.verifyShowAlternativeAnswersToggleExists();
116
+ listOrderingPage.steps.disableShowAlternativeAnswersToggle();
117
+ listOrderingPage.steps.verifyShowAlternativeAnswersToggleUnchecked();
118
+ listOrderingPage.steps.verifyAlternativeAnswersSectionNotExist();
119
+ listOrderingPage.steps.clickShowAlternativeAnswersToggle();
120
+ listOrderingPage.steps.verifyShowAlternativeAnswersToggleChecked();
121
+ listOrderingPage.steps.verifyAnswerLabelAndPoints('Alternative answer', '(20 points)', 1);
122
+ listOrderingPage.steps.verifyOptionsPositionInAlternativeAnswerSection(1, options, ['2', '3', '4', '1']);
123
+ }
94
124
  listOrderingPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
95
125
  /*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, a status message with text \'Your answer is incorrect\' and correct answer section should not be displayed')
96
126
  listOrderingPage.steps.checkAnswer()
@@ -113,6 +143,17 @@ describe('Create item page - List ordering: All or nothing scoring with alternat
113
143
  listOrderingPage.steps.verifyIncorrectOptionIconDropdownLayout(3);
114
144
  listOrderingPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
115
145
  listOrderingPage.steps.verifyOptionsPositionInCorrectAnswerSection(options, ['3', '4', '2', '1']);
146
+ if (alternativeAnswerCheck === 'true') {
147
+ listOrderingPage.steps.verifyAnswerLabelAndPoints('Correct answer', '(25 points)', 0);
148
+ listOrderingPage.steps.verifyShowAlternativeAnswersToggleExists();
149
+ listOrderingPage.steps.disableShowAlternativeAnswersToggle();
150
+ listOrderingPage.steps.verifyShowAlternativeAnswersToggleUnchecked();
151
+ listOrderingPage.steps.verifyAlternativeAnswersSectionNotExist();
152
+ listOrderingPage.steps.clickShowAlternativeAnswersToggle();
153
+ listOrderingPage.steps.verifyShowAlternativeAnswersToggleChecked();
154
+ listOrderingPage.steps.verifyAnswerLabelAndPoints('Alternative answer', '(20 points)', 1);
155
+ listOrderingPage.steps.verifyOptionsPositionInAlternativeAnswerSection(1, options, ['2', '3', '4', '1']);
156
+ }
116
157
  listOrderingPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
117
158
  /*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, a status message with text \'Your answer is incorrect\' and correct answer section should not be displayed')
118
159
  listOrderingPage.steps.checkAnswer();
@@ -135,6 +176,17 @@ describe('Create item page - List ordering: All or nothing scoring with alternat
135
176
  listOrderingPage.steps.verifyCorrectOptionIconDropdownLayout(3);
136
177
  listOrderingPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
137
178
  listOrderingPage.steps.verifyOptionsPositionInCorrectAnswerSection(options, ['3', '4', '2', '1']);
179
+ if (alternativeAnswerCheck === 'true') {
180
+ listOrderingPage.steps.verifyAnswerLabelAndPoints('Correct answer', '(25 points)', 0);
181
+ listOrderingPage.steps.verifyShowAlternativeAnswersToggleExists();
182
+ listOrderingPage.steps.disableShowAlternativeAnswersToggle();
183
+ listOrderingPage.steps.verifyShowAlternativeAnswersToggleUnchecked();
184
+ listOrderingPage.steps.verifyAlternativeAnswersSectionNotExist();
185
+ listOrderingPage.steps.clickShowAlternativeAnswersToggle();
186
+ listOrderingPage.steps.verifyShowAlternativeAnswersToggleChecked();
187
+ listOrderingPage.steps.verifyAnswerLabelAndPoints('Alternative answer', '(20 points)', 1);
188
+ listOrderingPage.steps.verifyOptionsPositionInAlternativeAnswerSection(1, options, ['2', '3', '4', '1']);
189
+ }
138
190
  listOrderingPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
139
191
  /*cy.log('When the user has attempted the question with equal number of correct responses from correct and alternative accordion and clicks on \'Check answer\' button, then correct icon should be displayed besides the correct answer responses, incorrect icon should be displayed beside empty responses a status message with text \'Your answer is incorrect\' and correct answer section should not be displayed')
140
192
  listOrderingPage.steps.checkAnswer();
@@ -157,6 +209,17 @@ describe('Create item page - List ordering: All or nothing scoring with alternat
157
209
  listOrderingPage.steps.verifyCorrectOptionIconDropdownLayout(3);
158
210
  listOrderingPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
159
211
  listOrderingPage.steps.verifyOptionsPositionInCorrectAnswerSection(options, ['3', '4', '2', '1']);
212
+ if (alternativeAnswerCheck === 'true') {
213
+ listOrderingPage.steps.verifyAnswerLabelAndPoints('Correct answer', '(25 points)', 0);
214
+ listOrderingPage.steps.verifyShowAlternativeAnswersToggleExists();
215
+ listOrderingPage.steps.disableShowAlternativeAnswersToggle();
216
+ listOrderingPage.steps.verifyShowAlternativeAnswersToggleUnchecked();
217
+ listOrderingPage.steps.verifyAlternativeAnswersSectionNotExist();
218
+ listOrderingPage.steps.clickShowAlternativeAnswersToggle();
219
+ listOrderingPage.steps.verifyShowAlternativeAnswersToggleChecked();
220
+ listOrderingPage.steps.verifyAnswerLabelAndPoints('Alternative answer', '(20 points)', 1);
221
+ listOrderingPage.steps.verifyOptionsPositionInAlternativeAnswerSection(1, options, ['2', '3', '4', '1']);
222
+ }
160
223
  listOrderingPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
161
224
  /*cy.log('When the user has attempted the question with the common response between correct and alternative accordion and clicks on \'Check answer\' button, then correct icon should be displayed besides the correct answer responses, a status message with text \'Your answer is incorrect\' and correct answer section should not be displayed')
162
225
  listOrderingPage.steps.checkAnswer();
@@ -178,6 +241,17 @@ describe('Create item page - List ordering: All or nothing scoring with alternat
178
241
  listOrderingPage.steps.verifyIncorrectOptionIconDropdownLayout(3);
179
242
  listOrderingPage.steps.verifyOptionsPositionInCorrectAnswerSection(options, ['3', '4', '2', '1']);
180
243
  listOrderingPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
244
+ if (alternativeAnswerCheck === 'true') {
245
+ listOrderingPage.steps.verifyAnswerLabelAndPoints('Correct answer', '(25 points)', 0);
246
+ listOrderingPage.steps.verifyShowAlternativeAnswersToggleExists();
247
+ listOrderingPage.steps.disableShowAlternativeAnswersToggle();
248
+ listOrderingPage.steps.verifyShowAlternativeAnswersToggleUnchecked();
249
+ listOrderingPage.steps.verifyAlternativeAnswersSectionNotExist();
250
+ listOrderingPage.steps.clickShowAlternativeAnswersToggle();
251
+ listOrderingPage.steps.verifyShowAlternativeAnswersToggleChecked();
252
+ listOrderingPage.steps.verifyAnswerLabelAndPoints('Alternative answer', '(20 points)', 1);
253
+ listOrderingPage.steps.verifyOptionsPositionInAlternativeAnswerSection(1, options, ['2', '3', '4', '1']);
254
+ }
181
255
  listOrderingPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
182
256
  /*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 responses, a status message with text \'Your answer is incorrect\' and correct answer section should not be displayed')
183
257
  listOrderingPage.steps.checkAnswer();
@@ -210,6 +284,9 @@ describe('Create item page - List ordering: All or nothing scoring with alternat
210
284
  listOrderingPage.steps.switchToGradingView();
211
285
  listOrderingPage.steps.verifyCorrectAnswerSectionNotExist();
212
286
  listOrderingPage.steps.verifyCorrectIncorrectAnswerLabel('correct');
287
+ if (alternativeAnswerCheck === 'true') {
288
+ listOrderingPage.steps.verifyShowAlternativeAnswersToggleNotExists();
289
+ }
213
290
  listOrderingPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
214
291
  });
215
292
  });