itemengine-cypress-automation 1.0.150-migrationScripts-4f6bd6a.0 → 1.0.150

Sign up to get free protection for your applications and to get access to all the features.
Files changed (78) hide show
  1. package/cypress/e2e/ILC/AudioResponseNew/compactRecorderStyle.smoke.js +4 -4
  2. package/cypress/e2e/ILC/AudioResponseNew/editTabBasicSection.js +3 -3
  3. package/cypress/e2e/ILC/AudioResponseNew/standardRecorderStyle.smoke.js +1 -1
  4. package/cypress/e2e/ILC/AudioResponseNew/studentViewSettings.js +2 -1
  5. package/cypress/e2e/ILC/ContentBlocks/additionalSection.js +2 -2
  6. package/cypress/e2e/ILC/ContentBlocks/editTabBasics.js +6 -6
  7. package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/clickAndDrop.js +1 -1
  8. package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/editTabBasicSection.js +1 -1
  9. package/cypress/e2e/ILC/DrawingResponse/drawingResponseAdditionalSettings.js +3 -3
  10. package/cypress/e2e/ILC/DrawingResponse/drawingResponseBackground.js +2 -2
  11. package/cypress/e2e/ILC/DrawingResponse/drawingResponseCustomizeAdditionalOptions.js +1 -1
  12. package/cypress/e2e/ILC/DrawingResponse/drawingResponseEditTabBasicSection.js +1 -1
  13. package/cypress/e2e/ILC/Graphing/gradingViewAndCorrectAnswerView.smoke.js +1 -1
  14. package/cypress/e2e/ILC/GridFill/additionalSettings.js +52 -0
  15. package/cypress/e2e/ILC/GridFill/headerSection.js +74 -0
  16. package/cypress/e2e/ILC/GridFill/minimumScoringPenaltyPointsAndRoundingDropdown.js +199 -0
  17. package/cypress/e2e/ILC/GridFill/scoring/allOrNothingAlternativePointsGreaterThanCorrectPoints.js +0 -15
  18. package/cypress/e2e/ILC/GridFill/scoring/allOrNothingCorrectPointsEqualToAlternativePoints.js +3 -18
  19. package/cypress/e2e/ILC/GridFill/scoring/allOrNothingCorrectPointsGreaterThanAlternativePoints.js +4 -25
  20. package/cypress/e2e/ILC/GridFill/scoring/allOrNothingPenaltyScoring.js +4 -7
  21. package/cypress/e2e/ILC/GridFill/scoring/allOrNothingScoringCellShadeCount.js +1 -14
  22. package/cypress/e2e/ILC/GridFill/scoring/manuallyAndNonScored.js +1 -1
  23. package/cypress/e2e/ILC/GridFill/scoring/partialEqualWeightsBasic.js +4 -4
  24. package/cypress/e2e/ILC/GridFill/scoring/partialEqualWeightsWithAlternativePointsGreaterThanCorrectPoints.js +256 -0
  25. package/cypress/e2e/ILC/GridFill/scoring/partialEqualWeightsWithCorrectPointsEqualToAlternativePoints.js +213 -0
  26. package/cypress/e2e/ILC/GridFill/scoring/partialEqualWeightsWithCorrectPointsGreaterThanAlternativePoints.js +258 -0
  27. package/cypress/e2e/ILC/GridFill/studentViewSettingsSection.js +206 -0
  28. package/cypress/e2e/ILC/Matching/Scoring/allOrNothingWithAlternativePointsGreaterThanCorrectPoints.js +198 -0
  29. package/cypress/e2e/ILC/Matching/Scoring/allOrNothingWithCorrectPointsEqualToAlternativePoints.js +4 -6
  30. package/cypress/e2e/ILC/Matching/Scoring/allOrNothingWithCorrectPointsGreaterThanAlternativePoints.js +10 -22
  31. package/cypress/e2e/ILC/Matching/Scoring/partialDifferentWeightsScoringBasic.js +421 -0
  32. package/cypress/e2e/ILC/Matching/Scoring/partialDifferentWeightsWithAlternativePointsGreaterThanCorrectPoints.js +247 -0
  33. package/cypress/e2e/ILC/Matching/Scoring/partialDifferentWeightsWithCorrectPointsEqualToAlternativePoints.js +219 -0
  34. package/cypress/e2e/ILC/Matching/Scoring/partialDifferentWeightsWithCorrectPointsGreaterThanAlternativePoints.js +247 -0
  35. package/cypress/e2e/ILC/Matching/Scoring/partialEqualWeightsBasic.js +168 -0
  36. package/cypress/e2e/ILC/Matching/Scoring/partialEqualWeightsWithAlternativePointsGreaterThanCorrectPoints.js +227 -0
  37. package/cypress/e2e/ILC/Matching/Scoring/partialEqualWeightsWithCorrectPointsEqualToAlternativePoints.js +199 -0
  38. package/cypress/e2e/ILC/Matching/Scoring/partialEqualWeightsWithCorrectPointsGreaterThanAlternativePoints.js +227 -0
  39. package/cypress/e2e/ILC/MultipleSelectionGridNew/Scoring/allOrNothingAlternativePointsGreaterThanCorrectPoints.js +345 -0
  40. package/cypress/e2e/ILC/MultipleSelectionGridNew/Scoring/allOrNothingCorrectPointsEqualToAlternativePoints.js +340 -0
  41. package/cypress/e2e/ILC/MultipleSelectionGridNew/Scoring/allOrNothingCorrectPointsGreaterThanAlternativePoints.js +421 -0
  42. package/cypress/e2e/ILC/MultipleSelectionGridNew/editTabScoringSection.js +292 -0
  43. package/cypress/e2e/ILC/MultipleSelectionGridNew/minimumScoringPenaltyPointsAndRoundingDropdown.js +194 -0
  44. package/cypress/e2e/ILC/MultipleSelectionGridNew/previewContentsForAllViews.smoke.js +10 -2
  45. package/cypress/e2e/ILC/MultipleSelectionGridNew/specifyCorrectAnswerSection.js +86 -0
  46. package/cypress/e2e/ILC/MultipleSelectionGridNew/studentViewSettings.js +189 -0
  47. package/cypress/e2e/ILC/SingleSelectionGridNew/Scoring/allOrNothingPenaltyScoring.js +55 -0
  48. package/cypress/e2e/ILC/SingleSelectionGridNew/Scoring/partialDifferentWeightsBasic.js +116 -0
  49. package/cypress/e2e/ILC/SingleSelectionGridNew/Scoring/partialDifferentWeightsMinimumAndPenaltyScoring.js +309 -0
  50. package/cypress/e2e/ILC/SingleSelectionGridNew/Scoring/partialEqualWeightsBasic.js +163 -0
  51. package/cypress/e2e/ILC/SingleSelectionGridNew/editTabScoringSection.js +292 -0
  52. package/cypress/e2e/ILC/SingleSelectionGridNew/minimumScoringPenaltyPointsAndRoundingDropdown.js +194 -0
  53. package/cypress/e2e/ILC/SingleSelectionGridNew/previewContentsForAllViews.smoke.js +10 -2
  54. package/cypress/e2e/ILC/SingleSelectionGridNew/specifyCorrectAnswerSection.js +86 -0
  55. package/cypress/e2e/ILC/SingleSelectionGridNew/studentViewSettings.js +189 -0
  56. package/cypress/e2e/ILC/TextEntryMathWithImage/allOrNothingScoringForAllViews.smoke.js +1 -1
  57. package/cypress/e2e/ILC/ToolSettings/toolSettingsPreviewContents.smoke.js +1 -1
  58. package/cypress/fixtures/drawingToolbarOptionsAdditionalOptionsAndSpecialAndMathCharacters.js +1 -1
  59. package/cypress/fixtures/uploads/sampleVirus.zip +0 -0
  60. package/cypress/pages/audioResponsePage.js +2 -2
  61. package/cypress/pages/components/autoScoredSpecifyCorrectAnswerSection.js +3 -3
  62. package/cypress/pages/components/commonComponents.js +2 -1
  63. package/cypress/pages/components/customizeSpecialCharacterComponent.js +5 -5
  64. package/cypress/pages/components/desmosToolComponent.js +1 -1
  65. package/cypress/pages/components/gridQuestionCommonComponent.js +388 -35
  66. package/cypress/pages/components/maximumRecorderLengthComponent.js +4 -4
  67. package/cypress/pages/components/playbackControlsBaseComponent.js +8 -2
  68. package/cypress/pages/components/scoringSectionBaseEditTab.js +1 -1
  69. package/cypress/pages/contentBlocksPage.js +1 -1
  70. package/cypress/pages/drawingResponsePage.js +9 -10
  71. package/cypress/pages/geoGebraActivityPage.js +2 -1
  72. package/cypress/pages/geoGebraToolsPage.js +1 -1
  73. package/cypress/pages/gridFillPage.js +108 -13
  74. package/cypress/pages/matchingPage.js +154 -2
  75. package/cypress/pages/multipleSelectionGridPage.js +10 -2
  76. package/cypress/pages/rulerPage.js +2 -5
  77. package/cypress/pages/singleSelectionGridPage.js +18 -2
  78. package/package.json +2 -2
@@ -0,0 +1,189 @@
1
+ import { multipleSelectionGridPage } from "../../../pages";
2
+ import abortEarlySetup from "../../../support/helpers/abortEarly";
3
+ import utilities from "../../../support/helpers/utilities";
4
+
5
+ const questionsArray = ['Elephants are the only mammals that can\'t jump', 'Bats are blind and navigate by using echolocation', 'Whale are mammals', 'Tigers can jump upto 3 metres'];
6
+
7
+ describe('Create item page - Multiple selection grid: Student view settings', () => {
8
+ before(() => {
9
+ cy.loginAs('admin');
10
+ });
11
+
12
+ describe('Randomize options : Edit tab', () => {
13
+ abortEarlySetup();
14
+ before(() => {
15
+ multipleSelectionGridPage.steps.navigateToCreateQuestion('multiple selection grid');
16
+ cy.barsPreLoaderWait();
17
+ multipleSelectionGridPage.steps.setRowsAndColumnsForBasicQuestion();
18
+ multipleSelectionGridPage.steps.enterTextInCellPropertyInputField({ row: 3, column: 0 }, 'Whale are mammals');
19
+ multipleSelectionGridPage.steps.enterTextInCellPropertyInputField({ row: 4, column: 0 }, 'Tigers can jump upto 3 metres');
20
+ });
21
+
22
+ multipleSelectionGridPage.tests.verifyStudentViewSettingsLabelAndCSS();
23
+
24
+ it('\'Randomize options\' checkbox and label should be displayed and by default it should be unchecked', () => {
25
+ utilities.verifyInnerText(multipleSelectionGridPage.randomizeOptionsLabel(), 'Randomize options');
26
+ utilities.verifyElementVisibilityState(multipleSelectionGridPage.randomizeOptionsCheckbox(), 'exist');
27
+ multipleSelectionGridPage.steps.verifyRandomizeOptionsCheckboxUnchecked();
28
+ });
29
+
30
+ multipleSelectionGridPage.tests.verifyRandomizeOptionsCheckboxAndLabelUncheckedCSS();
31
+
32
+ it('When the \'Randomize options\' functionality is disabled, the questions and options in the specify correct answer section grid should be displayed in the order in which the user has set them in the "Specify rows and columns" section', () => {
33
+ multipleSelectionGridPage.steps.verifyRandomizeOptionsCheckboxUnchecked();
34
+ questionsArray.forEach((question, rowIndex) => {
35
+ multipleSelectionGridPage.steps.verifyTextInGridCellSpecifyCorrectAnswerSection({ row: rowIndex + 1, column: 0 }, question);
36
+ });
37
+ multipleSelectionGridPage.steps.verifyTextInGridCellSpecifyCorrectAnswerSection({ row: 0, column: 1 }, 'True');
38
+ multipleSelectionGridPage.steps.verifyTextInGridCellSpecifyCorrectAnswerSection({ row: 0, column: 2 }, 'False');
39
+ });
40
+
41
+ it('When the user enables the \'Randomize options\' functionality, then the question stems and options in the specify correct answer section grid should be in the order in which the user has set them in the "Specify rows and columns" section', () => {
42
+ multipleSelectionGridPage.steps.checkRandomizeOptionsCheckbox()
43
+ questionsArray.forEach((question, rowIndex) => {
44
+ multipleSelectionGridPage.steps.verifyTextInGridCellSpecifyCorrectAnswerSection({ row: rowIndex + 1, column: 0 }, question);
45
+ });
46
+ multipleSelectionGridPage.steps.verifyTextInGridCellSpecifyCorrectAnswerSection({ row: 0, column: 1 }, 'True');
47
+ });
48
+
49
+ multipleSelectionGridPage.tests.verifyRandomizeOptionsCheckboxCheckedCSSAndA11y();
50
+ });
51
+
52
+ describe('Randomize options - Functionality: Preview tab', () => {
53
+ let randomizedOptionsString = '';
54
+ abortEarlySetup();
55
+ before(() => {
56
+ multipleSelectionGridPage.steps.navigateToCreateQuestion('multiple selection grid');
57
+ cy.barsPreLoaderWait();
58
+ multipleSelectionGridPage.steps.setRowsAndColumnsForBasicQuestion();
59
+ multipleSelectionGridPage.steps.enterTextInCellPropertyInputField({ row: 3, column: 0 }, 'Whale are mammals');
60
+ multipleSelectionGridPage.steps.enterTextInCellPropertyInputField({ row: 4, column: 0 }, 'Tigers can jump upto 3 metres');
61
+ });
62
+
63
+ it('When the \'Randomize options\' functionality is disabled, the questions and options in the preview tab grid should be displayed in the order in which the user has set them in the "Specify rows and columns" section', () => {
64
+ multipleSelectionGridPage.steps.switchToPreviewTab();
65
+ questionsArray.forEach((question, rowIndex) => {
66
+ multipleSelectionGridPage.steps.verifyTextInGridCellPreviewTab({ row: rowIndex + 1, column: 0 }, question);
67
+ });
68
+ multipleSelectionGridPage.steps.verifyTextInGridCellPreviewTab({ row: 0, column: 1 }, 'True');
69
+ multipleSelectionGridPage.steps.verifyTextInGridCellPreviewTab({ row: 0, column: 2 }, 'False');
70
+ });
71
+
72
+ it('When the user enables the \'Randomize options\' functionality, then the options should be displayed in a random order in the preview tab dropdown', () => {
73
+ multipleSelectionGridPage.steps.switchToEditTab();
74
+ multipleSelectionGridPage.steps.checkRandomizeOptionsCheckbox();
75
+ multipleSelectionGridPage.steps.switchToPreviewTab();
76
+ multipleSelectionGridPage.steps.verifyRandomizeQuestionsOrder(questionsArray);
77
+ randomizedOptionsString = multipleSelectionGridPage.steps.getQuestionsArray();
78
+ });
79
+
80
+ it('When the user switches to \'Edit tab\' and does not modify any question properties, then the order of the questions and options should not change in the preview tab grid', () => {
81
+ multipleSelectionGridPage.steps.resetQuestionPreview();
82
+ randomizedOptionsString.forEach((question, rowIndex) => {
83
+ multipleSelectionGridPage.steps.verifyTextInGridCellPreviewTab({ row: rowIndex + 1, column: 0 }, question);
84
+ });
85
+ });
86
+
87
+ it('When the user switches to \'Edit tab\' and modifies any of question properties, then the order of the questions should change and the options should be displayed in the order in which the user has set them in the preview tab grid', () => {
88
+ multipleSelectionGridPage.steps.switchToEditTab();
89
+ multipleSelectionGridPage.steps.allotPoints(5);
90
+ cy.log('Added wait here to prevent cypress from switching to preview tab just after modifying the question');
91
+ cy.wait(1000);
92
+ multipleSelectionGridPage.steps.switchToPreviewTab();
93
+ multipleSelectionGridPage.steps.verifyRandomizeQuestionsOrder(questionsArray);
94
+ multipleSelectionGridPage.steps.verifyQuestionsAreReRandomized(randomizedOptionsString);
95
+ });
96
+
97
+ it('When the user disables the \'Randomize options\' functionality, then the options should be displayed in the order in which the user has set them in the "Specify rows and columns" section in the preview tab grid', () => {
98
+ multipleSelectionGridPage.steps.switchToEditTab();
99
+ multipleSelectionGridPage.steps.uncheckRandomizeOptionsCheckbox();
100
+ multipleSelectionGridPage.steps.switchToPreviewTab();
101
+ questionsArray.forEach((question, rowIndex) => {
102
+ multipleSelectionGridPage.steps.verifyTextInGridCellPreviewTab({ row: rowIndex + 1, column: 0 }, question);
103
+ });
104
+ });
105
+ });
106
+
107
+ describe('Allow students to check answer: Edit tab', () => {
108
+ abortEarlySetup();
109
+ before(() => {
110
+ multipleSelectionGridPage.steps.navigateToCreateQuestion('multiple selection grid');
111
+ cy.barsPreLoaderWait();
112
+ });
113
+
114
+ multipleSelectionGridPage.tests.verifyAllowStudentsToCheckAnswerLabelAndCheckboxCSS();
115
+
116
+ multipleSelectionGridPage.tests.verifyMaximumAttemptsDropdownDisplayedWhenAllowStudentsToCheckAnswerIsChecked();
117
+
118
+ multipleSelectionGridPage.tests.verifyMaxCheckAnswerAttemptsDropdown();
119
+
120
+ multipleSelectionGridPage.tests.verifyAllowStudentsToCheckAnswerContentsCSSAndA11y();
121
+ });
122
+
123
+ describe('Allow students to check answer: Preview tab', () => {
124
+ abortEarlySetup();
125
+ before(() => {
126
+ multipleSelectionGridPage.steps.navigateToCreateQuestion('multiple selection grid');
127
+ cy.barsPreLoaderWait();
128
+ multipleSelectionGridPage.steps.setRowsAndColumnsForBasicQuestion();
129
+ multipleSelectionGridPage.steps.enterTextInCellPropertyInputField({ row: 3, column: 0 }, 'Whale are mammals');
130
+ multipleSelectionGridPage.steps.enterTextInCellPropertyInputField({ row: 4, column: 0 }, 'Tigers can jump upto 3 metres');
131
+ multipleSelectionGridPage.steps.allotPoints(20);
132
+ multipleSelectionGridPage.steps.setAnswersForAllQuestionStemsInSpecifyCorrectAnswerSection([{ row: 1, column: 0 }, { row: 2, column: 1 }, { row: 3, column: 0 }, { row: 4, column: 1 }]);
133
+ });
134
+
135
+ it('When the user has added questions and specified correct answer and points then on checking the \'Allow students to check answer\' checkbox the Check answer button should be displayed in the preview tab', () => {
136
+ multipleSelectionGridPage.steps.checkAllowStudentToCheckAnswerCheckbox();
137
+ multipleSelectionGridPage.steps.switchToPreviewTab();
138
+ utilities.verifyInnerText(multipleSelectionGridPage.checkAnswerButton(), 'Check answer');
139
+ });
140
+
141
+ it('When the user selects an option and checks the answer then an icon should be displayed beside the selected option and the check answer button should be in enabled state', () => {
142
+ multipleSelectionGridPage.steps.switchToPreviewTab();
143
+ multipleSelectionGridPage.steps.selectOptionsInPreviewTab({ row: 1, column: 0 });
144
+ multipleSelectionGridPage.steps.checkAnswer();
145
+ multipleSelectionGridPage.steps.verifyCorrectOptionBackgroundAndIcon({ row: 1, column: 0 });
146
+ multipleSelectionGridPage.steps.verifyCheckAnswerButtonEnabled();
147
+ });
148
+
149
+ it('When the user selects an option from the Maximum check answer attempts dropdown then the user should be able to check answer only those many times in the preview tab', () => {
150
+ multipleSelectionGridPage.steps.switchToEditTab();
151
+ multipleSelectionGridPage.steps.expandMaxCheckAnswerAttemptsDropdown();
152
+ multipleSelectionGridPage.steps.selectMaxCheckAnswerAttemptsDropdownListOption('1');
153
+ multipleSelectionGridPage.steps.switchToPreviewTab();
154
+ multipleSelectionGridPage.steps.selectOptionsInPreviewTab({ row: 1, column: 0 });
155
+ multipleSelectionGridPage.steps.checkAnswer();
156
+ multipleSelectionGridPage.steps.verifyCheckAnswerButtonDisabled();
157
+ });
158
+
159
+ multipleSelectionGridPage.tests.verifyDisabledCheckAnswerButtonWithCSSAndA11y();
160
+
161
+ it('When the user updates the value of \'Maximum check answer attempts\' dropdown, it should get reflected on the Preview tab', () => {
162
+ multipleSelectionGridPage.steps.switchToEditTab();
163
+ multipleSelectionGridPage.steps.expandMaxCheckAnswerAttemptsDropdown();
164
+ multipleSelectionGridPage.steps.selectMaxCheckAnswerAttemptsDropdownListOption('3');
165
+ multipleSelectionGridPage.steps.switchToPreviewTab();
166
+ multipleSelectionGridPage.steps.verifyCheckAnswerButtonEnabled();
167
+ multipleSelectionGridPage.steps.selectOptionsInPreviewTab({ row: 1, column: 0 });
168
+ multipleSelectionGridPage.steps.checkAnswer();
169
+ multipleSelectionGridPage.steps.verifyCheckAnswerButtonEnabled();
170
+ });
171
+
172
+ it('When the user selects \'No limit\' option from the dropdown then user should be able to check answer multiple times', () => {
173
+ multipleSelectionGridPage.steps.switchToEditTab();
174
+ multipleSelectionGridPage.steps.expandMaxCheckAnswerAttemptsDropdown();
175
+ multipleSelectionGridPage.steps.selectMaxCheckAnswerAttemptsDropdownListOption('no limit');
176
+ multipleSelectionGridPage.steps.switchToPreviewTab();
177
+ multipleSelectionGridPage.steps.verifyCheckAnswerButtonEnabled();
178
+ multipleSelectionGridPage.steps.selectOptionsInPreviewTab({ row: 1, column: 0 });
179
+ multipleSelectionGridPage.steps.checkAnswer();
180
+ multipleSelectionGridPage.steps.verifyCheckAnswerButtonEnabled();
181
+ multipleSelectionGridPage.steps.selectOptionsInPreviewTab({ row: 2, column: 1 });
182
+ multipleSelectionGridPage.steps.checkAnswer();
183
+ multipleSelectionGridPage.steps.verifyCheckAnswerButtonEnabled();
184
+ multipleSelectionGridPage.steps.selectOptionsInPreviewTab({ row: 3, column: 0 });
185
+ multipleSelectionGridPage.steps.checkAnswer();
186
+ multipleSelectionGridPage.steps.verifyCheckAnswerButtonEnabled();
187
+ });
188
+ });
189
+ });
@@ -0,0 +1,55 @@
1
+ import { singleSelectionGridPage } from "../../../../pages";
2
+ import abortEarlySetup from "../../../../support/helpers/abortEarly";
3
+
4
+ describe('Create item page - Single selection grid: All or nothing with alternative answers', () => {
5
+ before(() => {
6
+ cy.loginAs('admin');
7
+ });
8
+
9
+ describe('Question preview: Auto scored - All or nothing: Penalty scoring with \'Round negative score to zero\' unchecked', () => {
10
+ abortEarlySetup();
11
+ before(() => {
12
+ singleSelectionGridPage.steps.navigateToCreateQuestion('single selection grid');
13
+ cy.barsPreLoaderWait();
14
+ singleSelectionGridPage.steps.addTextInQuestionInstructionsInputField('Please select following animals facts are correct or not')
15
+ singleSelectionGridPage.steps.setRowsAndColumnsForBasicQuestion();
16
+ singleSelectionGridPage.steps.enterTextInCellPropertyInputField({ row: 3, column: 0 }, 'Whale are mammals');
17
+ singleSelectionGridPage.steps.enterTextInCellPropertyInputField({ row: 4, column: 0 }, 'Tigers can jump upto 3 metres');
18
+ singleSelectionGridPage.steps.allotPoints(20);
19
+ singleSelectionGridPage.steps.setAnswersForAllQuestionStemsInSpecifyCorrectAnswerSection([{ row: 1, column: 0 }, { row: 2, column: 1 }, { row: 3, column: 0 }, { row: 4, column: 1 }]);
20
+ });
21
+
22
+ //Penalty points for the entire question
23
+ 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', () => {
24
+ singleSelectionGridPage.steps.expandPenaltyScoringDropdown();
25
+ singleSelectionGridPage.steps.selectOptionFromPenaltyScoringDropdown('Penalty points for the entire question');
26
+ singleSelectionGridPage.steps.uncheckRoundNegativeScoresToZeroCheckbox();
27
+ singleSelectionGridPage.steps.allotPenaltyPoints(2);
28
+ singleSelectionGridPage.steps.switchToPreviewTab();
29
+ singleSelectionGridPage.steps.selectOptionsForAllQuestionStemsInPreviewTab([{ row: 1, column: 1 }]);
30
+ singleSelectionGridPage.steps.verifyPreviewScore(-2, 20);
31
+ });
32
+
33
+ it('When the user attempts the question correctly along with an incorrect option, then penalty points should get deducted from the awarded points', () => {
34
+ singleSelectionGridPage.steps.resetQuestionPreview();
35
+ singleSelectionGridPage.steps.selectOptionsForAllQuestionStemsInPreviewTab([{ row: 1, column: 0 }, { row: 1, column: 1 }, { row: 2, column: 1 }, { row: 3, column: 0 }, { row: 4, column: 1 }]);
36
+ singleSelectionGridPage.steps.verifyPreviewScore(-2, 20);
37
+ });
38
+
39
+ it('When the user attempts the question correctly along with multiple incorrect options, 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 options', () => {
40
+ singleSelectionGridPage.steps.resetQuestionPreview();
41
+ singleSelectionGridPage.steps.selectOptionsForAllQuestionStemsInPreviewTab([{ row: 1, column: 0 }, { row: 1, column: 1 }, { row: 2, column: 0 }, { row: 2, column: 1 }, { row: 3, column: 0 }, { row: 4, column: 1 }]);
42
+ singleSelectionGridPage.steps.verifyPreviewScore(-2, 20);
43
+ });
44
+
45
+ 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', () => {
46
+ singleSelectionGridPage.steps.switchToEditTab();
47
+ singleSelectionGridPage.steps.expandMinimumScoringDropdown();
48
+ singleSelectionGridPage.steps.selectOptionFromMinimumScoringDropdown('Award minimum score only if attempted');
49
+ singleSelectionGridPage.steps.allotMinimumPoints(3);
50
+ singleSelectionGridPage.steps.switchToPreviewTab();
51
+ singleSelectionGridPage.steps.selectOptionsForAllQuestionStemsInPreviewTab([{ row: 1, column: 0 }, { row: 1, column: 1 }, { row: 2, column: 1 }, { row: 3, column: 0 }, { row: 4, column: 1 }]);
52
+ singleSelectionGridPage.steps.verifyPreviewScore(3, 20);
53
+ });
54
+ });
55
+ });
@@ -0,0 +1,116 @@
1
+ import { singleSelectionGridPage } from "../../../../pages";
2
+ import abortEarlySetup from "../../../../support/helpers/abortEarly";
3
+
4
+ describe('Create item page - Single selection grid: Partial different weights', () => {
5
+ before(() => {
6
+ cy.loginAs('admin');
7
+ });
8
+
9
+ describe('Auto scored - Partial different weights', () => {
10
+ abortEarlySetup();
11
+ before(() => {
12
+ singleSelectionGridPage.steps.navigateToCreateQuestion('single selection grid');
13
+ cy.barsPreLoaderWait();
14
+ singleSelectionGridPage.steps.addTextInQuestionInstructionsInputField('Please select following animals facts are correct or not')
15
+ singleSelectionGridPage.steps.setRowsAndColumnsForBasicQuestion();
16
+ singleSelectionGridPage.steps.enterTextInCellPropertyInputField({ row: 3, column: 0 }, 'Whale are mammals');
17
+ singleSelectionGridPage.steps.enterTextInCellPropertyInputField({ row: 4, column: 0 }, 'Tigers can jump upto 3 metres');
18
+ singleSelectionGridPage.steps.setAnswersForAllQuestionStemsInSpecifyCorrectAnswerSection([{ row: 1, column: 0 }, { row: 2, column: 1 }, { row: 3, column: 0 }, { row: 4, column: 1 }]);
19
+ singleSelectionGridPage.steps.selectAutoScoredScoringSubtype('Partial different weights');
20
+ singleSelectionGridPage.steps.allotPartialDifferentWeightsPoints({ 0: 9, 1: 6, 2: 3, 3: 2 });
21
+ singleSelectionGridPage.steps.checkAllowStudentsToCheckAnswerCheckbox();
22
+ singleSelectionGridPage.steps.switchToPreviewTab();
23
+ });
24
+
25
+ it('When the user selects \'Grading\' view without attempting the question, correct answers section should be displayed with a preview of the entire grid with correct answers', () => {
26
+ singleSelectionGridPage.steps.verifyPreviewScore(0, 20);
27
+ singleSelectionGridPage.steps.switchToGradingView();
28
+ singleSelectionGridPage.steps.verifyPreviewTabPointsBackgroundForIncorrectOrPartiallyCorrectAnswer();
29
+ singleSelectionGridPage.steps.verifyCorrectAnswerResponses([{ row: 1, column: 0 }, { row: 2, column: 1 }, { row: 3, column: 0 }, { row: 4, column: 1 }]);
30
+ });
31
+
32
+ it('When the user attempts the question incorrectly, then the user should be awarded 0 points and on switching to \'Grading\' view, incorrect icon should be displayed besides all incorrect responses, correct/incorrect status message and correct answer section with a preview of the entire grid with correct answers should be displayed', () => {
33
+ singleSelectionGridPage.steps.selectOptionsForAllQuestionStemsInPreviewTab([{ row: 1, column: 1 }, { row: 2, column: 0 }]);
34
+ singleSelectionGridPage.steps.verifyPreviewScore(0, 20);
35
+ singleSelectionGridPage.steps.switchToGradingView();
36
+ singleSelectionGridPage.steps.verifyIncorrectOptionBackgroundAndIcon({ row: 1, column: 1 });
37
+ singleSelectionGridPage.steps.verifyIncorrectOptionBackgroundAndIcon({ row: 2, column: 0 });
38
+ singleSelectionGridPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
39
+ singleSelectionGridPage.steps.verifyCorrectAnswerResponses([{ row: 1, column: 0 }, { row: 2, column: 1 }, { row: 3, column: 0 }, { row: 4, column: 1 }]);
40
+ singleSelectionGridPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
41
+ cy.log('When the user attempts the question incorrectly and clicks on \'Check answer\' button, then incorrect icons should be displayed besides all incorrect responses, correct/incorrect status message and correct answer section should not be displayed')
42
+ singleSelectionGridPage.steps.checkAnswer();
43
+ singleSelectionGridPage.steps.verifyIncorrectOptionBackgroundAndIcon({ row: 1, column: 1 });
44
+ singleSelectionGridPage.steps.verifyIncorrectOptionBackgroundAndIcon({ row: 2, column: 0 });
45
+ singleSelectionGridPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
46
+ singleSelectionGridPage.steps.verifyCorrectAnswerSectionNotExists();
47
+ });
48
+
49
+ it('When the user attempts the question partially correct with incorrect responses, then the user should be awarded points of the correctly attempted responses and on switching to \'Grading\' view, correct icon should be displayed besides the correct answer responses, incorrect icon should be displayed besides incorrect answer response, correct/incorrect status message should not be displayed and correct answer section with a preview of the entire grid with correct answers should be displayed', () => {
50
+ singleSelectionGridPage.steps.resetQuestionPreview();
51
+ singleSelectionGridPage.steps.selectOptionsForAllQuestionStemsInPreviewTab([{ row: 1, column: 0 }, { row: 2, column: 1 }, { row: 3, column: 1 }, { row: 4, column: 0 }]);
52
+ singleSelectionGridPage.steps.verifyPreviewScore(15, 20);
53
+ singleSelectionGridPage.steps.switchToGradingView();
54
+ singleSelectionGridPage.steps.verifyCorrectOptionBackgroundAndIcon({ row: 1, column: 0 });
55
+ singleSelectionGridPage.steps.verifyCorrectOptionBackgroundAndIcon({ row: 2, column: 1 });
56
+ singleSelectionGridPage.steps.verifyIncorrectOptionBackgroundAndIcon({ row: 3, column: 1 });
57
+ singleSelectionGridPage.steps.verifyIncorrectOptionBackgroundAndIcon({ row: 4, column: 0 });
58
+ singleSelectionGridPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
59
+ singleSelectionGridPage.steps.verifyCorrectAnswerResponses([{ row: 1, column: 0 }, { row: 2, column: 1 }, { row: 3, column: 0 }, { row: 4, column: 1 }]);
60
+ singleSelectionGridPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
61
+ cy.log('When the user attempts the question partially correct with incorrect responses and clicks on \'Check answer\' button, then correct icon should be displayed besides the correct answer responses, incorrect icon should be displayed besides incorrect answer response, correct/incorrect status message and correct answer section should not be displayed')
62
+ singleSelectionGridPage.steps.checkAnswer();
63
+ singleSelectionGridPage.steps.verifyCorrectOptionBackgroundAndIcon({ row: 1, column: 0 });
64
+ singleSelectionGridPage.steps.verifyCorrectOptionBackgroundAndIcon({ row: 2, column: 1 });
65
+ singleSelectionGridPage.steps.verifyIncorrectOptionBackgroundAndIcon({ row: 3, column: 1 });
66
+ singleSelectionGridPage.steps.verifyIncorrectOptionBackgroundAndIcon({ row: 4, column: 0 });
67
+ singleSelectionGridPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
68
+ singleSelectionGridPage.steps.verifyCorrectAnswerSectionNotExists();
69
+ });
70
+
71
+ it('When the user attempts the question partially correct with incomplete responses, then the user should be awarded points of the correctly attempted responses and on switching to \'Grading\' view, correct icon should be displayed besides the correct answer responses, incorrect icon should be displayed besides incorrect answer response, correct/incorrect status message should not be displayed and correct answer section with a preview of the entire grid with correct answers should be displayed', () => {
72
+ singleSelectionGridPage.steps.resetQuestionPreview();
73
+ singleSelectionGridPage.steps.selectOptionsForAllQuestionStemsInPreviewTab([{ row: 1, column: 0 }, { row: 2, column: 1 }]);
74
+ singleSelectionGridPage.steps.verifyPreviewScore(15, 20);
75
+ singleSelectionGridPage.steps.switchToGradingView();
76
+ singleSelectionGridPage.steps.verifyCorrectOptionBackgroundAndIcon({ row: 1, column: 0 });
77
+ singleSelectionGridPage.steps.verifyCorrectOptionBackgroundAndIcon({ row: 2, column: 1 });
78
+ singleSelectionGridPage.steps.verifyCorrectIncorrectIconNotExists({ row: 3, column: 0 });
79
+ singleSelectionGridPage.steps.verifyCorrectIncorrectIconNotExists({ row: 4, column: 1 });
80
+ singleSelectionGridPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
81
+ singleSelectionGridPage.steps.verifyCorrectAnswerResponses([{ row: 1, column: 0 }, { row: 2, column: 1 }, { row: 3, column: 0 }, { row: 4, column: 1 }]);
82
+ singleSelectionGridPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
83
+ cy.log('When the user attempts the question partially correct with incomplete responses and clicks on \'Check answer\' button, then correct icon should be displayed besides the correct answer responses, incorrect icon should be displayed besides incorrect answer response, correct/incorrect status message and correct answer section should not be displayed')
84
+ singleSelectionGridPage.steps.checkAnswer();
85
+ singleSelectionGridPage.steps.verifyCorrectOptionBackgroundAndIcon({ row: 1, column: 0 });
86
+ singleSelectionGridPage.steps.verifyCorrectOptionBackgroundAndIcon({ row: 2, column: 1 });
87
+ singleSelectionGridPage.steps.verifyCorrectIncorrectIconNotExists({ row: 3, column: 0 });
88
+ singleSelectionGridPage.steps.verifyCorrectIncorrectIconNotExists({ row: 4, column: 1 });
89
+ singleSelectionGridPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
90
+ singleSelectionGridPage.steps.verifyCorrectAnswerSectionNotExists();
91
+ });
92
+
93
+ it('When user attempts the question correctly, the user should be awarded full points and on switching to \'Grading\' view, then correct icons should be displayed beside all the correct responses, correct/incorrect status message and correct answer section should not be displayed', () => {
94
+ singleSelectionGridPage.steps.resetQuestionPreview();
95
+ singleSelectionGridPage.steps.selectOptionsForAllQuestionStemsInPreviewTab([{ row: 1, column: 0 }, { row: 2, column: 1 }, { row: 3, column: 0 }, { row: 4, column: 1 }]);
96
+ singleSelectionGridPage.steps.verifyPreviewScore(20, 20);
97
+ singleSelectionGridPage.steps.switchToGradingView();
98
+ singleSelectionGridPage.steps.verifyPreviewTabPointsBackgroundForCorrectAnswer();
99
+ singleSelectionGridPage.steps.verifyCorrectOptionBackgroundAndIcon({ row: 1, column: 0 });
100
+ singleSelectionGridPage.steps.verifyCorrectOptionBackgroundAndIcon({ row: 2, column: 1 });
101
+ singleSelectionGridPage.steps.verifyCorrectOptionBackgroundAndIcon({ row: 3, column: 0 });
102
+ singleSelectionGridPage.steps.verifyCorrectOptionBackgroundAndIcon({ row: 4, column: 1 });
103
+ singleSelectionGridPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
104
+ singleSelectionGridPage.steps.verifyCorrectAnswerSectionNotExists();
105
+ singleSelectionGridPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
106
+ cy.log('When user clicks on Check answer button after he attempts the question correctly, then correct icon should be displayed besides the correct answer responses, correct/incorrect status message and correct answer section should not be displayed')
107
+ singleSelectionGridPage.steps.checkAnswer();
108
+ singleSelectionGridPage.steps.verifyCorrectOptionBackgroundAndIcon({ row: 1, column: 0 });
109
+ singleSelectionGridPage.steps.verifyCorrectOptionBackgroundAndIcon({ row: 2, column: 1 });
110
+ singleSelectionGridPage.steps.verifyCorrectOptionBackgroundAndIcon({ row: 3, column: 0 });
111
+ singleSelectionGridPage.steps.verifyCorrectOptionBackgroundAndIcon({ row: 4, column: 1 });
112
+ singleSelectionGridPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
113
+ singleSelectionGridPage.steps.verifyCorrectAnswerSectionNotExists();
114
+ });
115
+ });
116
+ });