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,258 @@
1
+ import { gridFillPage } from "../../../../pages";
2
+ import abortEarlySetup from "../../../../support/helpers/abortEarly";
3
+
4
+ describe('Create item page - Grid fill : Partial equal weights with alternative answers', () => {
5
+ before(() => {
6
+ cy.loginAs('admin');
7
+ });
8
+
9
+ describe('Question preview: Auto scored - Partial equal weights with alternative answer - When \'Correct answer\' points are more than \'Alternative answer\' points', () => {
10
+ abortEarlySetup();
11
+ before(() => {
12
+ gridFillPage.steps.navigateToCreateQuestion('grid fill');
13
+ cy.barsPreLoaderWait();
14
+ gridFillPage.steps.allotPoints(15);
15
+ gridFillPage.steps.selectCellSpecifyCorrectAnswerSection(0, 0);
16
+ gridFillPage.steps.selectCellSpecifyCorrectAnswerSection(0, 1);
17
+ gridFillPage.steps.selectCellSpecifyCorrectAnswerSection(0, 2);
18
+ gridFillPage.steps.selectAutoScoredScoringSubtype('Partial equal weights');
19
+ gridFillPage.steps.addAlternativeAnswerAccordion(1);
20
+ gridFillPage.steps.selectCellSpecifyCorrectAnswerSection(0, 2);
21
+ gridFillPage.steps.selectCellSpecifyCorrectAnswerSection(0, 3);
22
+ gridFillPage.steps.selectCellSpecifyCorrectAnswerSection(0, 4);
23
+ gridFillPage.steps.allotPoints(9);
24
+ gridFillPage.steps.checkAllowStudentToCheckAnswerCheckbox();
25
+ gridFillPage.steps.switchToPreviewTab();
26
+ });
27
+
28
+ it('When the user selects \'Grading\' view without attempting the question, correct icons should be displayed in responses from the correct accordion', () => {
29
+ gridFillPage.steps.switchToGradingView();
30
+ gridFillPage.steps.verifyCorrectResponseIcon(0, 0);
31
+ gridFillPage.steps.verifyResponseCellHasDefaultBackgroundColor(0, 0);
32
+ gridFillPage.steps.verifyCorrectResponseBorder(0, 0);
33
+ gridFillPage.steps.verifyCorrectResponseIcon(0, 1);
34
+ gridFillPage.steps.verifyResponseCellHasDefaultBackgroundColor(0, 1);
35
+ gridFillPage.steps.verifyCorrectResponseBorder(0, 1);
36
+ gridFillPage.steps.verifyCorrectResponseIcon(0, 2);
37
+ gridFillPage.steps.verifyResponseCellHasDefaultBackgroundColor(0, 2);
38
+ gridFillPage.steps.verifyCorrectResponseBorder(0, 2);
39
+ gridFillPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
40
+ });
41
+
42
+ it('When the user attempts the question with responses from the correct accordion, then the user should be awarded full points and on switching to \'Grading\' view, correct icons should be displayed in responses from correct accordion and correct/incorrect answer status message should not be displayed', () => {
43
+ gridFillPage.steps.resetQuestionPreview();
44
+ gridFillPage.steps.selectCellPreviewTab(0, 0);
45
+ gridFillPage.steps.selectCellPreviewTab(0, 1);
46
+ gridFillPage.steps.selectCellPreviewTab(0, 2);
47
+ gridFillPage.steps.verifyPreviewScore(15, 15);
48
+ gridFillPage.steps.switchToGradingView();
49
+ gridFillPage.steps.verifyCorrectResponseIcon(0, 0);
50
+ gridFillPage.steps.verifyCorrectResponseBorderAndBackgroundColor(0, 0);
51
+ gridFillPage.steps.verifyCorrectResponseIcon(0, 1);
52
+ gridFillPage.steps.verifyCorrectResponseBorderAndBackgroundColor(0, 1);
53
+ gridFillPage.steps.verifyCorrectResponseIcon(0, 2);
54
+ gridFillPage.steps.verifyCorrectResponseBorderAndBackgroundColor(0, 2);
55
+ gridFillPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
56
+ gridFillPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
57
+ cy.log('When the user has attempted the question with responses from the correct accordion and clicks on \'Check answer\' button, then correct icon should be displayed in responses from correct accordion, correct/incorrect answer status message should not be displayed')
58
+ gridFillPage.steps.checkAnswer();
59
+ gridFillPage.steps.verifyCorrectResponseIcon(0, 0);
60
+ gridFillPage.steps.verifyCorrectResponseBorderAndBackgroundColor(0, 0);
61
+ gridFillPage.steps.verifyCorrectResponseIcon(0, 1);
62
+ gridFillPage.steps.verifyCorrectResponseBorderAndBackgroundColor(0, 1);
63
+ gridFillPage.steps.verifyCorrectResponseIcon(0, 2);
64
+ gridFillPage.steps.verifyCorrectResponseBorderAndBackgroundColor(0, 2);
65
+ gridFillPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
66
+ });
67
+
68
+ it('When the user attempts the question with responses from the alternative accordion, then the user should be awarded with points specified for alternative accordion (less than full points) and on switching to \'Grading\' view, correct icons should be displayed in responses from alternative accordion, correct/incorrect status message should not be displayed', () => {
69
+ gridFillPage.steps.resetQuestionPreview();
70
+ gridFillPage.steps.selectCellPreviewTab(0, 2);
71
+ gridFillPage.steps.selectCellPreviewTab(0, 3);
72
+ gridFillPage.steps.selectCellPreviewTab(0, 4);
73
+ gridFillPage.steps.verifyPreviewScore(9, 15);
74
+ gridFillPage.steps.switchToGradingView();
75
+ gridFillPage.steps.verifyCorrectResponseIcon(0, 2);
76
+ gridFillPage.steps.verifyCorrectResponseBorderAndBackgroundColor(0, 2);
77
+ gridFillPage.steps.verifyCorrectResponseIcon(0, 3);
78
+ gridFillPage.steps.verifyCorrectResponseBorderAndBackgroundColor(0, 3);
79
+ gridFillPage.steps.verifyCorrectResponseIcon(0, 4);
80
+ gridFillPage.steps.verifyCorrectResponseBorderAndBackgroundColor(0, 4);
81
+ gridFillPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
82
+ gridFillPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
83
+ cy.log('When the user has attempted the question with responses from the alternative accordion and clicks on \'Check answer\' button, then correct icon should be displayed in responses from alternative accordion and correct/incorrect status message should not be displayed')
84
+ gridFillPage.steps.checkAnswer();
85
+ gridFillPage.steps.verifyCorrectResponseIcon(0, 2);
86
+ gridFillPage.steps.verifyCorrectResponseBorderAndBackgroundColor(0, 2);
87
+ gridFillPage.steps.verifyCorrectResponseIcon(0, 3);
88
+ gridFillPage.steps.verifyCorrectResponseBorderAndBackgroundColor(0, 3);
89
+ gridFillPage.steps.verifyCorrectResponseIcon(0, 4);
90
+ gridFillPage.steps.verifyCorrectResponseBorderAndBackgroundColor(0, 4);
91
+ gridFillPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
92
+ });
93
+
94
+ it('When the user attempts the question with partially correct options exclusively from the correct accordion, then the user should be awarded points of the correctly attempted response and on switching to \'Grading\' view, correct icon should be displayed in the selected responses and only correct icon should be displayed in unselected responses from correct accordion and correct/incorrect status message should not be displayed', () => {
95
+ gridFillPage.steps.resetQuestionPreview();
96
+ gridFillPage.steps.selectCellPreviewTab(0, 0);
97
+ gridFillPage.steps.selectCellPreviewTab(0, 1);
98
+ gridFillPage.steps.verifyPreviewScore(10, 15);
99
+ gridFillPage.steps.switchToGradingView();
100
+ gridFillPage.steps.verifyCorrectResponseIcon(0, 0);
101
+ gridFillPage.steps.verifyCorrectResponseBorderAndBackgroundColor(0, 0);
102
+ gridFillPage.steps.verifyCorrectResponseIcon(0, 1);
103
+ gridFillPage.steps.verifyCorrectResponseBorderAndBackgroundColor(0, 1);
104
+ gridFillPage.steps.verifyCorrectResponseIcon(0, 2);
105
+ gridFillPage.steps.verifyResponseCellHasDefaultBackgroundColor(0, 2);
106
+ gridFillPage.steps.verifyCorrectResponseBorder(0, 2);
107
+ gridFillPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
108
+ gridFillPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
109
+ cy.log('When the user has attempted the question with partially correct options exclusively from the correct accordion and clicks on \'Check answer\' button, then correct icon should be displayed in responses from correct accordion, correct/incorrect status message should not be displayed')
110
+ gridFillPage.steps.checkAnswer();
111
+ gridFillPage.steps.verifyCorrectResponseIcon(0, 0);
112
+ gridFillPage.steps.verifyCorrectResponseBorderAndBackgroundColor(0, 0);
113
+ gridFillPage.steps.verifyCorrectResponseIcon(0, 1);
114
+ gridFillPage.steps.verifyCorrectResponseBorderAndBackgroundColor(0, 1);
115
+ gridFillPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
116
+ });
117
+
118
+ it('When the user attempts the question with partially correct options exclusively from the alternative accordion, then the user should be awarded points of the correctly attempted response and on switching to \'Grading\' view, correct icon should be displayed in the selected responses from alternative accordion and correct/incorrect status message should not be displayed', () => {
119
+ gridFillPage.steps.resetQuestionPreview();
120
+ gridFillPage.steps.selectCellPreviewTab(0, 3);
121
+ gridFillPage.steps.selectCellPreviewTab(0, 4);
122
+ gridFillPage.steps.verifyPreviewScore(6, 15);
123
+ gridFillPage.steps.switchToGradingView();
124
+ gridFillPage.steps.verifyCorrectResponseIcon(0, 2);
125
+ gridFillPage.steps.verifyResponseCellHasDefaultBackgroundColor(0, 2);
126
+ gridFillPage.steps.verifyCorrectResponseBorder(0, 2);
127
+ gridFillPage.steps.verifyCorrectResponseIcon(0, 3);
128
+ gridFillPage.steps.verifyCorrectResponseBorderAndBackgroundColor(0, 3);
129
+ gridFillPage.steps.verifyCorrectResponseIcon(0, 4);
130
+ gridFillPage.steps.verifyCorrectResponseBorderAndBackgroundColor(0, 4);
131
+ gridFillPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
132
+ gridFillPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
133
+ cy.log('When the user has attempted the question with partially correct options exclusively from the alternative accordion and clicks on \'Check answer\' button, then correct icon should be displayed in the selected responses from alternative accordion and correct/incorrect status message should not be displayed');
134
+ gridFillPage.steps.checkAnswer();
135
+ gridFillPage.steps.verifyCorrectResponseIcon(0, 3);
136
+ gridFillPage.steps.verifyCorrectResponseBorderAndBackgroundColor(0, 3);
137
+ gridFillPage.steps.verifyCorrectResponseIcon(0, 4);
138
+ gridFillPage.steps.verifyCorrectResponseBorderAndBackgroundColor(0, 4);
139
+ gridFillPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
140
+ });
141
+
142
+ it('When the user has attempted the question with equal number of correct responses from correct and alternative accordion, then the user should be awarded with points of the correctly attempted response and on switching to \'Grading\' view, correct icon should be displayed in response from the correct accordion, incorrect icon should be displayed in response from the alternative accordion, correct/incorrect status message should not be displayed', () => {
143
+ gridFillPage.steps.resetQuestionPreview();
144
+ gridFillPage.steps.selectCellPreviewTab(0, 0);
145
+ gridFillPage.steps.selectCellPreviewTab(0, 4);
146
+ gridFillPage.steps.verifyPreviewScore(5, 15);
147
+ gridFillPage.steps.switchToGradingView();
148
+ gridFillPage.steps.verifyCorrectResponseIcon(0, 0);
149
+ gridFillPage.steps.verifyCorrectResponseBorderAndBackgroundColor(0, 0);
150
+ gridFillPage.steps.verifyCorrectResponseIcon(0, 1);
151
+ gridFillPage.steps.verifyCorrectResponseBorder(0, 1);
152
+ gridFillPage.steps.verifyResponseCellHasDefaultBackgroundColor(0, 1);
153
+ gridFillPage.steps.verifyCorrectResponseIcon(0, 2);
154
+ gridFillPage.steps.verifyCorrectResponseBorder(0, 2);
155
+ gridFillPage.steps.verifyResponseCellHasDefaultBackgroundColor(0, 2);
156
+ gridFillPage.steps.verifyIncorrectResponseIcon(0, 4);
157
+ gridFillPage.steps.verifyIncorrectResponseBorderAndBackgroundColor(0, 4);
158
+ gridFillPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
159
+ gridFillPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
160
+ cy.log('When the user has attempted the question with equal number of correct responses from correct and alternative accordion and clicks on \'Check answer\' button, then correct icon should be displayed in the correct answer responses, incorrect icon should be displayed in unselected cells and correct/incorrect status message should not be displayed');
161
+ gridFillPage.steps.checkAnswer();
162
+ gridFillPage.steps.verifyCorrectResponseIcon(0, 0);
163
+ gridFillPage.steps.verifyCorrectResponseBorderAndBackgroundColor(0, 0);
164
+ gridFillPage.steps.verifyIncorrectResponseIcon(0, 4);
165
+ gridFillPage.steps.verifyIncorrectResponseBorderAndBackgroundColor(0, 4);
166
+ gridFillPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
167
+ });
168
+
169
+ it('Race condition : When the user attempts the question with the common response between correct and alternative accordion, then the user should be awarded with points of the correctly attempted response and on switching to \'Grading\' view, correct icon should be in the common response, correct icons should be displayed in responses from correct accordion should be displayed in unselected cells and correct/incorrect status message should not be displayed', () => {
170
+ gridFillPage.steps.resetQuestionPreview();
171
+ gridFillPage.steps.selectCellPreviewTab(0, 2);
172
+ gridFillPage.steps.verifyPreviewScore(5, 15);
173
+ gridFillPage.steps.switchToGradingView();
174
+ gridFillPage.steps.verifyCorrectResponseIcon(0, 0);
175
+ gridFillPage.steps.verifyCorrectResponseBorder(0, 0);
176
+ gridFillPage.steps.verifyResponseCellHasDefaultBackgroundColor(0, 0);
177
+ gridFillPage.steps.verifyCorrectResponseIcon(0, 1);
178
+ gridFillPage.steps.verifyCorrectResponseBorder(0, 1);
179
+ gridFillPage.steps.verifyResponseCellHasDefaultBackgroundColor(0, 1);
180
+ gridFillPage.steps.verifyCorrectResponseIcon(0, 2);
181
+ gridFillPage.steps.verifyCorrectResponseBorderAndBackgroundColor(0, 2);
182
+ gridFillPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
183
+ gridFillPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
184
+ cy.log('When the user has attempted the question with common response between correct and alternative accordion and clicks on \'Check answer\' button, then correct icon should be displayed in the correct answer response, no icon should be displayed in unselected cells and correct/incorrect status message should not be displayed')
185
+ gridFillPage.steps.checkAnswer();
186
+ gridFillPage.steps.verifyCorrectResponseIcon(0, 2);
187
+ gridFillPage.steps.verifyCorrectResponseBorderAndBackgroundColor(0, 2);
188
+ gridFillPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
189
+ });
190
+
191
+ it('When the user attempts the question incorrectly, then the user should be awarded 0 points and on switching to \'Grading\' view, incorrect icons should be displayed in incorrect response, correct icons should be displayed in responses from the correct accordion and correct/incorrect status message should not be displayed', () => {
192
+ gridFillPage.steps.resetQuestionPreview();
193
+ gridFillPage.steps.selectCellPreviewTab(1, 1);
194
+ gridFillPage.steps.verifyPreviewScore(0, 15);
195
+ gridFillPage.steps.switchToGradingView();
196
+ gridFillPage.steps.verifyCorrectResponseIcon(0, 0);
197
+ gridFillPage.steps.verifyCorrectResponseBorder(0, 0);
198
+ gridFillPage.steps.verifyResponseCellHasDefaultBackgroundColor(0, 0);
199
+ gridFillPage.steps.verifyCorrectResponseIcon(0, 1);
200
+ gridFillPage.steps.verifyCorrectResponseBorder(0, 1);
201
+ gridFillPage.steps.verifyResponseCellHasDefaultBackgroundColor(0, 1);
202
+ gridFillPage.steps.verifyCorrectResponseIcon(0, 2);
203
+ gridFillPage.steps.verifyCorrectResponseBorder(0, 2);
204
+ gridFillPage.steps.verifyResponseCellHasDefaultBackgroundColor(0, 2);
205
+ gridFillPage.steps.verifyIncorrectResponseIcon(1, 1);
206
+ gridFillPage.steps.verifyIncorrectResponseBorderAndBackgroundColor(1, 1);
207
+ gridFillPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
208
+ gridFillPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
209
+ cy.log('When the user has attempted the question incorrectly and clicks on \'Check answer\' button, then incorrect icons should be displayed besides all incorrect responses and correct/incorrect status message should not be displayed')
210
+ gridFillPage.steps.checkAnswer();
211
+ gridFillPage.steps.verifyIncorrectResponseIcon(1, 1);
212
+ gridFillPage.steps.verifyIncorrectResponseBorderAndBackgroundColor(1, 1);
213
+ gridFillPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
214
+ });
215
+
216
+ it('Overachiever case: When the user attempts the question with more number of correct responses from the alternate tab than the correct accordion but the score of the individual response selected from the correct accordion overpowers the combined score of the alternate tab answers then on switching to the \'Grading view\', then points awarded should be of the correct accordion, green check-mark icons should be displayed for the correct accordion response, red cross-mark icon should be displayed for the alternate tab responses, correct/incorrect answer label and its border should not be displayed and correct answer container should be displayed with correct accordion answers for the responses marked incorrect', () => {
217
+ cy.log('Pre-step: Switching to Edit tab and allotting points to alternate tab such that the difference between the points is substantial and the points per response are in decimal')
218
+ gridFillPage.steps.switchToEditTab();
219
+ gridFillPage.steps.deleteAlternativeAnswerAccordion(0);
220
+ gridFillPage.steps.addAlternativeAnswerAccordion(1);
221
+ gridFillPage.steps.selectCellSpecifyCorrectAnswerSection(0, 3);
222
+ gridFillPage.steps.selectCellSpecifyCorrectAnswerSection(0, 4);
223
+ gridFillPage.steps.selectCellSpecifyCorrectAnswerSection(1, 0);
224
+ gridFillPage.steps.allotPoints(8);
225
+ gridFillPage.steps.expandCorrectAnswerAccordion();
226
+ gridFillPage.steps.allotPoints(23);
227
+ gridFillPage.steps.switchToPreviewTab();
228
+ gridFillPage.steps.selectCellPreviewTab(0, 0);
229
+ gridFillPage.steps.selectCellPreviewTab(0, 3);
230
+ gridFillPage.steps.selectCellPreviewTab(0, 4);
231
+ gridFillPage.steps.verifyPreviewScore(7.67, 23);
232
+ gridFillPage.steps.switchToGradingView();
233
+ gridFillPage.steps.verifyCorrectResponseIcon(0, 0);
234
+ gridFillPage.steps.verifyCorrectResponseBorderAndBackgroundColor(0, 0);
235
+ gridFillPage.steps.verifyCorrectResponseIcon(0, 1);
236
+ gridFillPage.steps.verifyCorrectResponseBorder(0, 1);
237
+ gridFillPage.steps.verifyResponseCellHasDefaultBackgroundColor(0, 1);
238
+ gridFillPage.steps.verifyCorrectResponseIcon(0, 2);
239
+ gridFillPage.steps.verifyCorrectResponseBorder(0, 2);
240
+ gridFillPage.steps.verifyResponseCellHasDefaultBackgroundColor(0, 2);
241
+ gridFillPage.steps.verifyIncorrectResponseIcon(0, 3);
242
+ gridFillPage.steps.verifyIncorrectResponseBorderAndBackgroundColor(0, 3);
243
+ gridFillPage.steps.verifyIncorrectResponseIcon(0, 4);
244
+ gridFillPage.steps.verifyIncorrectResponseBorderAndBackgroundColor(0, 4);
245
+ gridFillPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
246
+ gridFillPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
247
+ cy.log('When user attempts the question correctly and clicks on the \'Check answer\' button, green check-mark icons should be displayed beside the correct responses from the correct accordion, red cross-mark icons should be displayed beside the incorrectly answered responses, correct/incorrect answer label and its border, correct answer container should not be displayed')
248
+ gridFillPage.steps.checkAnswer();
249
+ gridFillPage.steps.verifyCorrectResponseIcon(0, 0);
250
+ gridFillPage.steps.verifyCorrectResponseBorderAndBackgroundColor(0, 0);
251
+ gridFillPage.steps.verifyIncorrectResponseIcon(0, 3);
252
+ gridFillPage.steps.verifyIncorrectResponseBorderAndBackgroundColor(0, 3);
253
+ gridFillPage.steps.verifyIncorrectResponseIcon(0, 4);
254
+ gridFillPage.steps.verifyIncorrectResponseBorderAndBackgroundColor(0, 4);
255
+ gridFillPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
256
+ });
257
+ });
258
+ });
@@ -0,0 +1,206 @@
1
+ import { gridFillPage } from "../../../pages";
2
+ import abortEarlySetup from "../../../support/helpers/abortEarly";
3
+ import utilities from "../../../support/helpers/utilities";
4
+ const css = Cypress.env('css');
5
+
6
+ describe('Create item page - Grid fill: Student view settings', () => {
7
+ before(() => {
8
+ cy.loginAs('admin');
9
+ });
10
+
11
+ describe('Grid fill : Student view settings : Edit tab', () => {
12
+ abortEarlySetup();
13
+ before(() => {
14
+ gridFillPage.steps.navigateToCreateQuestion('grid fill');
15
+ cy.barsPreLoaderWait();
16
+ });
17
+
18
+ gridFillPage.tests.verifyStudentViewSettingsLabelAndCSS();
19
+
20
+ it('Max selected cells label and input field should be displayed', () => {
21
+ utilities.verifyInnerText(gridFillPage.maxSelectedCellLabel(), 'Max selected cells');
22
+ utilities.verifyElementVisibilityState(gridFillPage.maxSelectedCellLabel(), 'visible');
23
+ utilities.verifyInnerText(gridFillPage.maxSelectedCellInputField(), '');
24
+ });
25
+
26
+ it('User should be able to enter text in Max selected cells input field', () => {
27
+ gridFillPage.steps.enterTextInMaxSelectedCellInputField(5);
28
+ gridFillPage.steps.VerifyTextInMaxSelectedCellInputField(5);
29
+ });
30
+
31
+ it('When user tries to enter a value more than total cells of grid selected in grid layout, then value should reset to maximum cell count', () => {
32
+ gridFillPage.steps.verifyColumnsInputField(5);
33
+ gridFillPage.steps.verifyRowsInputField(3);
34
+ gridFillPage.steps.enterTextInMaxSelectedCellInputField(16);
35
+ gridFillPage.steps.VerifyTextInMaxSelectedCellInputField(15);
36
+ });
37
+
38
+ it('When user tries to enter zero in max selected cells, then value should reset to 1', () => {
39
+ gridFillPage.steps.enterTextInMaxSelectedCellInputField(0);
40
+ gridFillPage.steps.VerifyTextInMaxSelectedCellInputField(1);
41
+ });
42
+
43
+ it('CSS of max cell selected label and input field', () => {
44
+ utilities.verifyCSS(gridFillPage.maxSelectedCellLabel(), {
45
+ 'color': css.color.labels,
46
+ 'font-size': css.fontSize.normal,
47
+ 'font-weight': css.fontWeight.semibold
48
+ });
49
+ utilities.verifyCSS(gridFillPage.maxSelectedCellInputField(), {
50
+ 'color': css.color.text,
51
+ 'font-size': css.fontSize.default,
52
+ 'font-weight': css.fontWeight.regular
53
+ });
54
+ });
55
+
56
+ gridFillPage.tests.verifyAllowStudentsToCheckAnswerLabelAndCheckboxCSS();
57
+
58
+ gridFillPage.tests.verifyMaximumAttemptsDropdownDisplayedWhenAllowStudentsToCheckAnswerIsChecked();
59
+
60
+ gridFillPage.tests.verifyMaxCheckAnswerAttemptsDropdown();
61
+
62
+ gridFillPage.tests.verifyAllowStudentsToCheckAnswerContentsCSSAndA11y();
63
+ });
64
+
65
+ describe('Max cell selected: Preview tab', () => {
66
+ abortEarlySetup();
67
+ before(() => {
68
+ gridFillPage.steps.navigateToCreateQuestion('grid fill');
69
+ cy.barsPreLoaderWait();
70
+ gridFillPage.steps.addTextInQuestionInstructionsInputField('Question');
71
+ gridFillPage.steps.allotPoints(10);
72
+ });
73
+
74
+ it('When max selected cells input field is empty then user should be able to select any number of cells', () => {
75
+ utilities.verifyInnerText(gridFillPage.maxSelectedCellInputField(), '');
76
+ gridFillPage.steps.switchToPreviewTab();
77
+ for (var index = 0; index < 5; index++) {
78
+ gridFillPage.steps.selectCellPreviewTab(0, index);
79
+ }
80
+ gridFillPage.steps.verifySelectedCellCountPreviewTab(5);
81
+ });
82
+
83
+ it('When user enter value in max selected cells input field, then user should be able to select cells of number equal to max selected cells count', () => {
84
+ gridFillPage.steps.switchToEditTab();
85
+ gridFillPage.steps.enterTextInMaxSelectedCellInputField(3);
86
+ gridFillPage.steps.VerifyTextInMaxSelectedCellInputField(3);
87
+ gridFillPage.steps.switchToPreviewTab();
88
+ for (var index = 0; index < 3; index++) {
89
+ gridFillPage.steps.selectCellPreviewTab(0, index);
90
+ }
91
+ gridFillPage.steps.verifySelectedCellCountPreviewTab(3);
92
+ });
93
+
94
+ it('When user updates max selected cells input value then it should be updated in preview tab', () => {
95
+ gridFillPage.steps.switchToEditTab();
96
+ gridFillPage.steps.enterTextInMaxSelectedCellInputField(2);
97
+ gridFillPage.steps.VerifyTextInMaxSelectedCellInputField(2);
98
+ gridFillPage.steps.switchToPreviewTab();
99
+ for (var index = 0; index < 2; index++) {
100
+ gridFillPage.steps.selectCellPreviewTab(0, index);
101
+ }
102
+ gridFillPage.steps.verifySelectedCellCountPreviewTab(2);
103
+ });
104
+
105
+ it('When user tries to select cells more than max selected cell count then warning message \'Maximum # cells can be selected\' should be displayed', () => {
106
+ gridFillPage.steps.resetQuestionPreview();
107
+ for (var index = 0; index < 4; index++) {
108
+ gridFillPage.steps.selectCellPreviewTab(0, index);
109
+ }
110
+ utilities.verifyInnerText(gridFillPage.warningMessage(), 'Maximum 2 cells can be selected');
111
+ utilities.verifyElementVisibilityState(gridFillPage.warningMessage(), 'visible');
112
+ gridFillPage.steps.verifySelectedCellCountPreviewTab(2);
113
+ });
114
+
115
+ it('CSS of warning message', { tags: 'css' }, () => {
116
+ utilities.verifyCSS(gridFillPage.WarningMessage().find('.min-max-answer-error-text'), {
117
+ 'color': css.color.warningText,
118
+ 'font-size': css.fontSize.normal,
119
+ 'font-weight': css.fontWeight.bold
120
+ });
121
+ });
122
+
123
+ it('Accessibility of warning message in Edit tab', { tags: 'a11y' }, () => {
124
+ cy.checkAccessibility(gridFillPage.WarningMessage());
125
+ });
126
+
127
+ gridFillPage.tests.verifyWarningMessageDisappear();
128
+ });
129
+
130
+ describe('Allow students to check answer: Preview tab', () => {
131
+ abortEarlySetup();
132
+ before(() => {
133
+ gridFillPage.steps.navigateToCreateQuestion('grid fill');
134
+ cy.barsPreLoaderWait();
135
+ gridFillPage.steps.addTextInQuestionInstructionsInputField('Question');
136
+ gridFillPage.steps.allotPoints(10);
137
+ gridFillPage.steps.selectCellSpecifyCorrectAnswerSection(0, 0);
138
+ gridFillPage.steps.selectCellSpecifyCorrectAnswerSection(0, 1);
139
+ });
140
+
141
+ it('When the user has added options 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', () => {
142
+ gridFillPage.steps.checkAllowStudentToCheckAnswerCheckbox();
143
+ gridFillPage.steps.switchToPreviewTab();
144
+ utilities.verifyInnerText(gridFillPage.checkAnswerButton(), 'Check answer');
145
+ });
146
+
147
+ it('When the user selects response in grid and checks the answer then an icon should be displayed in the selected response and the check answer button should be in enabled state', () => {
148
+ gridFillPage.steps.switchToPreviewTab();
149
+ gridFillPage.steps.selectCellPreviewTab(0, 0);
150
+ gridFillPage.steps.checkAnswer();
151
+ gridFillPage.steps.verifyCorrectResponseIcon(0, 0);
152
+ gridFillPage.steps.verifyCheckAnswerButtonEnabled();
153
+ });
154
+
155
+ 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', () => {
156
+ gridFillPage.steps.switchToEditTab();
157
+ gridFillPage.steps.expandMaxCheckAnswerAttemptsDropdown();
158
+ gridFillPage.steps.selectMaxCheckAnswerAttemptsDropdownListOption('1');
159
+ gridFillPage.steps.switchToPreviewTab();
160
+ gridFillPage.steps.selectCellPreviewTab(0, 0);
161
+ gridFillPage.steps.checkAnswer();
162
+ gridFillPage.steps.verifyCheckAnswerButtonDisabled();
163
+ });
164
+
165
+ it('When the user reaches maximum check answer attempts, then the \'Check Answer\' button should become disabled', () => {
166
+ utilities.verifyElementDisabled(gridFillPage.checkAnswerButton());
167
+ });
168
+
169
+ it('CSS of disabled \'Check Answer\' button', { tags: 'css' }, () => {
170
+ utilities.verifyCSS(gridFillPage.checkAnswerButton(), {
171
+ 'color': css.color.primaryBtnDisabled,
172
+ 'font-size': css.fontSize.default,
173
+ 'font-weight': css.fontWeight.semibold
174
+ });
175
+ });
176
+
177
+ it('Accessibility of disabled Check Answer button', { tags: 'a11y' }, () => {
178
+ cy.checkAccessibility(gridFillPage.checkAnswerButton().parents('.check-answer-and-status-wrapper'));
179
+ });
180
+
181
+ it('When the user updates the value of \'Maximum check answer attempts\' dropdown, it should get reflected on the Preview tab', () => {
182
+ gridFillPage.steps.switchToEditTab();
183
+ gridFillPage.steps.expandMaxCheckAnswerAttemptsDropdown();
184
+ gridFillPage.steps.selectMaxCheckAnswerAttemptsDropdownListOption('3');
185
+ gridFillPage.steps.switchToPreviewTab();
186
+ gridFillPage.steps.verifyCheckAnswerButtonEnabled();
187
+ gridFillPage.steps.selectCellPreviewTab(0, 0);
188
+ gridFillPage.steps.checkAnswer();
189
+ gridFillPage.steps.verifyCheckAnswerButtonEnabled();
190
+ });
191
+
192
+ it('When the user selects \'No limit\' option from the dropdown then user should be able to check answer multiple times', () => {
193
+ gridFillPage.steps.switchToEditTab();
194
+ gridFillPage.steps.expandMaxCheckAnswerAttemptsDropdown();
195
+ gridFillPage.steps.selectMaxCheckAnswerAttemptsDropdownListOption('no limit');
196
+ gridFillPage.steps.switchToPreviewTab();
197
+ gridFillPage.steps.verifyCheckAnswerButtonEnabled();
198
+ gridFillPage.steps.selectCellPreviewTab(0, 0);
199
+ gridFillPage.steps.checkAnswer();
200
+ gridFillPage.steps.verifyCheckAnswerButtonEnabled();
201
+ gridFillPage.steps.selectCellPreviewTab(0, 1);
202
+ gridFillPage.steps.checkAnswer();
203
+ gridFillPage.steps.verifyCheckAnswerButtonEnabled();
204
+ });
205
+ });
206
+ });