itemengine-cypress-automation 1.0.564-IEI-7011-3998a1c.0 → 1.0.564-IEI-7011-195aab1.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.
@@ -3,7 +3,6 @@ import abortEarlySetup from "../../../support/helpers/abortEarly";
3
3
  import utilities from "../../../support/helpers/utilities";
4
4
  const options = ['Pollution caused by treating chemical waste', 'Pollution caused by cement production', 'Pollution caused by methane production', 'Pollution caused by cement and methane production'];
5
5
  const grepTags = Cypress.env('grepTags');
6
- const alternativeAnswerCheck = Cypress.env('ENABLE_ALTERNATIVE_ANSWER_ENHANCEMENT');
7
6
  let correctAnswerViews = ['Question preview', 'Item preview', 'Grading view'];
8
7
  let questionMethodsViews = ['Question preview', 'Grading view'];
9
8
  const views = utilities.getViews(correctAnswerViews);
@@ -3,7 +3,6 @@ import abortEarlySetup from "../../../support/helpers/abortEarly";
3
3
  import { dialogBoxBase, gradingViewPage, itemPreviewPage, studentViewPage } from "../../../pages";
4
4
  import utilities from "../../../support/helpers/utilities";
5
5
  const grepTags = Cypress.env('grepTags');
6
- const alternativeAnswerCheck = Cypress.env('ENABLE_ALTERNATIVE_ANSWER_ENHANCEMENT');
7
6
  let correctAnswerViews = ['Question preview', 'Item preview', 'Grading view'];
8
7
  const views = utilities.getViews(correctAnswerViews);
9
8
  var itemReferenceID = "";
@@ -169,135 +168,6 @@ describe('Create Item page - Single Selection: Scoring cases', () => {
169
168
  });
170
169
  });
171
170
 
172
- views.forEach((view) => {
173
- describe(`Single selection: all or nothing with alternative answer - ${view}`, { tags: 'smoke' }, () => {
174
- abortEarlySetup();
175
- before(() => {
176
- switch (view) {
177
- case 'Question preview':
178
- singleSelectionPage.steps.navigateToCreateQuestion('single selection');
179
- cy.barsPreLoaderWait();
180
- singleSelectionPage.steps.addTextInQuestionInstructionsInputField('Which of the following is the major contributor to increased carbon dioxide levels because of urbanization? Select your answer from the options below.');
181
- singleSelectionPage.steps.allotPoints(20);
182
- singleSelectionPage.steps.addInputToOptionsInputField(options);
183
- singleSelectionPage.steps.checkOptionInSpecifyCorrectAnswerSection(1);
184
- singleSelectionPage.steps.clickOnAddAlternativeAnswerButton();
185
- singleSelectionPage.steps.allotPoints(10);
186
- singleSelectionPage.steps.checkOptionInSpecifyCorrectAnswerSection(0);
187
- singleSelectionPage.steps.switchToPreviewTab();
188
- break;
189
- case 'Item preview':
190
- cy.visit(`/item-engine/demo/edit-item/${utilities.base64Encoding(itemReferenceID)}`);
191
- itemPreviewPage.steps.switchToPreviewTab();
192
- break;
193
- case 'Grading view':
194
- cy.visit(`/item-engine/demo/render-item/student-view/${utilities.base64Encoding(itemReferenceID)}`);
195
- break;
196
- }
197
- });
198
-
199
- beforeEach(() => {
200
- switch (view) {
201
- case 'Question preview':
202
- singleSelectionPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
203
- singleSelectionPage.steps.verifyCorrectIncorrectBorderNotExists();
204
- singleSelectionPage.steps.resetQuestionPreview();
205
- break;
206
- case 'Item preview':
207
- itemPreviewPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
208
- singleSelectionPage.steps.verifyCorrectIncorrectBorderNotExists();
209
- itemPreviewPage.steps.resetQuestionPreview();
210
- break;
211
- case 'Grading view':
212
- cy.visit(`/item-engine/demo/render-item/student-view/${utilities.base64Encoding(itemReferenceID)}`);
213
- break;
214
- }
215
- });
216
-
217
- if (view === 'Question preview') {
218
- after(() => {
219
- singleSelectionPage.steps.clickOnSaveQuestionButton();
220
- utilities.verifyElementVisibilityState(itemPreviewPage.referenceID(), 'visible');
221
- itemReferenceID = itemPreviewPage.steps.getItemReferenceID();
222
- });
223
- };
224
-
225
- it('When the user selects \'Grading\' view without attempting the question, no icons should be displayed besides responses, correct answer label and border should not be displayed and correct answer should be displayed in correct answer section', () => {
226
- if (view === 'Grading view') {
227
- studentViewPage.steps.submitResponse();
228
- utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'visible');
229
- studentViewPage.steps.clickOnGoToGradingViewButton();
230
- gradingViewPage.steps.verifyGradingViewScore(0, 20);
231
- }
232
- if (view === 'Question preview' || view === 'Item preview') {
233
- singleSelectionPage.steps.switchToGradingView();
234
- singleSelectionPage.steps.verifyPreviewScore(0, 20);
235
- }
236
- singleSelectionPage.steps.verifyCorrectIncorrectIconNotVisibleStudentView(0);
237
- singleSelectionPage.steps.verifyCorrectIncorrectIconNotVisibleStudentView(1);
238
- singleSelectionPage.steps.verifyCorrectIncorrectIconNotVisibleStudentView(2);
239
- singleSelectionPage.steps.verifyCorrectIncorrectIconNotVisibleStudentView(3);
240
- singleSelectionPage.steps.verifyCorrectIncorrectAnswerLabelNotExist();
241
- singleSelectionPage.steps.verifyCorrectIncorrectBorderNotExists();
242
- //correct answer section
243
- singleSelectionPage.steps.verifyCorrectOptionIconCorrectAnswerSection(1);
244
- if (alternativeAnswerCheck === 'true') {
245
- singleSelectionPage.steps.verifyShowAlternativeAnswersToggleFunctionality(1, 10);
246
- }
247
- });
248
-
249
- it('When the user attempts the question incorrectly, then the user should be awarded 0 points and on switching to \'Grading\' view, incorrect icons should be displayed besides incorrect responses, no icons should be displayed besides unattempted responses, incorrect answer border and label should not be displayed below the question preview and correct answer should be displayed in correct answer section', () => {
250
- singleSelectionPage.steps.checkOptionInPreviewTab(2);
251
- if (view === 'Grading view') {
252
- studentViewPage.steps.submitResponse();
253
- utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'visible');
254
- studentViewPage.steps.clickOnGoToGradingViewButton();
255
- gradingViewPage.steps.verifyGradingViewScore(0, 20);
256
- }
257
- if (view === 'Question preview' || view === 'Item preview') {
258
- singleSelectionPage.steps.switchToGradingView();
259
- singleSelectionPage.steps.verifyPreviewScore(0, 20);
260
- }
261
- singleSelectionPage.steps.verifyIncorrectOptionIconStudentView(2);
262
- singleSelectionPage.steps.verifyCorrectIncorrectIconNotVisibleStudentView(0);
263
- singleSelectionPage.steps.verifyCorrectIncorrectIconNotVisibleStudentView(1);
264
- singleSelectionPage.steps.verifyCorrectIncorrectIconNotVisibleStudentView(3);
265
- singleSelectionPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
266
- singleSelectionPage.steps.verifyCorrectIncorrectBorderNotExists();
267
- //correct answer section
268
- singleSelectionPage.steps.verifyCorrectOptionIconCorrectAnswerSection(1);
269
- if (alternativeAnswerCheck === 'true') {
270
- singleSelectionPage.steps.verifyShowAlternativeAnswersToggleFunctionality(1, 10);
271
- }
272
- });
273
-
274
- it(`Single selection ${view} - When user attempts the question correctly, the user should be awarded full points and on switching to 'Grading' view, then correct icons should be displayed beside all the correct responses, correct answer border and a label should not be displayed below the question preview and correct answer section should not be displayed`, () => {
275
- singleSelectionPage.steps.checkOptionInPreviewTab(1);
276
- if (view === 'Grading view') {
277
- studentViewPage.steps.submitResponse();
278
- utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'visible');
279
- studentViewPage.steps.clickOnGoToGradingViewButton();
280
- gradingViewPage.steps.verifyGradingViewScore(20, 20);
281
- }
282
- if (view === 'Question preview' || view === 'Item preview') {
283
- singleSelectionPage.steps.verifyPreviewScore(20, 20);
284
- singleSelectionPage.steps.switchToGradingView();
285
- }
286
- singleSelectionPage.steps.verifyCorrectOptionIconStudentView(1);
287
- singleSelectionPage.steps.verifyCorrectIncorrectIconNotVisibleStudentView(0);
288
- singleSelectionPage.steps.verifyCorrectIncorrectIconNotVisibleStudentView(2);
289
- singleSelectionPage.steps.verifyCorrectIncorrectIconNotVisibleStudentView(3);
290
- singleSelectionPage.steps.verifyCorrectIncorrectAnswerLabel('correct');
291
- singleSelectionPage.steps.verifyCorrectIncorrectBorderNotExists();
292
- singleSelectionPage.steps.verifyCorrectAnswerSectionNotExist();
293
- if (alternativeAnswerCheck === 'true') {
294
- singleSelectionPage.steps.verifyShowAlternativeAnswersToggleNotExists();
295
- }
296
- cy.eyesCheckWindow(`Single selection ${view} - Correct attempt`);
297
- });
298
- });
299
- });
300
-
301
171
  views.forEach((view) => {
302
172
  describe(`Single selection - Manually scored: ${view}`, { tags: 'smoke' }, () => {
303
173
  abortEarlySetup();
@@ -36,6 +36,20 @@ describe('Create item page - Single selection: All or nothing with alternative a
36
36
  singleSelectionPage.steps.verifyCorrectIncorrectBorderNotExists();
37
37
  //correct answer section
38
38
  singleSelectionPage.steps.verifyCorrectOptionIconCorrectAnswerSection(1);
39
+ //show alternative answers
40
+ if (alternativeAnswerCheck === 'true') {
41
+ singleSelectionPage.steps.verifyCorrectAnswersLabelAndPointVisible('(20 points)');
42
+ singleSelectionPage.steps.verifyShowAlternativeAnswersToggleExists();
43
+ singleSelectionPage.steps.disableShowAlternativeAnswersToggle();
44
+ singleSelectionPage.steps.verifyShowAlternativeAnswersToggleUnchecked();
45
+ singleSelectionPage.steps.verifyAlternativeAnswersSectionNotExist();
46
+ singleSelectionPage.steps.clickShowAlternativeAnswersToggle();
47
+ singleSelectionPage.steps.verifyShowAlternativeAnswersToggleChecked();
48
+ singleSelectionPage.steps.verifyAlternativeAnswersLabelAndPointVisible(1, '(10 points)');
49
+ singleSelectionPage.steps.verifyAlternateAnswerOptionIconCorrectAnswerSection(2);
50
+ singleSelectionPage.steps.clickShowAlternativeAnswersToggle();
51
+ singleSelectionPage.steps.verifyShowAlternativeAnswersToggleUnchecked();
52
+ }
39
53
  singleSelectionPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
40
54
  });
41
55
 
@@ -78,6 +92,9 @@ describe('Create item page - Single selection: All or nothing with alternative a
78
92
  singleSelectionPage.steps.verifyCorrectIncorrectAnswerLabel('correct');
79
93
  singleSelectionPage.steps.verifyCorrectIncorrectBorderNotExists();
80
94
  singleSelectionPage.steps.verifyCorrectAnswerSectionNotExist();
95
+ if (alternativeAnswerCheck === 'true') {
96
+ singleSelectionPage.steps.verifyShowAlternativeAnswersToggleNotExists();
97
+ }
81
98
  singleSelectionPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
82
99
  /*cy.log('When the user has attempted the question with responses from the alternative accordion and clicks on \'Check answer\' button, then correct icons should only be displayed besides correct responses from the alternative accordion, correct answer border and a label should not be displayed below the question preview')
83
100
  singleSelectionPage.steps.checkAnswer();
@@ -100,12 +117,22 @@ describe('Create item page - Single selection: All or nothing with alternative a
100
117
  singleSelectionPage.steps.verifyIncorrectOptionIconStudentView(3);
101
118
  singleSelectionPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
102
119
  singleSelectionPage.steps.verifyCorrectIncorrectBorderNotExists();
120
+ //correct answer section
121
+ singleSelectionPage.steps.verifyCorrectOptionIconCorrectAnswerSection(1);
103
122
  //show alternative answers
104
123
  if (alternativeAnswerCheck === 'true') {
105
- singleSelectionPage.steps.verifyShowAlternativeAnswersToggleFunctionality(1, 10);
124
+ singleSelectionPage.steps.verifyCorrectAnswersLabelAndPointVisible('(20 points)');
125
+ singleSelectionPage.steps.verifyShowAlternativeAnswersToggleExists();
126
+ singleSelectionPage.steps.disableShowAlternativeAnswersToggle();
127
+ singleSelectionPage.steps.verifyShowAlternativeAnswersToggleUnchecked();
128
+ singleSelectionPage.steps.verifyAlternativeAnswersSectionNotExist();
129
+ singleSelectionPage.steps.clickShowAlternativeAnswersToggle();
130
+ singleSelectionPage.steps.verifyShowAlternativeAnswersToggleChecked();
131
+ singleSelectionPage.steps.verifyAlternativeAnswersLabelAndPointVisible(1, '(10 points)');
132
+ singleSelectionPage.steps.verifyAlternateAnswerOptionIconCorrectAnswerSection(2);
133
+ singleSelectionPage.steps.clickShowAlternativeAnswersToggle();
134
+ singleSelectionPage.steps.verifyShowAlternativeAnswersToggleUnchecked();
106
135
  }
107
- //correct answer section
108
- singleSelectionPage.steps.verifyCorrectOptionIconCorrectAnswerSection(1);
109
136
  //singleSelectionPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
110
137
  /*cy.log('When the user has attempted the question incorrectly and clicks on \'Check answer\' button, then incorrect icons should only be displayed besides incorrect responses, correct icons should not be displayed besides unattempted correct options, incorrect answer border and a label should not be displayed below the question preview')
111
138
  singleSelectionPage.steps.checkAnswer();
@@ -164,6 +191,20 @@ describe('Create item page - Single selection: All or nothing with alternative a
164
191
  singleSelectionPage.steps.verifyCorrectIncorrectBorderNotExists();
165
192
  //correct answer section
166
193
  singleSelectionPage.steps.verifyCorrectOptionIconCorrectAnswerSection(2);
194
+ // alternative answer section
195
+ if (alternativeAnswerCheck === 'true') {
196
+ singleSelectionPage.steps.verifyCorrectAnswersLabelAndPointVisible('(20 points)');
197
+ singleSelectionPage.steps.verifyShowAlternativeAnswersToggleExists();
198
+ singleSelectionPage.steps.disableShowAlternativeAnswersToggle();
199
+ singleSelectionPage.steps.verifyShowAlternativeAnswersToggleUnchecked();
200
+ singleSelectionPage.steps.verifyAlternativeAnswersSectionNotExist();
201
+ singleSelectionPage.steps.clickShowAlternativeAnswersToggle();
202
+ singleSelectionPage.steps.verifyShowAlternativeAnswersToggleChecked();
203
+ singleSelectionPage.steps.verifyAlternativeAnswersLabelAndPointVisible(1, '(10 points)');
204
+ singleSelectionPage.steps.verifyAlternateAnswerOptionIconCorrectAnswerSection(1);
205
+ singleSelectionPage.steps.clickShowAlternativeAnswersToggle();
206
+ singleSelectionPage.steps.verifyShowAlternativeAnswersToggleUnchecked();
207
+ }
167
208
  singleSelectionPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
168
209
  });
169
210
 
@@ -178,6 +219,9 @@ describe('Create item page - Single selection: All or nothing with alternative a
178
219
  singleSelectionPage.steps.verifyCorrectIncorrectAnswerLabel('correct');
179
220
  singleSelectionPage.steps.verifyCorrectIncorrectBorderNotExists();
180
221
  singleSelectionPage.steps.verifyCorrectAnswerSectionNotExist();
222
+ if (alternativeAnswerCheck === 'true') {
223
+ singleSelectionPage.steps.verifyShowAlternativeAnswersToggleNotExists();
224
+ }
181
225
  singleSelectionPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
182
226
  /*cy.log('When the user has attempted the question with responses from the correct accordion and clicks on \'Check answer\' button, then correct icons should be displayed besides correct responses, correct answer border and a label should not be displayed below the question preview')
183
227
  singleSelectionPage.steps.checkAnswer();
@@ -201,6 +245,9 @@ describe('Create item page - Single selection: All or nothing with alternative a
201
245
  singleSelectionPage.steps.verifyCorrectIncorrectAnswerLabel('correct');
202
246
  singleSelectionPage.steps.verifyCorrectIncorrectBorderNotExists();
203
247
  singleSelectionPage.steps.verifyCorrectAnswerSectionNotExist();
248
+ if (alternativeAnswerCheck === 'true') {
249
+ singleSelectionPage.steps.verifyShowAlternativeAnswersToggleNotExists();
250
+ }
204
251
  singleSelectionPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
205
252
  /*cy.log('When the user has attempted the question with responses from the alternative accordion and clicks on \'Check answer\' button, then correct icons should only be displayed besides correct responses from the alternative accordion, correct answer border and a label should not be displayed below the question preview')
206
253
  singleSelectionPage.steps.checkAnswer();
@@ -223,12 +270,22 @@ describe('Create item page - Single selection: All or nothing with alternative a
223
270
  singleSelectionPage.steps.verifyCorrectIncorrectIconNotVisibleStudentView(3);
224
271
  singleSelectionPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
225
272
  singleSelectionPage.steps.verifyCorrectIncorrectBorderNotExists();
226
- //show alternative answers
227
- if (alternativeAnswerCheck === 'true') {
228
- singleSelectionPage.steps.verifyShowAlternativeAnswersToggleFunctionality(1, 10);
229
- }
230
273
  //correct answer section
231
274
  singleSelectionPage.steps.verifyCorrectOptionIconCorrectAnswerSection(2);
275
+ // alternative answer section
276
+ if (alternativeAnswerCheck === 'true') {
277
+ singleSelectionPage.steps.verifyCorrectAnswersLabelAndPointVisible('(20 points)');
278
+ singleSelectionPage.steps.verifyShowAlternativeAnswersToggleExists();
279
+ singleSelectionPage.steps.disableShowAlternativeAnswersToggle();
280
+ singleSelectionPage.steps.verifyShowAlternativeAnswersToggleUnchecked();
281
+ singleSelectionPage.steps.verifyAlternativeAnswersSectionNotExist();
282
+ singleSelectionPage.steps.clickShowAlternativeAnswersToggle();
283
+ singleSelectionPage.steps.verifyShowAlternativeAnswersToggleChecked();
284
+ singleSelectionPage.steps.verifyAlternativeAnswersLabelAndPointVisible(1, '(10 points)');
285
+ singleSelectionPage.steps.verifyAlternateAnswerOptionIconCorrectAnswerSection(1);
286
+ singleSelectionPage.steps.clickShowAlternativeAnswersToggle();
287
+ singleSelectionPage.steps.verifyShowAlternativeAnswersToggleUnchecked();
288
+ }
232
289
  singleSelectionPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
233
290
  /*cy.log('When the user has attempted the question incorrectly and clicks on \'Check answer\' button, then incorrect icons should be displayed besides incorrect responses, correct icons should not be displayed besides unattempted correct options, incorrect answer border and a label should not be displayed below the question preview')
234
291
  singleSelectionPage.steps.checkAnswer();
@@ -267,6 +324,20 @@ describe('Create item page - Single selection: All or nothing with alternative a
267
324
  singleSelectionPage.steps.verifyCorrectIncorrectBorderNotExists();
268
325
  //correct answer section
269
326
  singleSelectionPage.steps.verifyCorrectOptionIconCorrectAnswerSection(1);
327
+ // alternative answer section
328
+ if (alternativeAnswerCheck === 'true') {
329
+ singleSelectionPage.steps.verifyCorrectAnswersLabelAndPointVisible('(20 points)');
330
+ singleSelectionPage.steps.verifyShowAlternativeAnswersToggleExists();
331
+ singleSelectionPage.steps.disableShowAlternativeAnswersToggle();
332
+ singleSelectionPage.steps.verifyShowAlternativeAnswersToggleUnchecked();
333
+ singleSelectionPage.steps.verifyAlternativeAnswersSectionNotExist();
334
+ singleSelectionPage.steps.clickShowAlternativeAnswersToggle();
335
+ singleSelectionPage.steps.verifyShowAlternativeAnswersToggleChecked();
336
+ singleSelectionPage.steps.verifyAlternativeAnswersLabelAndPointVisible(1, '(20 points)');
337
+ singleSelectionPage.steps.verifyAlternateAnswerOptionIconCorrectAnswerSection(2);
338
+ singleSelectionPage.steps.clickShowAlternativeAnswersToggle();
339
+ singleSelectionPage.steps.verifyShowAlternativeAnswersToggleUnchecked();
340
+ }
270
341
  singleSelectionPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
271
342
  });
272
343
 
@@ -281,6 +352,9 @@ describe('Create item page - Single selection: All or nothing with alternative a
281
352
  singleSelectionPage.steps.verifyCorrectIncorrectAnswerLabel('correct');
282
353
  singleSelectionPage.steps.verifyCorrectIncorrectBorderNotExists();
283
354
  singleSelectionPage.steps.verifyCorrectAnswerSectionNotExist();
355
+ if (alternativeAnswerCheck === 'true') {
356
+ singleSelectionPage.steps.verifyShowAlternativeAnswersToggleNotExists();
357
+ }
284
358
  singleSelectionPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
285
359
  /*cy.log('When the user has attempted the question with responses from the correct accordion and clicks on \'Check answer\' button, then correct icons should be displayed besides correct responses, correct answer border and a label should not be displayed below the question preview')
286
360
  singleSelectionPage.steps.checkAnswer();
@@ -304,6 +378,9 @@ describe('Create item page - Single selection: All or nothing with alternative a
304
378
  singleSelectionPage.steps.verifyCorrectIncorrectAnswerLabel('correct');
305
379
  singleSelectionPage.steps.verifyCorrectIncorrectBorderNotExists();
306
380
  singleSelectionPage.steps.verifyCorrectAnswerSectionNotExist();
381
+ if (alternativeAnswerCheck === 'true') {
382
+ singleSelectionPage.steps.verifyShowAlternativeAnswersToggleNotExists();
383
+ }
307
384
  singleSelectionPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
308
385
  /*cy.log('When the user has attempted the question with responses from the alternative accordion and clicks on \'Check answer\' button, then correct icons should only be displayed besides correct responses from the alternative accordion, correct answer border and a label should not be displayed below the question preview')
309
386
  singleSelectionPage.steps.checkAnswer();
@@ -326,12 +403,22 @@ describe('Create item page - Single selection: All or nothing with alternative a
326
403
  singleSelectionPage.steps.verifyCorrectIncorrectIconNotVisibleStudentView(3);
327
404
  singleSelectionPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
328
405
  singleSelectionPage.steps.verifyCorrectIncorrectBorderNotExists();
406
+ //correct answer section
407
+ singleSelectionPage.steps.verifyCorrectOptionIconCorrectAnswerSection(1);
329
408
  //show alternative answers
330
409
  if (alternativeAnswerCheck === 'true') {
331
- singleSelectionPage.steps.verifyShowAlternativeAnswersToggleFunctionality(1, 20);
410
+ singleSelectionPage.steps.verifyCorrectAnswersLabelAndPointVisible('(20 points)');
411
+ singleSelectionPage.steps.verifyShowAlternativeAnswersToggleExists();
412
+ singleSelectionPage.steps.disableShowAlternativeAnswersToggle();
413
+ singleSelectionPage.steps.verifyShowAlternativeAnswersToggleUnchecked();
414
+ singleSelectionPage.steps.verifyAlternativeAnswersSectionNotExist();
415
+ singleSelectionPage.steps.clickShowAlternativeAnswersToggle();
416
+ singleSelectionPage.steps.verifyShowAlternativeAnswersToggleChecked();
417
+ singleSelectionPage.steps.verifyAlternativeAnswersLabelAndPointVisible(1, '(20 points)');
418
+ singleSelectionPage.steps.verifyAlternateAnswerOptionIconCorrectAnswerSection(2);
419
+ singleSelectionPage.steps.clickShowAlternativeAnswersToggle();
420
+ singleSelectionPage.steps.verifyShowAlternativeAnswersToggleUnchecked();
332
421
  }
333
- //correct answer section
334
- singleSelectionPage.steps.verifyCorrectOptionIconCorrectAnswerSection(1);
335
422
  singleSelectionPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
336
423
  /*cy.log('When the user has attempted the question incorrectly and clicks on \'Check answer\' button, then incorrect icons should only be displayed besides incorrect responses, correct icons should not be displayed besides unattempted correct options, incorrect answer border and a label should not be displayed below the question preview')
337
424
  singleSelectionPage.steps.checkAnswer();
@@ -43,6 +43,8 @@ const selectors = {
43
43
  correctIncorrectAnswerLabel: () => cy.get('[class*="style"][class*="__Status"]'),
44
44
  answerStatusBanner: () => cy.get('[class*="StatusContainer"]'),
45
45
  optionsInputFieldInQuestionPreviewTab: () => cy.get('.mcq-radio-control [data-testid="question-instruction-element"]'),
46
+ //alternate answer section
47
+ alternativeAnswerSectionWrapper: () => cy.get('[class*="CorrectAnswerLabelWrapper"]').eq(1).next(),
46
48
  };
47
49
 
48
50
  const steps = {
@@ -226,6 +228,21 @@ const steps = {
226
228
  });
227
229
  },
228
230
 
231
+ /**
232
+ * Verifies the presence of the correct option icon in the alternate answer section
233
+ * @param {number} optionIndex - The index of the option to verify in the alternate answer section
234
+ */
235
+ verifyAlternateAnswerOptionIconCorrectAnswerSection: (optionIndex) => {
236
+ singleSelectionPage.alternativeAnswerSectionWrapper()
237
+ .within(() => {
238
+ singleSelectionPage.optionWrapperCorrectAnswerSection()
239
+ .eq(optionIndex)
240
+ .within(() => {
241
+ utilities.verifyElementVisibilityState(autoScoredScoringPreviewTab.correctIcon(), 'visible');
242
+ });
243
+ });
244
+ },
245
+
229
246
  /**
230
247
  * Verifies that the correct and incorrect icons are not visible in the correct answer section
231
248
  * @param {number} optionIndex - The index of the option to verify in the correct answer section
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "itemengine-cypress-automation",
3
- "version": "1.0.564-IEI-7011-3998a1c.0",
3
+ "version": "1.0.564-IEI-7011-195aab1.0",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {