itemengine-cypress-automation 1.0.199-20thMayRepoUpdate-6af11c9.0 → 1.0.199

Sign up to get free protection for your applications and to get access to all the features.
Files changed (65) hide show
  1. package/cypress/e2e/ILC/AudioPlayerNew/allSupportedFileTypes.js +3 -1
  2. package/cypress/e2e/ILC/AudioResponseNew/gradingViewAndCorrectAnswerViewContents.smoke.js +1 -0
  3. package/cypress/e2e/ILC/ChartsBar/Scoring/allOrNothingAlternatePointsGreaterThanCorrectPoints.js +348 -0
  4. package/cypress/e2e/ILC/ChartsBar/Scoring/allOrNothingCorrectPointsEqualToAlternatePoints.js +346 -0
  5. package/cypress/e2e/ILC/ChartsBar/Scoring/allOrNothingCorrectPointsGreaterThanAlternatePoints.js +401 -0
  6. package/cypress/e2e/ILC/ChartsBar/Scoring/allOrNothingPenaltyScoring.js +53 -0
  7. package/cypress/e2e/ILC/ChartsBar/Scoring/partialDifferentWeightBasic.js +251 -0
  8. package/cypress/e2e/ILC/ChartsBar/Scoring/partialEqualWeightBasic.js +251 -0
  9. package/cypress/e2e/ILC/ChartsBar/allOrNothingScoringForAllViews.smoke.js +366 -0
  10. package/cypress/e2e/ILC/ChartsBar/checkAnswerFunctionalityForAllViews.smoke.js +2 -2
  11. package/cypress/e2e/ILC/ChartsLine/allOrNothingScoringForAllViews.smoke.js +367 -0
  12. package/cypress/e2e/ILC/ChartsLine/gradingViewAndCorrectAnswerView.smoke.js +3 -3
  13. package/cypress/e2e/ILC/Compass/compassEditTabBasicsSection.js +134 -0
  14. package/cypress/e2e/ILC/Compass/compassPreviewContent.smoke.js +88 -0
  15. package/cypress/e2e/ILC/FeedbackScaleNew/editTabBasicSection.js +2 -1
  16. package/cypress/e2e/ILC/FillInTheGapsDropdownNew/editTabBasicSection.js +3 -3
  17. package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/partialDifferentWeightsMinimumAndPenaltyScoring.js +2 -2
  18. package/cypress/e2e/ILC/Graphing/Scoring/allOrNothingWithAlternativePointsGreaterThanCorrectPoints.js +1 -0
  19. package/cypress/e2e/ILC/Graphing/layoutAndGridOptions.js +4 -2
  20. package/cypress/e2e/ILC/Graphing/toolsControlsAndBackgroundSection.js +3 -3
  21. package/cypress/e2e/ILC/ListOrderingNew/horizontalOrientationAllOrNothingForAllViews.smoke.js +1 -1
  22. package/cypress/e2e/ILC/Matching/Scoring/partialDifferentWeightsWithAlternativePointsGreaterThanCorrectPoints.js +5 -5
  23. package/cypress/e2e/ILC/Matching/Scoring/partialDifferentWeightsWithCorrectPointsEqualToAlternativePoints.js +4 -4
  24. package/cypress/e2e/ILC/Matching/Scoring/partialEqualWeightsWithAlternativePointsGreaterThanCorrectPoints.js +1 -1
  25. package/cypress/e2e/ILC/Matching/Scoring/partialEqualWeightsWithCorrectPointsGreaterThanAlternativePoints.js +4 -4
  26. package/cypress/e2e/ILC/TextEntryMath/editTabBasicSection.js +1 -1
  27. package/cypress/e2e/ILC/TextEntryMath/evaluationMethodEquivalentStructures.js +4 -4
  28. package/cypress/e2e/ILC/TextEntryMath/evaluationMethodMatchExact.js +3 -3
  29. package/cypress/e2e/ILC/TextEntryMath/evaluationMethodMatchValue.js +4 -4
  30. package/cypress/e2e/ILC/TextEntryMath/evaluationMethodSymbolsAreEquivalent.js +4 -4
  31. package/cypress/e2e/ILC/TextEntryMath/evaluationMethodValueIsEquivalent.js +4 -4
  32. package/cypress/e2e/ILC/UploadResponse/previewContentsForAllViews.smoke.js +1 -1
  33. package/cypress/e2e/ILC/UploadResponse/studentViewSettingsSection.js +1 -16
  34. package/cypress/e2e/ILC/chartsDotsPlot/checkAnswerFunctionalityForAllViews.smoke.js +0 -1
  35. package/cypress/e2e/ILC/chartsDotsPlot/editTabScoring.js +223 -0
  36. package/cypress/e2e/ILC/chartsDotsPlot/headerSection.js +110 -0
  37. package/cypress/e2e/ILC/chartsDotsPlot/minimumScoringPenaltyPointsAndRoundingDropdown.js +199 -0
  38. package/cypress/e2e/ILC/chartsDotsPlot/scoring/allOrNothingWithAlternatePointsGreaterThanCorrectPoints.js +375 -0
  39. package/cypress/e2e/ILC/chartsDotsPlot/scoring/allOrNothingWithCorrectPointsEqualToAlternativePoints.js +382 -0
  40. package/cypress/e2e/ILC/chartsDotsPlot/scoring/allOrNothingWithCorrectPointsGreaterThanAlternativePoints.js +422 -0
  41. package/cypress/e2e/ILC/chartsDotsPlot/scoring/manualAndNonScoredScoring.js +159 -0
  42. package/cypress/e2e/ILC/chartsDotsPlot/scoring/partialEqualWeightsBasic.js +233 -0
  43. package/cypress/e2e/ILC/chartsDotsPlot/scoring/partialEqualWeightsWithAlternativePointsGreaterThanCorrectPoints.js +380 -0
  44. package/cypress/e2e/ILC/chartsDotsPlot/scoring/partialEqualWeightsWithCorrectPointsEqualToAlternativePoints.js +293 -0
  45. package/cypress/e2e/ILC/chartsDotsPlot/scoring/partialEqualWeightsWithCorrectPointsGreaterThanAlternativePoints.js +382 -0
  46. package/cypress/e2e/ILC/chartsDotsPlot/scoring/toleranceThresholdScoring.js +184 -0
  47. package/cypress/e2e/ILC/chartsDotsPlot/toolSettings.js +76 -0
  48. package/cypress/pages/chartsBarPage.js +23 -15
  49. package/cypress/pages/chartsDotPlotPage.js +130 -7
  50. package/cypress/pages/chartsLinePage.js +11 -11
  51. package/cypress/pages/compassPage.js +57 -0
  52. package/cypress/pages/components/autoScoredScoringSectionMultiResponseType.js +1 -0
  53. package/cypress/pages/components/autoScoredSpecifyCorrectAnswerSection.js +3 -0
  54. package/cypress/pages/components/barAndLineChartComponent.js +7 -7
  55. package/cypress/pages/components/chartsCommonComponent.js +55 -7
  56. package/cypress/pages/components/createQuestionBasePage.js +1 -1
  57. package/cypress/pages/components/optionsWrapperComponent.js +1 -1
  58. package/cypress/pages/components/questionInputFieldComponent.js +2 -2
  59. package/cypress/pages/feedbackScalePage.js +3 -1
  60. package/cypress/pages/graphingPage.js +1 -1
  61. package/cypress/pages/imageHighlightPage.js +4 -434
  62. package/cypress/pages/index.js +2 -1
  63. package/cypress/pages/listOrderingPage.js +9 -9
  64. package/cypress/pages/textEntryMathPage.js +16 -16
  65. package/package.json +2 -2
@@ -0,0 +1,251 @@
1
+ import { chartsBarPage } from "../../../../pages";
2
+ import abortEarlySetup from "../../../../support/helpers/abortEarly";
3
+
4
+ describe('Create item page - Charts - Bar: Partial different weights', () => {
5
+ before(() => {
6
+ cy.loginAs('admin');
7
+ });
8
+
9
+ describe('Charts - Bar: Partial different weights scoring', () => {
10
+ abortEarlySetup();
11
+ before(() => {
12
+ chartsBarPage.steps.navigateToCreateQuestion('charts');
13
+ cy.barsPreLoaderWait();
14
+ chartsBarPage.steps.addTextInQuestionInstructionsInputField('Set the bar on the chart for the profits of the years');
15
+ chartsBarPage.steps.addBarOrPointInChartInSelectChartTypeSection();
16
+ chartsBarPage.steps.addBarOrPointInChartInSelectChartTypeSection();
17
+ chartsBarPage.steps.setBarValueInSelectChartTypeSection({ barIndex: 0, value: 3, range: 10 });
18
+ chartsBarPage.steps.setBarValueInSelectChartTypeSection({ barIndex: 1, value: 2, range: 10 });
19
+ chartsBarPage.steps.setBarValueInSelectChartTypeSection({ barIndex: 3, value: 3, range: 10 });
20
+ chartsBarPage.steps.lockBar(1);
21
+ chartsBarPage.steps.setBarValueInSpecifyCorrectAnswerSection({ barIndex: 0, value: 3, range: 10 });
22
+ chartsBarPage.steps.setBarValueInSpecifyCorrectAnswerSection({ barIndex: 2, value: 6, range: 10 });
23
+ chartsBarPage.steps.setBarValueInSpecifyCorrectAnswerSection({ barIndex: 3, value: 5, range: 10 });
24
+ chartsBarPage.steps.selectAutoScoredScoringSubtype('Partial different weights');
25
+ chartsBarPage.steps.allotPartialDifferentWeightsPoints({ 0: 3, 1: 2, 2: 5, 3: 4, 4: 6 });
26
+ chartsBarPage.steps.checkAllowStudentToCheckAnswerCheckbox();
27
+ chartsBarPage.steps.switchToPreviewTab();
28
+ });
29
+
30
+ it('When the user selects \'Grading\' view without attempting the question, then user should be provided with 0 points, correct icon should be displayed for bar set to correct by default, incorrect icon should be displayed for incorrect graph, the correct answer should be displayed in the correct answer section graph and correct/incorrect status message should not be displayed', () => {
31
+ chartsBarPage.steps.switchToGradingView();
32
+ chartsBarPage.steps.verifyPreviewScore(0, 20);
33
+ chartsBarPage.steps.verifyBarCorrectIncorrectIconInPreviewTab(0, 'correct');
34
+ chartsBarPage.steps.verifyBarCorrectIncorrectIconNotExistsInPreviewTab(1);
35
+ chartsBarPage.steps.verifyBarCorrectIncorrectIconInPreviewTab(2, 'incorrect');
36
+ chartsBarPage.steps.verifyBarCorrectIncorrectIconInPreviewTab(3, 'incorrect');
37
+ chartsBarPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
38
+ chartsBarPage.steps.verifyBarInCorrectAnswerSection({ barIndex: 0, barValue: 3, range: 10 });
39
+ chartsBarPage.steps.verifyLockedBarInCorrectAnswerSection({ barIndex: 1, barValue: 2, range: 10 });
40
+ chartsBarPage.steps.verifyBarInCorrectAnswerSection({ barIndex: 2, barValue: 6, range: 10 });
41
+ chartsBarPage.steps.verifyBarInCorrectAnswerSection({ barIndex: 3, barValue: 5, range: 10 });
42
+ chartsBarPage.steps.verifyBarInCorrectAnswerSection({ barIndex: 4, barValue: 0, range: 10 });
43
+ chartsBarPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
44
+ cy.log('When the user selects check answer without attempting the question, then correct/incorrect status message should not be displayed, incorrect icons should be displayed on the unattempted bars and correct icons should be displayed on the bar which is correct by default')
45
+ chartsBarPage.steps.checkAnswer();
46
+ chartsBarPage.steps.verifyBarCorrectIncorrectIconInPreviewTab(0, 'correct');
47
+ chartsBarPage.steps.verifyBarCorrectIncorrectIconNotExistsInPreviewTab(1);
48
+ chartsBarPage.steps.verifyBarCorrectIncorrectIconInPreviewTab(2, 'incorrect');
49
+ chartsBarPage.steps.verifyBarCorrectIncorrectIconInPreviewTab(3, 'incorrect');
50
+ chartsBarPage.steps.verifyBarCorrectIncorrectIconInPreviewTab(4, 'correct');
51
+ chartsBarPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
52
+ chartsBarPage.steps.verifyCorrectAnswerSectionNotExist();
53
+ });
54
+
55
+ // Fully incorrect case
56
+ it('When the user incorrectly sets a bar which was correct by default, then the user should be awarded points for the correctly set locked bar and on switching to grading view, correct/incorrect status message should not be displayed, incorrect icons should be displayed on the incorrect response and correct answer section should be displayed with the correct answers', () => {
57
+ chartsBarPage.steps.setBarValueInPreviewTab({ barIndex: 0, value: 5, range: 10 });
58
+ chartsBarPage.steps.setBarValueInPreviewTab({ barIndex: 4, value: 2, range: 10 });
59
+ chartsBarPage.steps.verifyPreviewScore(2, 20);
60
+ chartsBarPage.steps.switchToGradingView();
61
+ chartsBarPage.steps.verifyBarCorrectIncorrectIconInPreviewTab(0, 'incorrect');
62
+ chartsBarPage.steps.verifyBarCorrectIncorrectIconNotExistsInPreviewTab(1);
63
+ chartsBarPage.steps.verifyBarCorrectIncorrectIconInPreviewTab(2, 'incorrect');
64
+ chartsBarPage.steps.verifyBarCorrectIncorrectIconInPreviewTab(3, 'incorrect');
65
+ chartsBarPage.steps.verifyBarCorrectIncorrectIconInPreviewTab(4, 'incorrect');
66
+ chartsBarPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
67
+ chartsBarPage.steps.verifyBarInCorrectAnswerSection({ barIndex: 0, barValue: 3, range: 10 });
68
+ chartsBarPage.steps.verifyLockedBarInCorrectAnswerSection({ barIndex: 1, barValue: 2, range: 10 });
69
+ chartsBarPage.steps.verifyBarInCorrectAnswerSection({ barIndex: 2, barValue: 6, range: 10 });
70
+ chartsBarPage.steps.verifyBarInCorrectAnswerSection({ barIndex: 3, barValue: 5, range: 10 });
71
+ chartsBarPage.steps.verifyBarInCorrectAnswerSection({ barIndex: 4, barValue: 0, range: 10 });
72
+ chartsBarPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
73
+ cy.log('When the user selects check answer after incorrectly attempting the question, then correct/incorrect status message should not be displayed, incorrect icons should be displayed on the incorrect response')
74
+ chartsBarPage.steps.checkAnswer();
75
+ chartsBarPage.steps.verifyBarCorrectIncorrectIconInPreviewTab(0, 'incorrect');
76
+ chartsBarPage.steps.verifyBarCorrectIncorrectIconNotExistsInPreviewTab(1);
77
+ chartsBarPage.steps.verifyBarCorrectIncorrectIconInPreviewTab(2, 'incorrect');
78
+ chartsBarPage.steps.verifyBarCorrectIncorrectIconInPreviewTab(3, 'incorrect');
79
+ chartsBarPage.steps.verifyBarCorrectIncorrectIconInPreviewTab(4, 'incorrect');
80
+ chartsBarPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
81
+ chartsBarPage.steps.verifyCorrectAnswerSectionNotExist();
82
+ });
83
+
84
+ // Partially correct cases
85
+ it('When the user incorrectly sets a bar which was set to 0 and correct by default, then the user should be awarded with points for the correctly attempted/set bars and on switching to grading view correct/incorrect status message should not be displayed, correct icons should be displayed for correctly attempted/set bars, incorrect icons should be displayed on the incorrectly attempted/set bars and correct answer section should be displayed with the correct answers', () => {
86
+ chartsBarPage.steps.resetQuestionPreview()
87
+ chartsBarPage.steps.setBarValueInPreviewTab({ barIndex: 4, value: 5, range: 10 });
88
+ chartsBarPage.steps.verifyPreviewScore(5, 20);
89
+ chartsBarPage.steps.switchToGradingView();
90
+ chartsBarPage.steps.verifyBarCorrectIncorrectIconInPreviewTab(0, 'correct');
91
+ chartsBarPage.steps.verifyBarCorrectIncorrectIconNotExistsInPreviewTab(1);
92
+ chartsBarPage.steps.verifyBarCorrectIncorrectIconInPreviewTab(2, 'incorrect');
93
+ chartsBarPage.steps.verifyBarCorrectIncorrectIconInPreviewTab(3, 'incorrect');
94
+ chartsBarPage.steps.verifyBarCorrectIncorrectIconInPreviewTab(4, 'incorrect');
95
+ chartsBarPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
96
+ chartsBarPage.steps.verifyBarInCorrectAnswerSection({ barIndex: 0, barValue: 3, range: 10 });
97
+ chartsBarPage.steps.verifyLockedBarInCorrectAnswerSection({ barIndex: 1, barValue: 2, range: 10 });
98
+ chartsBarPage.steps.verifyBarInCorrectAnswerSection({ barIndex: 2, barValue: 6, range: 10 });
99
+ chartsBarPage.steps.verifyBarInCorrectAnswerSection({ barIndex: 3, barValue: 5, range: 10 });
100
+ chartsBarPage.steps.verifyBarInCorrectAnswerSection({ barIndex: 4, barValue: 0, range: 10 });
101
+ chartsBarPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
102
+ cy.log('When the user selects check answer without attempting the question, then correct/incorrect status message should not be displayed, correct icons should be displayed for correctly attempted/set bars, incorrect icons should be displayed on the incorrectly attempted/set bars')
103
+ chartsBarPage.steps.checkAnswer();
104
+ chartsBarPage.steps.verifyBarCorrectIncorrectIconInPreviewTab(0, 'correct');
105
+ chartsBarPage.steps.verifyBarCorrectIncorrectIconNotExistsInPreviewTab(1);
106
+ chartsBarPage.steps.verifyBarCorrectIncorrectIconInPreviewTab(2, 'incorrect');
107
+ chartsBarPage.steps.verifyBarCorrectIncorrectIconInPreviewTab(3, 'incorrect');
108
+ chartsBarPage.steps.verifyBarCorrectIncorrectIconInPreviewTab(4, 'incorrect');
109
+ chartsBarPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
110
+ chartsBarPage.steps.verifyCorrectAnswerSectionNotExist();
111
+ });
112
+
113
+ it('When the user attempts the question partially correct by incorrectly setting a bar which was incorrect by default, then the user should be awarded with points for the correctly attempted/set bars and on switching to grading view correct/incorrect status message should not be displayed, correct icons should be displayed on the correctly attempted/set bars, incorrect icons should be displayed on the incorrectly attempted/set bars and correct answer section should be displayed with the correct answers', () => {
114
+ chartsBarPage.steps.resetQuestionPreview()
115
+ chartsBarPage.steps.setBarValueInPreviewTab({ barIndex: 3, value: 2, range: 10 });
116
+ chartsBarPage.steps.verifyPreviewScore(11, 20);
117
+ chartsBarPage.steps.switchToGradingView();
118
+ chartsBarPage.steps.verifyBarCorrectIncorrectIconInPreviewTab(0, 'correct');
119
+ chartsBarPage.steps.verifyBarCorrectIncorrectIconNotExistsInPreviewTab(1);
120
+ chartsBarPage.steps.verifyBarCorrectIncorrectIconInPreviewTab(2, 'incorrect');
121
+ chartsBarPage.steps.verifyBarCorrectIncorrectIconInPreviewTab(3, 'incorrect');
122
+ chartsBarPage.steps.verifyBarCorrectIncorrectIconInPreviewTab(4, 'correct');
123
+ chartsBarPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
124
+ chartsBarPage.steps.verifyBarInCorrectAnswerSection({ barIndex: 0, barValue: 3, range: 10 });
125
+ chartsBarPage.steps.verifyLockedBarInCorrectAnswerSection({ barIndex: 1, barValue: 2, range: 10 });
126
+ chartsBarPage.steps.verifyBarInCorrectAnswerSection({ barIndex: 2, barValue: 6, range: 10 });
127
+ chartsBarPage.steps.verifyBarInCorrectAnswerSection({ barIndex: 3, barValue: 5, range: 10 });
128
+ chartsBarPage.steps.verifyBarInCorrectAnswerSection({ barIndex: 4, barValue: 0, range: 10 });
129
+ chartsBarPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
130
+ cy.log('When the user selects check answer without attempting the question, then correct/incorrect status message should not be displayed, correct icons should be displayed for correctly attempted/set bars, incorrect icons should be displayed on the incorrectly attempted/set bars')
131
+ chartsBarPage.steps.checkAnswer();
132
+ chartsBarPage.steps.verifyBarCorrectIncorrectIconInPreviewTab(0, 'correct');
133
+ chartsBarPage.steps.verifyBarCorrectIncorrectIconNotExistsInPreviewTab(1);
134
+ chartsBarPage.steps.verifyBarCorrectIncorrectIconInPreviewTab(2, 'incorrect');
135
+ chartsBarPage.steps.verifyBarCorrectIncorrectIconInPreviewTab(3, 'incorrect');
136
+ chartsBarPage.steps.verifyBarCorrectIncorrectIconInPreviewTab(4, 'correct');
137
+ chartsBarPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
138
+ chartsBarPage.steps.verifyCorrectAnswerSectionNotExist();
139
+ });
140
+
141
+ it('When the user attempts the question partially correct by incorrectly setting a bar to zero which was incorrect by default, then the user should be awarded with points for the correctly attempted/set bars and on switching to grading view correct/incorrect status message should not be displayed, correct icons should be displayed on the correctly attempted/set bars, incorrect icons should be displayed on the incorrectly attempted/set bars and correct answer section should be displayed with the correct answers', () => {
142
+ chartsBarPage.steps.resetQuestionPreview()
143
+ chartsBarPage.steps.setBarValueInPreviewTab({ barIndex: 3, value: 0, range: 10 });
144
+ chartsBarPage.steps.verifyPreviewScore(11, 20);
145
+ chartsBarPage.steps.switchToGradingView();
146
+ chartsBarPage.steps.verifyBarCorrectIncorrectIconInPreviewTab(0, 'correct');
147
+ chartsBarPage.steps.verifyBarCorrectIncorrectIconNotExistsInPreviewTab(1);
148
+ chartsBarPage.steps.verifyBarCorrectIncorrectIconInPreviewTab(2, 'incorrect');
149
+ chartsBarPage.steps.verifyBarCorrectIncorrectIconInPreviewTab(3, 'incorrect');
150
+ chartsBarPage.steps.verifyBarCorrectIncorrectIconInPreviewTab(4, 'correct');
151
+ chartsBarPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
152
+ chartsBarPage.steps.verifyBarInCorrectAnswerSection({ barIndex: 0, barValue: 3, range: 10 });
153
+ chartsBarPage.steps.verifyLockedBarInCorrectAnswerSection({ barIndex: 1, barValue: 2, range: 10 });
154
+ chartsBarPage.steps.verifyBarInCorrectAnswerSection({ barIndex: 2, barValue: 6, range: 10 });
155
+ chartsBarPage.steps.verifyBarInCorrectAnswerSection({ barIndex: 3, barValue: 5, range: 10 });
156
+ chartsBarPage.steps.verifyBarInCorrectAnswerSection({ barIndex: 4, barValue: 0, range: 10 });
157
+ chartsBarPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
158
+ cy.log('When the user selects check answer without attempting the question, then correct/incorrect status message should not be displayed, correct icons should be displayed for correctly attempted/set bars, incorrect icons should be displayed on the incorrectly attempted/set bars')
159
+ chartsBarPage.steps.checkAnswer();
160
+ chartsBarPage.steps.verifyBarCorrectIncorrectIconInPreviewTab(0, 'correct');
161
+ chartsBarPage.steps.verifyBarCorrectIncorrectIconNotExistsInPreviewTab(1);
162
+ chartsBarPage.steps.verifyBarCorrectIncorrectIconInPreviewTab(2, 'incorrect');
163
+ chartsBarPage.steps.verifyBarCorrectIncorrectIconInPreviewTab(3, 'incorrect');
164
+ chartsBarPage.steps.verifyBarCorrectIncorrectIconInPreviewTab(4, 'correct');
165
+ chartsBarPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
166
+ chartsBarPage.steps.verifyCorrectAnswerSectionNotExist();
167
+ });
168
+
169
+ it('When the user attempts the question partially correct by incorrectly setting a bar which was set to zero by default, then the user should be awarded with points for the correctly attempted/set bars and on switching to grading view correct/incorrect status message should not be displayed, correct icons should be displayed on the correctly attempted/set bars, incorrect icons should be displayed on the incorrectly attempted/set bars and correct answer section should be displayed with the correct answers', () => {
170
+ chartsBarPage.steps.resetQuestionPreview()
171
+ chartsBarPage.steps.setBarValueInPreviewTab({ barIndex: 2, value: 9, range: 10 });
172
+ chartsBarPage.steps.verifyPreviewScore(11, 20);
173
+ chartsBarPage.steps.switchToGradingView();
174
+ chartsBarPage.steps.verifyBarCorrectIncorrectIconInPreviewTab(0, 'correct');
175
+ chartsBarPage.steps.verifyBarCorrectIncorrectIconNotExistsInPreviewTab(1);
176
+ chartsBarPage.steps.verifyBarCorrectIncorrectIconInPreviewTab(2, 'incorrect');
177
+ chartsBarPage.steps.verifyBarCorrectIncorrectIconInPreviewTab(3, 'incorrect');
178
+ chartsBarPage.steps.verifyBarCorrectIncorrectIconInPreviewTab(4, 'correct');
179
+ chartsBarPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
180
+ chartsBarPage.steps.verifyBarInCorrectAnswerSection({ barIndex: 0, barValue: 3, range: 10 });
181
+ chartsBarPage.steps.verifyLockedBarInCorrectAnswerSection({ barIndex: 1, barValue: 2, range: 10 });
182
+ chartsBarPage.steps.verifyBarInCorrectAnswerSection({ barIndex: 2, barValue: 6, range: 10 });
183
+ chartsBarPage.steps.verifyBarInCorrectAnswerSection({ barIndex: 3, barValue: 5, range: 10 });
184
+ chartsBarPage.steps.verifyBarInCorrectAnswerSection({ barIndex: 4, barValue: 0, range: 10 });
185
+ chartsBarPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
186
+ cy.log('When the user selects check answer without attempting the question, then correct/incorrect status message should not be displayed, correct icons should be displayed for correctly attempted/set bars, incorrect icons should be displayed on the incorrectly attempted/set bars')
187
+ chartsBarPage.steps.checkAnswer();
188
+ chartsBarPage.steps.verifyBarCorrectIncorrectIconInPreviewTab(0, 'correct');
189
+ chartsBarPage.steps.verifyBarCorrectIncorrectIconNotExistsInPreviewTab(1);
190
+ chartsBarPage.steps.verifyBarCorrectIncorrectIconInPreviewTab(2, 'incorrect');
191
+ chartsBarPage.steps.verifyBarCorrectIncorrectIconInPreviewTab(3, 'incorrect');
192
+ chartsBarPage.steps.verifyBarCorrectIncorrectIconInPreviewTab(4, 'correct');
193
+ chartsBarPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
194
+ chartsBarPage.steps.verifyCorrectAnswerSectionNotExist();
195
+ });
196
+
197
+ it('When the user attempts the question partially correct by setting all bars correctly except 1 then the user should be awarded with points for the correctly attempted/set bars and on switching to grading view correct/incorrect status message should not be displayed, correct icons should be displayed on the correctly attempted/set bars and incorrect icons should be displayed on the incorrectly attempted/set bars and correct answer section should be displayed with the correct answers', () => {
198
+ chartsBarPage.steps.resetQuestionPreview()
199
+ chartsBarPage.steps.setBarValueInPreviewTab({ barIndex: 3, value: 5, range: 10 });
200
+ chartsBarPage.steps.verifyPreviewScore(15, 20);
201
+ chartsBarPage.steps.switchToGradingView();
202
+ chartsBarPage.steps.verifyBarCorrectIncorrectIconInPreviewTab(0, 'correct');
203
+ chartsBarPage.steps.verifyBarCorrectIncorrectIconNotExistsInPreviewTab(1);
204
+ chartsBarPage.steps.verifyBarCorrectIncorrectIconInPreviewTab(2, 'incorrect');
205
+ chartsBarPage.steps.verifyBarCorrectIncorrectIconInPreviewTab(3, 'correct');
206
+ chartsBarPage.steps.verifyBarCorrectIncorrectIconInPreviewTab(4, 'correct');
207
+ chartsBarPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
208
+ chartsBarPage.steps.verifyBarInCorrectAnswerSection({ barIndex: 0, barValue: 3, range: 10 });
209
+ chartsBarPage.steps.verifyLockedBarInCorrectAnswerSection({ barIndex: 1, barValue: 2, range: 10 });
210
+ chartsBarPage.steps.verifyBarInCorrectAnswerSection({ barIndex: 2, barValue: 6, range: 10 });
211
+ chartsBarPage.steps.verifyBarInCorrectAnswerSection({ barIndex: 3, barValue: 5, range: 10 });
212
+ chartsBarPage.steps.verifyBarInCorrectAnswerSection({ barIndex: 4, barValue: 0, range: 10 });
213
+ chartsBarPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
214
+ cy.log('When the user selects check answer without attempting the question, then correct/incorrect status message should not be displayed, correct icons should be displayed for correctly attempted/set bars, incorrect icons should be displayed on the incorrectly attempted/set bars')
215
+ chartsBarPage.steps.checkAnswer();
216
+ chartsBarPage.steps.verifyBarCorrectIncorrectIconInPreviewTab(0, 'correct');
217
+ chartsBarPage.steps.verifyBarCorrectIncorrectIconNotExistsInPreviewTab(1);
218
+ chartsBarPage.steps.verifyBarCorrectIncorrectIconInPreviewTab(2, 'incorrect');
219
+ chartsBarPage.steps.verifyBarCorrectIncorrectIconInPreviewTab(3, 'correct');
220
+ chartsBarPage.steps.verifyBarCorrectIncorrectIconInPreviewTab(4, 'correct');
221
+ chartsBarPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
222
+ chartsBarPage.steps.verifyCorrectAnswerSectionNotExist();
223
+ });
224
+
225
+ // Fully correct
226
+ it('When the user attempts the question correctly then the user should be awarded with full points and on switching to grading view \'Your answer is correct\' should be displayed, correct icons should be displayed on the correctly attempted/set bars and the correct answer section graph should not be displayed', () => {
227
+ chartsBarPage.steps.resetQuestionPreview()
228
+ chartsBarPage.steps.setBarValueInPreviewTab({ barIndex: 2, value: 6, range: 10 });
229
+ chartsBarPage.steps.setBarValueInPreviewTab({ barIndex: 3, value: 5, range: 10 });
230
+ chartsBarPage.steps.verifyPreviewScore(20, 20);
231
+ chartsBarPage.steps.switchToGradingView();
232
+ chartsBarPage.steps.verifyBarCorrectIncorrectIconInPreviewTab(0, 'correct');
233
+ chartsBarPage.steps.verifyBarCorrectIncorrectIconNotExistsInPreviewTab(1);
234
+ chartsBarPage.steps.verifyBarCorrectIncorrectIconInPreviewTab(2, 'correct');
235
+ chartsBarPage.steps.verifyBarCorrectIncorrectIconInPreviewTab(3, 'correct');
236
+ chartsBarPage.steps.verifyBarCorrectIncorrectIconInPreviewTab(4, 'correct');
237
+ chartsBarPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
238
+ chartsBarPage.steps.verifyCorrectAnswerSectionNotExist();
239
+ chartsBarPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
240
+ cy.log('When the user selects check answer without attempting the question, then correct/incorrect status message should not be displayed, correct icons should be displayed for correctly attempted/set bars')
241
+ chartsBarPage.steps.checkAnswer();
242
+ chartsBarPage.steps.verifyBarCorrectIncorrectIconInPreviewTab(0, 'correct');
243
+ chartsBarPage.steps.verifyBarCorrectIncorrectIconNotExistsInPreviewTab(1);
244
+ chartsBarPage.steps.verifyBarCorrectIncorrectIconInPreviewTab(2, 'correct');
245
+ chartsBarPage.steps.verifyBarCorrectIncorrectIconInPreviewTab(3, 'correct');
246
+ chartsBarPage.steps.verifyBarCorrectIncorrectIconInPreviewTab(4, 'correct');
247
+ chartsBarPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
248
+ chartsBarPage.steps.verifyCorrectAnswerSectionNotExist();
249
+ });
250
+ });
251
+ });
@@ -0,0 +1,251 @@
1
+ import { chartsBarPage } from "../../../../pages";
2
+ import abortEarlySetup from "../../../../support/helpers/abortEarly";
3
+
4
+ describe('Create item page - Charts - Bar: Partial equal weights', () => {
5
+ before(() => {
6
+ cy.loginAs('admin');
7
+ });
8
+
9
+ describe('Charts - Bar: Partial equal weights scoring', () => {
10
+ abortEarlySetup();
11
+ before(() => {
12
+ chartsBarPage.steps.navigateToCreateQuestion('charts');
13
+ cy.barsPreLoaderWait();
14
+ chartsBarPage.steps.addTextInQuestionInstructionsInputField('Set the bar on the chart for the profits of the years');
15
+ chartsBarPage.steps.addBarOrPointInChartInSelectChartTypeSection();
16
+ chartsBarPage.steps.addBarOrPointInChartInSelectChartTypeSection();
17
+ chartsBarPage.steps.setBarValueInSelectChartTypeSection({ barIndex: 0, value: 3, range: 10 });
18
+ chartsBarPage.steps.setBarValueInSelectChartTypeSection({ barIndex: 1, value: 2, range: 10 });
19
+ chartsBarPage.steps.setBarValueInSelectChartTypeSection({ barIndex: 3, value: 3, range: 10 });
20
+ chartsBarPage.steps.lockBar(1);
21
+ chartsBarPage.steps.allotPoints(20);
22
+ chartsBarPage.steps.setBarValueInSpecifyCorrectAnswerSection({ barIndex: 0, value: 3, range: 10 });
23
+ chartsBarPage.steps.setBarValueInSpecifyCorrectAnswerSection({ barIndex: 2, value: 6, range: 10 });
24
+ chartsBarPage.steps.setBarValueInSpecifyCorrectAnswerSection({ barIndex: 3, value: 5, range: 10 });
25
+ chartsBarPage.steps.selectAutoScoredScoringSubtype('Partial equal weights');
26
+ chartsBarPage.steps.checkAllowStudentToCheckAnswerCheckbox();
27
+ chartsBarPage.steps.switchToPreviewTab();
28
+ });
29
+
30
+ it('When the user selects \'Grading\' view without attempting the question, then user should be provided with 0 points, correct icon should be displayed for bar set to correct by default, incorrect icon should be displayed for incorrect graph, the correct answer should be displayed in the correct answer section graph and correct/incorrect status message should not be displayed', () => {
31
+ chartsBarPage.steps.switchToGradingView();
32
+ chartsBarPage.steps.verifyPreviewScore(0, 20);
33
+ chartsBarPage.steps.verifyBarCorrectIncorrectIconInPreviewTab(0, 'correct');
34
+ chartsBarPage.steps.verifyBarCorrectIncorrectIconNotExistsInPreviewTab(1);
35
+ chartsBarPage.steps.verifyBarCorrectIncorrectIconInPreviewTab(2, 'incorrect');
36
+ chartsBarPage.steps.verifyBarCorrectIncorrectIconInPreviewTab(3, 'incorrect');
37
+ chartsBarPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
38
+ chartsBarPage.steps.verifyBarInCorrectAnswerSection({ barIndex: 0, barValue: 3, range: 10 });
39
+ chartsBarPage.steps.verifyLockedBarInCorrectAnswerSection({ barIndex: 1, barValue: 2, range: 10 });
40
+ chartsBarPage.steps.verifyBarInCorrectAnswerSection({ barIndex: 2, barValue: 6, range: 10 });
41
+ chartsBarPage.steps.verifyBarInCorrectAnswerSection({ barIndex: 3, barValue: 5, range: 10 });
42
+ chartsBarPage.steps.verifyBarInCorrectAnswerSection({ barIndex: 4, barValue: 0, range: 10 });
43
+ chartsBarPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
44
+ cy.log('When the user selects check answer without attempting the question, then correct/incorrect status message should not be displayed, incorrect icons should be displayed on the unattempted bars and correct icons should be displayed on the bar which is correct by default')
45
+ chartsBarPage.steps.checkAnswer();
46
+ chartsBarPage.steps.verifyBarCorrectIncorrectIconInPreviewTab(0, 'correct');
47
+ chartsBarPage.steps.verifyBarCorrectIncorrectIconNotExistsInPreviewTab(1);
48
+ chartsBarPage.steps.verifyBarCorrectIncorrectIconInPreviewTab(2, 'incorrect');
49
+ chartsBarPage.steps.verifyBarCorrectIncorrectIconInPreviewTab(3, 'incorrect');
50
+ chartsBarPage.steps.verifyBarCorrectIncorrectIconInPreviewTab(4, 'correct');
51
+ chartsBarPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
52
+ chartsBarPage.steps.verifyCorrectAnswerSectionNotExist();
53
+ });
54
+
55
+ // Fully incorrect case
56
+ it('When the user incorrectly sets a bar which was correct by default, then the user should be awarded points for the correctly set locked bar and on switching to grading view, correct/incorrect status message should not be displayed, incorrect icons should be displayed on the incorrectly attempted bars and correct answer section should be displayed with the correct answers', () => {
57
+ chartsBarPage.steps.setBarValueInPreviewTab({ barIndex: 0, value: 5, range: 10 });
58
+ chartsBarPage.steps.setBarValueInPreviewTab({ barIndex: 4, value: 2, range: 10 });
59
+ chartsBarPage.steps.verifyPreviewScore(4, 20);
60
+ chartsBarPage.steps.switchToGradingView();
61
+ chartsBarPage.steps.verifyBarCorrectIncorrectIconInPreviewTab(0, 'incorrect');
62
+ chartsBarPage.steps.verifyBarCorrectIncorrectIconNotExistsInPreviewTab(1);
63
+ chartsBarPage.steps.verifyBarCorrectIncorrectIconInPreviewTab(2, 'incorrect');
64
+ chartsBarPage.steps.verifyBarCorrectIncorrectIconInPreviewTab(3, 'incorrect');
65
+ chartsBarPage.steps.verifyBarCorrectIncorrectIconInPreviewTab(4, 'incorrect');
66
+ chartsBarPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
67
+ chartsBarPage.steps.verifyBarInCorrectAnswerSection({ barIndex: 0, barValue: 3, range: 10 });
68
+ chartsBarPage.steps.verifyLockedBarInCorrectAnswerSection({ barIndex: 1, barValue: 2, range: 10 });
69
+ chartsBarPage.steps.verifyBarInCorrectAnswerSection({ barIndex: 2, barValue: 6, range: 10 });
70
+ chartsBarPage.steps.verifyBarInCorrectAnswerSection({ barIndex: 3, barValue: 5, range: 10 });
71
+ chartsBarPage.steps.verifyBarInCorrectAnswerSection({ barIndex: 4, barValue: 0, range: 10 });
72
+ chartsBarPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
73
+ cy.log('When the user selects check answer after incorrectly attempting the question, then correct/incorrect status message should not be displayed, incorrect icons should be displayed on the incorrectly attempted bars')
74
+ chartsBarPage.steps.checkAnswer();
75
+ chartsBarPage.steps.verifyBarCorrectIncorrectIconInPreviewTab(0, 'incorrect');
76
+ chartsBarPage.steps.verifyBarCorrectIncorrectIconNotExistsInPreviewTab(1);
77
+ chartsBarPage.steps.verifyBarCorrectIncorrectIconInPreviewTab(2, 'incorrect');
78
+ chartsBarPage.steps.verifyBarCorrectIncorrectIconInPreviewTab(3, 'incorrect');
79
+ chartsBarPage.steps.verifyBarCorrectIncorrectIconInPreviewTab(4, 'incorrect');
80
+ chartsBarPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
81
+ chartsBarPage.steps.verifyCorrectAnswerSectionNotExist();
82
+ });
83
+
84
+ // Partially correct cases
85
+ it('When the user incorrectly sets a bar which was set to 0 and correct by default, then the user should be awarded with points for the correctly attempted/set bars and on switching to grading view correct/incorrect status message should not be displayed, correct icons should be displayed for correctly attempted/set bars, incorrect icons should be displayed on the incorrectly attempted/set bars and correct answer section should be displayed with the correct answers', () => {
86
+ chartsBarPage.steps.resetQuestionPreview()
87
+ chartsBarPage.steps.setBarValueInPreviewTab({ barIndex: 4, value: 5, range: 10 });
88
+ chartsBarPage.steps.verifyPreviewScore(8, 20);
89
+ chartsBarPage.steps.switchToGradingView();
90
+ chartsBarPage.steps.verifyBarCorrectIncorrectIconInPreviewTab(0, 'correct');
91
+ chartsBarPage.steps.verifyBarCorrectIncorrectIconNotExistsInPreviewTab(1);
92
+ chartsBarPage.steps.verifyBarCorrectIncorrectIconInPreviewTab(2, 'incorrect');
93
+ chartsBarPage.steps.verifyBarCorrectIncorrectIconInPreviewTab(3, 'incorrect');
94
+ chartsBarPage.steps.verifyBarCorrectIncorrectIconInPreviewTab(4, 'incorrect');
95
+ chartsBarPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
96
+ chartsBarPage.steps.verifyBarInCorrectAnswerSection({ barIndex: 0, barValue: 3, range: 10 });
97
+ chartsBarPage.steps.verifyLockedBarInCorrectAnswerSection({ barIndex: 1, barValue: 2, range: 10 });
98
+ chartsBarPage.steps.verifyBarInCorrectAnswerSection({ barIndex: 2, barValue: 6, range: 10 });
99
+ chartsBarPage.steps.verifyBarInCorrectAnswerSection({ barIndex: 3, barValue: 5, range: 10 });
100
+ chartsBarPage.steps.verifyBarInCorrectAnswerSection({ barIndex: 4, barValue: 0, range: 10 });
101
+ chartsBarPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
102
+ cy.log('When the user selects check answer without attempting the question, then correct/incorrect status message should not be displayed, correct icons should be displayed for correctly attempted/set bars, incorrect icons should be displayed on the incorrectly attempted/set bars')
103
+ chartsBarPage.steps.checkAnswer();
104
+ chartsBarPage.steps.verifyBarCorrectIncorrectIconInPreviewTab(0, 'correct');
105
+ chartsBarPage.steps.verifyBarCorrectIncorrectIconNotExistsInPreviewTab(1);
106
+ chartsBarPage.steps.verifyBarCorrectIncorrectIconInPreviewTab(2, 'incorrect');
107
+ chartsBarPage.steps.verifyBarCorrectIncorrectIconInPreviewTab(3, 'incorrect');
108
+ chartsBarPage.steps.verifyBarCorrectIncorrectIconInPreviewTab(4, 'incorrect');
109
+ chartsBarPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
110
+ chartsBarPage.steps.verifyCorrectAnswerSectionNotExist();
111
+ });
112
+
113
+ it('When the user attempts the question partially correct by incorrectly setting a bar which was incorrect by default, then the user should be awarded with points for the correctly attempted/set bars and on switching to grading view correct/incorrect status message should not be displayed, correct icons should be displayed on the correctly attempted/set bars, incorrect icons should be displayed on the incorrectly attempted/set bars and correct answer section should be displayed with the correct answers', () => {
114
+ chartsBarPage.steps.resetQuestionPreview()
115
+ chartsBarPage.steps.setBarValueInPreviewTab({ barIndex: 3, value: 2, range: 10 });
116
+ chartsBarPage.steps.verifyPreviewScore(12, 20);
117
+ chartsBarPage.steps.switchToGradingView();
118
+ chartsBarPage.steps.verifyBarCorrectIncorrectIconInPreviewTab(0, 'correct');
119
+ chartsBarPage.steps.verifyBarCorrectIncorrectIconNotExistsInPreviewTab(1);
120
+ chartsBarPage.steps.verifyBarCorrectIncorrectIconInPreviewTab(2, 'incorrect');
121
+ chartsBarPage.steps.verifyBarCorrectIncorrectIconInPreviewTab(3, 'incorrect');
122
+ chartsBarPage.steps.verifyBarCorrectIncorrectIconInPreviewTab(4, 'correct');
123
+ chartsBarPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
124
+ chartsBarPage.steps.verifyBarInCorrectAnswerSection({ barIndex: 0, barValue: 3, range: 10 });
125
+ chartsBarPage.steps.verifyLockedBarInCorrectAnswerSection({ barIndex: 1, barValue: 2, range: 10 });
126
+ chartsBarPage.steps.verifyBarInCorrectAnswerSection({ barIndex: 2, barValue: 6, range: 10 });
127
+ chartsBarPage.steps.verifyBarInCorrectAnswerSection({ barIndex: 3, barValue: 5, range: 10 });
128
+ chartsBarPage.steps.verifyBarInCorrectAnswerSection({ barIndex: 4, barValue: 0, range: 10 });
129
+ chartsBarPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
130
+ cy.log('When the user selects check answer without attempting the question, then correct/incorrect status message should not be displayed, correct icons should be displayed for correctly attempted/set bars, incorrect icons should be displayed on the incorrectly attempted/set bars')
131
+ chartsBarPage.steps.checkAnswer();
132
+ chartsBarPage.steps.verifyBarCorrectIncorrectIconInPreviewTab(0, 'correct');
133
+ chartsBarPage.steps.verifyBarCorrectIncorrectIconNotExistsInPreviewTab(1);
134
+ chartsBarPage.steps.verifyBarCorrectIncorrectIconInPreviewTab(2, 'incorrect');
135
+ chartsBarPage.steps.verifyBarCorrectIncorrectIconInPreviewTab(3, 'incorrect');
136
+ chartsBarPage.steps.verifyBarCorrectIncorrectIconInPreviewTab(4, 'correct');
137
+ chartsBarPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
138
+ chartsBarPage.steps.verifyCorrectAnswerSectionNotExist();
139
+ });
140
+
141
+ it('When the user attempts the question partially correct by incorrectly setting a bar to zero which was incorrect by default, then the user should be awarded with points for the correctly attempted/set bars and on switching to grading view correct/incorrect status message should not be displayed, correct icons should be displayed on the correctly attempted/set bars, incorrect icons should be displayed on the incorrectly attempted/set bars and correct answer section should be displayed with the correct answers', () => {
142
+ chartsBarPage.steps.resetQuestionPreview()
143
+ chartsBarPage.steps.setBarValueInPreviewTab({ barIndex: 3, value: 0, range: 10 });
144
+ chartsBarPage.steps.verifyPreviewScore(12, 20);
145
+ chartsBarPage.steps.switchToGradingView();
146
+ chartsBarPage.steps.verifyBarCorrectIncorrectIconInPreviewTab(0, 'correct');
147
+ chartsBarPage.steps.verifyBarCorrectIncorrectIconNotExistsInPreviewTab(1);
148
+ chartsBarPage.steps.verifyBarCorrectIncorrectIconInPreviewTab(2, 'incorrect');
149
+ chartsBarPage.steps.verifyBarCorrectIncorrectIconInPreviewTab(3, 'incorrect');
150
+ chartsBarPage.steps.verifyBarCorrectIncorrectIconInPreviewTab(4, 'correct');
151
+ chartsBarPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
152
+ chartsBarPage.steps.verifyBarInCorrectAnswerSection({ barIndex: 0, barValue: 3, range: 10 });
153
+ chartsBarPage.steps.verifyLockedBarInCorrectAnswerSection({ barIndex: 1, barValue: 2, range: 10 });
154
+ chartsBarPage.steps.verifyBarInCorrectAnswerSection({ barIndex: 2, barValue: 6, range: 10 });
155
+ chartsBarPage.steps.verifyBarInCorrectAnswerSection({ barIndex: 3, barValue: 5, range: 10 });
156
+ chartsBarPage.steps.verifyBarInCorrectAnswerSection({ barIndex: 4, barValue: 0, range: 10 });
157
+ chartsBarPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
158
+ cy.log('When the user selects check answer without attempting the question, then correct/incorrect status message should not be displayed, correct icons should be displayed for correctly attempted/set bars, incorrect icons should be displayed on the incorrectly attempted/set bars')
159
+ chartsBarPage.steps.checkAnswer();
160
+ chartsBarPage.steps.verifyBarCorrectIncorrectIconInPreviewTab(0, 'correct');
161
+ chartsBarPage.steps.verifyBarCorrectIncorrectIconNotExistsInPreviewTab(1);
162
+ chartsBarPage.steps.verifyBarCorrectIncorrectIconInPreviewTab(2, 'incorrect');
163
+ chartsBarPage.steps.verifyBarCorrectIncorrectIconInPreviewTab(3, 'incorrect');
164
+ chartsBarPage.steps.verifyBarCorrectIncorrectIconInPreviewTab(4, 'correct');
165
+ chartsBarPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
166
+ chartsBarPage.steps.verifyCorrectAnswerSectionNotExist();
167
+ });
168
+
169
+ it('When the user attempts the question partially correct by incorrectly setting a bar which was set to zero by default, then the user should be awarded with points for the correctly attempted/set bars and on switching to grading view correct/incorrect status message should not be displayed, correct icons should be displayed on the correctly attempted/set bars, incorrect icons should be displayed on the incorrectly attempted/set bars and correct answer section should be displayed with the correct answers', () => {
170
+ chartsBarPage.steps.resetQuestionPreview()
171
+ chartsBarPage.steps.setBarValueInPreviewTab({ barIndex: 2, value: 9, range: 10 });
172
+ chartsBarPage.steps.verifyPreviewScore(12, 20);
173
+ chartsBarPage.steps.switchToGradingView();
174
+ chartsBarPage.steps.verifyBarCorrectIncorrectIconInPreviewTab(0, 'correct');
175
+ chartsBarPage.steps.verifyBarCorrectIncorrectIconNotExistsInPreviewTab(1);
176
+ chartsBarPage.steps.verifyBarCorrectIncorrectIconInPreviewTab(2, 'incorrect');
177
+ chartsBarPage.steps.verifyBarCorrectIncorrectIconInPreviewTab(3, 'incorrect');
178
+ chartsBarPage.steps.verifyBarCorrectIncorrectIconInPreviewTab(4, 'correct');
179
+ chartsBarPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
180
+ chartsBarPage.steps.verifyBarInCorrectAnswerSection({ barIndex: 0, barValue: 3, range: 10 });
181
+ chartsBarPage.steps.verifyLockedBarInCorrectAnswerSection({ barIndex: 1, barValue: 2, range: 10 });
182
+ chartsBarPage.steps.verifyBarInCorrectAnswerSection({ barIndex: 2, barValue: 6, range: 10 });
183
+ chartsBarPage.steps.verifyBarInCorrectAnswerSection({ barIndex: 3, barValue: 5, range: 10 });
184
+ chartsBarPage.steps.verifyBarInCorrectAnswerSection({ barIndex: 4, barValue: 0, range: 10 });
185
+ chartsBarPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
186
+ cy.log('When the user selects check answer without attempting the question, then correct/incorrect status message should not be displayed, correct icons should be displayed for correctly attempted/set bars, incorrect icons should be displayed on the incorrectly attempted/set bars')
187
+ chartsBarPage.steps.checkAnswer();
188
+ chartsBarPage.steps.verifyBarCorrectIncorrectIconInPreviewTab(0, 'correct');
189
+ chartsBarPage.steps.verifyBarCorrectIncorrectIconNotExistsInPreviewTab(1);
190
+ chartsBarPage.steps.verifyBarCorrectIncorrectIconInPreviewTab(2, 'incorrect');
191
+ chartsBarPage.steps.verifyBarCorrectIncorrectIconInPreviewTab(3, 'incorrect');
192
+ chartsBarPage.steps.verifyBarCorrectIncorrectIconInPreviewTab(4, 'correct');
193
+ chartsBarPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
194
+ chartsBarPage.steps.verifyCorrectAnswerSectionNotExist();
195
+ });
196
+
197
+ it('When the user attempts the question partially correct by setting all bars correctly except 1 then the user should be awarded with points for the correctly attempted/set bars and on switching to grading view correct/incorrect status message should not be displayed, correct icons should be displayed on the correctly attempted/set bars and incorrect icons should be displayed on the incorrectly attempted/set bars and correct answer section should be displayed with the correct answers', () => {
198
+ chartsBarPage.steps.resetQuestionPreview()
199
+ chartsBarPage.steps.setBarValueInPreviewTab({ barIndex: 3, value: 5, range: 10 });
200
+ chartsBarPage.steps.verifyPreviewScore(16, 20);
201
+ chartsBarPage.steps.switchToGradingView();
202
+ chartsBarPage.steps.verifyBarCorrectIncorrectIconInPreviewTab(0, 'correct');
203
+ chartsBarPage.steps.verifyBarCorrectIncorrectIconNotExistsInPreviewTab(1);
204
+ chartsBarPage.steps.verifyBarCorrectIncorrectIconInPreviewTab(2, 'incorrect');
205
+ chartsBarPage.steps.verifyBarCorrectIncorrectIconInPreviewTab(3, 'correct');
206
+ chartsBarPage.steps.verifyBarCorrectIncorrectIconInPreviewTab(4, 'correct');
207
+ chartsBarPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
208
+ chartsBarPage.steps.verifyBarInCorrectAnswerSection({ barIndex: 0, barValue: 3, range: 10 });
209
+ chartsBarPage.steps.verifyLockedBarInCorrectAnswerSection({ barIndex: 1, barValue: 2, range: 10 });
210
+ chartsBarPage.steps.verifyBarInCorrectAnswerSection({ barIndex: 2, barValue: 6, range: 10 });
211
+ chartsBarPage.steps.verifyBarInCorrectAnswerSection({ barIndex: 3, barValue: 5, range: 10 });
212
+ chartsBarPage.steps.verifyBarInCorrectAnswerSection({ barIndex: 4, barValue: 0, range: 10 });
213
+ chartsBarPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
214
+ cy.log('When the user selects check answer without attempting the question, then correct/incorrect status message should not be displayed, correct icons should be displayed for correctly attempted/set bars, incorrect icons should be displayed on the incorrectly attempted/set bars')
215
+ chartsBarPage.steps.checkAnswer();
216
+ chartsBarPage.steps.verifyBarCorrectIncorrectIconInPreviewTab(0, 'correct');
217
+ chartsBarPage.steps.verifyBarCorrectIncorrectIconNotExistsInPreviewTab(1);
218
+ chartsBarPage.steps.verifyBarCorrectIncorrectIconInPreviewTab(2, 'incorrect');
219
+ chartsBarPage.steps.verifyBarCorrectIncorrectIconInPreviewTab(3, 'correct');
220
+ chartsBarPage.steps.verifyBarCorrectIncorrectIconInPreviewTab(4, 'correct');
221
+ chartsBarPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
222
+ chartsBarPage.steps.verifyCorrectAnswerSectionNotExist();
223
+ });
224
+
225
+ // Fully correct
226
+ it('When the user attempts the question correctly then the user should be awarded with full points and on switching to grading view \'Your answer is correct\' should be displayed, correct icons should be displayed on the correctly attempted/set bars and the correct answer section graph should not be displayed', () => {
227
+ chartsBarPage.steps.resetQuestionPreview()
228
+ chartsBarPage.steps.setBarValueInPreviewTab({ barIndex: 2, value: 6, range: 10 });
229
+ chartsBarPage.steps.setBarValueInPreviewTab({ barIndex: 3, value: 5, range: 10 });
230
+ chartsBarPage.steps.verifyPreviewScore(20, 20);
231
+ chartsBarPage.steps.switchToGradingView();
232
+ chartsBarPage.steps.verifyBarCorrectIncorrectIconInPreviewTab(0, 'correct');
233
+ chartsBarPage.steps.verifyBarCorrectIncorrectIconNotExistsInPreviewTab(1);
234
+ chartsBarPage.steps.verifyBarCorrectIncorrectIconInPreviewTab(2, 'correct');
235
+ chartsBarPage.steps.verifyBarCorrectIncorrectIconInPreviewTab(3, 'correct');
236
+ chartsBarPage.steps.verifyBarCorrectIncorrectIconInPreviewTab(4, 'correct');
237
+ chartsBarPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
238
+ chartsBarPage.steps.verifyCorrectAnswerSectionNotExist();
239
+ chartsBarPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
240
+ cy.log('When the user selects check answer without attempting the question, then correct/incorrect status message should not be displayed, correct icons should be displayed for correctly attempted/set bars')
241
+ chartsBarPage.steps.checkAnswer();
242
+ chartsBarPage.steps.verifyBarCorrectIncorrectIconInPreviewTab(0, 'correct');
243
+ chartsBarPage.steps.verifyBarCorrectIncorrectIconNotExistsInPreviewTab(1);
244
+ chartsBarPage.steps.verifyBarCorrectIncorrectIconInPreviewTab(2, 'correct');
245
+ chartsBarPage.steps.verifyBarCorrectIncorrectIconInPreviewTab(3, 'correct');
246
+ chartsBarPage.steps.verifyBarCorrectIncorrectIconInPreviewTab(4, 'correct');
247
+ chartsBarPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
248
+ chartsBarPage.steps.verifyCorrectAnswerSectionNotExist();
249
+ });
250
+ });
251
+ });