itemengine-cypress-automation 1.0.166-migrationScripts-b8c79a0.0 → 1.0.167-repoUpdate10April-1465c8c.0
Sign up to get free protection for your applications and to get access to all the features.
- 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/cypress/support/migrationHelpers/extractLrnQuestionData.js +3 -12
- package/cypress/support/migrationHelpers/lrnQestionTypesENUM.js +0 -1
- package/cypress/support/migrationHelpers/migrationScript.js +0 -10
- package/cypress/support/migrationHelpers/verifyIeQuestionData.js +0 -8
- package/package.json +1 -1
@@ -0,0 +1,570 @@
|
|
1
|
+
import { feedbackScalePage } from "../../../pages";
|
2
|
+
import { colorPopupComponent } from "../../../pages/components";
|
3
|
+
import abortEarlySetup from "../../../support/helpers/abortEarly";
|
4
|
+
import utilities from "../../../support/helpers/utilities";
|
5
|
+
const css = Cypress.env('css');
|
6
|
+
const optionsTextArray = ['Uncomfortable', 'Need some support', 'Comfortable'];
|
7
|
+
const optionsTextArray2 = ['Uncomfortable', 'Somewhat comfortable', 'Comfortable'];
|
8
|
+
const optionsTextArray3 = ['Below expectations', 'Meets expectations', 'Exceeds expectations'];
|
9
|
+
const optionsTextArray4 = ['Low', 'Medium', 'High', 'Very high'];
|
10
|
+
const optionsTextArray5 = ['Strongly disagree', 'Disagree', 'Neither agree nor disagree', 'Agree', 'Strongly agree'];
|
11
|
+
const defaultTextDropdownArray = [['Uncomfortable / Need some support / Comfortable', 'Uncomfortable / Somewhat comfortable / Comfortable', 'Below expectations / Meets expectations / Exceeds expectations', 'Custom'], ['Low / Medium / High / Very high', 'Custom'], ['Strongly disagree / Disagree / Neither agree nor disagree / Agree / Strongly agree', 'Custom']];
|
12
|
+
const defaultColorBlocks = ['rgb(255, 133, 165)', 'rgb(236, 216, 19)', 'rgb(77, 188, 147)'];
|
13
|
+
const defaultColorBlocks2 = ['rgb(255, 133, 165)', 'rgb(236, 216, 19)', 'rgb(77, 188, 147)', 'rgb(0, 111, 111)'];
|
14
|
+
const defaultColorBlocks3 = ['rgb(196, 56, 56)', 'rgb(255, 133, 165)', 'rgb(236, 216, 19)', 'rgb(77, 188, 147)', 'rgb(0, 111, 111)'];
|
15
|
+
describe('Create item page: Feedback scale - Text feedback scale style - Edit and preview tab contents and functionality ', () => {
|
16
|
+
before(() => {
|
17
|
+
cy.loginAs('admin');
|
18
|
+
});
|
19
|
+
|
20
|
+
describe('Specify feedback scale options section - Text feedback scale style : Edit tab contents', () => {
|
21
|
+
abortEarlySetup();
|
22
|
+
before(() => {
|
23
|
+
feedbackScalePage.steps.navigateToCreateQuestion('feedback scale');
|
24
|
+
cy.barsPreLoaderWait();
|
25
|
+
});
|
26
|
+
|
27
|
+
it('Specify feedback scale options label should be displayed', () => {
|
28
|
+
utilities.verifyInnerText(feedbackScalePage.specifyFeedbackScaleOptionsLabel(), 'Specify feedback scale options');
|
29
|
+
});
|
30
|
+
|
31
|
+
it('Feedback scale style label and dropdown should be displayed. By default "Text" option should be selected in the dropdown', () => {
|
32
|
+
utilities.verifyInnerText(feedbackScalePage.feedbackScaleStyleDropdownLabel(), 'Feedback scale style');
|
33
|
+
utilities.verifyInnerText(feedbackScalePage.feedbackScaleStyleDropdown(), 'Text');
|
34
|
+
});
|
35
|
+
|
36
|
+
it('Options label and stepper input field should be displayed. By default "3" should be the set value in the stepper input field', () => {
|
37
|
+
feedbackScalePage.steps.verifyCountInOptionsStepperInputField(3);
|
38
|
+
});
|
39
|
+
|
40
|
+
it('Default text label and and dropdown should be displayed. By default "Uncomfortable / Need some support / Comfortable" option should be selected in the dropdown', () => {
|
41
|
+
utilities.verifyInnerText(feedbackScalePage.defaultTextDropdownLabel(), 'Default text');
|
42
|
+
utilities.verifyInnerText(feedbackScalePage.defaultTextDropdown(), 'Uncomfortable / Need some support / Comfortable');
|
43
|
+
});
|
44
|
+
|
45
|
+
it(`When 3 options are present, then on expanding the default text dropdown, ${defaultTextDropdownArray[0].length} options - ${defaultTextDropdownArray[0].join(' , ')} should be displayed`, () => {
|
46
|
+
feedbackScalePage.steps.expandDefaultTextDropdown();
|
47
|
+
defaultTextDropdownArray[0].forEach((option, index) => {
|
48
|
+
utilities.verifyInnerText(utilities.getNthElement(feedbackScalePage.defaultTextDropdownListOptions(), index), option)
|
49
|
+
});
|
50
|
+
feedbackScalePage.steps.selectOptionFromDefaultTextDropdown('Uncomfortable / Need some support / Comfortable');
|
51
|
+
});
|
52
|
+
|
53
|
+
it(`3 option accordions should be displayed with label "Option #" (# being a number from 1 to 3), Options text, Points and "Delete option" icon button, by default all option accordions should be in collapsed state`, () => {
|
54
|
+
for (let index = 0; index < optionsTextArray.length; index++) {
|
55
|
+
feedbackScalePage.steps.verifyOptionsAccordionProperties(index, { optionLabel: `Option ${index + 1}\n:\n${optionsTextArray[index]}`, Points: `${index + 1}` });
|
56
|
+
feedbackScalePage.steps.verifyOptionAccordionCollapsedState(index);
|
57
|
+
}
|
58
|
+
});
|
59
|
+
|
60
|
+
it(`The user should be able to expand option accordions, an "Options text" label and input field and "Legend text" label and empty input field with placeholder text, "Enter legend text" should be displayed. For the Option 1 accordion, the options text input field should be pre-populated with ${optionsTextArray[0]}`, () => {
|
61
|
+
feedbackScalePage.steps.expandOptionAccordion(0);
|
62
|
+
feedbackScalePage.steps.verifyOptionTextLabel(0);
|
63
|
+
feedbackScalePage.steps.verifyOptionInputFieldText(0, `${optionsTextArray[0]}`);
|
64
|
+
utilities.verifyInnerText(utilities.getNthElement(feedbackScalePage.legendTextLabel(), 0), 'Legend text');
|
65
|
+
feedbackScalePage.steps.verifyLegendTextInputFieldPlaceholder(0);
|
66
|
+
});
|
67
|
+
|
68
|
+
it(`On expanding the "Option 2" accordion, the previously expanded accordion should continue to stay in expanded state. For Option 2 accordion, the options text input field should be pre-populated with ${optionsTextArray[1]}`, () => {
|
69
|
+
feedbackScalePage.steps.expandOptionAccordion(1);
|
70
|
+
feedbackScalePage.steps.verifyOptionAccordionExpandedState(0);
|
71
|
+
feedbackScalePage.steps.verifyOptionAccordionExpandedState(1);
|
72
|
+
feedbackScalePage.steps.verifyOptionTextLabel(1);
|
73
|
+
feedbackScalePage.steps.verifyOptionInputFieldText(1, `${optionsTextArray[1]}`);
|
74
|
+
utilities.verifyInnerText(utilities.getNthElement(feedbackScalePage.legendTextLabel(), 1), 'Legend text');
|
75
|
+
feedbackScalePage.steps.verifyLegendTextInputFieldPlaceholder(1);
|
76
|
+
});
|
77
|
+
|
78
|
+
it(`For Option 3 accordion, the options text input field should be pre-populated with ${optionsTextArray[2]}`, () => {
|
79
|
+
feedbackScalePage.steps.expandOptionAccordion(2);
|
80
|
+
feedbackScalePage.steps.verifyOptionInputFieldText(2, `${optionsTextArray[2]}`);
|
81
|
+
});
|
82
|
+
|
83
|
+
it('CSS of Specify feedback scale options section', { tags: 'css' }, () => {
|
84
|
+
utilities.verifyCSS(feedbackScalePage.specifyFeedbackScaleOptionsLabel(), {
|
85
|
+
'color': css.color.labels,
|
86
|
+
'font-size': css.fontSize.default,
|
87
|
+
'font-weight': css.fontWeight.semibold
|
88
|
+
});
|
89
|
+
utilities.verifyCSS(feedbackScalePage.feedbackScaleStyleDropdownLabel(), {
|
90
|
+
'color': css.color.labels,
|
91
|
+
'font-size': css.fontSize.normal,
|
92
|
+
'font-weight': css.fontWeight.semibold
|
93
|
+
});
|
94
|
+
utilities.verifyCSS(feedbackScalePage.feedbackScaleStyleDropdown().find('.dropdown-label-text'), {
|
95
|
+
'color': css.color.liText,
|
96
|
+
'font-size': css.fontSize.default,
|
97
|
+
'font-weight': css.fontWeight.regular
|
98
|
+
});
|
99
|
+
utilities.verifyCSS(feedbackScalePage.optionsStepperInputFieldLabel(), {
|
100
|
+
'color': css.color.labels,
|
101
|
+
'font-size': css.fontSize.normal,
|
102
|
+
'font-weight': css.fontWeight.semibold
|
103
|
+
});
|
104
|
+
utilities.verifyCSS(feedbackScalePage.optionsStepperInputField(), {
|
105
|
+
'color': css.color.text,
|
106
|
+
'font-size': css.fontSize.default,
|
107
|
+
'font-weight': css.fontWeight.regular
|
108
|
+
});
|
109
|
+
utilities.verifyCSS(feedbackScalePage.defaultTextDropdownLabel(), {
|
110
|
+
'color': css.color.labels,
|
111
|
+
'font-size': css.fontSize.normal,
|
112
|
+
'font-weight': css.fontWeight.semibold
|
113
|
+
});
|
114
|
+
utilities.verifyCSS(feedbackScalePage.defaultTextDropdown().find('.dropdown-label-text'), {
|
115
|
+
'color': css.color.liText,
|
116
|
+
'font-size': css.fontSize.default,
|
117
|
+
'font-weight': css.fontWeight.regular
|
118
|
+
});
|
119
|
+
utilities.verifyCSS(feedbackScalePage.optionAccordionLabel().find('[class*="OptionWrapper"]'), {
|
120
|
+
'color': css.color.liText,
|
121
|
+
'font-size': css.fontSize.default,
|
122
|
+
'font-weight': css.fontWeight.regular
|
123
|
+
});
|
124
|
+
});
|
125
|
+
});
|
126
|
+
|
127
|
+
describe('Text feedback scale style - Default text dropdown : Impact on option accordions', () => {
|
128
|
+
abortEarlySetup();
|
129
|
+
before(() => {
|
130
|
+
feedbackScalePage.steps.navigateToCreateQuestion('feedback scale');
|
131
|
+
cy.barsPreLoaderWait();
|
132
|
+
});
|
133
|
+
|
134
|
+
it(`When the user selects ${defaultTextDropdownArray[0][1]} option from the default text dropdown, then the option accordion labels and the pre-populated texts of the options text input fields should update accordingly`, () => {
|
135
|
+
feedbackScalePage.steps.expandDefaultTextDropdown();
|
136
|
+
feedbackScalePage.steps.selectOptionFromDefaultTextDropdown(defaultTextDropdownArray[0][1]);
|
137
|
+
for (let index = 0; index < optionsTextArray2.length; index++) {
|
138
|
+
feedbackScalePage.steps.verifyOptionsAccordionProperties(index, { optionLabel: `Option ${index + 1}\n:\n${optionsTextArray2[index]}`, Points: `${index + 1}` });
|
139
|
+
feedbackScalePage.steps.verifyOptionInputFieldText(index, `${optionsTextArray2[index]}`);
|
140
|
+
};
|
141
|
+
});
|
142
|
+
|
143
|
+
it('When the user modifies any of the options text input field, then the default text dropdown should set to "Custom"', () => {
|
144
|
+
feedbackScalePage.steps.expandOptionAccordion(0);
|
145
|
+
feedbackScalePage.steps.enterTextInOptionTextInputField(0, ' to the user');
|
146
|
+
feedbackScalePage.steps.verifyTextInOptionTextInputField(0, 'Uncomfortable to the user');
|
147
|
+
utilities.verifyInnerText(feedbackScalePage.defaultTextDropdown(), 'Custom');
|
148
|
+
});
|
149
|
+
|
150
|
+
it(`On selecting ${defaultTextDropdownArray[0][2]} option from the default text dropdown, then the option accordion labels and the pre-populated texts of the options text input fields should update accordingly`, () => {
|
151
|
+
feedbackScalePage.steps.expandDefaultTextDropdown();
|
152
|
+
feedbackScalePage.steps.selectOptionFromDefaultTextDropdown(defaultTextDropdownArray[0][2]);
|
153
|
+
for (let index = 0; index < optionsTextArray.length; index++) {
|
154
|
+
feedbackScalePage.steps.verifyOptionsAccordionProperties(index, { optionLabel: `Option ${index + 1}\n:\n${optionsTextArray3[index]}`, Points: `${index + 1}` });
|
155
|
+
feedbackScalePage.steps.verifyOptionInputFieldText(index, `${optionsTextArray3[index]}`);
|
156
|
+
};
|
157
|
+
});
|
158
|
+
|
159
|
+
it(`When the user selects ${defaultTextDropdownArray[0][3]} option from the default text dropdown, then the option accordion labels and the pre-populated texts of the options text input fields should get removed`, () => {
|
160
|
+
feedbackScalePage.steps.expandDefaultTextDropdown();
|
161
|
+
feedbackScalePage.steps.selectOptionFromDefaultTextDropdown(defaultTextDropdownArray[0][3]);
|
162
|
+
for (let index = 0; index < optionsTextArray.length; index++) {
|
163
|
+
feedbackScalePage.steps.verifyOptionsAccordionProperties(index, { optionLabel: `Option ${index + 1}`, Points: `${index + 1}` });
|
164
|
+
feedbackScalePage.steps.verifyOptionInputFieldText(index, '');
|
165
|
+
};
|
166
|
+
});
|
167
|
+
|
168
|
+
it(`Pre-step: Resetting the default text dropdown to ${defaultTextDropdownArray[0][0]}`, () => {
|
169
|
+
feedbackScalePage.steps.expandDefaultTextDropdown();
|
170
|
+
feedbackScalePage.steps.selectOptionFromDefaultTextDropdown(defaultTextDropdownArray[0][0]);
|
171
|
+
});
|
172
|
+
|
173
|
+
it('When the user increases the stepper count of the options input field, the default text dropdown should set to "Custom". In this case, the option accordion labels and the pre-populated texts of the options text input fields should persist', () => {
|
174
|
+
feedbackScalePage.steps.increaseOptionsInputStepperCount(1);
|
175
|
+
feedbackScalePage.steps.verifyOptionsAccordionCount(4);
|
176
|
+
for (let index = 0; index < optionsTextArray.length; index++) {
|
177
|
+
feedbackScalePage.steps.verifyOptionsAccordionProperties(index, { optionLabel: `Option ${index + 1}\n:\n${optionsTextArray[index]}`, Points: `${index + 1}` });
|
178
|
+
feedbackScalePage.steps.verifyOptionInputFieldText(index, `${optionsTextArray[index]}`);
|
179
|
+
};
|
180
|
+
feedbackScalePage.steps.verifyOptionsAccordionProperties(3, { optionLabel: 'Option 4', Points: '4' });
|
181
|
+
feedbackScalePage.steps.verifyOptionInputFieldText(3, '');
|
182
|
+
});
|
183
|
+
|
184
|
+
it(`On expanding the default text dropdown, ${defaultTextDropdownArray[1].length} options - ${defaultTextDropdownArray[1].join(' , ')} should be displayed`, () => {
|
185
|
+
feedbackScalePage.steps.expandDefaultTextDropdown();
|
186
|
+
defaultTextDropdownArray[1].forEach((option, index) => {
|
187
|
+
utilities.verifyInnerText(utilities.getNthElement(feedbackScalePage.defaultTextDropdownListOptions(), index), option)
|
188
|
+
});
|
189
|
+
});
|
190
|
+
|
191
|
+
it(`On selecting ${defaultTextDropdownArray[1][0]} option from the default text dropdown, then the option accordion labels and the pre-populated texts of the options text input fields should update accordingly`, () => {
|
192
|
+
feedbackScalePage.steps.selectOptionFromDefaultTextDropdown(defaultTextDropdownArray[1][0]);
|
193
|
+
for (let index = 0; index < optionsTextArray4.length; index++) {
|
194
|
+
feedbackScalePage.steps.verifyOptionsAccordionProperties(index, { optionLabel: `Option ${index + 1}\n:\n${optionsTextArray4[index]}`, Points: `${index + 1}` });
|
195
|
+
feedbackScalePage.steps.verifyOptionInputFieldText(index, `${optionsTextArray4[index]}`);
|
196
|
+
};
|
197
|
+
});
|
198
|
+
|
199
|
+
it(`When the user increases the stepper count of the options input field, then on expanding the default text dropdown, ${defaultTextDropdownArray[2].length} options - ${defaultTextDropdownArray[2].join(' , ')} should be displayed`, () => {
|
200
|
+
feedbackScalePage.steps.increaseOptionsInputStepperCount(1);
|
201
|
+
feedbackScalePage.steps.expandDefaultTextDropdown();
|
202
|
+
defaultTextDropdownArray[2].forEach((option, index) => {
|
203
|
+
utilities.verifyInnerText(utilities.getNthElement(feedbackScalePage.defaultTextDropdownListOptions(), index), option)
|
204
|
+
});
|
205
|
+
});
|
206
|
+
|
207
|
+
it(`On selecting ${defaultTextDropdownArray[2][0]} option from the default text dropdown, then the option accordion labels and the pre-populated texts of the options text input fields should update accordingly`, () => {
|
208
|
+
feedbackScalePage.steps.selectOptionFromDefaultTextDropdown(defaultTextDropdownArray[2][0]);
|
209
|
+
for (let index = 0; index < optionsTextArray5.length; index++) {
|
210
|
+
feedbackScalePage.steps.verifyOptionsAccordionProperties(index, { optionLabel: `Option ${index + 1}\n:\n${optionsTextArray5[index]}`, Points: `${index + 1}` });
|
211
|
+
feedbackScalePage.steps.verifyOptionInputFieldText(index, `${optionsTextArray5[index]}`);
|
212
|
+
};
|
213
|
+
});
|
214
|
+
|
215
|
+
it('On increasing the stepper count further (option count = 6), the default text dropdown should get removed', () => {
|
216
|
+
feedbackScalePage.steps.increaseOptionsInputStepperCount(1);
|
217
|
+
utilities.verifyElementVisibilityState(feedbackScalePage.defaultTextDropdown(), 'notExist');
|
218
|
+
});
|
219
|
+
|
220
|
+
it('When the user decreases the option stepper count, then the default text dropdown should appear again', () => {
|
221
|
+
feedbackScalePage.steps.decreaseOptionsInputStepperCount(1);
|
222
|
+
utilities.verifyElementVisibilityState(feedbackScalePage.defaultTextDropdown(), 'visible');
|
223
|
+
});
|
224
|
+
|
225
|
+
it('When the user reduces the option count to 2, then the default text dropdown should get removed', () => {
|
226
|
+
feedbackScalePage.steps.addInputToOptionStepperInputField(2);
|
227
|
+
utilities.verifyElementVisibilityState(feedbackScalePage.defaultTextDropdown(), 'notExist');
|
228
|
+
});
|
229
|
+
});
|
230
|
+
|
231
|
+
describe('Text feedback scale style - Default text dropdown : Impact in preview tab', () => {
|
232
|
+
abortEarlySetup();
|
233
|
+
before(() => {
|
234
|
+
feedbackScalePage.steps.navigateToCreateQuestion('feedback scale');
|
235
|
+
cy.barsPreLoaderWait();
|
236
|
+
});
|
237
|
+
|
238
|
+
it(`When the user selects ${defaultTextDropdownArray[0][1]} option from the default text dropdown, then the feedback buttons should update accordingly in the preview tab`, () => {
|
239
|
+
feedbackScalePage.steps.expandDefaultTextDropdown();
|
240
|
+
feedbackScalePage.steps.selectOptionFromDefaultTextDropdown(defaultTextDropdownArray[0][1]);
|
241
|
+
feedbackScalePage.steps.switchToPreviewTab();
|
242
|
+
optionsTextArray2.forEach((buttonContent, buttonIndex) => {
|
243
|
+
feedbackScalePage.steps.verifyFeedbackButtonInPreviewTab(buttonIndex, buttonContent);
|
244
|
+
feedbackScalePage.steps.verifyFeedbackButtonColorBlockPreviewTab(buttonIndex, defaultColorBlocks[buttonIndex]);
|
245
|
+
});
|
246
|
+
});
|
247
|
+
|
248
|
+
it(`When the user selects ${defaultTextDropdownArray[0][3]} option from the default text dropdown, then the feedback buttons should update accordingly in the preview tab`, () => {
|
249
|
+
cy.log('Switching to edit tab and setting default text dropdown to "Custom"')
|
250
|
+
feedbackScalePage.steps.switchToEditTab();
|
251
|
+
feedbackScalePage.steps.expandDefaultTextDropdown();
|
252
|
+
feedbackScalePage.steps.selectOptionFromDefaultTextDropdown(defaultTextDropdownArray[0][3]);
|
253
|
+
feedbackScalePage.steps.switchToPreviewTab();
|
254
|
+
for (let buttonIndex = 0; buttonIndex < 3; buttonIndex++) {
|
255
|
+
feedbackScalePage.steps.verifyFeedbackButtonInPreviewTab(buttonIndex, '');
|
256
|
+
feedbackScalePage.steps.verifyFeedbackButtonColorBlockPreviewTab(buttonIndex, defaultColorBlocks[buttonIndex]);
|
257
|
+
};
|
258
|
+
});
|
259
|
+
|
260
|
+
it(`When the user increases the stepper count of the options input field, selects ${defaultTextDropdownArray[1][0]} option from the default text dropdown, then the feedback buttons should update accordingly in the preview tab`, () => {
|
261
|
+
cy.log(`Switching to edit tab increasing stepper count to 4 and setting default text dropdown to ${defaultTextDropdownArray[1][0]}`)
|
262
|
+
feedbackScalePage.steps.switchToEditTab();
|
263
|
+
feedbackScalePage.steps.increaseOptionsInputStepperCount(1);
|
264
|
+
feedbackScalePage.steps.expandDefaultTextDropdown();
|
265
|
+
feedbackScalePage.steps.selectOptionFromDefaultTextDropdown(defaultTextDropdownArray[1][0]);
|
266
|
+
feedbackScalePage.steps.switchToPreviewTab();
|
267
|
+
optionsTextArray4.forEach((buttonContent, buttonIndex) => {
|
268
|
+
feedbackScalePage.steps.verifyFeedbackButtonInPreviewTab(buttonIndex, buttonContent);
|
269
|
+
feedbackScalePage.steps.verifyFeedbackButtonColorBlockPreviewTab(buttonIndex, defaultColorBlocks2[buttonIndex]);
|
270
|
+
});
|
271
|
+
});
|
272
|
+
|
273
|
+
it(`When the user increases the stepper count of the options input field, selects ${defaultTextDropdownArray[2][0]} option from the default text dropdown, then the feedback buttons should update accordingly in the preview tab`, () => {
|
274
|
+
cy.log(`Switching to edit tab increasing stepper count to 5 and setting default text dropdown to ${defaultTextDropdownArray[2][0]}`)
|
275
|
+
feedbackScalePage.steps.switchToEditTab();
|
276
|
+
feedbackScalePage.steps.increaseOptionsInputStepperCount(1);
|
277
|
+
feedbackScalePage.steps.expandDefaultTextDropdown();
|
278
|
+
feedbackScalePage.steps.selectOptionFromDefaultTextDropdown(defaultTextDropdownArray[2][0]);
|
279
|
+
feedbackScalePage.steps.switchToPreviewTab();
|
280
|
+
optionsTextArray5.forEach((buttonContent, buttonIndex) => {
|
281
|
+
feedbackScalePage.steps.verifyFeedbackButtonInPreviewTab(buttonIndex, buttonContent);
|
282
|
+
feedbackScalePage.steps.verifyFeedbackButtonColorBlockPreviewTab(buttonIndex, defaultColorBlocks3[buttonIndex]);
|
283
|
+
});
|
284
|
+
});
|
285
|
+
});
|
286
|
+
|
287
|
+
describe('Text feedback scale style - Add and delete options : Edit tab functionality', () => {
|
288
|
+
abortEarlySetup();
|
289
|
+
before(() => {
|
290
|
+
feedbackScalePage.steps.navigateToCreateQuestion('feedback scale');
|
291
|
+
cy.barsPreLoaderWait();
|
292
|
+
});
|
293
|
+
|
294
|
+
it('The user should be able to add a new option by increasing the stepper count in the options input field', () => {
|
295
|
+
feedbackScalePage.steps.increaseOptionsInputStepperCount(1);
|
296
|
+
feedbackScalePage.steps.verifyOptionsAccordionCount(4);
|
297
|
+
});
|
298
|
+
|
299
|
+
it('The newly added option should be displayed with label "Option 4", Points and "Delete option" icon button, by default the accordion should be in collapsed state', () => {
|
300
|
+
feedbackScalePage.steps.verifyOptionsAccordionProperties(3, { optionLabel: 'Option 4', Points: '4' });
|
301
|
+
feedbackScalePage.steps.verifyOptionAccordionCollapsedState(3);
|
302
|
+
});
|
303
|
+
|
304
|
+
it('The newly added option should be displayed with label "Option 4", Points and "Delete option" icon button, by default the accordion should be in collapsed state', () => {
|
305
|
+
feedbackScalePage.steps.verifyOptionsAccordionProperties(3, { optionLabel: 'Option 4', Points: '4' });
|
306
|
+
feedbackScalePage.steps.verifyOptionAccordionCollapsedState(3);
|
307
|
+
});
|
308
|
+
|
309
|
+
it('On expanding the newly added option accordion, "Option text" empty input field with placeholder text, "Enter option text" should be displayed', () => {
|
310
|
+
feedbackScalePage.steps.expandOptionAccordion(3);
|
311
|
+
feedbackScalePage.steps.verifyOptionTextInputFieldPlaceholder(3);
|
312
|
+
});
|
313
|
+
|
314
|
+
it('The user should be able to enter text in the option text input field, the placeholder text should disappear on entering the text', () => {
|
315
|
+
feedbackScalePage.steps.enterTextInOptionTextInputField(3, 'Super comfortable');
|
316
|
+
feedbackScalePage.steps.verifyOptionTextInputFieldPlaceholderNotExists(3);
|
317
|
+
});
|
318
|
+
|
319
|
+
it('When the user removes the added text from the option input field, the placeholder text should appear again', () => {
|
320
|
+
feedbackScalePage.steps.clearOptionTextInputField(3);
|
321
|
+
feedbackScalePage.steps.verifyOptionTextInputFieldPlaceholder(3);
|
322
|
+
});
|
323
|
+
|
324
|
+
it('The user should also be able to add a new option using the "+Add option" button, the count in the options stepper input field should also update accordingly', () => {
|
325
|
+
feedbackScalePage.steps.addOption();
|
326
|
+
feedbackScalePage.steps.verifyCountInOptionsStepperInputField(5);
|
327
|
+
feedbackScalePage.steps.verifyOptionsAccordionCount(5);
|
328
|
+
feedbackScalePage.steps.verifyOptionsAccordionProperties(4, { optionLabel: 'Option 5', Points: '5' });
|
329
|
+
});
|
330
|
+
|
331
|
+
it('When the user deletes an option accordion, then the remaining options should get updated accordingly, the count in the options stepper input field should also update accordingly', () => {
|
332
|
+
feedbackScalePage.steps.deleteOptionAccordion(4);
|
333
|
+
for (let index = 0; index < optionsTextArray.length; index++) {
|
334
|
+
feedbackScalePage.steps.verifyOptionsAccordionProperties(index, { optionLabel: `Option ${index + 1}\n:\n${optionsTextArray[index]}`, Points: `${index + 1}` });
|
335
|
+
};
|
336
|
+
feedbackScalePage.steps.verifyOptionsAccordionProperties(3, { optionLabel: 'Option 4', Points: '4' });
|
337
|
+
feedbackScalePage.steps.verifyCountInOptionsStepperInputField(4);
|
338
|
+
});
|
339
|
+
|
340
|
+
it('When the user decreases the options stepper count, the last option should get removed and the remaining options should get updated accordingly', () => {
|
341
|
+
feedbackScalePage.steps.decreaseOptionsInputStepperCount(1);
|
342
|
+
feedbackScalePage.steps.verifyCountInOptionsStepperInputField(3);
|
343
|
+
utilities.verifyElementCount(feedbackScalePage.optionAccordion(), 3);
|
344
|
+
for (let index = 0; index < optionsTextArray.length; index++) {
|
345
|
+
feedbackScalePage.steps.verifyOptionsAccordionProperties(index, { optionLabel: `Option ${index + 1}\n:\n${optionsTextArray[index]}`, Points: `${index + 1}` });
|
346
|
+
};
|
347
|
+
});
|
348
|
+
|
349
|
+
it('When the user deletes an option accordion, then the remaining options should get updated accordingly, the count in the options stepper input field should also update accordingly', () => {
|
350
|
+
feedbackScalePage.steps.deleteOptionAccordion(4);
|
351
|
+
for (let index = 0; index < optionsTextArray.length; index++) {
|
352
|
+
feedbackScalePage.steps.verifyOptionsAccordionProperties(index, { optionLabel: `Option ${index + 1}\n:\n${optionsTextArray[index]}`, Points: `${index + 1}` });
|
353
|
+
};
|
354
|
+
feedbackScalePage.steps.verifyCountInOptionsStepperInputField(4);
|
355
|
+
});
|
356
|
+
|
357
|
+
it('When the user only keeps two option accordions and deletes all the other options, the decrease stepper count button in the option stepper input field should get disabled and the delete icon buttons on the two option accordions should also get disabled', () => {
|
358
|
+
feedbackScalePage.steps.deleteOptionAccordion(3);
|
359
|
+
feedbackScalePage.steps.deleteOptionAccordion(2);
|
360
|
+
utilities.verifyElementDisabled(feedbackScalePage.optionsStepperDecreaseButton());
|
361
|
+
utilities.verifyElementDisabled(feedbackScalePage.deleteOptionAccordionButton());
|
362
|
+
});
|
363
|
+
|
364
|
+
it('When the user adds upto 12 options, the increase stepper count button in the option stepper input field should get disabled', () => {
|
365
|
+
feedbackScalePage.steps.addInputToOptionStepperInputField(12);
|
366
|
+
utilities.verifyElementDisabled(feedbackScalePage.optionsStepperIncreaseButton());
|
367
|
+
});
|
368
|
+
});
|
369
|
+
|
370
|
+
describe('Text feedback scale style - Add and delete options : Preview tab functionality', () => {
|
371
|
+
abortEarlySetup();
|
372
|
+
before(() => {
|
373
|
+
feedbackScalePage.steps.navigateToCreateQuestion('feedback scale');
|
374
|
+
cy.barsPreLoaderWait();
|
375
|
+
});
|
376
|
+
|
377
|
+
it('When the increases the stepper count in the options input field, the newly added feedback buttons should be displayed in the preview tab', () => {
|
378
|
+
feedbackScalePage.steps.increaseOptionsInputStepperCount(1);
|
379
|
+
feedbackScalePage.steps.switchToPreviewTab();
|
380
|
+
feedbackScalePage.steps.verifyFeedbackButtonCountPreviewTab(4);
|
381
|
+
feedbackScalePage.steps.verifyLegendItemCountPreviewTab(4);
|
382
|
+
feedbackScalePage.steps.verifyFeedbackButtonInPreviewTab(3, '');
|
383
|
+
});
|
384
|
+
|
385
|
+
it('When the user adds a new option using the "+Add option" button, the newly added feedback buttons should be displayed in the preview tab', () => {
|
386
|
+
feedbackScalePage.steps.switchToEditTab();
|
387
|
+
feedbackScalePage.steps.addOption();
|
388
|
+
feedbackScalePage.steps.switchToPreviewTab();
|
389
|
+
feedbackScalePage.steps.verifyFeedbackButtonCountPreviewTab(5);
|
390
|
+
feedbackScalePage.steps.verifyLegendItemCountPreviewTab(5);
|
391
|
+
feedbackScalePage.steps.verifyFeedbackButtonInPreviewTab(4, '');
|
392
|
+
});
|
393
|
+
|
394
|
+
it('When the user deletes an option accordion, then the remaining feedback buttons should get updated accordingly in the preview tab', () => {
|
395
|
+
feedbackScalePage.steps.switchToEditTab();
|
396
|
+
feedbackScalePage.steps.deleteOptionAccordion(4);
|
397
|
+
feedbackScalePage.steps.switchToPreviewTab();
|
398
|
+
feedbackScalePage.steps.verifyFeedbackButtonCountPreviewTab(4);
|
399
|
+
feedbackScalePage.steps.verifyLegendItemCountPreviewTab(4);
|
400
|
+
optionsTextArray.forEach((buttonContent, buttonIndex) => {
|
401
|
+
feedbackScalePage.steps.verifyFeedbackButtonInPreviewTab(buttonIndex, buttonContent);
|
402
|
+
});
|
403
|
+
feedbackScalePage.steps.verifyFeedbackButtonInPreviewTab(3, '');
|
404
|
+
});
|
405
|
+
|
406
|
+
it('When the user decreases the options stepper count, then the last feedback button should get removed and the remaining options should get updated accordingly', () => {
|
407
|
+
feedbackScalePage.steps.switchToEditTab();
|
408
|
+
feedbackScalePage.steps.decreaseOptionsInputStepperCount(1);
|
409
|
+
feedbackScalePage.steps.switchToPreviewTab();
|
410
|
+
feedbackScalePage.steps.verifyFeedbackButtonCountPreviewTab(3);
|
411
|
+
feedbackScalePage.steps.verifyLegendItemCountPreviewTab(3);
|
412
|
+
optionsTextArray.forEach((buttonContent, buttonIndex) => {
|
413
|
+
feedbackScalePage.steps.verifyFeedbackButtonInPreviewTab(buttonIndex, buttonContent);
|
414
|
+
});
|
415
|
+
});
|
416
|
+
});
|
417
|
+
|
418
|
+
describe('Text feedback scale style - Color section - Edit tab contents and functionality', () => {
|
419
|
+
abortEarlySetup();
|
420
|
+
before(() => {
|
421
|
+
feedbackScalePage.steps.navigateToCreateQuestion('feedback scale');
|
422
|
+
cy.barsPreLoaderWait();
|
423
|
+
});
|
424
|
+
|
425
|
+
it('Color label and two radio buttons, "Default color scheme" and "Custom colors" should be displayed. By default, "Default color scheme" radio button should be checked', () => {
|
426
|
+
utilities.verifyInnerText(feedbackScalePage.colorSectionLabel(), 'Color');
|
427
|
+
feedbackScalePage.steps.verifyDefaultColorSchemeRadioButtonCheckedState();
|
428
|
+
});
|
429
|
+
|
430
|
+
it('The user should be able to switch to "Custom colors" option', () => {
|
431
|
+
feedbackScalePage.steps.selectColorSectionRadioButton('Custom colors');
|
432
|
+
});
|
433
|
+
|
434
|
+
it('On switching to "Custom colors", Option label and Color label along with a list of feedback buttons and their respective color blocks should be displayed. Edit color icon should be displayed next to each color block', () => {
|
435
|
+
utilities.verifyInnerText(feedbackScalePage.colorLabel(), 'Color');
|
436
|
+
utilities.verifyInnerText(feedbackScalePage.optionLabel(), 'Option');
|
437
|
+
for (let index = 0; index < optionsTextArray.length; index++) {
|
438
|
+
feedbackScalePage.steps.verifyColorSectionListItemContents(index, { label: `${index + 1}. ${optionsTextArray[index]}`, colorBlock: defaultColorBlocks[index] });
|
439
|
+
}
|
440
|
+
});
|
441
|
+
|
442
|
+
it('CSS of "Color section"', { tags: 'css' }, () => {
|
443
|
+
utilities.verifyCSS(feedbackScalePage.colorSectionLabel(), {
|
444
|
+
'color': css.color.labels,
|
445
|
+
'font-size': css.fontSize.default,
|
446
|
+
'font-weight': css.fontWeight.semibold
|
447
|
+
});
|
448
|
+
utilities.verifyCSS(feedbackScalePage.defaultColorSchemeRadioButtonLabel(), {
|
449
|
+
'color': css.color.labelText,
|
450
|
+
'font-size': css.fontSize.normal,
|
451
|
+
'font-weight': css.fontWeight.regular
|
452
|
+
});
|
453
|
+
utilities.verifyCSS(feedbackScalePage.customColorsRadioButtonLabel(), {
|
454
|
+
'color': css.color.labelText,
|
455
|
+
'font-size': css.fontSize.normal,
|
456
|
+
'font-weight': css.fontWeight.regular
|
457
|
+
});
|
458
|
+
utilities.verifyCSS(feedbackScalePage.optionLabel(), {
|
459
|
+
'color': css.color.labels,
|
460
|
+
'font-size': css.fontSize.normal,
|
461
|
+
'font-weight': css.fontWeight.semibold
|
462
|
+
});
|
463
|
+
utilities.verifyCSS(feedbackScalePage.colorLabel(), {
|
464
|
+
'color': css.color.labels,
|
465
|
+
'font-size': css.fontSize.normal,
|
466
|
+
'font-weight': css.fontWeight.semibold
|
467
|
+
});
|
468
|
+
utilities.verifyCSS(feedbackScalePage.colorItemLabel(), {
|
469
|
+
'color': css.color.text,
|
470
|
+
'font-size': css.fontSize.default,
|
471
|
+
'font-weight': css.fontWeight.regular
|
472
|
+
});
|
473
|
+
feedbackScalePage.editColorButton()
|
474
|
+
.verifyPseudoClassBeforeProperty('color', css.color.activeButtons);
|
475
|
+
});
|
476
|
+
|
477
|
+
it('Accessibility of Colors section', {tags: 'a11y'}, () => {
|
478
|
+
cy.checkAccessibility(feedbackScalePage.colorSectionLabel().parents('.feedback-color-wrapper'));
|
479
|
+
});
|
480
|
+
});
|
481
|
+
|
482
|
+
describe('Text feedback scale style - Custom colors - Effect of adding/deleting options, default text dropdown', () => {
|
483
|
+
abortEarlySetup();
|
484
|
+
before(() => {
|
485
|
+
feedbackScalePage.steps.navigateToCreateQuestion('feedback scale');
|
486
|
+
cy.barsPreLoaderWait();
|
487
|
+
feedbackScalePage.steps.selectColorSectionRadioButton('Custom colors');
|
488
|
+
});
|
489
|
+
|
490
|
+
it('When the user adds a new option, a new list item should get added with a color block of color - "rgb(0, 111, 111)"', () => {
|
491
|
+
feedbackScalePage.steps.addOption();
|
492
|
+
feedbackScalePage.steps.verifyColorSectionListItemContents(3, { label: '4.', colorBlock: 'rgb(0, 111, 111)' });
|
493
|
+
});
|
494
|
+
|
495
|
+
it(`When the user selects ${defaultTextDropdownArray[1][0]} option from the default text dropdown, then the option labels in the colors list should update accordingly`, () => {
|
496
|
+
feedbackScalePage.steps.expandDefaultTextDropdown();
|
497
|
+
feedbackScalePage.steps.selectOptionFromDefaultTextDropdown(defaultTextDropdownArray[1][0]);
|
498
|
+
optionsTextArray4.forEach((optionLabel, index) => {
|
499
|
+
feedbackScalePage.steps.verifyColorSectionListItemContents(index, { label: `${index + 1}. ${optionLabel}`, colorBlock: defaultColorBlocks2[index] });
|
500
|
+
});
|
501
|
+
});
|
502
|
+
|
503
|
+
it(`When the user selects ${defaultTextDropdownArray[1][1]} option from the default text dropdown, then the option labels in the colors list should get removed`, () => {
|
504
|
+
feedbackScalePage.steps.expandDefaultTextDropdown();
|
505
|
+
feedbackScalePage.steps.selectOptionFromDefaultTextDropdown(defaultTextDropdownArray[1][1]);
|
506
|
+
for (let index = 0; index < 4; index++) {
|
507
|
+
feedbackScalePage.steps.verifyColorSectionListItemContents(index, { label: `${index + 1}.`, colorBlock: defaultColorBlocks[index] });
|
508
|
+
};
|
509
|
+
});
|
510
|
+
|
511
|
+
it(`When the user increments the option count, selects ${defaultTextDropdownArray[2][0]} option from the default text dropdown, then the option labels in the colors list should update accordingly`, () => {
|
512
|
+
feedbackScalePage.steps.increaseOptionsInputStepperCount(1);
|
513
|
+
feedbackScalePage.steps.expandDefaultTextDropdown();
|
514
|
+
feedbackScalePage.steps.selectOptionFromDefaultTextDropdown(defaultTextDropdownArray[2][0]);
|
515
|
+
optionsTextArray5.forEach((optionLabel, index) => {
|
516
|
+
feedbackScalePage.steps.verifyColorSectionListItemContents(index, { label: `${index + 1}. ${optionLabel}`, colorBlock: defaultColorBlocks3[index] });
|
517
|
+
});
|
518
|
+
});
|
519
|
+
|
520
|
+
it('When the user deletes an option, the deleted item should get removed from the Colors list. The color scheme for 4 options should get applied to the available options', () => {
|
521
|
+
feedbackScalePage.steps.deleteOptionAccordion(4);
|
522
|
+
utilities.verifyElementCount(feedbackScalePage.colorSectionListItem(), 4);
|
523
|
+
for (let index = 0; index < 4; index++) {
|
524
|
+
feedbackScalePage.steps.verifyColorSectionListItemContents(index, { label: `${index + 1}. ${optionsTextArray5[index]}`, colorBlock: defaultColorBlocks2[index] });
|
525
|
+
}
|
526
|
+
});
|
527
|
+
});
|
528
|
+
|
529
|
+
describe('Text feedback scale style - Custom colors - Preview tab functionality', () => {
|
530
|
+
const modifiedColor = 'rgba(255, 0, 0, 0.7)'
|
531
|
+
abortEarlySetup();
|
532
|
+
before(() => {
|
533
|
+
feedbackScalePage.steps.navigateToCreateQuestion('feedback scale');
|
534
|
+
cy.barsPreLoaderWait();
|
535
|
+
feedbackScalePage.steps.selectColorSectionRadioButton('Custom colors');
|
536
|
+
});
|
537
|
+
|
538
|
+
it(`When the user increments the option count, then the color blocks of the feedback button in the preview tab should update accordingly for 4 options`, () => {
|
539
|
+
feedbackScalePage.steps.increaseOptionsInputStepperCount(1);
|
540
|
+
feedbackScalePage.steps.switchToPreviewTab();
|
541
|
+
defaultColorBlocks2.forEach((colorBlock, index) => {
|
542
|
+
feedbackScalePage.steps.verifyFeedbackButtonColorBlockPreviewTab(index, colorBlock);
|
543
|
+
feedbackScalePage.steps.verifyColorBlockLegendAccordion(index, colorBlock);
|
544
|
+
});
|
545
|
+
});
|
546
|
+
|
547
|
+
it(`When the user increments the option count, then the color blocks of the feedback button in the preview tab should update accordingly for 5 options`, () => {
|
548
|
+
feedbackScalePage.steps.switchToEditTab();
|
549
|
+
feedbackScalePage.steps.increaseOptionsInputStepperCount(1);
|
550
|
+
feedbackScalePage.steps.switchToPreviewTab();
|
551
|
+
defaultColorBlocks3.forEach((colorBlock, index) => {
|
552
|
+
feedbackScalePage.steps.verifyFeedbackButtonColorBlockPreviewTab(index, colorBlock);
|
553
|
+
feedbackScalePage.steps.verifyColorBlockLegendAccordion(index, colorBlock);
|
554
|
+
});
|
555
|
+
});
|
556
|
+
|
557
|
+
it('When the user modifies the selected color for a feedback button, then the color blocks of the feedback button in the preview tab should update accordingly in the preview tab and on marking the feedback, the feedback button should get highlighted with the modified color', () => {
|
558
|
+
feedbackScalePage.steps.switchToEditTab();
|
559
|
+
feedbackScalePage.steps.editColor(0);
|
560
|
+
colorPopupComponent.steps.addInputToHexInputField('#ff0000');
|
561
|
+
colorPopupComponent.steps.addInputToOpacityInputField('70');
|
562
|
+
colorPopupComponent.steps.clickOnOkButton();
|
563
|
+
feedbackScalePage.steps.switchToPreviewTab();
|
564
|
+
feedbackScalePage.steps.verifyFeedbackButtonColorBlockPreviewTab(0, modifiedColor);
|
565
|
+
feedbackScalePage.steps.verifyColorBlockLegendAccordion(0, modifiedColor);
|
566
|
+
feedbackScalePage.steps.clickOnFeedbackButton(0);
|
567
|
+
feedbackScalePage.steps.verifyFeedbackButtonSelectedStateColor(0, 'rgba(255, 0, 0, 0.1)');
|
568
|
+
});
|
569
|
+
});
|
570
|
+
});
|