itemengine-cypress-automation 1.0.162-questionInsructionSelectorFix-15973d5.0 → 1.0.162

Sign up to get free protection for your applications and to get access to all the features.
Files changed (45) hide show
  1. package/cypress/e2e/ILC/DrawingResponse/drawingResponsePreviewTabContents.smoke.js +2 -2
  2. package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/FillInTheGapsOverImageDragAndDropScoring/allOrNothingForAllViews.smoke.js +0 -24
  3. package/cypress/e2e/ILC/Matching/additionalSettings.js +339 -0
  4. package/cypress/e2e/ILC/Matching/allOrNothingScoringForAllViews.smoke.js +0 -25
  5. package/cypress/e2e/ILC/Matching/clickAndDrop.js +634 -0
  6. package/cypress/e2e/ILC/Matching/studentViewSettings.js +453 -0
  7. package/cypress/e2e/ILC/Matching/studentViewSettingsForGroupedLayout.js +260 -0
  8. package/cypress/pages/components/gridQuestionCommonComponent.js +1 -1
  9. package/cypress/pages/matchingPage.js +444 -17
  10. package/package.json +2 -2
  11. /package/cypress/e2e/ILC/{Desmos → ThirdPartyDesmos}/desmosFourFunctionCalculatorEditTabBasicSection.js +0 -0
  12. /package/cypress/e2e/ILC/{Desmos → ThirdPartyDesmos}/desmosFourFunctionCalculatorPreviewContents.smoke.js +0 -0
  13. /package/cypress/e2e/ILC/{Desmos → ThirdPartyDesmos}/desmosGeometryToolEditTabBasicSection.js +0 -0
  14. /package/cypress/e2e/ILC/{Desmos → ThirdPartyDesmos}/desmosGeometryToolPreviewContents.smoke.js +0 -0
  15. /package/cypress/e2e/ILC/{Desmos → ThirdPartyDesmos}/desmosGraphingCalculatorEditTabBasicSection.js +0 -0
  16. /package/cypress/e2e/ILC/{Desmos → ThirdPartyDesmos}/desmosGraphingCalculatorPreviewContents.smoke.js +0 -0
  17. /package/cypress/e2e/ILC/{Desmos → ThirdPartyDesmos}/desmosMatrixCalculatorEditTabBasicSection.js +0 -0
  18. /package/cypress/e2e/ILC/{Desmos → ThirdPartyDesmos}/desmosMatrixCalculatorPreviewContents.smoke.js +0 -0
  19. /package/cypress/e2e/ILC/{Desmos → ThirdPartyDesmos}/desmosScientificCalculatorEditTabBasicSection.js +0 -0
  20. /package/cypress/e2e/ILC/{Desmos → ThirdPartyDesmos}/desmosScientificCalculatorPreviewContents.smoke.js +0 -0
  21. /package/cypress/e2e/ILC/{DesmosGraphing → ThirdPartyDesmosGraphing}/additionalSettings.js +0 -0
  22. /package/cypress/e2e/ILC/{DesmosGraphing → ThirdPartyDesmosGraphing}/editTabBasic.js +0 -0
  23. /package/cypress/e2e/ILC/{DesmosGraphing → ThirdPartyDesmosGraphing}/editTabScoring.js +0 -0
  24. /package/cypress/e2e/ILC/{DesmosGraphing → ThirdPartyDesmosGraphing}/gradingViewAndCorrectAnswerViewContents.smoke.js +0 -0
  25. /package/cypress/e2e/ILC/{DesmosGraphing → ThirdPartyDesmosGraphing}/previewTabContent.smoke.js +0 -0
  26. /package/cypress/e2e/ILC/{DesmosGraphing → ThirdPartyDesmosGraphing}/studentViewSettings.js +0 -0
  27. /package/cypress/e2e/ILC/{GeoGebraTools → ThirdPartyGeoGebra}/3DGraphingCalculatorEditTabBasicSection.js +0 -0
  28. /package/cypress/e2e/ILC/{GeoGebraTools → ThirdPartyGeoGebra}/3DGraphingCalculatorPreviewTabContents.smoke.js +0 -0
  29. /package/cypress/e2e/ILC/{GeoGebraTools → ThirdPartyGeoGebra}/casCalculatorEditTabBasicSection.js +0 -0
  30. /package/cypress/e2e/ILC/{GeoGebraTools → ThirdPartyGeoGebra}/casCalculatorPreviewTabContents.smoke.js +0 -0
  31. /package/cypress/e2e/ILC/{GeoGebraTools → ThirdPartyGeoGebra}/geometryCalculatorEditTabBasicSection.js +0 -0
  32. /package/cypress/e2e/ILC/{GeoGebraTools → ThirdPartyGeoGebra}/geometryCalculatorPreviewTabContents.smoke.js +0 -0
  33. /package/cypress/e2e/ILC/{GeoGebraTools → ThirdPartyGeoGebra}/graphingCalculatorEditTabBasicSection.js +0 -0
  34. /package/cypress/e2e/ILC/{GeoGebraTools → ThirdPartyGeoGebra}/graphingCalculatorPreviewTabContents.smoke.js +0 -0
  35. /package/cypress/e2e/ILC/{GeoGebraTools → ThirdPartyGeoGebra}/probablityCalculatorEditTabBasicSection.js +0 -0
  36. /package/cypress/e2e/ILC/{GeoGebraTools → ThirdPartyGeoGebra}/probablityCalculatorPreviewTabContents.smoke.js +0 -0
  37. /package/cypress/e2e/ILC/{GeoGebraTools → ThirdPartyGeoGebra}/scientificCalculatorEditTabBasicSection.js +0 -0
  38. /package/cypress/e2e/ILC/{GeoGebraTools → ThirdPartyGeoGebra}/scientificCalculatorPreviewTabContents.smoke.js +0 -0
  39. /package/cypress/e2e/ILC/{GeogebraActivity → ThirdPartyGeogebraActivity}/additionalSettings.js +0 -0
  40. /package/cypress/e2e/ILC/{GeogebraActivity → ThirdPartyGeogebraActivity}/editTabScoringSection.js +0 -0
  41. /package/cypress/e2e/ILC/{GeogebraActivity → ThirdPartyGeogebraActivity}/gradingViewAndCorrectAnswerViewContents.smoke.js +0 -0
  42. /package/cypress/e2e/ILC/{GeogebraActivity → ThirdPartyGeogebraActivity}/headerSection.js +0 -0
  43. /package/cypress/e2e/ILC/{GeogebraActivity → ThirdPartyGeogebraActivity}/insertResourceLink.js +0 -0
  44. /package/cypress/e2e/ILC/{GeogebraActivity → ThirdPartyGeogebraActivity}/previewTabContent.smoke.js +0 -0
  45. /package/cypress/e2e/ILC/{GeogebraActivity → ThirdPartyGeogebraActivity}/questionInstructions.js +0 -0
@@ -1,6 +1,7 @@
1
1
  import constants from "../fixtures/constants";
2
2
  import utilities from "../support/helpers/utilities";
3
- import { createQuestionBasePage, questionInstructionsComponent, autoScoredScoringPreviewTab, scoringSectionBaseEditTab, draggableOptionContainer, draggableOptionsSectionComponent, correctIncorrectAnswerLabelComponent, maximumCapacityPerDropzoneComponent, optionsWrapperComponent, ckEditorToolbar, equationEditorFlyout, autoScoredStudentViewSettings, autoScoredSpecifyCorrectAnswerSection, commonComponents, autoScoredScoringSectionMultiResponseType } from "./components";
3
+ import { createQuestionBasePage, questionInstructionsComponent, autoScoredScoringPreviewTab, scoringSectionBaseEditTab, draggableOptionContainer, draggableOptionsSectionComponent, correctIncorrectAnswerLabelComponent, maximumCapacityPerDropzoneComponent, optionsWrapperComponent, ckEditorToolbar, equationEditorFlyout, autoScoredStudentViewSettings, autoScoredSpecifyCorrectAnswerSection, commonComponents, randomizeOptionsComponent, autoScoredScoringSectionMultiResponseType, allowMultipleInstancesOfSameDraggableOptionComponent, studentViewSettingsLabelComponent, ariaLabelSectionComponent, additionalSettingsAccessibilitySectionComponent, gradingViewEnumerationComponent, additionalSettingsPanel, } from "./components";
4
+ import { dialogBoxBase } from "./dialogBoxBase";
4
5
  const css = Cypress.env('css');
5
6
  const options = ['option 1', 'option 2', 'option 3'];
6
7
  const fourOptions = ['option 1', 'option 2', 'option 3', 'option 4'];
@@ -14,10 +15,20 @@ const selectors = {
14
15
  ...autoScoredScoringSectionMultiResponseType,
15
16
  ...autoScoredSpecifyCorrectAnswerSection,
16
17
  ...draggableOptionContainer,
18
+ ...allowMultipleInstancesOfSameDraggableOptionComponent,
19
+ ...randomizeOptionsComponent,
20
+ ...gradingViewEnumerationComponent,
21
+ ...ariaLabelSectionComponent,
22
+ ...scoringSectionBaseEditTab,
23
+ ...additionalSettingsPanel,
24
+ ...maximumCapacityPerDropzoneComponent,
25
+
17
26
  //Edit tab
18
27
  promptInputField: () => cy.get('.edit-mcq-stems-wrapper [role="textbox"]'),
19
- promptInputFieldWrapper: () => cy.get('.edit-mcq-stems-wrapper .edit-mcq-option-wrapper'),
28
+ promptInputFieldWrapper: () => cy.get('.edit-mcq-stems-wrapper [class*="SingleOptionstyle__EditorBlockWrapper"]'),
20
29
  optionInputField: () => cy.get('.edit-mcq-options-wrapper [data-rbd-draggable-id*="option-draggable"] [role="textbox"]'),
30
+ optionWrapper: () => cy.get('.response-options-wrapper [data-rbd-draggable-id*="option-draggable"]'),
31
+ optionNumeration: () => cy.get('.response-options-wrapper [class*="SingleOptionstyle__AdornmentDiv"]'),
21
32
  promptNumeration: () => cy.get('[class*="SingleOptionstyle__AdornmentDiv"]'),
22
33
  promptLabel: () => cy.get('.match-list-stem-label'),
23
34
  promptHeaderLabel: () => cy.get('.prompt-header-container [class*="InlineTextFieldWithDebouncestyles__PropertyLabel"]'),
@@ -38,6 +49,10 @@ const selectors = {
38
49
  optionsLabel: () => cy.get('.cloze-with-drag-and-drop-options-label'),
39
50
  optionWrapper: () => cy.get('.response-options-wrapper [data-rbd-draggable-id*="option-draggable"]'),
40
51
  optionNumeration: () => cy.get('.response-options-wrapper [class*="SingleOptionstyle__AdornmentDiv"]'),
52
+ droppedDraggableOptionInDropzoneSpecifyCorrectAnswerSection: () => cy.get('[class*="MultipleDroppedItemstyles__ItemWrapper"]'),
53
+ optionsContainerSpecifyCorrectAnswerSection: () => cy.get('.draggable-wrapper'),
54
+ promptSpecifyCorrectAnswerSection: () => cy.get('.stem-container [data-testid="question-instruction-element"]'),
55
+ draggableOptionInDropzoneInSpecifyCorrectAnswer: () => cy.get('.item-content-wrapper'),
41
56
 
42
57
  //Penalty points
43
58
  penaltyPointsForEachIncorrectDropzoneInputField: () => cy.get('input[aria-label="Penalty points for each incorrect dropzone"]'),
@@ -45,21 +60,27 @@ const selectors = {
45
60
  partialEqualWeightsPerResponseScore: () => cy.get('[class*="PointsPerResponseValue"]'),
46
61
  partialDifferentWeightsPointsLabel: () => cy.get('.cloze-with-dropdown-partial-points-per-response-label'),
47
62
 
48
- //Specify correct answer section
49
- dropzoneSpecifyCorrectAnswerSection: () => cy.get('.authoring-droppable-hotspot-wrapper'),
50
- promptSpecifyCorrectAnswerSection: () => cy.get('.stem-container [data-testid="question-instruction-element"]:visible'),
51
- dropzoneSpecifyCorrectAnswerSection: () => cy.get('.authoring-droppable-hotspot-wrapper'),
52
- optionContainerOptionsSpecifyCorrectAnswerSection: () => cy.get('.draggable-selected-item'),
63
+ //Student view settings
64
+ enableOuterBorderForQuestionLabel: () => cy.get('[data-ngie-testid*="enable-outer-border-for-question-checkbox"] .MuiFormControlLabel-label'),
65
+ enableOuterBorderForQuestionCheckbox: () => cy.get('[data-ngie-testid*="enable-outer-border-for-question-checkbox"] input'),
66
+ maxLimitInEachDropzoneHelpText: () => cy.get('.max-answer-dropzone-limit:visible'),
53
67
 
54
68
  //Preview tab
55
69
  promptContainerPreviewTab: () => cy.get('.stem-container:visible'),
56
70
  dropzonePreviewTab: () => cy.get('.cloze-with-drag-and-drop-preview [class*="MultipleDroppableHotspotstyle__DroppableHotspotWrapper"]'),
71
+ dropzoneNumerationPreviewTab: () => cy.get('[class*="MultipleDroppableHotspotstyle__NumerationDiv"]'),
57
72
  dropzoneOptionPreviewTab: () => cy.get('[class*="MultipleDroppedItemstyles__FlexWrapper"]'),
58
73
  dropzoneNumeration: () => cy.get('[class*="NumerationDiv"]'),
59
74
  correctAnswersNumeration: () => cy.get('.answer-numeration-number-box'),
75
+ correctAnswerResponseWrapper: () => cy.get('[class*="ClozeWithDragAndDropstyles__AnswerCell"]'),
60
76
  correctAnswersOptions: () => cy.get('.match-list-drag-and-drop .question-text-wrapper'),
61
77
  correctAnswersOptionContainer: () => cy.get('.draggable-selected-option'),
78
+ questionBorderPreviewTab: () => cy.get('[class*="ClozeWithDragAndDropstyles__WrapperDiv"]'),
79
+ correctAnswerResponseWrapperWithoutEnumeration: () => cy.get('.answer-status-response-preview-wrapper .item-wrapper'),
80
+ correctAnswerTextWithoutEnumeration: () => cy.get('.answer-status-response-preview-wrapper .item-wrapper'),
62
81
  correctIncorrectAnswerLabel: () => cy.get('[class*="AnswerStatusText"]'),
82
+ previewResponseWrapper: () => cy.get('[class*="ClozeWithDragAndDropstyles__PreviewResponseContainer"]:visible'),
83
+ droppedDraggableOptionInDropzonePreviewTab: () => cy.get('[class*="MultipleDroppedItemstyles__ItemWrapper"]'),
63
84
  dropzoneColumnAndPromptHeaderWrapperPreviewTab: () => cy.get('.edit-question-preview-wrapper [class*="ClozeWithDragAndDropstyles__ResponseHeaderWrapper"]')
64
85
  }
65
86
 
@@ -75,6 +96,9 @@ const steps = {
75
96
  ...equationEditorFlyout.steps,
76
97
  ...autoScoredStudentViewSettings.steps,
77
98
  ...autoScoredSpecifyCorrectAnswerSection.steps,
99
+ ...draggableOptionContainer.steps,
100
+ ...randomizeOptionsComponent.steps,
101
+ ...draggableOptionsSectionComponent.steps,
78
102
  ...autoScoredScoringSectionMultiResponseType.steps,
79
103
  ...draggableOptionsSectionComponent.steps,
80
104
  ...draggableOptionContainer.steps,
@@ -82,6 +106,13 @@ const steps = {
82
106
  ...draggableOptionsSectionComponent.steps,
83
107
  ...draggableOptionContainer.steps,
84
108
  ...autoScoredScoringSectionMultiResponseType.steps,
109
+ ...allowMultipleInstancesOfSameDraggableOptionComponent.steps,
110
+ ...randomizeOptionsComponent.steps,
111
+ ...additionalSettingsPanel.steps,
112
+ ...gradingViewEnumerationComponent.steps,
113
+ ...ariaLabelSectionComponent.steps,
114
+ ...maximumCapacityPerDropzoneComponent.steps,
115
+
85
116
  //Edit tab
86
117
  addPrompt: () => {
87
118
  matchingPage.addPromptButton()
@@ -146,7 +177,7 @@ const steps = {
146
177
  matchingPage.promptInputField()
147
178
  .eq(index)
148
179
  .clear()
149
- .type(promptText, { delay: 500 })
180
+ .type(promptText, { delay: 50 })
150
181
  .should('have.text', promptText);
151
182
  });
152
183
  },
@@ -207,9 +238,9 @@ const steps = {
207
238
  },
208
239
 
209
240
  /**
210
- * @param {number} index of option
211
- * @description this function verifies error message of option input field
212
- */
241
+ * @param {number} index of option
242
+ * @description this function verifies error message of option input field
243
+ */
213
244
  verifyPromptInputFieldErrorMessage: (index) => {
214
245
  matchingPage.promptInputFieldWrapper()
215
246
  .eq(index)
@@ -228,7 +259,7 @@ const steps = {
228
259
  matchingPage.optionInputField()
229
260
  .eq(index)
230
261
  .clear()
231
- .type(options, { delay: 500 })
262
+ .type(options, { delay: 50 })
232
263
  .blur();
233
264
  });
234
265
  },
@@ -433,6 +464,41 @@ const steps = {
433
464
  .click();
434
465
  },
435
466
 
467
+ /**
468
+ * @param {number} dropzoneIndex index of the dropzone in specify correct answer section
469
+ * @param {string[]} responseArray array of options set as correct responses in a category cell
470
+ */
471
+ verifyDraggableOptionInDropzoneSpecifyCorrectAnswerSection: (dropzoneIndex, response) => {
472
+ matchingPage.dropzoneSpecifyCorrectAnswerSection()
473
+ .find('.item-content-container')
474
+ .eq(dropzoneIndex)
475
+ .should('have.text', response);
476
+ },
477
+
478
+ /**
479
+ * @description Verifies the text content of a specific preview tab dropzone element.
480
+ * @param {number} count - The index of the preview tab dropzone element to verify (zero-based).
481
+ * @param {string} text - The expected text content to match against the inner text of the specified dropzone element.
482
+ */
483
+ verifyDropzoneTextSpecifyCorrectAnswerSection: (count, text) => {
484
+ utilities.verifyInnerText(utilities.getNthElement(matchingPage.dropzoneSpecifyCorrectAnswerSection(), count), text);
485
+ },
486
+
487
+ /**
488
+ * @param {string} optionName denotes the text content of the draggable option
489
+ * @param {number} dropzoneIndex - The index of the dropzone.
490
+ * @description click on a draggable option present in the category cell of specify correct answer section
491
+ */
492
+ clickOnDraggableOptionInDropzoneOfSpecifyCorrectAnswerSection: (optionName, dropzoneIndex) => {
493
+ matchingPage.dropzoneSpecifyCorrectAnswerSection()
494
+ .eq(dropzoneIndex)
495
+ .within(() => {
496
+ matchingPage.draggableOptionInDropzoneInSpecifyCorrectAnswer()
497
+ .contains(optionName)
498
+ .click();
499
+ });
500
+ },
501
+
436
502
  /**
437
503
  * @param {string} groupTitle group title
438
504
  * @param {string[]} optionArray array of options for a particular group
@@ -478,16 +544,58 @@ const steps = {
478
544
  });
479
545
  },
480
546
 
547
+ /**
548
+ * Verifies the text of a dropzone in the Specify Correct Answer section.
549
+ * @param {number} count - The index of the dropzone.
550
+ * @param {string} text - The expected text of the dropzone.
551
+ */
481
552
  verifyDropzoneTextSpecifyCorrectAnswerSection: (count, text) => {
482
553
  utilities.verifyInnerText(utilities.getNthElement(matchingPage.dropzoneSpecifyCorrectAnswerSection(), count), text);
483
554
  },
484
555
 
556
+ /**
557
+ * Verifies the options in the Option Container section of the Specify Correct Answer section.
558
+ * @param {Object[]} optionsArray - An array of objects containing the index and option text.
559
+ * @param {number} optionsArray.index - The index of the option.
560
+ * @param {string} optionsArray.optionText - The expected text of the option.
561
+ */
485
562
  verifyOptionContainerOptionSpecifyCorrectAnswerSection: (optionsArray) => {
486
563
  optionsArray.forEach(({ index, optionText }) => {
487
564
  utilities.verifyInnerText(utilities.getNthElement(matchingPage.optionContainerOptionsSpecifyCorrectAnswerSection(), index), optionText);
488
565
  });
489
566
  },
490
567
 
568
+ /**
569
+ * @description Click on dropzone in specify correct answer section
570
+ * @param {number} dropzoneIndex
571
+ */
572
+ clickOnDropzoneOfSpecifyCorrectAnswerSection: (dropzoneIndex) => {
573
+ matchingPage.dropzoneSpecifyCorrectAnswerSection()
574
+ .eq(dropzoneIndex)
575
+ .click({ force: true });
576
+ },
577
+
578
+ /**
579
+ * @param {number} categoryIndex optionIndex of the dropzone in set correct answer section
580
+ * @param {string[]} responseArray array of options set as correct responses in a dropzone
581
+ */
582
+ verifyDraggableOptionInDropzoneSpecifyCorrectAnswerSection: (dropzoneIndex, responseArray) => {
583
+ matchingPage.dropzoneSpecifyCorrectAnswerSection()
584
+ .eq(dropzoneIndex)
585
+ .within(() => {
586
+ responseArray.forEach((response, count) => {
587
+ utilities.verifyTextContent(utilities.getNthElement(matchingPage.droppedDraggableOptionInDropzoneSpecifyCorrectAnswerSection(), count), response);
588
+ });
589
+ });
590
+ },
591
+
592
+
593
+ /**
594
+ * Verifies the prompt container in the 'Specify correct answer' section.
595
+ * @param {Object[]} optionsArray - An array of objects containing index and optionText.
596
+ * @param {number} optionsArray[].index - The index of the prompt container.
597
+ * @param {string} optionsArray[].optionText - The expected text of the prompt container.
598
+ */
491
599
  verifyPromptContainerSpecifyCorrectAnswerSection: (optionsArray) => {
492
600
  optionsArray.forEach(({ index, optionText }) => {
493
601
  utilities.verifyInnerText(utilities.getNthElement(matchingPage.promptSpecifyCorrectAnswerSection(), index), optionText);
@@ -520,6 +628,14 @@ const steps = {
520
628
  });
521
629
  },
522
630
 
631
+ clickAndDropOptionInOptionsContainerInPreviewTab: (optionText) => {
632
+ matchingPage.dropzonePreviewTab()
633
+ .contains(optionText)
634
+ .click();
635
+ draggableOptionContainer.optionsContainerPreviewTab()
636
+ .click({ force: true });
637
+ },
638
+
523
639
  /**
524
640
  * Sets options in dropzone in the Preview Tab based on the provided optionsObject.
525
641
  * @param {Object[]} responses - An array of objects containing the responseIndex, responseText and dropzone index
@@ -562,6 +678,18 @@ const steps = {
562
678
  .contains(text);
563
679
  },
564
680
 
681
+ /**
682
+ * Verifies the correct answer response without enumeration at a specific index.
683
+ * @param {number} index - The index of the correct answer response to verify.
684
+ * @param {string} correctAnswer - The correct answer response to verify.
685
+ */
686
+ verifyCorrectAnswerResponsesWithoutEnumeration: (index, correctAnswer) => {
687
+ matchingPage.correctAnswerResponseWrapperWithoutEnumeration()
688
+ .eq(index)
689
+ .find('.question-text-wrapper')
690
+ .should('have.text', correctAnswer);
691
+ },
692
+
565
693
  /**
566
694
  * @description Verifies that the equation text in the Preview tab is correct.
567
695
  * @param {number} optionIndex - The index of the option in the Preview tab.
@@ -671,6 +799,18 @@ const steps = {
671
799
  .contains(constants.CKEditorInputFieldEnteredEquationText);
672
800
  },
673
801
 
802
+ /**
803
+ * Verifies the prompt container in the 'Specify correct answer' section.
804
+ * @param {Object[]} optionsArray - An array of objects containing index and optionText.
805
+ * @param {number} optionsArray[].index - The index of the prompt container.
806
+ * @param {string} optionsArray[].optionText - The expected text of the prompt container.
807
+ */
808
+ verifyPromptContainerPreviewTab: (optionsArray) => {
809
+ optionsArray.forEach(({ index, optionText }) => {
810
+ utilities.verifyInnerText(utilities.getNthElement(matchingPage.promptContainerPreviewTab(), index), optionText);
811
+ });
812
+ },
813
+
674
814
  verifyDropzoneNumeration: () => {
675
815
  matchingPage.dropzonePreviewTab()
676
816
  .each(($element, index) => {
@@ -768,10 +908,10 @@ const steps = {
768
908
  },
769
909
 
770
910
  /**
771
- * @param {string} groupTitle group title
772
- * @param {string[]} optionArray array of options for a particular group
773
- * @description add a group with title and options in the response options section
774
- */
911
+ * @param {string} groupTitle group title
912
+ * @param {string[]} optionArray array of options for a particular group
913
+ * @description add a group with title and options in the response options section
914
+ */
775
915
  addGroupWithTitleAndOptionsInDraggableOptionsSection: (groupTitle, optionArray) => {
776
916
  const numOptionsToAdd = Math.max(0, optionArray.length - 2);
777
917
  draggableOptionsSectionComponent.steps.addGroup();
@@ -779,7 +919,286 @@ const steps = {
779
919
  for (let i = 0; i < numOptionsToAdd; i++) {
780
920
  optionsWrapperComponent.steps.addOption();
781
921
  }
782
- steps.enterTextInOptionInputField(optionArray);
922
+ matchingPage.steps.enterTextInOptionInputField(optionArray);
923
+ },
924
+
925
+ /**
926
+ * @param {number} dropzoneIndex index of the dropzone in preview tab
927
+ * @param {string[]} responseArray array of options set as correct responses in a category cell
928
+ */
929
+ verifyDraggableOptionInDropzoneOfPreviewTab: (dropzoneIndex, responseArray) => {
930
+ matchingPage.dropzonePreviewTab()
931
+ .eq(dropzoneIndex)
932
+ .within(() => {
933
+ responseArray.forEach((response, count) => {
934
+ utilities.verifyInnerText(utilities.getNthElement(cy.get('.item-content-container'), count), response);
935
+ });
936
+ });
937
+ },
938
+
939
+ verifyEnableOuterBorderForQuestionCheckboxCheckedState: () => {
940
+ matchingPage.enableOuterBorderForQuestionCheckbox()
941
+ .should('be.checked');
942
+ },
943
+
944
+ verifyEnableOuterBorderForQuestionCheckboxUncheckedState: () => {
945
+ matchingPage.enableOuterBorderForQuestionCheckbox()
946
+ .should('not.be.checked');
947
+ },
948
+
949
+ checkEnableOuterBorderForQuestionCheckbox: () => {
950
+ matchingPage.enableOuterBorderForQuestionCheckbox()
951
+ .click()
952
+ .should('be.checked');
953
+ },
954
+
955
+ uncheckEnableOuterBorderForQuestionCheckbox: () => {
956
+ matchingPage.enableOuterBorderForQuestionCheckbox()
957
+ .click()
958
+ .should('not.be.checked');
959
+ },
960
+
961
+ verifyQuestionBorderNotExist: () => {
962
+ matchingPage.questionBorderPreviewTab()
963
+ .should('have.css', 'border')
964
+ .and('match', /0px none/);
965
+ },
966
+
967
+ /**
968
+ * @description Verifies the text content of a specific preview tab dropzone element.
969
+ * @param {number} count - The index of the preview tab dropzone element to verify (zero-based).
970
+ * @param {string} text - The expected text content to match against the inner text of the specified dropzone element.
971
+ */
972
+ verifyDropzoneTextPreviewTab: (count, text) => {
973
+ utilities.verifyInnerText(utilities.getNthElement(matchingPage.dropzonePreviewTab(), count), text);
974
+ },
975
+
976
+ verifyInactiveStateOfAllDropzoneInSpecifyCorrectAnswerSection: () => {
977
+ matchingPage.dropzoneSpecifyCorrectAnswerSection()
978
+ .should('not.have.class', 'isActiveForDrop');
979
+ },
980
+
981
+ verifyActiveStateOfAllDropzoneInSpecifyCorrectAnswerSection: () => {
982
+ matchingPage.dropzoneSpecifyCorrectAnswerSection()
983
+ .should('have.class', 'isActiveForDrop');
984
+ },
985
+
986
+ /**
987
+ * Verifies the dropzone enumeration in the preview tab.
988
+ * @param {string[]} enumerationArray - An array of enumeration values to verify.
989
+ * @returns {void}
990
+ */
991
+ verifyDropzoneEnumeration: (enumerationArray) => {
992
+ utilities.verifyElementCount(matchingPage.dropzonePreviewTab(), enumerationArray.length);
993
+ enumerationArray.forEach((option, index) => {
994
+ matchingPage.dropzonePreviewTab()
995
+ .eq(index)
996
+ .within(() => {
997
+ utilities.verifyTextContent(matchingPage.dropzoneNumerationPreviewTab(), `${option}`);
998
+ });
999
+ });
1000
+ },
1001
+
1002
+ /**
1003
+ * Verifies the prompt container content in the preview tab.
1004
+ * @param {Object[]} optionsArray - Array of objects containing index and optionText.
1005
+ * @param {number} optionsArray[].index - The index of the prompt container element.
1006
+ * @param {string} optionsArray[].optionText - The expected text to verify against the prompt container element.
1007
+ */
1008
+ verifyPromptContainerPreviewTab: (optionsArray) => {
1009
+ optionsArray.forEach(({ index, optionText }) => {
1010
+ utilities.verifyInnerText(utilities.getNthElement(matchingPage.promptContainerPreviewTab(), index), optionText);
1011
+ });
1012
+ },
1013
+
1014
+ /**
1015
+ * Verifies the correct answer dropzone enumeration.
1016
+ * @param {string[]} enumerationArray - An array of enumeration values to verify.
1017
+ * @returns {void}
1018
+ */
1019
+ verifyCorrectAnswerDropzoneEnumeration: (enumerationArray) => {
1020
+ utilities.verifyElementCount(matchingPage.correctAnswerResponseWrapper(), enumerationArray.length);
1021
+ enumerationArray.forEach((option, index) => {
1022
+ matchingPage.correctAnswerResponseWrapper()
1023
+ .eq(index)
1024
+ .within(() => {
1025
+ utilities.verifyInnerText(matchingPage.correctAnswersNumeration(), `${option}`);
1026
+ });
1027
+ });
1028
+ },
1029
+
1030
+ verifyDropzoneNumerationNotExistsPreviewTab: () => {
1031
+ utilities.verifyElementVisibilityState(matchingPage.dropzoneNumerationPreviewTab(), 'notExist');
1032
+ },
1033
+
1034
+ /**
1035
+ * Verifies the ARIA label of a dropzone in the 'Specify correct answer' section.
1036
+ * @param {number} inputFieldIndex - The index of the input field.
1037
+ * @param {string} ariaLabel - The expected ARIA label of the dropzone.
1038
+ */
1039
+ verifyDropzoneAriaLabelSpecifyCorrectAnswerSection: (inputFieldIndex, ariaLabel) => {
1040
+ matchingPage.dropzoneSpecifyCorrectAnswerSection()
1041
+ .eq(inputFieldIndex)
1042
+ .should('have.attr', 'aria-label', ariaLabel);
1043
+ },
1044
+
1045
+ /**
1046
+ * Verifies the ARIA label of a dropzone in the preview tab.
1047
+ * @param {number} inputFieldIndex - The index of the input field.
1048
+ * @param {string} ariaLabel - The expected ARIA label of the dropzone.
1049
+ */
1050
+ verifyDropzoneAriaLabelPreviewTab: (inputFieldIndex, ariaLabel) => {
1051
+ matchingPage.dropzonePreviewTab()
1052
+ .eq(inputFieldIndex)
1053
+ .should('have.attr', 'aria-label', ariaLabel);
1054
+ },
1055
+
1056
+ /**
1057
+ * @param {number} responseAreaIndex Index of the dropzone in specify correct answer section
1058
+ * @description Verify drag handle is not visible in filled category cell in specify correct answer section
1059
+ */
1060
+ verifyDragHandleNotVisibleInFilledDropzoneOfSpecifyCorrectAnswerSection: (responseAreaIndex) => {
1061
+ matchingPage.dropzoneSpecifyCorrectAnswerSection()
1062
+ .eq(responseAreaIndex)
1063
+ .within(() => {
1064
+ utilities.verifyElementVisibilityState(draggableOptionContainer.draggableOptionDragIcon(), 'notExist')
1065
+ });
1066
+ },
1067
+
1068
+ verifyInactiveStateOfAllDropzoneInPreviewTab: () => {
1069
+ matchingPage.dropzonePreviewTab()
1070
+ .should('not.have.class', 'isActiveForDrop');
1071
+ },
1072
+
1073
+ verifyActiveStateOfAllDropzoneInPreviewTab: () => {
1074
+ matchingPage.dropzonePreviewTab()
1075
+ .should('have.class', 'isActiveForDrop');
1076
+ },
1077
+
1078
+ /**
1079
+ * Verifies the inactive state of unselected draggable options in the preview tab.
1080
+ * @param {number[]} optionIndexArray - An array containing the indices of unselected draggable options.
1081
+ */
1082
+ verifyInactiveStateOfUnselectedDraggableOptionsInPreviewTab: (optionIndexArray) => {
1083
+ draggableOptionContainer.optionsContainerPreviewTab()
1084
+ .within(() => {
1085
+ optionIndexArray.forEach((optionIndex) => {
1086
+ draggableOptionContainer.draggableOption()
1087
+ .eq(optionIndex)
1088
+ .should('not.have.class', 'isSelected');
1089
+ });
1090
+ });
1091
+ },
1092
+
1093
+ /**
1094
+ * @param {number} dropzoneIndex index of the dropzone in preview tab
1095
+ * @param {string[]} responseArray array of options set as correct responses in a category cell
1096
+ */
1097
+ verifyDraggableOptionInDropzoneOfPreviewTab: (dropzoneIndex, responseArray) => {
1098
+ matchingPage.dropzonePreviewTab()
1099
+ .eq(dropzoneIndex)
1100
+ .within(() => {
1101
+ responseArray.forEach((response, count) => {
1102
+ utilities.verifyInnerText(utilities.getNthElement(cy.get('.item-content-container'), count), response);
1103
+ });
1104
+ });
1105
+ },
1106
+
1107
+ /**
1108
+ * @param {number} responseAreaIndex Index of the dropzone in preview tab
1109
+ * @description Verify drag handle is not visible in filled category cell in preview tab
1110
+ */
1111
+ verifyDragHandleNotVisibleInFilledDropzoneOfPreviewTab: (responseAreaIndex) => {
1112
+ matchingPage.dropzonePreviewTab()
1113
+ .eq(responseAreaIndex)
1114
+ .within(() => {
1115
+ utilities.verifyElementVisibilityState(draggableOptionContainer.draggableOptionDragIcon(), 'notExist')
1116
+ });
1117
+ },
1118
+
1119
+ /**
1120
+ * @param {string} optionName denotes the text content of the draggable option
1121
+ * @param {number} dropzoneIndex - The index of the dropzone.
1122
+ * @description click on a draggable option present in the category cell of preview tab
1123
+ */
1124
+ clickOnDraggableOptionInDropzoneOfPreviewTab: (optionName, dropzoneIndex) => {
1125
+ matchingPage.dropzonePreviewTab()
1126
+ .eq(dropzoneIndex)
1127
+ .find('.item-content-wrapper')
1128
+ .contains(optionName)
1129
+ .click();
1130
+ },
1131
+
1132
+ /**
1133
+ * Clicks on a draggable option present in the category cell of the preview tab and drops it into the options container.
1134
+ * @param {string} optionName - The text content of the draggable option.
1135
+ * @param {number} dropzoneIndex - The index of the dropzone.
1136
+ */
1137
+ clickAndDropDraggableOptionFromDropzoneToOptionsContainerPreviewTab: (optionName, dropzoneIndex) => {
1138
+ matchingPage.dropzonePreviewTab()
1139
+ .eq(dropzoneIndex)
1140
+ .find('.item-content-wrapper')
1141
+ .contains(optionName)
1142
+ .click({ force: true });
1143
+ matchingPage.optionsContainerPreviewTab()
1144
+ .click();
1145
+ },
1146
+
1147
+ /**
1148
+ * @description Click on dropzone in preview tab
1149
+ * @param {number} dropzoneIndex
1150
+ */
1151
+ clickOnDropzoneOfPreviewTab: (dropzoneIndex) => {
1152
+ matchingPage.dropzonePreviewTab()
1153
+ .eq(dropzoneIndex)
1154
+ .click({ force: true });
1155
+ },
1156
+
1157
+ /**
1158
+ * Verifies that the options are randomized in the preview tab.
1159
+ * @param {string[]} promptArray - Array of options set in the correct answer section.
1160
+ */
1161
+ verifyRandomizePromptOrder: (promptArray) => {
1162
+ let currentOptions = [...promptArray];
1163
+ matchingPage.previewResponseWrapper().within(() => {
1164
+ for (let index = 0; index < currentOptions.length; index++) {
1165
+ matchingPage.promptContainerPreviewTab()
1166
+ .eq(index)
1167
+ .then(($element) => {
1168
+ expect($element.text()).to.be.oneOf(currentOptions);
1169
+ currentOptions = currentOptions.filter((value) => value !== $element.text());
1170
+ });
1171
+ }
1172
+ });
1173
+ matchingPage.steps.verifyPromptAreRerandomized(promptArray);
1174
+ },
1175
+
1176
+ /**
1177
+ * Verifies that options in the preview tab have been re-randomized compared to the previous order.
1178
+ * @param {string[]} previousOrderOfPrompt - An array representing the previous order of options.
1179
+ */
1180
+ verifyPromptAreRerandomized: (previousOrderOfPrompt) => {
1181
+ matchingPage.previewResponseWrapper().within(() => {
1182
+ matchingPage.promptContainerPreviewTab()
1183
+ .should('not.have.text', '')
1184
+ .and('not.have.text', previousOrderOfPrompt.join(''));
1185
+ });
1186
+ },
1187
+
1188
+ getPromptArray: () => {
1189
+ const promptArray = []
1190
+ commonComponents.previewTabQuestionWrapper()
1191
+ .within(() => {
1192
+ matchingPage.promptContainerPreviewTab()
1193
+ .each(($el) => {
1194
+ cy.wrap($el)
1195
+ .invoke('text')
1196
+ .then((text) => {
1197
+ promptArray.push(text);
1198
+ });
1199
+ });
1200
+ });
1201
+ return promptArray;
783
1202
  },
784
1203
 
785
1204
  /**
@@ -883,12 +1302,20 @@ const tests = {
883
1302
  ...autoScoredScoringPreviewTab.tests,
884
1303
  ...scoringSectionBaseEditTab.tests,
885
1304
  ...autoScoredScoringSectionMultiResponseType.tests,
1305
+ ...additionalSettingsPanel.tests,
1306
+ ...gradingViewEnumerationComponent.tests,
1307
+ ...additionalSettingsAccessibilitySectionComponent.tests,
1308
+ ...ariaLabelSectionComponent.tests,
886
1309
  ...optionsWrapperComponent.tests,
887
1310
  ...draggableOptionContainer.tests,
888
1311
  ...autoScoredSpecifyCorrectAnswerSection.tests,
889
1312
  ...createQuestionBasePage.tests,
890
1313
  ...commonComponents.tests,
891
1314
  ...draggableOptionsSectionComponent.tests,
1315
+ ...studentViewSettingsLabelComponent.tests,
1316
+ ...randomizeOptionsComponent.tests,
1317
+ ...allowMultipleInstancesOfSameDraggableOptionComponent.tests,
1318
+ ...autoScoredStudentViewSettings.tests,
892
1319
  ...questionInstructionsComponent.tests,
893
1320
 
894
1321
  verifyContentsOfSpecifyCorrectAnswerSection: () => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "itemengine-cypress-automation",
3
- "version": "1.0.162-questionInsructionSelectorFix-15973d5.0",
3
+ "version": "1.0.162",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -35,4 +35,4 @@
35
35
  "node-fetch": "^3.3.2",
36
36
  "react-uuid": "^2.0.0"
37
37
  }
38
- }
38
+ }