itemengine-cypress-automation 1.0.244 → 1.0.245

Sign up to get free protection for your applications and to get access to all the features.
Files changed (99) hide show
  1. package/cypress/e2e/ILC/BrainingCampManipulative/editTabBasicSection.js +1 -1
  2. package/cypress/e2e/ILC/ChartsBar/headerSection.js +1 -16
  3. package/cypress/e2e/ILC/ChartsLine/headerSection.js +1 -18
  4. package/cypress/e2e/ILC/ContentBlocks/editTabBasics.js +3 -2
  5. package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/clickAndDrop.js +4 -2
  6. package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/draggableOptions.js +4 -2
  7. package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/headerSection.js +5 -2
  8. package/cypress/e2e/ILC/EssayResponse/equationEditor.smoke.js +2 -0
  9. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/clickAndDrop.js +4 -2
  10. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/draggableOptions.js +4 -2
  11. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/editTabBasicSection.js +2 -2
  12. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/headerSection.js +5 -3
  13. package/cypress/e2e/ILC/FillInTheGapsDropdownNew/dropdownOptionsSection.js +2 -2
  14. package/cypress/e2e/ILC/FillInTheGapsDropdownNew/editTabBasicSection.js +2 -2
  15. package/cypress/e2e/ILC/FillInTheGapsDropdownNew/headerSection.js +5 -2
  16. package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/clickAndDrop.js +6 -4
  17. package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/draggableOptions.js +1 -0
  18. package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/headerSection.js +8 -2
  19. package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/dropdownOptionsSection.js +1 -1
  20. package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/editTabBasicSection.js +2 -3
  21. package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/headerSection.js +6 -2
  22. package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/supportedFileTypes.js +3 -2
  23. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/HeaderSection.js +4 -2
  24. package/cypress/e2e/ILC/FillInTheGapsTextNew/editTabBasicSection.js +2 -3
  25. package/cypress/e2e/ILC/FillInTheGapsTextNew/headerSection.js +3 -2
  26. package/cypress/e2e/ILC/Graphing/headerSection.js +3 -2
  27. package/cypress/e2e/ILC/GridFill/headerSection.js +3 -1
  28. package/cypress/e2e/ILC/GridFill/specifyCorrectAnswerSection.js +3 -3
  29. package/cypress/e2e/ILC/ImageHighlight/additionalSettingsBasic.js +2 -0
  30. package/cypress/e2e/ILC/ImageHighlight/headerSection.js +4 -2
  31. package/cypress/e2e/ILC/ListOrderingDropdown/specifyCorrectAnswerSection.js +8 -6
  32. package/cypress/e2e/ILC/ListOrderingNew/headerSection.js +8 -2
  33. package/cypress/e2e/ILC/ListOrderingReorderAsASeperateList/Scoring/partialDifferentWeightsAlternativePointsGreaterThanCorrectPoints.js +225 -0
  34. package/cypress/e2e/ILC/ListOrderingReorderAsASeperateList/Scoring/partialDifferentWeightsBasic.js +89 -0
  35. package/cypress/e2e/ILC/ListOrderingReorderAsASeperateList/Scoring/partialDifferentWeightsCorrectPointsEqualToAlternativePoints.js +225 -0
  36. package/cypress/e2e/ILC/ListOrderingReorderAsASeperateList/Scoring/partialDifferentWeightsCorrectPointsGreaterThanAlternativePoints.js +225 -0
  37. package/cypress/e2e/ILC/ListOrderingReorderAsASeperateList/Scoring/partialDifferentWeightsMinimumAndPenaltyScoring.js +405 -0
  38. package/cypress/e2e/ILC/ListOrderingReorderAsASeperateList/Scoring/partialEqualWeightsAlternativePointsGreaterThanCorrectPoints.js +201 -0
  39. package/cypress/e2e/ILC/ListOrderingReorderAsASeperateList/Scoring/partialEqualWeightsBasic.js +147 -0
  40. package/cypress/e2e/ILC/ListOrderingReorderAsASeperateList/Scoring/partialEqualWeightsCorrectPointsEqualToAlternativePoints.js +171 -0
  41. package/cypress/e2e/ILC/ListOrderingReorderAsASeperateList/Scoring/partialEqualWeightsCorrectPointsGreaterThanAlternativePoints.js +203 -0
  42. package/cypress/e2e/ILC/Matching/clickAndDrop.js +5 -3
  43. package/cypress/e2e/ILC/Matching/headerSection.js +10 -2
  44. package/cypress/e2e/ILC/Matching/questionInstructionsAndPromptSection.js +17 -4
  45. package/cypress/e2e/ILC/Matching/styleAndLayoutCustomizationDropzoneBorderStyleProperties.js +113 -0
  46. package/cypress/e2e/ILC/Matching/styleAndLayoutCustomizationDropzoneProperties.js +251 -0
  47. package/cypress/e2e/ILC/Matching/styleAndLayoutCustomizationLayoutProperties.js +227 -0
  48. package/cypress/e2e/ILC/MultipleSelection/headerSection.js +5 -2
  49. package/cypress/e2e/ILC/MultipleSelectionGridNew/headerSection.js +9 -2
  50. package/cypress/e2e/ILC/NumberLine/headerSection.js +3 -2
  51. package/cypress/e2e/ILC/NumberLineLabel/headerSection.js +4 -3
  52. package/cypress/e2e/ILC/ShortTextResponseNew/headerSection.js +4 -2
  53. package/cypress/e2e/ILC/SingleSelection/headerSection.js +5 -2
  54. package/cypress/e2e/ILC/SingleSelectionGridNew/headerSection.js +9 -2
  55. package/cypress/e2e/ILC/TextEntryMath/Scoring/allOrNothingAlternatePointsGreaterThanCorrectPoints.js +1 -1
  56. package/cypress/e2e/ILC/TextEntryMath/Scoring/allOrNothingCorrectPointsEqualToAlternatePoints.js +1 -1
  57. package/cypress/e2e/ILC/TextEntryMath/Scoring/allOrNothingCorrectPointsGreaterThanAlternatePoints.js +1 -1
  58. package/cypress/e2e/ILC/TextEntryMath/Scoring/partialDifferentWeightsAlternativePointsGreaterThanCorrectPoints.js +1 -1
  59. package/cypress/e2e/ILC/TextEntryMath/Scoring/partialDifferentWeightsCorrectPointsEqualToAlternativePoints.js +1 -1
  60. package/cypress/e2e/ILC/TextEntryMath/Scoring/partialDifferentWeightsCorrectPointsGreaterThanAlternativePoints.js +1 -1
  61. package/cypress/e2e/ILC/TextEntryMath/Scoring/partialDifferentWeightsScoringBasic.js +4 -4
  62. package/cypress/e2e/ILC/TextEntryMath/Scoring/partialEqualWeightsAlternativePointsGreaterThanCorrectPoints.js +1 -1
  63. package/cypress/e2e/ILC/TextEntryMath/Scoring/partialEqualWeightsCorrectPointsEqualToAlternativePoints.js +1 -1
  64. package/cypress/e2e/ILC/TextEntryMath/Scoring/partialEqualWeightsCorrectPointsGreaterThanAlternativePoints.js +1 -1
  65. package/cypress/e2e/ILC/TextEntryMath/Scoring/partialEqualWeightsScoringBasic.js +2 -2
  66. package/cypress/e2e/ILC/TextEntryMath/allOrNothingBasicForAllViews.smoke.js +3 -3
  67. package/cypress/e2e/ILC/TextEntryMath/editTabBasicSection.js +4 -4
  68. package/cypress/e2e/ILC/TextEntryMath/editTabScoringSection.js +6 -6
  69. package/cypress/e2e/ILC/TextEntryMath/evaluationMethodEquivalentStructures.js +5 -5
  70. package/cypress/e2e/ILC/TextEntryMath/evaluationMethodMatchExact.js +1 -1
  71. package/cypress/e2e/ILC/TextEntryMath/evaluationMethodMatchValue.js +1 -1
  72. package/cypress/e2e/ILC/TextEntryMath/evaluationMethodSymbolsAreEquivalent.js +1 -1
  73. package/cypress/e2e/ILC/TextEntryMath/evaluationMethodValueIsEquivalent.js +1 -1
  74. package/cypress/e2e/ILC/TextEntryMath/evaluationMethodsWithoutSetResponse.js +10 -10
  75. package/cypress/e2e/ILC/TextEntryMath/minimumScoringPenaltyPointsAndRoundingDropdown.js +3 -3
  76. package/cypress/e2e/ILC/TextEntryMath/previewContentsForAllViews.smoke.js +1 -1
  77. package/cypress/e2e/ILC/TextSelection/headerSection.js +5 -2
  78. package/cypress/e2e/ILC/TextSelection/questionInstructionsAndQuestion.js +2 -1
  79. package/cypress/e2e/ILC/ToolAudioPlayerNew/headerSection.js +2 -3
  80. package/cypress/e2e/ILC/UploadResponse/editTabBasicSection.js +2 -1
  81. package/cypress/fixtures/drawingToolbarOptionsAdditionalOptionsAndSpecialAndMathCharacters.js +2 -2
  82. package/cypress/pages/components/autoScoredSetCorrectAnswerSection.js +11 -0
  83. package/cypress/pages/components/autoScoredSpecifyCorrectAnswerSection.js +27 -9
  84. package/cypress/pages/components/fillInTheGapsDropdownCommonComponent.js +3 -2
  85. package/cypress/pages/components/fillInTheGapsTextCommonComponent.js +2 -1
  86. package/cypress/pages/components/optionsWrapperComponent.js +2 -2
  87. package/cypress/pages/components/scoringSectionBaseEditTab.js +2 -2
  88. package/cypress/pages/createItemPage.js +1 -1
  89. package/cypress/pages/dialogBoxBase.js +7 -13
  90. package/cypress/pages/dragAndDropIntoCategoriesPage.js +5 -4
  91. package/cypress/pages/graphingPage.js +7 -4
  92. package/cypress/pages/gridFillPage.js +16 -15
  93. package/cypress/pages/matchingPage.js +613 -6
  94. package/cypress/pages/multipleSelectionGridPage.js +5 -4
  95. package/cypress/pages/multipleSelectionPage.js +5 -4
  96. package/cypress/pages/numberLinePage.js +13 -2
  97. package/cypress/pages/shortTextResponsePage.js +3 -2
  98. package/cypress/pages/textEntryMathPage.js +7 -0
  99. package/package.json +1 -1
@@ -1,6 +1,6 @@
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, randomizeOptionsComponent, autoScoredScoringSectionMultiResponseType, allowMultipleInstancesOfSameDraggableOptionComponent, studentViewSettingsLabelComponent, ariaLabelSectionComponent, additionalSettingsAccessibilitySectionComponent, gradingViewEnumerationComponent, additionalSettingsPanel, toolSettingsComponent } 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, toolSettingsComponent, styleAndLayoutCustomizationAccordionComponent } from "./components";
4
4
  import { dialogBoxBase } from "./dialogBoxBase";
5
5
  const css = Cypress.env('css');
6
6
  const options = ['option 1', 'option 2', 'option 3'];
@@ -115,6 +115,71 @@ const selectors = {
115
115
  warningMessageContainer: () => cy.get('[class*="DropzoneLimitErrorMessagestyles__ErrorWrapper"]'),
116
116
  dropzoneColumnAndPromptHeaderWrapperPreviewTab: () => cy.get('.edit-question-preview-wrapper [class*="ClozeWithDragAndDropstyles__ResponseHeaderWrapper"]'),
117
117
  connectorIconPreviewTab: () => cy.get('.edit-question-preview-wrapper [class*="ClozeWithDragAndDropstyles__ShowIconWrapper"]'),
118
+
119
+ //Style and layout
120
+ optionRowContainerSpecifyCorrectAnswerSection: () => cy.get('.match-list-response-wrapper'),
121
+ optionRowContainerPreviewTab: () => cy.get('.match-list-response-container'),
122
+ layoutLabel: () => cy.get('[class*="Layoutstyles__SectionWrapper"]'),
123
+ rowSpacingDropdownLabel: () => cy.get('#Row-spacing-dropdown-label'),
124
+ rowSpacingDropdown: () => cy.get('[aria-labelledby*="Row-spacing-dropdown-label"]').eq(0),
125
+ rowSpacingDropdownOptions: (ariaLabel = null) => {
126
+ if (ariaLabel) {
127
+ return cy.get(`[aria-labelledby*="Row-spacing-dropdown-label"] .dropdown-menu-item[aria-label*="${ariaLabel}"]`)
128
+ } else {
129
+ return cy.get(`[aria-labelledby*="Row-spacing-dropdown-label"] .dropdown-menu-item`)
130
+ }
131
+ },
132
+ columnSpacingDropdownLabel: () => cy.get('#Column-spacing-dropdown-label'),
133
+ columnSpacingDropdown: () => cy.get('[aria-labelledby*="Column-spacing-dropdown-label"]').eq(0),
134
+ columnSpacingDropdownOptions: (ariaLabel = null) => {
135
+ if (ariaLabel) {
136
+ return cy.get(`[aria-labelledby*="Column-spacing-dropdown-label"] .dropdown-menu-item[aria-label*="${ariaLabel}"]`)
137
+ } else {
138
+ return cy.get(`[aria-labelledby*="Column-spacing-dropdown-label"] .dropdown-menu-item`)
139
+ }
140
+ },
141
+ dropzoneDimensionsLabel: () => cy.get('#Dropzone-dimensions-dropdown-label'),
142
+ dropzoneDimensionsDropdown: () => cy.get('#Dropzone-dimensions-select'),
143
+ dropzoneDimensionsDropdownOptions: (ariaLabel = null) => {
144
+ if (ariaLabel) {
145
+ return cy.get(`[aria-labelledby*="Dropzone-dimensions-dropdown-label"] .dropdown-menu-item[aria-label*="${ariaLabel}"]`)
146
+ } else {
147
+ return cy.get(`[aria-labelledby*="Dropzone-dimensions-dropdown-label"] .dropdown-menu-item`)
148
+ }
149
+ },
150
+ specifyForAllDropzoneColumnsLabel: () => cy.get('.ngie-radio-label[aria-label="Specify for all dropzone columns"]'),
151
+ specifyForAllDropzoneColumnsRadioButton: () => cy.get('[type="radio"][aria-label="Specify for all dropzone columns"]'),
152
+ specifyForFirstDropzoneColumnOnlyLabel: () => cy.get('.ngie-radio-label[aria-label="Specify for first dropzone column only"]'),
153
+ specifyForFirstDropzoneColumnOnlyRadioButton: () => cy.get('[type="radio"][aria-label="Specify for first dropzone column only"]'),
154
+ dropzoneWidthLabel: () => cy.get('.additional-settings-label[for*="width"]'),
155
+ dropzoneWidthInputField: () => cy.get('input[id*="width"]'),
156
+ dropzoneLabel: () => cy.get('[class*="Dropzonestyles__SectionWrapper"]'),
157
+ fillColorLabel: () => cy.get('.sub-section-label').eq(0),
158
+ borderColorLabel: () => cy.get('.sub-section-label').eq(1),
159
+ colorBlock: () => cy.get('.color-grid-wrapper .color-picker-block'),
160
+ editColorButton: () => cy.get('button[aria-label="edit color"]'),
161
+ colorBlockSelectedIcon: () => cy.get('[class*="BtnSelectionWrapper"] svg'),
162
+ dropzoneBorderStyleLabel: () => cy.get('.options-border-style .options-label').eq(0),
163
+ dropzoneBorderStyleOptions: (borderStyleOption) => cy.get('.options-border-style').eq(0).find(`.ngie-toggle-button-label-wrapper [aria-label*=${borderStyleOption}]`),
164
+ draggableOptionsBorderStyleLabel: () => cy.get('.options-border-style .options-label').eq(1),
165
+ draggableOptionsBorderStyleOptions: (borderStyleOption) => cy.get('.options-border-style').eq(1).find(`.ngie-toggle-button-label-wrapper [aria-label*=${borderStyleOption}]`),
166
+ draggableOptionsFillColorLabel: () => cy.get('.sub-section-label').eq(2),
167
+ draggableOptionsBorderColorLabel: () => cy.get('.sub-section-label').eq(3),
168
+ draggableOptionsLabel: () => cy.get('.draggable-options-label'),
169
+ dragHandleIconLabel: () => cy.get('[class*="__SubSectionLabel"]').eq(2),
170
+ dragHandle: () => cy.get('.draggable-item-wrapper [class*="drag"]'),
171
+ dragHandleOptions: () => cy.get('.drag-handle-icon-block'),
172
+ draggableOptionPanelPlacementLabel: () => cy.get('.draggable-option-panel-label'),
173
+ panelPlacementLabel: () => cy.get('.panel-placement-style .options-label'),
174
+ optionAlignmentInPanelLabel: () => cy.get('.option-alignment .options-label'),
175
+ panelPlacementOptions: (placementOption) => cy.get(`.panel-placement-style button[aria-label*="panel placement ${placementOption}"]`),
176
+ optionAlignmentInPanelOptions: (alignmentOption) => cy.get(`.option-alignment button[aria-label*="option alignment in panel ${alignmentOption}"]`),
177
+ optionsWrapper: () => cy.get('[class*="StandardDropZonestyles__DraggableItemsGrid"]'),
178
+ optionsWrapperPreviewTab: () => cy.get('.edit-question-preview-wrapper [class*="StandardDropZonestyles__DraggableItemsGrid"]'),
179
+ optionsPreviewTab: () => cy.get('[class*="CellDropZonestyles__DraggableItemWrapper"]'),
180
+ optionPanelWrapper: () => cy.get('.option-drag-and-drop'),
181
+ dropzoneCellSpecifyCorrectAnswerSection: () => cy.get('.correct-answer-accordion [class*="droppable-area"] .grading-style-with-enumeration'),
182
+ dropzoneCellPreviewTab: () => cy.get('.edit-question-preview-wrapper [class*="droppable-area"] .grading-style-with-enumeration')
118
183
  }
119
184
 
120
185
  const steps = {
@@ -139,6 +204,7 @@ const steps = {
139
204
  ...additionalSettingsPanel.steps,
140
205
  ...gradingViewEnumerationComponent.steps,
141
206
  ...ariaLabelSectionComponent.steps,
207
+ ...styleAndLayoutCustomizationAccordionComponent.steps,
142
208
 
143
209
  //Edit tab
144
210
  addPrompt: () => {
@@ -1629,7 +1695,545 @@ const steps = {
1629
1695
  default:
1630
1696
  throw new Error('Invalid option');
1631
1697
  }
1632
- }
1698
+ },
1699
+
1700
+ expandRowSpacingDropdown: () => {
1701
+ matchingPage.rowSpacingDropdown()
1702
+ .click();
1703
+ },
1704
+
1705
+ /**
1706
+ * This function selects row spacing option
1707
+ * @param {string} rowSpacingOption of the row spacing
1708
+ */
1709
+ selectRowSpacingDropdownOption: (rowSpacingOption) => {
1710
+ matchingPage.rowSpacingDropdownOptions(rowSpacingOption)
1711
+ .click();
1712
+ },
1713
+
1714
+ /**
1715
+ * This function verified the selected state of row spacing option
1716
+ * @param {string} rowSpacingOption of the row spacing
1717
+ */
1718
+ verifyRowSpacingOptionSelected: (rowSpacingOption) => {
1719
+ matchingPage.rowSpacingDropdownOptions(rowSpacingOption)
1720
+ .should('have.attr', 'aria-selected', 'true');
1721
+ },
1722
+
1723
+ /**
1724
+ * This function verifies the row spacing
1725
+ * @param {("Normal"|"Small"|"Wide")} spacing of the rows
1726
+ */
1727
+ verifyRowSpacingSpecifyCorrectAnswerSection: (spacing) => {
1728
+ switch (spacing) {
1729
+ case 'Normal':
1730
+ matchingPage.optionRowContainerSpecifyCorrectAnswerSection()
1731
+ .eq(0)
1732
+ .should('have.css', 'margin-bottom', '24px');
1733
+ break;
1734
+ case 'Small':
1735
+ matchingPage.optionRowContainerSpecifyCorrectAnswerSection()
1736
+ .eq(0)
1737
+ .should('have.css', 'margin-bottom', '16px');
1738
+ break;
1739
+ case 'Wide':
1740
+ matchingPage.optionRowContainerSpecifyCorrectAnswerSection()
1741
+ .eq(0)
1742
+ .should('have.css', 'margin-bottom', '32px');
1743
+ break;
1744
+ default:
1745
+ throw new Error(`Unsupported spacing option: ${spacing}`);
1746
+ }
1747
+ },
1748
+
1749
+ expandColumnSpacingDropdown: () => {
1750
+ matchingPage.columnSpacingDropdown()
1751
+ .click();
1752
+ },
1753
+
1754
+ /**
1755
+ * This function verified the selected state of row spacing option
1756
+ * @param {string} rowSpacingOption of the row spacing
1757
+ */
1758
+ verifyColumnSpacingOptionSelected: (rowSpacingOption) => {
1759
+ matchingPage.columnSpacingDropdownOptions(rowSpacingOption)
1760
+ .should('have.attr', 'aria-selected', 'true');
1761
+ },
1762
+
1763
+ /**
1764
+ * This function selects row spacing option
1765
+ * @param {string} rowSpacingOption of the row spacing
1766
+ */
1767
+ selectColumnSpacingDropdownOption: (rowSpacingOption) => {
1768
+ matchingPage.columnSpacingDropdownOptions(rowSpacingOption)
1769
+ .click();
1770
+ },
1771
+
1772
+ /**
1773
+ * This function verifies the row spacing
1774
+ * @param {("Normal"|"Small"|"Wide")} spacing of the rows
1775
+ */
1776
+ verifyColumnSpacingSpecifyCorrectAnswerSection: (spacing) => {
1777
+ switch (spacing) {
1778
+ case 'Normal':
1779
+ matchingPage.connectorIcon()
1780
+ .each(($el) => {
1781
+ cy.wrap($el)
1782
+ .should('have.css', 'width', '32px');
1783
+ });
1784
+ break;
1785
+ case 'Small':
1786
+ matchingPage.connectorIcon()
1787
+ .each(($el) => {
1788
+ cy.wrap($el)
1789
+ .should('have.css', 'width', '24px');
1790
+ });
1791
+ break;
1792
+ case 'Wide':
1793
+ matchingPage.connectorIcon()
1794
+ .each(($el) => {
1795
+ cy.wrap($el)
1796
+ .should('have.css', 'width', '48px');
1797
+ });
1798
+ break;
1799
+ default:
1800
+ throw new Error(`Unsupported spacing option: ${spacing}`);
1801
+ }
1802
+ },
1803
+
1804
+ /**
1805
+ * This function verifies the row spacing
1806
+ * @param {("Normal"|"Small"|"Wide")} spacing of the rows
1807
+ */
1808
+ verifyRowSpacingPreviewTab: (spacing) => {
1809
+ switch (spacing) {
1810
+ case 'Normal':
1811
+ matchingPage.optionRowContainerPreviewTab()
1812
+ .eq(0)
1813
+ .should('have.css', 'margin-bottom', '24px');
1814
+ break;
1815
+ case 'Small':
1816
+ matchingPage.optionRowContainerPreviewTab()
1817
+ .eq(0)
1818
+ .should('have.css', 'margin-bottom', '16px');
1819
+ break;
1820
+ case 'Wide':
1821
+ matchingPage.optionRowContainerPreviewTab()
1822
+ .eq(0)
1823
+ .should('have.css', 'margin-bottom', '32px');
1824
+ break;
1825
+ default:
1826
+ throw new Error(`Unsupported spacing option: ${spacing}`);
1827
+ }
1828
+ },
1829
+
1830
+ /**
1831
+ * This function verifies the row spacing
1832
+ * @param {("Normal"|"Small"|"Wide")} spacing of the rows
1833
+ */
1834
+ verifyColumnSpacingPreviewTab: (spacing) => {
1835
+ switch (spacing) {
1836
+ case 'Normal':
1837
+ matchingPage.connectorIconPreviewTab()
1838
+ .each(($el) => {
1839
+ cy.wrap($el)
1840
+ .should('have.css', 'width', '32px');
1841
+ });
1842
+ break;
1843
+ case 'Small':
1844
+ matchingPage.connectorIconPreviewTab()
1845
+ .each(($el) => {
1846
+ cy.wrap($el)
1847
+ .should('have.css', 'width', '24px');
1848
+ });
1849
+ break;
1850
+ case 'Wide':
1851
+ matchingPage.connectorIconPreviewTab()
1852
+ .each(($el) => {
1853
+ cy.wrap($el)
1854
+ .should('have.css', 'width', '48px');
1855
+ });
1856
+ break;
1857
+ default:
1858
+ throw new Error(`Unsupported spacing option: ${spacing}`);
1859
+ }
1860
+ },
1861
+
1862
+ expandDropzoneDimensionsDropdown: () => {
1863
+ matchingPage.dropzoneDimensionsDropdown()
1864
+ .click();
1865
+ },
1866
+
1867
+ /**
1868
+ * This function verified the selected state of column dimension dropdown
1869
+ * @param {string} dropzoneDimensionsOption of the column dimension dropdown
1870
+ */
1871
+ verifyDropzoneDimensionsDropdownOptionSelected: (dropzoneDimensionsOption) => {
1872
+ matchingPage.dropzoneDimensionsDropdownOptions(dropzoneDimensionsOption)
1873
+ .should('have.attr', 'aria-selected', 'true');
1874
+ },
1875
+
1876
+ /**
1877
+ * This function verified the selected state of column dimension dropdown
1878
+ * @param {string} dropzoneDimensionsOption of the column dimension dropdown
1879
+ */
1880
+ selectDropzoneDimensionsDropdownOption: (dropzoneDimensionsOption) => {
1881
+ matchingPage.dropzoneDimensionsDropdownOptions(dropzoneDimensionsOption)
1882
+ .click();
1883
+ },
1884
+
1885
+ /**
1886
+ * This function verifies the dimension of the column
1887
+ * @param {("Auto"|"Custom")} dimension of the column
1888
+ */
1889
+ verifyDropzoneDimensionsSpecifyCorrectAnswer: (dimension) => {
1890
+ switch (dimension) {
1891
+ case 'Auto':
1892
+ matchingPage.dropzoneCellSpecifyCorrectAnswerSection()
1893
+ .each(($el) => {
1894
+ cy.wrap($el)
1895
+ .invoke('css', 'width')
1896
+ .then((width) => {
1897
+ const actualWidth = parseFloat(width);
1898
+ expect(actualWidth).to.not.be.closeTo(225, 1);
1899
+ });
1900
+ });
1901
+ break;
1902
+ case 'Custom':
1903
+ matchingPage.dropzoneCellSpecifyCorrectAnswerSection()
1904
+ .each(($el) => {
1905
+ cy.wrap($el)
1906
+ .invoke('css', 'width')
1907
+ .then((width) => {
1908
+ const actualWidth = parseFloat(width);
1909
+ expect(actualWidth).to.be.closeTo(225, 1);
1910
+ });
1911
+ });
1912
+ break;
1913
+ default:
1914
+ throw new Error(`Unsupported spacing option: ${dimension}`);
1915
+ }
1916
+ },
1917
+
1918
+
1919
+ /**
1920
+ * This function verifies selected state of radio button
1921
+ * @param {("Specify for all columns"|"Specify for first column only")} radioButton in custom dimensions section
1922
+ */
1923
+ verifyCustomDimensionsRadioButtonSelected: (radioButton) => {
1924
+ switch (radioButton) {
1925
+ case 'Specify for all dropzone columns':
1926
+ matchingPage.specifyForAllDropzoneColumnsRadioButton()
1927
+ .should('be.checked');
1928
+ break;
1929
+ case 'Specify for first dropzone column only':
1930
+ matchingPage.specifyForFirstDropzoneColumnOnlyRadioButton()
1931
+ .should('be.checked');
1932
+ break;
1933
+ default:
1934
+ throw new Error(`Unsupported dimension option: ${radioButton}`);
1935
+ }
1936
+ },
1937
+
1938
+ /**
1939
+ * Verifies the value of the width input field for a specified dropzone.
1940
+ * @param {number} index - The index of the dropzone to check.
1941
+ * @param {string} width - The expected width value in the input field.
1942
+ */
1943
+ verifyDropzoneWidthInputField: (index, width) => {
1944
+ matchingPage.dropzoneWidthInputField()
1945
+ .eq(index)
1946
+ .should('have.value', width);
1947
+ },
1948
+
1949
+ /**
1950
+ * Enters text into the width input field for a specified dropzone.
1951
+ * @param {number} index - The index of the dropzone to modify.
1952
+ * @param {string} width - The width value to enter into the input field.
1953
+ */
1954
+ enterTextInDropzoneWidthInputField: (index, width) => {
1955
+ matchingPage.dropzoneWidthInputField()
1956
+ .eq(index)
1957
+ .clear()
1958
+ .type(width);
1959
+ matchingPage.dropzoneWidthInputField()
1960
+ .eq(index)
1961
+ .click();
1962
+ cy.wait(2000);
1963
+ matchingPage.dropzoneWidthInputField()
1964
+ .eq(index)
1965
+ .blur();
1966
+ },
1967
+
1968
+ /**
1969
+ * Verifies the width of a specified dropzone in the "Specify Correct Answer" section.
1970
+ * @param {number} index - The index of the dropzone to check.
1971
+ * @param {number} expectedWidth - The expected width of the dropzone.
1972
+ */
1973
+ verifyDropzoneWidthSpecifyCorrectAnswer: (index, expectedWidth) => {
1974
+ matchingPage.dropzoneCellSpecifyCorrectAnswerSection()
1975
+ .eq(index)
1976
+ .invoke('css', 'width')
1977
+ .then((width) => {
1978
+ const actualWidth = parseFloat(width);
1979
+ expect(actualWidth).to.be.closeTo(expectedWidth, 1);
1980
+ });
1981
+ },
1982
+
1983
+ /**
1984
+ * Verifies that a specified dropzone does not have a specific width in the "Specify Correct Answer" section.
1985
+ * @param {number} index - The index of the dropzone to check.
1986
+ * @param {number} expectedWidth - The width that the dropzone should not have.
1987
+ */
1988
+ verifyDropzoneDoeNotHaveSpecifiedWidthSpecifyCorrectAnswer: (index, expectedWidth) => {
1989
+ matchingPage.dropzoneCellSpecifyCorrectAnswerSection()
1990
+ .eq(index)
1991
+ .invoke('css', 'width')
1992
+ .then((width) => {
1993
+ const actualWidth = parseFloat(width);
1994
+ expect(actualWidth).to.not.be.closeTo(expectedWidth, 1);
1995
+ });
1996
+ },
1997
+
1998
+ /**
1999
+ * This function verifies the dimension of the column
2000
+ * @param {("Auto"|"Custom")} dimension of the column
2001
+ */
2002
+ verifyDropzoneDimensionsPreviewTab: (dimension) => {
2003
+ switch (dimension) {
2004
+ case 'Auto':
2005
+ matchingPage.dropzoneCellPreviewTab()
2006
+ .each(($el) => {
2007
+ cy.wrap($el)
2008
+ .invoke('css', 'width')
2009
+ .then((width) => {
2010
+ const actualWidth = parseFloat(width);
2011
+ expect(actualWidth).to.not.be.closeTo(225, 1);
2012
+ });
2013
+ });
2014
+ break;
2015
+ case 'Custom':
2016
+ matchingPage.dropzoneCellPreviewTab()
2017
+ .each(($el) => {
2018
+ cy.wrap($el)
2019
+ .invoke('css', 'width')
2020
+ .then((width) => {
2021
+ const actualWidth = parseFloat(width);
2022
+ expect(actualWidth).to.be.closeTo(225, 1);
2023
+ });
2024
+ });
2025
+ break;
2026
+ default:
2027
+ throw new Error(`Unsupported spacing option: ${dimension}`);
2028
+ }
2029
+ },
2030
+
2031
+ /**
2032
+ * Verifies the width of a specified dropzone in the preview tab.
2033
+ * @param {number} index - The index of the dropzone to check.
2034
+ * @param {number} expectedWidth - The expected width of the dropzone.
2035
+ */
2036
+ verifyDropzoneWidthPreviewTab: (index, expectedWidth) => {
2037
+ matchingPage.dropzoneCellPreviewTab()
2038
+ .eq(index)
2039
+ .invoke('css', 'width')
2040
+ .then((width) => {
2041
+ const actualWidth = parseFloat(width);
2042
+ expect(actualWidth).to.be.closeTo(expectedWidth, 1);
2043
+ });
2044
+ },
2045
+
2046
+ /**
2047
+ * This function verifies selected state of radio button
2048
+ * @param {{"Specify for all columns"|"Specify for first column only"}} radioButton in custom dimensions section
2049
+ */
2050
+ selectCustomDimensionsRadioButton: (radioButton) => {
2051
+ switch (radioButton) {
2052
+ case 'Specify for all dropzone columns':
2053
+ matchingPage.specifyForAllDropzoneColumnsRadioButton()
2054
+ .click()
2055
+ .should('be.checked');
2056
+ break;
2057
+ case 'Specify for first dropzone column only':
2058
+ matchingPage.specifyForFirstDropzoneColumnOnlyRadioButton()
2059
+ .click()
2060
+ .should('be.checked');
2061
+ break;
2062
+ default:
2063
+ throw new Error(`Unsupported dimension option: ${radioButton}`);
2064
+ }
2065
+ },
2066
+
2067
+ /**
2068
+ * Verifies that a specified dropzone does not have a specific width in the preview tab.
2069
+ * @param {number} index - The index of the dropzone to check.
2070
+ * @param {number} expectedWidth - The width that the dropzone should not have.
2071
+ */
2072
+ verifyDropzoneDoeNotHaveSpecifiedWidthPreviewTab: (index, expectedWidth) => {
2073
+ matchingPage.dropzoneCellPreviewTab()
2074
+ .eq(index)
2075
+ .invoke('css', 'width')
2076
+ .then((width) => {
2077
+ const actualWidth = parseFloat(width);
2078
+ expect(actualWidth).to.not.be.closeTo(expectedWidth, 1);
2079
+ });
2080
+ },
2081
+
2082
+ /**
2083
+ * Verifies the color of a color block.
2084
+ * @param {number} blockIndex - The index of the color block.
2085
+ * @param {string} color - The expected background color of the color block.
2086
+ */
2087
+ verifyColorBlockColor: (blockIndex, color) => {
2088
+ utilities.verifyCSS(utilities.getNthElement(matchingPage.colorBlock(), blockIndex), {
2089
+ 'background-color': color
2090
+ });
2091
+ },
2092
+
2093
+ /**
2094
+ * @param {number} blockIndex index of the color block in the style and layout customization section
2095
+ * @description this function verifies the selected state of a block
2096
+ */
2097
+ verifyColorBlockSelectedState: (blockIndex) => {
2098
+ utilities.getNthElement(matchingPage.colorBlock(), blockIndex)
2099
+ .should('have.class', 'selected-button-icon')
2100
+ .within(() => {
2101
+ utilities.verifyElementVisibilityState(matchingPage.colorBlockSelectedIcon(), 'visible');
2102
+ });
2103
+ },
2104
+
2105
+ /**
2106
+ * Verifies the background color of grid
2107
+ * @param {string} colorValue - The expected background color value.
2108
+ */
2109
+ verifyFillColorSpecifyCorrectAnswerSection: (colorValue) => {
2110
+ utilities.verifyCSS(matchingPage.dropzoneCellSpecifyCorrectAnswerSection(), {
2111
+ 'background-color': colorValue
2112
+ });
2113
+ },
2114
+
2115
+ /**
2116
+ * Verifies the background color of grid
2117
+ * @param {string} colorValue - The expected background color value.
2118
+ */
2119
+ verifyFillColorPreviewTab: (colorValue) => {
2120
+ utilities.verifyCSS(matchingPage.dropzoneCellPreviewTab(), {
2121
+ 'background-color': colorValue
2122
+ });
2123
+ },
2124
+
2125
+ /**
2126
+ * Selects a color block by index.
2127
+ * @param {number} blockIndex - The index of the color block to select.
2128
+ */
2129
+ selectColorBlock: (blockIndex) => {
2130
+ utilities.getNthElement(matchingPage.colorBlock(), blockIndex)
2131
+ .click();
2132
+ },
2133
+
2134
+ /**
2135
+ * Clicks on the edit color button.
2136
+ * @param {number} buttonIndex - The index of the edit color button.
2137
+ */
2138
+ editColor: (buttonIndex) => {
2139
+ utilities.getNthElement(matchingPage.editColorButton(), buttonIndex)
2140
+ .click();
2141
+ },
2142
+
2143
+ /**
2144
+ * Verifies the border color of grid
2145
+ * @param {string} colorValue - The expected border color value.
2146
+ */
2147
+ verifyBorderColorSpecifyCorrectAnswer: (colorValue) => {
2148
+ utilities.verifyCSS(matchingPage.dropzoneCellSpecifyCorrectAnswerSection(), {
2149
+ 'border-left-color': colorValue
2150
+ });
2151
+ },
2152
+
2153
+ /**
2154
+ * Verifies the border color of grid
2155
+ * @param {string} colorValue - The expected border color value.
2156
+ */
2157
+ verifyBorderColorPreviewTab: (colorValue) => {
2158
+ utilities.verifyCSS(matchingPage.dropzoneCellPreviewTab(), {
2159
+ 'border-left-color': colorValue
2160
+ });
2161
+ },
2162
+
2163
+ /**
2164
+ * Verifies the border style of the dropzone in the "Specify Correct Answer" section.
2165
+ * @param {string} borderStyle - The expected border style.
2166
+ */
2167
+ verifyDropzoneBorderStyleSpecifyCorrectAnswer: (borderStyle) => {
2168
+ matchingPage.dropzoneCellSpecifyCorrectAnswerSection()
2169
+ .should('have.css', 'border-left-style', borderStyle);
2170
+ },
2171
+
2172
+ /**
2173
+ * Verifies the border style of the dropzone in the preview tab.
2174
+ * @param {string} borderStyle - The expected border style.
2175
+ */
2176
+ verifyDropzoneBorderStylePreviewTab: (borderStyle) => {
2177
+ matchingPage.dropzoneCellPreviewTab()
2178
+ .should('have.css', 'border-left-style', borderStyle);
2179
+ },
2180
+
2181
+ /**
2182
+ * Verifies that the specified dropzone border style option is selected.
2183
+ * @param {string} borderStyleOption - The border style option to verify.
2184
+ */
2185
+ verifyDropzoneBorderStyleSelected: (borderStyleOption) => {
2186
+ matchingPage.dropzoneBorderStyleOptions(borderStyleOption.toLowerCase())
2187
+ .should('have.attr', 'aria-pressed', 'true');
2188
+ },
2189
+
2190
+ /**
2191
+ * Selects a dropzone border style option.
2192
+ * @param {string} borderStyleOption - The border style option to select.
2193
+ */
2194
+ selectDropzoneBorderStyleOption: (borderStyleOption) => {
2195
+ matchingPage.dropzoneBorderStyleOptions(borderStyleOption.toLowerCase())
2196
+ .click();
2197
+ },
2198
+
2199
+ /**
2200
+ * Verifies the border style of the draggable options in the "Specify Correct Answer" section.
2201
+ * @param {string} borderStyle - The expected border style.
2202
+ */
2203
+ verifyDraggableOptionsBorderStyleSpecifyCorrectAnswer: (borderStyle) => {
2204
+ draggableOptionContainer.draggableOption()
2205
+ .should('have.css', 'border-top-style', borderStyle);
2206
+ },
2207
+
2208
+ /**
2209
+ * Selects a draggable options border style option.
2210
+ * @param {string} borderStyleOption - The border style option to select.
2211
+ */
2212
+ selectDraggableOptionsBorderStyleOption: (borderStyleOption) => {
2213
+ matchingPage.draggableOptionsBorderStyleOptions(borderStyleOption.toLowerCase())
2214
+ .click();
2215
+ },
2216
+
2217
+ /**
2218
+ * Verifies that the specified draggable options border style option is selected.
2219
+ * @param {string} borderStyleOption - The border style option to verify.
2220
+ */
2221
+ verifyDraggableOptionsBorderStyleSelected: (borderStyleOption) => {
2222
+ matchingPage.draggableOptionsBorderStyleOptions(borderStyleOption.toLowerCase())
2223
+ .should('have.attr', 'aria-pressed', 'true');
2224
+ },
2225
+
2226
+ /**
2227
+ * Verifies the border style of the draggable options in the preview tab.
2228
+ * @param {string} borderStyle - The expected border style.
2229
+ */
2230
+ verifyDraggableOptionsBorderStylePreviewTab: (borderStyle) => {
2231
+ matchingPage.optionsContainerPreviewTab()
2232
+ .within(() => {
2233
+ draggableOptionContainer.draggableOption()
2234
+ .should('have.css', 'border-top-style', borderStyle);
2235
+ });
2236
+ },
1633
2237
  }
1634
2238
 
1635
2239
  const tests = {
@@ -1652,6 +2256,7 @@ const tests = {
1652
2256
  ...allowMultipleInstancesOfSameDraggableOptionComponent.tests,
1653
2257
  ...autoScoredStudentViewSettings.tests,
1654
2258
  ...questionInstructionsComponent.tests,
2259
+ ...styleAndLayoutCustomizationAccordionComponent.tests,
1655
2260
 
1656
2261
  verifyContentsOfSpecifyCorrectAnswerSection: () => {
1657
2262
  it('When user selects a scoring type then in the \'Correct\' accordion, all the contents should be displayed', () => {
@@ -2041,22 +2646,24 @@ const tests = {
2041
2646
  matchingPage.steps.clickAndDropOptionInDropzoneSpecifyCorrectAnswerSection([{ optionText: 'Petals', dropzoneIndex: 0 }]);
2042
2647
  });
2043
2648
 
2044
- it(`When the user has removed all the options from the dropzone in the ${accordionName} accordion, should not be thrown any error in \'${accordionName}\' accordion`, () => {
2649
+ it(`When the user has removed all the options from the dropzone in the ${accordionName} accordion, \'Error: Please set a correct answer.\' error message should be thrown along with an error icon on the \'${accordionName}\' accordion`, () => {
2045
2650
  matchingPage.steps.clickAndDropOptionInOptionsContainerInSpecifyCorrectAnswerSection('Petals');
2046
- commonComponents.steps.verifyErrorMessageIsNotDisplayed();
2651
+ utilities.verifyElementVisibilityState(commonComponents.errorMessage(), 'visible')
2652
+ utilities.verifyInnerText(commonComponents.errorMessage(), 'Error: Please set a correct answer.');
2047
2653
  if (accordionName == 'Correct') {
2048
2654
  autoScoredSpecifyCorrectAnswerSection.correctAnswerAccordion()
2049
2655
  .within(() => {
2050
- utilities.verifyElementVisibilityState(autoScoredSpecifyCorrectAnswerSection.specifyCorrectAnswerErrorIcon(), 'notExist');
2656
+ utilities.verifyElementVisibilityState(autoScoredSpecifyCorrectAnswerSection.specifyCorrectAnswerErrorIcon(), 'visible');
2051
2657
  });
2052
2658
  } else {
2053
2659
  autoScoredSpecifyCorrectAnswerSection.alternativeAnswerAccordion()
2054
2660
  .within(() => {
2055
- utilities.verifyElementVisibilityState(autoScoredSpecifyCorrectAnswerSection.specifyCorrectAnswerErrorIcon(), 'notExist');
2661
+ utilities.verifyElementVisibilityState(autoScoredSpecifyCorrectAnswerSection.specifyCorrectAnswerErrorIcon(), 'visible');
2056
2662
  });
2057
2663
  };
2058
2664
  });
2059
2665
 
2666
+ autoScoredSpecifyCorrectAnswerSection.tests.verifyAutoScoredCorrectAnswerErrorMessageCSSAndA11y();
2060
2667
 
2061
2668
  it('CSS of the dropzone border', { tags: 'css' }, () => {
2062
2669
  utilities.verifyCSS(matchingPage.dropzoneSpecifyCorrectAnswerSection().eq(0), {