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

Sign up to get free protection for your applications and to get access to all the features.
Files changed (109) hide show
  1. package/cypress/e2e/ILC/BrainingCampManipulative/additionalSettings.js +83 -0
  2. package/cypress/e2e/ILC/BrainingCampManipulative/editTabBasicSection.js +200 -0
  3. package/cypress/e2e/ILC/BrainingCampManipulative/editTabScoringSection.js +56 -0
  4. package/cypress/e2e/ILC/BrainingCampManipulative/gradingViewAndCorrectAnswerViewContents.smoke.js +95 -0
  5. package/cypress/e2e/ILC/BrainingCampManipulative/headerSection.js +71 -0
  6. package/cypress/e2e/ILC/BrainingCampManipulative/previewTabContent.smoke.js +72 -0
  7. package/cypress/e2e/ILC/BrainingCampManipulative/toolSettings.js +71 -0
  8. package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/allOrNothingBasicForAllViews.smoke.js +2 -2
  9. package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/clickAndDrop.js +22 -11
  10. package/cypress/e2e/ILC/EssayResponse/essayResponseAdditionalSettings.js +432 -0
  11. package/cypress/e2e/ILC/EssayResponse/essayResponseAdditionalSettingsBasic.js +134 -0
  12. package/cypress/e2e/ILC/FeedbackScaleNew/feedbackScaleStylePreviewTab.js +161 -0
  13. package/cypress/e2e/ILC/FeedbackScaleNew/numbersFeedbackScaleStyle.js +308 -0
  14. package/cypress/e2e/ILC/FeedbackScaleNew/previewContentsForAllViews.smoke.js +216 -0
  15. package/cypress/e2e/ILC/FeedbackScaleNew/starsHeartsFeedbackScaleStyle.js +336 -0
  16. package/cypress/e2e/ILC/FeedbackScaleNew/textFeedbackScaleStyle.js +570 -0
  17. package/cypress/e2e/ILC/FeedbackScaleNew/thumbsFeedbackScaleStyle.js +214 -0
  18. package/cypress/e2e/ILC/FillInTheGapsDragAndDrop/fillInTheGapsDragAndDropAdditionalSettings.js +356 -0
  19. package/cypress/e2e/ILC/FillInTheGapsDragAndDrop/fillInTheGapsDragAndDropAdditionalSettingsResponseAccordion.js +299 -0
  20. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/clickAndDrop.js +18 -7
  21. package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/clickAndDrop.js +11 -6
  22. package/cypress/e2e/ILC/Graphing/Scoring/allOrNothingWithCorrectPointsEqualToAlternatePoints.js +355 -0
  23. package/cypress/e2e/ILC/Graphing/previewContentsForAllViews.smoke.js +0 -1
  24. package/cypress/e2e/ILC/Graphing/toolsControlsAndBackgroundSection.js +2 -36
  25. package/cypress/e2e/ILC/GridFill/allOrNothingBasicForAllViews.smoke.js +22 -34
  26. package/cypress/e2e/ILC/GridFill/checkAnswerFunctionalityForAllViews.smoke.js +8 -24
  27. package/cypress/e2e/ILC/GridFill/previewContentsForAllViews.smoke.js +5 -25
  28. package/cypress/e2e/ILC/GridFill/scoring/allOrNothingAlternativePointsGreaterThanCorrectPoints.js +68 -114
  29. package/cypress/e2e/ILC/GridFill/scoring/allOrNothingCorrectPointsEqualToAlternativePoints.js +67 -111
  30. package/cypress/e2e/ILC/GridFill/scoring/allOrNothingCorrectPointsGreaterThanAlternativePoints.js +71 -123
  31. package/cypress/e2e/ILC/GridFill/scoring/allOrNothingScoringCellShadeCount.js +41 -63
  32. package/cypress/e2e/ILC/GridFill/scoring/manuallyAndNonScored.js +21 -25
  33. package/cypress/e2e/ILC/GridFill/scoring/partialEqualWeightsBasic.js +50 -85
  34. package/cypress/e2e/ILC/GridFill/scoring/partialEqualWeightsWithAlternativePointsGreaterThanCorrectPoints.js +68 -115
  35. package/cypress/e2e/ILC/GridFill/scoring/partialEqualWeightsWithCorrectPointsEqualToAlternativePoints.js +54 -98
  36. package/cypress/e2e/ILC/GridFill/scoring/partialEqualWeightsWithCorrectPointsGreaterThanAlternativePoints.js +72 -120
  37. package/cypress/e2e/ILC/GridFill/studentViewSettingsSection.js +3 -3
  38. package/cypress/e2e/ILC/Matching/maximumCapacityPerDropzoneSection.js +309 -0
  39. package/cypress/e2e/ILC/Matching/specifyCorrectAnswerSection.js +1 -1
  40. package/cypress/e2e/ILC/Matching/toolSettings.js +72 -0
  41. package/cypress/e2e/ILC/MultipleSelectionGridNew/editTabBasicSection.js +1033 -0
  42. package/cypress/e2e/ILC/MultipleSelectionGridNew/test.js +28 -0
  43. package/cypress/e2e/ILC/NumberLine/Scoring/allOrNothingWithAlternatePointsGreaterThanCorrectPoints.js +236 -0
  44. package/cypress/e2e/ILC/NumberLine/Scoring/allOrNothingWithCorrectPointsEqualToAlternatePoints.js +239 -0
  45. package/cypress/e2e/ILC/NumberLine/Scoring/allOrNothingWithCorrectPointsGreaterThanAlternativePoints.js +278 -0
  46. package/cypress/e2e/ILC/NumberLine/Scoring/manualAndNonScoredScoring.js +178 -0
  47. package/cypress/e2e/ILC/NumberLine/Scoring/partialEqualWeightsBasic.js +407 -0
  48. package/cypress/e2e/ILC/NumberLine/Scoring/partialEqualWeightsWithAlternatePointsGreaterThanCorrectPoints.js +273 -0
  49. package/cypress/e2e/ILC/NumberLine/Scoring/partialEqualWeightsWithCorrectPointsGreaterThanAlternatePoints.js +278 -0
  50. package/cypress/e2e/ILC/NumberLine/Scoring/partialEqualWeigtsWithCorrectPointsEqualToAlternatePoints.js +228 -0
  51. package/cypress/e2e/ILC/NumberLine/additionalSettings.js +120 -0
  52. package/cypress/e2e/ILC/NumberLine/allOrNothingScoringForAllViews.smoke.js +659 -0
  53. package/cypress/e2e/ILC/NumberLine/checkAnswerFunctionalityForAllViews.smoke.js +149 -0
  54. package/cypress/e2e/ILC/NumberLine/editTabScoringSection.js +151 -0
  55. package/cypress/e2e/ILC/NumberLine/gradingViewAndCorrectAnswerView.smoke.js +171 -0
  56. package/cypress/e2e/ILC/NumberLine/headerSection.js +76 -0
  57. package/cypress/e2e/ILC/NumberLine/minimumScoringPenaltyPointsAndRoundingDropdown.js +54 -0
  58. package/cypress/e2e/ILC/NumberLine/previewTabContentsForAllViews.smoke.js +200 -0
  59. package/cypress/e2e/ILC/NumberLine/specifyCorrectAnswerSection.js +67 -0
  60. package/cypress/e2e/ILC/NumberLine/studentViewSettings.js +135 -0
  61. package/cypress/e2e/ILC/NumberLine/toolSettings.js +73 -0
  62. package/cypress/e2e/ILC/NumberLine/toolsAndControls.js +372 -0
  63. package/cypress/e2e/ILC/SingleSelectionGridNew/editTabBasicSection.js +1014 -0
  64. package/cypress/e2e/ILC/TextSelection/Scoring/allOrNothingAlternatePointsMoreThanCorrectPoints.js +235 -0
  65. package/cypress/e2e/ILC/TextSelection/Scoring/allOrNothingCorrectPointsEqualToAlternatePoints.js +235 -0
  66. package/cypress/e2e/ILC/TextSelection/Scoring/allOrNothingCorrectPointsMoreThanAlternatePoints.js +235 -0
  67. package/cypress/e2e/ILC/TextSelection/Scoring/partialDifferentWeightsBasic.js +457 -0
  68. package/cypress/e2e/ILC/TextSelection/Scoring/partialDifferentWeightsWithAlternativePointsGreaterThanCorrectPoints.js +342 -0
  69. package/cypress/e2e/ILC/TextSelection/Scoring/partialDifferentWeightsWithCorrectPointsEqualToAlternativePoints.js +342 -0
  70. package/cypress/e2e/ILC/TextSelection/Scoring/partialDifferentWeightsWithCorrectPointsGreaterThanAlternativePoints.js +342 -0
  71. package/cypress/e2e/ILC/TextSelection/Scoring/partialEqualWeightsBasic.js +155 -0
  72. package/cypress/e2e/ILC/TextSelection/Scoring/partialEqualWeightsWithAlternativePointsGreaterThanCorrectPoints.js +314 -0
  73. package/cypress/e2e/ILC/TextSelection/Scoring/partialEqualWeightsWithCorrectPointsEqualToAlternativePoints.js +275 -0
  74. package/cypress/e2e/ILC/TextSelection/Scoring/partialEqualWeightsWithCorrectPointsGreaterThanAlternativePoints.js +314 -0
  75. package/cypress/e2e/ILC/TextSelection/allOrNothingScoringForAllViews.smoke.js +290 -0
  76. package/cypress/e2e/ILC/TextSelection/checkAnswerFunctionalityForAllViews.smoke.js +142 -0
  77. package/cypress/e2e/ILC/TextSelection/previewContentsForAllViews.js +137 -0
  78. package/cypress/e2e/ILC/ToolSettings/toolSettingsContent.js +4 -4
  79. package/cypress/fixtures/theme/ilc.json +14 -26
  80. package/cypress/pages/brainingCampManipulativePage.js +122 -0
  81. package/cypress/pages/components/autoScoredScoringSectionMultiResponseType.js +1 -1
  82. package/cypress/pages/components/autoScoredSpecifyCorrectAnswerSection.js +3 -0
  83. package/cypress/pages/components/autoScoredStudentViewSettings.js +1 -1
  84. package/cypress/pages/components/colorPopupComponent.js +2 -2
  85. package/cypress/pages/components/defaultToolDropdown.js +77 -0
  86. package/cypress/pages/components/gridQuestionCommonComponent.js +629 -2
  87. package/cypress/pages/components/index.js +3 -0
  88. package/cypress/pages/components/maximumCapacityPerDropzoneComponent.js +1 -1
  89. package/cypress/pages/components/measuringToolComponent.js +2 -2
  90. package/cypress/pages/components/resetPopupComponent.js +74 -0
  91. package/cypress/pages/components/scoringSectionBaseEditTab.js +1 -1
  92. package/cypress/pages/components/setPointsPopupBase.js +6 -4
  93. package/cypress/pages/components/specifyRowsAndColumnsComponent.js +60 -3
  94. package/cypress/pages/components/toolSettingsComponent.js +80 -12
  95. package/cypress/pages/components/toolsAndControlsComponent.js +69 -0
  96. package/cypress/pages/dragAndDropIntoCategoriesPage.js +0 -8
  97. package/cypress/pages/feedbackScalePage copy.js +716 -0
  98. package/cypress/pages/feedbackScalePage.js +591 -449
  99. package/cypress/pages/fillInTheGapsOverImageDragAndDropPage.js +3 -1
  100. package/cypress/pages/graphingPage.js +9 -145
  101. package/cypress/pages/gridFillPage.js +135 -120
  102. package/cypress/pages/highlightPage.js +0 -394
  103. package/cypress/pages/index.js +5 -2
  104. package/cypress/pages/matchingPage.js +78 -20
  105. package/cypress/pages/multipleSelectionGridPage.js +88 -1
  106. package/cypress/pages/numberLinePage.js +723 -0
  107. package/cypress/pages/singleSelectionGridPage.js +86 -0
  108. package/cypress/pages/textSelectionPage.js +582 -0
  109. package/package.json +2 -2
@@ -0,0 +1,216 @@
1
+ import { feedbackScalePage, itemPreviewPage, studentViewPage } from "../../../pages";
2
+ import abortEarlySetup from "../../../support/helpers/abortEarly";
3
+ import utilities from "../../../support/helpers/utilities";
4
+ const previewContentViews = ['Question preview', 'Item view', 'Item preview', 'Student view', 'Grading view'];
5
+ const views = utilities.getViews(previewContentViews);
6
+ var itemReferenceID = "";
7
+ const css = Cypress.env('css');
8
+ const selectedStateFeedbackButtonColor = 'rgba(236, 216, 19, 0.1)'
9
+ const optionsContentForTextLayout = [
10
+ {
11
+ 'labels': 'Uncomfortable',
12
+ 'color': 'rgb(255, 133, 165)',
13
+ 'legendText': 'I am uncomfortable with the learning target.'
14
+ },
15
+ {
16
+ 'labels': 'Need some support',
17
+ 'color': 'rgb(236, 216, 19)',
18
+ 'legendText': 'I am somewhat comfortable with the learning target.'
19
+ },
20
+ {
21
+ 'labels': 'Comfortable',
22
+ 'color': 'rgb(77, 188, 147)',
23
+ 'legendText': 'I am comfortable with the learning target.'
24
+ }
25
+ ];
26
+
27
+ describe('Create item page: Feedback scale - Preview tab contents in all views for "Text" feedback scale style layout', () => {
28
+ before(() => {
29
+ cy.loginAs('admin');
30
+ });
31
+
32
+ views.forEach((view) => {
33
+ describe(`Preview tab contents - ${view}`, { tags: 'smoke' }, () => {
34
+ abortEarlySetup();
35
+ before(() => {
36
+ switch (view) {
37
+ case 'Question preview':
38
+ feedbackScalePage.steps.navigateToCreateQuestion('feedback scale');
39
+ cy.barsPreLoaderWait();
40
+ feedbackScalePage.steps.addTextInQuestionInstructionsInputField('Reflect on your progress toward the learning target by rating your comfort level.');
41
+ feedbackScalePage.steps.checkAllowStudentsToAddCommentCheckbox();
42
+ feedbackScalePage.steps.expandOptionAccordion(0);
43
+ feedbackScalePage.steps.addLegendText(0, optionsContentForTextLayout[0].legendText);
44
+ feedbackScalePage.steps.expandOptionAccordion(1);
45
+ feedbackScalePage.steps.addLegendText(1, optionsContentForTextLayout[1].legendText);
46
+ feedbackScalePage.steps.expandOptionAccordion(2);
47
+ feedbackScalePage.steps.addLegendText(2, optionsContentForTextLayout[2].legendText);
48
+ feedbackScalePage.steps.switchToPreviewTab();
49
+ break;
50
+ case 'Item view':
51
+ cy.visit(`/item-engine/demo/edit-item/${utilities.base64Encoding(itemReferenceID)}`);
52
+ break;
53
+ case 'Item preview':
54
+ cy.visit(`/item-engine/demo/edit-item/${utilities.base64Encoding(itemReferenceID)}`);
55
+ feedbackScalePage.steps.switchToPreviewTab();
56
+ break;
57
+ case 'Student view':
58
+ cy.visit(`/item-engine/demo/render-item/student-view/${utilities.base64Encoding(itemReferenceID)}`);
59
+ break;
60
+ case 'Grading view':
61
+ cy.visit(`/item-engine/demo/render-item/grading-view/${utilities.base64Encoding(itemReferenceID)}`);
62
+ break;
63
+ default:
64
+ throw new Error('Invalid view');
65
+ }
66
+ });
67
+
68
+ after(() => {
69
+ if (view === 'Question preview') {
70
+ feedbackScalePage.steps.clickOnSaveQuestionButton();
71
+ utilities.verifyElementVisibilityState(itemPreviewPage.referenceID(), 'visible');
72
+ itemReferenceID = itemPreviewPage.steps.getItemReferenceID();
73
+ }
74
+ if (view === 'Student view') {
75
+ studentViewPage.steps.submitResponse();
76
+ utilities.verifyElementVisibilityState(studentViewPage.buttonGoToGradingView(), 'visible');
77
+ }
78
+ });
79
+
80
+ it('Question instructions should be visible', () => {
81
+ utilities.verifyInnerText(feedbackScalePage.questionInstructionsText(), 'Reflect on your progress toward the learning target by rating your comfort level.');
82
+ utilities.verifyElementVisibilityState(feedbackScalePage.questionInstructionsText(), 'visible');
83
+ });
84
+
85
+ it('By default three feedback buttons - \'Uncomfortable\', \'Need some support\' and \'Comfortable\' should be displayed', () => {
86
+ utilities.verifyElementCount(feedbackScalePage.feedbackButton(), 3);
87
+ optionsContentForTextLayout.forEach((buttonContent, buttonIndex) => {
88
+ feedbackScalePage.steps.verifyFeedbackButtonInPreviewTab(buttonIndex, buttonContent.labels);
89
+ feedbackScalePage.steps.verifyFeedbackButtonColorBlockPreviewTab(buttonIndex, buttonContent.color);
90
+ });
91
+ });
92
+
93
+ if (view !== 'Grading view') {
94
+ it('CSS of feedback buttons - unselected state', { tags: 'css' }, () => {
95
+ utilities.verifyCSS(feedbackScalePage.feedbackButtonLabelText(), {
96
+ 'color': css.color.text,
97
+ 'font-size': css.fontSize.default,
98
+ 'font-weight': css.fontWeight.regular,
99
+ });
100
+ utilities.verifyCSS(feedbackScalePage.feedbackButton(), {
101
+ 'background-color': css.color.transparent,
102
+ 'border': `1px solid ${css.color.figDefaultComponentBorder}`
103
+ });
104
+ });
105
+
106
+ it('Accessibility of feedback buttons - unselected state', { tags: 'a11y' }, () => {
107
+ cy.checkAccessibility(feedbackScalePage.feedbackButton().parents('[class*="question-preview-wrapper"]'));
108
+ });
109
+ }
110
+
111
+ feedbackScalePage.tests.verifyLegendAccordionDefaultState();
112
+
113
+ feedbackScalePage.tests.verifyLegendAccordionCollapsedAndExpandedState();
114
+
115
+ it('The legend text accordion should display the color block, feedback button text and the associated legend text', () => {
116
+ optionsContentForTextLayout.forEach((buttonContent, buttonIndex) => {
117
+ const { color, labels, legendText } = buttonContent;
118
+ feedbackScalePage.steps.verifyColorBlockFeedbackButtonLabelLegendTextInLegendAccordion(buttonIndex, {
119
+ colorBlock: color,
120
+ buttonText: labels,
121
+ legendText: legendText
122
+ });
123
+ });
124
+ });
125
+
126
+ if (view !== 'Grading view') {
127
+ it('The user should be able to mark feedback by clicking on any feedback button', () => {
128
+ feedbackScalePage.steps.clickOnFeedbackButton(0);
129
+ feedbackScalePage.steps.verifyFeedbackButtonSelectedState(0);
130
+ });
131
+
132
+ it('The user should be able to update the feedback by selecting other button, previously selected button should get unselected', () => {
133
+ feedbackScalePage.steps.clickOnFeedbackButton(1);
134
+ feedbackScalePage.steps.verifyFeedbackButtonSelectedState(1);
135
+ feedbackScalePage.steps.verifyFeedbackButtonUnselectedState(0);
136
+ });
137
+
138
+ it('A comment label and empty input field should be displayed', () => {
139
+ utilities.verifyInnerText(feedbackScalePage.commentLabel(), 'Comment');
140
+ feedbackScalePage.steps.verifyTextInCommentInputField('');
141
+ });
142
+
143
+ it('The user should be able to add comment in the comments input field', () => {
144
+ feedbackScalePage.steps.enterTextInCommentInputField('Excellent worksheet');
145
+ feedbackScalePage.steps.verifyTextInCommentInputField('Excellent worksheet');
146
+ });
147
+ } else {
148
+ it('The submitted feedback button should be in selected state', () => {
149
+ utilities.verifyElementCount(feedbackScalePage.feedbackButton(), 3);
150
+ feedbackScalePage.steps.verifyFeedbackButtonSelectedState(1);
151
+ });
152
+
153
+ it('The submitted feedback should not be editable', () => {
154
+ feedbackScalePage.steps.verifyFeedbackButtonDisabledState(0);
155
+ feedbackScalePage.steps.verifyFeedbackButtonDisabledState(2);
156
+ });
157
+
158
+ it('The added comment should be displayed in the input field', () => {
159
+ feedbackScalePage.steps.verifyTextInCommentInputField('Excellent worksheet');
160
+ });
161
+
162
+ it('The submitted comment should not be editable', () => {
163
+ utilities.verifyElementDisabled(feedbackScalePage.commentInputField());
164
+ });
165
+ }
166
+
167
+ if (view === 'Question preview' || view === 'Item preview') {
168
+ it('On switching to "Grading view", the marked feedback button should be in selected state', () => {
169
+ feedbackScalePage.steps.switchToGradingView();
170
+ feedbackScalePage.steps.verifyFeedbackButtonSelectedState(1);
171
+ });
172
+ }
173
+
174
+ it('CSS of feedback buttons - selected state', { tags: 'css' }, () => {
175
+ utilities.verifyCSS(utilities.getNthElement(feedbackScalePage.feedbackButtonLabelText(), 1), {
176
+ 'color': css.color.text,
177
+ 'font-size': css.fontSize.default,
178
+ 'font-weight': css.fontWeight.bold,
179
+ });
180
+ utilities.verifyCSS(utilities.getNthElement(feedbackScalePage.feedbackButton(), 1), {
181
+ 'background-color': selectedStateFeedbackButtonColor,
182
+ 'border': `2px solid ${css.color.activeComponentBorder}`
183
+ });
184
+ utilities.verifyCSS(feedbackScalePage.legendAccordion().find('.customize_info_label'), {
185
+ 'color': css.color.activeButtons,
186
+ 'font-size': css.fontSize.normal,
187
+ 'font-weight': css.fontWeight.regular
188
+ });
189
+ utilities.verifyCSS(feedbackScalePage.legendTextFeedbackButtonLabel(), {
190
+ 'color': css.color.text,
191
+ 'font-size': css.fontSize.small,
192
+ 'font-weight': css.fontWeight.semibold
193
+ });
194
+ utilities.verifyCSS(feedbackScalePage.legendTextPreviewTab(), {
195
+ 'color': css.color.text,
196
+ 'font-size': css.fontSize.small,
197
+ 'font-weight': css.fontWeight.regular
198
+ });
199
+ utilities.verifyCSS(feedbackScalePage.commentLabel(), {
200
+ 'color': css.color.labels,
201
+ 'font-size': css.fontSize.default,
202
+ 'font-weight': css.fontWeight.semibold,
203
+ });
204
+ utilities.verifyCSS(feedbackScalePage.commentInputField(), {
205
+ 'color': css.color.text,
206
+ 'font-size': css.fontSize.default,
207
+ 'font-weight': css.fontWeight.regular,
208
+ });
209
+ });
210
+
211
+ it('Accessibility of feedback buttons - selected state', { tags: 'a11y' }, () => {
212
+ cy.checkAccessibility(feedbackScalePage.feedbackButton().parents('[class*="question-preview-wrapper"]'));
213
+ });
214
+ });
215
+ });
216
+ });
@@ -0,0 +1,336 @@
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 starsDefaultColor = "rgb(226, 121, 0)";
6
+ const heartsDefaultColor = "rgb(255, 56, 0)";
7
+ const css = Cypress.env('css');
8
+ //Note: Only covering differentiating cases for Heart Feedback scale UI
9
+ describe('Create item page: Feedback scale - Stars/Hearts feedback scale style - Edit and preview tab contents and functionality ', () => {
10
+ before(() => {
11
+ cy.loginAs('admin');
12
+ });
13
+
14
+ describe('Stars/Hearts feedback scale style - Edit tab contents', () => {
15
+ abortEarlySetup();
16
+ before(() => {
17
+ feedbackScalePage.steps.navigateToCreateQuestion('feedback scale');
18
+ cy.barsPreLoaderWait();
19
+ });
20
+
21
+ it('The user should be able to select "Stars/Hearts" feedback scale style from the feedback scale style dropdown', () => {
22
+ feedbackScalePage.steps.expandFeedbackScaleStyleDropdown();
23
+ feedbackScalePage.steps.selectOptionFromFeedbackScaleStyleDropdown('Stars / Hearts');
24
+ });
25
+
26
+ it('When the user selects "Stars/Hearts" feedback scale style from the feedback scale style dropdown, "Feedback scale UI" label, "Stars" and "Hearts" button should be displayed. "Stars" should be selected by default', () => {
27
+ utilities.verifyInnerText(feedbackScalePage.feedbackScaleUILabel(), 'Feedback scale UI');
28
+ utilities.verifyElementVisibilityState(feedbackScalePage.starsFeedbackScaleUIButton(), 'visible');
29
+ utilities.verifyElementVisibilityState(feedbackScalePage.heartsFeedbackScaleUIButton(), 'visible');
30
+ feedbackScalePage.steps.verifyStarsFeedbackScaleUIButtonSelectedState();
31
+ });
32
+
33
+ it('By default in the options stepper count input field, "5" should be displayed', () => {
34
+ feedbackScalePage.steps.verifyCountInOptionsStepperInputField(5);
35
+ });
36
+
37
+ it('5 option accordions should be displayed with label "Option #" (# being a number from 1 to 5), Points and "Delete option" icon button, by default all option accordions should be in collapsed state', () => {
38
+ for (let index = 0; index < 5; index++) {
39
+ feedbackScalePage.steps.verifyOptionsAccordionProperties(index, { optionLabel: `Option ${index + 1}`, Points: `${index + 1}` });
40
+ feedbackScalePage.steps.verifyOptionAccordionCollapsedState(index);
41
+ }
42
+ });
43
+
44
+ it('The user should be able to expand any option accordion, on expanding the option accordion, a "Legend text" label and empty input field with placeholder text, "Enter legend text" should be displayed', () => {
45
+ feedbackScalePage.steps.expandOptionAccordion(0);
46
+ utilities.verifyInnerText(utilities.getNthElement(feedbackScalePage.legendTextLabel(), 0), 'Legend text');
47
+ feedbackScalePage.steps.verifyLegendTextInputFieldPlaceholder(0);
48
+ });
49
+
50
+ it('The user should be able to enter text in the legend text input field, the placeholder text should disappear on entering the text', () => {
51
+ feedbackScalePage.steps.addLegendText(0, 'I am uncomfortable with the learning target.');
52
+ feedbackScalePage.steps.verifyLegendTextInputFieldPlaceholderNotExists(0);
53
+ });
54
+
55
+ it('When the user removes the added text from the legend input field, the placeholder text should appear again', () => {
56
+ feedbackScalePage.steps.clearLegendTextInputField(0);
57
+ feedbackScalePage.steps.verifyLegendTextInputFieldPlaceholder(0);
58
+ });
59
+
60
+ it('On expanding any other option accordion, the previously expanded accordion should continue to stay in expanded state', () => {
61
+ feedbackScalePage.steps.expandOptionAccordion(1);
62
+ feedbackScalePage.steps.verifyOptionAccordionExpandedState(0);
63
+ feedbackScalePage.steps.verifyOptionAccordionExpandedState(1);
64
+ });
65
+
66
+ it('The user should be able to switch to the "Hearts" feedback scale style by clicking on the hearts toggle button. For "Hearts" feedback scale style, in the color section, the color block should be of "rgb(255, 56, 0)"', () => {
67
+ feedbackScalePage.steps.selectFeedbackScaleUIButton('Hearts');
68
+ feedbackScalePage.steps.verifyColorPickerBlockColor(0, heartsDefaultColor);
69
+ });
70
+ });
71
+
72
+ describe('Stars feedback scale style - Preview tab contents and functionality', () => {
73
+ const legendTexts = ['Poor', 'Okay', 'Can do better', 'Good', 'Excellent'];
74
+ abortEarlySetup();
75
+ before(() => {
76
+ feedbackScalePage.steps.navigateToCreateQuestion('feedback scale');
77
+ cy.barsPreLoaderWait();
78
+ feedbackScalePage.steps.expandFeedbackScaleStyleDropdown();
79
+ feedbackScalePage.steps.selectOptionFromFeedbackScaleStyleDropdown('Stars / Hearts');
80
+ feedbackScalePage.steps.switchToPreviewTab();
81
+ });
82
+
83
+ it('By default 5 star buttons should be displayed in the preview tab', () => {
84
+ utilities.verifyElementCount(feedbackScalePage.feedbackStarButton(), 5);
85
+ utilities.verifyElementVisibilityState(feedbackScalePage.feedbackStarButton(), 'visible')
86
+ });
87
+
88
+ feedbackScalePage.tests.verifyLegendAccordionDefaultState();
89
+
90
+ it('The legend text accordion should display the star icons, for each incrementing star button, the highlighted star icons in the legend text accordion should increase, legend text should not be displayed', () => {
91
+ for (let index = 0; index < 5; index++) {
92
+ feedbackScalePage.steps.verifyHighlightedStarsInLegendTextListItem(index);
93
+ };
94
+ utilities.verifyElementVisibilityState(feedbackScalePage.legendTextPreviewTab(), 'notExist');
95
+ });
96
+
97
+ it('When the user switches to edit tab and adds legend text, then the added legend text should be displayed besides the respective star buttons in the legend text accordion', () => {
98
+ feedbackScalePage.steps.switchToEditTab();
99
+ legendTexts.forEach((legendText, index) => {
100
+ feedbackScalePage.steps.expandOptionAccordion(index);
101
+ feedbackScalePage.steps.addLegendText(index, legendText);
102
+ });
103
+ feedbackScalePage.steps.switchToPreviewTab();
104
+ legendTexts.forEach((legendText, buttonIndex) => {
105
+ feedbackScalePage.steps.verifyLegendTextInLegendAccordion(buttonIndex, legendText);
106
+ });
107
+ });
108
+
109
+ it('CSS of star buttons - unselected state', { tags: 'css' }, () => {
110
+ utilities.verifyCSS(feedbackScalePage.feedbackStarButton().find('g g path').eq(1), {
111
+ 'fill': css.color.feedbackStar,
112
+ });
113
+ });
114
+
115
+ it('Accessibility of star buttons - unselected state', { tags: 'a11y' }, () => {
116
+ cy.checkAccessibility(feedbackScalePage.feedbackStarButton().parents('[class*="question-preview-wrapper"]'));
117
+ });
118
+
119
+ it('The user should be able to mark feedback by clicking on any star button', () => {
120
+ feedbackScalePage.steps.clickOnFeedbackStarButton(2);
121
+ feedbackScalePage.steps.verifyHighlightedStarsInFeedbackScale(2, css.color.feedbackStar);
122
+ });
123
+
124
+ it('CSS of star buttons - selected state', { tags: 'css' }, () => {
125
+ utilities.verifyCSS(feedbackScalePage.feedbackStarButton().find('g g g').eq(0), {
126
+ 'fill': css.color.feedbackStar,
127
+ });
128
+ utilities.verifyCSS(feedbackScalePage.legendAccordion().find('.customize_info_label'), {
129
+ 'color': css.color.activeButtons,
130
+ 'font-size': css.fontSize.normal,
131
+ 'font-weight': css.fontWeight.regular
132
+ });
133
+ utilities.verifyCSS(feedbackScalePage.legendTextPreviewTab(), {
134
+ 'color': css.color.text,
135
+ 'font-size': css.fontSize.small,
136
+ 'font-weight': css.fontWeight.regular
137
+ });
138
+ });
139
+
140
+ it('Accessibility of star buttons - selected state', { tags: 'a11y' }, () => {
141
+ cy.checkAccessibility(feedbackScalePage.feedbackStarButton().parents('[class*="question-preview-wrapper"]'));
142
+ });
143
+ });
144
+
145
+ describe('Stars/Hearts feedback scale style - Add and delete options : Edit tab functionality', () => {
146
+ abortEarlySetup();
147
+ before(() => {
148
+ feedbackScalePage.steps.navigateToCreateQuestion('feedback scale');
149
+ cy.barsPreLoaderWait();
150
+ feedbackScalePage.steps.expandFeedbackScaleStyleDropdown();
151
+ feedbackScalePage.steps.selectOptionFromFeedbackScaleStyleDropdown('Stars / Hearts');
152
+ });
153
+
154
+ it('The user should be able to add a new option by increasing the stepper count in the options input field', () => {
155
+ feedbackScalePage.steps.increaseOptionsInputStepperCount(1);
156
+ feedbackScalePage.steps.verifyOptionsAccordionCount(6);
157
+ });
158
+
159
+ it('The newly added option should be displayed with label "Option 6", Points and "Delete option" icon button, by default the accordion should be in collapsed state', () => {
160
+ feedbackScalePage.steps.verifyOptionsAccordionProperties(5, { optionLabel: 'Option 6', Points: '6' });
161
+ feedbackScalePage.steps.verifyOptionAccordionCollapsedState(5);
162
+ });
163
+
164
+ 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', () => {
165
+ feedbackScalePage.steps.addOption();
166
+ feedbackScalePage.steps.verifyCountInOptionsStepperInputField(7);
167
+ feedbackScalePage.steps.verifyOptionsAccordionCount(7);
168
+ feedbackScalePage.steps.verifyOptionsAccordionProperties(6, { optionLabel: 'Option 7', Points: '7' });
169
+ });
170
+
171
+ 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', () => {
172
+ feedbackScalePage.steps.deleteOptionAccordion(5);
173
+ for (let index = 0; index < 6; index++) {
174
+ feedbackScalePage.steps.verifyOptionsAccordionProperties(index, { optionLabel: `Option ${index + 1}`, Points: `${index + 1}` });
175
+ };
176
+ feedbackScalePage.steps.verifyCountInOptionsStepperInputField(6);
177
+ });
178
+
179
+ it('When the user decreases the options stepper count, the last option should get removed and the remaining options should get updated accordingly', () => {
180
+ feedbackScalePage.steps.decreaseOptionsInputStepperCount(1);
181
+ feedbackScalePage.steps.verifyCountInOptionsStepperInputField(5);
182
+ for (let index = 0; index < 5; index++) {
183
+ feedbackScalePage.steps.verifyOptionsAccordionProperties(index, { optionLabel: `Option ${index + 1}`, Points: `${index + 1}` });
184
+ };
185
+ feedbackScalePage.steps.verifyCountInOptionsStepperInputField(5);
186
+ });
187
+ });
188
+
189
+ describe('Stars/Hearts feedback scale style - Add and delete options : Preview tab functionality', () => {
190
+ abortEarlySetup();
191
+ before(() => {
192
+ feedbackScalePage.steps.navigateToCreateQuestion('feedback scale');
193
+ cy.barsPreLoaderWait();
194
+ feedbackScalePage.steps.expandFeedbackScaleStyleDropdown();
195
+ feedbackScalePage.steps.selectOptionFromFeedbackScaleStyleDropdown('Stars / Hearts');
196
+ });
197
+
198
+ it('When the increases the stepper count in the options input field, the newly added feedback buttons should be displayed in the preview tab', () => {
199
+ feedbackScalePage.steps.increaseOptionsInputStepperCount(1);
200
+ feedbackScalePage.steps.switchToPreviewTab();
201
+ utilities.verifyElementCount(feedbackScalePage.feedbackStarButton(), 6);
202
+ utilities.verifyElementCount(feedbackScalePage.legendTextOptionsList(), 6);
203
+ });
204
+
205
+ 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', () => {
206
+ feedbackScalePage.steps.switchToEditTab();
207
+ feedbackScalePage.steps.addOption();
208
+ feedbackScalePage.steps.switchToPreviewTab();
209
+ utilities.verifyElementCount(feedbackScalePage.feedbackStarButton(), 7);
210
+ utilities.verifyElementCount(feedbackScalePage.legendTextOptionsList(), 7);
211
+ });
212
+
213
+ it('When the user deletes an option accordion, then the remaining feedback buttons should get updated accordingly in the preview tab', () => {
214
+ feedbackScalePage.steps.switchToEditTab();
215
+ feedbackScalePage.steps.deleteOptionAccordion(5);
216
+ feedbackScalePage.steps.switchToPreviewTab();
217
+ utilities.verifyElementCount(feedbackScalePage.feedbackStarButton(), 6);
218
+ utilities.verifyElementCount(feedbackScalePage.legendTextOptionsList(), 6);
219
+ });
220
+
221
+ 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', () => {
222
+ feedbackScalePage.steps.switchToEditTab();
223
+ feedbackScalePage.steps.decreaseOptionsInputStepperCount(1);
224
+ feedbackScalePage.steps.switchToPreviewTab();
225
+ utilities.verifyElementCount(feedbackScalePage.feedbackStarButton(), 5);
226
+ utilities.verifyElementCount(feedbackScalePage.legendTextOptionsList(), 5);
227
+ });
228
+ });
229
+
230
+ describe('Stars feedback scale style - Colors section contents', () => {
231
+ const modifiedColor = 'rgba(255, 0, 0, 0.7)'
232
+ abortEarlySetup();
233
+ before(() => {
234
+ feedbackScalePage.steps.navigateToCreateQuestion('feedback scale');
235
+ cy.barsPreLoaderWait();
236
+ feedbackScalePage.steps.expandFeedbackScaleStyleDropdown();
237
+ feedbackScalePage.steps.selectOptionFromFeedbackScaleStyleDropdown('Stars / Hearts');
238
+ });
239
+
240
+ it('For "Stars" feedback scale style, in the color section, a color block with "rgb(230, 122, 0)" color should be displayed. An edit icon and "Edit color" label should be displayed besides the color block"', () => {
241
+ feedbackScalePage.steps.verifyColorPickerBlockColor(0, starsDefaultColor);
242
+ utilities.verifyInnerText(feedbackScalePage.editColorButton(), 'Edit color');
243
+ utilities.verifyElementVisibilityState(feedbackScalePage.editColorButton(), 'visible');
244
+ });
245
+
246
+ it('When the user clicks on the "Edit color" button, a "Select color" popup should be displayed and the default selected color block should be in the selected state in the color popup', () => {
247
+ feedbackScalePage.steps.editColor(0);
248
+ colorPopupComponent.steps.verifySaturationPaletteColor('rgb(230, 122, 0)');
249
+ colorPopupComponent.steps.verifyHuePaletteColor('rgb(255, 136, 0)');
250
+ colorPopupComponent.steps.verifyHexValue('#E27900');
251
+ colorPopupComponent.steps.verifyOpacityInputFieldValue('100');
252
+ colorPopupComponent.steps.verifyOpacitySliderValue('100');
253
+ colorPopupComponent.steps.verifySelectedColorBlock(starsDefaultColor);
254
+ colorPopupComponent.steps.verifyRecommendedColorBlockSelectedState(10);
255
+ });
256
+
257
+ it('When the user modifies the selected color, the updated color should be displayed in the color block of the "Colors" section', () => {
258
+ colorPopupComponent.steps.addInputToHexInputField('#ff0000');
259
+ colorPopupComponent.steps.addInputToOpacityInputField('70');
260
+ colorPopupComponent.steps.clickOnOkButton();
261
+ feedbackScalePage.steps.verifyColorPickerBlockColor(0, modifiedColor);
262
+ });
263
+ });
264
+
265
+ describe('Stars feedback scale style - Colors : Preview tab functionality', () => {
266
+ const modifiedColor = 'rgba(255, 0, 0, 0.7)'
267
+ abortEarlySetup();
268
+ before(() => {
269
+ feedbackScalePage.steps.navigateToCreateQuestion('feedback scale');
270
+ cy.barsPreLoaderWait();
271
+ feedbackScalePage.steps.expandFeedbackScaleStyleDropdown();
272
+ feedbackScalePage.steps.selectOptionFromFeedbackScaleStyleDropdown('Stars / Hearts');
273
+ });
274
+
275
+ it('When the user modifies the selected color for number buttons, then on marking the feedback in the preview tab, the feedback button should get highlighted with the modified color', () => {
276
+ feedbackScalePage.steps.editColor(0);
277
+ colorPopupComponent.steps.addInputToHexInputField('#ff0000');
278
+ colorPopupComponent.steps.addInputToOpacityInputField('70');
279
+ colorPopupComponent.steps.clickOnOkButton();
280
+ feedbackScalePage.steps.switchToPreviewTab();
281
+ feedbackScalePage.steps.clickOnFeedbackStarButton(2);
282
+ feedbackScalePage.steps.verifyHighlightedStarsInFeedbackScale(2, modifiedColor);
283
+ });
284
+ });
285
+
286
+ describe('Hearts feedback scale style - Preview tab contents and functionality', () => {
287
+ abortEarlySetup();
288
+ before(() => {
289
+ feedbackScalePage.steps.navigateToCreateQuestion('feedback scale');
290
+ cy.barsPreLoaderWait();
291
+ feedbackScalePage.steps.expandFeedbackScaleStyleDropdown();
292
+ feedbackScalePage.steps.selectOptionFromFeedbackScaleStyleDropdown('Stars / Hearts');
293
+ feedbackScalePage.steps.selectFeedbackScaleUIButton('Hearts');
294
+ feedbackScalePage.steps.switchToPreviewTab();
295
+ });
296
+
297
+ it('By default 5 heart buttons should be displayed in the preview tab', () => {
298
+ utilities.verifyElementCount(feedbackScalePage.feedbackHeartButton(), 5);
299
+ utilities.verifyElementVisibilityState(feedbackScalePage.feedbackHeartButton(), 'visible')
300
+ });
301
+
302
+ feedbackScalePage.tests.verifyLegendAccordionDefaultState();
303
+
304
+ it('The legend text accordion should display the heart icons, for each incrementing heart button, the highlighted heart icons in the legend text accordion should increase, legend text should not be displayed', () => {
305
+ for (let index = 0; index < 5; index++) {
306
+ feedbackScalePage.steps.verifyHighlightedHeartsInLegendTextListItem(index);
307
+ };
308
+ utilities.verifyElementVisibilityState(feedbackScalePage.legendTextPreviewTab(), 'notExist');
309
+ });
310
+
311
+ it('CSS of heart buttons - unselected state', { tags: 'css' }, () => {
312
+ utilities.verifyCSS(feedbackScalePage.feedbackHeartButton().find('g path').eq(1), {
313
+ 'fill': css.color.feedbackHeart,
314
+ });
315
+ });
316
+
317
+ it('Accessibility of heart buttons - unselected state', { tags: 'a11y' }, () => {
318
+ cy.checkAccessibility(feedbackScalePage.feedbackHeartButton().parents('[class*="question-preview-wrapper"]'));
319
+ });
320
+
321
+ it('The user should be able to mark feedback by clicking on any heart button', () => {
322
+ feedbackScalePage.steps.clickOnFeedbackHeartButton(2);
323
+ feedbackScalePage.steps.verifyHighlightedHeartsInFeedbackScale(2, css.color.feedbackHeart);
324
+ });
325
+
326
+ it('CSS of heart buttons - selected state', { tags: 'css' }, () => {
327
+ utilities.verifyCSS(feedbackScalePage.feedbackHeartButton().find('g').eq(0), {
328
+ 'fill': css.color.feedbackHeart,
329
+ });
330
+ });
331
+
332
+ it('Accessibility of heart buttons - selected state', { tags: 'a11y' }, () => {
333
+ cy.checkAccessibility(feedbackScalePage.feedbackHeartButton().parents('[class*="question-preview-wrapper"]'));
334
+ });
335
+ });
336
+ });