itemengine-cypress-automation 1.0.167-repoUpdate10April-1465c8c.0 → 1.0.169-uploadResponseMigration-83ab996.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (113) hide show
  1. package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/allOrNothingBasicForAllViews.smoke.js +2 -2
  2. package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/clickAndDrop.js +11 -22
  3. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/clickAndDrop.js +7 -18
  4. package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/clickAndDrop.js +6 -11
  5. package/cypress/e2e/ILC/Graphing/previewContentsForAllViews.smoke.js +1 -0
  6. package/cypress/e2e/ILC/Graphing/toolsControlsAndBackgroundSection.js +36 -2
  7. package/cypress/e2e/ILC/GridFill/allOrNothingBasicForAllViews.smoke.js +34 -22
  8. package/cypress/e2e/ILC/GridFill/checkAnswerFunctionalityForAllViews.smoke.js +24 -8
  9. package/cypress/e2e/ILC/GridFill/previewContentsForAllViews.smoke.js +25 -5
  10. package/cypress/e2e/ILC/GridFill/scoring/allOrNothingAlternativePointsGreaterThanCorrectPoints.js +114 -68
  11. package/cypress/e2e/ILC/GridFill/scoring/allOrNothingCorrectPointsEqualToAlternativePoints.js +111 -67
  12. package/cypress/e2e/ILC/GridFill/scoring/allOrNothingCorrectPointsGreaterThanAlternativePoints.js +123 -71
  13. package/cypress/e2e/ILC/GridFill/scoring/allOrNothingScoringCellShadeCount.js +63 -41
  14. package/cypress/e2e/ILC/GridFill/scoring/manuallyAndNonScored.js +25 -21
  15. package/cypress/e2e/ILC/GridFill/scoring/partialEqualWeightsBasic.js +85 -50
  16. package/cypress/e2e/ILC/GridFill/scoring/partialEqualWeightsWithAlternativePointsGreaterThanCorrectPoints.js +115 -68
  17. package/cypress/e2e/ILC/GridFill/scoring/partialEqualWeightsWithCorrectPointsEqualToAlternativePoints.js +98 -54
  18. package/cypress/e2e/ILC/GridFill/scoring/partialEqualWeightsWithCorrectPointsGreaterThanAlternativePoints.js +120 -72
  19. package/cypress/e2e/ILC/GridFill/studentViewSettingsSection.js +3 -3
  20. package/cypress/e2e/ILC/Matching/specifyCorrectAnswerSection.js +1 -1
  21. package/cypress/e2e/ILC/ToolSettings/toolSettingsContent.js +4 -4
  22. package/cypress/fixtures/theme/ilc.json +26 -14
  23. package/cypress/pages/components/autoScoredScoringSectionMultiResponseType.js +1 -1
  24. package/cypress/pages/components/autoScoredSpecifyCorrectAnswerSection.js +0 -3
  25. package/cypress/pages/components/autoScoredStudentViewSettings.js +1 -1
  26. package/cypress/pages/components/colorPopupComponent.js +2 -2
  27. package/cypress/pages/components/gridQuestionCommonComponent.js +2 -629
  28. package/cypress/pages/components/index.js +0 -3
  29. package/cypress/pages/components/maximumCapacityPerDropzoneComponent.js +1 -1
  30. package/cypress/pages/components/measuringToolComponent.js +2 -2
  31. package/cypress/pages/components/scoringSectionBaseEditTab.js +1 -1
  32. package/cypress/pages/components/setPointsPopupBase.js +4 -6
  33. package/cypress/pages/components/specifyRowsAndColumnsComponent.js +3 -60
  34. package/cypress/pages/components/toolSettingsComponent.js +12 -80
  35. package/cypress/pages/dragAndDropIntoCategoriesPage.js +8 -0
  36. package/cypress/pages/feedbackScalePage.js +449 -591
  37. package/cypress/pages/fillInTheGapsOverImageDragAndDropPage.js +1 -3
  38. package/cypress/pages/graphingPage.js +145 -9
  39. package/cypress/pages/gridFillPage.js +120 -135
  40. package/cypress/pages/highlightPage.js +394 -0
  41. package/cypress/pages/index.js +2 -5
  42. package/cypress/pages/matchingPage.js +20 -78
  43. package/cypress/pages/multipleSelectionGridPage.js +1 -88
  44. package/cypress/pages/singleSelectionGridPage.js +0 -86
  45. package/cypress/support/migrationHelpers/extractLrnQuestionData.js +38 -1
  46. package/cypress/support/migrationHelpers/lrnQestionTypesENUM.js +1 -0
  47. package/cypress/support/migrationHelpers/migrationScript.js +4 -0
  48. package/cypress/support/migrationHelpers/verifyIeQuestionData.js +34 -2
  49. package/package.json +1 -1
  50. package/cypress/e2e/ILC/BrainingCampManipulative/additionalSettings.js +0 -83
  51. package/cypress/e2e/ILC/BrainingCampManipulative/editTabBasicSection.js +0 -200
  52. package/cypress/e2e/ILC/BrainingCampManipulative/editTabScoringSection.js +0 -56
  53. package/cypress/e2e/ILC/BrainingCampManipulative/gradingViewAndCorrectAnswerViewContents.smoke.js +0 -95
  54. package/cypress/e2e/ILC/BrainingCampManipulative/headerSection.js +0 -71
  55. package/cypress/e2e/ILC/BrainingCampManipulative/previewTabContent.smoke.js +0 -72
  56. package/cypress/e2e/ILC/BrainingCampManipulative/toolSettings.js +0 -71
  57. package/cypress/e2e/ILC/EssayResponse/essayResponseAdditionalSettings.js +0 -432
  58. package/cypress/e2e/ILC/EssayResponse/essayResponseAdditionalSettingsBasic.js +0 -134
  59. package/cypress/e2e/ILC/FeedbackScaleNew/feedbackScaleStylePreviewTab.js +0 -161
  60. package/cypress/e2e/ILC/FeedbackScaleNew/numbersFeedbackScaleStyle.js +0 -308
  61. package/cypress/e2e/ILC/FeedbackScaleNew/previewContentsForAllViews.smoke.js +0 -216
  62. package/cypress/e2e/ILC/FeedbackScaleNew/starsHeartsFeedbackScaleStyle.js +0 -336
  63. package/cypress/e2e/ILC/FeedbackScaleNew/textFeedbackScaleStyle.js +0 -570
  64. package/cypress/e2e/ILC/FeedbackScaleNew/thumbsFeedbackScaleStyle.js +0 -214
  65. package/cypress/e2e/ILC/FillInTheGapsDragAndDrop/fillInTheGapsDragAndDropAdditionalSettings.js +0 -356
  66. package/cypress/e2e/ILC/FillInTheGapsDragAndDrop/fillInTheGapsDragAndDropAdditionalSettingsResponseAccordion.js +0 -299
  67. package/cypress/e2e/ILC/Graphing/Scoring/allOrNothingWithCorrectPointsEqualToAlternatePoints.js +0 -355
  68. package/cypress/e2e/ILC/Matching/maximumCapacityPerDropzoneSection.js +0 -309
  69. package/cypress/e2e/ILC/Matching/toolSettings.js +0 -72
  70. package/cypress/e2e/ILC/MultipleSelectionGridNew/editTabBasicSection.js +0 -1033
  71. package/cypress/e2e/ILC/MultipleSelectionGridNew/test.js +0 -28
  72. package/cypress/e2e/ILC/NumberLine/Scoring/allOrNothingWithAlternatePointsGreaterThanCorrectPoints.js +0 -236
  73. package/cypress/e2e/ILC/NumberLine/Scoring/allOrNothingWithCorrectPointsEqualToAlternatePoints.js +0 -239
  74. package/cypress/e2e/ILC/NumberLine/Scoring/allOrNothingWithCorrectPointsGreaterThanAlternativePoints.js +0 -278
  75. package/cypress/e2e/ILC/NumberLine/Scoring/manualAndNonScoredScoring.js +0 -178
  76. package/cypress/e2e/ILC/NumberLine/Scoring/partialEqualWeightsBasic.js +0 -407
  77. package/cypress/e2e/ILC/NumberLine/Scoring/partialEqualWeightsWithAlternatePointsGreaterThanCorrectPoints.js +0 -273
  78. package/cypress/e2e/ILC/NumberLine/Scoring/partialEqualWeightsWithCorrectPointsGreaterThanAlternatePoints.js +0 -278
  79. package/cypress/e2e/ILC/NumberLine/Scoring/partialEqualWeigtsWithCorrectPointsEqualToAlternatePoints.js +0 -228
  80. package/cypress/e2e/ILC/NumberLine/additionalSettings.js +0 -120
  81. package/cypress/e2e/ILC/NumberLine/allOrNothingScoringForAllViews.smoke.js +0 -659
  82. package/cypress/e2e/ILC/NumberLine/checkAnswerFunctionalityForAllViews.smoke.js +0 -149
  83. package/cypress/e2e/ILC/NumberLine/editTabScoringSection.js +0 -151
  84. package/cypress/e2e/ILC/NumberLine/gradingViewAndCorrectAnswerView.smoke.js +0 -171
  85. package/cypress/e2e/ILC/NumberLine/headerSection.js +0 -76
  86. package/cypress/e2e/ILC/NumberLine/minimumScoringPenaltyPointsAndRoundingDropdown.js +0 -54
  87. package/cypress/e2e/ILC/NumberLine/previewTabContentsForAllViews.smoke.js +0 -200
  88. package/cypress/e2e/ILC/NumberLine/specifyCorrectAnswerSection.js +0 -67
  89. package/cypress/e2e/ILC/NumberLine/studentViewSettings.js +0 -135
  90. package/cypress/e2e/ILC/NumberLine/toolSettings.js +0 -73
  91. package/cypress/e2e/ILC/NumberLine/toolsAndControls.js +0 -372
  92. package/cypress/e2e/ILC/SingleSelectionGridNew/editTabBasicSection.js +0 -1014
  93. package/cypress/e2e/ILC/TextSelection/Scoring/allOrNothingAlternatePointsMoreThanCorrectPoints.js +0 -235
  94. package/cypress/e2e/ILC/TextSelection/Scoring/allOrNothingCorrectPointsEqualToAlternatePoints.js +0 -235
  95. package/cypress/e2e/ILC/TextSelection/Scoring/allOrNothingCorrectPointsMoreThanAlternatePoints.js +0 -235
  96. package/cypress/e2e/ILC/TextSelection/Scoring/partialDifferentWeightsBasic.js +0 -457
  97. package/cypress/e2e/ILC/TextSelection/Scoring/partialDifferentWeightsWithAlternativePointsGreaterThanCorrectPoints.js +0 -342
  98. package/cypress/e2e/ILC/TextSelection/Scoring/partialDifferentWeightsWithCorrectPointsEqualToAlternativePoints.js +0 -342
  99. package/cypress/e2e/ILC/TextSelection/Scoring/partialDifferentWeightsWithCorrectPointsGreaterThanAlternativePoints.js +0 -342
  100. package/cypress/e2e/ILC/TextSelection/Scoring/partialEqualWeightsBasic.js +0 -155
  101. package/cypress/e2e/ILC/TextSelection/Scoring/partialEqualWeightsWithAlternativePointsGreaterThanCorrectPoints.js +0 -314
  102. package/cypress/e2e/ILC/TextSelection/Scoring/partialEqualWeightsWithCorrectPointsEqualToAlternativePoints.js +0 -275
  103. package/cypress/e2e/ILC/TextSelection/Scoring/partialEqualWeightsWithCorrectPointsGreaterThanAlternativePoints.js +0 -314
  104. package/cypress/e2e/ILC/TextSelection/allOrNothingScoringForAllViews.smoke.js +0 -290
  105. package/cypress/e2e/ILC/TextSelection/checkAnswerFunctionalityForAllViews.smoke.js +0 -142
  106. package/cypress/e2e/ILC/TextSelection/previewContentsForAllViews.js +0 -137
  107. package/cypress/pages/brainingCampManipulativePage.js +0 -122
  108. package/cypress/pages/components/defaultToolDropdown.js +0 -77
  109. package/cypress/pages/components/resetPopupComponent.js +0 -74
  110. package/cypress/pages/components/toolsAndControlsComponent.js +0 -69
  111. package/cypress/pages/feedbackScalePage copy.js +0 -716
  112. package/cypress/pages/numberLinePage.js +0 -723
  113. package/cypress/pages/textSelectionPage.js +0 -582
@@ -1,80 +1,56 @@
1
- import { additionalSettingsPanel, commonComponents, createQuestionBasePage, questionInstructionsComponent, autoScoredScoringPreviewTab } from "./components"
1
+ import constants from "../fixtures/constants";
2
+ import { additionalSettingsPanel, ckEditorToolbar, colorPopupComponent, commonComponents, createQuestionBasePage, questionInstructionsComponent } from "./components"
3
+ import { dialogBoxBase } from "./dialogBoxBase";
2
4
  import utilities from "../support/helpers/utilities";
5
+ import { selectQuestionResourceToolPage } from "./selectQuestionResourceToolPage";
3
6
  const css = Cypress.env('css');
4
7
 
5
8
  const selectors = {
6
9
  ...questionInstructionsComponent,
7
10
  ...commonComponents,
11
+ ...ckEditorToolbar,
8
12
  ...additionalSettingsPanel,
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) => {
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) => {
13
18
  if (ariaLabel) {
14
- return cy.get(`[aria-labelledby*="feedback-scale-style-dropdown-label"] [role="option"][aria-label*="${ariaLabel}"]`)
19
+ return cy.get(`[aria-labelledby*="feedback-layout-style-dropdown-label"] [role="option"][aria-label*="${ariaLabel}"]`)
15
20
  } else {
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"]')
21
+ return cy.get('[aria-labelledby*="feedback-layout-style-dropdown-label"] [role="option"]')
30
22
  }
31
23
  },
24
+ feedbackScaleLabel: () => cy.get('.feedback-scale-panel-heading'),
32
25
  optionAccordion: () => cy.get('.feedback-scale-panel .ngie-accordion-summary'),
33
- optionAccordionWrapper: () => cy.get('.feedback-scale-panel'),
34
26
  optionAccordionLabel: () => cy.get('.feedback-scale-panel-label'),
35
- optionAccordionPointsLabel: () => cy.get('.feedback-scale-points'),
36
27
  deleteOptionAccordionButton: () => cy.get('[aria-label*="Delete Option"]'),
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"]'),
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"]'),
41
35
  addOptionButton: () => cy.get('.feedback-scale-add-option button'),
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'),
36
+ optionAccordionPanel: () => cy.get('.feedback-scale-panel'),
37
+ //Preview tab
51
38
  feedbackButton: () => cy.get('.feedback-scale-label-btn'),
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"]'),
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'),
72
45
  feedbackStarButton: () => cy.get('.feedback-scale-label-star-btn'),
73
- feedbackHeartButton: () => cy.get('.feedback-scale-label-star-btn'),
74
- editColorButton: () => cy.get('.icon-pencil'),
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'),
75
51
  allowStudentsToAddCommentCheckbox: () => cy.get('[data-ngie-testid="allow-students-to-add-comment-checkbox"] input'),
76
- commentLabel: () => cy.get('.describe-your-experience .inline-text-property-label'),
77
- commentInputField: () => cy.get('input[aria-label="Comment"]'),
52
+ describeYourExperienceLabel: () => cy.get('.describe-your-experience .inline-text-property-label'),
53
+ describeYourExperienceInputField: () => cy.get('.describe-your-experience input')
78
54
  }
79
55
 
80
56
  const steps = {
@@ -82,42 +58,72 @@ const steps = {
82
58
  ...questionInstructionsComponent.steps,
83
59
  ...commonComponents.steps,
84
60
  ...additionalSettingsPanel.steps,
85
- ...questionInstructionsComponent.steps,
86
- ...autoScoredScoringPreviewTab.steps,
61
+ ...ckEditorToolbar.steps,
62
+ ...additionalSettingsPanel.steps,
63
+ ...dialogBoxBase.steps,
64
+ clickOnFeedbackStyleLayoutDropdown: () => {
65
+ feedbackScalePage.feedbackLayoutStyleDropdown()
66
+ .click();
67
+ },
68
+
87
69
  /**
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.
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
91
72
  */
92
- addLegendText: (optionIndex, text) => {
93
- utilities.getNthElement(feedbackScalePage.legendTextInputField(), optionIndex)
94
- .type(text)
95
- .blur();
73
+ selectFeedbackStyleLayoutDropdown: (dropdownOptionName) => {
74
+ feedbackScalePage.feedbackLayoutStyleDropdownOptions(dropdownOptionName)
75
+ .click();
96
76
  },
97
77
 
98
- clearLegendTextInputField: (optionIndex) => {
99
- utilities.getNthElement(feedbackScalePage.legendTextInputField(), optionIndex)
100
- .clear();
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
+ });
101
88
  },
102
89
 
103
90
  /**
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
91
+ * @param {number} optionAccordionIndex index of the option accordion
92
+ * @description this function verifies if an option accordion is in expanded state
107
93
  */
108
- verifyFeedbackButtonInPreviewTab: (buttonIndex, buttonText) => {
109
- utilities.verifyInnerText(utilities.getNthElement(feedbackScalePage.feedbackButton(), buttonIndex), buttonText);
110
- utilities.verifyElementVisibilityState(utilities.getNthElement(feedbackScalePage.feedbackButton(), buttonIndex), 'visible');
94
+ verifyOptionAccordionInExpandedState: (optionAccordionIndex) => {
95
+ feedbackScalePage.optionAccordion()
96
+ .eq(optionAccordionIndex)
97
+ .should('have.attr', 'aria-expanded', 'true');
111
98
  },
112
99
 
113
100
  /**
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.
101
+ * @param {number} optionAccordionIndex index of the option accordion
102
+ * @description this function verifies if an option accordion is in collapsed state
117
103
  */
118
- verifyFeedbackButtonColorBlockPreviewTab: (buttonIndex, colorBlock) => {
119
- utilities.getNthElement(feedbackScalePage.feedbackButtonColorBlock(), buttonIndex)
120
- .should('have.css', 'background-color', colorBlock);
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
+ });
121
127
  },
122
128
 
123
129
  /**
@@ -125,176 +131,219 @@ const steps = {
125
131
  * @description this function expands an option accordion
126
132
  */
127
133
  expandOptionAccordion: (optionAccordionIndex) => {
128
- utilities.getNthElement(feedbackScalePage.optionAccordion(), optionAccordionIndex)
134
+ feedbackScalePage.optionAccordion()
135
+ .eq(optionAccordionIndex)
129
136
  .click()
130
137
  .should('have.attr', 'aria-expanded', 'true');
131
138
  },
132
139
 
133
- verifyLegendAccordionExpandedState: () => {
134
- feedbackScalePage.legendAccordion()
135
- .should('have.attr', 'aria-expanded', 'true');
136
- },
137
-
138
- verifyLegendAccordionCollapsedState: () => {
139
- feedbackScalePage.legendAccordion()
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()
140
148
  .should('have.attr', 'aria-expanded', 'false');
141
149
  },
142
150
 
143
151
  /**
144
- * @param {number} buttonIndex index of the feedback button
145
- * @description this function is used to click on a feedback button
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.'})
146
156
  */
147
- clickOnFeedbackButton: (buttonIndex) => {
148
- utilities.getNthElement(feedbackScalePage.feedbackButton(), buttonIndex)
149
- .click();
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
+ });
150
171
  },
151
172
 
152
173
  /**
153
174
  * @param {number} buttonIndex index of the feedback button
154
- * @description this function verifies the selected state of a 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
155
177
  */
156
- verifyFeedbackButtonSelectedState: (buttonIndex) => {
157
- utilities.getNthElement(feedbackScalePage.feedbackButton(), buttonIndex)
158
- .should('have.class', 'selected-button');
178
+ verifyFeedbackButtonInPreviewTab: (buttonIndex, buttonText) => {
179
+ feedbackScalePage.feedbackButton()
180
+ .eq(buttonIndex)
181
+ .should('have.text', buttonText)
182
+ .and('be.visible');
159
183
  },
160
184
 
161
185
  /**
162
186
  * @param {number} buttonIndex index of the feedback button
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');
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')
168
206
  },
169
207
 
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));
208
+ verifyMoreInfoAccordionInCollapsedState: () => {
209
+ feedbackScalePage.moreInfoButton()
210
+ .should('have.attr', 'aria-expanded', 'false');
176
211
  },
177
212
 
178
- /**
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.
185
- */
186
- verifyColorBlockFeedbackButtonLabelLegendTextInLegendAccordion: (itemIndex, { colorBlock, buttonText, legendText }) => {
187
- utilities.getNthElement(feedbackScalePage.legendTextOptionsList(), itemIndex)
188
- .within(() => {
189
- feedbackScalePage.legendTextColorBlock()
190
- .should('have.css', 'background-color', colorBlock);
191
- utilities.verifyInnerText(feedbackScalePage.legendTextFeedbackButtonLabel(), `${buttonText}:`);
192
- utilities.verifyInnerText(feedbackScalePage.legendTextPreviewTab(), legendText);
193
- });
213
+ verifyMoreInfoAccordionInExpandedState: () => {
214
+ feedbackScalePage.moreInfoButton()
215
+ .should('have.attr', 'aria-expanded', 'true');
194
216
  },
195
217
 
196
- expandFeedbackScaleStyleDropdown: () => {
197
- feedbackScalePage.feedbackScaleStyleDropdown()
198
- .click();
218
+ expandMoreInfoAccordion: () => {
219
+ feedbackScalePage.moreInfoButton()
220
+ .click()
221
+ .should('have.attr', 'aria-expanded', 'true');
199
222
  },
200
223
 
201
224
  /**
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
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
204
228
  */
205
- selectOptionFromFeedbackScaleStyleDropdown: (dropdownOption) => {
206
- feedbackScalePage.feedbackScaleStyleDropdownListOptions(dropdownOption)
207
- .click();
229
+ verifyMoreInfoAccordionOptionsListLabelTooltipAndDescription: (itemIndex, contentsArray) => {
230
+ feedbackScalePage.moreInfoOptionsList()
231
+ .eq(itemIndex)
232
+ .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]);
239
+ });
208
240
  },
209
241
 
210
242
  /**
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.
243
+ * @param {number} buttonIndex index of the feedback button
244
+ * @description this function is used to click on a feedback button
213
245
  */
214
- verifyCountInOptionsStepperInputField: (value) => {
215
- utilities.verifyInputFieldValue(feedbackScalePage.optionsStepperInputField(), value)
246
+ clickOnFeedbackButton: (buttonIndex) => {
247
+ feedbackScalePage.feedbackButton()
248
+ .eq(buttonIndex)
249
+ .click();
216
250
  },
217
251
 
218
252
  /**
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
- };
253
+ * @param {number} buttonIndex index of the feedback button
254
+ * @description this function verifies the selected state of a feedback button
255
+ */
256
+ verifyFeedbackButtonSelectedState: (buttonIndex) => {
257
+ feedbackScalePage.feedbackButton()
258
+ .eq(buttonIndex)
259
+ .should('have.class', 'selected-button');
227
260
  },
228
261
 
229
262
  /**
230
- * @description Increase option input stepper count
231
- * @param {number} increaseValue The value by which the option input stepper count is to be increased
263
+ * @param {number} buttonIndex index of the feedback button
264
+ * @description this function verifies the unselected state of a feedback button
232
265
  */
233
- increaseOptionsInputStepperCount: (increaseValue) => {
234
- for (let index = 0; index < increaseValue; index++) {
235
- feedbackScalePage.optionsStepperIncreaseButton()
236
- .click();
237
- };
266
+ verifyFeedbackButtonUnselectedState: (buttonIndex) => {
267
+ feedbackScalePage.feedbackButton()
268
+ .eq(buttonIndex)
269
+ .should('not.have.class', 'selected-button');
238
270
  },
239
271
 
240
272
  /**
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.
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
246
275
  */
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
- });
276
+ verifyMoreInfoOptionListHighlightedState: (itemIndex) => {
277
+ feedbackScalePage.moreInfoOptionsList()
278
+ .eq(itemIndex)
279
+ .should('have.css', 'border', `1px solid ${css.color.activeComponentBorder}`);
254
280
  },
255
281
 
256
282
  /**
257
- * Verifies the collapsed state of an options accordion.
258
- * @param {number} optionAccordionIndex - The index of the options accordion.
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
259
285
  */
260
- verifyOptionAccordionCollapsedState: (optionAccordionIndex) => {
261
- utilities.getNthElement(feedbackScalePage.optionAccordion(), optionAccordionIndex)
262
- .should('have.attr', 'aria-expanded', 'false');
286
+ verifyMoreInfoOptionListHighlightedStateNotExists: (itemIndex) => {
287
+ feedbackScalePage.moreInfoOptionsList()
288
+ .eq(itemIndex)
289
+ .should('not.have.css', 'border', `1px solid ${css.color.activeComponentBorder}`);
263
290
  },
264
291
 
265
292
  /**
266
- * Verifies the expanded state of an options accordion.
267
- * @param {number} optionAccordionIndex - The index of the options accordion.
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
268
296
  */
269
- verifyOptionAccordionExpandedState: (optionAccordionIndex) => {
270
- utilities.getNthElement(feedbackScalePage.optionAccordion(), optionAccordionIndex)
271
- .should('have.attr', 'aria-expanded', 'true');
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');
272
311
  },
273
312
 
274
313
  /**
275
- * Verifies the placeholder of the legend text input field in an options accordion.
276
- * @param {number} optionAccordionIndex - The index of the options accordion.
314
+ * @param {number} buttonIndex index of the feedback star button
315
+ * @description this function is used to click on a feedback star button
277
316
  */
278
- verifyLegendTextInputFieldPlaceholder: (optionAccordionIndex) => {
279
- utilities.getNthElement(feedbackScalePage.legendTextInputField(), optionAccordionIndex)
280
- .should('have.attr', 'placeholder', 'Enter legend text');
317
+ clickOnFeedbackStarButton: (buttonIndex) => {
318
+ feedbackScalePage.feedbackStarButton()
319
+ .eq(buttonIndex)
320
+ .click();
281
321
  },
282
322
 
283
323
  /**
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');
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
+ });
290
334
  },
291
335
 
292
336
  /**
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);
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
+ });
298
347
  },
299
348
 
300
349
  addOption: () => {
@@ -307,530 +356,339 @@ const steps = {
307
356
  * @description this function is used to delete an option accordion
308
357
  */
309
358
  deleteOptionAccordion: (optionAccordionIndex) => {
310
- utilities.getNthElement(feedbackScalePage.deleteOptionAccordionButton(), optionAccordionIndex)
359
+ feedbackScalePage.deleteOptionAccordionButton()
360
+ .eq(optionAccordionIndex)
311
361
  .click();
312
362
  },
313
363
 
314
364
  /**
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.
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
331
367
  */
332
- verifyNumberBlockFeedbackButtonLabelLegendTextInLegendAccordion: (buttonIndex, legendText) => {
333
- utilities.getNthElement(feedbackScalePage.legendTextOptionsList(), buttonIndex)
368
+ focusInTooltipInputField: (optionAccordionIndex) => {
369
+ feedbackScalePage.optionAccordionPanel()
370
+ .eq(optionAccordionIndex)
334
371
  .within(() => {
335
- utilities.verifyInnerText(feedbackScalePage.legendTextNumberBlock(), `${buttonIndex + 1}`);
336
- utilities.verifyInnerText(feedbackScalePage.legendTextPreviewTab(), legendText);
372
+ feedbackScalePage.tooltipInputField()
373
+ .focus();
337
374
  });
338
375
  },
339
376
 
340
377
  /**
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.
353
- */
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.
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
362
380
  */
363
- verifyNumberBlocksInLegendAccordion: (itemIndex) => {
364
- utilities.getNthElement(feedbackScalePage.legendTextOptionsList(), itemIndex)
381
+ focusInDescriptionInputField: (optionAccordionIndex) => {
382
+ feedbackScalePage.optionAccordionPanel()
383
+ .eq(optionAccordionIndex)
365
384
  .within(() => {
366
- utilities.verifyInnerText(feedbackScalePage.legendTextNumberBlock(), `${itemIndex + 1}`);
385
+ feedbackScalePage.descriptionInputField()
386
+ .focus();
367
387
  });
368
388
  },
369
389
 
370
390
  /**
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}
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
374
393
  */
375
- verifyOptionTextLabel: (optionAccordionIndex) => {
376
- utilities.getNthElement(feedbackScalePage.optionAccordionWrapper(), optionAccordionIndex)
394
+ addInputToTooltipInputField: (optionAccordionIndex, textContent) => {
395
+ feedbackScalePage.optionAccordionPanel()
396
+ .eq(optionAccordionIndex)
377
397
  .within(() => {
378
- utilities.verifyInnerText(utilities.getNthElement(feedbackScalePage.optionTextLabel(), 0), 'Option text');
398
+ feedbackScalePage.tooltipInputField()
399
+ .type(textContent);
379
400
  });
380
401
  },
381
402
 
382
403
  /**
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}
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
386
406
  */
387
- verifyLegendTextLabel: (optionAccordionIndex) => {
388
- utilities.getNthElement(feedbackScalePage.optionAccordionWrapper(), optionAccordionIndex)
407
+ addInputToLabelsInputField: (optionAccordionIndex, textContent) => {
408
+ feedbackScalePage.optionAccordionPanel()
409
+ .eq(optionAccordionIndex)
389
410
  .within(() => {
390
- utilities.verifyInnerText(feedbackScalePage.legendTextLabel(), 'Legend text');
411
+ feedbackScalePage.labelsInputField()
412
+ .type(textContent)
413
+ .blur();
391
414
  });
392
415
  },
393
416
 
394
417
  /**
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}
418
+ * @param {number} optionAccordionIndex index of the option accordion
419
+ * @description this function verifies image in tooltip input field of an option accordion
399
420
  */
400
- verifyOptionInputFieldText: (optionAccordionIndex, text) => {
401
- utilities.getNthElement(feedbackScalePage.optionAccordionWrapper(), optionAccordionIndex)
421
+ verifyImageAndAltTextInTooltipInputField: (optionAccordionIndex) => {
422
+ feedbackScalePage.optionAccordionPanel()
423
+ .eq(optionAccordionIndex)
402
424
  .within(() => {
403
- utilities.verifyInputFieldValue(feedbackScalePage.optionTextInputField(), text)
425
+ feedbackScalePage.tooltipInputField()
426
+ .find('img')
427
+ .should('have.attr', 'src', constants.foxImageLink)
428
+ .and('have.attr', 'alt', constants.foxImageAltText);
404
429
  });
405
430
  },
406
431
 
407
432
  /**
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.
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
413
435
  */
414
- verifyOptionsAccordionPropertiesForThumbsScale: (optionAccordionIndex, { optionLabel, Points }) => {
415
- utilities.getNthElement(feedbackScalePage.optionAccordion(), optionAccordionIndex)
436
+ addInputToDescriptionInputField: (optionAccordionIndex, textContent) => {
437
+ feedbackScalePage.optionAccordionPanel()
438
+ .eq(optionAccordionIndex)
416
439
  .within(() => {
417
- utilities.verifyInnerText(feedbackScalePage.optionAccordionLabel(), optionLabel);
418
- utilities.verifyInnerText(feedbackScalePage.optionAccordionPointsLabel(), `Points:\n${Points}`);
419
- utilities.verifyElementVisibilityState(feedbackScalePage.deleteOptionAccordionButton(), 'notExist');
440
+ feedbackScalePage.descriptionInputField()
441
+ .type(textContent);
420
442
  });
421
443
  },
422
444
 
423
445
  /**
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}
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
427
448
  */
428
- verifyThumbsDownButtonInLegendAccordion: (buttonText) => {
429
- utilities.getNthElement(feedbackScalePage.legendTextOptionsList(), 0)
449
+ clearTooltipInputField: (optionAccordionIndex) => {
450
+ feedbackScalePage.optionAccordionPanel()
451
+ .eq(optionAccordionIndex)
430
452
  .within(() => {
431
- utilities.verifyElementVisibilityState(feedbackScalePage.thumbsDownButtonIcon(), 'visible')
432
- utilities.verifyInnerText(feedbackScalePage.legendTextFeedbackButtonLabel(), buttonText);
453
+ feedbackScalePage.tooltipInputField()
454
+ .clear();
433
455
  });
434
456
  },
435
457
 
436
458
  /**
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}
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
440
461
  */
441
- verifyThumbsUpButtonInLegendAccordion: (buttonText) => {
442
- utilities.getNthElement(feedbackScalePage.legendTextOptionsList(), 1)
462
+ clearDescriptionInputField: (optionAccordionIndex) => {
463
+ feedbackScalePage.optionAccordionPanel()
464
+ .eq(optionAccordionIndex)
443
465
  .within(() => {
444
- utilities.verifyElementVisibilityState(feedbackScalePage.thumbsUpButtonIcon(), 'visible')
445
- utilities.verifyInnerText(feedbackScalePage.legendTextFeedbackButtonLabel(), buttonText);
466
+ feedbackScalePage.descriptionInputField()
467
+ .clear();
446
468
  });
447
469
  },
448
470
 
449
471
  /**
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}
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
454
474
  */
455
- verifyLegendTextInLegendAccordion: (buttonIndex, legendText) => {
456
- utilities.getNthElement(feedbackScalePage.legendTextOptionsList(), buttonIndex)
475
+ verifyBoldTextInDescriptionInputField: (optionAccordionIndex, textContent) => {
476
+ feedbackScalePage.optionAccordionPanel()
477
+ .eq(optionAccordionIndex)
457
478
  .within(() => {
458
- utilities.verifyInnerText(feedbackScalePage.legendTextPreviewTab(), legendText);
479
+ feedbackScalePage.descriptionInputField()
480
+ .find('strong')
481
+ .should('exist')
482
+ .should('have.text', textContent);
459
483
  });
460
484
  },
461
485
 
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
-
482
486
  /**
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}
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
486
489
  */
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');
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');
495
504
  },
496
505
 
497
506
  /**
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.
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
501
510
  */
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
- }
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');
517
525
  },
518
526
 
519
527
  /**
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}
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
523
530
  */
524
- verifyHighlightedStarsInLegendTextListItem: (buttonIndex) => {
525
- utilities.getNthElement(feedbackScalePage.legendTextOptionsList(), buttonIndex)
531
+ verifyMoreInfoAccordionColorBlock: (itemIndex, color) => {
532
+ feedbackScalePage.moreInfoOptionsList()
533
+ .eq(itemIndex)
526
534
  .within(() => {
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
- });
535
+ feedbackScalePage.previewTabColorBlock()
536
+ .should('have.css', 'background-color', color);
537
537
  });
538
538
  },
539
539
 
540
540
  /**
541
- * @param {number} buttonIndex index of the feedback star button
542
- * @description this function is used to click on a feedback star button
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
543
543
  */
544
- clickOnFeedbackStarButton: (buttonIndex) => {
545
- utilities.getNthElement(feedbackScalePage.feedbackStarButton(), buttonIndex)
546
- .click();
544
+ verifyMoreInfoAccordionStarIcons: (itemIndex) => {
545
+ feedbackScalePage.moreInfoOptionsList()
546
+ .eq(itemIndex)
547
+ .within(() => {
548
+ feedbackScalePage.moreInfoStarIcon()
549
+ .should('have.length', itemIndex + 1);
550
+ });
547
551
  },
548
552
 
549
553
  /**
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}
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
554
556
  */
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
- }
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');
565
571
  });
566
572
  },
567
573
 
568
574
  /**
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}
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
572
577
  */
573
- verifyHighlightedHeartsInLegendTextListItem: (buttonIndex) => {
574
- utilities.getNthElement(feedbackScalePage.legendTextOptionsList(), buttonIndex)
578
+ verifyMoreInfoOptionListLabelTooltipAndDescriptionForBoldTooltipAndImageDescription: (itemIndex) => {
579
+ feedbackScalePage.moreInfoOptionsList()
580
+ .eq(itemIndex)
575
581
  .within(() => {
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
- });
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);
586
592
  });
587
593
  },
588
594
 
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();
595
+ verifyDisplayAdditionalInformationCheckboxCheckedState: () => {
596
+ feedbackScalePage.displayAdditionalInformationCheckbox()
597
+ .should('be.checked');
596
598
  },
597
599
 
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
- });
600
+ verifyDisplayAdditionalInformationCheckboxUncheckedState: () => {
601
+ feedbackScalePage.displayAdditionalInformationCheckbox()
602
+ .should('not.be.checked');
615
603
  },
616
604
 
617
- checkAllowStudentsToAddCommentCheckbox: () => {
605
+ verifyAllowStudentsToAddCommentCheckboxCheckedState: () => {
618
606
  feedbackScalePage.allowStudentsToAddCommentCheckbox()
619
- .click()
620
607
  .should('be.checked');
621
608
  },
622
609
 
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)
610
+ verifyAllowStudentsToAddCommentCheckboxUncheckedState: () => {
611
+ feedbackScalePage.allowStudentsToAddCommentCheckbox()
612
+ .should('not.be.checked');
639
613
  },
640
614
 
641
- collapseLegendAccordion: () => {
642
- feedbackScalePage.legendAccordion()
615
+ uncheckDisplayAdditionalInformationCheckbox: () => {
616
+ feedbackScalePage.displayAdditionalInformationCheckbox()
643
617
  .click()
644
- .should('have.attr', 'aria-expanded', 'false');
618
+ .should('not.be.checked');
645
619
  },
646
620
 
647
- expandLegendAccordion: () => {
648
- feedbackScalePage.legendAccordion()
621
+ checkAllowStudentsToAddCommentCheckbox: () => {
622
+ feedbackScalePage.allowStudentsToAddCommentCheckbox()
649
623
  .click()
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();
662
- },
663
-
664
- /**
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.
668
- */
669
- verifyTextInOptionTextInputField: (optionIndex, text) => {
670
- utilities.verifyInputFieldValue(utilities.getNthElement(feedbackScalePage.optionTextInputField(), optionIndex), text)
671
- },
672
-
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
- });
683
- },
684
-
685
- expandDefaultTextDropdown: () => {
686
- feedbackScalePage.defaultTextDropdown()
687
- .click();
688
- },
689
-
690
- /**
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()
624
+ .should('be.checked');
725
625
  },
726
626
 
727
627
  /**
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.
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
730
630
  */
731
- addInputToOptionStepperInputField: (value) => {
732
- feedbackScalePage.optionsStepperInputField()
733
- .clear()
734
- .type(value)
735
- .blur();
631
+ addInputToDescribeYourExperienceInputField: (textContent) => {
632
+ feedbackScalePage.describeYourExperienceInputField()
633
+ .type(textContent, { delay: 0 })
634
+ .blur()
635
+ .focus()
636
+ .should('have.value', textContent)
736
637
  },
737
638
 
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);
639
+ hoverOnFeedBackButton: () => {
640
+ feedbackScalePage.feedbackButton().eq(0)
641
+ .trigger('mouseover')
744
642
  },
745
643
 
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);
644
+ hoverAwayFromFeedbackButton: () => {
645
+ feedbackScalePage.feedbackButton().eq(0)
646
+ .trigger('mouseout')
752
647
  },
753
648
 
754
649
  /**
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)
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')
763
659
  .within(() => {
764
- utilities.verifyInnerText(feedbackScalePage.colorItemLabel(), label);
765
- utilities.verifyElementVisibilityState(feedbackScalePage.editColorButton(), 'visible');
660
+ utilities.verifyCSS(feedbackScalePage.previewTabColorBlock(), {
661
+ 'background-color': color
662
+ });
766
663
  });
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');
664
+ feedbackScalePage.feedbackButton()
665
+ .eq(buttonIndex)
666
+ .trigger('mouseout')
667
+ commonComponents.tooltipText()
668
+ .should('not.exist')
800
669
  },
801
670
 
802
671
  /**
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.
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
806
675
  */
807
- verifyColorBlockLegendAccordion: (itemIndex, colorBlock) => {
808
- utilities.getNthElement(feedbackScalePage.legendTextOptionsList(), itemIndex)
676
+ verifyMoreInfoAccordionStarIconsColor: (itemIndex, color) => {
677
+ feedbackScalePage.moreInfoOptionsList()
678
+ .eq(itemIndex)
809
679
  .within(() => {
810
- feedbackScalePage.legendTextColorBlock()
811
- .should('have.css', 'background-color', colorBlock);
680
+ utilities.verifyCSS(feedbackScalePage.moreInfoStarIcon(), {
681
+ 'fill': color
682
+ });
812
683
  });
813
- }
684
+ },
814
685
  }
815
686
 
816
687
  const tests = {
817
688
  ...questionInstructionsComponent.tests,
818
689
  ...additionalSettingsPanel.tests,
819
690
  ...createQuestionBasePage.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
- }
691
+ ...commonComponents.tests
834
692
  }
835
693
 
836
694
  export const feedbackScalePage = {