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,214 @@
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 thumbsDefaultColor = "rgba(0, 0, 0, 1)";
6
+ const css = Cypress.env('css');
7
+ const legendTexts = ['Satisfied', 'Not satisfied'];
8
+ const optionsTextArray = ['Thumbs down', 'Thumbs up'];
9
+ describe('Create item page: Feedback scale - Thumbs feedback scale style - Edit and preview tab contents and functionality ', () => {
10
+ before(() => {
11
+ cy.loginAs('admin');
12
+ });
13
+
14
+ describe('Thumbs feedback scale style - Edit tab contents and functionality', () => {
15
+ abortEarlySetup();
16
+ before(() => {
17
+ feedbackScalePage.steps.navigateToCreateQuestion('feedback scale');
18
+ cy.barsPreLoaderWait();
19
+ });
20
+
21
+ it('The user should be able to select "Thumbs" feedback scale style from the feedback scale style dropdown', () => {
22
+ feedbackScalePage.steps.expandFeedbackScaleStyleDropdown();
23
+ feedbackScalePage.steps.selectOptionFromFeedbackScaleStyleDropdown('Thumbs');
24
+ });
25
+
26
+ it('The options stepper count input field should not be displayed for "Thumbs" feedback scale style', () => {
27
+ utilities.verifyElementVisibilityState(feedbackScalePage.optionsStepperInputField(), 'notExist');
28
+ })
29
+
30
+ it('2 option accordions should be displayed with label "Option #" (# being a number from 1 to 2), Option text and Points, "Delete option" icon button should not be displayed, by default all option accordions should be in collapsed state', () => {
31
+ for (let index = 0; index < 2; index++) {
32
+ feedbackScalePage.steps.verifyOptionsAccordionPropertiesForThumbsScale(index, { optionLabel: `Option ${index + 1}\n:\n${optionsTextArray[index]}`, Points: `${index + 1}` });
33
+ feedbackScalePage.steps.verifyOptionAccordionCollapsedState(index);
34
+ }
35
+ });
36
+
37
+ 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 "Thumbs down".', () => {
38
+ feedbackScalePage.steps.expandOptionAccordion(0);
39
+ feedbackScalePage.steps.verifyOptionTextLabel(0);
40
+ feedbackScalePage.steps.verifyOptionInputFieldText(0, 'Thumbs down');
41
+ utilities.verifyInnerText(utilities.getNthElement(feedbackScalePage.legendTextLabel(), 0), 'Legend text');
42
+ feedbackScalePage.steps.verifyLegendTextInputFieldPlaceholder(0);
43
+ });
44
+
45
+ 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 "Thumbs up"', () => {
46
+ feedbackScalePage.steps.expandOptionAccordion(1);
47
+ feedbackScalePage.steps.verifyOptionAccordionExpandedState(0);
48
+ feedbackScalePage.steps.verifyOptionAccordionExpandedState(1);
49
+ feedbackScalePage.steps.verifyOptionTextLabel(1);
50
+ feedbackScalePage.steps.verifyOptionInputFieldText(1, 'Thumbs up');
51
+ utilities.verifyInnerText(utilities.getNthElement(feedbackScalePage.legendTextLabel(), 1), 'Legend text');
52
+ feedbackScalePage.steps.verifyLegendTextInputFieldPlaceholder(1);
53
+ });
54
+
55
+ it('The user should be able to enter text in the legend text input field, the placeholder text should disappear on entering the text', () => {
56
+ feedbackScalePage.steps.addLegendText(0, 'I am uncomfortable with the learning target.');
57
+ feedbackScalePage.steps.verifyLegendTextInputFieldPlaceholderNotExists(0);
58
+ });
59
+
60
+ it('When the user removes the added text from the legend input field, the placeholder text should appear again', () => {
61
+ feedbackScalePage.steps.clearLegendTextInputField(0);
62
+ feedbackScalePage.steps.verifyLegendTextInputFieldPlaceholder(0);
63
+ });
64
+
65
+ it('When the user modifies the option text input field, the updated option text should reflect on the respective option accordion', () => {
66
+ feedbackScalePage.steps.enterTextInOptionTextInputField(0, ' - Not satisfied');
67
+ feedbackScalePage.steps.verifyTextInOptionTextInputField(0, 'Thumbs down - Not satisfied');
68
+ feedbackScalePage.steps.verifyOptionsAccordionLabel(0, 'Option 1\n:\nThumbs down - Not satisfied')
69
+ });
70
+
71
+ it('For "Thumbs" feedback scale style, "+Add option" button should not be displayed', () => {
72
+ utilities.verifyElementVisibilityState(feedbackScalePage.addOptionButton(), 'notExist');
73
+ });
74
+ });
75
+
76
+ describe('Thumbs feedback scale style - Preview tab contents and functionality', () => {
77
+ abortEarlySetup();
78
+ before(() => {
79
+ feedbackScalePage.steps.navigateToCreateQuestion('feedback scale');
80
+ cy.barsPreLoaderWait();
81
+ feedbackScalePage.steps.expandFeedbackScaleStyleDropdown();
82
+ feedbackScalePage.steps.selectOptionFromFeedbackScaleStyleDropdown('Thumbs');
83
+ feedbackScalePage.steps.switchToPreviewTab();
84
+ });
85
+
86
+ it('By default 2 buttons, "Thumbs down" and "Thumbs up" should be displayed in the preview tab', () => {
87
+ utilities.verifyElementVisibilityState(feedbackScalePage.thumbsDownFeedbackButton(), 'visible');
88
+ utilities.verifyElementVisibilityState(feedbackScalePage.thumbsUpFeedbackButton(), 'visible');
89
+ });
90
+
91
+ feedbackScalePage.tests.verifyLegendAccordionDefaultState();
92
+
93
+ feedbackScalePage.tests.verifyLegendAccordionCollapsedAndExpandedState();
94
+
95
+ it('The legend text accordion should display the two thumb buttons and options text, legend text should not be displayed for the thumb buttons', () => {
96
+ feedbackScalePage.steps.verifyThumbsDownButtonInLegendAccordion('Thumbs down');
97
+ feedbackScalePage.steps.verifyThumbsUpButtonInLegendAccordion('Thumbs up');
98
+ utilities.verifyElementVisibilityState(feedbackScalePage.legendTextPreviewTab(), 'notExist');
99
+ });
100
+
101
+ it('When the user switches to edit tab and adds legend text, then the added legend text should be displayed besides the respective thumbs button in the legend text accordion', () => {
102
+ feedbackScalePage.steps.switchToEditTab();
103
+ legendTexts.forEach((legendText, index) => {
104
+ feedbackScalePage.steps.expandOptionAccordion(index);
105
+ feedbackScalePage.steps.addLegendText(index, legendText);
106
+ });
107
+ feedbackScalePage.steps.switchToPreviewTab();
108
+ legendTexts.forEach((legendText, buttonIndex) => {
109
+ feedbackScalePage.steps.verifyLegendTextInLegendAccordion(buttonIndex, legendText);
110
+ });
111
+ });
112
+
113
+ it('CSS of number buttons - unselected state', { tags: 'css' }, () => {
114
+ utilities.verifyCSS(feedbackScalePage.legendTextFeedbackButtonLabel(), {
115
+ 'color': css.color.text,
116
+ 'font-size': css.fontSize.small,
117
+ 'font-weight': css.fontWeight.semibold,
118
+ });
119
+ utilities.verifyCSS(feedbackScalePage.legendTextPreviewTab(), {
120
+ 'color': css.color.text,
121
+ 'font-size': css.fontSize.small,
122
+ 'font-weight': css.fontWeight.regular,
123
+ });
124
+ /* cy.log('Hover state CSS')
125
+ utilities.hoverOverElement(feedbackScalePage.thumbsUpFeedbackButton());
126
+ utilities.verifyCSS(feedbackScalePage.thumbsUpFeedbackButton(), {
127
+ 'background-color': css.color.transparent,
128
+ 'border': '2px solid rgb(102, 102, 102)'
129
+ });
130
+ utilities.hoverAwayFromElement(); */
131
+ });
132
+
133
+ it('Accessibility of number buttons - unselected state', { tags: 'a11y' }, () => {
134
+ cy.checkAccessibility(feedbackScalePage.thumbsDownFeedbackButton().parents('[class*="question-preview-wrapper"]'));
135
+ });
136
+
137
+ it('The user should be able to mark feedback by clicking on any thumb button', () => {
138
+ feedbackScalePage.steps.clickOnThumbsDownButton();
139
+ feedbackScalePage.steps.verifyThumbsDownButtonSelectedState();
140
+ });
141
+
142
+ it('The user should be able to update the feedback by selecting other button, previously selected button should get unselected', () => {
143
+ feedbackScalePage.steps.clickOnThumbsUpButton();
144
+ feedbackScalePage.steps.verifyThumbsUpButtonSelectedState();
145
+ });
146
+
147
+ it('CSS of number buttons - selected state', { tags: 'css' }, () => {
148
+ utilities.verifyCSS(feedbackScalePage.thumbsUpFeedbackButton().find('circle').eq(1), {
149
+ 'fill': 'rgb(0, 0, 0)'
150
+ });
151
+ });
152
+
153
+ it('Accessibility of number buttons - selected state', { tags: 'a11y' }, () => {
154
+ cy.checkAccessibility(feedbackScalePage.thumbsDownFeedbackButton().parents('[class*="question-preview-wrapper"]'));
155
+ });
156
+ });
157
+
158
+ describe('Thumbs feedback scale style - Colors section contents', () => {
159
+ const modifiedColor = 'rgba(255, 0, 0, 0.7)'
160
+ abortEarlySetup();
161
+ before(() => {
162
+ feedbackScalePage.steps.navigateToCreateQuestion('feedback scale');
163
+ cy.barsPreLoaderWait();
164
+ feedbackScalePage.steps.expandFeedbackScaleStyleDropdown();
165
+ feedbackScalePage.steps.selectOptionFromFeedbackScaleStyleDropdown('Thumbs');
166
+ });
167
+
168
+ it('For "Thumbs" feedback scale style, in the color section, a color block with "rgba(0, 0, 0, 1)" color should be displayed. An edit icon and "Edit color" label should be displayed besides the color block"', () => {
169
+ feedbackScalePage.steps.verifyColorPickerBlockColor(0, 'rgb(0, 0, 0)');
170
+ utilities.verifyInnerText(feedbackScalePage.editColorButton(), 'Edit color');
171
+ utilities.verifyElementVisibilityState(feedbackScalePage.editColorButton(), 'visible');
172
+ });
173
+
174
+ 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', () => {
175
+ feedbackScalePage.steps.editColor(0);
176
+ colorPopupComponent.steps.verifySaturationPaletteColor('rgb(0, 0, 0)');
177
+ colorPopupComponent.steps.verifyHuePaletteColor('rgb(255, 0, 0)');
178
+ colorPopupComponent.steps.verifyHexValue('#000000');
179
+ colorPopupComponent.steps.verifyOpacityInputFieldValue('100');
180
+ colorPopupComponent.steps.verifyOpacitySliderValue('100');
181
+ colorPopupComponent.steps.verifySelectedColorBlock(thumbsDefaultColor);
182
+ colorPopupComponent.steps.verifyRecommendedColorBlockSelectedState(8);
183
+ });
184
+
185
+ it('When the user modifies the selected color, the updated color should be displayed in the color block of the "Colors" section', () => {
186
+ colorPopupComponent.steps.addInputToHexInputField('#ff0000');
187
+ colorPopupComponent.steps.addInputToOpacityInputField('70');
188
+ colorPopupComponent.steps.clickOnOkButton();
189
+ feedbackScalePage.steps.verifyColorPickerBlockColor(0, modifiedColor);
190
+ })
191
+ });
192
+
193
+ describe('Thumbs feedback scale style - Colors : Preview tab functionality', () => {
194
+ const modifiedColor = 'rgba(255, 0, 0, 0.1)'
195
+ abortEarlySetup();
196
+ before(() => {
197
+ feedbackScalePage.steps.navigateToCreateQuestion('feedback scale');
198
+ cy.barsPreLoaderWait();
199
+ feedbackScalePage.steps.expandFeedbackScaleStyleDropdown();
200
+ feedbackScalePage.steps.selectOptionFromFeedbackScaleStyleDropdown('Thumbs');
201
+ });
202
+
203
+ 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', () => {
204
+ feedbackScalePage.steps.editColor(0);
205
+ colorPopupComponent.steps.addInputToHexInputField('#ff0000');
206
+ colorPopupComponent.steps.addInputToOpacityInputField('70');
207
+ colorPopupComponent.steps.clickOnOkButton();
208
+ feedbackScalePage.steps.switchToPreviewTab();
209
+ feedbackScalePage.steps.clickOnThumbsUpButton();
210
+ feedbackScalePage.steps.verifyThumbsUpButtonSelectedState();
211
+ feedbackScalePage.steps.verifyThumbsUpButtonSelectedStateColor(modifiedColor);
212
+ });
213
+ });
214
+ });
@@ -0,0 +1,356 @@
1
+ import { fillInTheGapsDragAndDropPage } from "../../../pages";
2
+ import abortEarlySetup from "../../../support/helpers/abortEarly";
3
+
4
+ describe('Fill In the Gaps Additional settings and Responses accordion', () => {
5
+ before(() => {
6
+ cy.loginAs('admin');
7
+ });
8
+
9
+ describe('Additional Settings accordion', () => {
10
+ abortEarlySetup();
11
+ before(() => {
12
+ fillInTheGapsDragAndDropPage.steps.navigateToCreateQuestion('fill in the gaps with drag and drop');
13
+ cy.barsPreLoaderWait();
14
+ });
15
+
16
+ fillInTheGapsDragAndDropPage.tests.verifyAdditionalSettingsAccordionProperties();
17
+ });
18
+
19
+ describe('Additional Settings: Height and Width', () => {
20
+ abortEarlySetup();
21
+ before(() => {
22
+ fillInTheGapsDragAndDropPage.steps.navigateToCreateQuestion('fill in the gaps with drag and drop');
23
+ cy.barsPreLoaderWait();
24
+ fillInTheGapsDragAndDropPage.steps.expandAdditionalSettings();
25
+ });
26
+
27
+ fillInTheGapsDragAndDropPage.tests.verifyHeightAndWidthLabelInputFieldWithCSSAnda11y()
28
+
29
+ //Height and width test cases for set correct answer section response fields
30
+ //TODO: We will need to revisit below case as it will fail for mobile view
31
+ it('When the input field of \'Height\' and \'Width\' is kept empty, the default dimension of the response field should be (197x46)px in the \'Set correct answer\' section response field', () => {
32
+ fillInTheGapsDragAndDropPage.heightInputField()
33
+ .should('have.value', '');
34
+ fillInTheGapsDragAndDropPage.widthInputField()
35
+ .should('have.value', '');
36
+ for (let index = 0; index < 2; index++) {
37
+ fillInTheGapsDragAndDropPage.setCorrectAnswerResponseArea()
38
+ .eq(index)
39
+ .should('have.attr', 'height', '46.000')
40
+ .and('have.attr', 'width', '197.000px');
41
+ };
42
+ });
43
+
44
+ it('When the user adds \'Height\' for the response field then the height of the response field should get updated accordingly in the \'Set correct answer\' section', () => {
45
+ fillInTheGapsDragAndDropPage.heightInputField()
46
+ .type('100')
47
+ .should('have.value', '100')
48
+ .blur();
49
+ for (let index = 0; index < 2; index++) {
50
+ fillInTheGapsDragAndDropPage.setCorrectAnswerResponseArea()
51
+ .eq(index)
52
+ .should('have.attr', 'height', '100.000')
53
+ };
54
+ });
55
+
56
+ it('When the user adds \'Width\' for the response field then the Width of the response field should get updated accordingly in the \'Set correct answer\' section', () => {
57
+ fillInTheGapsDragAndDropPage.heightInputField()
58
+ .clear()
59
+ .should('have.value', '');
60
+ fillInTheGapsDragAndDropPage.widthInputField()
61
+ .type('100')
62
+ .should('have.value', '100')
63
+ .blur();
64
+ for (let index = 0; index < 2; index++) {
65
+ fillInTheGapsDragAndDropPage.setCorrectAnswerResponseArea()
66
+ .eq(index)
67
+ .should('have.attr', 'width', '100.000px')
68
+ };
69
+ });
70
+
71
+ it('When the user enters a value below 80px in the \'Width\' input field then the width of the input field should remain 80px in \'Set correct answer\' section', () => {
72
+ fillInTheGapsDragAndDropPage.widthInputField()
73
+ .clear()
74
+ .type('20')
75
+ .should('have.value', '20')
76
+ .blur();
77
+ for (let index = 0; index < 2; index++) {
78
+ fillInTheGapsDragAndDropPage.setCorrectAnswerResponseArea()
79
+ .eq(index)
80
+ .should('have.attr', 'width', '80.000px')
81
+ };
82
+ });
83
+
84
+ it('When the user enters a value above 400px in the \'Width\' input field then the width of the input field should remain 400px in \'Set correct answer\' section', () => {
85
+ fillInTheGapsDragAndDropPage.widthInputField()
86
+ .clear()
87
+ .type('800')
88
+ .should('have.value', '800')
89
+ .blur();
90
+ for (let index = 0; index < 2; index++) {
91
+ fillInTheGapsDragAndDropPage.setCorrectAnswerResponseArea()
92
+ .eq(index)
93
+ .should('have.attr', 'width', '400.000px')
94
+ };
95
+ });
96
+
97
+ //Height and width test cases for preview tab response fields
98
+ //TODO: We will need to revisit below case as it will fail for mobile view
99
+ it('When the input field of \'Height\' and \'Width\' is kept empty, the default dimension of the response field should be (197x46)px for the preview tab', () => {
100
+ fillInTheGapsDragAndDropPage.widthInputField()
101
+ .clear()
102
+ .should('have.value', '');
103
+ fillInTheGapsDragAndDropPage.steps.switchToPreviewTab();
104
+ for (let index = 0; index < 2; index++) {
105
+ fillInTheGapsDragAndDropPage.previewTabResponseArea()
106
+ .eq(index)
107
+ .should('have.attr', 'height', '46.000')
108
+ .and('have.attr', 'width', '197.000px');
109
+ };
110
+ });
111
+
112
+ it('When the user adds \'Height\' for the response field then the height of the response field should get updated accordingly in the preview tab', () => {
113
+ cy.log('Pre step: Switching to Edit tab')
114
+ fillInTheGapsDragAndDropPage.steps.switchToEditTab();
115
+ fillInTheGapsDragAndDropPage.heightInputField()
116
+ .type('100')
117
+ .should('have.value', '100');
118
+ fillInTheGapsDragAndDropPage.steps.switchToPreviewTab();
119
+ for (let index = 0; index < 2; index++) {
120
+ fillInTheGapsDragAndDropPage.previewTabResponseArea()
121
+ .eq(index)
122
+ .should('have.attr', 'height', '100.000');
123
+ };
124
+ });
125
+
126
+ it('When the user adds \'Width\' for the response field then the response fields should get updated accordingly in the preview tab', () => {
127
+ cy.log('Pre step: Switching to Edit tab')
128
+ fillInTheGapsDragAndDropPage.steps.switchToEditTab();
129
+ fillInTheGapsDragAndDropPage.heightInputField()
130
+ .clear()
131
+ .should('have.value', '');
132
+ fillInTheGapsDragAndDropPage.widthInputField()
133
+ .type('100')
134
+ .should('have.value', '100');
135
+ fillInTheGapsDragAndDropPage.steps.switchToPreviewTab();
136
+ for (let index = 0; index < 2; index++) {
137
+ fillInTheGapsDragAndDropPage.previewTabResponseArea()
138
+ .eq(index)
139
+ .should('have.attr', 'width', '100.000px');
140
+ };
141
+ });
142
+
143
+ it('When the user enters a value below 80px in the \'Width\' input field then the input field should remain 80px for the preview tab response fields', () => {
144
+ cy.log('Pre step: Switching to Edit tab')
145
+ fillInTheGapsDragAndDropPage.steps.switchToEditTab();
146
+ fillInTheGapsDragAndDropPage.widthInputField()
147
+ .clear()
148
+ .type('20')
149
+ .should('have.value', '20');
150
+ fillInTheGapsDragAndDropPage.steps.switchToPreviewTab();
151
+ for (let index = 0; index < 2; index++) {
152
+ fillInTheGapsDragAndDropPage.previewTabResponseArea()
153
+ .eq(index)
154
+ .should('have.attr', 'width', '80.000px');
155
+ };
156
+ });
157
+
158
+ it('When the user enters a value above 400px in the \'Width\' input field then the input field should remain 400px for preview tab repsonse field', () => {
159
+ cy.log('Pre step: Switching to Edit tab')
160
+ fillInTheGapsDragAndDropPage.steps.switchToEditTab();
161
+ fillInTheGapsDragAndDropPage.widthInputField()
162
+ .clear()
163
+ .type('800')
164
+ .should('have.value', '800');
165
+ fillInTheGapsDragAndDropPage.steps.switchToPreviewTab();
166
+ for (let index = 0; index < 2; index++) {
167
+ fillInTheGapsDragAndDropPage.previewTabResponseArea()
168
+ .eq(index)
169
+ .should('have.attr', 'width', '400.000px');
170
+ };
171
+ });
172
+ });
173
+
174
+ describe('Additional Settings : Response accordion', () => {
175
+ abortEarlySetup();
176
+ before(() => {
177
+ fillInTheGapsDragAndDropPage.steps.navigateToCreateQuestion('fill in the gaps with drag and drop');
178
+ cy.barsPreLoaderWait();
179
+ fillInTheGapsDragAndDropPage.steps.expandAdditionalSettings();
180
+ });
181
+
182
+ fillInTheGapsDragAndDropPage.tests.verifyAdditionalSettingsResponseAccordionLabelCSSAndA11y();
183
+ });
184
+
185
+ describe('Additional Settings: Check Answer', () => {
186
+ abortEarlySetup();
187
+ before(() => {
188
+ fillInTheGapsDragAndDropPage.steps.navigateToCreateQuestion('fill in the gaps with drag and drop');
189
+ cy.barsPreLoaderWait();
190
+ fillInTheGapsDragAndDropPage.addOptionButton()
191
+ .click();
192
+ fillInTheGapsDragAndDropPage.addOptionButton()
193
+ .click();
194
+ fillInTheGapsDragAndDropPage.steps.addInputToOptionsForDragAndDropFields(['Correct answer for response 1', 'Correct answer for response 2', 'Incorrect answer 1', 'Incorrect answer 2']);
195
+ fillInTheGapsDragAndDropPage.pointsInputField()
196
+ .type('4');
197
+ fillInTheGapsDragAndDropPage.steps.setCorrectAnswerSectionClickAndDropDraggableOptionInResponseArea('Correct answer for response 1', 0);
198
+ fillInTheGapsDragAndDropPage.steps.setCorrectAnswerSectionClickAndDropDraggableOptionInResponseArea('Correct answer for response 2', 1);
199
+ fillInTheGapsDragAndDropPage.steps.expandAdditionalSettings();
200
+ });
201
+
202
+ fillInTheGapsDragAndDropPage.tests.verifyCheckAnswerSectionAndPreviewTabCheckAnswerButton();
203
+ });
204
+
205
+ describe('Additional Settings: Check Answer - Functionality', () => {
206
+ abortEarlySetup();
207
+ before(() => {
208
+ fillInTheGapsDragAndDropPage.steps.navigateToCreateQuestion('fill in the gaps with drag and drop');
209
+ cy.barsPreLoaderWait();
210
+ fillInTheGapsDragAndDropPage.addOptionButton()
211
+ .click();
212
+ fillInTheGapsDragAndDropPage.addOptionButton()
213
+ .click();
214
+ fillInTheGapsDragAndDropPage.steps.addInputToOptionsForDragAndDropFields(['Correct answer for response 1', 'Correct answer for response 2', 'Incorrect answer 1', 'Incorrect answer 2']);
215
+ fillInTheGapsDragAndDropPage.pointsInputField()
216
+ .type('4');
217
+ fillInTheGapsDragAndDropPage.steps.setCorrectAnswerSectionClickAndDropDraggableOptionInResponseArea('Correct answer for response 1', 0);
218
+ fillInTheGapsDragAndDropPage.steps.setCorrectAnswerSectionClickAndDropDraggableOptionInResponseArea('Correct answer for response 2', 1);
219
+ fillInTheGapsDragAndDropPage.steps.expandAdditionalSettings();
220
+ fillInTheGapsDragAndDropPage.steps.setMaximumCheckAnswerAttempts(2);
221
+ fillInTheGapsDragAndDropPage.steps.switchToPreviewTab();
222
+ });
223
+
224
+ it('When the user has not set any responses then on clicking on the Check Answer button icons should not be displayed beside both empty responses, label should not be displayed below the box', () => {
225
+ for (let index = 0; index < 2; index++) {
226
+ fillInTheGapsDragAndDropPage.previewTabResponseArea()
227
+ .eq(index)
228
+ .should('have.value', '');
229
+ };
230
+ fillInTheGapsDragAndDropPage.checkAnswerButton()
231
+ .click();
232
+ fillInTheGapsDragAndDropPage.correctIcon()
233
+ .should('not.exist');
234
+ fillInTheGapsDragAndDropPage.incorrectIcon()
235
+ .should('not.exist');
236
+ fillInTheGapsDragAndDropPage.correctIncorrectAnswerLabel()
237
+ .should('not.exist');
238
+ fillInTheGapsDragAndDropPage.previewTabCorrectAnswerContainer()
239
+ .should('not.exist')
240
+ });
241
+
242
+ it('When the user has added correct response for one option then on clicking on the Check Answer button, green checkmark icon should be displayed besides the correct response, red crossmark should not be displayed beside empty response and \'Incorrect Answer\' label should be displayed below the box', () => {
243
+ fillInTheGapsDragAndDropPage.steps.previewTabClickAndDropDraggableOptionInResponseArea('Correct answer for response 1', 0);
244
+ fillInTheGapsDragAndDropPage.checkAnswerButton()
245
+ .click();
246
+ fillInTheGapsDragAndDropPage.steps.verifyCorrectOptionCheckmarkIcon(0);
247
+ fillInTheGapsDragAndDropPage.steps.verifyCorrectIncorrectIconNotVisible(1);
248
+ fillInTheGapsDragAndDropPage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect')
249
+ fillInTheGapsDragAndDropPage.steps.verifyIncorrectAttemptBorder();
250
+ });
251
+
252
+ it('When the user has added correct responses then on clicking on the Check Answer button, green checkmark icon should be displayed besides the responses and \'Correct Answer\' label should be displayed below the box', () => {
253
+ fillInTheGapsDragAndDropPage.steps.previewTabClickAndDropDraggableOptionInResponseArea('Correct answer for response 2', 1);
254
+ fillInTheGapsDragAndDropPage.checkAnswerButton()
255
+ .click();
256
+ fillInTheGapsDragAndDropPage.steps.verifyCorrectOptionCheckmarkIcon(0);
257
+ fillInTheGapsDragAndDropPage.steps.verifyCorrectOptionCheckmarkIcon(1);
258
+ fillInTheGapsDragAndDropPage.steps.verifyCorrectIncorrectAnswerLabel('Correct');
259
+ fillInTheGapsDragAndDropPage.steps.verifyCorrectAttemptBorder();
260
+ });
261
+
262
+
263
+ fillInTheGapsDragAndDropPage.tests.verifyDisabledCheckAnswerButtonWithCSSAnda11y()
264
+
265
+ it('When the user updates the value of Maximum check answer attempts input field, it should get reflected on the Preview tab', () => {
266
+ cy.log('Pre step: Switching to Edit tab')
267
+ fillInTheGapsDragAndDropPage.steps.switchToEditTab();
268
+ fillInTheGapsDragAndDropPage.maximumCheckAnswerAttemptsInputField()
269
+ .clear()
270
+ .type(1)
271
+ .should('have.value', '1');
272
+ cy.log('Switching to Preview tab');
273
+ fillInTheGapsDragAndDropPage.steps.switchToPreviewTab();
274
+ fillInTheGapsDragAndDropPage.checkAnswerButton()
275
+ .should('be.enabled');
276
+ fillInTheGapsDragAndDropPage.steps.previewTabClickAndDropDraggableOptionInResponseArea('Correct answer for response 1', 0);
277
+ fillInTheGapsDragAndDropPage.steps.previewTabClickAndDropDraggableOptionInResponseArea('Correct answer for response 2', 1);
278
+ fillInTheGapsDragAndDropPage.checkAnswerButton()
279
+ .click()
280
+ .should('be.disabled');
281
+ });
282
+
283
+ it('When the \'Maximum check answer attempts\' input field has value \'0\' and user switches to Preview tab, then the \'Check Answer\' button should be enabled and user should be able to check answer multiple times', () => {
284
+ fillInTheGapsDragAndDropPage.steps.switchToEditTab();
285
+ fillInTheGapsDragAndDropPage.steps.clearMaximumCheckAnswerAttemptsInputField();
286
+ fillInTheGapsDragAndDropPage.steps.addInputToMaximumCheckAnswerAttemptsInputField(0);
287
+ cy.log('Switching to Preview tab');
288
+ fillInTheGapsDragAndDropPage.steps.switchToPreviewTab();
289
+ fillInTheGapsDragAndDropPage.checkAnswerButton()
290
+ .should('be.enabled');
291
+ cy.log('Clicking on \'Check Answer\' to check state of \'Check Answer\' to be enabled')
292
+ fillInTheGapsDragAndDropPage.steps.previewTabClickAndDropDraggableOptionInResponseArea('Incorrect answer 1', 0);
293
+ fillInTheGapsDragAndDropPage.steps.previewTabClickAndDropDraggableOptionInResponseArea('Incorrect answer 2', 1);
294
+ fillInTheGapsDragAndDropPage.checkAnswerButton()
295
+ .click();
296
+ fillInTheGapsDragAndDropPage.steps.verifyIncorrectOptionCrossmarkIcon(0)
297
+ fillInTheGapsDragAndDropPage.steps.verifyIncorrectOptionCrossmarkIcon(1)
298
+ fillInTheGapsDragAndDropPage.checkAnswerButton()
299
+ .should('be.enabled');
300
+ fillInTheGapsDragAndDropPage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect')
301
+ fillInTheGapsDragAndDropPage.steps.verifyIncorrectAttemptBorder()
302
+ cy.log('As the user is able to check answer multiple times, verifying state of \'Check Answer\' to be enabled by adding another response')
303
+ fillInTheGapsDragAndDropPage.steps.previewTabClickAndDropDraggableOptionInResponseArea('Correct answer for response 1', 0);
304
+ fillInTheGapsDragAndDropPage.steps.previewTabClickAndDropDraggableOptionInResponseArea('Correct answer for response 2', 1);
305
+ fillInTheGapsDragAndDropPage.checkAnswerButton()
306
+ .click();
307
+ fillInTheGapsDragAndDropPage.steps.verifyCorrectIncorrectAnswerLabel('Correct')
308
+ fillInTheGapsDragAndDropPage.steps.verifyCorrectAttemptBorder()
309
+ fillInTheGapsDragAndDropPage.checkAnswerButton()
310
+ .should('be.enabled');
311
+ });
312
+
313
+ it('When the \'Maximum check answer attempts\' input field is empty and user switches to Preview tab, then the \'Check Answer\' button should be enabled and user should be able to check answer multiple times', () => {
314
+ cy.log('Pre step: Switching to Edit tab')
315
+ fillInTheGapsDragAndDropPage.steps.switchToEditTab();
316
+ fillInTheGapsDragAndDropPage.maximumCheckAnswerAttemptsInputField()
317
+ .clear()
318
+ .should('have.value', '');
319
+ cy.log('Switching to Preview tab');
320
+ fillInTheGapsDragAndDropPage.steps.switchToPreviewTab();
321
+ fillInTheGapsDragAndDropPage.checkAnswerButton()
322
+ .should('be.enabled');
323
+ cy.log('Clicking on \'Check Answer\' to check state of \'Check Answer\' to be enabled')
324
+ fillInTheGapsDragAndDropPage.steps.previewTabClickAndDropDraggableOptionInResponseArea('Incorrect answer 1', 0);
325
+ fillInTheGapsDragAndDropPage.steps.previewTabClickAndDropDraggableOptionInResponseArea('Incorrect answer 2', 1);
326
+ fillInTheGapsDragAndDropPage.checkAnswerButton()
327
+ .click();
328
+ fillInTheGapsDragAndDropPage.steps.verifyIncorrectOptionCrossmarkIcon(0)
329
+ fillInTheGapsDragAndDropPage.steps.verifyIncorrectOptionCrossmarkIcon(1)
330
+ fillInTheGapsDragAndDropPage.checkAnswerButton()
331
+ .should('be.enabled');
332
+ fillInTheGapsDragAndDropPage.steps.verifyCorrectIncorrectAnswerLabel('Incorrect')
333
+ fillInTheGapsDragAndDropPage.steps.verifyIncorrectAttemptBorder()
334
+ cy.log('As the user is able to check answer multiple times, verifying state of \'Check Answer\' to be enabled by adding another response')
335
+ fillInTheGapsDragAndDropPage.steps.previewTabClickAndDropDraggableOptionInResponseArea('Correct answer for response 1', 0);
336
+ fillInTheGapsDragAndDropPage.steps.previewTabClickAndDropDraggableOptionInResponseArea('Correct answer for response 2', 1);
337
+ fillInTheGapsDragAndDropPage.checkAnswerButton()
338
+ .click();
339
+ fillInTheGapsDragAndDropPage.steps.verifyCorrectIncorrectAnswerLabel('Correct')
340
+ fillInTheGapsDragAndDropPage.steps.verifyCorrectAttemptBorder()
341
+ fillInTheGapsDragAndDropPage.checkAnswerButton()
342
+ .should('be.enabled');
343
+ });
344
+ });
345
+
346
+ describe('Additional Settings: Details section', () => {
347
+ abortEarlySetup();
348
+ before(() => {
349
+ fillInTheGapsDragAndDropPage.steps.navigateToCreateQuestion('fill in the gaps with drag and drop');
350
+ cy.barsPreLoaderWait();
351
+ fillInTheGapsDragAndDropPage.steps.expandAdditionalSettings();
352
+ });
353
+
354
+ fillInTheGapsDragAndDropPage.tests.verifyDetailsSection();
355
+ });
356
+ });