itemengine-cypress-automation 1.0.205-8thJuneFixes-5ad148f.0 → 1.0.206-12thJuneFixesAndRepoUpdate-5fe2304.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (107) hide show
  1. package/cypress/e2e/ILC/AudioPlayerNew/audioOverviewAndTranscript.js +2 -2
  2. package/cypress/e2e/ILC/ChartsBar/Scoring/addAndDeleteBarAllOrNothingScoring.js +302 -0
  3. package/cypress/e2e/ILC/ChartsBar/Scoring/manuallyAndNonScored.js +282 -0
  4. package/cypress/e2e/ILC/ChartsBar/Scoring/partialDifferentWeightsAlternativePointsGreaterThanCorrectPoints.js +385 -0
  5. package/cypress/e2e/ILC/ChartsBar/Scoring/partialDifferentWeightsCorrectPointsEqualToAlternativePoints.js +386 -0
  6. package/cypress/e2e/ILC/ChartsBar/Scoring/partialDifferentWeightsCorrectPointsGreaterThanAlternativePoints.js +386 -0
  7. package/cypress/e2e/ILC/ChartsBar/Scoring/partialDifferentWeightsMinimumAndPenaltyScoring.js +337 -0
  8. package/cypress/e2e/ILC/ChartsBar/Scoring/partialEqualWeightsCorrectPointsGreaterThanAlternativePoints.js +0 -1
  9. package/cypress/e2e/ILC/ChartsBar/chartFunctionalitySpecifyCorrectAnswerSection.js +258 -0
  10. package/cypress/e2e/ILC/ChartsBar/checkAnswerFunctionalityForAllViews.smoke.js +1 -1
  11. package/cypress/e2e/ILC/ChartsBar/gridSettings.js +439 -0
  12. package/cypress/e2e/ILC/ChartsBar/headerSection.js +105 -0
  13. package/cypress/e2e/ILC/ChartsBar/labelOptionsSection.js +450 -0
  14. package/cypress/e2e/ILC/ChartsBar/specifyCorrectAnswerSection.js +91 -0
  15. package/cypress/e2e/ILC/ChartsBar/toolSettings.js +73 -0
  16. package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/Scoring/manuallyAndNonScoredScoring.js +1 -1
  17. package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/Scoring/perDropzoneAlternativePointsGreaterThanCorrectPoints.js +3 -2
  18. package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/Scoring/perDropzoneCorrectPointsEqualToAlternativePoints.js +1 -1
  19. package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/Scoring/perDropzoneCorrectPointsGreaterThanAlternativePoints.js +1 -1
  20. package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/Scoring/perDropzoneMinimumAndPenaltyScoring.js +6 -6
  21. package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/additionalSettings.js +169 -0
  22. package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/editTabBasicSection.js +1 -1
  23. package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/styleAndLayoutCustomizationDraggableOptionProperties.js +223 -0
  24. package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/styleAndLayoutCustomizationDraggableOptionsPanel.js +119 -0
  25. package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/styleAndLayoutCustomizationDropzoneBorderStyleProperties.js +113 -0
  26. package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/styleAndLayoutCustomizationDropzoneProperties.js +251 -0
  27. package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/styleAndLayoutCustomizationLayoutProperties.js +277 -0
  28. package/cypress/e2e/ILC/EssayResponse/essayResponseCustomizeFormattingOptions1.smoke.js +0 -2
  29. package/cypress/e2e/ILC/EssayResponse/previewHyperlink.js +1 -5
  30. package/cypress/e2e/ILC/FeedbackScaleNew/editTabBasicSection.js +1 -0
  31. package/cypress/e2e/ILC/FillInTheGapsDropdownNew/editTabBasicSection.js +4 -4
  32. package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/dropdownOptionsSection.js +1 -0
  33. package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/editTabBasicSection.js +14 -1
  34. package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/styleAndLayoutCutomization.js +378 -0
  35. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/Scoring/partialDifferentWeightsAlternativePointsGreaterThanCorrectPoints.js +3 -3
  36. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/specifyCorrectAnswerSection.js +3 -1
  37. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/styleAndLayoutCustomization.js +479 -0
  38. package/cypress/e2e/ILC/GridFill/allOrNothingBasicForAllViews.smoke.js +3 -1
  39. package/cypress/e2e/ILC/GridFill/scoring/partialEqualWeightsCellShadeCountBasics.js +7 -7
  40. package/cypress/e2e/ILC/ListOrderingDropdown/Scoring/allOrNothingPenaltyScoring.js +1 -0
  41. package/cypress/e2e/ILC/ListOrderingDropdown/Scoring/manuallyAndNonScored.js +1 -0
  42. package/cypress/e2e/ILC/ListOrderingDropdown/Scoring/partialEqualWeightsAlternativePointsGreaterThanCorrectPoints.js +2 -2
  43. package/cypress/e2e/ILC/ListOrderingDropdown/Scoring/partialEqualWeightsCorrectPointsGreaterThanAlternativePoints.js +2 -3
  44. package/cypress/e2e/ILC/ListOrderingDropdown/minimumScoringPenaltyPointsAndRoundingDropdown.js +7 -7
  45. package/cypress/e2e/ILC/ListOrderingDropdown/studentViewSettings.js +1 -1
  46. package/cypress/e2e/ILC/ListOrderingNew/HorizontalOrientation/partialDifferentWeightsCorrectPointsGreaterThanAlternativePoints.js +3 -4
  47. package/cypress/e2e/ILC/ListOrderingNew/minimumScoringPenaltyPointsAndRoundingDropdown.js +10 -9
  48. package/cypress/e2e/ILC/Matching/toolSettings.js +1 -0
  49. package/cypress/e2e/ILC/MultipleSelection/additionalSettings.js +1 -0
  50. package/cypress/e2e/ILC/MultipleSelection/allOrNothingBasicForAllViews.smoke.js +36 -16
  51. package/cypress/e2e/ILC/MultipleSelection/allOrNothingWithAlternativeAnswer.js +326 -176
  52. package/cypress/e2e/ILC/MultipleSelection/blockCreateItem.js +2 -2
  53. package/cypress/e2e/ILC/MultipleSelection/manuallyAndNonScoredScoring.js +37 -15
  54. package/cypress/e2e/ILC/MultipleSelection/partialDifferentWeightsBasic.js +38 -17
  55. package/cypress/e2e/ILC/MultipleSelection/partialDifferentWeightsWithAlternativeAnswer.js +441 -186
  56. package/cypress/e2e/ILC/MultipleSelection/partialEqualWeightsBasic.js +33 -14
  57. package/cypress/e2e/ILC/MultipleSelection/partialEqualWeightsWithAlternativeAnswer.js +330 -164
  58. package/cypress/e2e/ILC/MultipleSelectionGridNew/Scoring/manuallyAndNonScored.js +1 -1
  59. package/cypress/e2e/ILC/MultipleSelectionGridNew/Scoring/partialDifferentWeightsAlternativePointsGreaterThanCorrectPoints.js +1 -1
  60. package/cypress/e2e/ILC/ShortTextResponseNew/manuallyAndNonScoredScoring.js +4 -4
  61. package/cypress/e2e/ILC/SingleSelection/allOrNothingBasicForAllViews.smoke.js +20 -7
  62. package/cypress/e2e/ILC/SingleSelection/allOrNothingWithAlternativeAnswer.js +83 -66
  63. package/cypress/e2e/ILC/SingleSelection/blockCreateItem.js +2 -2
  64. package/cypress/e2e/ILC/SingleSelection/manuallyAndNonScoredScoring.js +25 -17
  65. package/cypress/e2e/ILC/SingleSelection/trueOrFalseCreateItem.js +2 -2
  66. package/cypress/e2e/ILC/SingleSelectionGridNew/additionalSettings.js +89 -0
  67. package/cypress/e2e/ILC/SingleSelectionGridNew/editTabBasicSection.js +3 -3
  68. package/cypress/e2e/ILC/TextEntryMath/evaluationMethodEquivalentStructures.js +2 -2
  69. package/cypress/e2e/ILC/TextEntryMath/evaluationMethodValueIsEquivalent.js +2 -2
  70. package/cypress/e2e/ILC/TextEntryMathWithImage/backgroundImageAndCanvasProperties.js +2 -2
  71. package/cypress/e2e/ILC/VideoResponseNew/studentViewSettingsCompactRecorderStyle.js +0 -2
  72. package/cypress/e2e/ILC/chartsDotsPlot/allOrNothingForAllViews.smoke.js +2 -2
  73. package/cypress/e2e/ILC/chartsDotsPlot/scoring/allOrNothingPenaltyScoring.js +1 -1
  74. package/cypress/e2e/ILC/chartsDotsPlot/scoring/partialDifferentWeightsBasic.js +15 -15
  75. package/cypress/e2e/ILC/chartsDotsPlot/scoring/partialDifferentWeightsWithAlternativePointsGreaterThanCorrectPoints.js +21 -21
  76. package/cypress/e2e/ILC/chartsDotsPlot/scoring/partialDifferentWeightsWithCorrectPointsEqualToAlternativePoints.js +17 -17
  77. package/cypress/e2e/ILC/chartsDotsPlot/scoring/partialDifferentWeightsWithCorrectPointsGreaterThanAlternativePoints.js +21 -21
  78. package/cypress/e2e/ILC/chartsDotsPlot/scoring/toleranceThresholdScoring.js +1 -1
  79. package/cypress/e2e/ILC/chartsDotsPlot/selectChartTypeSection.js +8 -4
  80. package/cypress/e2e/ILC/chartsDotsPlot/toolSettings.js +0 -1
  81. package/cypress/fixtures/drawingToolbarOptionsAdditionalOptionsAndSpecialAndMathCharacters.js +2 -2
  82. package/cypress/pages/audioResponsePage.js +1 -1
  83. package/cypress/pages/chartsBarPage.js +785 -5
  84. package/cypress/pages/components/autoScoredScoringSectionMultiResponseType.js +1 -0
  85. package/cypress/pages/components/backgroundImageUploadComponent.js +1 -1
  86. package/cypress/pages/components/barAndLineChartComponent.js +180 -9
  87. package/cypress/pages/components/chartsCommonComponent.js +1 -0
  88. package/cypress/pages/components/connectorStyleStyleAndLayoutCustomizationComponent.js +77 -0
  89. package/cypress/pages/components/essayResponseCommonComponents.js +2 -3
  90. package/cypress/pages/components/figCommonStyleAndLayoutComponent.js +1 -1
  91. package/cypress/pages/components/fillInTheGapsDropdownCommonComponent.js +24 -7
  92. package/cypress/pages/components/fillInTheGapsTextCommonComponent.js +8 -4
  93. package/cypress/pages/components/gridQuestionCommonComponent.js +1 -1
  94. package/cypress/pages/components/imageCanvasComponent.js +112 -2
  95. package/cypress/pages/components/index.js +1 -0
  96. package/cypress/pages/components/layoutSectionComponent.js +4 -3
  97. package/cypress/pages/dragAndDropIntoCategoriesPage.js +960 -3
  98. package/cypress/pages/drawingResponsePage.js +2 -2
  99. package/cypress/pages/fillInTheGapsDragAndDropPage.js +4 -3
  100. package/cypress/pages/fillInTheGapsOverImageDropdownPage.js +18 -3
  101. package/cypress/pages/fillInTheGapsOverImageTextPage.js +65 -3
  102. package/cypress/pages/listOrderingPage.js +3 -3
  103. package/cypress/pages/multipleSelectionPage.js +77 -25
  104. package/cypress/pages/rulerPage.js +5 -0
  105. package/cypress/pages/singleSelectionPage.js +40 -1
  106. package/cypress/pages/videoResponsePage.js +1 -1
  107. package/package.json +1 -1
@@ -1,4 +1,4 @@
1
- import { optionsWrapperComponent, createQuestionBasePage, autoScoredSpecifyCorrectAnswerSection, scoringSectionBaseEditTab, autoScoredScoringSectionMultiResponseType, questionInstructionsComponent, autoScoredStudentViewSettings, autoScoredScoringPreviewTab, commonComponents, ckEditorToolbar, equationEditorFlyout, randomizeOptionsComponent, allowMultipleInstancesOfSameDraggableOptionComponent, studentViewSettingsLabelComponent, additionalSettingsPanel, draggableOptionContainer, draggableOptionsSectionComponent, maximumCapacityPerDropzoneComponent, enableOuterBorderComponent, specifyRowsAndColumnsComponent, additionalSettingsAccessibilitySectionComponent } from "./components";
1
+ import { optionsWrapperComponent, createQuestionBasePage, autoScoredSpecifyCorrectAnswerSection, scoringSectionBaseEditTab, autoScoredScoringSectionMultiResponseType, questionInstructionsComponent, autoScoredStudentViewSettings, autoScoredScoringPreviewTab, commonComponents, ckEditorToolbar, equationEditorFlyout, randomizeOptionsComponent, allowMultipleInstancesOfSameDraggableOptionComponent, studentViewSettingsLabelComponent, additionalSettingsPanel, draggableOptionContainer, draggableOptionsSectionComponent, maximumCapacityPerDropzoneComponent, enableOuterBorderComponent, specifyRowsAndColumnsComponent, additionalSettingsAccessibilitySectionComponent, styleAndLayoutCustomizationAccordionComponent, gradingViewEnumerationComponent, ariaLabelSectionComponent } from "./components";
2
2
  import utilities from "../support/helpers/utilities";
3
3
  import constants from "../fixtures/constants";
4
4
  const css = Cypress.env('css');
@@ -21,6 +21,9 @@ const selectors = {
21
21
  ...enableOuterBorderComponent,
22
22
  ...specifyRowsAndColumnsComponent,
23
23
  ...additionalSettingsPanel,
24
+ ...gradingViewEnumerationComponent,
25
+ ...ariaLabelSectionComponent,
26
+
24
27
  editCellPropertyButton: () => cy.get('button[aria-label="More Action"]'),
25
28
  editCellPropertyList: () => cy.get('.ngie-action-cell-container [role="menu"]'),
26
29
  editCellPropertyListOption: () => cy.get('[class*="MuiMenuItem"][role="menuitem"]'),
@@ -90,6 +93,68 @@ const selectors = {
90
93
  maxLimitInEachDropzoneHelpText: () => cy.get('[class*="Matrixstyles__MaxLimitWrapper"]'),
91
94
  dropzoneGridSpecifyCorrectAnswerSection: () => cy.get('[class*="Matrixstyles__TableWrapper"]'),
92
95
  dropzoneGridPreviewTab: () => cy.get('[class*="question-preview-wrapper"] [class*="Matrixstyles__TableWrapper"]'),
96
+
97
+ //Style and layout
98
+ layoutLabel: () => cy.get('[class*="Layoutstyles__SectionWrapper"]'),
99
+ rowSpacingDropdownLabel: () => cy.get('#Row-spacing-dropdown-label'),
100
+ rowSpacingDropdown: () => cy.get('[aria-labelledby*="Row-spacing-dropdown-label"]'),
101
+ rowSpacingDropdownOptions: (ariaLabel = null) => {
102
+ if (ariaLabel) {
103
+ return cy.get(`[aria-labelledby*="Row-spacing-dropdown-label"] .dropdown-menu-item[aria-label*="${ariaLabel}"]`)
104
+ } else {
105
+ return cy.get(`[aria-labelledby*="Row-spacing-dropdown-label"] .dropdown-menu-item`)
106
+ }
107
+ },
108
+ columnSpacingDropdownLabel: () => cy.get('#Column-spacing-dropdown-label'),
109
+ columnSpacingDropdown: () => cy.get('[aria-labelledby*="Column-spacing-dropdown-label"]'),
110
+ columnSpacingDropdownOptions: (ariaLabel = null) => {
111
+ if (ariaLabel) {
112
+ return cy.get(`[aria-labelledby*="Column-spacing-dropdown-label"] .dropdown-menu-item[aria-label*="${ariaLabel}"]`)
113
+ } else {
114
+ return cy.get(`[aria-labelledby*="Column-spacing-dropdown-label"] .dropdown-menu-item`)
115
+ }
116
+ },
117
+ dropzoneMinimumHeightLabel: () => cy.get('[for="Dropzone minimum height"]'),
118
+ dropzoneMinimumHeightInputField: () => cy.get('[id="Dropzone minimum height"]'),
119
+ dropzoneDimensionsLabel: () => cy.get('#Dropzone-dimensions-dropdown-label'),
120
+ dropzoneDimensionsDropdown: () => cy.get('#Dropzone-dimensions-select'),
121
+ dropzoneDimensionsDropdownOptions: (ariaLabel = null) => {
122
+ if (ariaLabel) {
123
+ return cy.get(`[aria-labelledby*="Dropzone-dimensions-dropdown-label"] .dropdown-menu-item[aria-label*="${ariaLabel}"]`)
124
+ } else {
125
+ return cy.get(`[aria-labelledby*="Dropzone-dimensions-dropdown-label"] .dropdown-menu-item`)
126
+ }
127
+ },
128
+ specifyForAllDropzoneColumnsLabel: () => cy.get('.ngie-radio-label[aria-label="Specify for all dropzone columns"]'),
129
+ specifyForAllDropzoneColumnsRadioButton: () => cy.get('[type="radio"][aria-label="Specify for all dropzone columns"]'),
130
+ specifyForFirstDropzoneColumnOnlyLabel: () => cy.get('.ngie-radio-label[aria-label="Specify for first dropzone column only"]'),
131
+ specifyForFirstDropzoneColumnOnlyRadioButton: () => cy.get('[type="radio"][aria-label="Specify for first dropzone column only"]'),
132
+ dropzoneWidthLabel: () => cy.get('.additional-settings-label[for*="width"]'),
133
+ dropzoneWidthInputField: () => cy.get('input[id*="width"]'),
134
+ dropzoneLabel: () => cy.get('[class*="Dropzonestyles__SectionWrapper"]'),
135
+ fillColorLabel: () => cy.get('.sub-section-label').eq(0),
136
+ borderColorLabel: () => cy.get('.sub-section-label').eq(1),
137
+ colorBlock: () => cy.get('.color-picker-block'),
138
+ editColorButton: () => cy.get('button[aria-label="edit color"]'),
139
+ colorBlockSelectedIcon: () => cy.get('[class*="BtnSelectionWrapper"] svg'),
140
+ dropzoneBorderStyleLabel: () => cy.get('.options-border-style .options-label').eq(0),
141
+ dropzoneBorderStyleOptions: (borderStyleOption) => cy.get('.options-border-style').eq(0).find(`.ngie-toggle-button-label-wrapper [aria-label*=${borderStyleOption}]`),
142
+ draggableOptionsBorderStyleLabel: () => cy.get('.options-border-style .options-label').eq(1),
143
+ draggableOptionsBorderStyleOptions: (borderStyleOption) => cy.get('.options-border-style').eq(1).find(`.ngie-toggle-button-label-wrapper [aria-label*=${borderStyleOption}]`),
144
+ draggableOptionsFillColorLabel: () => cy.get('.sub-section-label').eq(2),
145
+ draggableOptionsBorderColorLabel: () => cy.get('.sub-section-label').eq(3),
146
+ draggableOptionsLabel: () => cy.get('.draggable-options-label'),
147
+ dragHandleIconLabel: () => cy.get('[class*="__SubSectionLabel"]').eq(2),
148
+ dragHandle: () => cy.get('.draggable-item-wrapper [class*="drag"]'),
149
+ dragHandleOptions: () => cy.get('.drag-handle-icon-block'),
150
+ draggableOptionPanelPlacementLabel: () => cy.get('.draggable-option-panel-label'),
151
+ panelPlacementLabel: () => cy.get('.panel-placement-style .options-label'),
152
+ optionAlignmentInPanelLabel: () => cy.get('.option-alignment .options-label'),
153
+ panelPlacementOptions: (placementOption) => cy.get(`.panel-placement-style button[aria-label*="panel placement ${placementOption}"]`),
154
+ optionAlignmentInPanelOptions: (alignmentOption) => cy.get(`.option-alignment button[aria-label*="option alignment in panel ${alignmentOption}"]`),
155
+ optionsWrapper: () => cy.get('[class*="StandardDropZonestyles__DraggableItemsGrid"]'),
156
+ optionsWrapperPreviewTab: () => cy.get('.edit-question-preview-wrapper [class*="StandardDropZonestyles__DraggableItemsGrid"]'),
157
+ optionPanelWrapper: () => cy.get('.option-drag-and-drop')
93
158
  }
94
159
 
95
160
  const steps = {
@@ -113,6 +178,10 @@ const steps = {
113
178
  ...commonComponents.steps,
114
179
  ...enableOuterBorderComponent.steps,
115
180
  ...specifyRowsAndColumnsComponent.steps,
181
+ ...styleAndLayoutCustomizationAccordionComponent.steps,
182
+ ...gradingViewEnumerationComponent.steps,
183
+ ...ariaLabelSectionComponent.steps,
184
+
116
185
  /**
117
186
  * @description Modifies the dropzone property based on the specified list option.
118
187
  * @param {("Heading" | "Subheading" | "Text" | "Dropzone" | "None")} listOption - The list option to set to the dropzone.
@@ -573,7 +642,7 @@ const steps = {
573
642
  dragAndDropIntoCategoriesPage.tableRowContainerSpecifyCorrectAnswerSection()
574
643
  .eq(0)
575
644
  .within(() => {
576
- utilities.verifyElementCount(dragAndDropIntoCategoriesPage.tableCellContainerSpecifyCorrectAnswerSection(), numberOfColumns);
645
+ utilities.verifyElementCount(cy.wrap($element).find('[class*="styles__CellContainer"]'), numberOfColumns);
577
646
  });
578
647
  },
579
648
 
@@ -636,7 +705,7 @@ const steps = {
636
705
  dragAndDropIntoCategoriesPage.tableRowContainerPreviewTab()
637
706
  .eq(0)
638
707
  .within(($element) => {
639
- utilities.verifyElementCount(cy.wrap($element).find('[class*="Matrixstyles__CellContainer"]'), numberOfColumns);
708
+ utilities.verifyElementCount(cy.wrap($element).find('[class*="styles__CellContainer"]'), numberOfColumns);
640
709
  });
641
710
  },
642
711
 
@@ -1285,6 +1354,891 @@ const steps = {
1285
1354
  dragAndDropIntoCategoriesPage.dropzoneGridPreviewTab()
1286
1355
  .should('have.class', 'active-area-on-tap');
1287
1356
  },
1357
+
1358
+ expandRowSpacingDropdown: () => {
1359
+ dragAndDropIntoCategoriesPage.rowSpacingDropdown()
1360
+ .click();
1361
+ },
1362
+
1363
+ /**
1364
+ * This function selects row spacing option
1365
+ * @param {string} rowSpacingOption of the row spacing
1366
+ */
1367
+ selectRowSpacingDropdownOption: (rowSpacingOption) => {
1368
+ dragAndDropIntoCategoriesPage.rowSpacingDropdownOptions(rowSpacingOption)
1369
+ .click();
1370
+ },
1371
+
1372
+ /**
1373
+ * This function verified the selected state of row spacing option
1374
+ * @param {string} rowSpacingOption of the row spacing
1375
+ */
1376
+ verifyRowSpacingOptionSelected: (rowSpacingOption) => {
1377
+ dragAndDropIntoCategoriesPage.rowSpacingDropdownOptions(rowSpacingOption)
1378
+ .should('have.attr', 'aria-selected', 'true');
1379
+ },
1380
+
1381
+ expandColumnSpacingDropdown: () => {
1382
+ dragAndDropIntoCategoriesPage.columnSpacingDropdown()
1383
+ .click();
1384
+ },
1385
+
1386
+ /**
1387
+ * This function selects row spacing option
1388
+ * @param {string} rowSpacingOption of the row spacing
1389
+ */
1390
+ selectColumnSpacingDropdownOption: (rowSpacingOption) => {
1391
+ dragAndDropIntoCategoriesPage.columnSpacingDropdownOptions(rowSpacingOption)
1392
+ .click();
1393
+ },
1394
+
1395
+ /**
1396
+ * This function verified the selected state of row spacing option
1397
+ * @param {string} rowSpacingOption of the row spacing
1398
+ */
1399
+ verifyColumnSpacingOptionSelected: (rowSpacingOption) => {
1400
+ dragAndDropIntoCategoriesPage.columnSpacingDropdownOptions(rowSpacingOption)
1401
+ .should('have.attr', 'aria-selected', 'true');
1402
+ },
1403
+
1404
+ /**
1405
+ * This function verifies the row spacing
1406
+ * @param {("No spacing"|"Small"|"Wide")} spacing of the rows
1407
+ */
1408
+ verifyRowSpacingSpecifyCorrectAnswerSection: (spacing) => {
1409
+ switch (spacing) {
1410
+ case 'No spacing':
1411
+ dragAndDropIntoCategoriesPage.tableRowContainerSpecifyCorrectAnswerSection()
1412
+ .eq(0)
1413
+ .should('have.css', 'margin-bottom', '0px');
1414
+ break;
1415
+ case 'Small':
1416
+ dragAndDropIntoCategoriesPage.tableRowContainerSpecifyCorrectAnswerSection()
1417
+ .eq(0)
1418
+ .should('have.css', 'margin-bottom', '8px');
1419
+ break;
1420
+ case 'Wide':
1421
+ dragAndDropIntoCategoriesPage.tableRowContainerSpecifyCorrectAnswerSection()
1422
+ .eq(0)
1423
+ .should('have.css', 'margin-bottom', '24px');
1424
+ break;
1425
+ default:
1426
+ throw new Error(`Unsupported spacing option: ${spacing}`);
1427
+ }
1428
+ },
1429
+
1430
+ /**
1431
+ * This function verifies the row spacing
1432
+ * @param {("No spacing"|"Small"|"Wide")} spacing of the rows
1433
+ */
1434
+ verifyRowSpacingPreviewTab: (spacing) => {
1435
+ switch (spacing) {
1436
+ case 'No spacing':
1437
+ dragAndDropIntoCategoriesPage.tableRowContainerPreviewTab()
1438
+ .eq(0)
1439
+ .should('have.css', 'margin-bottom', '0px');
1440
+ break;
1441
+ case 'Small':
1442
+ dragAndDropIntoCategoriesPage.tableRowContainerPreviewTab()
1443
+ .eq(0)
1444
+ .should('have.css', 'margin-bottom', '8px');
1445
+ break;
1446
+ case 'Wide':
1447
+ dragAndDropIntoCategoriesPage.tableRowContainerPreviewTab()
1448
+ .eq(0)
1449
+ .should('have.css', 'margin-bottom', '24px');
1450
+ break;
1451
+ default:
1452
+ throw new Error(`Unsupported spacing option: ${spacing}`);
1453
+ }
1454
+ },
1455
+
1456
+ /**
1457
+ * This function verifies the row spacing
1458
+ * @param {("No spacing"|"Small"|"Wide")} spacing of the rows
1459
+ */
1460
+ verifyColumnSpacingSpecifyCorrectAnswerSection: (spacing) => {
1461
+ switch (spacing) {
1462
+ case 'No spacing':
1463
+ dragAndDropIntoCategoriesPage.tableRowContainerSpecifyCorrectAnswerSection()
1464
+ .each(($el) => {
1465
+ cy.wrap($el)
1466
+ .should('have.css', 'row-gap', '0px');
1467
+ });
1468
+ break;
1469
+ case 'Small':
1470
+ dragAndDropIntoCategoriesPage.tableRowContainerSpecifyCorrectAnswerSection()
1471
+ .each(($el) => {
1472
+ cy.wrap($el)
1473
+ .should('have.css', 'row-gap', '8px');
1474
+ });
1475
+ break;
1476
+ case 'Wide':
1477
+ dragAndDropIntoCategoriesPage.tableRowContainerSpecifyCorrectAnswerSection()
1478
+ .each(($el) => {
1479
+ cy.wrap($el)
1480
+ .should('have.css', 'row-gap', '24px');
1481
+ });
1482
+ break;
1483
+ default:
1484
+ throw new Error(`Unsupported spacing option: ${spacing}`);
1485
+ }
1486
+ },
1487
+
1488
+ /**
1489
+ * This function verifies the row spacing
1490
+ * @param {("No spacing"|"Small"|"Wide")} spacing of the rows
1491
+ */
1492
+ verifyColumnSpacingPreviewTab: (spacing) => {
1493
+ switch (spacing) {
1494
+ case 'No spacing':
1495
+ dragAndDropIntoCategoriesPage.tableRowContainerPreviewTab()
1496
+ .each(($el) => {
1497
+ cy.wrap($el)
1498
+ .should('have.css', 'row-gap', '0px');
1499
+ });
1500
+ break;
1501
+ case 'Small':
1502
+ dragAndDropIntoCategoriesPage.tableRowContainerPreviewTab()
1503
+ .each(($el) => {
1504
+ cy.wrap($el)
1505
+ .should('have.css', 'row-gap', '8px');
1506
+ });
1507
+ break;
1508
+ case 'Wide':
1509
+ dragAndDropIntoCategoriesPage.tableRowContainerPreviewTab()
1510
+ .each(($el) => {
1511
+ cy.wrap($el)
1512
+ .should('have.css', 'row-gap', '24px');
1513
+ });
1514
+ break;
1515
+ default:
1516
+ throw new Error(`Unsupported spacing option: ${spacing}`);
1517
+ }
1518
+ },
1519
+
1520
+ /**
1521
+ * This function enters text in cell height input field
1522
+ * @param {number} cellHeight of the rows
1523
+ */
1524
+ enterTextInDropzoneMinimumHeightInputField: (cellHeight) => {
1525
+ dragAndDropIntoCategoriesPage.dropzoneMinimumHeightInputField()
1526
+ .clear()
1527
+ .type(cellHeight)
1528
+ .should('have.value', cellHeight);
1529
+ dragAndDropIntoCategoriesPage.dropzoneMinimumHeightInputField()
1530
+ .blur();
1531
+ },
1532
+
1533
+ /**
1534
+ * This function verifies text in cell height input field
1535
+ * @param {number} cellHeight of the rows
1536
+ */
1537
+ verifyDropzoneMinimumHeightInputField: (cellHeight) => {
1538
+ dragAndDropIntoCategoriesPage.dropzoneMinimumHeightInputField()
1539
+ .should('have.value', cellHeight);
1540
+ },
1541
+
1542
+ /**
1543
+ * This function verifies cell height specify correct answer section
1544
+ * @param {number} cellHeight of the rows
1545
+ */
1546
+ verifyDropzoneMinimumHeightSpecifyCorrectAnswer: (cellHeight) => {
1547
+ dragAndDropIntoCategoriesPage.dropzoneCellSpecifyCorrectAnswerSection()
1548
+ .each(($el) => {
1549
+ cy.wrap($el)
1550
+ .should('have.css', 'min-height', `${cellHeight}px`)
1551
+ });
1552
+ },
1553
+
1554
+ /**
1555
+ * This function verifies cell height preview tab
1556
+ * @param {number} cellHeight of the rows
1557
+ */
1558
+ verifyDropzoneMinimumHeightPreviewTab: (cellHeight) => {
1559
+ dragAndDropIntoCategoriesPage.dropzoneCellPreviewTab()
1560
+ .each(($el) => {
1561
+ cy.wrap($el)
1562
+ .should('have.css', 'min-height', `${cellHeight}px`)
1563
+ });
1564
+ },
1565
+
1566
+ expandDropzoneDimensionsDropdown: () => {
1567
+ dragAndDropIntoCategoriesPage.dropzoneDimensionsDropdown()
1568
+ .click();
1569
+ },
1570
+
1571
+ /**
1572
+ * This function verified the selected state of column dimension dropdown
1573
+ * @param {string} dropzoneDimensionsOption of the column dimension dropdown
1574
+ */
1575
+ selectDropzoneDimensionsDropdownOption: (dropzoneDimensionsOption) => {
1576
+ dragAndDropIntoCategoriesPage.dropzoneDimensionsDropdownOptions(dropzoneDimensionsOption)
1577
+ .click();
1578
+ },
1579
+
1580
+ /**
1581
+ * This function verified the selected state of column dimension dropdown
1582
+ * @param {string} dropzoneDimensionsOption of the column dimension dropdown
1583
+ */
1584
+ verifyDropzoneDimensionsDropdownOptionSelected: (dropzoneDimensionsOption) => {
1585
+ dragAndDropIntoCategoriesPage.dropzoneDimensionsDropdownOptions(dropzoneDimensionsOption)
1586
+ .should('have.attr', 'aria-selected', 'true');
1587
+ },
1588
+
1589
+ /**
1590
+ * This function verifies the dimension of the column
1591
+ * @param {("Auto"|"Custom")} dimension of the column
1592
+ */
1593
+ verifyDropzoneDimensionsSpecifyCorrectAnswer: (dimension) => {
1594
+ switch (dimension) {
1595
+ case 'Auto':
1596
+ dragAndDropIntoCategoriesPage.dropzoneCellSpecifyCorrectAnswerSection()
1597
+ .each(($el) => {
1598
+ cy.wrap($el)
1599
+ .invoke('css', 'width')
1600
+ .then((width) => {
1601
+ const actualWidth = parseFloat(width);
1602
+ expect(actualWidth).to.not.be.closeTo(225, 1);
1603
+ });
1604
+ });
1605
+ break;
1606
+ case 'Custom':
1607
+ dragAndDropIntoCategoriesPage.dropzoneCellSpecifyCorrectAnswerSection()
1608
+ .each(($el) => {
1609
+ cy.wrap($el)
1610
+ .invoke('css', 'width')
1611
+ .then((width) => {
1612
+ const actualWidth = parseFloat(width);
1613
+ expect(actualWidth).to.be.closeTo(225, 1);
1614
+ });
1615
+ });
1616
+ break;
1617
+ default:
1618
+ throw new Error(`Unsupported spacing option: ${dimension}`);
1619
+ }
1620
+ },
1621
+
1622
+ /**
1623
+ * Verifies the width of a specified dropzone in the "Specify Correct Answer" section.
1624
+ * @param {number} index - The index of the dropzone to check.
1625
+ * @param {number} expectedWidth - The expected width of the dropzone.
1626
+ */
1627
+ verifyDropzoneWidthSpecifyCorrectAnswer: (index, expectedWidth) => {
1628
+ dragAndDropIntoCategoriesPage.dropzoneCellSpecifyCorrectAnswerSection()
1629
+ .eq(index)
1630
+ .invoke('css', 'width')
1631
+ .then((width) => {
1632
+ const actualWidth = parseFloat(width);
1633
+ expect(actualWidth).to.be.closeTo(expectedWidth, 1);
1634
+ });
1635
+ },
1636
+
1637
+ /**
1638
+ * Verifies that a specified dropzone does not have a specific width in the "Specify Correct Answer" section.
1639
+ * @param {number} index - The index of the dropzone to check.
1640
+ * @param {number} expectedWidth - The width that the dropzone should not have.
1641
+ */
1642
+ verifyDropzoneDoeNotHaveSpecifiedWidthSpecifyCorrectAnswer: (index, expectedWidth) => {
1643
+ dragAndDropIntoCategoriesPage.dropzoneCellSpecifyCorrectAnswerSection()
1644
+ .eq(index)
1645
+ .invoke('css', 'width')
1646
+ .then((width) => {
1647
+ const actualWidth = parseFloat(width);
1648
+ expect(actualWidth).to.not.be.closeTo(expectedWidth, 1);
1649
+ });
1650
+ },
1651
+
1652
+ /**
1653
+ * This function verifies the dimension of the column
1654
+ * @param {("Auto"|"Custom")} dimension of the column
1655
+ */
1656
+ verifyDropzoneDimensionsPreviewTab: (dimension) => {
1657
+ switch (dimension) {
1658
+ case 'Auto':
1659
+ dragAndDropIntoCategoriesPage.dropzoneCellPreviewTab()
1660
+ .each(($el) => {
1661
+ cy.wrap($el)
1662
+ .invoke('css', 'width')
1663
+ .then((width) => {
1664
+ const actualWidth = parseFloat(width);
1665
+ expect(actualWidth).to.not.be.closeTo(225, 1);
1666
+ });
1667
+ });
1668
+ break;
1669
+ case 'Custom':
1670
+ dragAndDropIntoCategoriesPage.dropzoneCellPreviewTab()
1671
+ .each(($el) => {
1672
+ cy.wrap($el)
1673
+ .invoke('css', 'width')
1674
+ .then((width) => {
1675
+ const actualWidth = parseFloat(width);
1676
+ expect(actualWidth).to.be.closeTo(225, 1);
1677
+ });
1678
+ });
1679
+ break;
1680
+ default:
1681
+ throw new Error(`Unsupported spacing option: ${dimension}`);
1682
+ }
1683
+ },
1684
+
1685
+ /**
1686
+ * This function verifies selected state of radio button
1687
+ * @param {("Specify for all columns"|"Specify for first column only")} radioButton in custom dimensions section
1688
+ */
1689
+ verifyCustomDimensionsRadioButtonSelected: (radioButton) => {
1690
+ switch (radioButton) {
1691
+ case 'Specify for all dropzone columns':
1692
+ dragAndDropIntoCategoriesPage.specifyForAllDropzoneColumnsRadioButton()
1693
+ .should('be.checked');
1694
+ break;
1695
+ case 'Specify for first dropzone column only':
1696
+ dragAndDropIntoCategoriesPage.specifyForFirstDropzoneColumnOnlyRadioButton()
1697
+ .should('be.checked');
1698
+ break;
1699
+ default:
1700
+ throw new Error(`Unsupported dimension option: ${radioButton}`);
1701
+ }
1702
+ },
1703
+
1704
+ /**
1705
+ * This function verifies selected state of radio button
1706
+ * @param {{"Specify for all columns"|"Specify for first column only"}} radioButton in custom dimensions section
1707
+ */
1708
+ selectCustomDimensionsRadioButton: (radioButton) => {
1709
+ switch (radioButton) {
1710
+ case 'Specify for all dropzone columns':
1711
+ dragAndDropIntoCategoriesPage.specifyForAllDropzoneColumnsRadioButton()
1712
+ .click()
1713
+ .should('be.checked');
1714
+ break;
1715
+ case 'Specify for first dropzone column only':
1716
+ dragAndDropIntoCategoriesPage.specifyForFirstDropzoneColumnOnlyRadioButton()
1717
+ .click()
1718
+ .should('be.checked');
1719
+ break;
1720
+ default:
1721
+ throw new Error(`Unsupported dimension option: ${radioButton}`);
1722
+ }
1723
+ },
1724
+
1725
+ /**
1726
+ * Verifies the value of the width input field for a specified dropzone.
1727
+ * @param {number} index - The index of the dropzone to check.
1728
+ * @param {string} width - The expected width value in the input field.
1729
+ */
1730
+ verifyDropzoneWidthInputField: (index, width) => {
1731
+ dragAndDropIntoCategoriesPage.dropzoneWidthInputField()
1732
+ .eq(index)
1733
+ .should('have.value', width);
1734
+ },
1735
+
1736
+ /**
1737
+ * Enters text into the width input field for a specified dropzone.
1738
+ * @param {number} index - The index of the dropzone to modify.
1739
+ * @param {string} width - The width value to enter into the input field.
1740
+ */
1741
+ enterTextInDropzoneWidthInputField: (index, width) => {
1742
+ dragAndDropIntoCategoriesPage.dropzoneWidthInputField()
1743
+ .eq(index)
1744
+ .clear()
1745
+ .type(width);
1746
+ dragAndDropIntoCategoriesPage.dropzoneWidthInputField()
1747
+ .eq(index)
1748
+ .blur();
1749
+ },
1750
+
1751
+ /**
1752
+ * Verifies the width of a specified dropzone in the preview tab.
1753
+ * @param {number} index - The index of the dropzone to check.
1754
+ * @param {number} expectedWidth - The expected width of the dropzone.
1755
+ */
1756
+ verifyDropzoneWidthPreviewTab: (index, expectedWidth) => {
1757
+ dragAndDropIntoCategoriesPage.dropzoneCellPreviewTab()
1758
+ .eq(index)
1759
+ .invoke('css', 'width')
1760
+ .then((width) => {
1761
+ const actualWidth = parseFloat(width);
1762
+ expect(actualWidth).to.be.closeTo(expectedWidth, 1);
1763
+ });
1764
+ },
1765
+
1766
+ /**
1767
+ * Verifies that a specified dropzone does not have a specific width in the preview tab.
1768
+ * @param {number} index - The index of the dropzone to check.
1769
+ * @param {number} expectedWidth - The width that the dropzone should not have.
1770
+ */
1771
+ verifyDropzoneDoeNotHaveSpecifiedWidthPreviewTab: (index, expectedWidth) => {
1772
+ dragAndDropIntoCategoriesPage.dropzoneCellPreviewTab()
1773
+ .eq(index)
1774
+ .invoke('css', 'width')
1775
+ .then((width) => {
1776
+ const actualWidth = parseFloat(width);
1777
+ expect(actualWidth).to.not.be.closeTo(expectedWidth, 1);
1778
+ });
1779
+ },
1780
+
1781
+ /**
1782
+ * Clicks on the edit color button.
1783
+ * @param {number} buttonIndex - The index of the edit color button.
1784
+ */
1785
+ editColor: (buttonIndex) => {
1786
+ utilities.getNthElement(dragAndDropIntoCategoriesPage.editColorButton(), buttonIndex)
1787
+ .click();
1788
+ },
1789
+
1790
+ /**
1791
+ * Verifies the color of a color block.
1792
+ * @param {number} blockIndex - The index of the color block.
1793
+ * @param {string} color - The expected background color of the color block.
1794
+ */
1795
+ verifyColorBlockColor: (blockIndex, color) => {
1796
+ utilities.verifyCSS(utilities.getNthElement(dragAndDropIntoCategoriesPage.colorBlock(), blockIndex), {
1797
+ 'background-color': color
1798
+ });
1799
+ },
1800
+
1801
+ /**
1802
+ * @param {number} blockIndex index of the color block in the style and layout customization section
1803
+ * @description this function verifies the selected state of a block
1804
+ */
1805
+ verifyColorBlockSelectedState: (blockIndex) => {
1806
+ utilities.getNthElement(dragAndDropIntoCategoriesPage.colorBlock(), blockIndex)
1807
+ .should('have.class', 'selected-button-icon')
1808
+ .within(() => {
1809
+ utilities.verifyElementVisibilityState(dragAndDropIntoCategoriesPage.colorBlockSelectedIcon(), 'visible');
1810
+ });
1811
+ },
1812
+
1813
+ /**
1814
+ * Verifies the background color of grid
1815
+ * @param {string} colorValue - The expected background color value.
1816
+ */
1817
+ verifyFillColorSpecifyCorrectAnswerSection: (colorValue) => {
1818
+ utilities.verifyCSS(dragAndDropIntoCategoriesPage.dropzoneCellSpecifyCorrectAnswerSection(), {
1819
+ 'background-color': colorValue
1820
+ });
1821
+ },
1822
+
1823
+ /**
1824
+ * Verifies the background color of grid
1825
+ * @param {string} colorValue - The expected background color value.
1826
+ */
1827
+ verifyFillColorPreviewTab: (colorValue) => {
1828
+ utilities.verifyCSS(dragAndDropIntoCategoriesPage.dropzoneCellPreviewTab(), {
1829
+ 'background-color': colorValue
1830
+ });
1831
+ },
1832
+
1833
+ /**
1834
+ * Verifies the border color of grid
1835
+ * @param {string} colorValue - The expected border color value.
1836
+ */
1837
+ verifyBorderColorSpecifyCorrectAnswer: (colorValue) => {
1838
+ utilities.verifyCSS(dragAndDropIntoCategoriesPage.dropzoneCellSpecifyCorrectAnswerSection(), {
1839
+ 'border-left-color': colorValue
1840
+ });
1841
+ },
1842
+
1843
+ /**
1844
+ * Verifies the border color of grid
1845
+ * @param {string} colorValue - The expected border color value.
1846
+ */
1847
+ verifyBorderColorPreviewTab: (colorValue) => {
1848
+ utilities.verifyCSS(dragAndDropIntoCategoriesPage.dropzoneCellPreviewTab(), {
1849
+ 'border-left-color': colorValue
1850
+ });
1851
+ },
1852
+
1853
+ /**
1854
+ * Selects a color block by index.
1855
+ * @param {number} blockIndex - The index of the color block to select.
1856
+ */
1857
+ selectColorBlock: (blockIndex) => {
1858
+ utilities.getNthElement(dragAndDropIntoCategoriesPage.colorBlock(), blockIndex)
1859
+ .click();
1860
+ },
1861
+
1862
+ /**
1863
+ * Selects a dropzone border style option.
1864
+ * @param {string} borderStyleOption - The border style option to select.
1865
+ */
1866
+ selectDropzoneBorderStyleOption: (borderStyleOption) => {
1867
+ dragAndDropIntoCategoriesPage.dropzoneBorderStyleOptions(borderStyleOption.toLowerCase())
1868
+ .click();
1869
+ },
1870
+
1871
+ /**
1872
+ * Verifies that the specified dropzone border style option is selected.
1873
+ * @param {string} borderStyleOption - The border style option to verify.
1874
+ */
1875
+ verifyDropzoneBorderStyleSelected: (borderStyleOption) => {
1876
+ dragAndDropIntoCategoriesPage.dropzoneBorderStyleOptions(borderStyleOption.toLowerCase())
1877
+ .should('have.attr', 'aria-pressed', 'true');
1878
+ },
1879
+
1880
+ /**
1881
+ * Verifies the border style of the dropzone in the "Specify Correct Answer" section.
1882
+ * @param {string} borderStyle - The expected border style.
1883
+ */
1884
+ verifyDropzoneBorderStyleSpecifyCorrectAnswer: (borderStyle) => {
1885
+ dragAndDropIntoCategoriesPage.dropzoneCellSpecifyCorrectAnswerSection()
1886
+ .should('have.css', 'border-left-style', borderStyle);
1887
+ },
1888
+
1889
+ /**
1890
+ * Verifies the border style of the dropzone in the preview tab.
1891
+ * @param {string} borderStyle - The expected border style.
1892
+ */
1893
+ verifyDropzoneBorderStylePreviewTab: (borderStyle) => {
1894
+ dragAndDropIntoCategoriesPage.dropzoneCellPreviewTab()
1895
+ .should('have.css', 'border-left-style', borderStyle);
1896
+ },
1897
+
1898
+ /**
1899
+ * Selects a draggable options border style option.
1900
+ * @param {string} borderStyleOption - The border style option to select.
1901
+ */
1902
+ selectDraggableOptionsBorderStyleOption: (borderStyleOption) => {
1903
+ dragAndDropIntoCategoriesPage.draggableOptionsBorderStyleOptions(borderStyleOption.toLowerCase())
1904
+ .click();
1905
+ },
1906
+
1907
+ /**
1908
+ * Verifies that the specified draggable options border style option is selected.
1909
+ * @param {string} borderStyleOption - The border style option to verify.
1910
+ */
1911
+ verifyDraggableOptionsBorderStyleSelected: (borderStyleOption) => {
1912
+ dragAndDropIntoCategoriesPage.draggableOptionsBorderStyleOptions(borderStyleOption.toLowerCase())
1913
+ .should('have.attr', 'aria-pressed', 'true');
1914
+ },
1915
+
1916
+ /**
1917
+ * Verifies the border style of the draggable options in the "Specify Correct Answer" section.
1918
+ * @param {string} borderStyle - The expected border style.
1919
+ */
1920
+ verifyDraggableOptionsBorderStyleSpecifyCorrectAnswer: (borderStyle) => {
1921
+ draggableOptionContainer.draggableOption()
1922
+ .should('have.css', 'border-top-style', borderStyle);
1923
+ },
1924
+
1925
+ /**
1926
+ * Verifies the border style of the draggable options in the preview tab.
1927
+ * @param {string} borderStyle - The expected border style.
1928
+ */
1929
+ verifyDraggableOptionsBorderStylePreviewTab: (borderStyle) => {
1930
+ dragAndDropIntoCategoriesPage.optionsContainerPreviewTab()
1931
+ .within(() => {
1932
+ draggableOptionContainer.draggableOption()
1933
+ .should('have.css', 'border-top-style', borderStyle);
1934
+ });
1935
+ },
1936
+
1937
+ /**
1938
+ * Verifies that the specified drag handle option is selected.
1939
+ * @param {number} index - The index of the drag handle option to verify.
1940
+ */
1941
+ verifyDragHandleOptionSelected: (index) => {
1942
+ dragAndDropIntoCategoriesPage.dragHandleOptions()
1943
+ .eq(index)
1944
+ .should('have.attr', 'aria-pressed', 'true')
1945
+ .within(() => {
1946
+ dragAndDropIntoCategoriesPage.colorBlockSelectedIcon()
1947
+ .should('exist');
1948
+ });
1949
+ },
1950
+
1951
+ /**
1952
+ * Selects a drag handle option.
1953
+ * @param {number} index - The index of the drag handle option to select.
1954
+ */
1955
+ selectDragHandleOption: (index) => {
1956
+ dragAndDropIntoCategoriesPage.dragHandleOptions()
1957
+ .eq(index)
1958
+ .click();
1959
+ },
1960
+
1961
+
1962
+ /**
1963
+ * Verifies the drag handle icon in the "Specify Correct Answer" section.
1964
+ * @param {string} dragHandleOption - The drag handle option to verify.
1965
+ */
1966
+ verifyDragHandleIconSpecifyCorrectAnswer: (dragHandleOption) => {
1967
+ switch (dragHandleOption) {
1968
+ case 'drag icon':
1969
+ dragAndDropIntoCategoriesPage.dragHandle()
1970
+ .should('have.class', 'drag-icon-button ');
1971
+ break;
1972
+ case 'arrow icon':
1973
+ dragAndDropIntoCategoriesPage.dragHandle()
1974
+ .should('have.class', 'drag-arrows-icon ');
1975
+ break;
1976
+ case 'none':
1977
+ dragAndDropIntoCategoriesPage.dragHandle()
1978
+ .should('not.exist');
1979
+ break;
1980
+ }
1981
+ },
1982
+
1983
+ /**
1984
+ * Verifies the drag handle icon in the preview tab.
1985
+ * @param {string} dragHandleOption - The drag handle option to verify.
1986
+ */
1987
+ verifyDragHandleIconPreviewTab: (dragHandleOption) => {
1988
+ switch (dragHandleOption) {
1989
+ case 'drag icon':
1990
+ dragAndDropIntoCategoriesPage.previewTabQuestionWrapper()
1991
+ .within(() => {
1992
+ dragAndDropIntoCategoriesPage.dragHandle()
1993
+ .should('have.class', 'drag-icon-button ');
1994
+ });
1995
+ break;
1996
+ case 'arrow icon':
1997
+ dragAndDropIntoCategoriesPage.previewTabQuestionWrapper()
1998
+ .within(() => {
1999
+ dragAndDropIntoCategoriesPage.dragHandle()
2000
+ .should('have.class', 'drag-arrows-icon ');
2001
+ });
2002
+ break;
2003
+ case 'none':
2004
+ dragAndDropIntoCategoriesPage.previewTabQuestionWrapper()
2005
+ .within(() => {
2006
+ dragAndDropIntoCategoriesPage.dragHandle()
2007
+ .should('not.exist');
2008
+ });
2009
+ break;
2010
+ }
2011
+ },
2012
+
2013
+ /**
2014
+ * Verifies the background color of grid
2015
+ * @param {string} colorValue - The expected background color value.
2016
+ */
2017
+ verifyDraggableOptionsFillColorSpecifyCorrectAnswerSection: (colorValue) => {
2018
+ utilities.verifyCSS(draggableOptionContainer.draggableOption(), {
2019
+ 'background-color': colorValue
2020
+ });
2021
+ },
2022
+
2023
+ /**
2024
+ * Verifies the background color of grid
2025
+ * @param {string} colorValue - The expected background color value.
2026
+ */
2027
+ verifyDraggableOptionsFillColorPreviewTab: (colorValue) => {
2028
+ dragAndDropIntoCategoriesPage.previewTabQuestionWrapper()
2029
+ .within(() => {
2030
+ utilities.verifyCSS(dragAndDropIntoCategoriesPage.draggableOption(), {
2031
+ 'background-color': colorValue
2032
+ });
2033
+ });
2034
+ },
2035
+
2036
+ /**
2037
+ * Verifies the border color of grid
2038
+ * @param {string} colorValue - The expected border color value.
2039
+ */
2040
+ verifyDraggableOptionsBorderColorSpecifyCorrectAnswer: (colorValue) => {
2041
+ utilities.verifyCSS(dragAndDropIntoCategoriesPage.draggableOption(), {
2042
+ 'border': `1px solid ${colorValue}`
2043
+ });
2044
+ },
2045
+
2046
+ /**
2047
+ * Verifies the border color of grid
2048
+ * @param {string} colorValue - The expected border color value.
2049
+ */
2050
+ verifyDraggableOptionsBorderColorPreviewTab: (colorValue) => {
2051
+ dragAndDropIntoCategoriesPage.previewTabQuestionWrapper()
2052
+ .within(() => {
2053
+ utilities.verifyCSS(dragAndDropIntoCategoriesPage.draggableOption(), {
2054
+ 'border': `1px solid ${colorValue}`
2055
+ });
2056
+ });
2057
+ },
2058
+
2059
+ /**
2060
+ * Verifies if the specified panel placement option is selected.
2061
+ * @param {string} placementOption - The panel placement option to verify.
2062
+ */
2063
+ verifyPanelPlacementOptionSelected: (placementOption) => {
2064
+ dragAndDropIntoCategoriesPage.panelPlacementOptions(placementOption)
2065
+ .should('have.attr', 'aria-pressed', 'true');
2066
+ },
2067
+
2068
+ /**
2069
+ * Selects the specified panel placement option.
2070
+ * @param {string} placementOption - The panel placement option to select.
2071
+ */
2072
+ selectPanelPlacementOption: (placementOption) => {
2073
+ dragAndDropIntoCategoriesPage.panelPlacementOptions(placementOption)
2074
+ .click();
2075
+ },
2076
+
2077
+ /**
2078
+ * Verifies if the specified option alignment in panel is selected.
2079
+ * @param {string} alignmentOption - The alignment option to verify.
2080
+ */
2081
+ verifyOptionAlignmentInPanelOptionSelected: (alignmentOption) => {
2082
+ dragAndDropIntoCategoriesPage.optionAlignmentInPanelOptions(alignmentOption)
2083
+ .should('have.attr', 'aria-pressed', 'true');
2084
+ },
2085
+
2086
+ /**
2087
+ * Selects the specified option alignment in panel.
2088
+ * @param {string} alignmentOption - The alignment option to select.
2089
+ */
2090
+ selectOptionAlignmentInPanelOption: (alignmentOption) => {
2091
+ dragAndDropIntoCategoriesPage.optionAlignmentInPanelOptions(alignmentOption)
2092
+ .click();
2093
+ },
2094
+
2095
+ /**
2096
+ * Verifies the panel placement in the specify correct answer section.
2097
+ * @param {string} placementOption - The panel placement option to verify.
2098
+ */
2099
+ verifyPanelPlacementSpecifyCorrectAnswerSection: (placementOption) => {
2100
+ switch (placementOption) {
2101
+ case 'Bottom':
2102
+ dragAndDropIntoCategoriesPage.optionPanelWrapper()
2103
+ .should('have.css', 'width', '844px')
2104
+ .and('have.css', 'padding-top', '32px')
2105
+ .and('have.css', 'padding-bottom', '16px')
2106
+ break;
2107
+ case 'Top':
2108
+ dragAndDropIntoCategoriesPage.optionPanelWrapper()
2109
+ .should('have.css', 'width', '844px')
2110
+ .and('have.css', 'padding-top', '16px')
2111
+ .and('have.css', 'padding-bottom', '32px')
2112
+ break;
2113
+ case 'Left':
2114
+ dragAndDropIntoCategoriesPage.optionPanelWrapper()
2115
+ .should('have.css', 'width', '200px')
2116
+ .and('have.css', 'padding-right', '24px')
2117
+ .and('have.css', 'padding-left', '8px')
2118
+ break;
2119
+ case 'Right':
2120
+ dragAndDropIntoCategoriesPage.optionPanelWrapper()
2121
+ .should('have.css', 'width', '200px')
2122
+ .and('have.css', 'padding-right', '8px')
2123
+ .and('have.css', 'padding-left', '24px')
2124
+ break;
2125
+ }
2126
+ },
2127
+
2128
+ /**
2129
+ * Verifies the panel placement in the preview tab.
2130
+ * @param {string} placementOption - The panel placement option to verify.
2131
+ */
2132
+ verifyPanelPlacementPreviewTab: (placementOption) => {
2133
+ dragAndDropIntoCategoriesPage.previewTabQuestionWrapper()
2134
+ .within(() => {
2135
+ switch (placementOption) {
2136
+ case 'Bottom':
2137
+ dragAndDropIntoCategoriesPage.optionPanelWrapper()
2138
+ .should('have.css', 'width', '844px')
2139
+ .and('have.css', 'padding-top', '32px')
2140
+ .and('have.css', 'padding-bottom', '16px')
2141
+ break;
2142
+ case 'Top':
2143
+ dragAndDropIntoCategoriesPage.optionPanelWrapper()
2144
+ .should('have.css', 'width', '844px')
2145
+ .and('have.css', 'padding-top', '16px')
2146
+ .and('have.css', 'padding-bottom', '32px')
2147
+ break;
2148
+ case 'Left':
2149
+ dragAndDropIntoCategoriesPage.optionPanelWrapper()
2150
+ .should('have.css', 'width', '200px')
2151
+ .and('have.css', 'padding-right', '24px')
2152
+ .and('have.css', 'padding-left', '8px')
2153
+ break;
2154
+ case 'Right':
2155
+ dragAndDropIntoCategoriesPage.optionPanelWrapper()
2156
+ .should('have.css', 'width', '200px')
2157
+ .and('have.css', 'padding-right', '8px')
2158
+ .and('have.css', 'padding-left', '24px')
2159
+ break;
2160
+ }
2161
+ });
2162
+ },
2163
+
2164
+ /**
2165
+ * Verifies the option alignment in panel in the specify correct answer section.
2166
+ * @param {string} optionAlignment - The option alignment to verify ('Left', 'Center', 'Right').
2167
+ */
2168
+ verifyOptionAlignmentInPanelInSpecifyCorrectAnswer: (optionAlignment) => {
2169
+ switch (optionAlignment) {
2170
+ case 'Left':
2171
+ dragAndDropIntoCategoriesPage.optionsWrapper()
2172
+ .should('have.css', 'justify-content', 'flex-start');
2173
+ break;
2174
+ case 'Center':
2175
+ dragAndDropIntoCategoriesPage.optionsWrapper()
2176
+ .should('have.css', 'justify-content', 'center');
2177
+ break;
2178
+ case 'Right':
2179
+ dragAndDropIntoCategoriesPage.optionsWrapper()
2180
+ .should('have.css', 'justify-content', 'flex-end');
2181
+ break;
2182
+ }
2183
+ },
2184
+
2185
+ /**
2186
+ * Verifies the option alignment in panel in the preview tab.
2187
+ * @param {string} optionAlignment - The option alignment to verify ('Left', 'Center', 'Right').
2188
+ */
2189
+ verifyOptionAlignmentInPanelInPreviewTab: (optionAlignment) => {
2190
+ switch (optionAlignment) {
2191
+ case 'Left':
2192
+ dragAndDropIntoCategoriesPage.optionsWrapperPreviewTab()
2193
+ .should('have.css', 'justify-content', 'flex-start');
2194
+ break;
2195
+ case 'Center':
2196
+ dragAndDropIntoCategoriesPage.optionsWrapperPreviewTab()
2197
+ .should('have.css', 'justify-content', 'center');
2198
+ break;
2199
+ case 'Right':
2200
+ dragAndDropIntoCategoriesPage.optionsWrapperPreviewTab()
2201
+ .should('have.css', 'justify-content', 'flex-end');
2202
+ break;
2203
+ }
2204
+ },
2205
+
2206
+ /**
2207
+ * Verifies the aria-label attribute of the dropzone in the specify correct answer section.
2208
+ * @param {number} index - The index of the dropzone.
2209
+ * @param {string} ariaLabel - The expected aria-label value.
2210
+ */
2211
+ verifyDropzoneAriaLabelSpecifyCorrectAnswerSection: (index, ariaLabel) => {
2212
+ dragAndDropIntoCategoriesPage.dropzoneCellSpecifyCorrectAnswerSection()
2213
+ .eq(index)
2214
+ .should('have.attr', 'aria-describedby', ariaLabel);
2215
+ },
2216
+
2217
+ /**
2218
+ * Verifies the aria-label attribute of the dropzone in the preview tab.
2219
+ * @param {number} index - The index of the dropzone.
2220
+ * @param {string} ariaLabel - The expected aria-label value.
2221
+ */
2222
+ verifyDropzoneAriaLabelPreviewTab: (index, ariaLabel) => {
2223
+ dragAndDropIntoCategoriesPage.dropzoneCellPreviewTab()
2224
+ .eq(index)
2225
+ .should('have.attr', 'aria-describedby', ariaLabel);
2226
+ },
2227
+
2228
+
2229
+ /**
2230
+ * Verifies the numeration of dropzone cells in the Preview Tab.
2231
+ * @param {number[]} dropZoneCellIndexArray - An array of expected numerations for each dropzone cell.
2232
+ */
2233
+ verifyDropzoneCellNumerationPreviewTab: (numerationArray) => {
2234
+ numerationArray.forEach((option, index) => {
2235
+ dragAndDropIntoCategoriesPage.dropzoneCellPreviewTab()
2236
+ .eq(index)
2237
+ .within(() => {
2238
+ utilities.verifyInnerText(dragAndDropIntoCategoriesPage.dropzoneCellNumeration(), `${option}`);
2239
+ });
2240
+ });
2241
+ },
1288
2242
  }
1289
2243
 
1290
2244
  const tests = {
@@ -1305,6 +2259,9 @@ const tests = {
1305
2259
  ...createQuestionBasePage.tests,
1306
2260
  ...additionalSettingsPanel.tests,
1307
2261
  ...additionalSettingsAccessibilitySectionComponent.tests,
2262
+ ...styleAndLayoutCustomizationAccordionComponent.tests,
2263
+ ...gradingViewEnumerationComponent.tests,
2264
+ ...ariaLabelSectionComponent.tests,
1308
2265
  verifyContentsOfSpecifyCorrectAnswerSection: (scoringType) => {
1309
2266
  it(`When the user selects ${scoringType} from scoring type dropdown then the specify correct answer sections should be displayed`, () => {
1310
2267
  dragAndDropIntoCategoriesPage.steps.verifyTableCellPropertySpecifyCorrectAnswer(0, 'None');