itemengine-cypress-automation 1.0.173 → 1.0.174

Sign up to get free protection for your applications and to get access to all the features.
Files changed (96) hide show
  1. package/cypress/e2e/ILC/DrawingResponse/drawingResponseCustomizeAdditionalOptions.js +0 -18
  2. package/cypress/e2e/ILC/DrawingResponse/drawingResponseEditTabBasicSection.js +1 -1
  3. package/cypress/e2e/ILC/EssayResponse/createCustomCategory.smoke.js +10 -7
  4. package/cypress/e2e/ILC/FeedbackScaleNew/additionalSettings.js +111 -0
  5. package/cypress/e2e/ILC/FeedbackScaleNew/colorPopup.js +206 -0
  6. package/cypress/e2e/ILC/FeedbackScaleNew/editTabBasicSection.js +262 -0
  7. package/cypress/e2e/ILC/FeedbackScaleNew/headerSection.js +51 -0
  8. package/cypress/e2e/ILC/FeedbackScaleNew/numbersFeedbackScaleStyle.js +17 -17
  9. package/cypress/e2e/ILC/FeedbackScaleNew/thumbsFeedbackScaleStyle.js +1 -1
  10. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/additionalSettings.js +2 -2
  11. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/clickAndDrop.js +3 -3
  12. package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/conditionalCheckboxScoring.js +1 -0
  13. package/cypress/e2e/ILC/Graphing/addBackgroundShapesSection.js +6 -7
  14. package/cypress/e2e/ILC/Graphing/additionalSettingsBasic.js +3 -3
  15. package/cypress/e2e/ILC/Graphing/allOrNothingForAllViews.smoke.js +0 -1
  16. package/cypress/e2e/ILC/Graphing/checkAnswerFunctionalityForAllViews.smoke.js +0 -1
  17. package/cypress/e2e/ILC/Graphing/toolsControlsAndBackgroundSection.js +0 -1
  18. package/cypress/e2e/ILC/GridFill/checkAnswerFunctionalityForAllViews.smoke.js +2 -0
  19. package/cypress/e2e/ILC/GridFill/gridLayoutContents.js +3 -4
  20. package/cypress/e2e/ILC/GridFill/gridLayoutEditTabFunctionality.js +2 -2
  21. package/cypress/e2e/ILC/GridFill/previewContentsForAllViews.smoke.js +12 -12
  22. package/cypress/e2e/ILC/NumberLine/Scoring/allOrNothingWithAlternatePointsGreaterThanCorrectPoints.js +91 -90
  23. package/cypress/e2e/ILC/NumberLine/Scoring/allOrNothingWithCorrectPointsEqualToAlternatePoints.js +93 -92
  24. package/cypress/e2e/ILC/NumberLine/Scoring/allOrNothingWithCorrectPointsGreaterThanAlternativePoints.js +97 -95
  25. package/cypress/e2e/ILC/NumberLine/Scoring/manualAndNonScoredScoring.js +62 -62
  26. package/cypress/e2e/ILC/NumberLine/Scoring/partialEqualWeightsBasic.js +118 -117
  27. package/cypress/e2e/ILC/NumberLine/Scoring/partialEqualWeightsWithAlternatePointsGreaterThanCorrectPoints.js +124 -120
  28. package/cypress/e2e/ILC/NumberLine/Scoring/partialEqualWeightsWithCorrectPointsGreaterThanAlternatePoints.js +128 -125
  29. package/cypress/e2e/ILC/NumberLine/Scoring/partialEqualWeigtsWithCorrectPointsEqualToAlternatePoints.js +97 -96
  30. package/cypress/e2e/ILC/NumberLine/allOrNothingScoringForAllViews.smoke.js +222 -196
  31. package/cypress/e2e/ILC/NumberLine/checkAnswerFunctionalityForAllViews.smoke.js +34 -34
  32. package/cypress/e2e/ILC/NumberLine/editTabScoringSection.js +20 -20
  33. package/cypress/e2e/ILC/NumberLine/gradingViewAndCorrectAnswerView.smoke.js +29 -29
  34. package/cypress/e2e/ILC/NumberLine/headerSection.js +3 -2
  35. package/cypress/e2e/ILC/NumberLine/previewTabContentsForAllViews.smoke.js +40 -37
  36. package/cypress/e2e/ILC/NumberLine/specifyCorrectAnswerSection.js +7 -4
  37. package/cypress/e2e/ILC/NumberLine/studentViewSettings.js +14 -12
  38. package/cypress/e2e/ILC/NumberLine/toolsAndControls.js +24 -23
  39. package/cypress/e2e/ILC/ShortTextResponseNew/studentViewSettings.js +2 -2
  40. package/cypress/e2e/ILC/SimpleCalculator/previewContents.smoke.js +1 -1
  41. package/cypress/e2e/ILC/TextEntryMath/evaluationMethodEquivalentStructures.js +2 -0
  42. package/cypress/e2e/ILC/TextEntryMath/evaluationMethodMatchExact.js +1 -0
  43. package/cypress/e2e/ILC/TextEntryMath/evaluationMethodMatchValue.js +1 -0
  44. package/cypress/e2e/ILC/TextEntryMath/evaluationMethodSymbolsAreEquivalent.js +1 -0
  45. package/cypress/e2e/ILC/TextEntryMath/evaluationMethodValueIsEquivalent.js +1 -0
  46. package/cypress/e2e/ILC/TextEntryMath/evaluationMethodsWithoutSetResponse.js +4 -0
  47. package/cypress/e2e/ILC/TextEntryMath/responseEvaluationMethodsAndCustomSettings.js +8 -15
  48. package/cypress/e2e/ILC/TextEntryMath/specifyCorrectAnswerSection.js +1 -0
  49. package/cypress/e2e/ILC/TextEntryMathWithImage/allOrNothingScoringForAllViews.smoke.js +1 -0
  50. package/cypress/e2e/ILC/TextEntryMathWithImage/backgroundImageAndCanvasProperties.js +1 -1
  51. package/cypress/e2e/ILC/TextSelection/Scoring/basicScoringForAllTextSelectionTypes.smoke.js +332 -0
  52. package/cypress/e2e/ILC/TextSelection/Scoring/manuallyAndNonScored.js +149 -0
  53. package/cypress/e2e/ILC/TextSelection/Scoring/partialDifferentWeightsBasic.js +0 -1
  54. package/cypress/e2e/ILC/TextSelection/Scoring/partialEqualWeightsBasic.js +0 -1
  55. package/cypress/e2e/ILC/TextSelection/allOrNothingScoringForAllViews.smoke.js +11 -11
  56. package/cypress/e2e/ILC/TextSelection/checkAnswerFunctionalityForAllViews.smoke.js +3 -3
  57. package/cypress/e2e/ILC/TextSelection/editTabScoringSection.js +337 -0
  58. package/cypress/e2e/ILC/TextSelection/minimumScoringPenaltyPointsAndRoundingDropdown.js +206 -0
  59. package/cypress/e2e/ILC/TextSelection/{previewContentsForAllViews.js → previewContentsForAllViews.smoke.js} +3 -3
  60. package/cypress/e2e/ILC/UploadResponse/uplodResponsePreviewUploadedFileProperties.js +87 -87
  61. package/cypress/fixtures/equationEditorCategoriesAndSymbols .js +5 -5
  62. package/cypress/pages/audioResponsePage.js +1 -0
  63. package/cypress/pages/components/autoScoredScoringSectionMultiResponseType.js +2 -1
  64. package/cypress/pages/components/autoScoredStudentViewSettings.js +1 -1
  65. package/cypress/pages/components/backgroundImageUploadComponent.js +1 -4
  66. package/cypress/pages/components/colorPopupComponent.js +11 -0
  67. package/cypress/pages/components/createCustomCategoryFlyout.js +13 -9
  68. package/cypress/pages/components/draggableOptionContainer.js +1 -0
  69. package/cypress/pages/components/equationEditorFlyout.js +0 -1
  70. package/cypress/pages/components/essayResponseCommonComponents.js +1 -1
  71. package/cypress/pages/components/imageCanvasComponent.js +1 -1
  72. package/cypress/pages/components/index.js +2 -1
  73. package/cypress/pages/components/optionsWrapperComponent.js +2 -1
  74. package/cypress/pages/components/questionInputFieldComponent.js +1 -1
  75. package/cypress/pages/components/questionInstructionsComponent.js +19 -7
  76. package/cypress/pages/components/setPointsPopupBase.js +17 -4
  77. package/cypress/pages/components/studentViewSettingsLabelComponent.js +2 -2
  78. package/cypress/pages/drawingResponsePage.js +2 -3
  79. package/cypress/pages/feedbackScalePage.js +143 -2
  80. package/cypress/pages/fillInTheGapsDragAndDropPage.js +1 -1
  81. package/cypress/pages/fillInTheGapsOverImageDragAndDropPage.js +12 -12
  82. package/cypress/pages/graphingPage.js +6 -6
  83. package/cypress/pages/gridFillPage.js +64 -7
  84. package/cypress/pages/matchingPage.js +3 -3
  85. package/cypress/pages/numberLinePage.js +342 -215
  86. package/cypress/pages/readingRulerPage.js +1 -1
  87. package/cypress/pages/textEntryMathPage.js +9 -0
  88. package/cypress/pages/textEntryMathWithImagePage.js +11 -11
  89. package/cypress/pages/textSelectionPage.js +125 -57
  90. package/package.json +1 -1
  91. package/cypress/e2e/ILC/FeedbackScaleNew/feedbackScaleStylePreviewTab.js +0 -161
  92. package/cypress/e2e/ILC/FillInTheGapsDragAndDrop/fillInTheGapsDragAndDropAdditionalSettings.js +0 -356
  93. package/cypress/e2e/ILC/FillInTheGapsDragAndDrop/fillInTheGapsDragAndDropAdditionalSettingsResponseAccordion.js +0 -299
  94. package/cypress/e2e/ILC/Graphing/Scoring/allOrNothingWithCorrectPointsEqualToCorrectPoints.js +0 -355
  95. package/cypress/e2e/ILC/MultipleSelectionGridNew/test.js +0 -28
  96. package/cypress/pages/feedbackScalePage copy.js +0 -716
@@ -0,0 +1,337 @@
1
+ import { textSelectionPage } from "../../../pages";
2
+ import abortEarlySetup from "../../../support/helpers/abortEarly";
3
+ import utilities from "../../../support/helpers/utilities";
4
+ const css = Cypress.env('css');
5
+
6
+ const paragraphTextArray = ['All animals have a unique role to play in maintaining the balance of nature.', 'A lot of animal species exist in both, land and water. As a result, each of them has a purpose for their existence.', 'The animals divide into specific groups in biology. Amphibians are those which can live on both, land and water.', 'Mammals are ones which give birth to their offspring in the womb and have mammary glands.'];
7
+
8
+ describe('Create item page - Text selection: Scoring section', () => {
9
+ before(() => {
10
+ cy.loginAs('admin');
11
+ });
12
+
13
+ describe('Scoring section contents', () => {
14
+ abortEarlySetup();
15
+ before(() => {
16
+ textSelectionPage.steps.navigateToCreateQuestion('text selection');
17
+ cy.barsPreLoaderWait();
18
+ });
19
+
20
+ textSelectionPage.tests.verifyScoringTypeLabelAndDropdown('Auto scored');
21
+
22
+ textSelectionPage.tests.verifyScoringSubtypeContentsForMultipleResponseTypeQuestion();
23
+ });
24
+
25
+ describe('Auto scored: All or nothing scoring - Scoring section', () => {
26
+ abortEarlySetup();
27
+ before(() => {
28
+ textSelectionPage.steps.navigateToCreateQuestion('text selection');
29
+ cy.barsPreLoaderWait();
30
+ textSelectionPage.steps.allotPoints(10);
31
+ });
32
+
33
+ it('When the user has selected \'All or nothing\' scoring subtype, minimum scoring dropdown should be displayed in the scoring section', () => {
34
+ textSelectionPage.steps.verifyMinimumScoringLabelAndDropdownDefaultState();
35
+ });
36
+ });
37
+
38
+ describe('Auto scored: All or nothing scoring - Specify correct answer section', () => {
39
+ abortEarlySetup();
40
+ before(() => {
41
+ textSelectionPage.steps.navigateToCreateQuestion('text selection');
42
+ cy.barsPreLoaderWait();
43
+ textSelectionPage.steps.clearQuestionInputField();
44
+ paragraphTextArray.forEach((paragraphText) => {
45
+ textSelectionPage.steps.addInputToQuestionInputField(`${paragraphText}{enter}`);
46
+ });
47
+ textSelectionPage.steps.addInputToQuestionInputField('{backspace}');
48
+ textSelectionPage.steps.switchTextSelectionMode('Paragraph');
49
+ textSelectionPage.steps.clickOnOptionInSpecifyPossibleOptionsSection(paragraphTextArray[0]);
50
+ textSelectionPage.steps.clickOnOptionInSpecifyPossibleOptionsSection(paragraphTextArray[1]);
51
+ textSelectionPage.steps.clickOnOptionInSpecifyPossibleOptionsSection(paragraphTextArray[2]);
52
+ textSelectionPage.steps.selectOptionInSpecifyCorrectAnswerSection(paragraphTextArray[0]);
53
+ textSelectionPage.steps.selectOptionInSpecifyCorrectAnswerSection(paragraphTextArray[1]);
54
+ });
55
+
56
+ textSelectionPage.tests.verifyContentsOfSpecifyCorrectAnswerSection();
57
+
58
+ textSelectionPage.tests.verifyPointsLabelAndInputField();
59
+ });
60
+
61
+ describe('Auto scored: Partial - equal weights scoring - Scoring section', () => {
62
+ abortEarlySetup();
63
+ before(() => {
64
+ textSelectionPage.steps.navigateToCreateQuestion('text selection');
65
+ cy.barsPreLoaderWait();
66
+ });
67
+
68
+ it('User should be able to select \'Partial - equal weights\' scoring type', () => {
69
+ textSelectionPage.steps.selectAutoScoredScoringSubtype('Partial equal weights');
70
+ });
71
+
72
+ it('When the user has switched to \'Partial - equal weights\' scoring, then \'Penalty scoring\', \'Minimum scoring\' and \'Rounding\' label and dropdown should be displayed in the \'Scoring\' section, \'Round negative scores to zero\' label and checkbox should not be displayed in the \'Scoring\' section', () => {
73
+ textSelectionPage.steps.verifyMinimumScoringLabelAndDropdownDefaultState();
74
+ textSelectionPage.steps.verifyPenaltyPointsLabelAndDropdownDefaultState();
75
+ textSelectionPage.steps.verifyRoundingLabelAndDropdownDefaultState();
76
+ utilities.verifyElementVisibilityState(textSelectionPage.roundNegativeScoresToZeroCheckbox(), 'notExist');
77
+ });
78
+ });
79
+
80
+ describe('Auto scored: Partial - equal weights scoring - Specify correct answer section', () => {
81
+ abortEarlySetup();
82
+ before(() => {
83
+ textSelectionPage.steps.navigateToCreateQuestion('text selection');
84
+ cy.barsPreLoaderWait();
85
+ textSelectionPage.steps.clearQuestionInputField();
86
+ paragraphTextArray.forEach((paragraphText) => {
87
+ textSelectionPage.steps.addInputToQuestionInputField(`${paragraphText}{enter}`);
88
+ });
89
+ textSelectionPage.steps.addInputToQuestionInputField('{backspace}');
90
+ textSelectionPage.steps.switchTextSelectionMode('Paragraph');
91
+ textSelectionPage.steps.clickOnOptionInSpecifyPossibleOptionsSection(paragraphTextArray[0]);
92
+ textSelectionPage.steps.clickOnOptionInSpecifyPossibleOptionsSection(paragraphTextArray[1]);
93
+ textSelectionPage.steps.clickOnOptionInSpecifyPossibleOptionsSection(paragraphTextArray[2]);
94
+ textSelectionPage.steps.selectOptionInSpecifyCorrectAnswerSection(paragraphTextArray[0]);
95
+ textSelectionPage.steps.selectOptionInSpecifyCorrectAnswerSection(paragraphTextArray[1]);
96
+ textSelectionPage.steps.selectAutoScoredScoringSubtype('Partial equal weights');
97
+ });
98
+
99
+ textSelectionPage.tests.verifyContentsOfSpecifyCorrectAnswerSection();
100
+
101
+ it('\'Points per response\' label should be displayed and a \'-\' should be displayed besides each response in the \'Specify correct answer\' section', () => {
102
+ textSelectionPage.steps.verifyPointsPerResponseLabel();
103
+ });
104
+
105
+ it('When the user gives a score input to \'Points\' input field, then the score should be equally divided among the dropzone \'Points per response\' label', () => {
106
+ textSelectionPage.steps.allotPoints(6);
107
+ textSelectionPage.steps.verifyPartialEqualWeightsPointsPerResponseScore(2);
108
+ });
109
+
110
+ it('When the user inserts one more dropzone, then points per response should get updated accordingly', () => {
111
+ textSelectionPage.steps.selectOptionInSpecifyCorrectAnswerSection(paragraphTextArray[2]);
112
+ textSelectionPage.steps.verifyPartialEqualWeightsPointsPerResponseScore(1.5);
113
+ });
114
+
115
+ it('When the user deletes a dropzone, then points per response should get updated accordingly', () => {
116
+ textSelectionPage.steps.deselectOptionInSpecifyCorrectAnswerSection(paragraphTextArray[2]);
117
+ textSelectionPage.steps.verifyPartialEqualWeightsPointsPerResponseScore(2);
118
+ });
119
+
120
+ it('When the user adds an option in the options section then the points should not change', () => {
121
+ textSelectionPage.steps.clickOnOptionInSpecifyPossibleOptionsSection(paragraphTextArray[3]);
122
+ textSelectionPage.steps.verifyPartialEqualWeightsPointsPerResponseScore(2);
123
+ });
124
+
125
+ it('When the user deletes an option in the options section then the points should not change', () => {
126
+ textSelectionPage.steps.clickOnOptionInSpecifyPossibleOptionsSection(paragraphTextArray[3]);
127
+ textSelectionPage.steps.verifyPartialEqualWeightsPointsPerResponseScore(2);
128
+ });
129
+
130
+ it('When the user switches to \'All or nothing\' scoring, the \'Points per response\' label and the points displayed for individual responses should not be displayed and the points displayed in \'Points\' input field should remain unchanged', () => {
131
+ textSelectionPage.steps.selectAutoScoredScoringSubtype('All or nothing');
132
+ utilities.verifyElementVisibilityState(textSelectionPage.pointsPerResponseLabel(), 'notExist');
133
+ textSelectionPage.steps.verifyPointsFieldValue(6);
134
+ });
135
+
136
+ it('When the user updates the entered points in \'All or nothing\' scoring type and switches to \'Partial equal weights\' scoring type, then the points should be equally divided and displayed besides each correct option', () => {
137
+ textSelectionPage.steps.allotPoints(12);
138
+ textSelectionPage.steps.selectAutoScoredScoringSubtype('Partial equal weights');
139
+ textSelectionPage.steps.verifyPartialEqualWeightsPointsPerResponseScore(4);
140
+ });
141
+
142
+ it('CSS of \'Points per response\' label and its displayed score', { tags: 'css' }, () => {
143
+ utilities.verifyCSS(textSelectionPage.pointsPerResponseLabel(), {
144
+ 'color': css.color.labels,
145
+ 'font-size': css.fontSize.normal,
146
+ 'font-weight': css.fontWeight.semibold
147
+ });
148
+ });
149
+ });
150
+
151
+ describe('Auto scored: Partial - different weights scoring - Scoring section', () => {
152
+ abortEarlySetup();
153
+ before(() => {
154
+ textSelectionPage.steps.navigateToCreateQuestion('text selection');
155
+ cy.barsPreLoaderWait();
156
+ });
157
+
158
+ it('User should be able to select \'Partial - different weights\' scoring', () => {
159
+ textSelectionPage.steps.selectAutoScoredScoringSubtype('Partial different weights');
160
+ });
161
+
162
+ it('When the user has switched to \'Partial - different weights\' scoring, then \'Penalty scoring\', \'Minimum scoring\' and \'Rounding\' labels and dropdowns, \'Round negative scores to zero\' label and checkbox should not be displayed in the \'Scoring\' section', () => {
163
+ textSelectionPage.steps.verifyMinimumScoringLabelAndDropdownDefaultState();
164
+ textSelectionPage.steps.verifyPenaltyPointsLabelAndDropdownDefaultState();
165
+ textSelectionPage.steps.verifyRoundingLabelAndDropdownDefaultState();
166
+ utilities.verifyElementVisibilityState(textSelectionPage.roundNegativeScoresToZeroCheckbox(), 'notExist');
167
+ });
168
+ });
169
+
170
+ describe('Auto scored: Partial - different weights scoring - Specify correct answer section', () => {
171
+ abortEarlySetup();
172
+ before(() => {
173
+ textSelectionPage.steps.navigateToCreateQuestion('text selection');
174
+ cy.barsPreLoaderWait();
175
+ textSelectionPage.steps.clearQuestionInputField();
176
+ paragraphTextArray.forEach((paragraphText) => {
177
+ textSelectionPage.steps.addInputToQuestionInputField(`${paragraphText}{enter}`);
178
+ });
179
+ textSelectionPage.steps.addInputToQuestionInputField('{backspace}');
180
+ textSelectionPage.steps.switchTextSelectionMode('Paragraph');
181
+ textSelectionPage.steps.clickOnOptionInSpecifyPossibleOptionsSection(paragraphTextArray[0]);
182
+ textSelectionPage.steps.clickOnOptionInSpecifyPossibleOptionsSection(paragraphTextArray[1]);
183
+ textSelectionPage.steps.clickOnOptionInSpecifyPossibleOptionsSection(paragraphTextArray[2]);
184
+ textSelectionPage.steps.selectAutoScoredScoringSubtype('Partial different weights');
185
+ });
186
+
187
+ it('When user has not selected an option in specify correct answer section, then the \'Set points\' button should be disabled', () => {
188
+ utilities.verifyElementDisabled(textSelectionPage.setPointsButton());
189
+ });
190
+
191
+ it('When user selects an option in set correct answer section, then the \'Set points\' button should be enabled', () => {
192
+ textSelectionPage.steps.selectOptionInSpecifyCorrectAnswerSection(paragraphTextArray[0]);
193
+ textSelectionPage.steps.verifySetPointsButtonLabelAndEnabledState();
194
+ });
195
+
196
+ it('CSS of \'Set points\' button', { tags: 'css' }, () => {
197
+ utilities.verifyCSS(textSelectionPage.setPointsButton(), {
198
+ 'color': css.color.activeButtons,
199
+ 'font-size': css.fontSize.default,
200
+ 'font-weight': css.fontWeight.regular
201
+ });
202
+ utilities.verifyCSS(textSelectionPage.setPointsButton().find('svg'), {
203
+ 'color': css.color.activeButtons
204
+ });
205
+ });
206
+
207
+ it('Accessibility of \'Set points\' button', { tags: 'a11y' }, () => {
208
+ cy.checkAccessibility(textSelectionPage.setPointsButton());
209
+ });
210
+
211
+ textSelectionPage.tests.verifyContentsOfSpecifyCorrectAnswerSection();
212
+
213
+ it('When user clicks on \'Set points\' button, then the popup should be displayed with \'Set points\' title,', () => {
214
+ textSelectionPage.steps.openSetPointsPopup();
215
+ utilities.verifyElementVisibilityState(textSelectionPage.setPointsPopup(), 'visible');
216
+ utilities.verifyInnerText(textSelectionPage.setPointsPopupTitle(), 'Set points');
217
+ });
218
+
219
+ it('When user has opened \'Set points\' popup and focuses in and out of the points input field then an error message \'Error: Please enter points.\' should be displayed', () => {
220
+ textSelectionPage.steps.focusInAndFocusOutOfPointsInputField(0);
221
+ utilities.verifyInnerText(textSelectionPage.errorMessage(), 'Error: Please enter points.');
222
+ });
223
+
224
+ textSelectionPage.tests.verifyErrorMessageCSSAndA11y();
225
+
226
+ it('When user enters points then the error message should disappear', () => {
227
+ textSelectionPage.steps.allotPointsToSetPointsPopupPointsInputField([5]);
228
+ utilities.verifyElementVisibilityState(textSelectionPage.errorMessage(), 'notExist');
229
+ });
230
+
231
+ it('When user clicks on Cancel button then the popup should close and on opening the popup again empty points fields should be displayed', () => {
232
+ textSelectionPage.steps.cancelSetPointsPopup();
233
+ textSelectionPage.steps.openSetPointsPopup();
234
+ utilities.verifyInnerText(textSelectionPage.pointsInputField(), '');
235
+ });
236
+
237
+ it('When user has selected an options in the specify correct answer section then it should be displayed in the \'Set points\' popup with an empty points field under a \'Points\' label', () => {
238
+ textSelectionPage.steps.cancelSetPointsPopup();
239
+ textSelectionPage.steps.selectOptionInSpecifyCorrectAnswerSection(paragraphTextArray[1]);
240
+ textSelectionPage.steps.selectOptionInSpecifyCorrectAnswerSection(paragraphTextArray[2]);
241
+ textSelectionPage.steps.openSetPointsPopup();
242
+ textSelectionPage.steps.verifySetPointsPopupOptions([paragraphTextArray[0], paragraphTextArray[1], paragraphTextArray[2]]);
243
+ utilities.verifyInnerText(textSelectionPage.setPointsPopupPointsLabel(), 'Points');
244
+ utilities.verifyElementCount(textSelectionPage.pointsInputField(), 3);
245
+ textSelectionPage.steps.verifyPointsAllotedInSetPointsPopup(['', '', '']);
246
+ });
247
+
248
+ it('CSS of \'Set points\' popup', { tags: 'css' }, () => {
249
+ utilities.verifyCSS(textSelectionPage.setPointsPopupTitle(), {
250
+ 'color': css.color.flyoutTitle,
251
+ 'font-size': css.fontSize.heading,
252
+ 'font-weight': css.fontWeight.semibold
253
+ });
254
+ utilities.verifyCSS(textSelectionPage.setPointsPopupPointsLabel(), {
255
+ 'color': css.color.labels,
256
+ 'font-size': css.fontSize.normal,
257
+ 'font-weight': css.fontWeight.semibold
258
+ });
259
+ utilities.verifyCSS(textSelectionPage.setPointsPopupOptions(), {
260
+ 'color': css.color.text,
261
+ 'font-size': css.fontSize.default,
262
+ 'font-weight': css.fontWeight.regular,
263
+ 'background-color': css.color.figActiveComponentBg,
264
+ 'border': `1px solid ${css.color.activeComponentBorder}`
265
+ });
266
+ utilities.verifyCSS(textSelectionPage.pointsInputField(), {
267
+ 'color': css.color.text,
268
+ 'font-size': css.fontSize.default,
269
+ 'font-weight': css.fontWeight.regular
270
+ });
271
+ utilities.verifyCSS(textSelectionPage.setPointsPopupSaveButton(), {
272
+ 'color': css.color.whiteText,
273
+ 'font-size': css.fontSize.default,
274
+ 'font-weight': css.fontWeight.semibold,
275
+ 'background-color': css.color.primaryBtnBg
276
+ });
277
+ utilities.verifyCSS(textSelectionPage.setPointsPopupCancelButton(), {
278
+ 'color': css.color.secondaryBtn,
279
+ 'font-size': css.fontSize.default,
280
+ 'font-weight': css.fontWeight.semibold,
281
+ 'background-color': css.color.transparent
282
+ });
283
+ });
284
+
285
+ it('Accessibility of \'Set points\' popup', { tags: 'a11y' }, () => {
286
+ cy.checkAccessibility(textSelectionPage.setPointsPopup());
287
+ });
288
+
289
+ it('When user de-selects an option in the set correct answer section then it should not be displayed in the \'Set points\' popup', () => {
290
+ cy.log('Pre-step: Close the set points popup');
291
+ textSelectionPage.steps.cancelSetPointsPopup();
292
+ textSelectionPage.steps.deselectOptionInSpecifyCorrectAnswerSection(paragraphTextArray[2]);
293
+ textSelectionPage.steps.openSetPointsPopup();
294
+ textSelectionPage.steps.verifySetPointsPopupOptions([`${paragraphTextArray[0]}`, `${paragraphTextArray[1]}`]);
295
+ });
296
+
297
+ it('When user adds points to the options and clicks on \'Save\' button then the popup should close and opening the popup again the points should be prefilled', () => {
298
+ textSelectionPage.steps.allotPointsToSetPointsPopupPointsInputField([4.8]);
299
+ textSelectionPage.steps.saveSetPointsPopup();
300
+ textSelectionPage.steps.openSetPointsPopup();
301
+ textSelectionPage.steps.verifyPointsAllotedInSetPointsPopup(['4.8', '']);
302
+ cy.log('Close the Set points popup')
303
+ textSelectionPage.steps.cancelSetPointsPopup();
304
+ });
305
+
306
+ it('When user tries to add \'Alternate\' tab without adding points to all options points field then a warning popup should be displayed with \'Warning!\' title and \'Please fill required details.\' should be displayed', () => {
307
+ textSelectionPage.steps.clickOnAddAlternativeAnswerButton();
308
+ textSelectionPage.steps.allFieldsRequiredWarningPopupContents();
309
+ });
310
+
311
+ it('Warning popup should close on clicking the Close icon button', () => {
312
+ textSelectionPage.steps.closeWarningPopup();
313
+ });
314
+
315
+ it('\'Error: Please enter points.\' error message should be displayed below the Set points button with error icon on the Correct tab', () => {
316
+ textSelectionPage.steps.verifySpecifyCorrectAnswerErrorIconIsVisible();
317
+ utilities.verifyInnerText(textSelectionPage.errorMessage(), 'Error: Please enter points.');
318
+ });
319
+
320
+ it('When user opens the Set points popup an error message should be displayed below the empty points input field and on entering points the error message should disappear', () => {
321
+ textSelectionPage.steps.openSetPointsPopup();
322
+ textSelectionPage.steps.verifyPointsErrorMessageInSetPointsPopup(1);
323
+ textSelectionPage.steps.allotPointsToSetPointsPopupPointsInputField([4, 3]);
324
+ utilities.verifyElementVisibilityState(textSelectionPage.errorMessage(), 'notExist');
325
+ });
326
+
327
+ it('When user has alloted points to all options then the error message and error icon should not be displayed', () => {
328
+ textSelectionPage.steps.saveSetPointsPopup();
329
+ textSelectionPage.steps.verifySpecifyCorrectAnswerErrorIconNotExists();
330
+ utilities.verifyElementVisibilityState(textSelectionPage.errorMessage(), 'notExist');
331
+ });
332
+
333
+ it('User should be able to add \'Alternate\' tab', () => {
334
+ textSelectionPage.steps.addAlternativeAnswerAccordion(1);
335
+ });
336
+ });
337
+ });
@@ -0,0 +1,206 @@
1
+ import { textSelectionPage } from "../../../pages";
2
+ import abortEarlySetup from "../../../support/helpers/abortEarly";
3
+ import utilities from "../../../support/helpers/utilities";
4
+ const css = Cypress.env('css');
5
+ const penaltyScoringTypeArray = ['No penalty points', 'Penalty points for the entire question', 'Penalty points for each incorrect answer'];
6
+ const paragraphTextArray = ['All animals have a unique role to play in maintaining the balance of nature.', 'A lot of animal species exist in both, land and water. As a result, each of them has a purpose for their existence.', 'The animals divide into specific groups in biology. Amphibians are those which can live on both, land and water.', 'Mammals are ones which give birth to their offspring in the womb and have mammary glands.'];
7
+
8
+ describe('Create item page - Fill in the gaps with drag and drop: Minimum scoring, Penalty scoring, Rounding - Edit tab', () => {
9
+ before(() => {
10
+ cy.loginAs('admin');
11
+ });
12
+
13
+ describe('Scoring section: Minimum scoring - Edit tab', () => {
14
+ abortEarlySetup();
15
+ before(() => {
16
+ textSelectionPage.steps.navigateToCreateQuestion('text selection');
17
+ cy.barsPreLoaderWait();
18
+ textSelectionPage.steps.allotPoints(10);
19
+ });
20
+
21
+ textSelectionPage.tests.verifyMinimumScoringDropdown();
22
+
23
+ textSelectionPage.tests.verifyMinimumPointsLabelAndInputField();
24
+
25
+ textSelectionPage.tests.verifyMinimumPointsFieldErrorState();
26
+ });
27
+
28
+ describe('Scoring section: Penalty scoring - Edit tab', () => {
29
+ abortEarlySetup();
30
+ before(() => {
31
+ textSelectionPage.steps.navigateToCreateQuestion('text selection');
32
+ cy.barsPreLoaderWait();
33
+ textSelectionPage.steps.clearQuestionInputField();
34
+ paragraphTextArray.forEach((paragraphText) => {
35
+ textSelectionPage.steps.addInputToQuestionInputField(`${paragraphText}{enter}`);
36
+ });
37
+ textSelectionPage.steps.addInputToQuestionInputField('{backspace}');
38
+ textSelectionPage.steps.switchTextSelectionMode('Paragraph');
39
+ textSelectionPage.steps.clickOnOptionInSpecifyPossibleOptionsSection(paragraphTextArray[0]);
40
+ textSelectionPage.steps.clickOnOptionInSpecifyPossibleOptionsSection(paragraphTextArray[1]);
41
+ textSelectionPage.steps.clickOnOptionInSpecifyPossibleOptionsSection(paragraphTextArray[2]);
42
+ textSelectionPage.steps.selectOptionInSpecifyCorrectAnswerSection(paragraphTextArray[0]);
43
+ textSelectionPage.steps.selectOptionInSpecifyCorrectAnswerSection(paragraphTextArray[1]);
44
+ textSelectionPage.steps.allotPoints(10);
45
+ textSelectionPage.steps.selectAutoScoredScoringSubtype('Partial equal weights');
46
+ });
47
+
48
+ textSelectionPage.tests.verifyPenaltyScoringDropdown(penaltyScoringTypeArray);
49
+
50
+ textSelectionPage.tests.verifyPenaltyPointsLabelAndInputField();
51
+
52
+ textSelectionPage.tests.verifyPenaltyPointsErrorState();
53
+
54
+ it('When the user selects \'Penalty points for each incorrect answer\' from the penalty scoring dropdown, \'Automatically set penalty for each incorrect answer to total points / no. of incorrect answers\' label and checkbox should be displayed, by default the checkbox should be unchecked. Two radio buttons with labels - \'Specify total penalty points\' and \'Specify points for each incorrect answer\' should be displayed. By default, \'Specify total penalty points\' radio button should be checked', () => {
55
+ textSelectionPage.steps.expandPenaltyScoringDropdown();
56
+ textSelectionPage.steps.selectOptionFromPenaltyScoringDropdown('Penalty points for each incorrect answer');
57
+ utilities.verifyInnerText(textSelectionPage.automaticallySetPenaltyPointsCheckboxLabel(), 'Automatically set penalty for each incorrect answer to total points / no. of incorrect answers');
58
+ utilities.verifyInnerText(textSelectionPage.specifyTotalPenaltyPointsRadioButtonLabel(), 'Specify total penalty points');
59
+ utilities.verifyInnerText(textSelectionPage.specifyPointsForEachIncorrectOptionRadioButtonLabel(), 'Specify points for each incorrect answer');
60
+ textSelectionPage.steps.verifyAutomaticallySetPenaltyPointsCheckboxUncheckedState();
61
+ textSelectionPage.steps.verifySpecifyTotalPenaltyPointsRadioButtonCheckedState();
62
+ textSelectionPage.steps.verifySpecifyPointsForEachIncorrectOptionRadioButtonUncheckedState();
63
+ });
64
+
65
+ it('When \'Specify total penalty points\' is selected, a penalty points detail section with \'Total penalty points\' label and empty input field, \'Penalty points for each incorrect answer: -\' label should be displayed', () => {
66
+ utilities.verifyInnerText(textSelectionPage.penaltyPointsDetailsSectionInputFieldLabel(), 'Total penalty points');
67
+ textSelectionPage.steps.verifyTotalPenaltyPointsValue('');
68
+ utilities.verifyInnerText(textSelectionPage.penaltyPointsDetailsSectionAllottedPointsLabel(), 'Penalty points for each incorrect answer: -');
69
+ });
70
+
71
+ it('When the user allots total penalty points, then \'points for each incorrect option\' should get updated as per the count of incorrect options available', () => {
72
+ textSelectionPage.steps.allotTotalPenaltyPoints(5);
73
+ textSelectionPage.steps.verifyPenaltyPointsForEachIncorrectAnswer(2.5);
74
+ });
75
+
76
+ it('When the user adds a new option, then \'points for each incorrect option\' should get updated accordingly', () => {
77
+ textSelectionPage.steps.selectOptionInSpecifyCorrectAnswerSection(paragraphTextArray[2]);
78
+ textSelectionPage.steps.verifyPenaltyPointsForEachIncorrectAnswer(1.67);
79
+ });
80
+
81
+ it('When the user removes an option, then \'points for each incorrect option\' should get updated accordingly', () => {
82
+ textSelectionPage.steps.deselectOptionInSpecifyCorrectAnswerSection(paragraphTextArray[2]);
83
+ textSelectionPage.steps.verifyPenaltyPointsForEachIncorrectAnswer(2.5);
84
+ });
85
+
86
+ it('CSS of the penalty points section - Total penalty points', { tags: 'css' }, () => {
87
+ utilities.verifyCSS(textSelectionPage.automaticallySetPenaltyPointsCheckboxLabel(), {
88
+ 'color': css.color.labelText,
89
+ 'font-size': css.fontSize.default,
90
+ 'font-weight': css.fontWeight.regular
91
+ });
92
+ utilities.verifyCSS(textSelectionPage.automaticallySetPenaltyPointsCheckbox().parent().find('svg'), {
93
+ 'fill': css.color.uncheckedCheckbox
94
+ });
95
+ utilities.verifyCSS(textSelectionPage.specifyTotalPenaltyPointsRadioButton().parent().find('svg'), {
96
+ 'fill': css.color.activeButtons
97
+ });
98
+ utilities.verifyCSS(textSelectionPage.specifyPointsForEachIncorrectOptionRadioButton().parent().find('svg path'), {
99
+ 'fill': css.color.uncheckedCheckbox
100
+ });
101
+ utilities.verifyCSS(textSelectionPage.specifyTotalPenaltyPointsRadioButtonLabel(), {
102
+ 'color': css.color.labelText,
103
+ 'font-size': css.fontSize.default,
104
+ 'font-weight': css.fontWeight.regular
105
+ });
106
+ utilities.verifyCSS(textSelectionPage.specifyPointsForEachIncorrectOptionRadioButtonLabel(), {
107
+ 'color': css.color.labelText,
108
+ 'font-size': css.fontSize.default,
109
+ 'font-weight': css.fontWeight.regular
110
+ });
111
+ utilities.verifyCSS(textSelectionPage.penaltyPointsDetailsSectionInputFieldLabel(), {
112
+ 'color': css.color.labelText,
113
+ 'font-size': css.fontSize.default,
114
+ 'font-weight': css.fontWeight.regular
115
+ });
116
+ utilities.verifyCSS(textSelectionPage.totalPenaltyPointsInputField(), {
117
+ 'color': css.color.text,
118
+ 'font-size': css.fontSize.default,
119
+ 'font-weight': css.fontWeight.regular
120
+ });
121
+ utilities.verifyCSS(textSelectionPage.penaltyPointsDetailsSectionAllottedPointsLabel(), {
122
+ 'color': css.color.labelText,
123
+ 'font-size': css.fontSize.default,
124
+ 'font-weight': css.fontWeight.regular
125
+ });
126
+ });
127
+
128
+ it('Accessibility of the penalty points section - Total penalty points', { tags: 'a11y' }, () => {
129
+ cy.checkAccessibility(textSelectionPage.automaticallySetPenaltyPointsCheckboxLabel().parents('.penalty-score-for-each-incorrect-wrapper'));
130
+ });
131
+
132
+ it('When the user selects \'Specify points for each incorrect answer\', a penalty points detail section with \'Penalty points for each incorrect answer:\' label and empty input field, \'Total penalty points: -\' label should be displayed', () => {
133
+ cy.log('Pre-step: Clearing the total penalty points input field')
134
+ textSelectionPage.steps.clearTotalPenaltyPointsInputField();
135
+ textSelectionPage.steps.selectPenaltyPointsForEachIncorrectOptionType('Specify points for each incorrect answer');
136
+ utilities.verifyInnerText(textSelectionPage.penaltyPointsDetailsSectionInputFieldLabel(), 'Penalty points for each incorrect answer');
137
+ textSelectionPage.steps.verifyPenaltyPointsForEachIncorrectOptionValue('');
138
+ utilities.verifyInnerText(textSelectionPage.penaltyPointsDetailsSectionAllottedPointsLabel(), 'Total penalty points: -');
139
+ });
140
+
141
+ it('When the user allots Penalty points for each incorrect answer, then \'Total penalty points\' should get updated as per the count of incorrect options available', () => {
142
+ textSelectionPage.steps.allotPenaltyPointsForEachIncorrectOption(1);
143
+ textSelectionPage.steps.verifyTotalPenaltyPoints(2);
144
+ });
145
+
146
+ it('When the user adds a new option, then \'Total penalty points\' should get updated accordingly', () => {
147
+ textSelectionPage.steps.selectOptionInSpecifyCorrectAnswerSection(paragraphTextArray[2]);
148
+ textSelectionPage.steps.verifyTotalPenaltyPoints(3);
149
+ });
150
+
151
+ it('When the user deletes an option, then \'points for each incorrect option\' should get updated accordingly', () => {
152
+ textSelectionPage.steps.deselectOptionInSpecifyCorrectAnswerSection(paragraphTextArray[2]);
153
+ textSelectionPage.steps.verifyTotalPenaltyPoints(2);
154
+ });
155
+
156
+ it('CSS of the penalty points section - Penalty points for each incorrect answer', { tags: 'css' }, () => {
157
+ utilities.verifyCSS(textSelectionPage.penaltyPointsDetailsSectionInputFieldLabel(), {
158
+ 'color': css.color.labelText,
159
+ 'font-size': css.fontSize.default,
160
+ 'font-weight': css.fontWeight.regular
161
+ });
162
+ utilities.verifyCSS(textSelectionPage.penaltyPointsForEachIncorrectOptionInputField(), {
163
+ 'color': css.color.text,
164
+ 'font-size': css.fontSize.default,
165
+ 'font-weight': css.fontWeight.regular
166
+ });
167
+ utilities.verifyCSS(textSelectionPage.penaltyPointsDetailsSectionAllottedPointsLabel(), {
168
+ 'color': css.color.labelText,
169
+ 'font-size': css.fontSize.default,
170
+ 'font-weight': css.fontWeight.regular
171
+ });
172
+ });
173
+
174
+ it('Accessibility of the penalty points section - Penalty points for each incorrect answer', { tags: 'a11y' }, () => {
175
+ cy.checkAccessibility(textSelectionPage.automaticallySetPenaltyPointsCheckboxLabel().parents('.penalty-score-for-each-incorrect-wrapper'));
176
+ });
177
+
178
+ it('When the user switches to the \'Specify total penalty points\' option, the total penalty points input field should be filled as per the total penalty points in \'Specify points for each incorrect answer\'', () => {
179
+ textSelectionPage.steps.selectPenaltyPointsForEachIncorrectOptionType('Specify total penalty points');
180
+ textSelectionPage.steps.verifyTotalPenaltyPointsValue(2);
181
+ utilities.verifyInnerText(textSelectionPage.penaltyPointsDetailsSectionAllottedPointsLabel(), 'Penalty points for each incorrect answer: 1');
182
+ });
183
+
184
+ it('When the user checks the \'Automatically set penalty for each incorrect answer to total points / no. of incorrect answers\' checkbox, both radio buttons should get disabled, \'Specify points for each incorrect answer\' should get checked, in the penalty points details section, \'Penalty points for each incorrect answer: #\' and \'Total penalty points: #\' should be displayed as per the alloted points and available incorrect options', () => {
185
+ textSelectionPage.steps.checkAutomaticallySetPenaltyPointsCheckbox();
186
+ textSelectionPage.steps.verifySpecifyTotalPenaltyPointsDisabledState();
187
+ textSelectionPage.steps.verifySpecifyPointsForEachIncorrectOptionRadioButtonSelectedAndDisabledState();
188
+ utilities.verifyInnerText(utilities.getNthElement(textSelectionPage.penaltyPointsDetailsSectionAllottedPointsLabel(), 0), 'Penalty points for each incorrect answer: 5');
189
+ utilities.verifyInnerText(utilities.getNthElement(textSelectionPage.penaltyPointsDetailsSectionAllottedPointsLabel(), 1), 'Total penalty points: 10');
190
+ });
191
+ });
192
+
193
+ describe('Scoring section: Rounding - Edit tab', () => {
194
+ abortEarlySetup();
195
+ before(() => {
196
+ textSelectionPage.steps.navigateToCreateQuestion('text selection');
197
+ cy.barsPreLoaderWait();
198
+ textSelectionPage.steps.allotPoints(10);
199
+ textSelectionPage.steps.selectAutoScoredScoringSubtype('Partial equal weights')
200
+ });
201
+
202
+ textSelectionPage.tests.verifyRoundingDropdown();
203
+
204
+ textSelectionPage.tests.verifyRoundNegativeScoreToZeroLabelAndCheckbox();
205
+ });
206
+ });
@@ -28,9 +28,9 @@ describe('Create item page - Text selection : Preview contents', () => {
28
28
  });
29
29
  textSelectionPage.steps.addInputToQuestionInputField('{backspace}');
30
30
  textSelectionPage.steps.switchTextSelectionMode('Paragraph');
31
- textSelectionPage.steps.clickOnOptionInHighlightOptionsSection(paragraphTextArray[0]);
32
- textSelectionPage.steps.clickOnOptionInHighlightOptionsSection(paragraphTextArray[1]);
33
- textSelectionPage.steps.clickOnOptionInHighlightOptionsSection(paragraphTextArray[2]);
31
+ textSelectionPage.steps.clickOnOptionInSpecifyPossibleOptionsSection(paragraphTextArray[0]);
32
+ textSelectionPage.steps.clickOnOptionInSpecifyPossibleOptionsSection(paragraphTextArray[1]);
33
+ textSelectionPage.steps.clickOnOptionInSpecifyPossibleOptionsSection(paragraphTextArray[2]);
34
34
  textSelectionPage.steps.selectOptionInSpecifyCorrectAnswerSection(paragraphTextArray[0]);
35
35
  textSelectionPage.steps.selectOptionInSpecifyCorrectAnswerSection(paragraphTextArray[1]);
36
36
  textSelectionPage.steps.allotPoints(20);