itemengine-cypress-automation 1.0.582-IEI-7178-6c816dc.0 → 1.0.583-IEI-7048-71a8251.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 (74) hide show
  1. package/cypress/e2e/ILC/ListOrderingDropdown/Scoring/allOrNothingAlternativePointsGreaterThanCorrectPoints.js +77 -0
  2. package/cypress/e2e/ILC/ListOrderingDropdown/Scoring/allOrNothingCorrectPointsEqualToAlternativePoints.js +78 -1
  3. package/cypress/e2e/ILC/ListOrderingDropdown/Scoring/allOrNothingCorrectPointsGreaterThanAlternativePoints.js +78 -1
  4. package/cypress/e2e/ILC/ListOrderingDropdown/Scoring/partialDifferentWeightsAlternativePointsGreaterThanCorrectPoints.js +104 -9
  5. package/cypress/e2e/ILC/ListOrderingDropdown/Scoring/partialDifferentWeightsBasic.js +4 -0
  6. package/cypress/e2e/ILC/ListOrderingDropdown/Scoring/partialDifferentWeightsCorrectPointsEqualToAlternativePoints.js +95 -0
  7. package/cypress/e2e/ILC/ListOrderingDropdown/Scoring/partialDifferentWeightsCorrectPointsGreaterThanAlternativePoints.js +95 -0
  8. package/cypress/e2e/ILC/ListOrderingDropdown/Scoring/partialEqualWeightsAlternativePointsGreaterThanCorrectPoints.js +84 -0
  9. package/cypress/e2e/ILC/ListOrderingDropdown/Scoring/partialEqualWeightsBasic.js +4 -0
  10. package/cypress/e2e/ILC/ListOrderingDropdown/Scoring/partialEqualWeightsCorrectPointsEqualToAlternativePoints.js +73 -0
  11. package/cypress/e2e/ILC/ListOrderingDropdown/Scoring/partialEqualWeightsCorrectPointsGreaterThanAlternativePoints.js +84 -0
  12. package/cypress/e2e/ILC/ListOrderingDropdown/allOrNothingForAllViews.smoke.js +187 -2
  13. package/cypress/e2e/ILC/ListOrderingNew/Scoring/allOrNothingAlternativePointsGreaterThanCorrectPoints.js +79 -1
  14. package/cypress/e2e/ILC/ListOrderingNew/Scoring/allOrNothingCorrectPointsEqualToAlternativePoints.js +79 -0
  15. package/cypress/e2e/ILC/ListOrderingNew/Scoring/allOrNothingCorrectPointsGreaterThanAlternativePoints.js +79 -0
  16. package/cypress/e2e/ILC/ListOrderingNew/Scoring/manuallyAndNonScored.js +4 -0
  17. package/cypress/e2e/ILC/ListOrderingNew/Scoring/partialDifferentWeightsAlternativePointsGreaterThanCorrectPoints.js +103 -0
  18. package/cypress/e2e/ILC/ListOrderingNew/Scoring/partialDifferentWeightsBasic.js +4 -0
  19. package/cypress/e2e/ILC/ListOrderingNew/Scoring/partialDifferentWeightsCorrectPointsEqualToAlternativePoints.js +103 -0
  20. package/cypress/e2e/ILC/ListOrderingNew/Scoring/partialDifferentWeightsCorrectPointsGreaterThanAlternativePoints.js +103 -0
  21. package/cypress/e2e/ILC/ListOrderingNew/Scoring/partialEqualWeightsAlternativePointsGreaterThanCorrectPoints.js +91 -0
  22. package/cypress/e2e/ILC/ListOrderingNew/Scoring/partialEqualWeightsBasic.js +4 -0
  23. package/cypress/e2e/ILC/ListOrderingNew/Scoring/partialEqualWeightsCorrectPointsEqualToAlternativePoints.js +79 -0
  24. package/cypress/e2e/ILC/ListOrderingNew/Scoring/partialEqualWeightsCorrectPointsGreaterThanAlternativePoints.js +91 -0
  25. package/cypress/e2e/ILC/ListOrderingNew/allOrNothingForAllViews.smoke.js +209 -5
  26. package/cypress/e2e/ILC/ListOrderingNew/horizontalOrientationAllOrNothingForAllViews.smoke.js +195 -1
  27. package/cypress/e2e/ILC/ListOrderingReorderAsASeperateList/HorizontalOrientation/partialDifferentWeightsCorrectPointsGreaterThanAlternativePoints.js +103 -0
  28. package/cypress/e2e/ILC/ListOrderingReorderAsASeperateList/Scoring/allOrNothingAlternativePointsGreaterThanCorrectPoints.js +85 -0
  29. package/cypress/e2e/ILC/ListOrderingReorderAsASeperateList/Scoring/allOrNothingCorrectPointsEqualToAlternativePoints.js +82 -0
  30. package/cypress/e2e/ILC/ListOrderingReorderAsASeperateList/Scoring/allOrNothingCorrectPointsGreaterThanAlternativePoints.js +85 -0
  31. package/cypress/e2e/ILC/ListOrderingReorderAsASeperateList/Scoring/partialDifferentWeightsAlternativePointsGreaterThanCorrectPoints.js +109 -6
  32. package/cypress/e2e/ILC/ListOrderingReorderAsASeperateList/Scoring/partialDifferentWeightsBasic.js +4 -0
  33. package/cypress/e2e/ILC/ListOrderingReorderAsASeperateList/Scoring/partialDifferentWeightsCorrectPointsEqualToAlternativePoints.js +103 -0
  34. package/cypress/e2e/ILC/ListOrderingReorderAsASeperateList/Scoring/partialDifferentWeightsCorrectPointsGreaterThanAlternativePoints.js +103 -0
  35. package/cypress/e2e/ILC/ListOrderingReorderAsASeperateList/Scoring/partialEqualWeightsAlternativePointsGreaterThanCorrectPoints.js +91 -0
  36. package/cypress/e2e/ILC/ListOrderingReorderAsASeperateList/Scoring/partialEqualWeightsBasic.js +4 -0
  37. package/cypress/e2e/ILC/ListOrderingReorderAsASeperateList/Scoring/partialEqualWeightsCorrectPointsEqualToAlternativePoints.js +79 -0
  38. package/cypress/e2e/ILC/ListOrderingReorderAsASeperateList/Scoring/partialEqualWeightsCorrectPointsGreaterThanAlternativePoints.js +91 -0
  39. package/cypress/e2e/ILC/ListOrderingReorderAsASeperateList/allOrNothingForAllViews.smoke.js +203 -3
  40. package/cypress/e2e/ILC/Matching/Scoring/allOrNothingGroupedScoring.js +9 -1
  41. package/cypress/e2e/ILC/Matching/Scoring/allOrNothingWithAlternativePointsGreaterThanCorrectPoints.js +102 -2
  42. package/cypress/e2e/ILC/Matching/Scoring/allOrNothingWithCorrectPointsEqualToAlternativePoints.js +102 -2
  43. package/cypress/e2e/ILC/Matching/Scoring/allOrNothingWithCorrectPointsGreaterThanAlternativePoints.js +107 -2
  44. package/cypress/e2e/ILC/Matching/Scoring/blankResponseScoring.js +36 -2
  45. package/cypress/e2e/ILC/Matching/Scoring/checkScoringLabelBannerAndCorrectAnswerSection.js +5 -0
  46. package/cypress/e2e/ILC/Matching/Scoring/manuallyAndNonScored.js +1 -0
  47. package/cypress/e2e/ILC/Matching/Scoring/partialDifferentWeightsScoringBasic.js +10 -1
  48. package/cypress/e2e/ILC/Matching/Scoring/partialDifferentWeightsWithAlternativePointsGreaterThanCorrectPoints.js +128 -2
  49. package/cypress/e2e/ILC/Matching/Scoring/partialDifferentWeightsWithCorrectPointsEqualToAlternativePoints.js +115 -2
  50. package/cypress/e2e/ILC/Matching/Scoring/partialDifferentWeightsWithCorrectPointsGreaterThanAlternativePoints.js +128 -2
  51. package/cypress/e2e/ILC/Matching/Scoring/partialEqualWeightsBasic.js +9 -1
  52. package/cypress/e2e/ILC/Matching/Scoring/partialEqualWeightsWithAlternativePointsGreaterThanCorrectPoints.js +115 -2
  53. package/cypress/e2e/ILC/Matching/Scoring/partialEqualWeightsWithCorrectPointsEqualToAlternativePoints.js +102 -2
  54. package/cypress/e2e/ILC/Matching/Scoring/partialEqualWeightsWithCorrectPointsGreaterThanAlternativePoints.js +115 -2
  55. package/cypress/e2e/ILC/Matching/allOrNothingScoringForAllViews.smoke.js +226 -2
  56. package/cypress/e2e/ILC/Matching/maximumCapacityPerDropzoneSection.js +9 -1
  57. package/cypress/e2e/ILC/MatchingDropdown/Scoring/allOrNothingWithAlternativePointsGreaterThanCorrectPoints.js +102 -2
  58. package/cypress/e2e/ILC/MatchingDropdown/Scoring/allOrNothingWithCorrectPointsEqualToAlternativePoints.js +102 -2
  59. package/cypress/e2e/ILC/MatchingDropdown/Scoring/allOrNothingWithCorrectPointsGreaterThanAlternativePoints.js +102 -2
  60. package/cypress/e2e/ILC/MatchingDropdown/Scoring/blankResponseScoring.js +32 -5
  61. package/cypress/e2e/ILC/MatchingDropdown/Scoring/manuallyAndNonScored.js +3 -0
  62. package/cypress/e2e/ILC/MatchingDropdown/Scoring/partialDifferentWeightsScoringBasic.js +10 -1
  63. package/cypress/e2e/ILC/MatchingDropdown/Scoring/partialDifferentWeightsWithAlternativePointsGreaterThanCorrectPoints.js +128 -2
  64. package/cypress/e2e/ILC/MatchingDropdown/Scoring/partialDifferentWeightsWithCorrectPointsEqualToAlternatePoints.js +115 -2
  65. package/cypress/e2e/ILC/MatchingDropdown/Scoring/partialDifferentWeightsWithCorrectPointsGreaterThanAlternatePoints.js +128 -2
  66. package/cypress/e2e/ILC/MatchingDropdown/Scoring/partialEqualWeightsBasic.js +9 -1
  67. package/cypress/e2e/ILC/MatchingDropdown/Scoring/partialEqualWeightsWithAlternativePointsGreaterThanCorrectPoints.js +115 -2
  68. package/cypress/e2e/ILC/MatchingDropdown/Scoring/partialEqualWeightsWithCorrectPointsEqualToAlternativePoints.js +102 -2
  69. package/cypress/e2e/ILC/MatchingDropdown/Scoring/partialEqualWeightsWithCorrectPointsGreaterThanAlternativePoints.js +115 -2
  70. package/cypress/e2e/ILC/MatchingDropdown/allOrNothingScoringForAllViews.smoke.js +216 -2
  71. package/cypress/pages/components/correctIncorrectAnswerLabelComponent.js +18 -1
  72. package/cypress/pages/listOrderingPage.js +60 -1
  73. package/cypress/pages/matchingPage.js +23 -1
  74. package/package.json +1 -1
@@ -2,6 +2,7 @@ import { matchingPage } from "../../../../pages";
2
2
  import abortEarlySetup from "../../../../support/helpers/abortEarly";
3
3
  import utilities from "../../../../support/helpers/utilities";
4
4
  const css = Cypress.env('css');
5
+ const alternativeAnswerCheck = Cypress.env('ENABLE_ALTERNATIVE_ANSWER_ENHANCEMENT');
5
6
  const promptTextArray = ['Wild', 'Aquatic', 'Pet'];
6
7
  const optionsArray = ['Cat', 'Elephant', 'Fish', 'Bear', 'Eagle', 'Penguin'];
7
8
 
@@ -32,8 +33,23 @@ describe('Create item page - Matching: Partial equal weights with alternative an
32
33
  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 dropzone numeration', () => {
33
34
  matchingPage.steps.switchToGradingView();
34
35
  matchingPage.steps.verifyDropzoneNumeration();
35
- utilities.verifyInnerText(matchingPage.correctAnswersLabel(), 'Correct answers');
36
- matchingPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([['Elephant'], ['Fish'], ['Cat']]);
36
+ if (alternativeAnswerCheck === 'true') {
37
+ matchingPage.steps.verifyAnswerLabelAndPoints('Correct answer', '(Points per response - 5 pts)', 0);
38
+ matchingPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([['Elephant'], ['Fish'], ['Cat']]);
39
+ matchingPage.steps.verifyShowAlternativeAnswersToggleExists();
40
+ matchingPage.steps.disableShowAlternativeAnswersToggle();
41
+ matchingPage.steps.verifyShowAlternativeAnswersToggleUnchecked();
42
+ matchingPage.steps.verifyAlternativeAnswersSectionNotExist();
43
+ matchingPage.steps.clickShowAlternativeAnswersToggle();
44
+ matchingPage.steps.verifyShowAlternativeAnswersToggleChecked();
45
+ matchingPage.steps.verifyAnswerLabelAndPoints('Alternative answer', '(Points per response - 5 pts)', 1);
46
+ matchingPage.steps.verifyAlternativeAnswerResponsesInCorrectAnswerSectionAndCount([['Bear'], ['Penguin'], ['Cat']], 1);
47
+ matchingPage.steps.clickShowAlternativeAnswersToggle();
48
+ matchingPage.steps.verifyShowAlternativeAnswersToggleUnchecked();
49
+ } else {
50
+ utilities.verifyInnerText(matchingPage.correctAnswersLabel(), 'Correct answers');
51
+ matchingPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([['Elephant'], ['Fish'], ['Cat']]);
52
+ }
37
53
  });
38
54
 
39
55
  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', () => {
@@ -46,6 +62,9 @@ describe('Create item page - Matching: Partial equal weights with alternative an
46
62
  matchingPage.steps.verifyCorrectOptionIcon(2);
47
63
  matchingPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
48
64
  matchingPage.steps.verifyCorrectAnswerSectionNotExists();
65
+ if (alternativeAnswerCheck === 'true') {
66
+ matchingPage.steps.verifyShowAlternativeAnswersToggleNotExists();
67
+ }
49
68
  matchingPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
50
69
  /*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 and correct answer section should not be displayed')
51
70
  matchingPage.steps.checkAnswer();
@@ -66,6 +85,9 @@ describe('Create item page - Matching: Partial equal weights with alternative an
66
85
  matchingPage.steps.verifyCorrectOptionIcon(2);
67
86
  matchingPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
68
87
  matchingPage.steps.verifyCorrectAnswerSectionNotExists();
88
+ if (alternativeAnswerCheck === 'true') {
89
+ matchingPage.steps.verifyShowAlternativeAnswersToggleNotExists();
90
+ }
69
91
  matchingPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
70
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 and correct answer section should not be displayed')
71
93
  matchingPage.steps.checkAnswer();
@@ -86,6 +108,19 @@ describe('Create item page - Matching: Partial equal weights with alternative an
86
108
  matchingPage.steps.verifyIncorrectOptionIconForEmptyOption(2);
87
109
  matchingPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
88
110
  matchingPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([['Elephant'], ['Fish'], ['Cat']]);
111
+ if (alternativeAnswerCheck === 'true') {
112
+ matchingPage.steps.verifyAnswerLabelAndPoints('Correct answer', '(Points per response - 5 pts)', 0);
113
+ matchingPage.steps.verifyShowAlternativeAnswersToggleExists();
114
+ matchingPage.steps.disableShowAlternativeAnswersToggle();
115
+ matchingPage.steps.verifyShowAlternativeAnswersToggleUnchecked();
116
+ matchingPage.steps.verifyAlternativeAnswersSectionNotExist();
117
+ matchingPage.steps.clickShowAlternativeAnswersToggle();
118
+ matchingPage.steps.verifyShowAlternativeAnswersToggleChecked();
119
+ matchingPage.steps.verifyAnswerLabelAndPoints('Alternative answer', '(Points per response - 5 pts)', 1);
120
+ matchingPage.steps.verifyAlternativeAnswerResponsesInCorrectAnswerSectionAndCount([['Bear'], ['Penguin'], ['Cat']], 1);
121
+ matchingPage.steps.clickShowAlternativeAnswersToggle();
122
+ matchingPage.steps.verifyShowAlternativeAnswersToggleUnchecked();
123
+ }
89
124
  matchingPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
90
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 should not be displayed and correct answer section should not be displayed')
91
126
  matchingPage.steps.checkAnswer();
@@ -106,6 +141,19 @@ describe('Create item page - Matching: Partial equal weights with alternative an
106
141
  matchingPage.steps.verifyIncorrectOptionIconForEmptyOption(2);
107
142
  matchingPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
108
143
  matchingPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([['Elephant'], ['Fish'], ['Cat']]);
144
+ if (alternativeAnswerCheck === 'true') {
145
+ matchingPage.steps.verifyAnswerLabelAndPoints('Correct answer', '(Points per response - 5 pts)', 0);
146
+ matchingPage.steps.verifyShowAlternativeAnswersToggleExists();
147
+ matchingPage.steps.disableShowAlternativeAnswersToggle();
148
+ matchingPage.steps.verifyShowAlternativeAnswersToggleUnchecked();
149
+ matchingPage.steps.verifyAlternativeAnswersSectionNotExist();
150
+ matchingPage.steps.clickShowAlternativeAnswersToggle();
151
+ matchingPage.steps.verifyShowAlternativeAnswersToggleChecked();
152
+ matchingPage.steps.verifyAnswerLabelAndPoints('Alternative answer', '(Points per response - 5 pts)', 1);
153
+ matchingPage.steps.verifyAlternativeAnswerResponsesInCorrectAnswerSectionAndCount([['Bear'], ['Penguin'], ['Cat']], 1);
154
+ matchingPage.steps.clickShowAlternativeAnswersToggle();
155
+ matchingPage.steps.verifyShowAlternativeAnswersToggleUnchecked();
156
+ }
109
157
  matchingPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
110
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, no icon should be displayed beside unattempted response a status message should not be displayed and correct answer section should not be displayed')
111
159
  matchingPage.steps.checkAnswer();
@@ -126,6 +174,19 @@ describe('Create item page - Matching: Partial equal weights with alternative an
126
174
  matchingPage.steps.verifyCorrectOptionIcon(2);
127
175
  matchingPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
128
176
  matchingPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([['Elephant'], ['Fish'], ['Cat']]);
177
+ if (alternativeAnswerCheck === 'true') {
178
+ matchingPage.steps.verifyAnswerLabelAndPoints('Correct answer', '(Points per response - 5 pts)', 0);
179
+ matchingPage.steps.verifyShowAlternativeAnswersToggleExists();
180
+ matchingPage.steps.disableShowAlternativeAnswersToggle();
181
+ matchingPage.steps.verifyShowAlternativeAnswersToggleUnchecked();
182
+ matchingPage.steps.verifyAlternativeAnswersSectionNotExist();
183
+ matchingPage.steps.clickShowAlternativeAnswersToggle();
184
+ matchingPage.steps.verifyShowAlternativeAnswersToggleChecked();
185
+ matchingPage.steps.verifyAnswerLabelAndPoints('Alternative answer', '(Points per response - 5 pts)', 1);
186
+ matchingPage.steps.verifyAlternativeAnswerResponsesInCorrectAnswerSectionAndCount([['Bear'], ['Penguin'], ['Cat']], 1);
187
+ matchingPage.steps.clickShowAlternativeAnswersToggle();
188
+ matchingPage.steps.verifyShowAlternativeAnswersToggleUnchecked();
189
+ }
129
190
  matchingPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
130
191
  /*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 and 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')
131
192
  matchingPage.steps.checkAnswer();
@@ -146,6 +207,19 @@ describe('Create item page - Matching: Partial equal weights with alternative an
146
207
  matchingPage.steps.verifyCorrectOptionIcon(2);
147
208
  matchingPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
148
209
  matchingPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([['Elephant'], ['Fish'], ['Cat']]);
210
+ if (alternativeAnswerCheck === 'true') {
211
+ matchingPage.steps.verifyAnswerLabelAndPoints('Correct answer', '(Points per response - 5 pts)', 0);
212
+ matchingPage.steps.verifyShowAlternativeAnswersToggleExists();
213
+ matchingPage.steps.disableShowAlternativeAnswersToggle();
214
+ matchingPage.steps.verifyShowAlternativeAnswersToggleUnchecked();
215
+ matchingPage.steps.verifyAlternativeAnswersSectionNotExist();
216
+ matchingPage.steps.clickShowAlternativeAnswersToggle();
217
+ matchingPage.steps.verifyShowAlternativeAnswersToggleChecked();
218
+ matchingPage.steps.verifyAnswerLabelAndPoints('Alternative answer', '(Points per response - 5 pts)', 1);
219
+ matchingPage.steps.verifyAlternativeAnswerResponsesInCorrectAnswerSectionAndCount([['Bear'], ['Penguin'], ['Cat']], 1);
220
+ matchingPage.steps.clickShowAlternativeAnswersToggle();
221
+ matchingPage.steps.verifyShowAlternativeAnswersToggleUnchecked();
222
+ }
149
223
  matchingPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
150
224
  /*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')
151
225
  matchingPage.steps.checkAnswer();
@@ -166,6 +240,19 @@ describe('Create item page - Matching: Partial equal weights with alternative an
166
240
  matchingPage.steps.verifyCorrectOptionIcon(2);
167
241
  matchingPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
168
242
  matchingPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([['Elephant'], ['Fish'], ['Cat']]);
243
+ if (alternativeAnswerCheck === 'true') {
244
+ matchingPage.steps.verifyAnswerLabelAndPoints('Correct answer', '(Points per response - 5 pts)', 0);
245
+ matchingPage.steps.verifyShowAlternativeAnswersToggleExists();
246
+ matchingPage.steps.disableShowAlternativeAnswersToggle();
247
+ matchingPage.steps.verifyShowAlternativeAnswersToggleUnchecked();
248
+ matchingPage.steps.verifyAlternativeAnswersSectionNotExist();
249
+ matchingPage.steps.clickShowAlternativeAnswersToggle();
250
+ matchingPage.steps.verifyShowAlternativeAnswersToggleChecked();
251
+ matchingPage.steps.verifyAnswerLabelAndPoints('Alternative answer', '(Points per response - 5 pts)', 1);
252
+ matchingPage.steps.verifyAlternativeAnswerResponsesInCorrectAnswerSectionAndCount([['Bear'], ['Penguin'], ['Cat']], 1);
253
+ matchingPage.steps.clickShowAlternativeAnswersToggle();
254
+ matchingPage.steps.verifyShowAlternativeAnswersToggleUnchecked();
255
+ }
169
256
  matchingPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
170
257
  /*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')
171
258
  matchingPage.steps.checkAnswer();
@@ -186,6 +273,19 @@ describe('Create item page - Matching: Partial equal weights with alternative an
186
273
  matchingPage.steps.verifyIncorrectOptionIconForEmptyOption(2);
187
274
  matchingPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
188
275
  matchingPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([['Elephant'], ['Fish'], ['Cat']]);
276
+ if (alternativeAnswerCheck === 'true') {
277
+ matchingPage.steps.verifyAnswerLabelAndPoints('Correct answer', '(Points per response - 5 pts)', 0);
278
+ matchingPage.steps.verifyShowAlternativeAnswersToggleExists();
279
+ matchingPage.steps.disableShowAlternativeAnswersToggle();
280
+ matchingPage.steps.verifyShowAlternativeAnswersToggleUnchecked();
281
+ matchingPage.steps.verifyAlternativeAnswersSectionNotExist();
282
+ matchingPage.steps.clickShowAlternativeAnswersToggle();
283
+ matchingPage.steps.verifyShowAlternativeAnswersToggleChecked();
284
+ matchingPage.steps.verifyAnswerLabelAndPoints('Alternative answer', '(Points per response - 5 pts)', 1);
285
+ matchingPage.steps.verifyAlternativeAnswerResponsesInCorrectAnswerSectionAndCount([['Bear'], ['Penguin'], ['Cat']], 1);
286
+ matchingPage.steps.clickShowAlternativeAnswersToggle();
287
+ matchingPage.steps.verifyShowAlternativeAnswersToggleUnchecked();
288
+ }
189
289
  matchingPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
190
290
  /*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')
191
291
  matchingPage.steps.checkAnswer();
@@ -2,6 +2,7 @@ import { matchingPage } from "../../../../pages";
2
2
  import abortEarlySetup from "../../../../support/helpers/abortEarly";
3
3
  import utilities from "../../../../support/helpers/utilities";
4
4
  const css = Cypress.env('css');
5
+ const alternativeAnswerCheck = Cypress.env('ENABLE_ALTERNATIVE_ANSWER_ENHANCEMENT');
5
6
  const promptTextArray = ['Wild', 'Aquatic', 'Pet'];
6
7
  const optionsArray = ['Cat', 'Elephant', 'Fish', 'Bear', 'Eagle', 'Penguin'];
7
8
 
@@ -32,8 +33,23 @@ describe('Create item page - Matching: Partial equal weights with alternative an
32
33
  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 dropzone numeration', () => {
33
34
  matchingPage.steps.switchToGradingView();
34
35
  matchingPage.steps.verifyDropzoneNumeration();
35
- utilities.verifyInnerText(matchingPage.correctAnswersLabel(), 'Correct answers');
36
- matchingPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([['Elephant'], ['Fish'], ['Cat']]);
36
+ if (alternativeAnswerCheck === 'true') {
37
+ matchingPage.steps.verifyAnswerLabelAndPoints('Correct answer', '(Points per response - 5 pts)', 0);
38
+ matchingPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([['Elephant'], ['Fish'], ['Cat']]);
39
+ matchingPage.steps.verifyShowAlternativeAnswersToggleExists();
40
+ matchingPage.steps.disableShowAlternativeAnswersToggle();
41
+ matchingPage.steps.verifyShowAlternativeAnswersToggleUnchecked();
42
+ matchingPage.steps.verifyAlternativeAnswersSectionNotExist();
43
+ matchingPage.steps.clickShowAlternativeAnswersToggle();
44
+ matchingPage.steps.verifyShowAlternativeAnswersToggleChecked();
45
+ matchingPage.steps.verifyAnswerLabelAndPoints('Alternative answer', '(Points per response - 3 pts)', 1);
46
+ matchingPage.steps.verifyAlternativeAnswerResponsesInCorrectAnswerSectionAndCount([['Bear'], ['Penguin'], ['Cat']], 1);
47
+ matchingPage.steps.clickShowAlternativeAnswersToggle();
48
+ matchingPage.steps.verifyShowAlternativeAnswersToggleUnchecked();
49
+ } else {
50
+ utilities.verifyInnerText(matchingPage.correctAnswersLabel(), 'Correct answers');
51
+ matchingPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([['Elephant'], ['Fish'], ['Cat']]);
52
+ }
37
53
  });
38
54
 
39
55
  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', () => {
@@ -46,6 +62,9 @@ describe('Create item page - Matching: Partial equal weights with alternative an
46
62
  matchingPage.steps.verifyCorrectOptionIcon(2);
47
63
  matchingPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
48
64
  matchingPage.steps.verifyCorrectAnswerSectionNotExists();
65
+ if (alternativeAnswerCheck === 'true') {
66
+ matchingPage.steps.verifyShowAlternativeAnswersToggleNotExists();
67
+ }
49
68
  matchingPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
50
69
  /*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 and correct answer section should not be displayed')
51
70
  matchingPage.steps.checkAnswer();
@@ -66,6 +85,9 @@ describe('Create item page - Matching: Partial equal weights with alternative an
66
85
  matchingPage.steps.verifyCorrectOptionIcon(2);
67
86
  matchingPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
68
87
  matchingPage.steps.verifyCorrectAnswerSectionNotExists();
88
+ if (alternativeAnswerCheck === 'true') {
89
+ matchingPage.steps.verifyShowAlternativeAnswersToggleNotExists();
90
+ }
69
91
  matchingPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
70
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 and correct answer section should not be displayed')
71
93
  matchingPage.steps.checkAnswer();
@@ -86,6 +108,19 @@ describe('Create item page - Matching: Partial equal weights with alternative an
86
108
  matchingPage.steps.verifyIncorrectOptionIconForEmptyOption(2);
87
109
  matchingPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
88
110
  matchingPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([['Elephant'], ['Fish'], ['Cat']]);
111
+ if (alternativeAnswerCheck === 'true') {
112
+ matchingPage.steps.verifyAnswerLabelAndPoints('Correct answer', '(Points per response - 5 pts)', 0);
113
+ matchingPage.steps.verifyShowAlternativeAnswersToggleExists();
114
+ matchingPage.steps.disableShowAlternativeAnswersToggle();
115
+ matchingPage.steps.verifyShowAlternativeAnswersToggleUnchecked();
116
+ matchingPage.steps.verifyAlternativeAnswersSectionNotExist();
117
+ matchingPage.steps.clickShowAlternativeAnswersToggle();
118
+ matchingPage.steps.verifyShowAlternativeAnswersToggleChecked();
119
+ matchingPage.steps.verifyAnswerLabelAndPoints('Alternative answer', '(Points per response - 3 pts)', 1);
120
+ matchingPage.steps.verifyAlternativeAnswerResponsesInCorrectAnswerSectionAndCount([['Bear'], ['Penguin'], ['Cat']], 1);
121
+ matchingPage.steps.clickShowAlternativeAnswersToggle();
122
+ matchingPage.steps.verifyShowAlternativeAnswersToggleUnchecked();
123
+ }
89
124
  matchingPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
90
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 should not be displayed and correct answer section should not be displayed')
91
126
  matchingPage.steps.checkAnswer();
@@ -106,6 +141,19 @@ describe('Create item page - Matching: Partial equal weights with alternative an
106
141
  matchingPage.steps.verifyIncorrectOptionIconForEmptyOption(2);
107
142
  matchingPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
108
143
  matchingPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([['Elephant'], ['Fish'], ['Cat']]);
144
+ if (alternativeAnswerCheck === 'true') {
145
+ matchingPage.steps.verifyAnswerLabelAndPoints('Correct answer', '(Points per response - 5 pts)', 0);
146
+ matchingPage.steps.verifyShowAlternativeAnswersToggleExists();
147
+ matchingPage.steps.disableShowAlternativeAnswersToggle();
148
+ matchingPage.steps.verifyShowAlternativeAnswersToggleUnchecked();
149
+ matchingPage.steps.verifyAlternativeAnswersSectionNotExist();
150
+ matchingPage.steps.clickShowAlternativeAnswersToggle();
151
+ matchingPage.steps.verifyShowAlternativeAnswersToggleChecked();
152
+ matchingPage.steps.verifyAnswerLabelAndPoints('Alternative answer', '(Points per response - 3 pts)', 1);
153
+ matchingPage.steps.verifyAlternativeAnswerResponsesInCorrectAnswerSectionAndCount([['Bear'], ['Penguin'], ['Cat']], 1);
154
+ matchingPage.steps.clickShowAlternativeAnswersToggle();
155
+ matchingPage.steps.verifyShowAlternativeAnswersToggleUnchecked();
156
+ }
109
157
  matchingPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
110
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, no icon should be displayed beside unattempted response a status message should not be displayed and correct answer section should not be displayed')
111
159
  matchingPage.steps.checkAnswer();
@@ -126,6 +174,19 @@ describe('Create item page - Matching: Partial equal weights with alternative an
126
174
  matchingPage.steps.verifyCorrectOptionIcon(2);
127
175
  matchingPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
128
176
  matchingPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([['Elephant'], ['Fish'], ['Cat']]);
177
+ if (alternativeAnswerCheck === 'true') {
178
+ matchingPage.steps.verifyAnswerLabelAndPoints('Correct answer', '(Points per response - 5 pts)', 0);
179
+ matchingPage.steps.verifyShowAlternativeAnswersToggleExists();
180
+ matchingPage.steps.disableShowAlternativeAnswersToggle();
181
+ matchingPage.steps.verifyShowAlternativeAnswersToggleUnchecked();
182
+ matchingPage.steps.verifyAlternativeAnswersSectionNotExist();
183
+ matchingPage.steps.clickShowAlternativeAnswersToggle();
184
+ matchingPage.steps.verifyShowAlternativeAnswersToggleChecked();
185
+ matchingPage.steps.verifyAnswerLabelAndPoints('Alternative answer', '(Points per response - 3 pts)', 1);
186
+ matchingPage.steps.verifyAlternativeAnswerResponsesInCorrectAnswerSectionAndCount([['Bear'], ['Penguin'], ['Cat']], 1);
187
+ matchingPage.steps.clickShowAlternativeAnswersToggle();
188
+ matchingPage.steps.verifyShowAlternativeAnswersToggleUnchecked();
189
+ }
129
190
  matchingPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
130
191
  /*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 and 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')
131
192
  matchingPage.steps.checkAnswer();
@@ -146,6 +207,19 @@ describe('Create item page - Matching: Partial equal weights with alternative an
146
207
  matchingPage.steps.verifyCorrectOptionIcon(2);
147
208
  matchingPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
148
209
  matchingPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([['Elephant'], ['Fish'], ['Cat']]);
210
+ if (alternativeAnswerCheck === 'true') {
211
+ matchingPage.steps.verifyAnswerLabelAndPoints('Correct answer', '(Points per response - 5 pts)', 0);
212
+ matchingPage.steps.verifyShowAlternativeAnswersToggleExists();
213
+ matchingPage.steps.disableShowAlternativeAnswersToggle();
214
+ matchingPage.steps.verifyShowAlternativeAnswersToggleUnchecked();
215
+ matchingPage.steps.verifyAlternativeAnswersSectionNotExist();
216
+ matchingPage.steps.clickShowAlternativeAnswersToggle();
217
+ matchingPage.steps.verifyShowAlternativeAnswersToggleChecked();
218
+ matchingPage.steps.verifyAnswerLabelAndPoints('Alternative answer', '(Points per response - 3 pts)', 1);
219
+ matchingPage.steps.verifyAlternativeAnswerResponsesInCorrectAnswerSectionAndCount([['Bear'], ['Penguin'], ['Cat']], 1);
220
+ matchingPage.steps.clickShowAlternativeAnswersToggle();
221
+ matchingPage.steps.verifyShowAlternativeAnswersToggleUnchecked();
222
+ }
149
223
  matchingPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
150
224
  /*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')
151
225
  matchingPage.steps.checkAnswer();
@@ -166,6 +240,19 @@ describe('Create item page - Matching: Partial equal weights with alternative an
166
240
  matchingPage.steps.verifyCorrectOptionIcon(2);
167
241
  matchingPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
168
242
  matchingPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([['Elephant'], ['Fish'], ['Cat']]);
243
+ if (alternativeAnswerCheck === 'true') {
244
+ matchingPage.steps.verifyAnswerLabelAndPoints('Correct answer', '(Points per response - 5 pts)', 0);
245
+ matchingPage.steps.verifyShowAlternativeAnswersToggleExists();
246
+ matchingPage.steps.disableShowAlternativeAnswersToggle();
247
+ matchingPage.steps.verifyShowAlternativeAnswersToggleUnchecked();
248
+ matchingPage.steps.verifyAlternativeAnswersSectionNotExist();
249
+ matchingPage.steps.clickShowAlternativeAnswersToggle();
250
+ matchingPage.steps.verifyShowAlternativeAnswersToggleChecked();
251
+ matchingPage.steps.verifyAnswerLabelAndPoints('Alternative answer', '(Points per response - 3 pts)', 1);
252
+ matchingPage.steps.verifyAlternativeAnswerResponsesInCorrectAnswerSectionAndCount([['Bear'], ['Penguin'], ['Cat']], 1);
253
+ matchingPage.steps.clickShowAlternativeAnswersToggle();
254
+ matchingPage.steps.verifyShowAlternativeAnswersToggleUnchecked();
255
+ }
169
256
  matchingPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
170
257
  /*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')
171
258
  matchingPage.steps.checkAnswer();
@@ -186,6 +273,19 @@ describe('Create item page - Matching: Partial equal weights with alternative an
186
273
  matchingPage.steps.verifyIncorrectOptionIconForEmptyOption(2);
187
274
  matchingPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
188
275
  matchingPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([['Elephant'], ['Fish'], ['Cat']]);
276
+ if (alternativeAnswerCheck === 'true') {
277
+ matchingPage.steps.verifyAnswerLabelAndPoints('Correct answer', '(Points per response - 5 pts)', 0);
278
+ matchingPage.steps.verifyShowAlternativeAnswersToggleExists();
279
+ matchingPage.steps.disableShowAlternativeAnswersToggle();
280
+ matchingPage.steps.verifyShowAlternativeAnswersToggleUnchecked();
281
+ matchingPage.steps.verifyAlternativeAnswersSectionNotExist();
282
+ matchingPage.steps.clickShowAlternativeAnswersToggle();
283
+ matchingPage.steps.verifyShowAlternativeAnswersToggleChecked();
284
+ matchingPage.steps.verifyAnswerLabelAndPoints('Alternative answer', '(Points per response - 3 pts)', 1);
285
+ matchingPage.steps.verifyAlternativeAnswerResponsesInCorrectAnswerSectionAndCount([['Bear'], ['Penguin'], ['Cat']], 1);
286
+ matchingPage.steps.clickShowAlternativeAnswersToggle();
287
+ matchingPage.steps.verifyShowAlternativeAnswersToggleUnchecked();
288
+ }
189
289
  matchingPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
190
290
  /*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')
191
291
  matchingPage.steps.checkAnswer();
@@ -214,6 +314,19 @@ describe('Create item page - Matching: Partial equal weights with alternative an
214
314
  matchingPage.steps.verifyIncorrectOptionIcon(2);
215
315
  matchingPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
216
316
  matchingPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([['Elephant'], ['Fish'], ['Cat']]);
317
+ if (alternativeAnswerCheck === 'true') {
318
+ matchingPage.steps.verifyAnswerLabelAndPoints('Correct answer', '(Points per response - 7.67 pts)', 0);
319
+ matchingPage.steps.verifyShowAlternativeAnswersToggleExists();
320
+ matchingPage.steps.disableShowAlternativeAnswersToggle();
321
+ matchingPage.steps.verifyShowAlternativeAnswersToggleUnchecked();
322
+ matchingPage.steps.verifyAlternativeAnswersSectionNotExist();
323
+ matchingPage.steps.clickShowAlternativeAnswersToggle();
324
+ matchingPage.steps.verifyShowAlternativeAnswersToggleChecked();
325
+ matchingPage.steps.verifyAnswerLabelAndPoints('Alternative answer', '(Points per response - 1.67 pts)', 1);
326
+ matchingPage.steps.verifyAlternativeAnswerResponsesInCorrectAnswerSectionAndCount([['Bear'], ['Penguin'], ['Eagle']], 1);
327
+ matchingPage.steps.clickShowAlternativeAnswersToggle();
328
+ matchingPage.steps.verifyShowAlternativeAnswersToggleUnchecked();
329
+ }
217
330
  matchingPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
218
331
  /*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')
219
332
  matchingPage.steps.checkAnswer();