itemengine-cypress-automation 1.0.133-7thMarchFixes-0e78080.0 → 1.0.134-14MarchUpdates-0b00629.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (50) hide show
  1. package/cypress/e2e/ILC/DesmosGraphing/previewTabContent.smoke.js +1 -2
  2. package/cypress/e2e/ILC/DrawingResponse/drawingResponsePreviewTabContents.smoke.js +53 -54
  3. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/Scoring/partialDifferentWeightsBasic.js +0 -149
  4. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/Scoring/partialDifferentWeightsMinimumAndPenaltyScoring.js +312 -0
  5. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/additionalSettingsBasic.js +71 -0
  6. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/minimumScoringPenaltyPointsAndRoundingDropdown.js +194 -0
  7. package/cypress/e2e/ILC/GeogebraActivity/additionalSettings.js +98 -0
  8. package/cypress/e2e/ILC/GeogebraActivity/editTabScoringSection.js +56 -0
  9. package/cypress/e2e/ILC/GeogebraActivity/gradingViewAndCorrectAnswerViewContents.smoke.js +106 -0
  10. package/cypress/e2e/ILC/GeogebraActivity/headerSection.js +74 -0
  11. package/cypress/e2e/ILC/GeogebraActivity/previewTabContent.smoke.js +91 -0
  12. package/cypress/e2e/ILC/GeogebraActivity/questionInstructions.js +28 -0
  13. package/cypress/e2e/ILC/Graphing/Scoring/allOrNothingPenaltyScoring.js +79 -0
  14. package/cypress/e2e/ILC/Graphing/Scoring/manuallyAndNonScoredScoring.js +253 -0
  15. package/cypress/e2e/ILC/Graphing/addBackgroundShapesSection.js +307 -0
  16. package/cypress/e2e/ILC/Graphing/additionalSettingsBasic.js +84 -0
  17. package/cypress/e2e/ILC/Graphing/editTabScoringSection.js +105 -0
  18. package/cypress/e2e/ILC/Graphing/headerSection.js +77 -0
  19. package/cypress/e2e/ILC/Graphing/layoutAndGridOptions.js +916 -0
  20. package/cypress/e2e/ILC/Graphing/minimumScoringPenaltyPointsAndRoundingDropdown.js +57 -0
  21. package/cypress/e2e/ILC/Graphing/previewContentsForAllViews.smoke.js +1 -1
  22. package/cypress/e2e/ILC/Graphing/specifyCorrectAnswerSection.js +72 -0
  23. package/cypress/e2e/ILC/Graphing/studentViewSettings.js +120 -0
  24. package/cypress/e2e/ILC/Graphing/toolsControlsAndBackgroundSection.js +858 -0
  25. package/cypress/e2e/ILC/ShortTextResponseNew/additionalSettings.js +337 -4
  26. package/cypress/fixtures/constants.js +1 -1
  27. package/cypress/fixtures/theme/ilc.json +3 -1
  28. package/cypress/pages/components/additionalSettingsAccessibilitySectionComponent.js +66 -0
  29. package/cypress/pages/components/additionalSettingsPanel.js +95 -90
  30. package/cypress/pages/components/autoScoredSpecifyCorrectAnswerSection.js +9 -7
  31. package/cypress/pages/components/backgroundImageUploadComponent.js +16 -14
  32. package/cypress/pages/components/colorPopupComponent.js +14 -17
  33. package/cypress/pages/components/commonComponents.js +1 -1
  34. package/cypress/pages/components/fillInTheGapsDropdownCommonComponent.js +1 -1
  35. package/cypress/pages/components/imageCanvasComponent.js +3 -3
  36. package/cypress/pages/components/index.js +2 -2
  37. package/cypress/pages/components/opacityComponent.js +1 -1
  38. package/cypress/pages/components/scoringSectionBaseEditTab.js +18 -0
  39. package/cypress/pages/components/studentResponseAreaAndLayoutComponent.js +1 -1
  40. package/cypress/pages/dialogBoxBase.js +1 -1
  41. package/cypress/pages/drawingResponsePage.js +35 -4
  42. package/cypress/pages/fillInTheGapsOverImageDropdownPage.js +2 -2
  43. package/cypress/pages/fillInTheGapsOverImageTextPage.js +2 -0
  44. package/cypress/pages/geogebraActivityPage.js +106 -0
  45. package/cypress/pages/graphingPage.js +1458 -77
  46. package/cypress/pages/index.js +1 -0
  47. package/cypress/pages/multipleSelectionPage.js +0 -1
  48. package/cypress/pages/shortTextResponsePage.js +155 -3
  49. package/cypress/pages/uploadResponsePage.js +0 -2
  50. package/package.json +1 -1
@@ -0,0 +1,312 @@
1
+ import { fillInTheGapsOverImageTextPage } from "../../../../pages";
2
+ import abortEarlySetup from "../../../../support/helpers/abortEarly";
3
+
4
+ describe('Create item page - Fill in the gaps over image with text: Partial different weights', () => {
5
+ before(() => {
6
+ cy.loginAs('admin');
7
+ });
8
+
9
+ describe('Question preview: Auto scored - Partial different weights: Minimum scoring', () => {
10
+ abortEarlySetup();
11
+ before(() => {
12
+ fillInTheGapsOverImageTextPage.steps.navigateToCreateQuestion('fill in the gaps over image with text');
13
+ cy.barsPreLoaderWait();
14
+ fillInTheGapsOverImageTextPage.steps.uploadFile('highlightImage.jpg');
15
+ fillInTheGapsOverImageTextPage.steps.verifyImageIsUploaded();
16
+ fillInTheGapsOverImageTextPage.steps.insertResponseArea(10);
17
+ fillInTheGapsOverImageTextPage.steps.insertResponseArea(40);
18
+ fillInTheGapsOverImageTextPage.steps.insertResponseArea(80);
19
+ fillInTheGapsOverImageTextPage.steps.enterTextInAnswerInputFieldsSpecifyCorrectAnswerSection([{ responseIndex: 0, responseText: 'Flower' }, { responseIndex: 1, responseText: 'Leaf' }, { responseIndex: 2, responseText: 'Stem' }]);
20
+ fillInTheGapsOverImageTextPage.steps.selectAutoScoredScoringSubtype('Partial different weights');
21
+ fillInTheGapsOverImageTextPage.steps.allotPartialDifferentWeightsPoints({ 0: 1, 1: 6, 2: 5 });
22
+ fillInTheGapsOverImageTextPage.steps.checkAllowStudentToCheckAnswerCheckbox();
23
+ });
24
+
25
+ it('When the user selects \'Award minimum score\' from the minimum scoring dropdown, does not attempt the question and switches to grading view, then the user should be awarded with minimum points', () => {
26
+ fillInTheGapsOverImageTextPage.steps.expandMinimumScoringDropdown();
27
+ fillInTheGapsOverImageTextPage.steps.selectOptionFromMinimumScoringDropdown('Award minimum score');
28
+ fillInTheGapsOverImageTextPage.steps.allotMinimumPoints(2);
29
+ fillInTheGapsOverImageTextPage.steps.switchToPreviewTab();
30
+ fillInTheGapsOverImageTextPage.steps.switchToGradingView();
31
+ fillInTheGapsOverImageTextPage.steps.verifyPreviewScore(2, 12);
32
+ fillInTheGapsOverImageTextPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
33
+ });
34
+
35
+ it('When the user has selected \'Award minimum score\' from the minimum scoring dropdown, attempts the question incorrectly and switches to grading view, the user should be awarded with minimum points', () => {
36
+ fillInTheGapsOverImageTextPage.steps.resetQuestionPreview();
37
+ fillInTheGapsOverImageTextPage.steps.enterTextInAnswerInputFieldsPreviewTab([{ responseIndex: 2, responseText: 'Roots' }]);
38
+ fillInTheGapsOverImageTextPage.steps.verifyPreviewScore(2, 12);
39
+ fillInTheGapsOverImageTextPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
40
+ });
41
+
42
+ it('When the user selects \'Award minimum score only if attempted\' from the minimum scoring dropdown, does not attempt the question and switches to grading view, then the user should be awarded with 0 points', () => {
43
+ fillInTheGapsOverImageTextPage.steps.switchToEditTab();
44
+ fillInTheGapsOverImageTextPage.steps.expandMinimumScoringDropdown();
45
+ fillInTheGapsOverImageTextPage.steps.selectOptionFromMinimumScoringDropdown('Award minimum score only if attempted');
46
+ fillInTheGapsOverImageTextPage.steps.allotMinimumPoints(2);
47
+ fillInTheGapsOverImageTextPage.steps.switchToPreviewTab();
48
+ fillInTheGapsOverImageTextPage.steps.switchToGradingView();
49
+ fillInTheGapsOverImageTextPage.steps.verifyPreviewScore(0, 12);
50
+ fillInTheGapsOverImageTextPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
51
+ });
52
+
53
+ it('When the user has selected \'Award minimum score only if attempted\' from the minimum scoring dropdown, attempts the question incorrectly and switches to grading view, the user should be awarded with minimum points', () => {
54
+ fillInTheGapsOverImageTextPage.steps.resetQuestionPreview();
55
+ fillInTheGapsOverImageTextPage.steps.enterTextInAnswerInputFieldsPreviewTab([{ responseIndex: 2, responseText: 'Roots' }]);
56
+ fillInTheGapsOverImageTextPage.steps.verifyPreviewScore(2, 12);
57
+ });
58
+
59
+ it('When the user attempts the question partially correct such that points of the correctly attempted option are greater than minimum points, then the user should be awarded with points as per the correctly attempted response', () => {
60
+ fillInTheGapsOverImageTextPage.steps.resetQuestionPreview();
61
+ fillInTheGapsOverImageTextPage.steps.enterTextInAnswerInputFieldsPreviewTab([{ responseIndex: 2, responseText: 'Stem' }]);
62
+ fillInTheGapsOverImageTextPage.steps.verifyPreviewScore(5, 12);
63
+ });
64
+
65
+ it('When the user attempts the question partially correct such that minimum points are greater than points of the correctly attempted option, then the user should be awarded with minimum points', () => {
66
+ fillInTheGapsOverImageTextPage.steps.resetQuestionPreview();
67
+ fillInTheGapsOverImageTextPage.steps.enterTextInAnswerInputFieldsPreviewTab([{ responseIndex: 0, responseText: 'Flower' }]);
68
+ fillInTheGapsOverImageTextPage.steps.verifyPreviewScore(2, 12);
69
+ });
70
+ });
71
+
72
+ describe('Question preview: Auto scored - Partial different weights: Rounding', () => {
73
+ abortEarlySetup();
74
+ before(() => {
75
+ fillInTheGapsOverImageTextPage.steps.navigateToCreateQuestion('fill in the gaps over image with text');
76
+ cy.barsPreLoaderWait();
77
+ fillInTheGapsOverImageTextPage.steps.uploadFile('highlightImage.jpg');
78
+ fillInTheGapsOverImageTextPage.steps.verifyImageIsUploaded();
79
+ fillInTheGapsOverImageTextPage.steps.insertResponseArea(10);
80
+ fillInTheGapsOverImageTextPage.steps.insertResponseArea(40);
81
+ fillInTheGapsOverImageTextPage.steps.insertResponseArea(60);
82
+ fillInTheGapsOverImageTextPage.steps.insertResponseArea(80);
83
+ fillInTheGapsOverImageTextPage.steps.enterTextInAnswerInputFieldsSpecifyCorrectAnswerSection([{ responseIndex: 0, responseText: 'Flower' }, { responseIndex: 1, responseText: 'Leaf' }, { responseIndex: 2, responseText: 'Stem' }, { responseIndex: 3, responseText: 'Roots' }]);
84
+ fillInTheGapsOverImageTextPage.steps.selectAutoScoredScoringSubtype('Partial different weights');
85
+ fillInTheGapsOverImageTextPage.steps.allotPartialDifferentWeightsPoints({ 0: 2.67, 1: 1.99, 2: 1.34, 3: 4.5 });
86
+ });
87
+
88
+ it('When the user sets \'Rounding\' to \'Round down if <=0.99\', attempts the question partially correct with an option such that points of the correctly attempted options has decimal value greater than 0.5 and less than 0.99, then the points awarded should be rounded down to the nearest integer value', () => {
89
+ fillInTheGapsOverImageTextPage.steps.expandRoundingDropdown();
90
+ fillInTheGapsOverImageTextPage.steps.selectOptionFromRoundingDropdown('round down if <= 0.99');
91
+ fillInTheGapsOverImageTextPage.steps.switchToPreviewTab();
92
+ fillInTheGapsOverImageTextPage.steps.enterTextInAnswerInputFieldsPreviewTab([{ responseIndex: 0, responseText: 'Flower' }]);
93
+ fillInTheGapsOverImageTextPage.steps.verifyPreviewScore(2, 10.5);
94
+ });
95
+
96
+ it('When the user has set \'Rounding\' to \'Round down if <=0.99\', attempts the question partially correct with an option such that points of the correctly attempted options has decimal value equal to 0.99, then the points awarded should be rounded down to the nearest integer value', () => {
97
+ fillInTheGapsOverImageTextPage.steps.resetQuestionPreview();
98
+ fillInTheGapsOverImageTextPage.steps.enterTextInAnswerInputFieldsPreviewTab([{ responseIndex: 1, responseText: 'Leaf' }]);
99
+ fillInTheGapsOverImageTextPage.steps.verifyPreviewScore(1, 10.5);
100
+ });
101
+
102
+ it('When the user sets \'Rounding\' to \'Round down if <=0.50\', attempts the question partially correct with an option such that points of the correctly attempted options has decimal value less than 0.50, then the points awarded should be rounded down to the nearest integer value', () => {
103
+ fillInTheGapsOverImageTextPage.steps.switchToEditTab();
104
+ fillInTheGapsOverImageTextPage.steps.expandRoundingDropdown();
105
+ fillInTheGapsOverImageTextPage.steps.selectOptionFromRoundingDropdown('round down if <= 0.50');
106
+ fillInTheGapsOverImageTextPage.steps.switchToPreviewTab();
107
+ fillInTheGapsOverImageTextPage.steps.enterTextInAnswerInputFieldsPreviewTab([{ responseIndex: 2, responseText: 'Stem' }]);
108
+ fillInTheGapsOverImageTextPage.steps.verifyPreviewScore(1, 10.5);
109
+ });
110
+
111
+ it('When the user has set \'Rounding\' to \'Round down if <=0.50\', attempts the question partially correct with an option such that points of the correctly attempted options has decimal value equal to 0.50, then the points awarded should be rounded down to the nearest integer value', () => {
112
+ fillInTheGapsOverImageTextPage.steps.resetQuestionPreview();
113
+ fillInTheGapsOverImageTextPage.steps.enterTextInAnswerInputFieldsPreviewTab([{ responseIndex: 3, responseText: 'Roots' }]);
114
+ fillInTheGapsOverImageTextPage.steps.verifyPreviewScore(4, 10.5);
115
+ });
116
+
117
+ it('When the user sets \'Rounding\' to \'Round down if <=0.50, Round up if > 0.50\', attempts the question partially correct with an option such that points of the correctly attempted options has decimal value less than 0.50, then the points awarded should be rounded down to the nearest integer value', () => {
118
+ fillInTheGapsOverImageTextPage.steps.switchToEditTab();
119
+ fillInTheGapsOverImageTextPage.steps.expandRoundingDropdown();
120
+ fillInTheGapsOverImageTextPage.steps.selectOptionFromRoundingDropdown('round down if <= 0.50; Round up if > 0.50');
121
+ fillInTheGapsOverImageTextPage.steps.switchToPreviewTab();
122
+ fillInTheGapsOverImageTextPage.steps.enterTextInAnswerInputFieldsPreviewTab([{ responseIndex: 2, responseText: 'Stem' }]);
123
+ fillInTheGapsOverImageTextPage.steps.verifyPreviewScore(1, 10.5);
124
+ });
125
+
126
+ it('When the user has set \'Rounding\' to \'Round down if <=0.50, Round up if > 0.50\', attempts the question partially correct with an option such that points of the correctly attempted options has decimal value equal to 0.50, then the points awarded should be rounded down to the nearest integer value', () => {
127
+ fillInTheGapsOverImageTextPage.steps.resetQuestionPreview();
128
+ fillInTheGapsOverImageTextPage.steps.enterTextInAnswerInputFieldsPreviewTab([{ responseIndex: 3, responseText: 'Roots' }]);
129
+ fillInTheGapsOverImageTextPage.steps.verifyPreviewScore(4, 10.5);
130
+ });
131
+
132
+ it('When the user has set \'Rounding\' to \'Round down if <=0.50, Round up if > 0.50\', attempts the question partially correct with an option such that points of the correctly attempted options has decimal value greater than 0.50, then the points awarded should be rounded down to the nearest integer value', () => {
133
+ fillInTheGapsOverImageTextPage.steps.resetQuestionPreview();
134
+ fillInTheGapsOverImageTextPage.steps.enterTextInAnswerInputFieldsPreviewTab([{ responseIndex: 0, responseText: 'Flower' }]);
135
+ fillInTheGapsOverImageTextPage.steps.verifyPreviewScore(3, 10.5);
136
+ });
137
+
138
+ it('When \'Round negative score to zero\' is in checked state and the user attempts the question incorrectly, then the user should be awarded with 0 points', () => {
139
+ cy.log('Pre-step: Setting penalty scoring to \'Penalty points for the entire question\', allotting penalty points')
140
+ fillInTheGapsOverImageTextPage.steps.switchToEditTab();
141
+ fillInTheGapsOverImageTextPage.steps.expandPenaltyScoringDropdown();
142
+ fillInTheGapsOverImageTextPage.steps.selectOptionFromPenaltyScoringDropdown('Penalty points for the entire question');
143
+ fillInTheGapsOverImageTextPage.steps.allotPenaltyPoints(4);
144
+ fillInTheGapsOverImageTextPage.steps.switchToPreviewTab();
145
+ fillInTheGapsOverImageTextPage.steps.enterTextInAnswerInputFieldsPreviewTab([{ responseIndex: 0, responseText: 'Seed' }]);
146
+ fillInTheGapsOverImageTextPage.steps.verifyPreviewScore(0, 10.5);
147
+ });
148
+
149
+ it('When the user unchecks \'Round negative score to zero\' checkbox and the user attempts the question incorrectly, then the user should be awarded with negative points', () => {
150
+ fillInTheGapsOverImageTextPage.steps.switchToEditTab();
151
+ fillInTheGapsOverImageTextPage.steps.uncheckRoundNegativeScoresToZeroCheckbox();
152
+ fillInTheGapsOverImageTextPage.steps.switchToPreviewTab();
153
+ fillInTheGapsOverImageTextPage.steps.enterTextInAnswerInputFieldsPreviewTab([{ responseIndex: 0, responseText: 'Seed' }]);
154
+ fillInTheGapsOverImageTextPage.steps.verifyPreviewScore(-4, 10.5);
155
+ });
156
+ });
157
+
158
+ describe('Question preview: Auto scored - Partial different weights: Penalty scoring with \'Round negative score to zero\' unchecked', () => {
159
+ abortEarlySetup();
160
+ before(() => {
161
+ fillInTheGapsOverImageTextPage.steps.navigateToCreateQuestion('fill in the gaps over image with text');
162
+ cy.barsPreLoaderWait();
163
+ fillInTheGapsOverImageTextPage.steps.uploadFile('highlightImage.jpg');
164
+ fillInTheGapsOverImageTextPage.steps.verifyImageIsUploaded();
165
+ fillInTheGapsOverImageTextPage.steps.insertResponseArea(10);
166
+ fillInTheGapsOverImageTextPage.steps.insertResponseArea(40);
167
+ fillInTheGapsOverImageTextPage.steps.insertResponseArea(80);
168
+ fillInTheGapsOverImageTextPage.steps.enterTextInAnswerInputFieldsSpecifyCorrectAnswerSection([{ responseIndex: 0, responseText: 'Flower' }, { responseIndex: 1, responseText: 'Leaf' }, { responseIndex: 2, responseText: 'Stem' }]);
169
+ fillInTheGapsOverImageTextPage.steps.selectAutoScoredScoringSubtype('Partial different weights');
170
+ fillInTheGapsOverImageTextPage.steps.allotPartialDifferentWeightsPoints({ 0: 9, 1: 6, 2: 5 });
171
+ fillInTheGapsOverImageTextPage.steps.checkAllowStudentToCheckAnswerCheckbox();
172
+ });
173
+
174
+ //Penalty points for the entire question
175
+ it('When the user sets penalty scoring to \'Penalty points for the entire question\', allots penalty points and attempts the question incorrectly, then the user should be awarded with negative points', () => {
176
+ fillInTheGapsOverImageTextPage.steps.expandPenaltyScoringDropdown();
177
+ fillInTheGapsOverImageTextPage.steps.selectOptionFromPenaltyScoringDropdown('Penalty points for the entire question');
178
+ fillInTheGapsOverImageTextPage.steps.uncheckRoundNegativeScoresToZeroCheckbox();
179
+ fillInTheGapsOverImageTextPage.steps.allotPenaltyPoints(4);
180
+ fillInTheGapsOverImageTextPage.steps.switchToPreviewTab();
181
+ fillInTheGapsOverImageTextPage.steps.enterTextInAnswerInputFieldsPreviewTab([{ responseIndex: 0, responseText: 'Seed' }]);
182
+ fillInTheGapsOverImageTextPage.steps.verifyPreviewScore(-4, 20);
183
+ });
184
+
185
+ it('When the user attempts the question correctly along with an incorrect response, then penalty points should get deducted from the awarded points', () => {
186
+ fillInTheGapsOverImageTextPage.steps.resetQuestionPreview();
187
+ fillInTheGapsOverImageTextPage.steps.enterTextInAnswerInputFieldsPreviewTab([{ responseIndex: 0, responseText: 'Flower' }, { responseIndex: 1, responseText: 'Leaf' }, { responseIndex: 2, responseText: 'Seed' }]);
188
+ fillInTheGapsOverImageTextPage.steps.verifyPreviewScore(5, 20);
189
+ });
190
+
191
+ it('When the user attempts the question correctly along with multiple incorrect responses, then penalty points should get deducted from the awarded points only once, the deducted penalty points should not increase as per number of attempted incorrect responses', () => {
192
+ fillInTheGapsOverImageTextPage.steps.resetQuestionPreview();
193
+ fillInTheGapsOverImageTextPage.steps.enterTextInAnswerInputFieldsPreviewTab([{ responseIndex: 0, responseText: 'Flower' }, { responseIndex: 1, responseText: 'Seed' }, { responseIndex: 2, responseText: 'Branch' }]);
194
+ fillInTheGapsOverImageTextPage.steps.verifyPreviewScore(5, 20);
195
+ });
196
+
197
+ it('When the user has defined penalty points and also sets minimum scoring to \'Award minimum score only if attempted\' and allots minimum points, then on attempting the question incorrectly, minimum points should be awarded', () => {
198
+ fillInTheGapsOverImageTextPage.steps.switchToEditTab();
199
+ fillInTheGapsOverImageTextPage.steps.expandMinimumScoringDropdown();
200
+ fillInTheGapsOverImageTextPage.steps.selectOptionFromMinimumScoringDropdown('Award minimum score only if attempted');
201
+ fillInTheGapsOverImageTextPage.steps.allotMinimumPoints(3);
202
+ fillInTheGapsOverImageTextPage.steps.switchToPreviewTab();
203
+ fillInTheGapsOverImageTextPage.steps.enterTextInAnswerInputFieldsPreviewTab([{ responseIndex: 0, responseText: 'Roots' }]);
204
+ fillInTheGapsOverImageTextPage.steps.verifyPreviewScore(3, 20);
205
+ cy.log('Post step: Switching to edit tab and resetting minimum scoring to "No minimum score"')
206
+ fillInTheGapsOverImageTextPage.steps.switchToEditTab();
207
+ fillInTheGapsOverImageTextPage.steps.expandMinimumScoringDropdown();
208
+ fillInTheGapsOverImageTextPage.steps.selectOptionFromMinimumScoringDropdown('No minimum score');
209
+ });
210
+
211
+ //Penalty points for each incorrect text container - Specify total penalty points
212
+ it('When the user sets penalty scoring to \'Penalty points for each incorrect text container\', and \'Specify total penalty points\' radio button in checked state, allots total penalty points and attempts the question incorrectly, then the user should be awarded with negative points of all the empty and incorrect text container', () => {
213
+ fillInTheGapsOverImageTextPage.steps.expandPenaltyScoringDropdown();
214
+ fillInTheGapsOverImageTextPage.steps.selectOptionFromPenaltyScoringDropdown('Penalty points for each incorrect text container');
215
+ fillInTheGapsOverImageTextPage.steps.allotTotalPenaltyPoints(4);
216
+ fillInTheGapsOverImageTextPage.steps.switchToPreviewTab();
217
+ fillInTheGapsOverImageTextPage.steps.enterTextInAnswerInputFieldsPreviewTab([{ responseIndex: 0, responseText: 'Roots' }]);
218
+ fillInTheGapsOverImageTextPage.steps.verifyPreviewScore(-3.99, 20);
219
+ });
220
+
221
+ it('When the user attempts the question correctly along with an incorrect option, then penalty points should get deducted from the awarded points', () => {
222
+ fillInTheGapsOverImageTextPage.steps.resetQuestionPreview();
223
+ fillInTheGapsOverImageTextPage.steps.enterTextInAnswerInputFieldsPreviewTab([{ responseIndex: 0, responseText: 'Flower' }, { responseIndex: 1, responseText: 'Leaf' }, { responseIndex: 2, responseText: 'Roots' }]);
224
+ fillInTheGapsOverImageTextPage.steps.verifyPreviewScore(12.67, 20);
225
+ });
226
+
227
+ it('When the user attempts the question correctly along with multiple incorrect options, then Penalty points for each incorrect text container should get deducted from the awarded points', () => {
228
+ fillInTheGapsOverImageTextPage.steps.resetQuestionPreview();
229
+ fillInTheGapsOverImageTextPage.steps.enterTextInAnswerInputFieldsPreviewTab([{ responseIndex: 0, responseText: 'Flower' }, { responseIndex: 1, responseText: 'Seed' }, { responseIndex: 2, responseText: 'Branch' }]);
230
+ fillInTheGapsOverImageTextPage.steps.verifyPreviewScore(12.67, 20);
231
+ });
232
+
233
+ it('When the user has defined penalty points and also sets minimum scoring to \'Award minimum score only if attempted\' and allots minimum points, then on attempting the question incorrectly, minimum points should be awarded', () => {
234
+ fillInTheGapsOverImageTextPage.steps.switchToEditTab();
235
+ fillInTheGapsOverImageTextPage.steps.expandMinimumScoringDropdown();
236
+ fillInTheGapsOverImageTextPage.steps.selectOptionFromMinimumScoringDropdown('Award minimum score only if attempted');
237
+ fillInTheGapsOverImageTextPage.steps.allotMinimumPoints(3);
238
+ fillInTheGapsOverImageTextPage.steps.switchToPreviewTab();
239
+ fillInTheGapsOverImageTextPage.steps.enterTextInAnswerInputFieldsPreviewTab([{ responseIndex: 0, responseText: 'Roots' }]);
240
+ fillInTheGapsOverImageTextPage.steps.verifyPreviewScore(3, 20);
241
+ cy.log('Post step: Switching to edit tab and resetting minimum scoring to "No minimum score"')
242
+ fillInTheGapsOverImageTextPage.steps.switchToEditTab();
243
+ fillInTheGapsOverImageTextPage.steps.expandMinimumScoringDropdown();
244
+ fillInTheGapsOverImageTextPage.steps.selectOptionFromMinimumScoringDropdown('No minimum score');
245
+ });
246
+
247
+ //Penalty points for each incorrect text container - Specify points for each incorrect text container
248
+ it('When the user has set penalty scoring to \'Penalty points for each incorrect text container\', and \'Specify total penalty points\' radio button in checked state, allots total penalty points and attempts the question incorrectly, then the user should be awarded with negative points for the incorrect and empty dropzone', () => {
249
+ fillInTheGapsOverImageTextPage.steps.selectOptionFromPenaltyScoringDropdown('Penalty points for each incorrect text container');
250
+ fillInTheGapsOverImageTextPage.steps.allotPenaltyPointsForEachIncorrectTextContainer(4);
251
+ fillInTheGapsOverImageTextPage.steps.switchToPreviewTab();
252
+ fillInTheGapsOverImageTextPage.steps.enterTextInAnswerInputFieldsPreviewTab([{ responseIndex: 0, responseText: 'Roots' }]);
253
+ fillInTheGapsOverImageTextPage.steps.verifyPreviewScore(-12, 20);
254
+ });
255
+
256
+ it('When the user attempts the question correctly along with an incorrect option, then penalty points should get deducted from the awarded points', () => {
257
+ fillInTheGapsOverImageTextPage.steps.resetQuestionPreview();
258
+ fillInTheGapsOverImageTextPage.steps.enterTextInAnswerInputFieldsPreviewTab([{ responseIndex: 0, responseText: 'Flower' }, { responseIndex: 1, responseText: 'Leaf' }, { responseIndex: 2, responseText: 'Roots' }]);
259
+ fillInTheGapsOverImageTextPage.steps.verifyPreviewScore(10, 20);
260
+ });
261
+
262
+ it('When the user attempts the question correctly along with multiple incorrect options, then Penalty points for each incorrect text container should get deducted from the awarded points', () => {
263
+ fillInTheGapsOverImageTextPage.steps.resetQuestionPreview();
264
+ fillInTheGapsOverImageTextPage.steps.enterTextInAnswerInputFieldsPreviewTab([{ responseIndex: 0, responseText: 'Flower' }, { responseIndex: 1, responseText: 'Branch' }, { responseIndex: 2, responseText: 'Roots' }]);
265
+ fillInTheGapsOverImageTextPage.steps.verifyPreviewScore(1, 20);
266
+ });
267
+
268
+ it('When the user has defined penalty points and also sets minimum scoring to \'Award minimum score only if attempted\' and allots minimum points, then on attempting the question incorrectly, minimum points should be awarded', () => {
269
+ fillInTheGapsOverImageTextPage.steps.switchToEditTab();
270
+ fillInTheGapsOverImageTextPage.steps.expandMinimumScoringDropdown();
271
+ fillInTheGapsOverImageTextPage.steps.selectOptionFromMinimumScoringDropdown('Award minimum score only if attempted');
272
+ fillInTheGapsOverImageTextPage.steps.allotMinimumPoints(3);
273
+ fillInTheGapsOverImageTextPage.steps.switchToPreviewTab();
274
+ fillInTheGapsOverImageTextPage.steps.enterTextInAnswerInputFieldsPreviewTab([{ responseIndex: 0, responseText: 'Roots' }]);
275
+ fillInTheGapsOverImageTextPage.steps.verifyPreviewScore(3, 20);
276
+ cy.log('Post step: Switching to edit tab and resetting minimum scoring to "No minimum score"')
277
+ fillInTheGapsOverImageTextPage.steps.switchToEditTab();
278
+ fillInTheGapsOverImageTextPage.steps.expandMinimumScoringDropdown();
279
+ fillInTheGapsOverImageTextPage.steps.selectOptionFromMinimumScoringDropdown('No minimum score');
280
+ });
281
+
282
+ // Penalty points for each incorrect text container - Automatically set penalty for each incorrect text container to total points / no. of incorrect text container
283
+ it('When the user has set penalty scoring to \'Penalty points for each incorrect text container\', and checks \'Automatically set penalty for each incorrect text container to total points / no. of incorrect text container\' checkbox and attempts the question incorrectly, then the user should be awarded with negative points for the incorrect and empty dropzone', () => {
284
+ fillInTheGapsOverImageTextPage.steps.checkAutomaticallySetPenaltyPointsCheckbox();
285
+ fillInTheGapsOverImageTextPage.steps.switchToPreviewTab();
286
+ fillInTheGapsOverImageTextPage.steps.enterTextInAnswerInputFieldsPreviewTab([{ responseIndex: 0, responseText: 'Roots' }]);
287
+ fillInTheGapsOverImageTextPage.steps.verifyPreviewScore(-20.01, 20);
288
+ });
289
+
290
+ it('When the user attempts the question correctly along with an incorrect option, then penalty points should get deducted from the awarded points', () => {
291
+ fillInTheGapsOverImageTextPage.steps.resetQuestionPreview();
292
+ fillInTheGapsOverImageTextPage.steps.enterTextInAnswerInputFieldsPreviewTab([{ responseIndex: 0, responseText: 'Flower' }, { responseIndex: 1, responseText: 'Leaf' }, { responseIndex: 2, responseText: 'Roots' }]);
293
+ fillInTheGapsOverImageTextPage.steps.verifyPreviewScore(7.33, 20);
294
+ });
295
+
296
+ it('When the user attempts the question correctly along with multiple incorrect options, then penalty points for each incorrect option should get deducted from the awarded points', () => {
297
+ fillInTheGapsOverImageTextPage.steps.resetQuestionPreview();
298
+ fillInTheGapsOverImageTextPage.steps.enterTextInAnswerInputFieldsPreviewTab([{ responseIndex: 0, responseText: 'Flower' }, { responseIndex: 1, responseText: 'Branch' }, { responseIndex: 2, responseText: 'Roots' }]);
299
+ fillInTheGapsOverImageTextPage.steps.verifyPreviewScore(-4.34, 20);
300
+ });
301
+
302
+ it('When the user has defined penalty points and also sets minimum scoring to \'Award minimum score only if attempted\' and allots minimum points, then on attempting the question incorrectly, minimum points should be awarded', () => {
303
+ fillInTheGapsOverImageTextPage.steps.switchToEditTab();
304
+ fillInTheGapsOverImageTextPage.steps.expandMinimumScoringDropdown();
305
+ fillInTheGapsOverImageTextPage.steps.selectOptionFromMinimumScoringDropdown('Award minimum score only if attempted');
306
+ fillInTheGapsOverImageTextPage.steps.allotMinimumPoints(3);
307
+ fillInTheGapsOverImageTextPage.steps.switchToPreviewTab();
308
+ fillInTheGapsOverImageTextPage.steps.enterTextInAnswerInputFieldsPreviewTab([{ responseIndex: 0, responseText: 'Roots' }]);
309
+ fillInTheGapsOverImageTextPage.steps.verifyPreviewScore(3, 20);
310
+ });
311
+ });
312
+ });
@@ -0,0 +1,71 @@
1
+ import { fillInTheGapsOverImageTextPage } from "../../../pages";
2
+ import abortEarlySetup from "../../../support/helpers/abortEarly";
3
+ import utilities from "../../../support/helpers/utilities";
4
+ const fontSizes = { 'Tiny': '12px', 'Small': '14px', 'Default': '16px', 'Normal': '18px', 'Big': '22px', 'Huge': '26px' };
5
+
6
+ describe('Fill In the gaps over image with text - Additional settings', () => {
7
+ before(() => {
8
+ cy.loginAs('admin');
9
+ });
10
+
11
+ describe('Additional settings accordion', () => {
12
+ abortEarlySetup();
13
+ before(() => {
14
+ fillInTheGapsOverImageTextPage.steps.navigateToCreateQuestion('fill in the gaps over image with text');
15
+ });
16
+
17
+ fillInTheGapsOverImageTextPage.tests.verifyAdditionalSettingsAccordionProperties();
18
+ });
19
+
20
+ describe('Additional settings: Font size - functionality in preview tab', () => {
21
+ abortEarlySetup();
22
+ before(() => {
23
+ fillInTheGapsOverImageTextPage.steps.navigateToCreateQuestion('fill in the gaps over image with text');
24
+ cy.barsPreLoaderWait();
25
+ fillInTheGapsOverImageTextPage.steps.addTextInQuestionInstructionsInputField('Fill in the gaps');
26
+ fillInTheGapsOverImageTextPage.steps.uploadFile('highlightImage.jpg');
27
+ fillInTheGapsOverImageTextPage.steps.verifyImageIsUploaded();
28
+ fillInTheGapsOverImageTextPage.steps.insertResponseArea(30);
29
+ fillInTheGapsOverImageTextPage.steps.insertResponseArea(80);
30
+ fillInTheGapsOverImageTextPage.steps.enterTextInAnswerInputFieldsSpecifyCorrectAnswerSection([{ responseIndex: 0, responseText: 'Flower' }, { responseIndex: 1, responseText: 'Leaf' }]);
31
+ fillInTheGapsOverImageTextPage.steps.allotPoints(10);
32
+ fillInTheGapsOverImageTextPage.steps.expandAdditionalSettings();
33
+ });
34
+
35
+ Object.keys(fontSizes).forEach((option) => {
36
+ it(`When the user selects \'${option}\' option from the Font Size dropdown, then font size of the preview tab should change to ${fontSizes[option]} accordingly`, () => {
37
+ fillInTheGapsOverImageTextPage.steps.selectFontSizeOptionFromFontSizeDropdown(option);
38
+ utilities.verifyInnerText(fillInTheGapsOverImageTextPage.fontSizeDropdown(), `${option}`);
39
+ fillInTheGapsOverImageTextPage.steps.switchToPreviewTab();
40
+ utilities.verifyCSS(fillInTheGapsOverImageTextPage.questionInstructionsText(), {
41
+ 'font-size': fontSizes[option]
42
+ });
43
+ utilities.verifyCSS(fillInTheGapsOverImageTextPage.answerInputFieldPreviewTab(), {
44
+ 'font-size': fontSizes[option]
45
+ });
46
+ fillInTheGapsOverImageTextPage.steps.switchToGradingView();
47
+ utilities.verifyCSS(fillInTheGapsOverImageTextPage.correctAnswersLabel(), {
48
+ 'font-size': fontSizes[option]
49
+ });
50
+ utilities.verifyCSS(fillInTheGapsOverImageTextPage.correctAnswerResponseNumeration().find('.response-input-adornment'), {
51
+ 'font-size': fontSizes[option]
52
+ });
53
+ utilities.verifyCSS(fillInTheGapsOverImageTextPage.correctAnswerResponse(), {
54
+ 'font-size': fontSizes[option]
55
+ });
56
+ fillInTheGapsOverImageTextPage.steps.switchToStudentView();
57
+ fillInTheGapsOverImageTextPage.steps.switchToEditTab();
58
+ });
59
+ });
60
+ });
61
+
62
+ describe('Additional settings: Details section', () => {
63
+ abortEarlySetup();
64
+ before(() => {
65
+ fillInTheGapsOverImageTextPage.steps.navigateToCreateQuestion('fill in the gaps over image with text');
66
+ fillInTheGapsOverImageTextPage.steps.expandAdditionalSettings();
67
+ });
68
+
69
+ fillInTheGapsOverImageTextPage.tests.verifyDetailsSection();
70
+ });
71
+ });
@@ -0,0 +1,194 @@
1
+ import { fillInTheGapsOverImageTextPage } 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 text container'];
6
+
7
+ describe('Create item page - Fill in the gaps over image with text: Minimum scoring, Penalty scoring, Rounding - Edit tab', () => {
8
+ before(() => {
9
+ cy.loginAs('admin');
10
+ });
11
+
12
+ describe('Scoring section: Minimum scoring - Edit tab', () => {
13
+ abortEarlySetup();
14
+ before(() => {
15
+ fillInTheGapsOverImageTextPage.steps.navigateToCreateQuestion('fill in the gaps over image with text');
16
+ cy.barsPreLoaderWait();
17
+ fillInTheGapsOverImageTextPage.steps.allotPoints(10);
18
+ });
19
+
20
+ fillInTheGapsOverImageTextPage.tests.verifyMinimumScoringDropdown();
21
+
22
+ fillInTheGapsOverImageTextPage.tests.verifyMinimumPointsLabelAndInputField();
23
+
24
+ fillInTheGapsOverImageTextPage.tests.verifyMinimumPointsFieldErrorState();
25
+ });
26
+
27
+ describe('Scoring section: Penalty scoring - Edit tab', () => {
28
+ abortEarlySetup();
29
+ before(() => {
30
+ fillInTheGapsOverImageTextPage.steps.navigateToCreateQuestion('fill in the gaps over image with text');
31
+ cy.barsPreLoaderWait();
32
+ fillInTheGapsOverImageTextPage.steps.selectAutoScoredScoringSubtype('Partial equal weights');
33
+ fillInTheGapsOverImageTextPage.steps.allotPoints(10);
34
+ });
35
+
36
+ fillInTheGapsOverImageTextPage.tests.verifyPenaltyScoringDropdown(penaltyScoringTypeArray);
37
+
38
+ fillInTheGapsOverImageTextPage.tests.verifyPenaltyPointsLabelAndInputField();
39
+
40
+ fillInTheGapsOverImageTextPage.tests.verifyPenaltyPointsErrorState();
41
+
42
+ it('When the user selects \'Penalty points for each incorrect text container\' from the penalty scoring dropdown, \'Automatically set penalty for each incorrect text container to total points / no. of incorrect text container\' 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 text container\' should be displayed. By default, \'Specify total penalty points\' radio button should be checked', () => {
43
+ fillInTheGapsOverImageTextPage.steps.expandPenaltyScoringDropdown();
44
+ fillInTheGapsOverImageTextPage.steps.selectOptionFromPenaltyScoringDropdown('Penalty points for each incorrect text container');
45
+ utilities.verifyInnerText(fillInTheGapsOverImageTextPage.automaticallySetPenaltyPointsCheckboxLabel(), 'Automatically set penalty for each incorrect text container to total points / no. of incorrect text container');
46
+ utilities.verifyInnerText(fillInTheGapsOverImageTextPage.specifyTotalPenaltyPointsRadioButtonLabel(), 'Specify total penalty points');
47
+ utilities.verifyInnerText(fillInTheGapsOverImageTextPage.specifyPointsForEachIncorrectOptionRadioButtonLabel(), 'Specify points for each incorrect text container');
48
+ fillInTheGapsOverImageTextPage.steps.verifyAutomaticallySetPenaltyPointsCheckboxUncheckedState();
49
+ fillInTheGapsOverImageTextPage.steps.verifySpecifyTotalPenaltyPointsRadioButtonCheckedState();
50
+ fillInTheGapsOverImageTextPage.steps.verifySpecifyPointsForEachIncorrectOptionRadioButtonUncheckedState();
51
+ });
52
+
53
+ 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 text container: -\' label should be displayed', () => {
54
+ utilities.verifyInnerText(fillInTheGapsOverImageTextPage.penaltyPointsDetailsSectionInputFieldLabel(), 'Total penalty points');
55
+ fillInTheGapsOverImageTextPage.steps.verifyTotalPenaltyPointsValue('');
56
+ utilities.verifyInnerText(fillInTheGapsOverImageTextPage.penaltyPointsDetailsSectionAllottedPointsLabel(), 'Penalty points for each incorrect text container: -');
57
+ });
58
+
59
+ it('When the user allots total penalty points, then \'points for each incorrect text container\' should get updated as per the count of incorrect options available', () => {
60
+ fillInTheGapsOverImageTextPage.steps.allotTotalPenaltyPoints(5);
61
+ fillInTheGapsOverImageTextPage.steps.verifyPenaltyPointsForEachIncorrectTextContainer(2.5);
62
+ });
63
+
64
+ it('When the user adds a new option, then \'points for each incorrect text container\' should get updated accordingly', () => {
65
+ fillInTheGapsOverImageTextPage.steps.insertResponseArea(30);
66
+ fillInTheGapsOverImageTextPage.steps.verifyPenaltyPointsForEachIncorrectTextContainer(1.67);
67
+ });
68
+
69
+ it('When the user deletes an option, then \'points for each incorrect text container\' should get updated accordingly', () => {
70
+ fillInTheGapsOverImageTextPage.steps.removeResponseArea(0);
71
+ fillInTheGapsOverImageTextPage.steps.verifyPenaltyPointsForEachIncorrectTextContainer(2.5);
72
+ });
73
+
74
+ it('CSS of the penalty points section - Total penalty points', { tags: 'css' }, () => {
75
+ utilities.verifyCSS(fillInTheGapsOverImageTextPage.automaticallySetPenaltyPointsCheckboxLabel(), {
76
+ 'color': css.color.labelText,
77
+ 'font-size': css.fontSize.normal,
78
+ 'font-weight': css.fontWeight.regular
79
+ });
80
+ utilities.verifyCSS(fillInTheGapsOverImageTextPage.automaticallySetPenaltyPointsCheckbox().parent().find('svg'), {
81
+ 'fill': css.color.uncheckedCheckbox
82
+ });
83
+ utilities.verifyCSS(fillInTheGapsOverImageTextPage.specifyTotalPenaltyPointsRadioButton().parent().find('svg'), {
84
+ 'fill': css.color.activeButtons
85
+ });
86
+ utilities.verifyCSS(fillInTheGapsOverImageTextPage.specifyPointsForEachIncorrectOptionRadioButton().parent().find('svg path'), {
87
+ 'fill': css.color.uncheckedCheckbox
88
+ });
89
+ utilities.verifyCSS(fillInTheGapsOverImageTextPage.specifyTotalPenaltyPointsRadioButtonLabel(), {
90
+ 'color': css.color.labelText,
91
+ 'font-size': css.fontSize.normal,
92
+ 'font-weight': css.fontWeight.regular
93
+ });
94
+ utilities.verifyCSS(fillInTheGapsOverImageTextPage.specifyPointsForEachIncorrectOptionRadioButtonLabel(), {
95
+ 'color': css.color.labelText,
96
+ 'font-size': css.fontSize.normal,
97
+ 'font-weight': css.fontWeight.regular
98
+ });
99
+ utilities.verifyCSS(fillInTheGapsOverImageTextPage.penaltyPointsDetailsSectionInputFieldLabel(), {
100
+ 'color': css.color.labels,
101
+ 'font-size': css.fontSize.normal,
102
+ 'font-weight': css.fontWeight.regular
103
+ });
104
+ utilities.verifyCSS(fillInTheGapsOverImageTextPage.totalPenaltyPointsInputField(), {
105
+ 'color': css.color.text,
106
+ 'font-size': css.fontSize.default,
107
+ 'font-weight': css.fontWeight.regular
108
+ });
109
+ utilities.verifyCSS(fillInTheGapsOverImageTextPage.penaltyPointsDetailsSectionAllottedPointsLabel(), {
110
+ 'color': css.color.labels,
111
+ 'font-size': css.fontSize.normal,
112
+ 'font-weight': css.fontWeight.regular
113
+ });
114
+ });
115
+
116
+ it('Accessibility of the penalty points section - Total penalty points', { tags: 'a11y' }, () => {
117
+ cy.checkAccessibility(fillInTheGapsOverImageTextPage.automaticallySetPenaltyPointsCheckboxLabel().parents('.penalty-score-for-each-incorrect-wrapper'));
118
+ });
119
+
120
+ it('When the user selects \'Specify points for each incorrect answer\', a penalty points detail section with \'Penalty points for each incorrect text container:\' label and empty input field, \'Total penalty points: -\' label should be displayed', () => {
121
+ cy.log('Pre-step: Clearing the total penalty points input field')
122
+ fillInTheGapsOverImageTextPage.steps.clearTotalPenaltyPointsInputField();
123
+ fillInTheGapsOverImageTextPage.steps.selectPenaltyPointsForEachIncorrectOptionType('Specify points for each incorrect option');
124
+ utilities.verifyInnerText(fillInTheGapsOverImageTextPage.penaltyPointsDetailsSectionInputFieldLabel(), 'Penalty points for each incorrect text container');
125
+ fillInTheGapsOverImageTextPage.steps.verifyPenaltyPointsForEachIncorrectTextContainerValue('');
126
+ utilities.verifyInnerText(fillInTheGapsOverImageTextPage.penaltyPointsDetailsSectionAllottedPointsLabel(), 'Total penalty points: -');
127
+ });
128
+
129
+ it('When the user allots Penalty points for each incorrect text container, then \'Total penalty points\' should get updated as per the count of incorrect options available', () => {
130
+ fillInTheGapsOverImageTextPage.steps.allotPenaltyPointsForEachIncorrectTextContainer(1);
131
+ fillInTheGapsOverImageTextPage.steps.verifyTotalPenaltyPoints(2);
132
+ });
133
+
134
+ it('When the user adds a new option, then \'Total penalty points\' should get updated accordingly', () => {
135
+ fillInTheGapsOverImageTextPage.steps.insertResponseArea(60);
136
+ fillInTheGapsOverImageTextPage.steps.verifyTotalPenaltyPoints(3);
137
+ });
138
+
139
+ it('When the user deletes an option, then \'points for each incorrect text container\' should get updated accordingly', () => {
140
+ fillInTheGapsOverImageTextPage.steps.removeResponseArea(0);
141
+ fillInTheGapsOverImageTextPage.steps.verifyTotalPenaltyPoints(2);
142
+ });
143
+
144
+ it('CSS of the penalty points section - Penalty points for each incorrect text container', { tags: 'css' }, () => {
145
+ utilities.verifyCSS(fillInTheGapsOverImageTextPage.penaltyPointsDetailsSectionInputFieldLabel(), {
146
+ 'color': css.color.labels,
147
+ 'font-size': css.fontSize.normal,
148
+ 'font-weight': css.fontWeight.regular
149
+ });
150
+ utilities.verifyCSS(fillInTheGapsOverImageTextPage.penaltyPointsForEachIncorrectTextContainerInputField(), {
151
+ 'color': css.color.text,
152
+ 'font-size': css.fontSize.default,
153
+ 'font-weight': css.fontWeight.regular
154
+ });
155
+ utilities.verifyCSS(fillInTheGapsOverImageTextPage.penaltyPointsDetailsSectionAllottedPointsLabel(), {
156
+ 'color': css.color.labels,
157
+ 'font-size': css.fontSize.normal,
158
+ 'font-weight': css.fontWeight.regular
159
+ });
160
+ });
161
+
162
+ it('Accessibility of the penalty points section - Penalty points for each incorrect text container', { tags: 'a11y' }, () => {
163
+ cy.checkAccessibility(fillInTheGapsOverImageTextPage.automaticallySetPenaltyPointsCheckboxLabel().parents('.penalty-score-for-each-incorrect-wrapper'));
164
+ });
165
+
166
+ 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 text container\'', () => {
167
+ fillInTheGapsOverImageTextPage.steps.selectPenaltyPointsForEachIncorrectOptionType('Specify total penalty points');
168
+ fillInTheGapsOverImageTextPage.steps.verifyTotalPenaltyPointsValue(2);
169
+ utilities.verifyInnerText(fillInTheGapsOverImageTextPage.penaltyPointsDetailsSectionAllottedPointsLabel(), 'Penalty points for each incorrect text container: 1');
170
+ });
171
+
172
+ it('When the user checks the \'Automatically set penalty for each incorrect text container to total points / no. of incorrect text containers\' checkbox, both radio buttons should get disabled, \'Specify points for each incorrect text container\' should get checked, in the penalty points details section, \'Penalty points for each incorrect text container: #\' and \'Total penalty points: #\' should be displayed as per the alloted points and available incorrect options', () => {
173
+ fillInTheGapsOverImageTextPage.steps.checkAutomaticallySetPenaltyPointsCheckbox();
174
+ fillInTheGapsOverImageTextPage.steps.verifySpecifyTotalPenaltyPointsDisabledState();
175
+ fillInTheGapsOverImageTextPage.steps.verifySpecifyPointsForEachIncorrectOptionRadioButtonSelectedAndDisabledState();
176
+ utilities.verifyInnerText(utilities.getNthElement(fillInTheGapsOverImageTextPage.penaltyPointsDetailsSectionAllottedPointsLabel(), 0), 'Penalty points for each incorrect text container: 5');
177
+ utilities.verifyInnerText(utilities.getNthElement(fillInTheGapsOverImageTextPage.penaltyPointsDetailsSectionAllottedPointsLabel(), 1), 'Total penalty points: 10');
178
+ });
179
+ });
180
+
181
+ describe('Scoring section: Rounding - Edit tab', () => {
182
+ abortEarlySetup();
183
+ before(() => {
184
+ fillInTheGapsOverImageTextPage.steps.navigateToCreateQuestion('fill in the gaps over image with text');
185
+ cy.barsPreLoaderWait();
186
+ fillInTheGapsOverImageTextPage.steps.selectAutoScoredScoringSubtype('Partial equal weights');
187
+ fillInTheGapsOverImageTextPage.steps.allotPoints(10);
188
+ });
189
+
190
+ fillInTheGapsOverImageTextPage.tests.verifyRoundingDropdown();
191
+
192
+ fillInTheGapsOverImageTextPage.tests.verifyRoundNegativeScoreToZeroLabelAndCheckbox();
193
+ });
194
+ });