itemengine-cypress-automation 1.0.602-IEI-7260-20e3fb8.0 → 1.0.603-IEI-7053-9616741.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 (29) hide show
  1. package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/Scoring/allOrNothingAlternativePointsGreaterThanCorrectPoints.js +100 -0
  2. package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/Scoring/allOrNothingCorrectPointsEqualToAlternativePoints.js +100 -0
  3. package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/Scoring/allOrNothingCorrectPointsGreaterThanAlternativePoints.js +104 -2
  4. package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/Scoring/partialDifferentWeightsAlternativePointsGreaterThanCorrectPoints.js +115 -0
  5. package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/Scoring/partialDifferentWeightsWithCorrectPointsEqualToAlternativePoints.js +115 -0
  6. package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/Scoring/partialDifferentWeightsWithCorrectPointsGreaterThanAlternativePoints.js +115 -0
  7. package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/Scoring/partialEqualWeightsWithAlternativePointsGreaterThanCorrectPoints.js +102 -0
  8. package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/Scoring/partialEqualWeightsWithCorrectPointsEqualToAlternativePoints.js +88 -0
  9. package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/Scoring/partialEqualWeightsWithCorrectPointsGreaterThanAlternativePoints.js +106 -2
  10. package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/allOrNothingForAllView.smoke.js +382 -2
  11. package/cypress/e2e/ILC/TextEntryMath/Scoring/allOrNothingAlternatePointsGreaterThanCorrectPoints.js +108 -7
  12. package/cypress/e2e/ILC/TextEntryMath/Scoring/allOrNothingBasicForAddEvaluation.js +58 -5
  13. package/cypress/e2e/ILC/TextEntryMath/Scoring/allOrNothingBasicForAlternateAnswer.js +25 -2
  14. package/cypress/e2e/ILC/TextEntryMath/Scoring/allOrNothingCorrectPointsEqualToAlternatePoints.js +108 -7
  15. package/cypress/e2e/ILC/TextEntryMath/Scoring/allOrNothingCorrectPointsGreaterThanAlternatePoints.js +108 -7
  16. package/cypress/e2e/ILC/TextEntryMath/Scoring/blankResponseScoring.js +93 -10
  17. package/cypress/e2e/ILC/TextEntryMath/Scoring/partialDifferentWeightsAlternativePointsGreaterThanCorrectPoints.js +123 -8
  18. package/cypress/e2e/ILC/TextEntryMath/Scoring/partialDifferentWeightsCorrectPointsEqualToAlternativePoints.js +108 -7
  19. package/cypress/e2e/ILC/TextEntryMath/Scoring/partialDifferentWeightsCorrectPointsGreaterThanAlternativePoints.js +123 -8
  20. package/cypress/e2e/ILC/TextEntryMath/Scoring/partialDifferentWeightsScoringBasic.js +47 -4
  21. package/cypress/e2e/ILC/TextEntryMath/Scoring/partialEqualWeightsAlternativePointsGreaterThanCorrectPoints.js +123 -8
  22. package/cypress/e2e/ILC/TextEntryMath/Scoring/partialEqualWeightsCorrectPointsEqualToAlternativePoints.js +108 -7
  23. package/cypress/e2e/ILC/TextEntryMath/Scoring/partialEqualWeightsCorrectPointsGreaterThanAlternativePoints.js +123 -8
  24. package/cypress/e2e/ILC/TextEntryMath/allOrNothingBasicForAllViews.smoke.js +234 -0
  25. package/cypress/e2e/ILC/TextEntryMathWithImage/allOrNothingScoringForAllViews.smoke.js +235 -0
  26. package/cypress/pages/fillInTheGapsOverImageDropdownPage.js +24 -1
  27. package/cypress/pages/matchingPage.js +2 -2
  28. package/cypress/pages/textEntryMathPage.js +41 -3
  29. package/package.json +1 -1
@@ -2,6 +2,9 @@ import { textEntryMathWithImagePage, gradingViewPage, itemPreviewPage, studentVi
2
2
  import { equationEditorFlyout } from "../../../pages/components";
3
3
  import abortEarlySetup from "../../../support/helpers/abortEarly";
4
4
  import utilities from "../../../support/helpers/utilities";
5
+ import { showAlternativeAnswersComponent } from "../../../pages/components";
6
+
7
+ const alternativeAnswerCheck = Cypress.env('ENABLE_ALTERNATIVE_ANSWER_ENHANCEMENT') === 'true';
5
8
  const grepTags = Cypress.env('grepTags');
6
9
  let correctAnswerViews = ['Question preview', 'Item preview', 'Grading view'];
7
10
  const views = utilities.getViews(correctAnswerViews);
@@ -263,6 +266,238 @@ describe('Create Item page - Text entry math: All or nothing ', () => {
263
266
  });
264
267
  });
265
268
 
269
+ if (alternativeAnswerCheck) {
270
+ views.forEach((view) => {
271
+ describe(`Text entry math: all or nothing scoring with alternative answers - ${view}`, { tags: 'smoke' }, () => {
272
+ abortEarlySetup();
273
+ before(() => {
274
+ switch (view) {
275
+ case 'Question preview':
276
+ textEntryMathWithImagePage.steps.navigateToCreateQuestion('Text Entry Math');
277
+ cy.wait(5000);//waiting for question instructions to load
278
+ cy.barsPreLoaderWait();
279
+ textEntryMathWithImagePage.steps.addBackground();
280
+ textEntryMathWithImagePage.steps.allotPoints(20);
281
+ textEntryMathWithImagePage.steps.addTextInQuestionInstructionsInputField('Enter the correct answer in the response field');
282
+ textEntryMathWithImagePage.steps.uploadFile('highlightImage.jpg');
283
+ textEntryMathWithImagePage.steps.verifyImageIsUploaded();
284
+ textEntryMathWithImagePage.steps.insertResponseArea(10);
285
+ textEntryMathWithImagePage.steps.insertResponseArea(40);
286
+ textEntryMathWithImagePage.steps.insertResponseArea(50);
287
+ textEntryMathWithImagePage.steps.expandResponseAccordionSpecifyCorrectAnswer(0);
288
+ textEntryMathWithImagePage.steps.focusInResponseAnswerInputFieldSpecifyCorrectAnswerSection(0);
289
+ equationEditorFlyout.steps.clearAll();
290
+ equationEditorFlyout.steps.enterTextInPreviewInputField('Correct');
291
+ equationEditorFlyout.steps.clickOnOkButton();
292
+ textEntryMathWithImagePage.steps.expandResponseAccordionSpecifyCorrectAnswer(1);
293
+ textEntryMathWithImagePage.steps.focusInResponseAnswerInputFieldSpecifyCorrectAnswerSection(1);
294
+ equationEditorFlyout.steps.enterQuadraticEquation();
295
+ textEntryMathWithImagePage.steps.expandResponseAccordionSpecifyCorrectAnswer(2);
296
+ textEntryMathWithImagePage.steps.focusInResponseAnswerInputFieldSpecifyCorrectAnswerSection(2);
297
+ equationEditorFlyout.steps.enterTextInPreviewInputField('9000%');
298
+ equationEditorFlyout.steps.clickOnOkButton();
299
+ textEntryMathWithImagePage.steps.allotPoints(20);
300
+ textEntryMathWithImagePage.steps.addAlternativeAnswerAccordion(1);
301
+ textEntryMathWithImagePage.steps.expandResponseAccordionSpecifyCorrectAnswer(0);
302
+ textEntryMathWithImagePage.steps.focusInResponseAnswerInputFieldSpecifyCorrectAnswerSection(0);
303
+ equationEditorFlyout.steps.clearAll();
304
+ equationEditorFlyout.steps.enterTextInPreviewInputField('Correct');
305
+ equationEditorFlyout.steps.clickOnOkButton();
306
+ textEntryMathWithImagePage.steps.expandResponseAccordionSpecifyCorrectAnswer(1);
307
+ textEntryMathWithImagePage.steps.focusInResponseAnswerInputFieldSpecifyCorrectAnswerSection(1);
308
+ equationEditorFlyout.steps.enterEquationUsingPiSymbol();
309
+ textEntryMathWithImagePage.steps.expandResponseAccordionSpecifyCorrectAnswer(2);
310
+ textEntryMathWithImagePage.steps.focusInResponseAnswerInputFieldSpecifyCorrectAnswerSection(2);
311
+ equationEditorFlyout.steps.enterTextInPreviewInputField('7.07e');
312
+ equationEditorFlyout.steps.clickOnOkButton();
313
+ textEntryMathWithImagePage.steps.allotPoints(12);
314
+ textEntryMathWithImagePage.steps.switchToPreviewTab();
315
+ break;
316
+ case 'Item preview':
317
+ cy.visit(`/item-engine/demo/edit-item/${utilities.base64Encoding(itemReferenceID)}`);
318
+ itemPreviewPage.steps.switchToPreviewTab();
319
+ break;
320
+ case 'Grading view':
321
+ cy.visit(`/item-engine/demo/render-item/student-view/${utilities.base64Encoding(itemReferenceID)}`);
322
+ break;
323
+ }
324
+ });
325
+
326
+ beforeEach(() => {
327
+ switch (view) {
328
+ case 'Question preview':
329
+ textEntryMathWithImagePage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
330
+ textEntryMathWithImagePage.steps.resetQuestionPreview();
331
+ break;
332
+ case 'Item preview':
333
+ itemPreviewPage.steps.switchToStudentView();
334
+ itemPreviewPage.steps.resetQuestionPreview();
335
+ break;
336
+ case 'Grading view':
337
+ cy.visit(`/item-engine/demo/render-item/student-view/${utilities.base64Encoding(itemReferenceID)}`);
338
+ break;
339
+ }
340
+ });
341
+
342
+ if (view === 'Question preview') {
343
+ after(() => {
344
+ textEntryMathWithImagePage.steps.clickOnSaveQuestionButton();
345
+ utilities.verifyElementVisibilityState(itemPreviewPage.referenceID(), 'visible');
346
+ itemReferenceID = itemPreviewPage.steps.getItemReferenceID();
347
+ });
348
+ };
349
+
350
+ it('When the user selects \'Grading\' view without attempting the question, correct/incorrect icons should not be displayed correct answers section should be displayed with the correct answers, correct answer label and border should not be displayed', () => {
351
+ if (view === 'Grading view') {
352
+ studentViewPage.steps.submitResponse();
353
+ utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'visible');
354
+ studentViewPage.steps.clickOnGoToGradingViewButton();
355
+ gradingViewPage.steps.verifyGradingViewScore(0, 20);
356
+ }
357
+ if (view === 'Question preview' || view === 'Item preview') {
358
+ textEntryMathWithImagePage.steps.switchToGradingView();
359
+ textEntryMathWithImagePage.steps.verifyPreviewScore(0, 20);
360
+ }
361
+ textEntryMathWithImagePage.steps.verifyResponseFieldNumerationPreviewTab();
362
+ textEntryMathWithImagePage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSection([
363
+ {
364
+ correctAnswers: ['C⁢o⁢r⁢r⁢e⁢c⁢t', '6×π', '7.07⁢e'],
365
+ points: ['(20 points)']
366
+ },
367
+ {
368
+ correctAnswers: ['C⁢o⁢r⁢r⁢e⁢c⁢t', '2⁢x2⁢y2+4⁢x⁢y+4', '9000%'],
369
+ points: ['(12 points)']
370
+ },
371
+ ]);
372
+ textEntryMathWithImagePage.steps.verifyCorrectAnswerResponsesAriaLabel(1, '2 x squared y squared plus 4 x y plus 4');
373
+ textEntryMathWithImagePage.steps.verifyCorrectAnswerResponsesAriaLabel(2, '6 times pi');
374
+ textEntryMathWithImagePage.steps.verifyCorrectIncorrectIconNotExist(0);
375
+ textEntryMathWithImagePage.steps.verifyCorrectIncorrectIconNotExist(1);
376
+ textEntryMathWithImagePage.steps.verifyCorrectIncorrectIconNotExist(2);
377
+ textEntryMathWithImagePage.steps.verifyCorrectIncorrectAnswerLabelNotExist();
378
+ });
379
+
380
+ it('When the user attempts the question incorrectly, then the user should be awarded 0 points and on switching to \'Grading\' view, incorrect icons should be displayed besides all incorrect responses, and \'Your answer is incorrect\' label should be displayed', () => {
381
+ textEntryMathWithImagePage.steps.focusInResponseAnswerInputFieldPreviewTab(0);
382
+ textEntryMathWithImagePage.steps.enterTextInResponsePreviewInputField(0, '13');
383
+ equationEditorFlyout.steps.clickOnOkButton();
384
+ textEntryMathWithImagePage.steps.focusInResponseAnswerInputFieldPreviewTab(1);
385
+ textEntryMathWithImagePage.steps.enterTextInResponsePreviewInputField(1, '14');
386
+ equationEditorFlyout.steps.clickOnOkButton();
387
+ textEntryMathWithImagePage.steps.focusInResponseAnswerInputFieldPreviewTab(2);
388
+ textEntryMathWithImagePage.steps.enterTextInResponsePreviewInputField(2, '15');
389
+ equationEditorFlyout.steps.clickOnOkButton();
390
+ if (view === 'Grading view') {
391
+ studentViewPage.steps.submitResponse();
392
+ utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'visible');
393
+ studentViewPage.steps.clickOnGoToGradingViewButton();
394
+ gradingViewPage.steps.verifyGradingViewScore(0, 20);
395
+ }
396
+ if (view === 'Question preview' || view === 'Item preview') {
397
+ textEntryMathWithImagePage.steps.verifyPreviewScore(0, 20);
398
+ textEntryMathWithImagePage.steps.switchToGradingView();
399
+ }
400
+ textEntryMathWithImagePage.steps.verifyIncorrectResponseIcon(0);
401
+ textEntryMathWithImagePage.steps.verifyIncorrectResponseIcon(1);
402
+ textEntryMathWithImagePage.steps.verifyIncorrectResponseIcon(2);
403
+ textEntryMathWithImagePage.steps.verifyResponseFieldNumerationPreviewTab();
404
+ textEntryMathWithImagePage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSection([
405
+ {
406
+ correctAnswers: ['C⁢o⁢r⁢r⁢e⁢c⁢t', '6×π', '7.07⁢e'],
407
+ points: ['(20 points)']
408
+ },
409
+ {
410
+ correctAnswers: ['C⁢o⁢r⁢r⁢e⁢c⁢t', '2⁢x2⁢y2+4⁢x⁢y+4', '9000%'],
411
+ points: ['(12 points)']
412
+ },
413
+ ]);
414
+ textEntryMathWithImagePage.steps.verifyCorrectAnswerResponsesAriaLabel(1, '2 x squared y squared plus 4 x y plus 4');
415
+ textEntryMathWithImagePage.steps.verifyCorrectAnswerResponsesAriaLabel(2, '6 times pi');
416
+ textEntryMathWithImagePage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
417
+ });
418
+
419
+ it('When the user attempts the question partially correct, then the user should be awarded 0 points and on switching to \'Grading\' view, correct icons should be displayed besides the correct responses, incorrect icons should be displayed beside the incorrect responses, and \'Your answer is incorrect\' label should be displayed', () => {
420
+ if (view === 'Grading view') {
421
+ studentViewPage.steps.clearResponses();
422
+ }
423
+ textEntryMathWithImagePage.steps.focusInResponseAnswerInputFieldPreviewTab(0);
424
+ textEntryMathWithImagePage.steps.enterTextInResponsePreviewInputField(0, '12');
425
+ equationEditorFlyout.steps.clickOnOkButton();
426
+ textEntryMathWithImagePage.steps.focusInResponseAnswerInputFieldPreviewTab(1);
427
+ equationEditorFlyout.steps.enterQuadraticEquation();
428
+ textEntryMathWithImagePage.steps.focusInResponseAnswerInputFieldPreviewTab(2);
429
+ textEntryMathWithImagePage.steps.enterTextInResponsePreviewInputField(2, '13');
430
+ equationEditorFlyout.steps.clickOnOkButton();
431
+ if (view === 'Grading view') {
432
+ studentViewPage.steps.submitResponse();
433
+ utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'exist');
434
+ studentViewPage.steps.clickOnGoToGradingViewButton();
435
+ gradingViewPage.steps.verifyGradingViewScore(0, 20);
436
+ }
437
+ if (view === 'Question preview' || view === 'Item preview') {
438
+ textEntryMathWithImagePage.steps.verifyPreviewScore(0, 20);
439
+ textEntryMathWithImagePage.steps.switchToGradingView();
440
+ }
441
+ textEntryMathWithImagePage.steps.verifyCorrectResponseIcon(0);
442
+ textEntryMathWithImagePage.steps.verifyCorrectResponseIcon(1);
443
+ textEntryMathWithImagePage.steps.verifyIncorrectResponseIcon(2);
444
+ textEntryMathWithImagePage.steps.verifyResponseFieldNumerationPreviewTab();
445
+ textEntryMathWithImagePage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSection([
446
+ {
447
+ correctAnswers: ['C⁢o⁢r⁢r⁢e⁢c⁢t', '6×π', '7.07⁢e'],
448
+ points: ['(20 points)']
449
+ },
450
+ {
451
+ correctAnswers: ['C⁢o⁢r⁢r⁢e⁢c⁢t', '2⁢x2⁢y2+4⁢x⁢y+4', '9000%'],
452
+ points: ['(12 points)']
453
+ },
454
+ ]);
455
+ textEntryMathWithImagePage.steps.verifyCorrectAnswerResponsesAriaLabel(1, '2 x squared y squared plus 4 x y plus 4');
456
+ textEntryMathWithImagePage.steps.verifyCorrectAnswerResponsesAriaLabel(2, '6 times pi');
457
+ textEntryMathWithImagePage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
458
+ });
459
+
460
+ it('When the user attempts the question partially correct with an incomplete response, then the user should be awarded 0 points and on switching to \'Grading\' view, correct icons should be displayed besides the correct responses and unattempted correct options, no icon should be displayed beside unattempted response, \'Your answer is incorrect\' should be displayed', () => {
461
+ if (view === 'Grading view') {
462
+ studentViewPage.steps.clearResponses();
463
+ }
464
+ textEntryMathWithImagePage.steps.focusInResponseAnswerInputFieldPreviewTab(0);
465
+ textEntryMathWithImagePage.steps.enterTextInResponsePreviewInputField(0, '12');
466
+ equationEditorFlyout.steps.clickOnOkButton();
467
+ textEntryMathWithImagePage.steps.focusInResponseAnswerInputFieldPreviewTab(1);
468
+ equationEditorFlyout.steps.enterQuadraticEquation();
469
+ if (view === 'Grading view') {
470
+ studentViewPage.steps.submitResponse();
471
+ utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'exist');
472
+ studentViewPage.steps.clickOnGoToGradingViewButton();
473
+ gradingViewPage.steps.verifyGradingViewScore(0, 20);
474
+ }
475
+ if (view === 'Question preview' || view === 'Item preview') {
476
+ textEntryMathWithImagePage.steps.verifyPreviewScore(0, 20);
477
+ textEntryMathWithImagePage.steps.switchToGradingView();
478
+ }
479
+ textEntryMathWithImagePage.steps.verifyCorrectResponseIcon(0);
480
+ textEntryMathWithImagePage.steps.verifyCorrectResponseIcon(1);
481
+ textEntryMathWithImagePage.steps.verifyIncorrectResponseIcon(2);
482
+ textEntryMathWithImagePage.steps.verifyResponseFieldNumerationPreviewTab();
483
+ textEntryMathWithImagePage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSection([
484
+ {
485
+ correctAnswers: ['C⁢o⁢r⁢r⁢e⁢c⁢t', '6×π', '7.07⁢e'],
486
+ points: ['(20 points)']
487
+ },
488
+ {
489
+ correctAnswers: ['C⁢o⁢r⁢r⁢e⁢c⁢t', '2⁢x2⁢y2+4⁢x⁢y+4', '9000%'],
490
+ points: ['(12 points)']
491
+ },
492
+ ]);
493
+ textEntryMathWithImagePage.steps.verifyCorrectAnswerResponsesAriaLabel(1, '2 x squared y squared plus 4 x y plus 4');
494
+ textEntryMathWithImagePage.steps.verifyCorrectAnswerResponsesAriaLabel(2, '6 times pi');
495
+ textEntryMathWithImagePage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
496
+ });
497
+ });
498
+ });
499
+ }
500
+
266
501
  views.forEach((view) => {
267
502
  describe(`Text entry math with image: manually scored - ${view}`, { tags: 'smoke' }, () => {
268
503
  abortEarlySetup();
@@ -1,5 +1,5 @@
1
1
  import utilities from "../support/helpers/utilities";
2
- import { imageCanvasComponent, autoScoredScoringPreviewTab, createQuestionBasePage, backgroundImageUploadComponent, scoringSectionBaseEditTab, questionInstructionsComponent, correctIncorrectAnswerLabelComponent, autoScoredStudentViewSettings, autoScoredSpecifyCorrectAnswerSection, autoScoredScoringSectionMultiResponseType, fillInTheGapsDropdownCommonComponent, randomizeOptionsComponent, optionsWrapperComponent, studentViewSettingsLabelComponent, additionalSettingsPanel, placeholderTextSectionComponent, gradingViewEnumerationComponent, ariaLabelSectionComponent, commonComponents, additionalSettingsAccessibilitySectionComponent, styleAndLayoutCustomizationAccordionComponent, figCommonStyleAndLayoutComponent, connectorStyleStyleAndLayoutCustomizationComponent } from "./components";
2
+ import { imageCanvasComponent, autoScoredScoringPreviewTab, createQuestionBasePage, backgroundImageUploadComponent, scoringSectionBaseEditTab, questionInstructionsComponent, correctIncorrectAnswerLabelComponent, autoScoredStudentViewSettings, autoScoredSpecifyCorrectAnswerSection, autoScoredScoringSectionMultiResponseType, fillInTheGapsDropdownCommonComponent, randomizeOptionsComponent, optionsWrapperComponent, studentViewSettingsLabelComponent, additionalSettingsPanel, placeholderTextSectionComponent, gradingViewEnumerationComponent, ariaLabelSectionComponent, commonComponents, additionalSettingsAccessibilitySectionComponent, styleAndLayoutCustomizationAccordionComponent, figCommonStyleAndLayoutComponent, connectorStyleStyleAndLayoutCustomizationComponent, showAlternativeAnswersComponent } from "./components";
3
3
  import { createItemPage } from "./createItemPage";
4
4
  const css = Cypress.env('css');
5
5
 
@@ -21,12 +21,15 @@ const selectors = {
21
21
  ...autoScoredSpecifyCorrectAnswerSection,
22
22
  ...figCommonStyleAndLayoutComponent,
23
23
  ...connectorStyleStyleAndLayoutCustomizationComponent,
24
+ ...showAlternativeAnswersComponent,
24
25
 
25
26
  optionsInputField: () => cy.get('[class*="TextFieldWrapper"] input'),
26
27
  optionNumeration: () => cy.get('.MuiInputAdornment-positionStart'),
27
28
  pointsLabel: () => cy.get('.cloze-with-text-partial-points-per-response-label'),
28
29
  dropdownWrapperPreviewTab: () => cy.get('[class*="Canvasstyle__DropzoneWrapper"]'),
29
30
  correctAnswerResponseWrapper: () => cy.get('[class*="LabelImageWithDropdownPreviewstyles__AnswerCell"]'),
31
+ correctAnswersWrapper: () => cy.get('[class*="LabelImageWithDropdownPreviewstyles__CorrectAnswers"]'),
32
+ correctAnswersNumeration: () => cy.get('.answer-numeration-number-box'),
30
33
  correctAnswerResponse: () => cy.get('[class*="LabelImageWithDropdownPreviewstyles__AnswerWrapper"]'),
31
34
  correctAnswerSectionWrapper: () => cy.get('.dnd-correct-answer-wrapper'),
32
35
  correctAnswersLabel: () => cy.get('[class*="question-preview-wrapper"] [class*="correct-answers-label"]'),
@@ -65,6 +68,7 @@ const steps = {
65
68
  ...figCommonStyleAndLayoutComponent.steps,
66
69
  ...connectorStyleStyleAndLayoutCustomizationComponent.steps,
67
70
  ...createItemPage.steps,
71
+ ...showAlternativeAnswersComponent.steps,
68
72
  /**
69
73
  * Verify that the correct option icon is is displayed for a specific dropdown.
70
74
  * @param {number} dropdownIndex - The index of the dropdown.
@@ -208,6 +212,25 @@ const steps = {
208
212
  });
209
213
  },
210
214
 
215
+ /**
216
+ * @param {Array<{label: string, points: string, answers: string[][]}>} alternativeAnswers - Array of alternative answer objects.
217
+ * @description Verifies alternative answer sections with labels, points, enumeration, and answers.
218
+ * Example: verifyAlternativeAnswerSections([{label: 'Alternative answer 1', points: '(10 points)', answers: [['Elephant'], ['Fish'], ['Cat']]}])
219
+ */
220
+ verifyAlternativeAnswerResponsesInCorrectAnswerSectionAndCount: (alternativeAnswers = [], index) => {
221
+ fillInTheGapsOverImageDropdownPage.correctAnswersWrapper()
222
+ .eq(index)
223
+ .within(() => {
224
+ utilities.verifyElementCount(fillInTheGapsOverImageDropdownPage.correctAnswerResponseWrapper(), alternativeAnswers.length);
225
+ alternativeAnswers.forEach((correctAnswer, index) => {
226
+ utilities.verifyTextContent(utilities.getNthElement(fillInTheGapsOverImageDropdownPage.correctAnswersNumeration(), index), index + 1);
227
+ fillInTheGapsOverImageDropdownPage.correctAnswerResponse()
228
+ .eq(index)
229
+ .should('have.text', correctAnswer);
230
+ });
231
+ });
232
+ },
233
+
211
234
  verifyVisibilityOfCorrectAnswerLabel: () => {
212
235
  utilities.verifyInnerText(fillInTheGapsOverImageDropdownPage.correctAnswersLabel(), 'Correct answers');
213
236
  },
@@ -966,9 +966,9 @@ const steps = {
966
966
  * @description Verifies alternative answer sections with labels, points, enumeration, and answers.
967
967
  * Example: verifyAlternativeAnswerSections([{label: 'Alternative answer 1', points: '(10 points)', answers: [['Elephant'], ['Fish'], ['Cat']]}])
968
968
  */
969
- verifyAlternativeAnswerResponsesInCorrectAnswerSectionAndCount: (alternativeAnswers = []) => {
969
+ verifyAlternativeAnswerResponsesInCorrectAnswerSectionAndCount: (alternativeAnswers = [], index) => {
970
970
  matchingPage.correctAnswersWrapper()
971
- .eq(1)
971
+ .eq(index)
972
972
  .within(() => {
973
973
  utilities.verifyElementCount(matchingPage.correctAnswersOptions(), alternativeAnswers.length);
974
974
  alternativeAnswers.forEach((correctAnswer, index) => {
@@ -5,6 +5,8 @@ import { customSettingsSeparatorComponent } from "./components/customSettingsSep
5
5
  import { dialogBoxBase } from "./dialogBoxBase";
6
6
  import { createItemPage } from "./createItemPage";
7
7
 
8
+ const alternativeAnswerCheck = Cypress.env('ENABLE_ALTERNATIVE_ANSWER_ENHANCEMENT') === 'true';
9
+
8
10
  const css = Cypress.env('css');
9
11
  const borderStyles = ["Dashed", "Dotted", "Solid", "None"]
10
12
  const modifiedColor = 'rgb(121, 60, 60)'
@@ -128,6 +130,9 @@ const selectors = {
128
130
  tickIcon: () => cy.get('.tick-icon-wrapper'),
129
131
  correctAnswersContainerResponse: () => cy.get('.cloze-math-correct-answer-wrapper .question-text-wrapper'),
130
132
  correctAnswersContainerResponseNumeration: () => cy.get('.cloze-math-correct-answer-wrapper .answer-numeration-number-box'),
133
+ correctAnswersSectionResponse: () => cy.get('.correct-answer-section-wrapper .question-text-wrapper'),
134
+ correctAnswersSectionResponseNumeration: () => cy.get('.correct-answer-section-wrapper .answer-numeration-number-box'),
135
+ correctAnswerSectionPointsLabel: () => cy.get('[class*="CorrectAnswerSectionstyle__CorrectAnswerLabelWrapper"] p'),
131
136
  correctAnswersLabel: () => cy.get('.cloze-with-text-correct-answer-label'),
132
137
  correctIncorrectStatusMessageText: () => cy.get('[class*="AnswerLabelText"]'),
133
138
  correctAnswersContainer: () => cy.get('[class*="__AnswerLabelWrapper"]'),
@@ -775,10 +780,43 @@ const steps = {
775
780
  * @param {string[]} correctAnswerArray An array of arrays, each containing the expected answer options for a specific correct answer section.
776
781
  */
777
782
  verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount: (correctAnswerArray) => {
778
- utilities.verifyElementCount(textEntryMathPage.correctAnswersContainerResponse(), correctAnswerArray.length);
783
+ utilities.verifyElementCount(
784
+ alternativeAnswerCheck ? textEntryMathPage.correctAnswersSectionResponseNumeration() : textEntryMathPage.correctAnswersContainerResponseNumeration(),
785
+ correctAnswerArray.length
786
+ );
779
787
  correctAnswerArray.forEach((correctAnswer, index) => {
780
- utilities.verifyTextContent(utilities.getNthElement(textEntryMathPage.correctAnswersContainerResponseNumeration(), index), index + 1);
781
- utilities.verifyTextContent(utilities.getNthElement(textEntryMathPage.correctAnswersContainerResponse(), index), correctAnswer);
788
+ utilities.verifyTextContent(utilities.getNthElement(
789
+ alternativeAnswerCheck ? textEntryMathPage.correctAnswersSectionResponseNumeration() : textEntryMathPage.correctAnswersContainerResponseNumeration(),
790
+ index
791
+ ), index + 1);
792
+ utilities.verifyTextContent(utilities.getNthElement(
793
+ alternativeAnswerCheck ? textEntryMathPage.correctAnswersSectionResponse(): textEntryMathPage.correctAnswersContainerResponse(),
794
+ index
795
+ ), correctAnswer);
796
+ });
797
+ },
798
+
799
+ /**
800
+ * Verifies the correct answer responses and points in the correct answer section
801
+ * @param {Array} correctAnswersArray - Array of objects containing correctAnswers and points arrays
802
+ * @param {Array} correctAnswersArray[].correctAnswers - Array of correct answer strings to verify
803
+ * @param {Array} correctAnswersArray[].points - Array of point values to verify
804
+ */
805
+ verifyCorrectAnswerResponsesInCorrectAnswerSection: (correctAnswersArray) => {
806
+ let responseIndex = 0;
807
+ let pointsIndex = 0;
808
+ correctAnswersArray.forEach(({
809
+ correctAnswers, points
810
+ }) => {
811
+ correctAnswers.forEach((answer, index) => {
812
+ utilities.verifyTextContent(utilities.getNthElement(textEntryMathPage.correctAnswersSectionResponseNumeration(), responseIndex), index + 1);
813
+ utilities.verifyTextContent(utilities.getNthElement(textEntryMathPage.correctAnswersSectionResponse(), responseIndex), answer);
814
+ responseIndex += 1;
815
+ })
816
+ points.forEach((pointsText) => {
817
+ utilities.verifyTextContent(utilities.getNthElement(textEntryMathPage.correctAnswerSectionPointsLabel(), pointsIndex), pointsText);
818
+ pointsIndex += 1;
819
+ })
782
820
  });
783
821
  },
784
822
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "itemengine-cypress-automation",
3
- "version": "1.0.602-IEI-7260-20e3fb8.0",
3
+ "version": "1.0.603-IEI-7053-9616741.0",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {