itemengine-cypress-automation 1.0.585-IEI-7048-5c19852.0 → 1.0.585-IEI-7048-de16dee.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 (16) hide show
  1. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/Scoring/allOrNothingGroupedScoring.js +4 -1
  2. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/Scoring/allOrNothingWithAlternativePointsGreaterThanCorrectPoints.js +109 -8
  3. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/Scoring/allOrNothingWithCorrectPointsEqualToAlternativePoints.js +109 -8
  4. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/Scoring/allOrNothingWithCorrectPointsGreaterThanAlternativePoints.js +109 -8
  5. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/Scoring/blankResponseScoring.js +7 -2
  6. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/Scoring/partialDifferentWeightsAlternativePointsGreaterThanCorrectPoints.js +139 -10
  7. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/Scoring/partialDifferentWeightsBasic.js +4 -1
  8. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/Scoring/partialDifferentWeightsWithCorrectPointsEqualToAlternativePoints.js +124 -9
  9. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/Scoring/partialDifferentWeightsWithCorrectPointsGreaterThanAlternativePoints.js +139 -10
  10. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/Scoring/partialEqualWeightsBasic.js +4 -1
  11. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/Scoring/partialEqualWeightsWithAlternativePointsGreaterThanCorrectPoints.js +124 -9
  12. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/Scoring/partialEqualWeightsWithCorrectPointsEqualToAlternativePoints.js +109 -8
  13. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/Scoring/partialEqualWeightsWithCorrectPointsGreaterThanAlternativePoints.js +124 -9
  14. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/allOrNothingForAllViews.smoke.js +243 -2
  15. package/cypress/pages/components/fillInTheGapsDragAndDropCommonComponents.js +25 -1
  16. package/package.json +1 -1
@@ -1,6 +1,9 @@
1
1
  import { fillInTheGapsDragAndDropPage } from "../../../../pages";
2
2
  import abortEarlySetup from "../../../../support/helpers/abortEarly";
3
3
  import utilities from "../../../../support/helpers/utilities";
4
+ import { showAlternativeAnswersComponent } from "../../../../pages/components";
5
+
6
+ const alternativeAnswerCheck = Cypress.env('ENABLE_ALTERNATIVE_ANSWER_ENHANCEMENT') === 'true';
4
7
  const css = Cypress.env('css');
5
8
 
6
9
  describe('Create item page - Fill in the gaps with drag and drop: Partial different weights', () => {
@@ -30,8 +33,22 @@ describe('Create item page - Fill in the gaps with drag and drop: Partial differ
30
33
  it('When the user selects \'Grading\' view without attempting the question, dropzone 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', () => {
31
34
  fillInTheGapsDragAndDropPage.steps.switchToGradingView();
32
35
  fillInTheGapsDragAndDropPage.steps.verifyDropzoneNumeration();
33
- utilities.verifyInnerText(fillInTheGapsDragAndDropPage.correctAnswersLabel(), 'Correct answers');
34
- fillInTheGapsDragAndDropPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([['Petals'], ['Stem'], ['Seed']]);
36
+ if (alternativeAnswerCheck) {
37
+ showAlternativeAnswersComponent.steps.clickShowAlternativeAnswersToggle();
38
+ fillInTheGapsDragAndDropPage.steps.verifyCorrectAnswerSectionWithAlternateAnswers([
39
+ {
40
+ correctAnswers: [['Petals'], ['Stem'], ['Seed']],
41
+ points: ['(15 points)', '(6 points)', '(4 points)', '(5 points)'],
42
+ },
43
+ {
44
+ correctAnswers: [['Petals'], ['Flower'], ['Leaves']],
45
+ points: ['(13 points)', '(7 points)', '(1 point)', '(5 points)'],
46
+ }
47
+ ]);
48
+ } else {
49
+ utilities.verifyInnerText(fillInTheGapsDragAndDropPage.correctAnswersLabel(), 'Correct answers');
50
+ fillInTheGapsDragAndDropPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([['Petals'], ['Stem'], ['Seed']]);
51
+ }
35
52
  });
36
53
 
37
54
  it('When the user attempts the question with responses from the correct accordion, then the user should be awarded points of the correct accordion (less than full points) and on switching to \'Grading\' view, green check-marks should be displayed beside all the correct responses, status message and correct answer section should not be displayed', () => {
@@ -83,7 +100,21 @@ describe('Create item page - Fill in the gaps with drag and drop: Partial differ
83
100
  fillInTheGapsDragAndDropPage.steps.verifyCorrectOptionIcon(1);
84
101
  fillInTheGapsDragAndDropPage.steps.verifyCorrectOptionIcon(2);
85
102
  fillInTheGapsDragAndDropPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
86
- fillInTheGapsDragAndDropPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([['Petals'], ['Stem'], ['Seed']]);
103
+ if (alternativeAnswerCheck) {
104
+ showAlternativeAnswersComponent.steps.clickShowAlternativeAnswersToggle();
105
+ fillInTheGapsDragAndDropPage.steps.verifyCorrectAnswerSectionWithAlternateAnswers([
106
+ {
107
+ correctAnswers: [['Petals'], ['Stem'], ['Seed']],
108
+ points: ['(15 points)', '(6 points)', '(4 points)', '(5 points)'],
109
+ },
110
+ {
111
+ correctAnswers: [['Petals'], ['Flower'], ['Leaves']],
112
+ points: ['(13 points)', '(7 points)', '(1 point)', '(5 points)'],
113
+ }
114
+ ]);
115
+ } else {
116
+ fillInTheGapsDragAndDropPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([['Petals'], ['Stem'], ['Seed']]);
117
+ }
87
118
  fillInTheGapsDragAndDropPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
88
119
  /*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 green check-mark should be displayed besides the correct answer responses, status message and correct answer section should not be displayed')
89
120
  fillInTheGapsDragAndDropPage.steps.checkAnswer();
@@ -103,7 +134,21 @@ describe('Create item page - Fill in the gaps with drag and drop: Partial differ
103
134
  fillInTheGapsDragAndDropPage.steps.verifyCorrectOptionIcon(1);
104
135
  fillInTheGapsDragAndDropPage.steps.verifyCorrectOptionIcon(2);
105
136
  fillInTheGapsDragAndDropPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
106
- fillInTheGapsDragAndDropPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([['Petals'], ['Stem'], ['Seed']]);
137
+ if (alternativeAnswerCheck) {
138
+ showAlternativeAnswersComponent.steps.clickShowAlternativeAnswersToggle();
139
+ fillInTheGapsDragAndDropPage.steps.verifyCorrectAnswerSectionWithAlternateAnswers([
140
+ {
141
+ correctAnswers: [['Petals'], ['Stem'], ['Seed']],
142
+ points: ['(15 points)', '(6 points)', '(4 points)', '(5 points)'],
143
+ },
144
+ {
145
+ correctAnswers: [['Petals'], ['Flower'], ['Leaves']],
146
+ points: ['(13 points)', '(7 points)', '(1 point)', '(5 points)'],
147
+ }
148
+ ]);
149
+ } else {
150
+ fillInTheGapsDragAndDropPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([['Petals'], ['Stem'], ['Seed']]);
151
+ }
107
152
  fillInTheGapsDragAndDropPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
108
153
  /*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 green check-mark should be displayed besides the correct answer responses, no icon should be displayed beside unattempted response status message and correct answer section should not be displayed')
109
154
  fillInTheGapsDragAndDropPage.steps.checkAnswer();
@@ -123,7 +168,21 @@ describe('Create item page - Fill in the gaps with drag and drop: Partial differ
123
168
  fillInTheGapsDragAndDropPage.steps.verifyCorrectOptionIcon(1);
124
169
  fillInTheGapsDragAndDropPage.steps.verifyIncorrectOptionIcon(2);
125
170
  fillInTheGapsDragAndDropPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
126
- fillInTheGapsDragAndDropPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([['Petals'], ['Stem'], ['Seed']]);
171
+ if (alternativeAnswerCheck) {
172
+ showAlternativeAnswersComponent.steps.clickShowAlternativeAnswersToggle();
173
+ fillInTheGapsDragAndDropPage.steps.verifyCorrectAnswerSectionWithAlternateAnswers([
174
+ {
175
+ correctAnswers: [['Petals'], ['Stem'], ['Seed']],
176
+ points: ['(15 points)', '(6 points)', '(4 points)', '(5 points)'],
177
+ },
178
+ {
179
+ correctAnswers: [['Petals'], ['Flower'], ['Leaves']],
180
+ points: ['(13 points)', '(7 points)', '(1 point)', '(5 points)'],
181
+ }
182
+ ]);
183
+ } else {
184
+ fillInTheGapsDragAndDropPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([['Petals'], ['Stem'], ['Seed']]);
185
+ }
127
186
  fillInTheGapsDragAndDropPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
128
187
  /*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 green check-mark should be displayed besides the response from the correct accordion, red cross-mark should be displayed besides the responses from the alternative accordion and no icon should be displayed beside unattempted response, status message and correct answer section should not be displayed')
129
188
  fillInTheGapsDragAndDropPage.steps.checkAnswer();
@@ -143,7 +202,21 @@ describe('Create item page - Fill in the gaps with drag and drop: Partial differ
143
202
  fillInTheGapsDragAndDropPage.steps.verifyIncorrectOptionIcon(1);
144
203
  fillInTheGapsDragAndDropPage.steps.verifyCorrectOptionIcon(2);
145
204
  fillInTheGapsDragAndDropPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
146
- fillInTheGapsDragAndDropPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([['Petals'], ['Stem'], ['Seed']]);
205
+ if (alternativeAnswerCheck) {
206
+ showAlternativeAnswersComponent.steps.clickShowAlternativeAnswersToggle();
207
+ fillInTheGapsDragAndDropPage.steps.verifyCorrectAnswerSectionWithAlternateAnswers([
208
+ {
209
+ correctAnswers: [['Petals'], ['Stem'], ['Seed']],
210
+ points: ['(15 points)', '(6 points)', '(4 points)', '(5 points)'],
211
+ },
212
+ {
213
+ correctAnswers: [['Petals'], ['Flower'], ['Leaves']],
214
+ points: ['(13 points)', '(7 points)', '(1 point)', '(5 points)'],
215
+ }
216
+ ]);
217
+ } else {
218
+ fillInTheGapsDragAndDropPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([['Petals'], ['Stem'], ['Seed']]);
219
+ }
147
220
  fillInTheGapsDragAndDropPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
148
221
  /*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 green check-mark should be displayed besides the alternative answer responses, red cross-mark should be displayed beside responses of the correct accordion status message and correct answer section should not be displayed')
149
222
  fillInTheGapsDragAndDropPage.steps.checkAnswer();
@@ -163,7 +236,21 @@ describe('Create item page - Fill in the gaps with drag and drop: Partial differ
163
236
  fillInTheGapsDragAndDropPage.steps.verifyIncorrectOptionIcon(1);
164
237
  fillInTheGapsDragAndDropPage.steps.verifyCorrectOptionIcon(2);
165
238
  fillInTheGapsDragAndDropPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
166
- fillInTheGapsDragAndDropPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([['Petals'], ['Stem'], ['Seed']]);
239
+ if (alternativeAnswerCheck) {
240
+ showAlternativeAnswersComponent.steps.clickShowAlternativeAnswersToggle();
241
+ fillInTheGapsDragAndDropPage.steps.verifyCorrectAnswerSectionWithAlternateAnswers([
242
+ {
243
+ correctAnswers: [['Petals'], ['Stem'], ['Seed']],
244
+ points: ['(15 points)', '(6 points)', '(4 points)', '(5 points)'],
245
+ },
246
+ {
247
+ correctAnswers: [['Petals'], ['Flower'], ['Leaves']],
248
+ points: ['(13 points)', '(7 points)', '(1 point)', '(5 points)'],
249
+ }
250
+ ]);
251
+ } else {
252
+ fillInTheGapsDragAndDropPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([['Petals'], ['Stem'], ['Seed']]);
253
+ }
167
254
  fillInTheGapsDragAndDropPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
168
255
  /*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 green check-mark should be displayed besides the correct answer responses, red cross-mark should be displayed beside empty responses status message and correct answer section should not be displayed')
169
256
  fillInTheGapsDragAndDropPage.steps.checkAnswer();
@@ -183,7 +270,21 @@ describe('Create item page - Fill in the gaps with drag and drop: Partial differ
183
270
  fillInTheGapsDragAndDropPage.steps.verifyIncorrectOptionIcon(1);
184
271
  fillInTheGapsDragAndDropPage.steps.verifyIncorrectOptionIcon(2);
185
272
  fillInTheGapsDragAndDropPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
186
- fillInTheGapsDragAndDropPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([['Petals'], ['Stem'], ['Seed']]);
273
+ if (alternativeAnswerCheck) {
274
+ showAlternativeAnswersComponent.steps.clickShowAlternativeAnswersToggle();
275
+ fillInTheGapsDragAndDropPage.steps.verifyCorrectAnswerSectionWithAlternateAnswers([
276
+ {
277
+ correctAnswers: [['Petals'], ['Stem'], ['Seed']],
278
+ points: ['(15 points)', '(6 points)', '(4 points)', '(5 points)'],
279
+ },
280
+ {
281
+ correctAnswers: [['Petals'], ['Flower'], ['Leaves']],
282
+ points: ['(13 points)', '(7 points)', '(1 point)', '(5 points)'],
283
+ }
284
+ ]);
285
+ } else {
286
+ fillInTheGapsDragAndDropPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([['Petals'], ['Stem'], ['Seed']]);
287
+ }
187
288
  fillInTheGapsDragAndDropPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
188
289
  /*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 green check-mark should be displayed besides the correct answer responses, no icon should be displayed beside unattempted response status message and correct answer section should not be displayed')
189
290
  fillInTheGapsDragAndDropPage.steps.checkAnswer();
@@ -203,7 +304,21 @@ describe('Create item page - Fill in the gaps with drag and drop: Partial differ
203
304
  fillInTheGapsDragAndDropPage.steps.verifyIncorrectOptionIcon(1);
204
305
  fillInTheGapsDragAndDropPage.steps.verifyIncorrectOptionIcon(2);
205
306
  fillInTheGapsDragAndDropPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
206
- fillInTheGapsDragAndDropPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([['Petals'], ['Stem'], ['Seed']]);
307
+ if (alternativeAnswerCheck) {
308
+ showAlternativeAnswersComponent.steps.clickShowAlternativeAnswersToggle();
309
+ fillInTheGapsDragAndDropPage.steps.verifyCorrectAnswerSectionWithAlternateAnswers([
310
+ {
311
+ correctAnswers: [['Petals'], ['Stem'], ['Seed']],
312
+ points: ['(15 points)', '(6 points)', '(4 points)', '(5 points)'],
313
+ },
314
+ {
315
+ correctAnswers: [['Petals'], ['Flower'], ['Leaves']],
316
+ points: ['(13 points)', '(7 points)', '(1 point)', '(5 points)'],
317
+ }
318
+ ]);
319
+ } else {
320
+ fillInTheGapsDragAndDropPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([['Petals'], ['Stem'], ['Seed']]);
321
+ }
207
322
  fillInTheGapsDragAndDropPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
208
323
  /*cy.log('When the user has attempted the question incorrectly and clicks on \'Check answer\' button, then red cross-marks should be displayed besides all incorrect responses, no icon should be displayed beside unattempted response status message and correct answer section should not be displayed')
209
324
  fillInTheGapsDragAndDropPage.steps.checkAnswer();
@@ -231,7 +346,21 @@ describe('Create item page - Fill in the gaps with drag and drop: Partial differ
231
346
  fillInTheGapsDragAndDropPage.steps.verifyIncorrectOptionIcon(1);
232
347
  fillInTheGapsDragAndDropPage.steps.verifyCorrectOptionIcon(2);
233
348
  fillInTheGapsDragAndDropPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
234
- fillInTheGapsDragAndDropPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([['Roots'], ['Stem'], ['Seed']]);
349
+ if (alternativeAnswerCheck) {
350
+ showAlternativeAnswersComponent.steps.clickShowAlternativeAnswersToggle();
351
+ fillInTheGapsDragAndDropPage.steps.verifyCorrectAnswerSectionWithAlternateAnswers([
352
+ {
353
+ correctAnswers: [['Roots'], ['Stem'], ['Seed']],
354
+ points: ['(23 points)', '(11.4 points)', '(1.2 points)', '(10.4 points)'],
355
+ },
356
+ {
357
+ correctAnswers: [['Petals'], ['Flower'], ['Leaves']],
358
+ points: ['(5 points)', '(1.2 points)', '(2.2 points)', '(1.6 points)'],
359
+ }
360
+ ]);
361
+ } else {
362
+ fillInTheGapsDragAndDropPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([['Roots'], ['Stem'], ['Seed']]);
363
+ }
235
364
  fillInTheGapsDragAndDropPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
236
365
  /*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')
237
366
  fillInTheGapsDragAndDropPage.steps.checkAnswer();
@@ -1,6 +1,7 @@
1
1
  import { fillInTheGapsDragAndDropPage } from "../../../../pages";
2
2
  import abortEarlySetup from "../../../../support/helpers/abortEarly";
3
3
  import utilities from "../../../../support/helpers/utilities";
4
+ const alternativeAnswerCheck = Cypress.env('ENABLE_ALTERNATIVE_ANSWER_ENHANCEMENT') === 'true';
4
5
 
5
6
  describe('Create item page - Fill in the gaps with drag and drop: Partial different weights', () => {
6
7
  before(() => {
@@ -27,7 +28,9 @@ describe('Create item page - Fill in the gaps with drag and drop: Partial differ
27
28
  fillInTheGapsDragAndDropPage.steps.switchToGradingView();
28
29
  fillInTheGapsDragAndDropPage.steps.verifyPreviewTabPointsBackgroundForIncorrectOrPartiallyCorrectAnswer();
29
30
  fillInTheGapsDragAndDropPage.steps.verifyDropzoneNumeration();
30
- utilities.verifyInnerText(fillInTheGapsDragAndDropPage.correctAnswersLabel(), 'Correct answers');
31
+ if (!alternativeAnswerCheck) {
32
+ utilities.verifyInnerText(fillInTheGapsDragAndDropPage.correctAnswersLabel(), 'Correct answers');
33
+ }
31
34
  fillInTheGapsDragAndDropPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([['Petals'], ['Flower'], ['Leaves']]);
32
35
  });
33
36
 
@@ -1,6 +1,9 @@
1
1
  import { fillInTheGapsDragAndDropPage } from "../../../../pages";
2
2
  import abortEarlySetup from "../../../../support/helpers/abortEarly";
3
3
  import utilities from "../../../../support/helpers/utilities";
4
+ import { showAlternativeAnswersComponent } from "../../../../pages/components";
5
+
6
+ const alternativeAnswerCheck = Cypress.env('ENABLE_ALTERNATIVE_ANSWER_ENHANCEMENT') === 'true';
4
7
  const css = Cypress.env('css');
5
8
 
6
9
  describe('Create item page - Fill in the gaps with drag and drop: Partial different weights', () => {
@@ -31,8 +34,22 @@ describe('Create item page - Fill in the gaps with drag and drop: Partial differ
31
34
  it('When the user selects \'Grading\' view without attempting the question, numeration should be displayed, correct answers section with a label \'Correct answers\' should be displayed with correct answers from the correct accordion and respective numeration', () => {
32
35
  fillInTheGapsDragAndDropPage.steps.switchToGradingView();
33
36
  fillInTheGapsDragAndDropPage.steps.verifyDropzoneNumeration();
34
- utilities.verifyInnerText(fillInTheGapsDragAndDropPage.correctAnswersLabel(), 'Correct answers');
35
- fillInTheGapsDragAndDropPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([['Petals'], ['Flower'], ['Leaves']]);
37
+ if (alternativeAnswerCheck) {
38
+ showAlternativeAnswersComponent.steps.clickShowAlternativeAnswersToggle();
39
+ fillInTheGapsDragAndDropPage.steps.verifyCorrectAnswerSectionWithAlternateAnswers([
40
+ {
41
+ correctAnswers: [['Petals'], ['Flower'], ['Leaves']],
42
+ points: ['(15 points)', '(6 points)', '(5 points)', '(4 points)'],
43
+ },
44
+ {
45
+ correctAnswers: [['Petals'], ['Stem'], ['Seed']],
46
+ points: ['(15 points)', '(7 points)', '(5 points)', '(3 points)'],
47
+ }
48
+ ]);
49
+ } else {
50
+ utilities.verifyInnerText(fillInTheGapsDragAndDropPage.correctAnswersLabel(), 'Correct answers');
51
+ fillInTheGapsDragAndDropPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([['Petals'], ['Flower'], ['Leaves']]);
52
+ }
36
53
  });
37
54
 
38
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, green check-marks should be displayed beside all the correct responses, a status message and correct answer section should not be displayed', () => {
@@ -84,7 +101,21 @@ describe('Create item page - Fill in the gaps with drag and drop: Partial differ
84
101
  fillInTheGapsDragAndDropPage.steps.verifyCorrectOptionIcon(1);
85
102
  fillInTheGapsDragAndDropPage.steps.verifyCorrectOptionIcon(2);
86
103
  fillInTheGapsDragAndDropPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
87
- fillInTheGapsDragAndDropPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([['Petals'], ['Flower'], ['Leaves']]);
104
+ if (alternativeAnswerCheck) {
105
+ showAlternativeAnswersComponent.steps.clickShowAlternativeAnswersToggle();
106
+ fillInTheGapsDragAndDropPage.steps.verifyCorrectAnswerSectionWithAlternateAnswers([
107
+ {
108
+ correctAnswers: [['Petals'], ['Flower'], ['Leaves']],
109
+ points: ['(15 points)', '(6 points)', '(5 points)', '(4 points)'],
110
+ },
111
+ {
112
+ correctAnswers: [['Petals'], ['Stem'], ['Seed']],
113
+ points: ['(15 points)', '(7 points)', '(5 points)', '(3 points)'],
114
+ }
115
+ ]);
116
+ } else {
117
+ fillInTheGapsDragAndDropPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([['Petals'], ['Flower'], ['Leaves']]);
118
+ }
88
119
  fillInTheGapsDragAndDropPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
89
120
  /*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 green check-mark should be displayed besides the correct answer responses, a status message and correct answer section should not be displayed')
90
121
  fillInTheGapsDragAndDropPage.steps.checkAnswer();
@@ -104,7 +135,21 @@ describe('Create item page - Fill in the gaps with drag and drop: Partial differ
104
135
  fillInTheGapsDragAndDropPage.steps.verifyCorrectOptionIcon(1);
105
136
  fillInTheGapsDragAndDropPage.steps.verifyCorrectOptionIcon(2);
106
137
  fillInTheGapsDragAndDropPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
107
- fillInTheGapsDragAndDropPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([['Petals'], ['Flower'], ['Leaves']]);
138
+ if (alternativeAnswerCheck) {
139
+ showAlternativeAnswersComponent.steps.clickShowAlternativeAnswersToggle();
140
+ fillInTheGapsDragAndDropPage.steps.verifyCorrectAnswerSectionWithAlternateAnswers([
141
+ {
142
+ correctAnswers: [['Petals'], ['Flower'], ['Leaves']],
143
+ points: ['(15 points)', '(6 points)', '(5 points)', '(4 points)'],
144
+ },
145
+ {
146
+ correctAnswers: [['Petals'], ['Stem'], ['Seed']],
147
+ points: ['(15 points)', '(7 points)', '(5 points)', '(3 points)'],
148
+ }
149
+ ]);
150
+ } else {
151
+ fillInTheGapsDragAndDropPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([['Petals'], ['Flower'], ['Leaves']]);
152
+ }
108
153
  fillInTheGapsDragAndDropPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
109
154
  /*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 green check-mark should be displayed besides the correct answer responses, no icon should be displayed beside unattempted response a status message and correct answer section should not be displayed')
110
155
  fillInTheGapsDragAndDropPage.steps.checkAnswer();
@@ -124,7 +169,21 @@ describe('Create item page - Fill in the gaps with drag and drop: Partial differ
124
169
  fillInTheGapsDragAndDropPage.steps.verifyCorrectOptionIcon(1);
125
170
  fillInTheGapsDragAndDropPage.steps.verifyIncorrectOptionIcon(2);
126
171
  fillInTheGapsDragAndDropPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
127
- fillInTheGapsDragAndDropPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([['Petals'], ['Flower'], ['Leaves']]);
172
+ if (alternativeAnswerCheck) {
173
+ showAlternativeAnswersComponent.steps.clickShowAlternativeAnswersToggle();
174
+ fillInTheGapsDragAndDropPage.steps.verifyCorrectAnswerSectionWithAlternateAnswers([
175
+ {
176
+ correctAnswers: [['Petals'], ['Flower'], ['Leaves']],
177
+ points: ['(15 points)', '(6 points)', '(5 points)', '(4 points)'],
178
+ },
179
+ {
180
+ correctAnswers: [['Petals'], ['Stem'], ['Seed']],
181
+ points: ['(15 points)', '(7 points)', '(5 points)', '(3 points)'],
182
+ }
183
+ ]);
184
+ } else {
185
+ fillInTheGapsDragAndDropPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([['Petals'], ['Flower'], ['Leaves']]);
186
+ }
128
187
  fillInTheGapsDragAndDropPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
129
188
  /*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 green check-mark should be displayed besides the response from the correct accordion, red cross-mark should be displayed besides the responses from the alternative accordion and no icon should be displayed beside unattempted response, a status message and correct answer section should not be displayed')
130
189
  fillInTheGapsDragAndDropPage.steps.checkAnswer();
@@ -144,7 +203,21 @@ describe('Create item page - Fill in the gaps with drag and drop: Partial differ
144
203
  fillInTheGapsDragAndDropPage.steps.verifyCorrectOptionIcon(1);
145
204
  fillInTheGapsDragAndDropPage.steps.verifyIncorrectOptionIcon(2);
146
205
  fillInTheGapsDragAndDropPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
147
- fillInTheGapsDragAndDropPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([['Petals'], ['Flower'], ['Leaves']]);
206
+ if (alternativeAnswerCheck) {
207
+ showAlternativeAnswersComponent.steps.clickShowAlternativeAnswersToggle();
208
+ fillInTheGapsDragAndDropPage.steps.verifyCorrectAnswerSectionWithAlternateAnswers([
209
+ {
210
+ correctAnswers: [['Petals'], ['Flower'], ['Leaves']],
211
+ points: ['(15 points)', '(6 points)', '(5 points)', '(4 points)'],
212
+ },
213
+ {
214
+ correctAnswers: [['Petals'], ['Stem'], ['Seed']],
215
+ points: ['(15 points)', '(7 points)', '(5 points)', '(3 points)'],
216
+ }
217
+ ]);
218
+ } else {
219
+ fillInTheGapsDragAndDropPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([['Petals'], ['Flower'], ['Leaves']]);
220
+ }
148
221
  fillInTheGapsDragAndDropPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
149
222
  /*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 green check-mark should be displayed besides the correct answer responses, red cross-mark should be displayed beside empty responses a status message and correct answer section should not be displayed')
150
223
  fillInTheGapsDragAndDropPage.steps.checkAnswer();
@@ -164,7 +237,21 @@ describe('Create item page - Fill in the gaps with drag and drop: Partial differ
164
237
  fillInTheGapsDragAndDropPage.steps.verifyCorrectOptionIcon(1);
165
238
  fillInTheGapsDragAndDropPage.steps.verifyIncorrectOptionIcon(2);
166
239
  fillInTheGapsDragAndDropPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
167
- fillInTheGapsDragAndDropPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([['Petals'], ['Flower'], ['Leaves']]);
240
+ if (alternativeAnswerCheck) {
241
+ showAlternativeAnswersComponent.steps.clickShowAlternativeAnswersToggle();
242
+ fillInTheGapsDragAndDropPage.steps.verifyCorrectAnswerSectionWithAlternateAnswers([
243
+ {
244
+ correctAnswers: [['Petals'], ['Flower'], ['Leaves']],
245
+ points: ['(15 points)', '(6 points)', '(5 points)', '(4 points)'],
246
+ },
247
+ {
248
+ correctAnswers: [['Petals'], ['Stem'], ['Seed']],
249
+ points: ['(15 points)', '(7 points)', '(5 points)', '(3 points)'],
250
+ }
251
+ ]);
252
+ } else {
253
+ fillInTheGapsDragAndDropPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([['Petals'], ['Flower'], ['Leaves']]);
254
+ }
168
255
  fillInTheGapsDragAndDropPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
169
256
  /*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 green check-mark should be displayed besides the alternative responses, red cross-mark should be displayed beside correct accordion responses a status message and correct answer section should not be displayed')
170
257
  fillInTheGapsDragAndDropPage.steps.checkAnswer();
@@ -184,7 +271,21 @@ describe('Create item page - Fill in the gaps with drag and drop: Partial differ
184
271
  fillInTheGapsDragAndDropPage.steps.verifyIncorrectOptionIcon(1);
185
272
  fillInTheGapsDragAndDropPage.steps.verifyIncorrectOptionIcon(2);
186
273
  fillInTheGapsDragAndDropPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
187
- fillInTheGapsDragAndDropPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([['Petals'], ['Flower'], ['Leaves']]);
274
+ if (alternativeAnswerCheck) {
275
+ showAlternativeAnswersComponent.steps.clickShowAlternativeAnswersToggle();
276
+ fillInTheGapsDragAndDropPage.steps.verifyCorrectAnswerSectionWithAlternateAnswers([
277
+ {
278
+ correctAnswers: [['Petals'], ['Flower'], ['Leaves']],
279
+ points: ['(15 points)', '(6 points)', '(5 points)', '(4 points)'],
280
+ },
281
+ {
282
+ correctAnswers: [['Petals'], ['Stem'], ['Seed']],
283
+ points: ['(15 points)', '(7 points)', '(5 points)', '(3 points)'],
284
+ }
285
+ ]);
286
+ } else {
287
+ fillInTheGapsDragAndDropPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([['Petals'], ['Flower'], ['Leaves']]);
288
+ }
188
289
  fillInTheGapsDragAndDropPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
189
290
  /*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 green check-mark should be displayed besides the correct answer responses, no icon should be displayed beside unattempted response a status message and correct answer section should not be displayed')
190
291
  fillInTheGapsDragAndDropPage.steps.checkAnswer();
@@ -204,7 +305,21 @@ describe('Create item page - Fill in the gaps with drag and drop: Partial differ
204
305
  fillInTheGapsDragAndDropPage.steps.verifyIncorrectOptionIcon(1);
205
306
  fillInTheGapsDragAndDropPage.steps.verifyIncorrectOptionIcon(2);
206
307
  fillInTheGapsDragAndDropPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
207
- fillInTheGapsDragAndDropPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([['Petals'], ['Flower'], ['Leaves']]);
308
+ if (alternativeAnswerCheck) {
309
+ showAlternativeAnswersComponent.steps.clickShowAlternativeAnswersToggle();
310
+ fillInTheGapsDragAndDropPage.steps.verifyCorrectAnswerSectionWithAlternateAnswers([
311
+ {
312
+ correctAnswers: [['Petals'], ['Flower'], ['Leaves']],
313
+ points: ['(15 points)', '(6 points)', '(5 points)', '(4 points)'],
314
+ },
315
+ {
316
+ correctAnswers: [['Petals'], ['Stem'], ['Seed']],
317
+ points: ['(15 points)', '(7 points)', '(5 points)', '(3 points)'],
318
+ }
319
+ ]);
320
+ } else {
321
+ fillInTheGapsDragAndDropPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([['Petals'], ['Flower'], ['Leaves']]);
322
+ }
208
323
  fillInTheGapsDragAndDropPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
209
324
  /*cy.log('When the user has attempted the question incorrectly and clicks on \'Check answer\' button, then red cross-marks should be displayed besides all incorrect responses, no icon should be displayed beside unattempted response a status message and correct answer section should not be displayed')
210
325
  fillInTheGapsDragAndDropPage.steps.checkAnswer();