itemengine-cypress-automation 1.0.165-migrationScripts-e27d6f2.0 → 1.0.166

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (109) hide show
  1. package/cypress/e2e/ILC/BrainingCampManipulative/additionalSettings.js +83 -0
  2. package/cypress/e2e/ILC/BrainingCampManipulative/editTabBasicSection.js +200 -0
  3. package/cypress/e2e/ILC/BrainingCampManipulative/editTabScoringSection.js +56 -0
  4. package/cypress/e2e/ILC/BrainingCampManipulative/gradingViewAndCorrectAnswerViewContents.smoke.js +95 -0
  5. package/cypress/e2e/ILC/BrainingCampManipulative/headerSection.js +71 -0
  6. package/cypress/e2e/ILC/BrainingCampManipulative/previewTabContent.smoke.js +72 -0
  7. package/cypress/e2e/ILC/BrainingCampManipulative/toolSettings.js +71 -0
  8. package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/allOrNothingBasicForAllViews.smoke.js +2 -2
  9. package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/clickAndDrop.js +22 -11
  10. package/cypress/e2e/ILC/EssayResponse/essayResponseAdditionalSettings.js +432 -0
  11. package/cypress/e2e/ILC/EssayResponse/essayResponseAdditionalSettingsBasic.js +134 -0
  12. package/cypress/e2e/ILC/FeedbackScaleNew/feedbackScaleStylePreviewTab.js +161 -0
  13. package/cypress/e2e/ILC/FeedbackScaleNew/numbersFeedbackScaleStyle.js +308 -0
  14. package/cypress/e2e/ILC/FeedbackScaleNew/previewContentsForAllViews.smoke.js +216 -0
  15. package/cypress/e2e/ILC/FeedbackScaleNew/starsHeartsFeedbackScaleStyle.js +336 -0
  16. package/cypress/e2e/ILC/FeedbackScaleNew/textFeedbackScaleStyle.js +570 -0
  17. package/cypress/e2e/ILC/FeedbackScaleNew/thumbsFeedbackScaleStyle.js +214 -0
  18. package/cypress/e2e/ILC/FillInTheGapsDragAndDrop/fillInTheGapsDragAndDropAdditionalSettings.js +356 -0
  19. package/cypress/e2e/ILC/FillInTheGapsDragAndDrop/fillInTheGapsDragAndDropAdditionalSettingsResponseAccordion.js +299 -0
  20. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/clickAndDrop.js +18 -7
  21. package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/clickAndDrop.js +11 -6
  22. package/cypress/e2e/ILC/Graphing/Scoring/allOrNothingWithCorrectPointsEqualToAlternatePoints.js +355 -0
  23. package/cypress/e2e/ILC/Graphing/previewContentsForAllViews.smoke.js +0 -1
  24. package/cypress/e2e/ILC/Graphing/toolsControlsAndBackgroundSection.js +2 -36
  25. package/cypress/e2e/ILC/GridFill/allOrNothingBasicForAllViews.smoke.js +22 -34
  26. package/cypress/e2e/ILC/GridFill/checkAnswerFunctionalityForAllViews.smoke.js +8 -24
  27. package/cypress/e2e/ILC/GridFill/previewContentsForAllViews.smoke.js +5 -25
  28. package/cypress/e2e/ILC/GridFill/scoring/allOrNothingAlternativePointsGreaterThanCorrectPoints.js +68 -114
  29. package/cypress/e2e/ILC/GridFill/scoring/allOrNothingCorrectPointsEqualToAlternativePoints.js +67 -111
  30. package/cypress/e2e/ILC/GridFill/scoring/allOrNothingCorrectPointsGreaterThanAlternativePoints.js +71 -123
  31. package/cypress/e2e/ILC/GridFill/scoring/allOrNothingScoringCellShadeCount.js +41 -63
  32. package/cypress/e2e/ILC/GridFill/scoring/manuallyAndNonScored.js +21 -25
  33. package/cypress/e2e/ILC/GridFill/scoring/partialEqualWeightsBasic.js +50 -85
  34. package/cypress/e2e/ILC/GridFill/scoring/partialEqualWeightsWithAlternativePointsGreaterThanCorrectPoints.js +68 -115
  35. package/cypress/e2e/ILC/GridFill/scoring/partialEqualWeightsWithCorrectPointsEqualToAlternativePoints.js +54 -98
  36. package/cypress/e2e/ILC/GridFill/scoring/partialEqualWeightsWithCorrectPointsGreaterThanAlternativePoints.js +72 -120
  37. package/cypress/e2e/ILC/GridFill/studentViewSettingsSection.js +3 -3
  38. package/cypress/e2e/ILC/Matching/maximumCapacityPerDropzoneSection.js +309 -0
  39. package/cypress/e2e/ILC/Matching/specifyCorrectAnswerSection.js +1 -1
  40. package/cypress/e2e/ILC/Matching/toolSettings.js +72 -0
  41. package/cypress/e2e/ILC/MultipleSelectionGridNew/editTabBasicSection.js +1033 -0
  42. package/cypress/e2e/ILC/MultipleSelectionGridNew/test.js +28 -0
  43. package/cypress/e2e/ILC/NumberLine/Scoring/allOrNothingWithAlternatePointsGreaterThanCorrectPoints.js +236 -0
  44. package/cypress/e2e/ILC/NumberLine/Scoring/allOrNothingWithCorrectPointsEqualToAlternatePoints.js +239 -0
  45. package/cypress/e2e/ILC/NumberLine/Scoring/allOrNothingWithCorrectPointsGreaterThanAlternativePoints.js +278 -0
  46. package/cypress/e2e/ILC/NumberLine/Scoring/manualAndNonScoredScoring.js +178 -0
  47. package/cypress/e2e/ILC/NumberLine/Scoring/partialEqualWeightsBasic.js +407 -0
  48. package/cypress/e2e/ILC/NumberLine/Scoring/partialEqualWeightsWithAlternatePointsGreaterThanCorrectPoints.js +273 -0
  49. package/cypress/e2e/ILC/NumberLine/Scoring/partialEqualWeightsWithCorrectPointsGreaterThanAlternatePoints.js +278 -0
  50. package/cypress/e2e/ILC/NumberLine/Scoring/partialEqualWeigtsWithCorrectPointsEqualToAlternatePoints.js +228 -0
  51. package/cypress/e2e/ILC/NumberLine/additionalSettings.js +120 -0
  52. package/cypress/e2e/ILC/NumberLine/allOrNothingScoringForAllViews.smoke.js +659 -0
  53. package/cypress/e2e/ILC/NumberLine/checkAnswerFunctionalityForAllViews.smoke.js +149 -0
  54. package/cypress/e2e/ILC/NumberLine/editTabScoringSection.js +151 -0
  55. package/cypress/e2e/ILC/NumberLine/gradingViewAndCorrectAnswerView.smoke.js +171 -0
  56. package/cypress/e2e/ILC/NumberLine/headerSection.js +76 -0
  57. package/cypress/e2e/ILC/NumberLine/minimumScoringPenaltyPointsAndRoundingDropdown.js +54 -0
  58. package/cypress/e2e/ILC/NumberLine/previewTabContentsForAllViews.smoke.js +200 -0
  59. package/cypress/e2e/ILC/NumberLine/specifyCorrectAnswerSection.js +67 -0
  60. package/cypress/e2e/ILC/NumberLine/studentViewSettings.js +135 -0
  61. package/cypress/e2e/ILC/NumberLine/toolSettings.js +73 -0
  62. package/cypress/e2e/ILC/NumberLine/toolsAndControls.js +372 -0
  63. package/cypress/e2e/ILC/SingleSelectionGridNew/editTabBasicSection.js +1014 -0
  64. package/cypress/e2e/ILC/TextSelection/Scoring/allOrNothingAlternatePointsMoreThanCorrectPoints.js +235 -0
  65. package/cypress/e2e/ILC/TextSelection/Scoring/allOrNothingCorrectPointsEqualToAlternatePoints.js +235 -0
  66. package/cypress/e2e/ILC/TextSelection/Scoring/allOrNothingCorrectPointsMoreThanAlternatePoints.js +235 -0
  67. package/cypress/e2e/ILC/TextSelection/Scoring/partialDifferentWeightsBasic.js +457 -0
  68. package/cypress/e2e/ILC/TextSelection/Scoring/partialDifferentWeightsWithAlternativePointsGreaterThanCorrectPoints.js +342 -0
  69. package/cypress/e2e/ILC/TextSelection/Scoring/partialDifferentWeightsWithCorrectPointsEqualToAlternativePoints.js +342 -0
  70. package/cypress/e2e/ILC/TextSelection/Scoring/partialDifferentWeightsWithCorrectPointsGreaterThanAlternativePoints.js +342 -0
  71. package/cypress/e2e/ILC/TextSelection/Scoring/partialEqualWeightsBasic.js +155 -0
  72. package/cypress/e2e/ILC/TextSelection/Scoring/partialEqualWeightsWithAlternativePointsGreaterThanCorrectPoints.js +314 -0
  73. package/cypress/e2e/ILC/TextSelection/Scoring/partialEqualWeightsWithCorrectPointsEqualToAlternativePoints.js +275 -0
  74. package/cypress/e2e/ILC/TextSelection/Scoring/partialEqualWeightsWithCorrectPointsGreaterThanAlternativePoints.js +314 -0
  75. package/cypress/e2e/ILC/TextSelection/allOrNothingScoringForAllViews.smoke.js +290 -0
  76. package/cypress/e2e/ILC/TextSelection/checkAnswerFunctionalityForAllViews.smoke.js +142 -0
  77. package/cypress/e2e/ILC/TextSelection/previewContentsForAllViews.js +137 -0
  78. package/cypress/e2e/ILC/ToolSettings/toolSettingsContent.js +4 -4
  79. package/cypress/fixtures/theme/ilc.json +14 -26
  80. package/cypress/pages/brainingCampManipulativePage.js +122 -0
  81. package/cypress/pages/components/autoScoredScoringSectionMultiResponseType.js +1 -1
  82. package/cypress/pages/components/autoScoredSpecifyCorrectAnswerSection.js +3 -0
  83. package/cypress/pages/components/autoScoredStudentViewSettings.js +1 -1
  84. package/cypress/pages/components/colorPopupComponent.js +2 -2
  85. package/cypress/pages/components/defaultToolDropdown.js +77 -0
  86. package/cypress/pages/components/gridQuestionCommonComponent.js +629 -2
  87. package/cypress/pages/components/index.js +3 -0
  88. package/cypress/pages/components/maximumCapacityPerDropzoneComponent.js +1 -1
  89. package/cypress/pages/components/measuringToolComponent.js +2 -2
  90. package/cypress/pages/components/resetPopupComponent.js +74 -0
  91. package/cypress/pages/components/scoringSectionBaseEditTab.js +1 -1
  92. package/cypress/pages/components/setPointsPopupBase.js +6 -4
  93. package/cypress/pages/components/specifyRowsAndColumnsComponent.js +60 -3
  94. package/cypress/pages/components/toolSettingsComponent.js +80 -12
  95. package/cypress/pages/components/toolsAndControlsComponent.js +69 -0
  96. package/cypress/pages/dragAndDropIntoCategoriesPage.js +0 -8
  97. package/cypress/pages/feedbackScalePage copy.js +716 -0
  98. package/cypress/pages/feedbackScalePage.js +591 -449
  99. package/cypress/pages/fillInTheGapsOverImageDragAndDropPage.js +3 -1
  100. package/cypress/pages/graphingPage.js +9 -145
  101. package/cypress/pages/gridFillPage.js +135 -120
  102. package/cypress/pages/highlightPage.js +0 -394
  103. package/cypress/pages/index.js +5 -2
  104. package/cypress/pages/matchingPage.js +78 -20
  105. package/cypress/pages/multipleSelectionGridPage.js +88 -1
  106. package/cypress/pages/numberLinePage.js +723 -0
  107. package/cypress/pages/singleSelectionGridPage.js +86 -0
  108. package/cypress/pages/textSelectionPage.js +582 -0
  109. package/package.json +2 -2
@@ -1,56 +1,80 @@
1
- import constants from "../fixtures/constants";
2
- import { additionalSettingsPanel, ckEditorToolbar, colorPopupComponent, commonComponents, createQuestionBasePage, questionInstructionsComponent } from "./components"
3
- import { dialogBoxBase } from "./dialogBoxBase";
1
+ import { additionalSettingsPanel, commonComponents, createQuestionBasePage, questionInstructionsComponent, autoScoredScoringPreviewTab } from "./components"
4
2
  import utilities from "../support/helpers/utilities";
5
- import { selectQuestionResourceToolPage } from "./selectQuestionResourceToolPage";
6
3
  const css = Cypress.env('css');
7
4
 
8
5
  const selectors = {
9
6
  ...questionInstructionsComponent,
10
7
  ...commonComponents,
11
- ...ckEditorToolbar,
12
8
  ...additionalSettingsPanel,
13
- ...dialogBoxBase,
14
- ...createQuestionBasePage,
15
- feedbackLayoutStyleLabel: () => cy.get('#feedback-layout-style-dropdown-label'),
16
- feedbackLayoutStyleDropdown: () => cy.get('#feedback-layout-style-select'),
17
- feedbackLayoutStyleDropdownOptions: (ariaLabel = null) => {
9
+ specifyFeedbackScaleOptionsLabel: () => cy.get('[class*="FeedbackScalestyles__SpecifyFeedbackLabel"]'),
10
+ feedbackScaleStyleDropdownLabel: () => cy.get('#feedback-scale-style-dropdown-label'),
11
+ feedbackScaleStyleDropdown: () => cy.get('#feedback-scale-style-select'),
12
+ feedbackScaleStyleDropdownListOptions: (ariaLabel = null) => {
18
13
  if (ariaLabel) {
19
- return cy.get(`[aria-labelledby*="feedback-layout-style-dropdown-label"] [role="option"][aria-label*="${ariaLabel}"]`)
14
+ return cy.get(`[aria-labelledby*="feedback-scale-style-dropdown-label"] [role="option"][aria-label*="${ariaLabel}"]`)
20
15
  } else {
21
- return cy.get('[aria-labelledby*="feedback-layout-style-dropdown-label"] [role="option"]')
16
+ return cy.get('[aria-labelledby*="feedback-scale-style-dropdown-label"] [role="option"]')
17
+ }
18
+ },
19
+ optionsStepperInputFieldLabel: () => cy.get('.input-stepper-label'),
20
+ optionsStepperInputField: () => cy.get('.input-stepper-textfield'),
21
+ optionsStepperDecreaseButton: () => cy.get('.input-stepper-button[aria-label="Decrease count"]'),
22
+ optionsStepperIncreaseButton: () => cy.get('.input-stepper-button[aria-label="Increase count"]'),
23
+ defaultTextDropdownLabel: () => cy.get('#Default-text-dropdown-label'),
24
+ defaultTextDropdown: () => cy.get('#Default-text-select'),
25
+ defaultTextDropdownListOptions: (ariaLabel = null) => {
26
+ if (ariaLabel) {
27
+ return cy.get(`[aria-labelledby*="Default-text-dropdown-label"] [role="option"][aria-label*="${ariaLabel}"]`)
28
+ } else {
29
+ return cy.get('[aria-labelledby*="Default-text-dropdown-label"] [role="option"]')
22
30
  }
23
31
  },
24
- feedbackScaleLabel: () => cy.get('.feedback-scale-panel-heading'),
25
32
  optionAccordion: () => cy.get('.feedback-scale-panel .ngie-accordion-summary'),
33
+ optionAccordionWrapper: () => cy.get('.feedback-scale-panel'),
26
34
  optionAccordionLabel: () => cy.get('.feedback-scale-panel-label'),
35
+ optionAccordionPointsLabel: () => cy.get('.feedback-scale-points'),
27
36
  deleteOptionAccordionButton: () => cy.get('[aria-label*="Delete Option"]'),
28
- labelsLabel: () => cy.get('[class*="InlineTextFieldWithDebouncestyles__PropertyLabel"]'),
29
- labelsInputField: () => cy.get('input[aria-label="Label"]'),
30
- colorLabel: () => cy.get('[class*="FeedbackScalePanelstyle__ColorPickerWrapper"][class*="text-label"]'),
31
- tooltipLabel: () => cy.get('[class*="FeedbackScalePanelstyle__FeedbackScaleOptionWrapper"] [class*="InlineRichTextComponentstyles__LabelWarpper"]').eq(0),
32
- tooltipInputField: () => cy.get('[role="textbox"][aria-label*="tooltip"]'),
33
- descriptionLabel: () => cy.get('[class*="FeedbackScalePanelstyle__FeedbackScaleOptionWrapper"] [class*="InlineRichTextComponentstyles__LabelWarpper"]').eq(1),
34
- descriptionInputField: () => cy.get('[role="textbox"][aria-label*="description"]'),
37
+ optionTextInputField: () => cy.get('input[aria-label="Option text"]'),
38
+ legendTextLabel: () => cy.get('.legend-wrapper [class*="LabelWrapper"]'),
39
+ legendTextInputField: () => cy.get('.legend-wrapper input'),
40
+ optionTextLabel: () => cy.get('[class*="FeedbackScaleOptionWrapper"] [class*="LabelWrapper"]'),
35
41
  addOptionButton: () => cy.get('.feedback-scale-add-option button'),
36
- optionAccordionPanel: () => cy.get('.feedback-scale-panel'),
37
- //Preview tab
42
+ colorSectionLabel: () => cy.get('[class*="FeedbackScalestyles__ColorLabelWrapper"]'),
43
+ defaultColorSchemeRadioButton: () => cy.get('[type="radio"][aria-label="Default color scheme"]'),
44
+ defaultColorSchemeRadioButtonLabel: () => cy.get('label[aria-label="Default color scheme"]'),
45
+ customColorsRadioButton: () => cy.get('[type="radio"][aria-label="Custom colors"]'),
46
+ customColorsRadioButtonLabel: () => cy.get('label[aria-label="Custom colors"]'),
47
+ colorLabel: () => cy.get('[class*="FeedbackScalestyles__RightHeader"]'),
48
+ optionLabel: () => cy.get('[class*="FeedbackScalestyles__LeftHeader"]'),
49
+ colorItemLabel: () => cy.get('.feedback-left-wrapper'),
50
+ colorSectionListItem: () => cy.get('.feedback-color-row'),
38
51
  feedbackButton: () => cy.get('.feedback-scale-label-btn'),
39
- previewTabColorBlock: () => cy.get('[class*="ColorDiv"]'),
40
- moreInfoOptionsList: () => cy.get('.options-list-item'),
41
- moreInfoButton: () => cy.get('.feedback-layout-accordion .ngie-accordion-summary'),
42
- moreInfoFeedbackLabel: () => cy.get('[class*="MoreInfostyles__LabelDiv"]'),
43
- moreInfoTooltipText: () => cy.get('.tooltip-text'),
44
- moreInfoDescriptionText: () => cy.get('.description-text'),
52
+ feedbackButtonLabelText: () => cy.get('[class*="FeedbackScalestyles__LabelText"]'),
53
+ feedbackButtonNumberText: () => cy.get('[class*="FeedbackScalestyles__NumberBox"]'),
54
+ colorPickerBlock: () => cy.get('.color-picker-block'),
55
+ feedbackButtonColorBlock: () => cy.get('[class*="FeedbackScalestyles__ColorBlock"]'),
56
+ legendTextOptionsList: () => cy.get('.more-info-wrapper .options-list-item'),
57
+ legendAccordion: () => cy.get('.more-info-wrapper .ngie-accordion-summary'),
58
+ legendTextFeedbackButtonLabel: () => cy.get('[class*="MoreInfostyles__OptionText"]'),
59
+ legendTextColorBlock: () => cy.get('[class*="ColorDiv"]'),
60
+ legendTextPreviewTab: () => cy.get('[class*="MoreInfostyles__LegendText"]'),
61
+ legendTextNumberBlock: () => cy.get('[class*="MoreInfostyles__NumberBox"]'),
62
+ legendTextStarIcon: () => cy.get('[class*="MoreInfostyles__StarWrapper"] svg'),
63
+ legendTextHeartIcon: () => cy.get('[class*="MoreInfostyles__StarWrapper"] svg'),
64
+ editColorButton: () => cy.get('.icon-pencil'),
65
+ thumbsUpFeedbackButton: () => cy.get('[role="button"][aria-label="Thumbs-Up"]'),
66
+ thumbsDownFeedbackButton: () => cy.get('[role="button"][aria-label="Thumbs-Down"]'),
67
+ thumbsUpButtonIcon: () => cy.get('[data-name="Thumbs up button"]'),
68
+ thumbsDownButtonIcon: () => cy.get('[data-name="Thumbs down button"]'),
69
+ feedbackScaleUILabel: () => cy.get('.feedback-scale-ui .options-label'),
70
+ starsFeedbackScaleUIButton: () => cy.get('[data-ngie-testid="stars-toggle-button"]'),
71
+ heartsFeedbackScaleUIButton: () => cy.get('[data-ngie-testid="hearts-toggle-button"]'),
45
72
  feedbackStarButton: () => cy.get('.feedback-scale-label-star-btn'),
46
- moreInfoStarIcon: () => cy.get('[class*="MoreInfostyles__IconWrapper"] svg'),
47
- studentResponseAreaAndLayoutLabel: () => cy.get('[class*="AdditionalOptionstyles__LayoutText"]'),
48
- displayAdditionalInformationCheckboxLabel: () => cy.get('[data-ngie-testid="display-additional-information-checkbox"] .MuiFormControlLabel-label'),
49
- displayAdditionalInformationCheckbox: () => cy.get('[data-ngie-testid="display-additional-information-checkbox"] input'),
50
- allowStudentsToAddCommentCheckboxLabel: () => cy.get('[data-ngie-testid="allow-students-to-add-comment-checkbox"] .MuiFormControlLabel-label'),
73
+ feedbackHeartButton: () => cy.get('.feedback-scale-label-star-btn'),
74
+ editColorButton: () => cy.get('.icon-pencil'),
51
75
  allowStudentsToAddCommentCheckbox: () => cy.get('[data-ngie-testid="allow-students-to-add-comment-checkbox"] input'),
52
- describeYourExperienceLabel: () => cy.get('.describe-your-experience .inline-text-property-label'),
53
- describeYourExperienceInputField: () => cy.get('.describe-your-experience input')
76
+ commentLabel: () => cy.get('.describe-your-experience .inline-text-property-label'),
77
+ commentInputField: () => cy.get('input[aria-label="Comment"]'),
54
78
  }
55
79
 
56
80
  const steps = {
@@ -58,72 +82,42 @@ const steps = {
58
82
  ...questionInstructionsComponent.steps,
59
83
  ...commonComponents.steps,
60
84
  ...additionalSettingsPanel.steps,
61
- ...ckEditorToolbar.steps,
62
- ...additionalSettingsPanel.steps,
63
- ...dialogBoxBase.steps,
64
- clickOnFeedbackStyleLayoutDropdown: () => {
65
- feedbackScalePage.feedbackLayoutStyleDropdown()
66
- .click();
67
- },
68
-
85
+ ...questionInstructionsComponent.steps,
86
+ ...autoScoredScoringPreviewTab.steps,
69
87
  /**
70
- * @param {string} dropdownOptionName option from the feedback layout style dropdown. Should be one of 'Button' or 'Star'
71
- * @description this function selects an option from the feedback layout style dropdown
88
+ * Adds legend text to a specific option in the Legend Text accordion.
89
+ * @param {number} optionIndex - The index of the option in the Legend Text accordion.
90
+ * @param {string} text - The legend text to be added.
72
91
  */
73
- selectFeedbackStyleLayoutDropdown: (dropdownOptionName) => {
74
- feedbackScalePage.feedbackLayoutStyleDropdownOptions(dropdownOptionName)
75
- .click();
92
+ addLegendText: (optionIndex, text) => {
93
+ utilities.getNthElement(feedbackScalePage.legendTextInputField(), optionIndex)
94
+ .type(text)
95
+ .blur();
76
96
  },
77
97
 
78
- /**
79
- * @param {string[]} dropdownOptions array of options of the feedback layout style dropdown
80
- * @description this function verifies the list options of the feedback layout style dropdown
81
- */
82
- verifyFeedbackStyleLayoutOptions: (dropdownOptions) => {
83
- dropdownOptions.forEach((option, count) => {
84
- feedbackScalePage.feedbackLayoutStyleDropdownOptions()
85
- .eq(count)
86
- .verifyInnerText(option);
87
- });
98
+ clearLegendTextInputField: (optionIndex) => {
99
+ utilities.getNthElement(feedbackScalePage.legendTextInputField(), optionIndex)
100
+ .clear();
88
101
  },
89
102
 
90
103
  /**
91
- * @param {number} optionAccordionIndex index of the option accordion
92
- * @description this function verifies if an option accordion is in expanded state
104
+ * @param {number} buttonIndex index of the feedback button
105
+ * @param {string} buttonText text content of the feedback button
106
+ * @description this function verifies the visibility and text content of a feedback button in the preview tab
93
107
  */
94
- verifyOptionAccordionInExpandedState: (optionAccordionIndex) => {
95
- feedbackScalePage.optionAccordion()
96
- .eq(optionAccordionIndex)
97
- .should('have.attr', 'aria-expanded', 'true');
108
+ verifyFeedbackButtonInPreviewTab: (buttonIndex, buttonText) => {
109
+ utilities.verifyInnerText(utilities.getNthElement(feedbackScalePage.feedbackButton(), buttonIndex), buttonText);
110
+ utilities.verifyElementVisibilityState(utilities.getNthElement(feedbackScalePage.feedbackButton(), buttonIndex), 'visible');
98
111
  },
99
112
 
100
113
  /**
101
- * @param {number} optionAccordionIndex index of the option accordion
102
- * @description this function verifies if an option accordion is in collapsed state
114
+ * Verifies the color block of a feedback button in the preview tab.
115
+ * @param {number} buttonIndex - The index of the feedback button.
116
+ * @param {string} colorBlock - The expected background color of the color block.
103
117
  */
104
- verifyOptionAccordionInCollapsedState: (optionAccordionIndex) => {
105
- feedbackScalePage.optionAccordion()
106
- .eq(optionAccordionIndex)
107
- .should('have.attr', 'aria-expanded', 'false');
108
- },
109
-
110
- /**
111
- * @param {number} optionAccordionIndex index of the option accordion
112
- * @param {string} optionAccordionLabelText label of the option accordion. for example: Option 1
113
- * @description this function verifies the contents that appear on an option accordion
114
- */
115
- verifyOptionAccordionPanelContents: (optionAccordionIndex, optionAccordionLabelText) => {
116
- feedbackScalePage.optionAccordion()
117
- .eq(optionAccordionIndex)
118
- .within(($element) => {
119
- feedbackScalePage.optionAccordionLabel()
120
- .verifyInnerText(optionAccordionLabelText);
121
- feedbackScalePage.deleteOptionAccordionButton()
122
- .should('be.visible');
123
- cy.wrap($element)
124
- .find('svg')
125
- .should('be.visible');
126
- });
118
+ verifyFeedbackButtonColorBlockPreviewTab: (buttonIndex, colorBlock) => {
119
+ utilities.getNthElement(feedbackScalePage.feedbackButtonColorBlock(), buttonIndex)
120
+ .should('have.css', 'background-color', colorBlock);
127
121
  },
128
122
 
129
123
  /**
@@ -131,219 +125,176 @@ const steps = {
131
125
  * @description this function expands an option accordion
132
126
  */
133
127
  expandOptionAccordion: (optionAccordionIndex) => {
134
- feedbackScalePage.optionAccordion()
135
- .eq(optionAccordionIndex)
128
+ utilities.getNthElement(feedbackScalePage.optionAccordion(), optionAccordionIndex)
136
129
  .click()
137
130
  .should('have.attr', 'aria-expanded', 'true');
138
131
  },
139
132
 
140
- /**
141
- * @param {number} optionAccordionIndex index of the option accordion
142
- * @description this function collapses an option accordion
143
- */
144
- collapseOptionAccordion: (optionAccordionIndex) => {
145
- feedbackScalePage.optionAccordion()
146
- .eq(optionAccordionIndex)
147
- .click()
133
+ verifyLegendAccordionExpandedState: () => {
134
+ feedbackScalePage.legendAccordion()
135
+ .should('have.attr', 'aria-expanded', 'true');
136
+ },
137
+
138
+ verifyLegendAccordionCollapsedState: () => {
139
+ feedbackScalePage.legendAccordion()
148
140
  .should('have.attr', 'aria-expanded', 'false');
149
141
  },
150
142
 
151
143
  /**
152
- * @param {number} optionAccordionIndex index of the option accordion
153
- * @param {string[]} contents array of labels, color, tooltip and description of an option accordion
154
- * @description this function verifies the contents in the input fields of an option accordion
155
- * @example verifyOptionAccordionInputFieldContents(0, {'labels': 'Comfortable', 'color': 'rgba(9, 179, 33, 1)', 'tooltip': 'I\'m feeling confident.', 'description': 'I am comfortable with the learning target.'})
144
+ * @param {number} buttonIndex index of the feedback button
145
+ * @description this function is used to click on a feedback button
156
146
  */
157
- verifyOptionAccordionInputFieldContents: (optionAccordionIndex, contents) => {
158
- feedbackScalePage.optionAccordionPanel()
159
- .eq(optionAccordionIndex)
160
- .within(() => {
161
- feedbackScalePage.labelsInputField()
162
- .should('have.value', contents['labels']);
163
- utilities.verifyCSS(colorPopupComponent.colorBlock(), {
164
- 'background-color': contents['color']
165
- });
166
- feedbackScalePage.tooltipInputField()
167
- .should('have.text', contents['tooltip']);
168
- feedbackScalePage.descriptionInputField()
169
- .should('have.text', contents['description']);
170
- });
147
+ clickOnFeedbackButton: (buttonIndex) => {
148
+ utilities.getNthElement(feedbackScalePage.feedbackButton(), buttonIndex)
149
+ .click();
171
150
  },
172
151
 
173
152
  /**
174
153
  * @param {number} buttonIndex index of the feedback button
175
- * @param {string} buttonText text content of the feedback button
176
- * @description this function verifies the visibility and text content of a feedback button in the preview tab
154
+ * @description this function verifies the selected state of a feedback button
177
155
  */
178
- verifyFeedbackButtonInPreviewTab: (buttonIndex, buttonText) => {
179
- feedbackScalePage.feedbackButton()
180
- .eq(buttonIndex)
181
- .should('have.text', buttonText)
182
- .and('be.visible');
156
+ verifyFeedbackButtonSelectedState: (buttonIndex) => {
157
+ utilities.getNthElement(feedbackScalePage.feedbackButton(), buttonIndex)
158
+ .should('have.class', 'selected-button');
183
159
  },
184
160
 
185
161
  /**
186
162
  * @param {number} buttonIndex index of the feedback button
187
- * @param {string} tooltipText text that appears on tooltip of the feedback button
188
- * @description this function verifies the tooltip text of a feedback button in the preview tab
189
- */
190
- verifyTooltipFeedbackButton: (buttonIndex, tooltipText) => {
191
- feedbackScalePage.feedbackButton()
192
- .eq(buttonIndex)
193
- .trigger('mouseover')
194
- commonComponents.tooltipText()
195
- .should('have.text', tooltipText)
196
- .and('be.visible')
197
- .within(() => {
198
- feedbackScalePage.previewTabColorBlock()
199
- .should('be.visible');
200
- });
201
- feedbackScalePage.feedbackButton()
202
- .eq(buttonIndex)
203
- .trigger('mouseout')
204
- commonComponents.tooltipText()
205
- .should('not.exist')
206
- },
207
-
208
- verifyMoreInfoAccordionInCollapsedState: () => {
209
- feedbackScalePage.moreInfoButton()
210
- .should('have.attr', 'aria-expanded', 'false');
211
- },
212
-
213
- verifyMoreInfoAccordionInExpandedState: () => {
214
- feedbackScalePage.moreInfoButton()
215
- .should('have.attr', 'aria-expanded', 'true');
163
+ * @description this function verifies the unselected state of a feedback button
164
+ */
165
+ verifyFeedbackButtonUnselectedState: (buttonIndex) => {
166
+ utilities.getNthElement(feedbackScalePage.feedbackButton(), buttonIndex)
167
+ .should('not.have.class', 'selected-button');
216
168
  },
217
169
 
218
- expandMoreInfoAccordion: () => {
219
- feedbackScalePage.moreInfoButton()
220
- .click()
221
- .should('have.attr', 'aria-expanded', 'true');
170
+ /**
171
+ * Verifies the disabled state of a feedback button.
172
+ * @param {number} buttonIndex - The index of the feedback button.
173
+ */
174
+ verifyFeedbackButtonDisabledState: (buttonIndex) => {
175
+ utilities.verifyElementDisabledClass(utilities.getNthElement(feedbackScalePage.feedbackButton(), buttonIndex));
222
176
  },
223
177
 
224
178
  /**
225
- * @param {number} itemIndex index of the more info list of a feedback button
226
- * @param {string[]} contents array of labels, tooltip and description of the more info list of a feedback button
227
- * @description this function verifies the label, tooltip and description texts of the more info accordion option list for a feedback button
179
+ * Verifies the color block, feedback button label, and legend text in the Legend Text accordion.
180
+ * @param {number} itemIndex - The index of the item in the Legend Text accordion.
181
+ * @param {Object} options - An object containing properties for colorBlock, buttonText, and legendText.
182
+ * @param {string} options.colorBlock - The expected background color of the color block.
183
+ * @param {string} options.buttonText - The expected text of the feedback button label.
184
+ * @param {string} options.legendText - The expected text of the legend text.
228
185
  */
229
- verifyMoreInfoAccordionOptionsListLabelTooltipAndDescription: (itemIndex, contentsArray) => {
230
- feedbackScalePage.moreInfoOptionsList()
231
- .eq(itemIndex)
186
+ verifyColorBlockFeedbackButtonLabelLegendTextInLegendAccordion: (itemIndex, { colorBlock, buttonText, legendText }) => {
187
+ utilities.getNthElement(feedbackScalePage.legendTextOptionsList(), itemIndex)
232
188
  .within(() => {
233
- feedbackScalePage.moreInfoFeedbackLabel()
234
- .should('have.text', contentsArray[0]);
235
- feedbackScalePage.moreInfoTooltipText()
236
- .should('have.text', contentsArray[1]);
237
- feedbackScalePage.moreInfoDescriptionText()
238
- .should('have.text', contentsArray[2]);
189
+ feedbackScalePage.legendTextColorBlock()
190
+ .should('have.css', 'background-color', colorBlock);
191
+ utilities.verifyInnerText(feedbackScalePage.legendTextFeedbackButtonLabel(), `${buttonText}:`);
192
+ utilities.verifyInnerText(feedbackScalePage.legendTextPreviewTab(), legendText);
239
193
  });
240
194
  },
241
195
 
196
+ expandFeedbackScaleStyleDropdown: () => {
197
+ feedbackScalePage.feedbackScaleStyleDropdown()
198
+ .click();
199
+ },
200
+
242
201
  /**
243
- * @param {number} buttonIndex index of the feedback button
244
- * @description this function is used to click on a feedback button
202
+ * @param {("Text" | "Numbers" | "Thumbs"| "Stars / Hearts")} dropdownOption aria-label of dropdown options
203
+ * @description this function selects dropdown option from feedback scale style dropdown
245
204
  */
246
- clickOnFeedbackButton: (buttonIndex) => {
247
- feedbackScalePage.feedbackButton()
248
- .eq(buttonIndex)
205
+ selectOptionFromFeedbackScaleStyleDropdown: (dropdownOption) => {
206
+ feedbackScalePage.feedbackScaleStyleDropdownListOptions(dropdownOption)
249
207
  .click();
250
208
  },
251
209
 
252
210
  /**
253
- * @param {number} buttonIndex index of the feedback button
254
- * @description this function verifies the selected state of a feedback button
211
+ * Verifies the count displayed in the options stepper input field.
212
+ * @param {number} value - The expected value to be displayed in the input field.
255
213
  */
256
- verifyFeedbackButtonSelectedState: (buttonIndex) => {
257
- feedbackScalePage.feedbackButton()
258
- .eq(buttonIndex)
259
- .should('have.class', 'selected-button');
214
+ verifyCountInOptionsStepperInputField: (value) => {
215
+ utilities.verifyInputFieldValue(feedbackScalePage.optionsStepperInputField(), value)
260
216
  },
261
217
 
262
218
  /**
263
- * @param {number} buttonIndex index of the feedback button
264
- * @description this function verifies the unselected state of a feedback button
219
+ * @description Decrease option input stepper count
220
+ * @param {number} increaseValue The value by which the option input stepper count is to be decreased
221
+ */
222
+ decreaseOptionsInputStepperCount: (increaseValue) => {
223
+ for (let index = 0; index < increaseValue; index++) {
224
+ feedbackScalePage.optionsStepperDecreaseButton()
225
+ .click();
226
+ };
227
+ },
228
+
229
+ /**
230
+ * @description Increase option input stepper count
231
+ * @param {number} increaseValue The value by which the option input stepper count is to be increased
265
232
  */
266
- verifyFeedbackButtonUnselectedState: (buttonIndex) => {
267
- feedbackScalePage.feedbackButton()
268
- .eq(buttonIndex)
269
- .should('not.have.class', 'selected-button');
233
+ increaseOptionsInputStepperCount: (increaseValue) => {
234
+ for (let index = 0; index < increaseValue; index++) {
235
+ feedbackScalePage.optionsStepperIncreaseButton()
236
+ .click();
237
+ };
270
238
  },
271
239
 
272
240
  /**
273
- * @param {number} itemIndex index of the more info list of a feedback button/star
274
- * @description this function verifies the highlighted state of the more info list of a feedback button/star
241
+ * Verifies the properties of an options accordion.
242
+ * @param {number} optionAccordionIndex - The index of the options accordion.
243
+ * @param {Object} properties - An object containing properties for the options accordion.
244
+ * @param {string} properties.optionLabel - The expected label of the options accordion.
245
+ * @param {number} properties.Points - The expected points associated with the options accordion.
275
246
  */
276
- verifyMoreInfoOptionListHighlightedState: (itemIndex) => {
277
- feedbackScalePage.moreInfoOptionsList()
278
- .eq(itemIndex)
279
- .should('have.css', 'border', `1px solid ${css.color.activeComponentBorder}`);
247
+ verifyOptionsAccordionProperties: (optionAccordionIndex, { optionLabel, Points }) => {
248
+ utilities.getNthElement(feedbackScalePage.optionAccordion(), optionAccordionIndex)
249
+ .within(() => {
250
+ utilities.verifyInnerText(feedbackScalePage.optionAccordionLabel(), optionLabel);
251
+ utilities.verifyInnerText(feedbackScalePage.optionAccordionPointsLabel(), `Points:\n${Points}`);
252
+ utilities.verifyElementVisibilityState(feedbackScalePage.deleteOptionAccordionButton(), 'visible');
253
+ });
280
254
  },
281
255
 
282
256
  /**
283
- * @param {number} itemIndex index of the more info list of a feedback button/star
284
- * @description this function verifies that the more info list of a feedback button/star is not in the highlighted state
257
+ * Verifies the collapsed state of an options accordion.
258
+ * @param {number} optionAccordionIndex - The index of the options accordion.
285
259
  */
286
- verifyMoreInfoOptionListHighlightedStateNotExists: (itemIndex) => {
287
- feedbackScalePage.moreInfoOptionsList()
288
- .eq(itemIndex)
289
- .should('not.have.css', 'border', `1px solid ${css.color.activeComponentBorder}`);
260
+ verifyOptionAccordionCollapsedState: (optionAccordionIndex) => {
261
+ utilities.getNthElement(feedbackScalePage.optionAccordion(), optionAccordionIndex)
262
+ .should('have.attr', 'aria-expanded', 'false');
290
263
  },
291
264
 
292
265
  /**
293
- * @param {number} buttonIndex index of the feedback star button
294
- * @param {string} tooltipText text that appears on tooltip of the feedback button
295
- * @description this function verifies the tooltip text of a feedback star button in the preview tab
266
+ * Verifies the expanded state of an options accordion.
267
+ * @param {number} optionAccordionIndex - The index of the options accordion.
296
268
  */
297
- verifyTooltipFeedbackStarButton: (buttonIndex, tooltipText) => {
298
- feedbackScalePage.feedbackStarButton()
299
- .eq(buttonIndex)
300
- .trigger('mouseover')
301
- commonComponents.tooltipText()
302
- .should('have.text', tooltipText)
303
- .and('be.visible')
304
- .within(() => {
305
- utilities.verifyElementVisibilityState(feedbackScalePage.previewTabColorBlock(), 'notExist');
306
- });
307
- feedbackScalePage.feedbackStarButton()
308
- .eq(buttonIndex)
309
- .trigger('mouseout')
310
- utilities.verifyElementVisibilityState(commonComponents.tooltipText(), 'notExist');
269
+ verifyOptionAccordionExpandedState: (optionAccordionIndex) => {
270
+ utilities.getNthElement(feedbackScalePage.optionAccordion(), optionAccordionIndex)
271
+ .should('have.attr', 'aria-expanded', 'true');
311
272
  },
312
273
 
313
274
  /**
314
- * @param {number} buttonIndex index of the feedback star button
315
- * @description this function is used to click on a feedback star button
275
+ * Verifies the placeholder of the legend text input field in an options accordion.
276
+ * @param {number} optionAccordionIndex - The index of the options accordion.
316
277
  */
317
- clickOnFeedbackStarButton: (buttonIndex) => {
318
- feedbackScalePage.feedbackStarButton()
319
- .eq(buttonIndex)
320
- .click();
278
+ verifyLegendTextInputFieldPlaceholder: (optionAccordionIndex) => {
279
+ utilities.getNthElement(feedbackScalePage.legendTextInputField(), optionAccordionIndex)
280
+ .should('have.attr', 'placeholder', 'Enter legend text');
321
281
  },
322
282
 
323
283
  /**
324
- * @param {number} buttonIndex index of the feedback button
325
- * @description this function verifies the selected state of a feedback star button
326
- */
327
- verifyFeedbackStarButtonSelectedState: (buttonIndexArray, color) => {
328
- buttonIndexArray.forEach((button) => {
329
- feedbackScalePage.feedbackStarButton()
330
- .eq(button)
331
- .find('svg')
332
- .should('have.css', 'fill', color);
333
- });
284
+ * Verifies that the placeholder of the legend text input field in an options accordion does not exist.
285
+ * @param {number} optionAccordionIndex - The index of the options accordion.
286
+ */
287
+ verifyLegendTextInputFieldPlaceholderNotExists: (optionAccordionIndex) => {
288
+ utilities.getNthElement(feedbackScalePage.legendTextInputField(), optionAccordionIndex)
289
+ .should('not.have.attr', 'placeholder');
334
290
  },
335
291
 
336
292
  /**
337
- * @param {number} buttonIndex index of the feedback button
338
- * @description this function verifies the unselected state of a feedback star button
339
- */
340
- verifyFeedbackStarButtonUnselectedState: (buttonIndexArray) => {
341
- buttonIndexArray.forEach((button) => {
342
- feedbackScalePage.feedbackStarButton()
343
- .eq(button)
344
- .find('svg')
345
- .should('have.css', 'fill', css.color.defaultBackground);
346
- });
293
+ * Verifies the count of options accordions.
294
+ * @param {number} count - The expected count of options accordions.
295
+ */
296
+ verifyOptionsAccordionCount: (count) => {
297
+ utilities.verifyElementCount(feedbackScalePage.optionAccordion(), count);
347
298
  },
348
299
 
349
300
  addOption: () => {
@@ -356,339 +307,530 @@ const steps = {
356
307
  * @description this function is used to delete an option accordion
357
308
  */
358
309
  deleteOptionAccordion: (optionAccordionIndex) => {
359
- feedbackScalePage.deleteOptionAccordionButton()
360
- .eq(optionAccordionIndex)
310
+ utilities.getNthElement(feedbackScalePage.deleteOptionAccordionButton(), optionAccordionIndex)
361
311
  .click();
362
312
  },
363
313
 
364
314
  /**
365
- * @param {number} optionAccordionIndex index of the option accordion
366
- * @description this function is used to focus in a tooltip input field of an option accordion
315
+ * Verifies the color of a color picker block.
316
+ *
317
+ * @param {number} blockIndex - The index of the color picker block.
318
+ * @param {string} color - The expected background color of the color picker block.
319
+ */
320
+ verifyColorPickerBlockColor: (blockIndex, color) => {
321
+ utilities.verifyCSS(utilities.getNthElement(feedbackScalePage.colorPickerBlock(), blockIndex), {
322
+ 'background-color': color
323
+ });
324
+ },
325
+
326
+ /**
327
+ * Verifies the number block, feedback button label, and legend text in the Legend Text accordion.
328
+ *
329
+ * @param {number} buttonIndex - The index of the button in the Legend Text accordion.
330
+ * @param {string} legendText - The expected text of the legend text.
367
331
  */
368
- focusInTooltipInputField: (optionAccordionIndex) => {
369
- feedbackScalePage.optionAccordionPanel()
370
- .eq(optionAccordionIndex)
332
+ verifyNumberBlockFeedbackButtonLabelLegendTextInLegendAccordion: (buttonIndex, legendText) => {
333
+ utilities.getNthElement(feedbackScalePage.legendTextOptionsList(), buttonIndex)
371
334
  .within(() => {
372
- feedbackScalePage.tooltipInputField()
373
- .focus();
335
+ utilities.verifyInnerText(feedbackScalePage.legendTextNumberBlock(), `${buttonIndex + 1}`);
336
+ utilities.verifyInnerText(feedbackScalePage.legendTextPreviewTab(), legendText);
374
337
  });
375
338
  },
376
339
 
377
340
  /**
378
- * @param {number} optionAccordionIndex index of the option accordion
379
- * @description this function is used to focus in a description input field of an option accordion
341
+ * Clicks on the edit color button.
342
+ * @param {number} buttonIndex - The index of the edit color button.
343
+ */
344
+ editColor: (buttonIndex) => {
345
+ utilities.getNthElement(feedbackScalePage.editColorButton(), buttonIndex)
346
+ .click();
347
+ },
348
+
349
+ /**
350
+ * Verifies the selected state color of a feedback button.
351
+ * @param {number} buttonIndex - The index of the feedback button.
352
+ * @param {string} colorBlock - The expected background color of the feedback button.
380
353
  */
381
- focusInDescriptionInputField: (optionAccordionIndex) => {
382
- feedbackScalePage.optionAccordionPanel()
383
- .eq(optionAccordionIndex)
354
+ verifyFeedbackButtonSelectedStateColor: (buttonIndex, colorBlock) => {
355
+ utilities.getNthElement(feedbackScalePage.feedbackButton(), buttonIndex)
356
+ .should('have.css', 'background-color', colorBlock);
357
+ },
358
+
359
+ /**
360
+ * Verifies the number blocks in the Legend Text accordion.
361
+ * @param {number} itemIndex - The index of the item in the Legend Text accordion.
362
+ */
363
+ verifyNumberBlocksInLegendAccordion: (itemIndex) => {
364
+ utilities.getNthElement(feedbackScalePage.legendTextOptionsList(), itemIndex)
384
365
  .within(() => {
385
- feedbackScalePage.descriptionInputField()
386
- .focus();
366
+ utilities.verifyInnerText(feedbackScalePage.legendTextNumberBlock(), `${itemIndex + 1}`);
387
367
  });
388
368
  },
389
369
 
390
370
  /**
391
- * @param {number} optionAccordionIndex index of the option accordion
392
- * @description this function is used to add input to the tooltip input field of an option accordion
371
+ * Verifies the text label of an option in the feedback scale options accordion.
372
+ * @param {number} optionAccordionIndex - The index of the option accordion.
373
+ * @returns {void}
393
374
  */
394
- addInputToTooltipInputField: (optionAccordionIndex, textContent) => {
395
- feedbackScalePage.optionAccordionPanel()
396
- .eq(optionAccordionIndex)
375
+ verifyOptionTextLabel: (optionAccordionIndex) => {
376
+ utilities.getNthElement(feedbackScalePage.optionAccordionWrapper(), optionAccordionIndex)
397
377
  .within(() => {
398
- feedbackScalePage.tooltipInputField()
399
- .type(textContent);
378
+ utilities.verifyInnerText(utilities.getNthElement(feedbackScalePage.optionTextLabel(), 0), 'Option text');
400
379
  });
401
380
  },
402
381
 
403
382
  /**
404
- * @param {number} optionAccordionIndex index of the option accordion
405
- * @description this function is used to add input to the labels input field of an option accordion
383
+ * Verifies the text label of the legend in the feedback scale options accordion.
384
+ * @param {number} optionAccordionIndex - The index of the option accordion.
385
+ * @returns {void}
406
386
  */
407
- addInputToLabelsInputField: (optionAccordionIndex, textContent) => {
408
- feedbackScalePage.optionAccordionPanel()
409
- .eq(optionAccordionIndex)
387
+ verifyLegendTextLabel: (optionAccordionIndex) => {
388
+ utilities.getNthElement(feedbackScalePage.optionAccordionWrapper(), optionAccordionIndex)
410
389
  .within(() => {
411
- feedbackScalePage.labelsInputField()
412
- .type(textContent)
413
- .blur();
390
+ utilities.verifyInnerText(feedbackScalePage.legendTextLabel(), 'Legend text');
414
391
  });
415
392
  },
416
393
 
417
394
  /**
418
- * @param {number} optionAccordionIndex index of the option accordion
419
- * @description this function verifies image in tooltip input field of an option accordion
395
+ * Verifies the input field text value of an option in the feedback scale options accordion.
396
+ * @param {number} optionAccordionIndex - The index of the option accordion.
397
+ * @param {string} text - The expected text value of the input field.
398
+ * @returns {void}
420
399
  */
421
- verifyImageAndAltTextInTooltipInputField: (optionAccordionIndex) => {
422
- feedbackScalePage.optionAccordionPanel()
423
- .eq(optionAccordionIndex)
400
+ verifyOptionInputFieldText: (optionAccordionIndex, text) => {
401
+ utilities.getNthElement(feedbackScalePage.optionAccordionWrapper(), optionAccordionIndex)
424
402
  .within(() => {
425
- feedbackScalePage.tooltipInputField()
426
- .find('img')
427
- .should('have.attr', 'src', constants.foxImageLink)
428
- .and('have.attr', 'alt', constants.foxImageAltText);
403
+ utilities.verifyInputFieldValue(feedbackScalePage.optionTextInputField(), text)
429
404
  });
430
405
  },
431
406
 
432
407
  /**
433
- * @param {number} optionAccordionIndex index of the option accordion
434
- * @description this function is used to add bold text to the description input field of an option accordion
408
+ * Verifies the properties of an options accordion for thumbs feedback scale style.
409
+ * @param {number} optionAccordionIndex - The index of the options accordion.
410
+ * @param {Object} properties - An object containing properties for the options accordion.
411
+ * @param {string} properties.optionLabel - The expected label of the options accordion.
412
+ * @param {number} properties.Points - The expected points associated with the options accordion.
435
413
  */
436
- addInputToDescriptionInputField: (optionAccordionIndex, textContent) => {
437
- feedbackScalePage.optionAccordionPanel()
438
- .eq(optionAccordionIndex)
414
+ verifyOptionsAccordionPropertiesForThumbsScale: (optionAccordionIndex, { optionLabel, Points }) => {
415
+ utilities.getNthElement(feedbackScalePage.optionAccordion(), optionAccordionIndex)
439
416
  .within(() => {
440
- feedbackScalePage.descriptionInputField()
441
- .type(textContent);
417
+ utilities.verifyInnerText(feedbackScalePage.optionAccordionLabel(), optionLabel);
418
+ utilities.verifyInnerText(feedbackScalePage.optionAccordionPointsLabel(), `Points:\n${Points}`);
419
+ utilities.verifyElementVisibilityState(feedbackScalePage.deleteOptionAccordionButton(), 'notExist');
442
420
  });
443
421
  },
444
422
 
445
423
  /**
446
- * @param {number} optionAccordionIndex index of the option accordion
447
- * @description this function is used to clear the tooltip input field of an option accordion
424
+ * Verifies the thumbs down button in the legend text accordion.
425
+ * @param {string} buttonText - The expected text of the thumbs down button.
426
+ * @returns {void}
448
427
  */
449
- clearTooltipInputField: (optionAccordionIndex) => {
450
- feedbackScalePage.optionAccordionPanel()
451
- .eq(optionAccordionIndex)
428
+ verifyThumbsDownButtonInLegendAccordion: (buttonText) => {
429
+ utilities.getNthElement(feedbackScalePage.legendTextOptionsList(), 0)
452
430
  .within(() => {
453
- feedbackScalePage.tooltipInputField()
454
- .clear();
431
+ utilities.verifyElementVisibilityState(feedbackScalePage.thumbsDownButtonIcon(), 'visible')
432
+ utilities.verifyInnerText(feedbackScalePage.legendTextFeedbackButtonLabel(), buttonText);
455
433
  });
456
434
  },
457
435
 
458
436
  /**
459
- * @param {number} optionAccordionIndex index of the option accordion
460
- * @description this function is used to clear the description input field of an option accordion
437
+ * Verifies the thumbs up button in the legend text accordion.
438
+ * @param {string} buttonText - The expected text of the thumbs up button.
439
+ * @returns {void}
461
440
  */
462
- clearDescriptionInputField: (optionAccordionIndex) => {
463
- feedbackScalePage.optionAccordionPanel()
464
- .eq(optionAccordionIndex)
441
+ verifyThumbsUpButtonInLegendAccordion: (buttonText) => {
442
+ utilities.getNthElement(feedbackScalePage.legendTextOptionsList(), 1)
465
443
  .within(() => {
466
- feedbackScalePage.descriptionInputField()
467
- .clear();
444
+ utilities.verifyElementVisibilityState(feedbackScalePage.thumbsUpButtonIcon(), 'visible')
445
+ utilities.verifyInnerText(feedbackScalePage.legendTextFeedbackButtonLabel(), buttonText);
468
446
  });
469
447
  },
470
448
 
471
449
  /**
472
- * @param {number} optionAccordionIndex index of the option accordion
473
- * @description this function is used to verify bold text in the description input field of an option accordion
450
+ * Verifies the legend text in the legend text accordion.
451
+ * @param {number} buttonIndex - The index of the legend text accordion.
452
+ * @param {string} legendText - The expected text of the legend text.
453
+ * @returns {void}
474
454
  */
475
- verifyBoldTextInDescriptionInputField: (optionAccordionIndex, textContent) => {
476
- feedbackScalePage.optionAccordionPanel()
477
- .eq(optionAccordionIndex)
455
+ verifyLegendTextInLegendAccordion: (buttonIndex, legendText) => {
456
+ utilities.getNthElement(feedbackScalePage.legendTextOptionsList(), buttonIndex)
478
457
  .within(() => {
479
- feedbackScalePage.descriptionInputField()
480
- .find('strong')
481
- .should('exist')
482
- .should('have.text', textContent);
458
+ utilities.verifyInnerText(feedbackScalePage.legendTextPreviewTab(), legendText);
483
459
  });
484
460
  },
485
461
 
462
+ clickOnThumbsUpButton: () => {
463
+ feedbackScalePage.thumbsUpFeedbackButton()
464
+ .click();
465
+ },
466
+
467
+ verifyThumbsUpButtonSelectedState: () => {
468
+ feedbackScalePage.thumbsUpFeedbackButton()
469
+ .should('have.attr', 'aria-pressed', 'true');
470
+ },
471
+
472
+ clickOnThumbsDownButton: () => {
473
+ feedbackScalePage.thumbsDownFeedbackButton()
474
+ .click();
475
+ },
476
+
477
+ verifyThumbsDownButtonSelectedState: () => {
478
+ feedbackScalePage.thumbsDownFeedbackButton()
479
+ .should('have.attr', 'aria-pressed', 'true');
480
+ },
481
+
486
482
  /**
487
- * @param {number} buttonIndex index of the feedback button
488
- * @description this function is used to verify an image in tooltip of a feedback button
483
+ * Verifies the selected state color of the thumbs up button.
484
+ * @param {string} color - The expected color of the selected state of the thumbs up button.
485
+ * @returns {void}
489
486
  */
490
- verifyTooltipImageFeedbackButton: (buttonIndex) => {
491
- feedbackScalePage.feedbackButton()
492
- .eq(buttonIndex)
493
- .trigger('mouseover');
494
- commonComponents.tooltipText()
495
- .and('be.visible')
496
- .find('img')
497
- .should('have.attr', 'src', constants.foxImageLink)
498
- .and('have.attr', 'alt', constants.foxImageAltText);
499
- feedbackScalePage.feedbackButton()
500
- .eq(buttonIndex)
501
- .trigger('mouseout')
502
- commonComponents.tooltipText()
503
- .should('not.exist');
487
+ verifyThumbsUpButtonSelectedStateColor: (color) => {
488
+ feedbackScalePage.thumbsUpFeedbackButton().find('circle').eq(1)
489
+ .should('have.css', 'fill', color);
490
+ },
491
+
492
+ verifyStarsFeedbackScaleUIButtonSelectedState: () => {
493
+ feedbackScalePage.starsFeedbackScaleUIButton()
494
+ .should('have.attr', 'aria-pressed', 'true');
504
495
  },
505
496
 
506
497
  /**
507
- * @param {number} buttonIndex index of the feedback star button
508
- * @param {string} textContent is the text that appears on the tooltip
509
- * @description this function is used to verify bold text on a tooltip of a feedback star button
498
+ * Selects a feedback scale UI button.
499
+ * @param {('Stars' | 'Hearts')} button - The type of feedback scale UI button to select .
500
+ * @throws {Error} Thrown if an invalid feedback scale style is provided.
510
501
  */
511
- verifyTooltipBoldTextFeedbackStarButton: (buttonIndex, textContent) => {
512
- feedbackScalePage.feedbackStarButton()
513
- .eq(buttonIndex)
514
- .trigger('mouseover');
515
- commonComponents.tooltipText()
516
- .and('be.visible')
517
- .find('strong')
518
- .should('exist')
519
- .should('have.text', textContent);
520
- feedbackScalePage.feedbackStarButton()
521
- .eq(buttonIndex)
522
- .trigger('mouseout')
523
- commonComponents.tooltipText()
524
- .should('not.exist');
502
+ selectFeedbackScaleUIButton: (button) => {
503
+ switch (button) {
504
+ case 'Stars':
505
+ feedbackScalePage.starsFeedbackScaleUIButton()
506
+ .click()
507
+ .should('have.attr', 'aria-pressed', 'true');
508
+ break;
509
+ case 'Hearts':
510
+ feedbackScalePage.heartsFeedbackScaleUIButton()
511
+ .click()
512
+ .should('have.attr', 'aria-pressed', 'true');
513
+ break;
514
+ default:
515
+ throw new Error('Invalid feedback scale style');
516
+ }
525
517
  },
526
518
 
527
519
  /**
528
- * @param {number} itemIndex index of the more info list item
529
- * @description this function is used to verify color block in more info list item for button layout
520
+ * Verifies the highlighted stars and un-highlighted stars in the legend text item specified by buttonIndex.
521
+ * @param {number} buttonIndex - The index of the legend text item in the list.
522
+ * @returns {void}
530
523
  */
531
- verifyMoreInfoAccordionColorBlock: (itemIndex, color) => {
532
- feedbackScalePage.moreInfoOptionsList()
533
- .eq(itemIndex)
524
+ verifyHighlightedStarsInLegendTextListItem: (buttonIndex) => {
525
+ utilities.getNthElement(feedbackScalePage.legendTextOptionsList(), buttonIndex)
534
526
  .within(() => {
535
- feedbackScalePage.previewTabColorBlock()
536
- .should('have.css', 'background-color', color);
527
+ feedbackScalePage.legendTextStarIcon()
528
+ .then(($stars) => {
529
+ const totalStars = $stars.length;
530
+ for (let index = 0; index < buttonIndex + 1; index++) {
531
+ expect($stars.eq(index)).to.have.css('fill', 'rgb(102, 102, 102)');
532
+ }
533
+ for (let index = buttonIndex + 1; index < totalStars; index++) {
534
+ expect($stars.eq(index)).to.have.css('fill', 'none');
535
+ }
536
+ });
537
537
  });
538
538
  },
539
539
 
540
540
  /**
541
- * @param {number} itemIndex index of the more info list item
542
- * @description this function is used to verify the number of stars in more info list item for star layout
541
+ * @param {number} buttonIndex index of the feedback star button
542
+ * @description this function is used to click on a feedback star button
543
543
  */
544
- verifyMoreInfoAccordionStarIcons: (itemIndex) => {
545
- feedbackScalePage.moreInfoOptionsList()
546
- .eq(itemIndex)
547
- .within(() => {
548
- feedbackScalePage.moreInfoStarIcon()
549
- .should('have.length', itemIndex + 1);
550
- });
544
+ clickOnFeedbackStarButton: (buttonIndex) => {
545
+ utilities.getNthElement(feedbackScalePage.feedbackStarButton(), buttonIndex)
546
+ .click();
551
547
  },
552
548
 
553
549
  /**
554
- * @param {number} itemIndex index of the more info list item
555
- * @description this function is used to verify the label, image tooltip and bold description text in more info list item
550
+ * Verifies the highlighted stars and un-highlighted stars in the feedback scale up to the specified buttonIndex.
551
+ * @param {number} buttonIndex - The index of the last highlighted star in the feedback scale.
552
+ * @param {string} fillColor - The expected fill color of the highlighted stars.
553
+ * @returns {void}
556
554
  */
557
- verifyMoreInfoOptionListLabelTooltipAndDescriptionForImageTooltipAndBoldDescription: (itemIndex) => {
558
- feedbackScalePage.moreInfoOptionsList()
559
- .eq(itemIndex)
560
- .within(() => {
561
- feedbackScalePage.moreInfoFeedbackLabel()
562
- .should('have.text', 'Comfortable');
563
- feedbackScalePage.moreInfoTooltipText()
564
- .find('img')
565
- .should('have.attr', 'src', constants.foxImageLink)
566
- .and('have.attr', 'alt', constants.foxImageAltText);
567
- feedbackScalePage.moreInfoDescriptionText()
568
- .find('strong')
569
- .should('exist')
570
- .should('have.text', 'I\'m very comfortable with the learning target');
555
+ verifyHighlightedStarsInFeedbackScale: (buttonIndex, fillColor) => {
556
+ feedbackScalePage.feedbackStarButton()
557
+ .then(($stars) => {
558
+ const totalStars = $stars.length;
559
+ for (let index = 0; index <= buttonIndex; index++) {
560
+ expect($stars.find('g g g').eq(index)).to.have.css('fill', fillColor);
561
+ }
562
+ for (let index = buttonIndex + 1; index < totalStars; index++) {
563
+ expect($stars.find('g g g').eq(index)).to.have.css('fill', 'none');
564
+ }
571
565
  });
572
566
  },
573
567
 
574
568
  /**
575
- * @param {number} itemIndex index of the more info list item
576
- * @description this function is used to verify the label, bold tooltip text and image description in more info list item
569
+ * Verifies the highlighted hearts and un-highlighted hearts in the legend text item specified by buttonIndex.
570
+ * @param {number} buttonIndex - The index of the legend text item in the list.
571
+ * @returns {void}
577
572
  */
578
- verifyMoreInfoOptionListLabelTooltipAndDescriptionForBoldTooltipAndImageDescription: (itemIndex) => {
579
- feedbackScalePage.moreInfoOptionsList()
580
- .eq(itemIndex)
573
+ verifyHighlightedHeartsInLegendTextListItem: (buttonIndex) => {
574
+ utilities.getNthElement(feedbackScalePage.legendTextOptionsList(), buttonIndex)
581
575
  .within(() => {
582
- feedbackScalePage.moreInfoFeedbackLabel()
583
- .should('have.text', '100%');
584
- feedbackScalePage.moreInfoTooltipText()
585
- .find('strong')
586
- .should('exist')
587
- .should('have.text', 'Keep up the good work!');
588
- feedbackScalePage.moreInfoDescriptionText()
589
- .find('img')
590
- .should('have.attr', 'src', constants.foxImageLink)
591
- .and('have.attr', 'alt', constants.foxImageAltText);
576
+ feedbackScalePage.legendTextHeartIcon()
577
+ .then(($hearts) => {
578
+ const totalHearts = $hearts.length;
579
+ for (let index = 0; index < buttonIndex + 1; index++) {
580
+ expect($hearts.find('g').eq(index)).to.have.css('fill', 'rgb(102, 102, 102)');
581
+ }
582
+ for (let index = buttonIndex + 1; index < totalHearts; index++) {
583
+ expect($hearts.find('g').eq(index)).to.have.css('fill', 'none');
584
+ }
585
+ });
592
586
  });
593
587
  },
594
588
 
595
- verifyDisplayAdditionalInformationCheckboxCheckedState: () => {
596
- feedbackScalePage.displayAdditionalInformationCheckbox()
597
- .should('be.checked');
589
+ /**
590
+ * @param {number} buttonIndex index of the feedback star button
591
+ * @description this function is used to click on a feedback star button
592
+ */
593
+ clickOnFeedbackHeartButton: (buttonIndex) => {
594
+ utilities.getNthElement(feedbackScalePage.feedbackHeartButton(), buttonIndex)
595
+ .click();
598
596
  },
599
597
 
600
- verifyDisplayAdditionalInformationCheckboxUncheckedState: () => {
601
- feedbackScalePage.displayAdditionalInformationCheckbox()
602
- .should('not.be.checked');
598
+ /**
599
+ * Verifies the highlighted hearts and un-highlighted hearts in the feedback scale up to the specified buttonIndex.
600
+ * @param {number} buttonIndex - The index of the last highlighted heart in the feedback scale.
601
+ * @param {string} fillColor - The expected fill color of the highlighted hearts.
602
+ * @returns {void}
603
+ */
604
+ verifyHighlightedHeartsInFeedbackScale: (buttonIndex, fillColor) => {
605
+ feedbackScalePage.feedbackHeartButton()
606
+ .then(($hearts) => {
607
+ const totalHearts = $hearts.length;
608
+ for (let index = 0; index <= buttonIndex; index++) {
609
+ expect($hearts.find('g').eq(index)).to.have.css('fill', fillColor);
610
+ }
611
+ for (let index = buttonIndex + 1; index < totalHearts; index++) {
612
+ expect($hearts.find('g').eq(index)).to.have.css('fill', 'none');
613
+ }
614
+ });
603
615
  },
604
616
 
605
- verifyAllowStudentsToAddCommentCheckboxCheckedState: () => {
617
+ checkAllowStudentsToAddCommentCheckbox: () => {
606
618
  feedbackScalePage.allowStudentsToAddCommentCheckbox()
619
+ .click()
607
620
  .should('be.checked');
608
621
  },
609
622
 
610
- verifyAllowStudentsToAddCommentCheckboxUncheckedState: () => {
611
- feedbackScalePage.allowStudentsToAddCommentCheckbox()
612
- .should('not.be.checked');
623
+ /**
624
+ * Enters text into the comment input field and then blurs the field.
625
+ * @param {string} text - The text to be entered into the comment input field.
626
+ */
627
+ enterTextInCommentInputField: (text) => {
628
+ feedbackScalePage.commentInputField()
629
+ .type(text)
630
+ .blur();
631
+ },
632
+
633
+ /**
634
+ * Verifies that the comment input field contains the expected text.
635
+ * @param {string} text - The expected text in the comment input field.
636
+ */
637
+ verifyTextInCommentInputField: (text) => {
638
+ utilities.verifyInputFieldValue(feedbackScalePage.commentInputField(), text)
613
639
  },
614
640
 
615
- uncheckDisplayAdditionalInformationCheckbox: () => {
616
- feedbackScalePage.displayAdditionalInformationCheckbox()
641
+ collapseLegendAccordion: () => {
642
+ feedbackScalePage.legendAccordion()
617
643
  .click()
618
- .should('not.be.checked');
644
+ .should('have.attr', 'aria-expanded', 'false');
619
645
  },
620
646
 
621
- checkAllowStudentsToAddCommentCheckbox: () => {
622
- feedbackScalePage.allowStudentsToAddCommentCheckbox()
647
+ expandLegendAccordion: () => {
648
+ feedbackScalePage.legendAccordion()
623
649
  .click()
624
- .should('be.checked');
650
+ .should('have.attr', 'aria-expanded', 'true');
651
+ },
652
+
653
+ /**
654
+ * Enters text into the text input field of the specified option and then blurs the field.
655
+ * @param {number} optionIndex - The index of the option.
656
+ * @param {string} text - The text to be entered into the option's text input field.
657
+ */
658
+ enterTextInOptionTextInputField: (optionIndex, text) => {
659
+ utilities.getNthElement(feedbackScalePage.optionTextInputField(), optionIndex)
660
+ .type(text)
661
+ .blur();
625
662
  },
626
663
 
627
664
  /**
628
- * @param {string} textContent text to be entered in describe your experience input field
629
- * @description this function is used to add input to the describe your experience input field
665
+ * Verifies that the text input field of the specified option contains the expected text.
666
+ * @param {number} optionIndex - The index of the option.
667
+ * @param {string} text - The expected text in the option's text input field.
630
668
  */
631
- addInputToDescribeYourExperienceInputField: (textContent) => {
632
- feedbackScalePage.describeYourExperienceInputField()
633
- .type(textContent, { delay: 0 })
634
- .blur()
635
- .focus()
636
- .should('have.value', textContent)
669
+ verifyTextInOptionTextInputField: (optionIndex, text) => {
670
+ utilities.verifyInputFieldValue(utilities.getNthElement(feedbackScalePage.optionTextInputField(), optionIndex), text)
637
671
  },
638
672
 
639
- hoverOnFeedBackButton: () => {
640
- feedbackScalePage.feedbackButton().eq(0)
641
- .trigger('mouseover')
673
+ /**
674
+ * Verifies the label of the option accordion at the specified index.
675
+ * @param {number} optionAccordionIndex - The index of the option accordion.
676
+ * @param {string} optionLabel - The expected label of the option accordion.
677
+ */
678
+ verifyOptionsAccordionLabel: (optionAccordionIndex, optionLabel) => {
679
+ utilities.getNthElement(feedbackScalePage.optionAccordion(), optionAccordionIndex)
680
+ .within(() => {
681
+ utilities.verifyInnerText(feedbackScalePage.optionAccordionLabel(), optionLabel);
682
+ });
642
683
  },
643
684
 
644
- hoverAwayFromFeedbackButton: () => {
645
- feedbackScalePage.feedbackButton().eq(0)
646
- .trigger('mouseout')
685
+ expandDefaultTextDropdown: () => {
686
+ feedbackScalePage.defaultTextDropdown()
687
+ .click();
647
688
  },
648
689
 
649
690
  /**
650
- * @param {number} buttonIndex index of the feedback button
651
- * @param {string} color to be verified present on the tooltip of a feedback button in rgb format
652
- */
653
- verifyColorBlockOnFeedbackButtonTooltip: (buttonIndex, color) => {
654
- feedbackScalePage.feedbackButton()
655
- .eq(buttonIndex)
656
- .trigger('mouseover')
657
- commonComponents.tooltipText()
658
- .and('be.visible')
691
+ * Selects an option from the default text dropdown list.
692
+ * @param {string} dropdownOption - The option to be selected from the dropdown list.
693
+ * @example - selectOptionFromDefaultTextDropdown('Uncomfortable / Need some support / Comfortable');
694
+ */
695
+ selectOptionFromDefaultTextDropdown: (dropdownOption) => {
696
+ feedbackScalePage.defaultTextDropdownListOptions(dropdownOption)
697
+ .click();
698
+ },
699
+
700
+ /**
701
+ * Verifies the placeholder of the option text input field in an options accordion.
702
+ * @param {number} optionAccordionIndex - The index of the options accordion.
703
+ */
704
+ verifyOptionTextInputFieldPlaceholder: (optionAccordionIndex) => {
705
+ utilities.getNthElement(feedbackScalePage.optionTextInputField(), optionAccordionIndex)
706
+ .should('have.attr', 'placeholder', 'Enter option text');
707
+ },
708
+
709
+ /**
710
+ * Verifies that the placeholder of the option text input field in an options accordion does not exist.
711
+ * @param {number} optionAccordionIndex - The index of the options accordion.
712
+ */
713
+ verifyOptionTextInputFieldPlaceholderNotExists: (optionAccordionIndex) => {
714
+ utilities.getNthElement(feedbackScalePage.optionTextInputField(), optionAccordionIndex)
715
+ .should('not.have.attr', 'placeholder');
716
+ },
717
+
718
+ /**
719
+ * Clears the text input field of the option at the specified index.
720
+ * @param {number} optionIndex - The index of the option.
721
+ */
722
+ clearOptionTextInputField: (optionIndex) => {
723
+ utilities.getNthElement(feedbackScalePage.optionTextInputField(), optionIndex)
724
+ .clear()
725
+ },
726
+
727
+ /**
728
+ * Clears the text input field of the options stepper and then inputs the specified value.
729
+ * @param {string} value - The value to input into the options stepper input field.
730
+ */
731
+ addInputToOptionStepperInputField: (value) => {
732
+ feedbackScalePage.optionsStepperInputField()
733
+ .clear()
734
+ .type(value)
735
+ .blur();
736
+ },
737
+
738
+ /**
739
+ * Verifies the count of feedback buttons in the preview tab.
740
+ * @param {number} count - The expected count of feedback buttons.
741
+ */
742
+ verifyFeedbackButtonCountPreviewTab: (count) => {
743
+ utilities.verifyElementCount(feedbackScalePage.feedbackButton(), count);
744
+ },
745
+
746
+ /**
747
+ * Verifies the count of legend items in the preview tab.
748
+ * @param {number} count - The expected count of legend items
749
+ */
750
+ verifyLegendItemCountPreviewTab: (count) => {
751
+ utilities.verifyElementCount(feedbackScalePage.legendTextOptionsList(), count);
752
+ },
753
+
754
+ /**
755
+ * Verifies the contents of the color section list item at the specified index.
756
+ * @param {number} itemIndex - The index of the color section list item.
757
+ * @param {Object} options - The options object.
758
+ * @param {string} options.label - The expected label of the color section list item.
759
+ * @param {string} options.colorBlock - The expected color block of the color section list item.
760
+ */
761
+ verifyColorSectionListItemContents: (itemIndex, { label, colorBlock }) => {
762
+ utilities.getNthElement(feedbackScalePage.colorSectionListItem(), itemIndex)
659
763
  .within(() => {
660
- utilities.verifyCSS(feedbackScalePage.previewTabColorBlock(), {
661
- 'background-color': color
662
- });
764
+ utilities.verifyInnerText(feedbackScalePage.colorItemLabel(), label);
765
+ utilities.verifyElementVisibilityState(feedbackScalePage.editColorButton(), 'visible');
663
766
  });
664
- feedbackScalePage.feedbackButton()
665
- .eq(buttonIndex)
666
- .trigger('mouseout')
667
- commonComponents.tooltipText()
668
- .should('not.exist')
767
+ steps.verifyColorPickerBlockColor(itemIndex, colorBlock);
768
+ },
769
+
770
+ /**
771
+ * Selects a color section button.
772
+ * @param {('Default color scheme' | 'Custom colors')} option - The type of color scheme to select .
773
+ * @throws {Error} Thrown if an invalid radio button is provided.
774
+ */
775
+ selectColorSectionRadioButton: (option) => {
776
+ switch (option) {
777
+ case 'Default color scheme':
778
+ feedbackScalePage.defaultColorSchemeRadioButton()
779
+ .click()
780
+ .should('be.checked');
781
+ break;
782
+ case 'Custom colors':
783
+ feedbackScalePage.customColorsRadioButton()
784
+ .click()
785
+ .should('be.checked');
786
+ break;
787
+ default:
788
+ throw new Error('Invalid radio button');
789
+ }
790
+ },
791
+
792
+ verifyDefaultColorSchemeRadioButtonCheckedState: () => {
793
+ feedbackScalePage.defaultColorSchemeRadioButton()
794
+ .should('be.checked');
795
+ },
796
+
797
+ verifyCustomColorsRadioButtonCheckedState: () => {
798
+ feedbackScalePage.customColorsRadioButton()
799
+ .should('be.checked');
669
800
  },
670
801
 
671
802
  /**
672
- * @param {number} itemIndex index of the more info list item
673
- * @param {string} color to be verified present in more info list item in rgb format
674
- * @description this function is used to verify the color of stars in more info list item for star layout
803
+ * Verifies the color block of the legend accordion item at the specified index.
804
+ * @param {number} itemIndex - The index of the legend accordion item.
805
+ * @param {string} colorBlock - The expected background color of the color block.
675
806
  */
676
- verifyMoreInfoAccordionStarIconsColor: (itemIndex, color) => {
677
- feedbackScalePage.moreInfoOptionsList()
678
- .eq(itemIndex)
807
+ verifyColorBlockLegendAccordion: (itemIndex, colorBlock) => {
808
+ utilities.getNthElement(feedbackScalePage.legendTextOptionsList(), itemIndex)
679
809
  .within(() => {
680
- utilities.verifyCSS(feedbackScalePage.moreInfoStarIcon(), {
681
- 'fill': color
682
- });
810
+ feedbackScalePage.legendTextColorBlock()
811
+ .should('have.css', 'background-color', colorBlock);
683
812
  });
684
- },
813
+ }
685
814
  }
686
815
 
687
816
  const tests = {
688
817
  ...questionInstructionsComponent.tests,
689
818
  ...additionalSettingsPanel.tests,
690
819
  ...createQuestionBasePage.tests,
691
- ...commonComponents.tests
820
+ ...commonComponents.tests,
821
+ verifyLegendAccordionDefaultState: () => {
822
+ it('A \'Legend\' accordion should be present and by default it should be in expanded state', () => {
823
+ utilities.verifyInnerText(feedbackScalePage.legendAccordion(), 'Legend');
824
+ feedbackScalePage.steps.verifyLegendAccordionExpandedState();
825
+ });
826
+ },
827
+
828
+ verifyLegendAccordionCollapsedAndExpandedState: () => {
829
+ it('The user should be able to collapse and expand the legend accordion', () => {
830
+ feedbackScalePage.steps.collapseLegendAccordion();
831
+ feedbackScalePage.steps.expandLegendAccordion();
832
+ })
833
+ }
692
834
  }
693
835
 
694
836
  export const feedbackScalePage = {