itemengine-cypress-automation 1.0.577-IEI-7065-Improve-test-coverage-for-essay-response-1a0a73e.0 → 1.0.578-IEI-7079-de6e553.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 (34) hide show
  1. package/cypress/e2e/ILC/ChartsBar/Scoring/allOrNothingAlternatePointsGreaterThanCorrectPoints.js +205 -0
  2. package/cypress/e2e/ILC/ChartsBar/Scoring/allOrNothingCorrectPointsEqualToAlternatePoints.js +205 -0
  3. package/cypress/e2e/ILC/ChartsBar/Scoring/allOrNothingCorrectPointsGreaterThanAlternatePoints.js +205 -0
  4. package/cypress/e2e/ILC/ChartsBar/Scoring/partialDifferentWeightsAlternativePointsGreaterThanCorrectPoints.js +248 -1
  5. package/cypress/e2e/ILC/ChartsBar/Scoring/partialDifferentWeightsCorrectPointsEqualToAlternativePoints.js +247 -0
  6. package/cypress/e2e/ILC/ChartsBar/Scoring/partialDifferentWeightsCorrectPointsGreaterThanAlternativePoints.js +223 -0
  7. package/cypress/e2e/ILC/ChartsBar/Scoring/partialEqualWeightsAlternativePointsGreaterThanCorrectPoints.js +223 -0
  8. package/cypress/e2e/ILC/ChartsBar/Scoring/partialEqualWeightsCorrectPointsEqualToAlternativePoints.js +175 -0
  9. package/cypress/e2e/ILC/ChartsBar/Scoring/partialEqualWeightsCorrectPointsGreaterThanAlternativePoints.js +223 -0
  10. package/cypress/e2e/ILC/ChartsBar/Scoring/partialEqualWeightsCorrectPointsGreaterThanAlternativePointsLocked.js +191 -0
  11. package/cypress/e2e/ILC/ChartsDotsPlot/scoring/partialEqualWeightsWithCorrectPointsGreaterThanAlternativePointsLocked.js +184 -24
  12. package/cypress/e2e/ILC/ChartsLine/Scoring/allOrNothingAlternatePointsGreaterThanCorrectPoints.js +177 -0
  13. package/cypress/e2e/ILC/ChartsLine/Scoring/allOrNothingCorrectPointsEqualToAlternatePoints.js +206 -0
  14. package/cypress/e2e/ILC/ChartsLine/Scoring/allOrNothingCorrectPointsGreaterThanAlternatePoints.js +205 -0
  15. package/cypress/e2e/ILC/ChartsLine/Scoring/partialDifferentWeightsAlternativePointsGreaterThanCorrectPoints.js +228 -0
  16. package/cypress/e2e/ILC/ChartsLine/Scoring/partialDifferentWeightsCorrectPointsEqualToAlternativePoints.js +229 -1
  17. package/cypress/e2e/ILC/ChartsLine/Scoring/partialDifferentWeightsCorrectPointsGreaterThanAlternativePoints.js +229 -1
  18. package/cypress/e2e/ILC/ChartsLine/Scoring/partialEqualWeightsAlternativePointsGreaterThanCorrectPoints.js +206 -0
  19. package/cypress/e2e/ILC/ChartsLine/Scoring/partialEqualWeightsCorrectPointsEqualToAlternativePoints.js +183 -0
  20. package/cypress/e2e/ILC/ChartsLine/Scoring/partialEqualWeightsCorrectPointsGreaterThanAlternativePoints.js +206 -0
  21. package/cypress/e2e/ILC/ChartsLine/Scoring/partialEqualWeightsCorrectPointsGreaterThanAlternativePointsLocked.js +184 -0
  22. package/cypress/e2e/ILC/chartsDotsPlot/scoring/allOrNothingWithAlternatePointsGreaterThanCorrectPoints.js +164 -10
  23. package/cypress/e2e/ILC/chartsDotsPlot/scoring/allOrNothingWithCorrectPointsEqualToAlternativePoints.js +165 -11
  24. package/cypress/e2e/ILC/chartsDotsPlot/scoring/allOrNothingWithCorrectPointsGreaterThanAlternativePoints.js +165 -11
  25. package/cypress/e2e/ILC/chartsDotsPlot/scoring/partialDifferentWeightsWithAlternativePointsGreaterThanCorrectPoints.js +164 -14
  26. package/cypress/e2e/ILC/chartsDotsPlot/scoring/partialDifferentWeightsWithCorrectPointsEqualToAlternativePoints.js +121 -10
  27. package/cypress/e2e/ILC/chartsDotsPlot/scoring/partialDifferentWeightsWithCorrectPointsGreaterThanAlternativePoints.js +167 -16
  28. package/cypress/e2e/ILC/chartsDotsPlot/scoring/partialEqualWeightsWithAlternativePointsGreaterThanCorrectPoints.js +178 -15
  29. package/cypress/e2e/ILC/chartsDotsPlot/scoring/partialEqualWeightsWithCorrectPointsEqualToAlternativePoints.js +121 -10
  30. package/cypress/e2e/ILC/chartsDotsPlot/scoring/partialEqualWeightsWithCorrectPointsGreaterThanAlternativePoints.js +165 -13
  31. package/cypress/pages/chartsBarPage.js +44 -1
  32. package/cypress/pages/chartsDotPlotPage.js +99 -1
  33. package/cypress/pages/chartsLinePage.js +48 -1
  34. package/package.json +1 -1
@@ -1,6 +1,8 @@
1
1
  import { chartsLinePage } from "../../../../pages";
2
2
  import abortEarlySetup from "../../../../support/helpers/abortEarly";
3
3
 
4
+ const alternativeAnswerCheck = Cypress.env('ENABLE_ALTERNATIVE_ANSWER_ENHANCEMENT');
5
+
4
6
  describe('Create item page - Charts - Line: All or nothing scoring with alternative answer - When Alternate answer points are more than correct answer points', () => {
5
7
  before(() => {
6
8
  cy.loginAs('admin');
@@ -47,6 +49,27 @@ describe('Create item page - Charts - Line: All or nothing scoring with alternat
47
49
  chartsLinePage.steps.verifyPointInCorrectAnswerSection({ pointIndex: 2, value: 0, range: 10 });
48
50
  chartsLinePage.steps.verifyPointInCorrectAnswerSection({ pointIndex: 3, value: 4, range: 10 });
49
51
  chartsLinePage.steps.verifyPointInCorrectAnswerSection({ pointIndex: 4, value: 6, range: 10 });
52
+ if (alternativeAnswerCheck === 'true') {
53
+ chartsLinePage.steps.verifyCorrectAnswersLabelAndPointVisible('(20 points)');
54
+ chartsLinePage.steps.verifyPointInCorrectAnswerSection({ pointIndex: 0, value: 4, range: 10 });
55
+ chartsLinePage.steps.verifyLockedPointInCorrectAnswerSection({ pointIndex: 1, value: 2, range: 10 });
56
+ chartsLinePage.steps.verifyPointInCorrectAnswerSection({ pointIndex: 3, value: 4, range: 10 });
57
+ chartsLinePage.steps.verifyPointInCorrectAnswerSection({ pointIndex: 4, value: 6, range: 10 });
58
+ chartsLinePage.steps.verifyShowAlternativeAnswersToggleExists();
59
+ chartsLinePage.steps.disableShowAlternativeAnswersToggle();
60
+ chartsLinePage.steps.verifyShowAlternativeAnswersToggleUnchecked();
61
+ chartsLinePage.steps.verifyAlternativeAnswersSectionNotExist();
62
+ chartsLinePage.steps.clickShowAlternativeAnswersToggle();
63
+ chartsLinePage.steps.verifyShowAlternativeAnswersToggleChecked();
64
+ chartsLinePage.steps.verifyAlternativeAnswersLabelAndPointVisible(1, '(10 points)');
65
+ chartsLinePage.steps.verifyPointValueInAlternativeAnswerSection({ pointIndex: 0, value: 3, range: 10 });
66
+ chartsLinePage.steps.verifyLockedPointInAlternativeAnswerSection({ pointIndex: 1, value: 2, range: 10 });
67
+ chartsLinePage.steps.verifyPointValueInAlternativeAnswerSection({ pointIndex: 2, value: 5, range: 10 });
68
+ chartsLinePage.steps.verifyPointValueInAlternativeAnswerSection({ pointIndex: 3, value: 4, range: 10 });
69
+ chartsLinePage.steps.verifyPointValueInAlternativeAnswerSection({ pointIndex: 4, value: 0, range: 10 });
70
+ chartsLinePage.steps.clickShowAlternativeAnswersToggle();
71
+ chartsLinePage.steps.verifyShowAlternativeAnswersToggleUnchecked();
72
+ }
50
73
  chartsLinePage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
51
74
  /*cy.log('When the user selects check answer without attempting the question, then correct/incorrect status message should not be displayed, incorrect icons should be displayed on the unattempted bars and correct icons should be displayed on the bar which is correct by default')
52
75
  chartsLinePage.steps.checkAnswer();
@@ -77,6 +100,27 @@ describe('Create item page - Charts - Line: All or nothing scoring with alternat
77
100
  chartsLinePage.steps.verifyPointInCorrectAnswerSection({ pointIndex: 2, value: 0, range: 10 });
78
101
  chartsLinePage.steps.verifyPointInCorrectAnswerSection({ pointIndex: 3, value: 4, range: 10 });
79
102
  chartsLinePage.steps.verifyPointInCorrectAnswerSection({ pointIndex: 4, value: 6, range: 10 });
103
+ if (alternativeAnswerCheck === 'true') {
104
+ chartsLinePage.steps.verifyCorrectAnswersLabelAndPointVisible('(20 points)');
105
+ chartsLinePage.steps.verifyPointInCorrectAnswerSection({ pointIndex: 0, value: 4, range: 10 });
106
+ chartsLinePage.steps.verifyLockedPointInCorrectAnswerSection({ pointIndex: 1, value: 2, range: 10 });
107
+ chartsLinePage.steps.verifyPointInCorrectAnswerSection({ pointIndex: 3, value: 4, range: 10 });
108
+ chartsLinePage.steps.verifyPointInCorrectAnswerSection({ pointIndex: 4, value: 6, range: 10 });
109
+ chartsLinePage.steps.verifyShowAlternativeAnswersToggleExists();
110
+ chartsLinePage.steps.disableShowAlternativeAnswersToggle();
111
+ chartsLinePage.steps.verifyShowAlternativeAnswersToggleUnchecked();
112
+ chartsLinePage.steps.verifyAlternativeAnswersSectionNotExist();
113
+ chartsLinePage.steps.clickShowAlternativeAnswersToggle();
114
+ chartsLinePage.steps.verifyShowAlternativeAnswersToggleChecked();
115
+ chartsLinePage.steps.verifyAlternativeAnswersLabelAndPointVisible(1, '(10 points)');
116
+ chartsLinePage.steps.verifyPointValueInAlternativeAnswerSection({ pointIndex: 0, value: 3, range: 10 });
117
+ chartsLinePage.steps.verifyLockedPointInAlternativeAnswerSection({ pointIndex: 1, value: 2, range: 10 });
118
+ chartsLinePage.steps.verifyPointValueInAlternativeAnswerSection({ pointIndex: 2, value: 5, range: 10 });
119
+ chartsLinePage.steps.verifyPointValueInAlternativeAnswerSection({ pointIndex: 3, value: 4, range: 10 });
120
+ chartsLinePage.steps.verifyPointValueInAlternativeAnswerSection({ pointIndex: 4, value: 0, range: 10 });
121
+ chartsLinePage.steps.clickShowAlternativeAnswersToggle();
122
+ chartsLinePage.steps.verifyShowAlternativeAnswersToggleUnchecked();
123
+ }
80
124
  chartsLinePage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
81
125
  /*cy.log('When the user selects check answer after incorrectly attempting the question, then \'Your answer is incorrect\' should be displayed, incorrect icons should be displayed on the incorrectly attempted bars')
82
126
  chartsLinePage.steps.checkAnswer();
@@ -102,6 +146,9 @@ describe('Create item page - Charts - Line: All or nothing scoring with alternat
102
146
  chartsLinePage.steps.verifyPointCorrectIncorrectIconInPreviewTab(4, 'correct');
103
147
  chartsLinePage.steps.verifyCorrectIncorrectAnswerLabel('correct');
104
148
  chartsLinePage.steps.verifyCorrectAnswerSectionNotExist();
149
+ if (alternativeAnswerCheck === 'true') {
150
+ chartsLinePage.steps.verifyShowAlternativeAnswersToggleNotExists();
151
+ }
105
152
  chartsLinePage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
106
153
  /*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\' should be displayed and correct answer section should not be displayed')
107
154
  chartsLinePage.steps.checkAnswer();
@@ -128,6 +175,9 @@ describe('Create item page - Charts - Line: All or nothing scoring with alternat
128
175
  chartsLinePage.steps.verifyPointCorrectIncorrectIconInPreviewTab(4, 'correct');
129
176
  chartsLinePage.steps.verifyCorrectIncorrectAnswerLabel('correct');
130
177
  chartsLinePage.steps.verifyCorrectAnswerSectionNotExist();
178
+ if (alternativeAnswerCheck === 'true') {
179
+ chartsLinePage.steps.verifyShowAlternativeAnswersToggleNotExists();
180
+ }
131
181
  chartsLinePage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
132
182
  /*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\' should be displayed and correct answer section should not be displayed')
133
183
  chartsLinePage.steps.checkAnswer();
@@ -156,6 +206,7 @@ describe('Create item page - Charts - Line: All or nothing scoring with alternat
156
206
  chartsLinePage.steps.verifyPointInCorrectAnswerSection({ pointIndex: 2, value: 0, range: 10 });
157
207
  chartsLinePage.steps.verifyPointInCorrectAnswerSection({ pointIndex: 3, value: 4, range: 10 });
158
208
  chartsLinePage.steps.verifyPointInCorrectAnswerSection({ pointIndex: 4, value: 6, range: 10 });
209
+
159
210
  chartsLinePage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
160
211
  /*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')
161
212
  chartsLinePage.steps.checkAnswer();
@@ -185,6 +236,27 @@ describe('Create item page - Charts - Line: All or nothing scoring with alternat
185
236
  chartsLinePage.steps.verifyPointInCorrectAnswerSection({ pointIndex: 2, value: 0, range: 10 });
186
237
  chartsLinePage.steps.verifyPointInCorrectAnswerSection({ pointIndex: 3, value: 4, range: 10 });
187
238
  chartsLinePage.steps.verifyPointInCorrectAnswerSection({ pointIndex: 4, value: 6, range: 10 });
239
+ if (alternativeAnswerCheck === 'true') {
240
+ chartsLinePage.steps.verifyCorrectAnswersLabelAndPointVisible('(20 points)');
241
+ chartsLinePage.steps.verifyPointInCorrectAnswerSection({ pointIndex: 0, value: 4, range: 10 });
242
+ chartsLinePage.steps.verifyLockedPointInCorrectAnswerSection({ pointIndex: 1, value: 2, range: 10 });
243
+ chartsLinePage.steps.verifyPointInCorrectAnswerSection({ pointIndex: 3, value: 4, range: 10 });
244
+ chartsLinePage.steps.verifyPointInCorrectAnswerSection({ pointIndex: 4, value: 6, range: 10 });
245
+ chartsLinePage.steps.verifyShowAlternativeAnswersToggleExists();
246
+ chartsLinePage.steps.disableShowAlternativeAnswersToggle();
247
+ chartsLinePage.steps.verifyShowAlternativeAnswersToggleUnchecked();
248
+ chartsLinePage.steps.verifyAlternativeAnswersSectionNotExist();
249
+ chartsLinePage.steps.clickShowAlternativeAnswersToggle();
250
+ chartsLinePage.steps.verifyShowAlternativeAnswersToggleChecked();
251
+ chartsLinePage.steps.verifyAlternativeAnswersLabelAndPointVisible(1, '(10 points)');
252
+ chartsLinePage.steps.verifyPointValueInAlternativeAnswerSection({ pointIndex: 0, value: 3, range: 10 });
253
+ chartsLinePage.steps.verifyLockedPointInAlternativeAnswerSection({ pointIndex: 1, value: 2, range: 10 });
254
+ chartsLinePage.steps.verifyPointValueInAlternativeAnswerSection({ pointIndex: 2, value: 5, range: 10 });
255
+ chartsLinePage.steps.verifyPointValueInAlternativeAnswerSection({ pointIndex: 3, value: 4, range: 10 });
256
+ chartsLinePage.steps.verifyPointValueInAlternativeAnswerSection({ pointIndex: 4, value: 0, range: 10 });
257
+ chartsLinePage.steps.clickShowAlternativeAnswersToggle();
258
+ chartsLinePage.steps.verifyShowAlternativeAnswersToggleUnchecked();
259
+ }
188
260
  chartsLinePage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
189
261
  /*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, incorrect icons should be displayed on the incorrect bars a status message with text \'Your answer is incorrect\' and correct answer section should not be displayed')
190
262
  chartsLinePage.steps.checkAnswer();
@@ -216,6 +288,27 @@ describe('Create item page - Charts - Line: All or nothing scoring with alternat
216
288
  chartsLinePage.steps.verifyPointInCorrectAnswerSection({ pointIndex: 2, value: 0, range: 10 });
217
289
  chartsLinePage.steps.verifyPointInCorrectAnswerSection({ pointIndex: 3, value: 4, range: 10 });
218
290
  chartsLinePage.steps.verifyPointInCorrectAnswerSection({ pointIndex: 4, value: 6, range: 10 });
291
+ if (alternativeAnswerCheck === 'true') {
292
+ chartsLinePage.steps.verifyCorrectAnswersLabelAndPointVisible('(20 points)');
293
+ chartsLinePage.steps.verifyPointInCorrectAnswerSection({ pointIndex: 0, value: 4, range: 10 });
294
+ chartsLinePage.steps.verifyLockedPointInCorrectAnswerSection({ pointIndex: 1, value: 2, range: 10 });
295
+ chartsLinePage.steps.verifyPointInCorrectAnswerSection({ pointIndex: 3, value: 4, range: 10 });
296
+ chartsLinePage.steps.verifyPointInCorrectAnswerSection({ pointIndex: 4, value: 6, range: 10 });
297
+ chartsLinePage.steps.verifyShowAlternativeAnswersToggleExists();
298
+ chartsLinePage.steps.disableShowAlternativeAnswersToggle();
299
+ chartsLinePage.steps.verifyShowAlternativeAnswersToggleUnchecked();
300
+ chartsLinePage.steps.verifyAlternativeAnswersSectionNotExist();
301
+ chartsLinePage.steps.clickShowAlternativeAnswersToggle();
302
+ chartsLinePage.steps.verifyShowAlternativeAnswersToggleChecked();
303
+ chartsLinePage.steps.verifyAlternativeAnswersLabelAndPointVisible(1, '(10 points)');
304
+ chartsLinePage.steps.verifyPointValueInAlternativeAnswerSection({ pointIndex: 0, value: 3, range: 10 });
305
+ chartsLinePage.steps.verifyLockedPointInAlternativeAnswerSection({ pointIndex: 1, value: 2, range: 10 });
306
+ chartsLinePage.steps.verifyPointValueInAlternativeAnswerSection({ pointIndex: 2, value: 5, range: 10 });
307
+ chartsLinePage.steps.verifyPointValueInAlternativeAnswerSection({ pointIndex: 3, value: 4, range: 10 });
308
+ chartsLinePage.steps.verifyPointValueInAlternativeAnswerSection({ pointIndex: 4, value: 0, range: 10 });
309
+ chartsLinePage.steps.clickShowAlternativeAnswersToggle();
310
+ chartsLinePage.steps.verifyShowAlternativeAnswersToggleUnchecked();
311
+ }
219
312
  chartsLinePage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
220
313
  /*cy.log('When the user attempts the question with all answers from the correct accordion except one 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')
221
314
  chartsLinePage.steps.checkAnswer();
@@ -245,6 +338,27 @@ describe('Create item page - Charts - Line: All or nothing scoring with alternat
245
338
  chartsLinePage.steps.verifyPointInCorrectAnswerSection({ pointIndex: 2, value: 0, range: 10 });
246
339
  chartsLinePage.steps.verifyPointInCorrectAnswerSection({ pointIndex: 3, value: 4, range: 10 });
247
340
  chartsLinePage.steps.verifyPointInCorrectAnswerSection({ pointIndex: 4, value: 6, range: 10 });
341
+ if (alternativeAnswerCheck === 'true') {
342
+ chartsLinePage.steps.verifyCorrectAnswersLabelAndPointVisible('(20 points)');
343
+ chartsLinePage.steps.verifyPointInCorrectAnswerSection({ pointIndex: 0, value: 4, range: 10 });
344
+ chartsLinePage.steps.verifyLockedPointInCorrectAnswerSection({ pointIndex: 1, value: 2, range: 10 });
345
+ chartsLinePage.steps.verifyPointInCorrectAnswerSection({ pointIndex: 3, value: 4, range: 10 });
346
+ chartsLinePage.steps.verifyPointInCorrectAnswerSection({ pointIndex: 4, value: 6, range: 10 });
347
+ chartsLinePage.steps.verifyShowAlternativeAnswersToggleExists();
348
+ chartsLinePage.steps.disableShowAlternativeAnswersToggle();
349
+ chartsLinePage.steps.verifyShowAlternativeAnswersToggleUnchecked();
350
+ chartsLinePage.steps.verifyAlternativeAnswersSectionNotExist();
351
+ chartsLinePage.steps.clickShowAlternativeAnswersToggle();
352
+ chartsLinePage.steps.verifyShowAlternativeAnswersToggleChecked();
353
+ chartsLinePage.steps.verifyAlternativeAnswersLabelAndPointVisible(1, '(10 points)');
354
+ chartsLinePage.steps.verifyPointValueInAlternativeAnswerSection({ pointIndex: 0, value: 3, range: 10 });
355
+ chartsLinePage.steps.verifyLockedPointInAlternativeAnswerSection({ pointIndex: 1, value: 2, range: 10 });
356
+ chartsLinePage.steps.verifyPointValueInAlternativeAnswerSection({ pointIndex: 2, value: 5, range: 10 });
357
+ chartsLinePage.steps.verifyPointValueInAlternativeAnswerSection({ pointIndex: 3, value: 4, range: 10 });
358
+ chartsLinePage.steps.verifyPointValueInAlternativeAnswerSection({ pointIndex: 4, value: 0, range: 10 });
359
+ chartsLinePage.steps.clickShowAlternativeAnswersToggle();
360
+ chartsLinePage.steps.verifyShowAlternativeAnswersToggleUnchecked();
361
+ }
248
362
  chartsLinePage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
249
363
  /*cy.log('When the user attempts the question with more answers from the correct accordion than the alternate accordion and clicks on \'Check answer\' button, then correct icon should be displayed besides the alternate accordion responses, incorrect icons should be displayed on the correct accordion responses, a status message with text \'Your answer is incorrect\' and correct answer section should not be displayed')
250
364
  chartsLinePage.steps.checkAnswer();
@@ -273,6 +387,27 @@ describe('Create item page - Charts - Line: All or nothing scoring with alternat
273
387
  chartsLinePage.steps.verifyPointInCorrectAnswerSection({ pointIndex: 2, value: 0, range: 10 });
274
388
  chartsLinePage.steps.verifyPointInCorrectAnswerSection({ pointIndex: 3, value: 4, range: 10 });
275
389
  chartsLinePage.steps.verifyPointInCorrectAnswerSection({ pointIndex: 4, value: 6, range: 10 });
390
+ if (alternativeAnswerCheck === 'true') {
391
+ chartsLinePage.steps.verifyCorrectAnswersLabelAndPointVisible('(20 points)');
392
+ chartsLinePage.steps.verifyPointInCorrectAnswerSection({ pointIndex: 0, value: 4, range: 10 });
393
+ chartsLinePage.steps.verifyLockedPointInCorrectAnswerSection({ pointIndex: 1, value: 2, range: 10 });
394
+ chartsLinePage.steps.verifyPointInCorrectAnswerSection({ pointIndex: 3, value: 4, range: 10 });
395
+ chartsLinePage.steps.verifyPointInCorrectAnswerSection({ pointIndex: 4, value: 6, range: 10 });
396
+ chartsLinePage.steps.verifyShowAlternativeAnswersToggleExists();
397
+ chartsLinePage.steps.disableShowAlternativeAnswersToggle();
398
+ chartsLinePage.steps.verifyShowAlternativeAnswersToggleUnchecked();
399
+ chartsLinePage.steps.verifyAlternativeAnswersSectionNotExist();
400
+ chartsLinePage.steps.clickShowAlternativeAnswersToggle();
401
+ chartsLinePage.steps.verifyShowAlternativeAnswersToggleChecked();
402
+ chartsLinePage.steps.verifyAlternativeAnswersLabelAndPointVisible(1, '(10 points)');
403
+ chartsLinePage.steps.verifyPointValueInAlternativeAnswerSection({ pointIndex: 0, value: 3, range: 10 });
404
+ chartsLinePage.steps.verifyLockedPointInAlternativeAnswerSection({ pointIndex: 1, value: 2, range: 10 });
405
+ chartsLinePage.steps.verifyPointValueInAlternativeAnswerSection({ pointIndex: 2, value: 5, range: 10 });
406
+ chartsLinePage.steps.verifyPointValueInAlternativeAnswerSection({ pointIndex: 3, value: 4, range: 10 });
407
+ chartsLinePage.steps.verifyPointValueInAlternativeAnswerSection({ pointIndex: 4, value: 0, range: 10 });
408
+ chartsLinePage.steps.clickShowAlternativeAnswersToggle();
409
+ chartsLinePage.steps.verifyShowAlternativeAnswersToggleUnchecked();
410
+ }
276
411
  chartsLinePage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
277
412
  /*cy.log('When the user attempts the question with more answers from the alternate accordion than the correct accordion and clicks on \'Check answer\' button, then correct icon should be displayed besides the correct accordion responses, incorrect icons should be displayed on the alternate accordion responses, a status message with text \'Your answer is incorrect\' and correct answer section should not be displayed')
278
413
  chartsLinePage.steps.checkAnswer();
@@ -303,6 +438,27 @@ describe('Create item page - Charts - Line: All or nothing scoring with alternat
303
438
  chartsLinePage.steps.verifyPointInCorrectAnswerSection({ pointIndex: 2, value: 0, range: 10 });
304
439
  chartsLinePage.steps.verifyPointInCorrectAnswerSection({ pointIndex: 3, value: 4, range: 10 });
305
440
  chartsLinePage.steps.verifyPointInCorrectAnswerSection({ pointIndex: 4, value: 6, range: 10 });
441
+ if (alternativeAnswerCheck === 'true') {
442
+ chartsLinePage.steps.verifyCorrectAnswersLabelAndPointVisible('(20 points)');
443
+ chartsLinePage.steps.verifyPointInCorrectAnswerSection({ pointIndex: 0, value: 4, range: 10 });
444
+ chartsLinePage.steps.verifyLockedPointInCorrectAnswerSection({ pointIndex: 1, value: 2, range: 10 });
445
+ chartsLinePage.steps.verifyPointInCorrectAnswerSection({ pointIndex: 3, value: 4, range: 10 });
446
+ chartsLinePage.steps.verifyPointInCorrectAnswerSection({ pointIndex: 4, value: 6, range: 10 });
447
+ chartsLinePage.steps.verifyShowAlternativeAnswersToggleExists();
448
+ chartsLinePage.steps.disableShowAlternativeAnswersToggle();
449
+ chartsLinePage.steps.verifyShowAlternativeAnswersToggleUnchecked();
450
+ chartsLinePage.steps.verifyAlternativeAnswersSectionNotExist();
451
+ chartsLinePage.steps.clickShowAlternativeAnswersToggle();
452
+ chartsLinePage.steps.verifyShowAlternativeAnswersToggleChecked();
453
+ chartsLinePage.steps.verifyAlternativeAnswersLabelAndPointVisible(1, '(10 points)');
454
+ chartsLinePage.steps.verifyPointValueInAlternativeAnswerSection({ pointIndex: 0, value: 3, range: 10 });
455
+ chartsLinePage.steps.verifyLockedPointInAlternativeAnswerSection({ pointIndex: 1, value: 2, range: 10 });
456
+ chartsLinePage.steps.verifyPointValueInAlternativeAnswerSection({ pointIndex: 2, value: 5, range: 10 });
457
+ chartsLinePage.steps.verifyPointValueInAlternativeAnswerSection({ pointIndex: 3, value: 4, range: 10 });
458
+ chartsLinePage.steps.verifyPointValueInAlternativeAnswerSection({ pointIndex: 4, value: 0, range: 10 });
459
+ chartsLinePage.steps.clickShowAlternativeAnswersToggle();
460
+ chartsLinePage.steps.verifyShowAlternativeAnswersToggleUnchecked();
461
+ }
306
462
  chartsLinePage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
307
463
  /*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')
308
464
  chartsLinePage.steps.checkAnswer();
@@ -334,6 +490,27 @@ describe('Create item page - Charts - Line: All or nothing scoring with alternat
334
490
  chartsLinePage.steps.verifyPointInCorrectAnswerSection({ pointIndex: 2, value: 0, range: 10 });
335
491
  chartsLinePage.steps.verifyPointInCorrectAnswerSection({ pointIndex: 3, value: 4, range: 10 });
336
492
  chartsLinePage.steps.verifyPointInCorrectAnswerSection({ pointIndex: 4, value: 6, range: 10 });
493
+ if (alternativeAnswerCheck === 'true') {
494
+ chartsLinePage.steps.verifyCorrectAnswersLabelAndPointVisible('(20 points)');
495
+ chartsLinePage.steps.verifyPointInCorrectAnswerSection({ pointIndex: 0, value: 4, range: 10 });
496
+ chartsLinePage.steps.verifyLockedPointInCorrectAnswerSection({ pointIndex: 1, value: 2, range: 10 });
497
+ chartsLinePage.steps.verifyPointInCorrectAnswerSection({ pointIndex: 3, value: 4, range: 10 });
498
+ chartsLinePage.steps.verifyPointInCorrectAnswerSection({ pointIndex: 4, value: 6, range: 10 });
499
+ chartsLinePage.steps.verifyShowAlternativeAnswersToggleExists();
500
+ chartsLinePage.steps.disableShowAlternativeAnswersToggle();
501
+ chartsLinePage.steps.verifyShowAlternativeAnswersToggleUnchecked();
502
+ chartsLinePage.steps.verifyAlternativeAnswersSectionNotExist();
503
+ chartsLinePage.steps.clickShowAlternativeAnswersToggle();
504
+ chartsLinePage.steps.verifyShowAlternativeAnswersToggleChecked();
505
+ chartsLinePage.steps.verifyAlternativeAnswersLabelAndPointVisible(1, '(10 points)');
506
+ chartsLinePage.steps.verifyPointValueInAlternativeAnswerSection({ pointIndex: 0, value: 3, range: 10 });
507
+ chartsLinePage.steps.verifyLockedPointInAlternativeAnswerSection({ pointIndex: 1, value: 2, range: 10 });
508
+ chartsLinePage.steps.verifyPointValueInAlternativeAnswerSection({ pointIndex: 2, value: 5, range: 10 });
509
+ chartsLinePage.steps.verifyPointValueInAlternativeAnswerSection({ pointIndex: 3, value: 4, range: 10 });
510
+ chartsLinePage.steps.verifyPointValueInAlternativeAnswerSection({ pointIndex: 4, value: 0, range: 10 });
511
+ chartsLinePage.steps.clickShowAlternativeAnswersToggle();
512
+ chartsLinePage.steps.verifyShowAlternativeAnswersToggleUnchecked();
513
+ }
337
514
  chartsLinePage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
338
515
  /*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 icons should be displayed on the incorrect bars a status message with text \'Your answer is incorrect\' and correct answer section should not be displayed')
339
516
  chartsLinePage.steps.checkAnswer();
@@ -1,6 +1,8 @@
1
1
  import { chartsLinePage } from "../../../../pages";
2
2
  import abortEarlySetup from "../../../../support/helpers/abortEarly";
3
3
 
4
+ const alternativeAnswerCheck = Cypress.env('ENABLE_ALTERNATIVE_ANSWER_ENHANCEMENT');
5
+
4
6
  describe('Create item page - Charts - Line: All or nothing scoring with alternative answer - When Correct answer points are equal to alternative Answer points', () => {
5
7
  before(() => {
6
8
  cy.loginAs('admin');
@@ -47,6 +49,28 @@ describe('Create item page - Charts - Line: All or nothing scoring with alternat
47
49
  chartsLinePage.steps.verifyPointInCorrectAnswerSection({ pointIndex: 2, value: 5, range: 10 });
48
50
  chartsLinePage.steps.verifyPointInCorrectAnswerSection({ pointIndex: 3, value: 4, range: 10 });
49
51
  chartsLinePage.steps.verifyPointInCorrectAnswerSection({ pointIndex: 4, value: 0, range: 10 });
52
+ if (alternativeAnswerCheck === 'true') {
53
+ chartsLinePage.steps.verifyCorrectAnswersLabelAndPointVisible('(20 points)');
54
+ chartsLinePage.steps.verifyPointInCorrectAnswerSection({ pointIndex: 0, value: 3, range: 10 });
55
+ chartsLinePage.steps.verifyLockedPointInCorrectAnswerSection({ pointIndex: 1, value: 2, range: 10 });
56
+ chartsLinePage.steps.verifyPointInCorrectAnswerSection({ pointIndex: 2, value: 5, range: 10 });
57
+ chartsLinePage.steps.verifyPointInCorrectAnswerSection({ pointIndex: 3, value: 4, range: 10 });
58
+ chartsLinePage.steps.verifyPointInCorrectAnswerSection({ pointIndex: 4, value: 0, range: 10 });
59
+ chartsLinePage.steps.verifyShowAlternativeAnswersToggleExists();
60
+ chartsLinePage.steps.disableShowAlternativeAnswersToggle();
61
+ chartsLinePage.steps.verifyShowAlternativeAnswersToggleUnchecked();
62
+ chartsLinePage.steps.verifyAlternativeAnswersSectionNotExist();
63
+ chartsLinePage.steps.clickShowAlternativeAnswersToggle();
64
+ chartsLinePage.steps.verifyShowAlternativeAnswersToggleChecked();
65
+ chartsLinePage.steps.verifyAlternativeAnswersLabelAndPointVisible(1, '(20 points)');
66
+ chartsLinePage.steps.verifyPointValueInAlternativeAnswerSection({ pointIndex: 0, value: 4, range: 10 });
67
+ chartsLinePage.steps.verifyLockedPointInAlternativeAnswerSection({ pointIndex: 1, value: 2, range: 10 });
68
+ chartsLinePage.steps.verifyPointValueInAlternativeAnswerSection({ pointIndex: 2, value: 0, range: 10 });
69
+ chartsLinePage.steps.verifyPointValueInAlternativeAnswerSection({ pointIndex: 3, value: 4, range: 10 });
70
+ chartsLinePage.steps.verifyPointValueInAlternativeAnswerSection({ pointIndex: 4, value: 6, range: 10 });
71
+ chartsLinePage.steps.clickShowAlternativeAnswersToggle();
72
+ chartsLinePage.steps.verifyShowAlternativeAnswersToggleUnchecked();
73
+ }
50
74
  chartsLinePage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
51
75
  /*cy.log('When the user selects check answer without attempting the question, then correct/incorrect status message should not be displayed, incorrect icons should be displayed on the unattempted bars and correct icons should be displayed on the bar which is correct by default')
52
76
  chartsLinePage.steps.checkAnswer();
@@ -77,6 +101,28 @@ describe('Create item page - Charts - Line: All or nothing scoring with alternat
77
101
  chartsLinePage.steps.verifyPointInCorrectAnswerSection({ pointIndex: 2, value: 5, range: 10 });
78
102
  chartsLinePage.steps.verifyPointInCorrectAnswerSection({ pointIndex: 3, value: 4, range: 10 });
79
103
  chartsLinePage.steps.verifyPointInCorrectAnswerSection({ pointIndex: 4, value: 0, range: 10 });
104
+ if (alternativeAnswerCheck === 'true') {
105
+ chartsLinePage.steps.verifyCorrectAnswersLabelAndPointVisible('(20 points)');
106
+ chartsLinePage.steps.verifyPointInCorrectAnswerSection({ pointIndex: 0, value: 3, range: 10 });
107
+ chartsLinePage.steps.verifyLockedPointInCorrectAnswerSection({ pointIndex: 1, value: 2, range: 10 });
108
+ chartsLinePage.steps.verifyPointInCorrectAnswerSection({ pointIndex: 2, value: 5, range: 10 });
109
+ chartsLinePage.steps.verifyPointInCorrectAnswerSection({ pointIndex: 3, value: 4, range: 10 });
110
+ chartsLinePage.steps.verifyPointInCorrectAnswerSection({ pointIndex: 4, value: 0, range: 10 });
111
+ chartsLinePage.steps.verifyShowAlternativeAnswersToggleExists();
112
+ chartsLinePage.steps.disableShowAlternativeAnswersToggle();
113
+ chartsLinePage.steps.verifyShowAlternativeAnswersToggleUnchecked();
114
+ chartsLinePage.steps.verifyAlternativeAnswersSectionNotExist();
115
+ chartsLinePage.steps.clickShowAlternativeAnswersToggle();
116
+ chartsLinePage.steps.verifyShowAlternativeAnswersToggleChecked();
117
+ chartsLinePage.steps.verifyAlternativeAnswersLabelAndPointVisible(1, '(20 points)');
118
+ chartsLinePage.steps.verifyPointValueInAlternativeAnswerSection({ pointIndex: 0, value: 4, range: 10 });
119
+ chartsLinePage.steps.verifyLockedPointInAlternativeAnswerSection({ pointIndex: 1, value: 2, range: 10 });
120
+ chartsLinePage.steps.verifyPointValueInAlternativeAnswerSection({ pointIndex: 2, value: 0, range: 10 });
121
+ chartsLinePage.steps.verifyPointValueInAlternativeAnswerSection({ pointIndex: 3, value: 4, range: 10 });
122
+ chartsLinePage.steps.verifyPointValueInAlternativeAnswerSection({ pointIndex: 4, value: 6, range: 10 });
123
+ chartsLinePage.steps.clickShowAlternativeAnswersToggle();
124
+ chartsLinePage.steps.verifyShowAlternativeAnswersToggleUnchecked();
125
+ }
80
126
  chartsLinePage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
81
127
  /*cy.log('When the user selects check answer after incorrectly attempting the question, then \'Your answer is incorrect\' should be displayed, incorrect icons should be displayed on the incorrectly attempted bars')
82
128
  chartsLinePage.steps.checkAnswer();
@@ -102,6 +148,9 @@ describe('Create item page - Charts - Line: All or nothing scoring with alternat
102
148
  chartsLinePage.steps.verifyPointCorrectIncorrectIconInPreviewTab(4, 'correct');
103
149
  chartsLinePage.steps.verifyCorrectIncorrectAnswerLabel('correct');
104
150
  chartsLinePage.steps.verifyCorrectAnswerSectionNotExist();
151
+ if (alternativeAnswerCheck === 'true') {
152
+ chartsLinePage.steps.verifyShowAlternativeAnswersToggleNotExists();
153
+ }
105
154
  chartsLinePage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
106
155
  /*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\' should be displayed and correct answer section should not be displayed')
107
156
  chartsLinePage.steps.checkAnswer();
@@ -128,6 +177,9 @@ describe('Create item page - Charts - Line: All or nothing scoring with alternat
128
177
  chartsLinePage.steps.verifyPointCorrectIncorrectIconInPreviewTab(4, 'correct');
129
178
  chartsLinePage.steps.verifyCorrectIncorrectAnswerLabel('correct');
130
179
  chartsLinePage.steps.verifyCorrectAnswerSectionNotExist();
180
+ if (alternativeAnswerCheck === 'true') {
181
+ chartsLinePage.steps.verifyShowAlternativeAnswersToggleNotExists();
182
+ }
131
183
  chartsLinePage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
132
184
  /*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\' should be displayed and correct answer section should not be displayed')
133
185
  chartsLinePage.steps.checkAnswer();
@@ -156,6 +208,28 @@ describe('Create item page - Charts - Line: All or nothing scoring with alternat
156
208
  chartsLinePage.steps.verifyPointInCorrectAnswerSection({ pointIndex: 2, value: 5, range: 10 });
157
209
  chartsLinePage.steps.verifyPointInCorrectAnswerSection({ pointIndex: 3, value: 4, range: 10 });
158
210
  chartsLinePage.steps.verifyPointInCorrectAnswerSection({ pointIndex: 4, value: 0, range: 10 });
211
+ if (alternativeAnswerCheck === 'true') {
212
+ chartsLinePage.steps.verifyCorrectAnswersLabelAndPointVisible('(20 points)');
213
+ chartsLinePage.steps.verifyPointInCorrectAnswerSection({ pointIndex: 0, value: 3, range: 10 });
214
+ chartsLinePage.steps.verifyLockedPointInCorrectAnswerSection({ pointIndex: 1, value: 2, range: 10 });
215
+ chartsLinePage.steps.verifyPointInCorrectAnswerSection({ pointIndex: 2, value: 5, range: 10 });
216
+ chartsLinePage.steps.verifyPointInCorrectAnswerSection({ pointIndex: 3, value: 4, range: 10 });
217
+ chartsLinePage.steps.verifyPointInCorrectAnswerSection({ pointIndex: 4, value: 0, range: 10 });
218
+ chartsLinePage.steps.verifyShowAlternativeAnswersToggleExists();
219
+ chartsLinePage.steps.disableShowAlternativeAnswersToggle();
220
+ chartsLinePage.steps.verifyShowAlternativeAnswersToggleUnchecked();
221
+ chartsLinePage.steps.verifyAlternativeAnswersSectionNotExist();
222
+ chartsLinePage.steps.clickShowAlternativeAnswersToggle();
223
+ chartsLinePage.steps.verifyShowAlternativeAnswersToggleChecked();
224
+ chartsLinePage.steps.verifyAlternativeAnswersLabelAndPointVisible(1, '(20 points)');
225
+ chartsLinePage.steps.verifyPointValueInAlternativeAnswerSection({ pointIndex: 0, value: 4, range: 10 });
226
+ chartsLinePage.steps.verifyLockedPointInAlternativeAnswerSection({ pointIndex: 1, value: 2, range: 10 });
227
+ chartsLinePage.steps.verifyPointValueInAlternativeAnswerSection({ pointIndex: 2, value: 0, range: 10 });
228
+ chartsLinePage.steps.verifyPointValueInAlternativeAnswerSection({ pointIndex: 3, value: 4, range: 10 });
229
+ chartsLinePage.steps.verifyPointValueInAlternativeAnswerSection({ pointIndex: 4, value: 6, range: 10 });
230
+ chartsLinePage.steps.clickShowAlternativeAnswersToggle();
231
+ chartsLinePage.steps.verifyShowAlternativeAnswersToggleUnchecked();
232
+ }
159
233
  chartsLinePage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
160
234
  /*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')
161
235
  chartsLinePage.steps.checkAnswer();
@@ -185,6 +259,28 @@ describe('Create item page - Charts - Line: All or nothing scoring with alternat
185
259
  chartsLinePage.steps.verifyPointInCorrectAnswerSection({ pointIndex: 2, value: 5, range: 10 });
186
260
  chartsLinePage.steps.verifyPointInCorrectAnswerSection({ pointIndex: 3, value: 4, range: 10 });
187
261
  chartsLinePage.steps.verifyPointInCorrectAnswerSection({ pointIndex: 4, value: 0, range: 10 });
262
+ if (alternativeAnswerCheck === 'true') {
263
+ chartsLinePage.steps.verifyCorrectAnswersLabelAndPointVisible('(20 points)');
264
+ chartsLinePage.steps.verifyPointInCorrectAnswerSection({ pointIndex: 0, value: 3, range: 10 });
265
+ chartsLinePage.steps.verifyLockedPointInCorrectAnswerSection({ pointIndex: 1, value: 2, range: 10 });
266
+ chartsLinePage.steps.verifyPointInCorrectAnswerSection({ pointIndex: 2, value: 5, range: 10 });
267
+ chartsLinePage.steps.verifyPointInCorrectAnswerSection({ pointIndex: 3, value: 4, range: 10 });
268
+ chartsLinePage.steps.verifyPointInCorrectAnswerSection({ pointIndex: 4, value: 0, range: 10 });
269
+ chartsLinePage.steps.verifyShowAlternativeAnswersToggleExists();
270
+ chartsLinePage.steps.disableShowAlternativeAnswersToggle();
271
+ chartsLinePage.steps.verifyShowAlternativeAnswersToggleUnchecked();
272
+ chartsLinePage.steps.verifyAlternativeAnswersSectionNotExist();
273
+ chartsLinePage.steps.clickShowAlternativeAnswersToggle();
274
+ chartsLinePage.steps.verifyShowAlternativeAnswersToggleChecked();
275
+ chartsLinePage.steps.verifyAlternativeAnswersLabelAndPointVisible(1, '(20 points)');
276
+ chartsLinePage.steps.verifyPointValueInAlternativeAnswerSection({ pointIndex: 0, value: 4, range: 10 });
277
+ chartsLinePage.steps.verifyLockedPointInAlternativeAnswerSection({ pointIndex: 1, value: 2, range: 10 });
278
+ chartsLinePage.steps.verifyPointValueInAlternativeAnswerSection({ pointIndex: 2, value: 0, range: 10 });
279
+ chartsLinePage.steps.verifyPointValueInAlternativeAnswerSection({ pointIndex: 3, value: 4, range: 10 });
280
+ chartsLinePage.steps.verifyPointValueInAlternativeAnswerSection({ pointIndex: 4, value: 6, range: 10 });
281
+ chartsLinePage.steps.clickShowAlternativeAnswersToggle();
282
+ chartsLinePage.steps.verifyShowAlternativeAnswersToggleUnchecked();
283
+ }
188
284
  chartsLinePage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
189
285
  /*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, incorrect icons should be displayed on the incorrect bars a status message with text \'Your answer is incorrect\' and correct answer section should not be displayed')
190
286
  chartsLinePage.steps.checkAnswer();
@@ -215,6 +311,28 @@ describe('Create item page - Charts - Line: All or nothing scoring with alternat
215
311
  chartsLinePage.steps.verifyPointInCorrectAnswerSection({ pointIndex: 2, value: 5, range: 10 });
216
312
  chartsLinePage.steps.verifyPointInCorrectAnswerSection({ pointIndex: 3, value: 4, range: 10 });
217
313
  chartsLinePage.steps.verifyPointInCorrectAnswerSection({ pointIndex: 4, value: 0, range: 10 });
314
+ if (alternativeAnswerCheck === 'true') {
315
+ chartsLinePage.steps.verifyCorrectAnswersLabelAndPointVisible('(20 points)');
316
+ chartsLinePage.steps.verifyPointInCorrectAnswerSection({ pointIndex: 0, value: 3, range: 10 });
317
+ chartsLinePage.steps.verifyLockedPointInCorrectAnswerSection({ pointIndex: 1, value: 2, range: 10 });
318
+ chartsLinePage.steps.verifyPointInCorrectAnswerSection({ pointIndex: 2, value: 5, range: 10 });
319
+ chartsLinePage.steps.verifyPointInCorrectAnswerSection({ pointIndex: 3, value: 4, range: 10 });
320
+ chartsLinePage.steps.verifyPointInCorrectAnswerSection({ pointIndex: 4, value: 0, range: 10 });
321
+ chartsLinePage.steps.verifyShowAlternativeAnswersToggleExists();
322
+ chartsLinePage.steps.disableShowAlternativeAnswersToggle();
323
+ chartsLinePage.steps.verifyShowAlternativeAnswersToggleUnchecked();
324
+ chartsLinePage.steps.verifyAlternativeAnswersSectionNotExist();
325
+ chartsLinePage.steps.clickShowAlternativeAnswersToggle();
326
+ chartsLinePage.steps.verifyShowAlternativeAnswersToggleChecked();
327
+ chartsLinePage.steps.verifyAlternativeAnswersLabelAndPointVisible(1, '(20 points)');
328
+ chartsLinePage.steps.verifyPointValueInAlternativeAnswerSection({ pointIndex: 0, value: 4, range: 10 });
329
+ chartsLinePage.steps.verifyLockedPointInAlternativeAnswerSection({ pointIndex: 1, value: 2, range: 10 });
330
+ chartsLinePage.steps.verifyPointValueInAlternativeAnswerSection({ pointIndex: 2, value: 0, range: 10 });
331
+ chartsLinePage.steps.verifyPointValueInAlternativeAnswerSection({ pointIndex: 3, value: 4, range: 10 });
332
+ chartsLinePage.steps.verifyPointValueInAlternativeAnswerSection({ pointIndex: 4, value: 6, range: 10 });
333
+ chartsLinePage.steps.clickShowAlternativeAnswersToggle();
334
+ chartsLinePage.steps.verifyShowAlternativeAnswersToggleUnchecked();
335
+ }
218
336
  chartsLinePage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
219
337
  /*cy.log('When the user attempts the question with all answers from the correct accordion except one 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')
220
338
  chartsLinePage.steps.checkAnswer();
@@ -244,6 +362,28 @@ describe('Create item page - Charts - Line: All or nothing scoring with alternat
244
362
  chartsLinePage.steps.verifyPointInCorrectAnswerSection({ pointIndex: 2, value: 5, range: 10 });
245
363
  chartsLinePage.steps.verifyPointInCorrectAnswerSection({ pointIndex: 3, value: 4, range: 10 });
246
364
  chartsLinePage.steps.verifyPointInCorrectAnswerSection({ pointIndex: 4, value: 0, range: 10 });
365
+ if (alternativeAnswerCheck === 'true') {
366
+ chartsLinePage.steps.verifyCorrectAnswersLabelAndPointVisible('(20 points)');
367
+ chartsLinePage.steps.verifyPointInCorrectAnswerSection({ pointIndex: 0, value: 3, range: 10 });
368
+ chartsLinePage.steps.verifyLockedPointInCorrectAnswerSection({ pointIndex: 1, value: 2, range: 10 });
369
+ chartsLinePage.steps.verifyPointInCorrectAnswerSection({ pointIndex: 2, value: 5, range: 10 });
370
+ chartsLinePage.steps.verifyPointInCorrectAnswerSection({ pointIndex: 3, value: 4, range: 10 });
371
+ chartsLinePage.steps.verifyPointInCorrectAnswerSection({ pointIndex: 4, value: 0, range: 10 });
372
+ chartsLinePage.steps.verifyShowAlternativeAnswersToggleExists();
373
+ chartsLinePage.steps.disableShowAlternativeAnswersToggle();
374
+ chartsLinePage.steps.verifyShowAlternativeAnswersToggleUnchecked();
375
+ chartsLinePage.steps.verifyAlternativeAnswersSectionNotExist();
376
+ chartsLinePage.steps.clickShowAlternativeAnswersToggle();
377
+ chartsLinePage.steps.verifyShowAlternativeAnswersToggleChecked();
378
+ chartsLinePage.steps.verifyAlternativeAnswersLabelAndPointVisible(1, '(20 points)');
379
+ chartsLinePage.steps.verifyPointValueInAlternativeAnswerSection({ pointIndex: 0, value: 4, range: 10 });
380
+ chartsLinePage.steps.verifyLockedPointInAlternativeAnswerSection({ pointIndex: 1, value: 2, range: 10 });
381
+ chartsLinePage.steps.verifyPointValueInAlternativeAnswerSection({ pointIndex: 2, value: 0, range: 10 });
382
+ chartsLinePage.steps.verifyPointValueInAlternativeAnswerSection({ pointIndex: 3, value: 4, range: 10 });
383
+ chartsLinePage.steps.verifyPointValueInAlternativeAnswerSection({ pointIndex: 4, value: 6, range: 10 });
384
+ chartsLinePage.steps.clickShowAlternativeAnswersToggle();
385
+ chartsLinePage.steps.verifyShowAlternativeAnswersToggleUnchecked();
386
+ }
247
387
  chartsLinePage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
248
388
  /*cy.log('When the user attempts the question with more answers from the correct accordion than the alternate accordion and clicks on \'Check answer\' button, then correct icon should be displayed besides the correct accordion responses, incorrect icons should be displayed on the alternate accordion responses, a status message with text \'Your answer is incorrect\' and correct answer section should not be displayed')
249
389
  chartsLinePage.steps.checkAnswer();
@@ -272,6 +412,28 @@ describe('Create item page - Charts - Line: All or nothing scoring with alternat
272
412
  chartsLinePage.steps.verifyPointInCorrectAnswerSection({ pointIndex: 2, value: 5, range: 10 });
273
413
  chartsLinePage.steps.verifyPointInCorrectAnswerSection({ pointIndex: 3, value: 4, range: 10 });
274
414
  chartsLinePage.steps.verifyPointInCorrectAnswerSection({ pointIndex: 4, value: 0, range: 10 });
415
+ if (alternativeAnswerCheck === 'true') {
416
+ chartsLinePage.steps.verifyCorrectAnswersLabelAndPointVisible('(20 points)');
417
+ chartsLinePage.steps.verifyPointInCorrectAnswerSection({ pointIndex: 0, value: 3, range: 10 });
418
+ chartsLinePage.steps.verifyLockedPointInCorrectAnswerSection({ pointIndex: 1, value: 2, range: 10 });
419
+ chartsLinePage.steps.verifyPointInCorrectAnswerSection({ pointIndex: 2, value: 5, range: 10 });
420
+ chartsLinePage.steps.verifyPointInCorrectAnswerSection({ pointIndex: 3, value: 4, range: 10 });
421
+ chartsLinePage.steps.verifyPointInCorrectAnswerSection({ pointIndex: 4, value: 0, range: 10 });
422
+ chartsLinePage.steps.verifyShowAlternativeAnswersToggleExists();
423
+ chartsLinePage.steps.disableShowAlternativeAnswersToggle();
424
+ chartsLinePage.steps.verifyShowAlternativeAnswersToggleUnchecked();
425
+ chartsLinePage.steps.verifyAlternativeAnswersSectionNotExist();
426
+ chartsLinePage.steps.clickShowAlternativeAnswersToggle();
427
+ chartsLinePage.steps.verifyShowAlternativeAnswersToggleChecked();
428
+ chartsLinePage.steps.verifyAlternativeAnswersLabelAndPointVisible(1, '(20 points)');
429
+ chartsLinePage.steps.verifyPointValueInAlternativeAnswerSection({ pointIndex: 0, value: 4, range: 10 });
430
+ chartsLinePage.steps.verifyLockedPointInAlternativeAnswerSection({ pointIndex: 1, value: 2, range: 10 });
431
+ chartsLinePage.steps.verifyPointValueInAlternativeAnswerSection({ pointIndex: 2, value: 0, range: 10 });
432
+ chartsLinePage.steps.verifyPointValueInAlternativeAnswerSection({ pointIndex: 3, value: 4, range: 10 });
433
+ chartsLinePage.steps.verifyPointValueInAlternativeAnswerSection({ pointIndex: 4, value: 6, range: 10 });
434
+ chartsLinePage.steps.clickShowAlternativeAnswersToggle();
435
+ chartsLinePage.steps.verifyShowAlternativeAnswersToggleUnchecked();
436
+ }
275
437
  chartsLinePage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
276
438
  /*cy.log('When the user attempts the question with more answers from the alternate accordion than the correct accordion and clicks on \'Check answer\' button, then correct icon should be displayed besides the correct accordion responses, incorrect icons should be displayed on the alternate accordion responses, a status message with text \'Your answer is incorrect\' and correct answer section should not be displayed')
277
439
  chartsLinePage.steps.checkAnswer();
@@ -302,6 +464,28 @@ describe('Create item page - Charts - Line: All or nothing scoring with alternat
302
464
  chartsLinePage.steps.verifyPointInCorrectAnswerSection({ pointIndex: 2, value: 5, range: 10 });
303
465
  chartsLinePage.steps.verifyPointInCorrectAnswerSection({ pointIndex: 3, value: 4, range: 10 });
304
466
  chartsLinePage.steps.verifyPointInCorrectAnswerSection({ pointIndex: 4, value: 0, range: 10 });
467
+ if (alternativeAnswerCheck === 'true') {
468
+ chartsLinePage.steps.verifyCorrectAnswersLabelAndPointVisible('(20 points)');
469
+ chartsLinePage.steps.verifyPointInCorrectAnswerSection({ pointIndex: 0, value: 3, range: 10 });
470
+ chartsLinePage.steps.verifyLockedPointInCorrectAnswerSection({ pointIndex: 1, value: 2, range: 10 });
471
+ chartsLinePage.steps.verifyPointInCorrectAnswerSection({ pointIndex: 2, value: 5, range: 10 });
472
+ chartsLinePage.steps.verifyPointInCorrectAnswerSection({ pointIndex: 3, value: 4, range: 10 });
473
+ chartsLinePage.steps.verifyPointInCorrectAnswerSection({ pointIndex: 4, value: 0, range: 10 });
474
+ chartsLinePage.steps.verifyShowAlternativeAnswersToggleExists();
475
+ chartsLinePage.steps.disableShowAlternativeAnswersToggle();
476
+ chartsLinePage.steps.verifyShowAlternativeAnswersToggleUnchecked();
477
+ chartsLinePage.steps.verifyAlternativeAnswersSectionNotExist();
478
+ chartsLinePage.steps.clickShowAlternativeAnswersToggle();
479
+ chartsLinePage.steps.verifyShowAlternativeAnswersToggleChecked();
480
+ chartsLinePage.steps.verifyAlternativeAnswersLabelAndPointVisible(1, '(20 points)');
481
+ chartsLinePage.steps.verifyPointValueInAlternativeAnswerSection({ pointIndex: 0, value: 4, range: 10 });
482
+ chartsLinePage.steps.verifyLockedPointInAlternativeAnswerSection({ pointIndex: 1, value: 2, range: 10 });
483
+ chartsLinePage.steps.verifyPointValueInAlternativeAnswerSection({ pointIndex: 2, value: 0, range: 10 });
484
+ chartsLinePage.steps.verifyPointValueInAlternativeAnswerSection({ pointIndex: 3, value: 4, range: 10 });
485
+ chartsLinePage.steps.verifyPointValueInAlternativeAnswerSection({ pointIndex: 4, value: 6, range: 10 });
486
+ chartsLinePage.steps.clickShowAlternativeAnswersToggle();
487
+ chartsLinePage.steps.verifyShowAlternativeAnswersToggleUnchecked();
488
+ }
305
489
  chartsLinePage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
306
490
  /*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')
307
491
  chartsLinePage.steps.checkAnswer();
@@ -333,6 +517,28 @@ describe('Create item page - Charts - Line: All or nothing scoring with alternat
333
517
  chartsLinePage.steps.verifyPointInCorrectAnswerSection({ pointIndex: 2, value: 5, range: 10 });
334
518
  chartsLinePage.steps.verifyPointInCorrectAnswerSection({ pointIndex: 3, value: 4, range: 10 });
335
519
  chartsLinePage.steps.verifyPointInCorrectAnswerSection({ pointIndex: 4, value: 0, range: 10 });
520
+ if (alternativeAnswerCheck === 'true') {
521
+ chartsLinePage.steps.verifyCorrectAnswersLabelAndPointVisible('(20 points)');
522
+ chartsLinePage.steps.verifyPointInCorrectAnswerSection({ pointIndex: 0, value: 3, range: 10 });
523
+ chartsLinePage.steps.verifyLockedPointInCorrectAnswerSection({ pointIndex: 1, value: 2, range: 10 });
524
+ chartsLinePage.steps.verifyPointInCorrectAnswerSection({ pointIndex: 2, value: 5, range: 10 });
525
+ chartsLinePage.steps.verifyPointInCorrectAnswerSection({ pointIndex: 3, value: 4, range: 10 });
526
+ chartsLinePage.steps.verifyPointInCorrectAnswerSection({ pointIndex: 4, value: 0, range: 10 });
527
+ chartsLinePage.steps.verifyShowAlternativeAnswersToggleExists();
528
+ chartsLinePage.steps.disableShowAlternativeAnswersToggle();
529
+ chartsLinePage.steps.verifyShowAlternativeAnswersToggleUnchecked();
530
+ chartsLinePage.steps.verifyAlternativeAnswersSectionNotExist();
531
+ chartsLinePage.steps.clickShowAlternativeAnswersToggle();
532
+ chartsLinePage.steps.verifyShowAlternativeAnswersToggleChecked();
533
+ chartsLinePage.steps.verifyAlternativeAnswersLabelAndPointVisible(1, '(20 points)');
534
+ chartsLinePage.steps.verifyPointValueInAlternativeAnswerSection({ pointIndex: 0, value: 4, range: 10 });
535
+ chartsLinePage.steps.verifyLockedPointInAlternativeAnswerSection({ pointIndex: 1, value: 2, range: 10 });
536
+ chartsLinePage.steps.verifyPointValueInAlternativeAnswerSection({ pointIndex: 2, value: 0, range: 10 });
537
+ chartsLinePage.steps.verifyPointValueInAlternativeAnswerSection({ pointIndex: 3, value: 4, range: 10 });
538
+ chartsLinePage.steps.verifyPointValueInAlternativeAnswerSection({ pointIndex: 4, value: 6, range: 10 });
539
+ chartsLinePage.steps.clickShowAlternativeAnswersToggle();
540
+ chartsLinePage.steps.verifyShowAlternativeAnswersToggleUnchecked();
541
+ }
336
542
  chartsLinePage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
337
543
  /*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 icons should be displayed on the incorrect bars a status message with text \'Your answer is incorrect\' and correct answer section should not be displayed')
338
544
  chartsLinePage.steps.checkAnswer();