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.
- package/cypress/e2e/ILC/BrainingCampManipulative/additionalSettings.js +83 -0
- package/cypress/e2e/ILC/BrainingCampManipulative/editTabBasicSection.js +200 -0
- package/cypress/e2e/ILC/BrainingCampManipulative/editTabScoringSection.js +56 -0
- package/cypress/e2e/ILC/BrainingCampManipulative/gradingViewAndCorrectAnswerViewContents.smoke.js +95 -0
- package/cypress/e2e/ILC/BrainingCampManipulative/headerSection.js +71 -0
- package/cypress/e2e/ILC/BrainingCampManipulative/previewTabContent.smoke.js +72 -0
- package/cypress/e2e/ILC/BrainingCampManipulative/toolSettings.js +71 -0
- package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/allOrNothingBasicForAllViews.smoke.js +2 -2
- package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/clickAndDrop.js +22 -11
- package/cypress/e2e/ILC/EssayResponse/essayResponseAdditionalSettings.js +432 -0
- package/cypress/e2e/ILC/EssayResponse/essayResponseAdditionalSettingsBasic.js +134 -0
- package/cypress/e2e/ILC/FeedbackScaleNew/feedbackScaleStylePreviewTab.js +161 -0
- package/cypress/e2e/ILC/FeedbackScaleNew/numbersFeedbackScaleStyle.js +308 -0
- package/cypress/e2e/ILC/FeedbackScaleNew/previewContentsForAllViews.smoke.js +216 -0
- package/cypress/e2e/ILC/FeedbackScaleNew/starsHeartsFeedbackScaleStyle.js +336 -0
- package/cypress/e2e/ILC/FeedbackScaleNew/textFeedbackScaleStyle.js +570 -0
- package/cypress/e2e/ILC/FeedbackScaleNew/thumbsFeedbackScaleStyle.js +214 -0
- package/cypress/e2e/ILC/FillInTheGapsDragAndDrop/fillInTheGapsDragAndDropAdditionalSettings.js +356 -0
- package/cypress/e2e/ILC/FillInTheGapsDragAndDrop/fillInTheGapsDragAndDropAdditionalSettingsResponseAccordion.js +299 -0
- package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/clickAndDrop.js +18 -7
- package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/clickAndDrop.js +11 -6
- package/cypress/e2e/ILC/Graphing/Scoring/allOrNothingWithCorrectPointsEqualToAlternatePoints.js +355 -0
- package/cypress/e2e/ILC/Graphing/previewContentsForAllViews.smoke.js +0 -1
- package/cypress/e2e/ILC/Graphing/toolsControlsAndBackgroundSection.js +2 -36
- package/cypress/e2e/ILC/GridFill/allOrNothingBasicForAllViews.smoke.js +22 -34
- package/cypress/e2e/ILC/GridFill/checkAnswerFunctionalityForAllViews.smoke.js +8 -24
- package/cypress/e2e/ILC/GridFill/previewContentsForAllViews.smoke.js +5 -25
- package/cypress/e2e/ILC/GridFill/scoring/allOrNothingAlternativePointsGreaterThanCorrectPoints.js +68 -114
- package/cypress/e2e/ILC/GridFill/scoring/allOrNothingCorrectPointsEqualToAlternativePoints.js +67 -111
- package/cypress/e2e/ILC/GridFill/scoring/allOrNothingCorrectPointsGreaterThanAlternativePoints.js +71 -123
- package/cypress/e2e/ILC/GridFill/scoring/allOrNothingScoringCellShadeCount.js +41 -63
- package/cypress/e2e/ILC/GridFill/scoring/manuallyAndNonScored.js +21 -25
- package/cypress/e2e/ILC/GridFill/scoring/partialEqualWeightsBasic.js +50 -85
- package/cypress/e2e/ILC/GridFill/scoring/partialEqualWeightsWithAlternativePointsGreaterThanCorrectPoints.js +68 -115
- package/cypress/e2e/ILC/GridFill/scoring/partialEqualWeightsWithCorrectPointsEqualToAlternativePoints.js +54 -98
- package/cypress/e2e/ILC/GridFill/scoring/partialEqualWeightsWithCorrectPointsGreaterThanAlternativePoints.js +72 -120
- package/cypress/e2e/ILC/GridFill/studentViewSettingsSection.js +3 -3
- package/cypress/e2e/ILC/Matching/maximumCapacityPerDropzoneSection.js +309 -0
- package/cypress/e2e/ILC/Matching/specifyCorrectAnswerSection.js +1 -1
- package/cypress/e2e/ILC/Matching/toolSettings.js +72 -0
- package/cypress/e2e/ILC/MultipleSelectionGridNew/editTabBasicSection.js +1033 -0
- package/cypress/e2e/ILC/MultipleSelectionGridNew/test.js +28 -0
- package/cypress/e2e/ILC/NumberLine/Scoring/allOrNothingWithAlternatePointsGreaterThanCorrectPoints.js +236 -0
- package/cypress/e2e/ILC/NumberLine/Scoring/allOrNothingWithCorrectPointsEqualToAlternatePoints.js +239 -0
- package/cypress/e2e/ILC/NumberLine/Scoring/allOrNothingWithCorrectPointsGreaterThanAlternativePoints.js +278 -0
- package/cypress/e2e/ILC/NumberLine/Scoring/manualAndNonScoredScoring.js +178 -0
- package/cypress/e2e/ILC/NumberLine/Scoring/partialEqualWeightsBasic.js +407 -0
- package/cypress/e2e/ILC/NumberLine/Scoring/partialEqualWeightsWithAlternatePointsGreaterThanCorrectPoints.js +273 -0
- package/cypress/e2e/ILC/NumberLine/Scoring/partialEqualWeightsWithCorrectPointsGreaterThanAlternatePoints.js +278 -0
- package/cypress/e2e/ILC/NumberLine/Scoring/partialEqualWeigtsWithCorrectPointsEqualToAlternatePoints.js +228 -0
- package/cypress/e2e/ILC/NumberLine/additionalSettings.js +120 -0
- package/cypress/e2e/ILC/NumberLine/allOrNothingScoringForAllViews.smoke.js +659 -0
- package/cypress/e2e/ILC/NumberLine/checkAnswerFunctionalityForAllViews.smoke.js +149 -0
- package/cypress/e2e/ILC/NumberLine/editTabScoringSection.js +151 -0
- package/cypress/e2e/ILC/NumberLine/gradingViewAndCorrectAnswerView.smoke.js +171 -0
- package/cypress/e2e/ILC/NumberLine/headerSection.js +76 -0
- package/cypress/e2e/ILC/NumberLine/minimumScoringPenaltyPointsAndRoundingDropdown.js +54 -0
- package/cypress/e2e/ILC/NumberLine/previewTabContentsForAllViews.smoke.js +200 -0
- package/cypress/e2e/ILC/NumberLine/specifyCorrectAnswerSection.js +67 -0
- package/cypress/e2e/ILC/NumberLine/studentViewSettings.js +135 -0
- package/cypress/e2e/ILC/NumberLine/toolSettings.js +73 -0
- package/cypress/e2e/ILC/NumberLine/toolsAndControls.js +372 -0
- package/cypress/e2e/ILC/SingleSelectionGridNew/editTabBasicSection.js +1014 -0
- package/cypress/e2e/ILC/TextSelection/Scoring/allOrNothingAlternatePointsMoreThanCorrectPoints.js +235 -0
- package/cypress/e2e/ILC/TextSelection/Scoring/allOrNothingCorrectPointsEqualToAlternatePoints.js +235 -0
- package/cypress/e2e/ILC/TextSelection/Scoring/allOrNothingCorrectPointsMoreThanAlternatePoints.js +235 -0
- package/cypress/e2e/ILC/TextSelection/Scoring/partialDifferentWeightsBasic.js +457 -0
- package/cypress/e2e/ILC/TextSelection/Scoring/partialDifferentWeightsWithAlternativePointsGreaterThanCorrectPoints.js +342 -0
- package/cypress/e2e/ILC/TextSelection/Scoring/partialDifferentWeightsWithCorrectPointsEqualToAlternativePoints.js +342 -0
- package/cypress/e2e/ILC/TextSelection/Scoring/partialDifferentWeightsWithCorrectPointsGreaterThanAlternativePoints.js +342 -0
- package/cypress/e2e/ILC/TextSelection/Scoring/partialEqualWeightsBasic.js +155 -0
- package/cypress/e2e/ILC/TextSelection/Scoring/partialEqualWeightsWithAlternativePointsGreaterThanCorrectPoints.js +314 -0
- package/cypress/e2e/ILC/TextSelection/Scoring/partialEqualWeightsWithCorrectPointsEqualToAlternativePoints.js +275 -0
- package/cypress/e2e/ILC/TextSelection/Scoring/partialEqualWeightsWithCorrectPointsGreaterThanAlternativePoints.js +314 -0
- package/cypress/e2e/ILC/TextSelection/allOrNothingScoringForAllViews.smoke.js +290 -0
- package/cypress/e2e/ILC/TextSelection/checkAnswerFunctionalityForAllViews.smoke.js +142 -0
- package/cypress/e2e/ILC/TextSelection/previewContentsForAllViews.js +137 -0
- package/cypress/e2e/ILC/ToolSettings/toolSettingsContent.js +4 -4
- package/cypress/fixtures/theme/ilc.json +14 -26
- package/cypress/pages/brainingCampManipulativePage.js +122 -0
- package/cypress/pages/components/autoScoredScoringSectionMultiResponseType.js +1 -1
- package/cypress/pages/components/autoScoredSpecifyCorrectAnswerSection.js +3 -0
- package/cypress/pages/components/autoScoredStudentViewSettings.js +1 -1
- package/cypress/pages/components/colorPopupComponent.js +2 -2
- package/cypress/pages/components/defaultToolDropdown.js +77 -0
- package/cypress/pages/components/gridQuestionCommonComponent.js +629 -2
- package/cypress/pages/components/index.js +3 -0
- package/cypress/pages/components/maximumCapacityPerDropzoneComponent.js +1 -1
- package/cypress/pages/components/measuringToolComponent.js +2 -2
- package/cypress/pages/components/resetPopupComponent.js +74 -0
- package/cypress/pages/components/scoringSectionBaseEditTab.js +1 -1
- package/cypress/pages/components/setPointsPopupBase.js +6 -4
- package/cypress/pages/components/specifyRowsAndColumnsComponent.js +60 -3
- package/cypress/pages/components/toolSettingsComponent.js +80 -12
- package/cypress/pages/components/toolsAndControlsComponent.js +69 -0
- package/cypress/pages/dragAndDropIntoCategoriesPage.js +0 -8
- package/cypress/pages/feedbackScalePage copy.js +716 -0
- package/cypress/pages/feedbackScalePage.js +591 -449
- package/cypress/pages/fillInTheGapsOverImageDragAndDropPage.js +3 -1
- package/cypress/pages/graphingPage.js +9 -145
- package/cypress/pages/gridFillPage.js +135 -120
- package/cypress/pages/highlightPage.js +0 -394
- package/cypress/pages/index.js +5 -2
- package/cypress/pages/matchingPage.js +78 -20
- package/cypress/pages/multipleSelectionGridPage.js +88 -1
- package/cypress/pages/numberLinePage.js +723 -0
- package/cypress/pages/singleSelectionGridPage.js +86 -0
- package/cypress/pages/textSelectionPage.js +582 -0
- package/package.json +2 -2
|
@@ -1,56 +1,80 @@
|
|
|
1
|
-
import
|
|
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
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
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-
|
|
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-
|
|
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
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
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
|
-
|
|
37
|
-
|
|
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
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
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
|
-
|
|
47
|
-
|
|
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
|
-
|
|
53
|
-
|
|
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
|
-
...
|
|
62
|
-
...
|
|
63
|
-
...dialogBoxBase.steps,
|
|
64
|
-
clickOnFeedbackStyleLayoutDropdown: () => {
|
|
65
|
-
feedbackScalePage.feedbackLayoutStyleDropdown()
|
|
66
|
-
.click();
|
|
67
|
-
},
|
|
68
|
-
|
|
85
|
+
...questionInstructionsComponent.steps,
|
|
86
|
+
...autoScoredScoringPreviewTab.steps,
|
|
69
87
|
/**
|
|
70
|
-
*
|
|
71
|
-
* @
|
|
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
|
-
|
|
74
|
-
feedbackScalePage.
|
|
75
|
-
.
|
|
92
|
+
addLegendText: (optionIndex, text) => {
|
|
93
|
+
utilities.getNthElement(feedbackScalePage.legendTextInputField(), optionIndex)
|
|
94
|
+
.type(text)
|
|
95
|
+
.blur();
|
|
76
96
|
},
|
|
77
97
|
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
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}
|
|
92
|
-
* @
|
|
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
|
-
|
|
95
|
-
feedbackScalePage.
|
|
96
|
-
|
|
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
|
-
*
|
|
102
|
-
* @
|
|
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
|
-
|
|
105
|
-
feedbackScalePage.
|
|
106
|
-
.
|
|
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
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
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}
|
|
153
|
-
* @
|
|
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
|
-
|
|
158
|
-
feedbackScalePage.
|
|
159
|
-
.
|
|
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
|
-
* @
|
|
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
|
-
|
|
179
|
-
feedbackScalePage.feedbackButton()
|
|
180
|
-
.
|
|
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
|
-
* @
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
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
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
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
|
-
*
|
|
226
|
-
* @param {
|
|
227
|
-
* @
|
|
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
|
-
|
|
230
|
-
feedbackScalePage.
|
|
231
|
-
.eq(itemIndex)
|
|
186
|
+
verifyColorBlockFeedbackButtonLabelLegendTextInLegendAccordion: (itemIndex, { colorBlock, buttonText, legendText }) => {
|
|
187
|
+
utilities.getNthElement(feedbackScalePage.legendTextOptionsList(), itemIndex)
|
|
232
188
|
.within(() => {
|
|
233
|
-
feedbackScalePage.
|
|
234
|
-
.should('have.
|
|
235
|
-
feedbackScalePage.
|
|
236
|
-
|
|
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 {
|
|
244
|
-
* @description this function
|
|
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
|
-
|
|
247
|
-
feedbackScalePage.
|
|
248
|
-
.eq(buttonIndex)
|
|
205
|
+
selectOptionFromFeedbackScaleStyleDropdown: (dropdownOption) => {
|
|
206
|
+
feedbackScalePage.feedbackScaleStyleDropdownListOptions(dropdownOption)
|
|
249
207
|
.click();
|
|
250
208
|
},
|
|
251
209
|
|
|
252
210
|
/**
|
|
253
|
-
*
|
|
254
|
-
* @
|
|
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
|
-
|
|
257
|
-
feedbackScalePage.
|
|
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
|
-
|
|
264
|
-
|
|
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
|
-
|
|
267
|
-
|
|
268
|
-
.
|
|
269
|
-
|
|
233
|
+
increaseOptionsInputStepperCount: (increaseValue) => {
|
|
234
|
+
for (let index = 0; index < increaseValue; index++) {
|
|
235
|
+
feedbackScalePage.optionsStepperIncreaseButton()
|
|
236
|
+
.click();
|
|
237
|
+
};
|
|
270
238
|
},
|
|
271
239
|
|
|
272
240
|
/**
|
|
273
|
-
*
|
|
274
|
-
* @
|
|
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
|
-
|
|
277
|
-
feedbackScalePage.
|
|
278
|
-
.
|
|
279
|
-
|
|
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
|
-
*
|
|
284
|
-
* @
|
|
257
|
+
* Verifies the collapsed state of an options accordion.
|
|
258
|
+
* @param {number} optionAccordionIndex - The index of the options accordion.
|
|
285
259
|
*/
|
|
286
|
-
|
|
287
|
-
feedbackScalePage.
|
|
288
|
-
.
|
|
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
|
-
*
|
|
294
|
-
* @param {
|
|
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
|
-
|
|
298
|
-
feedbackScalePage.
|
|
299
|
-
.
|
|
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
|
-
*
|
|
315
|
-
* @
|
|
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
|
-
|
|
318
|
-
feedbackScalePage.
|
|
319
|
-
.
|
|
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
|
-
*
|
|
325
|
-
* @
|
|
326
|
-
*/
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
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
|
-
*
|
|
338
|
-
* @
|
|
339
|
-
*/
|
|
340
|
-
|
|
341
|
-
|
|
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
|
-
*
|
|
366
|
-
*
|
|
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
|
-
|
|
369
|
-
feedbackScalePage.
|
|
370
|
-
.eq(optionAccordionIndex)
|
|
332
|
+
verifyNumberBlockFeedbackButtonLabelLegendTextInLegendAccordion: (buttonIndex, legendText) => {
|
|
333
|
+
utilities.getNthElement(feedbackScalePage.legendTextOptionsList(), buttonIndex)
|
|
371
334
|
.within(() => {
|
|
372
|
-
feedbackScalePage.
|
|
373
|
-
|
|
335
|
+
utilities.verifyInnerText(feedbackScalePage.legendTextNumberBlock(), `${buttonIndex + 1}`);
|
|
336
|
+
utilities.verifyInnerText(feedbackScalePage.legendTextPreviewTab(), legendText);
|
|
374
337
|
});
|
|
375
338
|
},
|
|
376
339
|
|
|
377
340
|
/**
|
|
378
|
-
*
|
|
379
|
-
* @
|
|
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
|
-
|
|
382
|
-
feedbackScalePage.
|
|
383
|
-
.
|
|
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.
|
|
386
|
-
.focus();
|
|
366
|
+
utilities.verifyInnerText(feedbackScalePage.legendTextNumberBlock(), `${itemIndex + 1}`);
|
|
387
367
|
});
|
|
388
368
|
},
|
|
389
369
|
|
|
390
370
|
/**
|
|
391
|
-
*
|
|
392
|
-
* @
|
|
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
|
-
|
|
395
|
-
feedbackScalePage.
|
|
396
|
-
.eq(optionAccordionIndex)
|
|
375
|
+
verifyOptionTextLabel: (optionAccordionIndex) => {
|
|
376
|
+
utilities.getNthElement(feedbackScalePage.optionAccordionWrapper(), optionAccordionIndex)
|
|
397
377
|
.within(() => {
|
|
398
|
-
feedbackScalePage.
|
|
399
|
-
.type(textContent);
|
|
378
|
+
utilities.verifyInnerText(utilities.getNthElement(feedbackScalePage.optionTextLabel(), 0), 'Option text');
|
|
400
379
|
});
|
|
401
380
|
},
|
|
402
381
|
|
|
403
382
|
/**
|
|
404
|
-
*
|
|
405
|
-
* @
|
|
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
|
-
|
|
408
|
-
feedbackScalePage.
|
|
409
|
-
.eq(optionAccordionIndex)
|
|
387
|
+
verifyLegendTextLabel: (optionAccordionIndex) => {
|
|
388
|
+
utilities.getNthElement(feedbackScalePage.optionAccordionWrapper(), optionAccordionIndex)
|
|
410
389
|
.within(() => {
|
|
411
|
-
feedbackScalePage.
|
|
412
|
-
.type(textContent)
|
|
413
|
-
.blur();
|
|
390
|
+
utilities.verifyInnerText(feedbackScalePage.legendTextLabel(), 'Legend text');
|
|
414
391
|
});
|
|
415
392
|
},
|
|
416
393
|
|
|
417
394
|
/**
|
|
418
|
-
*
|
|
419
|
-
* @
|
|
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
|
-
|
|
422
|
-
feedbackScalePage.
|
|
423
|
-
.eq(optionAccordionIndex)
|
|
400
|
+
verifyOptionInputFieldText: (optionAccordionIndex, text) => {
|
|
401
|
+
utilities.getNthElement(feedbackScalePage.optionAccordionWrapper(), optionAccordionIndex)
|
|
424
402
|
.within(() => {
|
|
425
|
-
feedbackScalePage.
|
|
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
|
-
*
|
|
434
|
-
* @
|
|
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
|
-
|
|
437
|
-
feedbackScalePage.
|
|
438
|
-
.eq(optionAccordionIndex)
|
|
414
|
+
verifyOptionsAccordionPropertiesForThumbsScale: (optionAccordionIndex, { optionLabel, Points }) => {
|
|
415
|
+
utilities.getNthElement(feedbackScalePage.optionAccordion(), optionAccordionIndex)
|
|
439
416
|
.within(() => {
|
|
440
|
-
feedbackScalePage.
|
|
441
|
-
|
|
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
|
-
*
|
|
447
|
-
* @
|
|
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
|
-
|
|
450
|
-
feedbackScalePage.
|
|
451
|
-
.eq(optionAccordionIndex)
|
|
428
|
+
verifyThumbsDownButtonInLegendAccordion: (buttonText) => {
|
|
429
|
+
utilities.getNthElement(feedbackScalePage.legendTextOptionsList(), 0)
|
|
452
430
|
.within(() => {
|
|
453
|
-
feedbackScalePage.
|
|
454
|
-
|
|
431
|
+
utilities.verifyElementVisibilityState(feedbackScalePage.thumbsDownButtonIcon(), 'visible')
|
|
432
|
+
utilities.verifyInnerText(feedbackScalePage.legendTextFeedbackButtonLabel(), buttonText);
|
|
455
433
|
});
|
|
456
434
|
},
|
|
457
435
|
|
|
458
436
|
/**
|
|
459
|
-
*
|
|
460
|
-
* @
|
|
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
|
-
|
|
463
|
-
feedbackScalePage.
|
|
464
|
-
.eq(optionAccordionIndex)
|
|
441
|
+
verifyThumbsUpButtonInLegendAccordion: (buttonText) => {
|
|
442
|
+
utilities.getNthElement(feedbackScalePage.legendTextOptionsList(), 1)
|
|
465
443
|
.within(() => {
|
|
466
|
-
feedbackScalePage.
|
|
467
|
-
|
|
444
|
+
utilities.verifyElementVisibilityState(feedbackScalePage.thumbsUpButtonIcon(), 'visible')
|
|
445
|
+
utilities.verifyInnerText(feedbackScalePage.legendTextFeedbackButtonLabel(), buttonText);
|
|
468
446
|
});
|
|
469
447
|
},
|
|
470
448
|
|
|
471
449
|
/**
|
|
472
|
-
*
|
|
473
|
-
* @
|
|
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
|
-
|
|
476
|
-
feedbackScalePage.
|
|
477
|
-
.eq(optionAccordionIndex)
|
|
455
|
+
verifyLegendTextInLegendAccordion: (buttonIndex, legendText) => {
|
|
456
|
+
utilities.getNthElement(feedbackScalePage.legendTextOptionsList(), buttonIndex)
|
|
478
457
|
.within(() => {
|
|
479
|
-
feedbackScalePage.
|
|
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
|
-
*
|
|
488
|
-
* @
|
|
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
|
-
|
|
491
|
-
feedbackScalePage.
|
|
492
|
-
.
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
.should('have.attr', '
|
|
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
|
-
*
|
|
508
|
-
* @param {
|
|
509
|
-
* @
|
|
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
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
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
|
-
*
|
|
529
|
-
* @
|
|
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
|
-
|
|
532
|
-
feedbackScalePage.
|
|
533
|
-
.eq(itemIndex)
|
|
524
|
+
verifyHighlightedStarsInLegendTextListItem: (buttonIndex) => {
|
|
525
|
+
utilities.getNthElement(feedbackScalePage.legendTextOptionsList(), buttonIndex)
|
|
534
526
|
.within(() => {
|
|
535
|
-
feedbackScalePage.
|
|
536
|
-
.
|
|
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}
|
|
542
|
-
* @description this function is used to
|
|
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
|
-
|
|
545
|
-
feedbackScalePage.
|
|
546
|
-
.
|
|
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
|
-
*
|
|
555
|
-
* @
|
|
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
|
-
|
|
558
|
-
feedbackScalePage.
|
|
559
|
-
.
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
.
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
.
|
|
566
|
-
|
|
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
|
-
*
|
|
576
|
-
* @
|
|
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
|
-
|
|
579
|
-
feedbackScalePage.
|
|
580
|
-
.eq(itemIndex)
|
|
573
|
+
verifyHighlightedHeartsInLegendTextListItem: (buttonIndex) => {
|
|
574
|
+
utilities.getNthElement(feedbackScalePage.legendTextOptionsList(), buttonIndex)
|
|
581
575
|
.within(() => {
|
|
582
|
-
feedbackScalePage.
|
|
583
|
-
.
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
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
|
-
|
|
596
|
-
|
|
597
|
-
|
|
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
|
-
|
|
601
|
-
|
|
602
|
-
|
|
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
|
-
|
|
617
|
+
checkAllowStudentsToAddCommentCheckbox: () => {
|
|
606
618
|
feedbackScalePage.allowStudentsToAddCommentCheckbox()
|
|
619
|
+
.click()
|
|
607
620
|
.should('be.checked');
|
|
608
621
|
},
|
|
609
622
|
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
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
|
-
|
|
616
|
-
feedbackScalePage.
|
|
641
|
+
collapseLegendAccordion: () => {
|
|
642
|
+
feedbackScalePage.legendAccordion()
|
|
617
643
|
.click()
|
|
618
|
-
.should('
|
|
644
|
+
.should('have.attr', 'aria-expanded', 'false');
|
|
619
645
|
},
|
|
620
646
|
|
|
621
|
-
|
|
622
|
-
feedbackScalePage.
|
|
647
|
+
expandLegendAccordion: () => {
|
|
648
|
+
feedbackScalePage.legendAccordion()
|
|
623
649
|
.click()
|
|
624
|
-
.should('
|
|
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
|
-
*
|
|
629
|
-
* @
|
|
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
|
-
|
|
632
|
-
feedbackScalePage.
|
|
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
|
-
|
|
640
|
-
|
|
641
|
-
|
|
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
|
-
|
|
645
|
-
feedbackScalePage.
|
|
646
|
-
.
|
|
685
|
+
expandDefaultTextDropdown: () => {
|
|
686
|
+
feedbackScalePage.defaultTextDropdown()
|
|
687
|
+
.click();
|
|
647
688
|
},
|
|
648
689
|
|
|
649
690
|
/**
|
|
650
|
-
*
|
|
651
|
-
* @param {string}
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
.
|
|
657
|
-
|
|
658
|
-
|
|
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.
|
|
661
|
-
|
|
662
|
-
});
|
|
764
|
+
utilities.verifyInnerText(feedbackScalePage.colorItemLabel(), label);
|
|
765
|
+
utilities.verifyElementVisibilityState(feedbackScalePage.editColorButton(), 'visible');
|
|
663
766
|
});
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
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
|
-
*
|
|
673
|
-
* @param {
|
|
674
|
-
* @
|
|
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
|
-
|
|
677
|
-
feedbackScalePage.
|
|
678
|
-
.eq(itemIndex)
|
|
807
|
+
verifyColorBlockLegendAccordion: (itemIndex, colorBlock) => {
|
|
808
|
+
utilities.getNthElement(feedbackScalePage.legendTextOptionsList(), itemIndex)
|
|
679
809
|
.within(() => {
|
|
680
|
-
|
|
681
|
-
'
|
|
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 = {
|