itemengine-cypress-automation 1.0.190-repoUpdate3May-f180558.0 → 1.0.191-7thMayFixes-2faebef.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (99) hide show
  1. package/cypress/e2e/ILC/AudioPlayerNew/allSupportedFileTypes.js +2 -0
  2. package/cypress/e2e/ILC/AudioPlayerNew/barAudioPlayerStyle.js +3 -30
  3. package/cypress/e2e/ILC/AudioPlayerNew/compactAudioPlayerStyle.js +0 -27
  4. package/cypress/e2e/ILC/AudioPlayerNew/customizePlayerLayoutSettings.js +9 -9
  5. package/cypress/e2e/ILC/AudioPlayerNew/standardAudioPlayerStyle.js +12 -12
  6. package/cypress/e2e/ILC/AudioResponseNew/barRecorderStyle.smoke.js +1 -1
  7. package/cypress/e2e/ILC/AudioResponseNew/editAndPreviewTabScoringSection.js +1 -1
  8. package/cypress/e2e/ILC/AudioResponseNew/editTabBasicSection.js +1 -0
  9. package/cypress/e2e/ILC/AudioResponseNew/headerSection.js +4 -20
  10. package/cypress/e2e/ILC/ChartsBar/allOrNothingScoringForAllViews.smoke.js +366 -0
  11. package/cypress/e2e/ILC/ChartsBar/checkAnswerFunctionalityForAllViews.smoke.js +181 -0
  12. package/cypress/e2e/ILC/ChartsBar/gradingViewAndCorrectAnswerView.smoke.js +283 -0
  13. package/cypress/e2e/ILC/ChartsBar/previewContentsForAllViews.smoke.js +396 -130
  14. package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/additionalSettingsBasic.js +1 -1
  15. package/cypress/e2e/ILC/DrawingResponse/drawingResponseAdditionalSettings.js +2 -2
  16. package/cypress/e2e/ILC/DrawingResponse/drawingResponseBackground.js +0 -3
  17. package/cypress/e2e/ILC/DrawingResponse/drawingResponseCustomizeAdditionalOptions.js +3 -5
  18. package/cypress/e2e/ILC/DrawingResponse/drawingResponseEditTabBasicSection.js +0 -4
  19. package/cypress/e2e/ILC/DrawingResponse/drawingResponseEditTabScoring.js +0 -1
  20. package/cypress/e2e/ILC/DrawingResponse/drawingResponsePageHeaderSection.js +4 -24
  21. package/cypress/e2e/ILC/DrawingResponse/drawingResponsePreviewTabContents.smoke.js +0 -9
  22. package/cypress/e2e/ILC/EditTabSettingPage/itemPreviewSettingsTabFunctionality.js +3 -3
  23. package/cypress/e2e/ILC/EssayResponse/essayResponseSpecialCharacters.js +0 -2
  24. package/cypress/e2e/ILC/EssayResponse/headerSection.js +3 -18
  25. package/cypress/e2e/ILC/EssayResponse/previewHyperlink.js +0 -1
  26. package/cypress/e2e/ILC/EssayResponseMath/mathCharacters.js +0 -1
  27. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/headerSection.js +0 -5
  28. package/cypress/e2e/ILC/FillInTheGapsDropdownNew/headerSection.js +0 -4
  29. package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/backgroundImageAndCanvasProperties.js +3 -3
  30. package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/headerSection.js +5 -5
  31. package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/studentViewSettings.js +3 -3
  32. package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/headerSection.js +0 -4
  33. package/cypress/e2e/ILC/FillInTheGapsTextNew/editTabScoringSection.js +1 -2
  34. package/cypress/e2e/ILC/FillInTheGapsTextNew/studentViewSettings.js +0 -2
  35. package/cypress/e2e/ILC/Graphing/allOrNothingForAllViews.smoke.js +2 -1
  36. package/cypress/e2e/ILC/GridFill/allOrNothingBasicForAllViews.smoke.js +6 -6
  37. package/cypress/e2e/ILC/GridFill/headerSection.js +4 -5
  38. package/cypress/e2e/ILC/ImageHighlight/allOrNothingForAllViews.smoke.js +276 -0
  39. package/cypress/e2e/ILC/ImageHighlight/checkAnswerFunctionalityForAllViews.smoke.js +141 -0
  40. package/cypress/e2e/ILC/ImageHighlight/previewContentsForAllViews.smoke.js +150 -0
  41. package/cypress/e2e/ILC/ListOrderingDropdown/allOrNothingForAllViews.smoke.js +1 -1
  42. package/cypress/e2e/ILC/ListOrderingDropdown/checkAnswerFunctionalityForAllViews.smoke.js +1 -1
  43. package/cypress/e2e/ILC/Matching/additionalSettings.js +1 -0
  44. package/cypress/e2e/ILC/Matching/headerSection.js +2 -2
  45. package/cypress/e2e/ILC/NumberLine/Scoring/allOrNothingWithAlternatePointsGreaterThanCorrectPoints.js +22 -20
  46. package/cypress/e2e/ILC/NumberLine/Scoring/allOrNothingWithCorrectPointsEqualToAlternatePoints.js +4 -2
  47. package/cypress/e2e/ILC/NumberLine/Scoring/allOrNothingWithCorrectPointsGreaterThanAlternativePoints.js +4 -2
  48. package/cypress/e2e/ILC/NumberLine/allOrNothingScoringForAllViews.smoke.js +3 -2
  49. package/cypress/e2e/ILC/NumberLine/checkAnswerFunctionalityForAllViews.smoke.js +2 -1
  50. package/cypress/e2e/ILC/NumberLine/editTabScoringSection.js +1 -8
  51. package/cypress/e2e/ILC/NumberLine/headerSection.js +3 -3
  52. package/cypress/e2e/ILC/NumberLine/studentViewSettings.js +1 -1
  53. package/cypress/e2e/ILC/NumberLine/verticalNumberLine/allOrNothingScoringForAllViews.smoke.js +5 -4
  54. package/cypress/e2e/ILC/NumberLineLabel/Scoring/allOrNothingAlternativePointsGreaterThanCorrectPoints.js +4 -2
  55. package/cypress/e2e/ILC/NumberLineLabel/Scoring/allOrNothingCorrectPointsEqualToAlternativePoints.js +4 -2
  56. package/cypress/e2e/ILC/NumberLineLabel/Scoring/allOrNothingCorrectPointsGreaterThanAlternativePoints.js +4 -2
  57. package/cypress/e2e/ILC/NumberLineLabel/allOrNothingForAllViews.smoke.js +2 -1
  58. package/cypress/e2e/ILC/NumberLineLabel/checkAnswerFunctionalityForAllViews.smoke.js +3 -2
  59. package/cypress/e2e/ILC/ShortTextResponseNew/editTabScoringSection.js +1 -1
  60. package/cypress/e2e/ILC/ShortTextResponseNew/headerSection.js +1 -7
  61. package/cypress/e2e/ILC/ShortTextResponseNew/studentViewSettings.js +0 -1
  62. package/cypress/e2e/ILC/TextEntryMath/evaluationMethodMatchExact.js +2 -2
  63. package/cypress/e2e/ILC/TextEntryMath/responseEvaluationMethodsAndCustomSettings.js +3 -3
  64. package/cypress/e2e/ILC/VideoResponseNew/customizePlaybackControls.js +2 -2
  65. package/cypress/e2e/ILC/VideoResponseNew/editTabBasicSection.js +2 -2
  66. package/cypress/e2e/ILC/VideoResponseNew/gradingViewAndCorrectAnswerViewContents.smoke.js +6 -6
  67. package/cypress/e2e/ILC/VideoResponseNew/previewContentsForAllViews.smoke.js +6 -6
  68. package/cypress/e2e/ILC/VideoResponseNew/standardRecorderStyle.js +9 -9
  69. package/cypress/e2e/ILC/VideoResponseNew/studentViewSettings.js +2 -4
  70. package/cypress/pages/audioPlayerPage.js +4 -2
  71. package/cypress/pages/audioResponsePage.js +2 -0
  72. package/cypress/pages/chartsBarPage.js +289 -3
  73. package/cypress/pages/components/autoScoredSpecifyCorrectAnswerSection.js +8 -5
  74. package/cypress/pages/components/autoScoredStudentViewSettings.js +1 -1
  75. package/cypress/pages/components/barAndLineChartComponent.js +7 -4
  76. package/cypress/pages/components/chartsCommonComponent.js +33 -0
  77. package/cypress/pages/components/imageCanvasComponent.js +3 -3
  78. package/cypress/pages/components/index.js +2 -1
  79. package/cypress/pages/components/questionInputFieldComponent.js +2 -1
  80. package/cypress/pages/components/resetPopupComponent.js +7 -3
  81. package/cypress/pages/components/scoringSectionBaseEditTab.js +6 -17
  82. package/cypress/pages/components/singleMultipleSelectionModeComponent.js +16 -0
  83. package/cypress/pages/contentBlocksPage.js +1 -1
  84. package/cypress/pages/dragAndDropIntoCategoriesPage.js +22 -24
  85. package/cypress/pages/drawingResponsePage.js +3 -2
  86. package/cypress/pages/fillInTheGapsOverImageDragAndDropPage.js +14 -0
  87. package/cypress/pages/fillInTheGapsOverImageDropdownPage.js +1 -1
  88. package/cypress/pages/imageHighlightPage.js +364 -0
  89. package/cypress/pages/index.js +2 -1
  90. package/cypress/pages/matchingPage.js +2 -1
  91. package/cypress/pages/numberLineLabelPage.js +14 -7
  92. package/cypress/pages/protractorPage.js +1 -1
  93. package/cypress/pages/readingRulerPage.js +1 -1
  94. package/cypress/pages/rulerPage.js +3 -3
  95. package/cypress/pages/textEntryMathPage.js +2 -2
  96. package/cypress/pages/videoResponsePage.js +6 -5
  97. package/package.json +1 -1
  98. package/cypress/e2e/ILC/EssayResponse/essayResponseAdditionalSettings.js +0 -432
  99. package/cypress/e2e/ILC/EssayResponse/essayResponseAdditionalSettingsBasic.js +0 -134
@@ -0,0 +1,283 @@
1
+ import { chartsBarPage, correctAnswerViewPage, itemPreviewPage, studentViewPage } from "../../../pages";
2
+ import { gradingViewPage } from "../../../pages";
3
+ import abortEarlySetup from "../../../support/helpers/abortEarly";
4
+ import utilities from "../../../support/helpers/utilities";
5
+ const css = Cypress.env('css');
6
+
7
+ let gradingAndCorrectAnsView = ['Grading view', 'Correct answer view']
8
+ const views = utilities.getViews(gradingAndCorrectAnsView);
9
+ var itemReferenceID = "";
10
+ const barBackgroundColor = ['rgb(46, 169, 89)', 'rgb(6, 117, 244)', 'rgb(219, 124, 0)', 'rgb(156, 105, 39)', 'rgb(219, 60, 0)'];
11
+
12
+
13
+ describe('Create item page - Charts - Bar: Grading view, Correct answer view contents', () => {
14
+ before(() => {
15
+ cy.loginAs('admin');
16
+ });
17
+
18
+ if (views.includes('Grading view')) {
19
+ describe('Grading view contents', { tags: 'smoke' }, () => {
20
+ abortEarlySetup();
21
+ before(() => {
22
+ chartsBarPage.steps.navigateToCreateQuestion('charts');
23
+ cy.barsPreLoaderWait();
24
+ chartsBarPage.steps.addTextInQuestionInstructionsInputField('Set the bar on the chart for the profits of the years');
25
+ chartsBarPage.steps.selectAddBarOrPointToolbarOption();
26
+ chartsBarPage.steps.addBarOrPointInChartInSelectChartTypeSection();
27
+ chartsBarPage.steps.setGraphTitle('Graph of profits');
28
+ chartsBarPage.steps.setYAxisLabel('Profit');
29
+ chartsBarPage.steps.setXAxisLabel('Year');
30
+ chartsBarPage.steps.setMaxYValue(20);
31
+ chartsBarPage.steps.setBarValueInSelectChartTypeSection({ barIndex: 0, value: 1, range: 20 });
32
+ chartsBarPage.steps.setBarValueInSelectChartTypeSection({ barIndex: 1, value: 2, range: 20 });
33
+ chartsBarPage.steps.setBarValueInSelectChartTypeSection({ barIndex: 2, value: 3, range: 20 });
34
+ chartsBarPage.steps.setBarValueInSelectChartTypeSection({ barIndex: 3, value: 4, range: 20 });
35
+ chartsBarPage.steps.lockBar(1);
36
+ chartsBarPage.steps.allotPoints(10);
37
+ chartsBarPage.steps.setBarValueInSpecifyCorrectAnswerSection({ barIndex: 0, value: 2, range: 20 });
38
+ chartsBarPage.steps.setBarValueInSpecifyCorrectAnswerSection({ barIndex: 2, value: 5, range: 20 });
39
+ chartsBarPage.steps.setBarValueInSpecifyCorrectAnswerSection({ barIndex: 3, value: 1, range: 20 });
40
+ chartsBarPage.steps.addBarOrPointInChartInSpecifyCorrectAnswerSection();
41
+ chartsBarPage.steps.setBarValueInSpecifyCorrectAnswerSection({ barIndex: 4, value: 8, range: 20 });
42
+ chartsBarPage.steps.clickOnSaveQuestionButton();
43
+ utilities.verifyElementVisibilityState(itemPreviewPage.referenceID(), 'visible');
44
+ //Global variable issue, not working inside before
45
+ itemPreviewPage.referenceID()
46
+ .invoke('text')
47
+ .then(($refID) => {
48
+ itemReferenceID = $refID;
49
+ cy.visit(`/item-engine/demo/render-item/student-view/${utilities.base64Encoding(itemReferenceID)}`);
50
+ chartsBarPage.steps.addBarOrPointInChartInPreviewTab();
51
+ chartsBarPage.steps.setBarValueInPreviewTab({ barIndex: 2, value: 5, range: 20 });
52
+ chartsBarPage.steps.setBarValueInPreviewTab({ barIndex: 4, value: 10, range: 20 });
53
+ studentViewPage.steps.submitResponse();
54
+ studentViewPage.steps.clickOnGoToGradingViewButton();
55
+ });
56
+ });
57
+
58
+ it('Question instructions should be visible', () => {
59
+ utilities.verifyInnerText(chartsBarPage.questionInstructionsText(), 'Set the bar on the chart for the profits of the years');
60
+ utilities.verifyElementVisibilityState(chartsBarPage.questionInstructionsText(), 'visible');
61
+ });
62
+
63
+ it('Graph title, Y axis label and X axis label set by the user should be displayed in the chart', () => {
64
+ utilities.verifyInnerText(chartsBarPage.previewTabGraphTitle(), 'Graph of profits');
65
+ utilities.verifyInnerText(chartsBarPage.previewTabYAxisLabelButton(), 'Profit');
66
+ utilities.verifyInnerText(chartsBarPage.previewTabXAxisLabelButton(), 'Year');
67
+ });
68
+
69
+ it('Toolbar, toolbar options and control actions(Undo, Redo, Reset) should not be displayed', () => {
70
+ utilities.verifyElementVisibilityState(chartsBarPage.previewTabTool(), 'notExist');
71
+ utilities.verifyElementVisibilityState(chartsBarPage.previewTabToolBarWrapper(), 'notExist');
72
+ });
73
+
74
+ it('The response submitted by the student should be displayed in grading view', () => {
75
+ chartsBarPage.steps.verifyBarHeightInPreviewTab({ barIndex: 0, barValue: 1, range: 20 });
76
+ chartsBarPage.steps.verifyBarHeightInPreviewTab({ barIndex: 1, barValue: 2, range: 20 });
77
+ chartsBarPage.steps.verifyBarHeightInPreviewTab({ barIndex: 2, barValue: 5, range: 20 });
78
+ chartsBarPage.steps.verifyBarHeightInPreviewTab({ barIndex: 3, barValue: 4, range: 20 });
79
+ chartsBarPage.steps.verifyBarHeightInPreviewTab({ barIndex: 4, barValue: 10, range: 20 });
80
+ });
81
+
82
+ it('The locked bar should have lock icon displayed in it', () => {
83
+ chartsBarPage.steps.verifyBarIsLockedInPreviewTab(1);
84
+ });
85
+
86
+ it('Correct and Incorrect icons should be displayed in each bar graph and locked bar should not have any correct or incorrect icon', () => {
87
+ chartsBarPage.steps.verifyBarCorrectIncorrectIconInPreviewTab(0, 'incorrect');
88
+ chartsBarPage.steps.verifyBarCorrectIncorrectIconNotExistsInPreviewTab(1);
89
+ chartsBarPage.steps.verifyBarCorrectIncorrectIconInPreviewTab(2, 'correct');
90
+ chartsBarPage.steps.verifyBarCorrectIncorrectIconInPreviewTab(3, 'incorrect');
91
+ chartsBarPage.steps.verifyBarCorrectIncorrectIconInPreviewTab(4, 'incorrect');
92
+ });
93
+
94
+ it('\'Your answer is incorrect\' label should be displayed', () => {
95
+ chartsBarPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
96
+ });
97
+
98
+ it('All the bar graphs in grading view should be non-editable', () => {
99
+ chartsBarPage.steps.verifyDragHandleNotVisible();
100
+ for (let index = 0; index < 5; index++) {
101
+ utilities.triggerMouseover(utilities.getNthElement(chartsBarPage.previewTabBar(), index));
102
+ utilities.verifyElementVisibilityState(chartsBarPage.barAndPointTooltipWrapper(), 'notExist');
103
+ }
104
+ });
105
+
106
+ it('Correct answer label should be displayed', () => {
107
+ utilities.verifyInnerText(chartsBarPage.correctAnswersLabel(), 'Correct answers');
108
+ utilities.verifyElementVisibilityState(chartsBarPage.correctAnswersLabel(), 'visible');
109
+ });
110
+
111
+ it('Correct answer should be displayed in the correct answer section', () => {
112
+ chartsBarPage.steps.verifyBarHeightInCorrectAnswerSection({ barIndex: 0, barValue: 2, range: 20 });
113
+ chartsBarPage.steps.verifyBarHeightInCorrectAnswerSection({ barIndex: 1, barValue: 2, range: 20 });
114
+ chartsBarPage.steps.verifyBarHeightInCorrectAnswerSection({ barIndex: 2, barValue: 5, range: 20 });
115
+ chartsBarPage.steps.verifyBarHeightInCorrectAnswerSection({ barIndex: 3, barValue: 1, range: 20 });
116
+ chartsBarPage.steps.verifyBarHeightInCorrectAnswerSection({ barIndex: 4, barValue: 8, range: 20 });
117
+ chartsBarPage.steps.verifyBarCorrectIconInCorrectAnswerSection(0);
118
+ chartsBarPage.steps.verifyBarCorrectIncorrectIconNotExistsInCorrectAnswerSection(1);
119
+ chartsBarPage.steps.verifyBarCorrectIconInCorrectAnswerSection(2);
120
+ chartsBarPage.steps.verifyBarCorrectIconInCorrectAnswerSection(3);
121
+ chartsBarPage.steps.verifyBarCorrectIconInCorrectAnswerSection(4);
122
+ chartsBarPage.steps.verifyGraphTitleInCorrectAnswerSection('Graph of profits');
123
+ chartsBarPage.steps.verifyYAxisLabelInCorrectAnswerSection('Profit');
124
+ chartsBarPage.steps.verifyXAxisLabelInCorrectAnswerSection('Year');
125
+ });
126
+
127
+ it('Points and the total score should be displayed', () => {
128
+ gradingViewPage.steps.verifyGradingViewScore(0, 10);
129
+ });
130
+
131
+ it('CSS of grading view', { tags: 'css' }, () => {
132
+ utilities.verifyCSS(chartsBarPage.previewTabGraphTitle(), {
133
+ 'color': css.color.text,
134
+ 'font-size': css.fontSize.default,
135
+ 'font-weight': css.fontWeight.bold
136
+ });
137
+ utilities.verifyCSS(chartsBarPage.previewTabYAxisLabelButton(), {
138
+ 'color': css.color.text,
139
+ 'font-size': css.fontSize.default,
140
+ 'font-weight': css.fontWeight.bold
141
+ });
142
+ utilities.verifyCSS(chartsBarPage.previewTabXAxisLabelButton(), {
143
+ 'color': css.color.text,
144
+ 'font-size': css.fontSize.default,
145
+ 'font-weight': css.fontWeight.bold
146
+ });
147
+ utilities.verifyCSS(chartsBarPage.previewTabBar().eq(0), {
148
+ 'background-color': barBackgroundColor[0]
149
+ });
150
+ utilities.verifyCSS(chartsBarPage.previewTabBar().eq(1), {
151
+ 'background-color': barBackgroundColor[1]
152
+ });
153
+ utilities.verifyCSS(chartsBarPage.previewTabBar().eq(2), {
154
+ 'background-color': barBackgroundColor[2]
155
+ });
156
+ utilities.verifyCSS(chartsBarPage.previewTabBar().eq(3), {
157
+ 'background-color': barBackgroundColor[3]
158
+ });
159
+ utilities.verifyCSS(chartsBarPage.previewTabBar().eq(4), {
160
+ 'background-color': barBackgroundColor[4]
161
+ });
162
+ utilities.verifyCSS(chartsBarPage.barLockIcon(), {
163
+ 'background-color': css.color.defaultBackground,
164
+ });
165
+ });
166
+
167
+ it('Accessibility of grading view', { tags: 'a11y' }, () => {
168
+ cy.checkAccessibility(chartsBarPage.previewTabBar().parents('[class*="question-preview-wrapper"]'));
169
+ });
170
+ });
171
+ }
172
+
173
+ if (views.includes('Correct answer view')) {
174
+ describe('Correct answer view contents', { tags: 'smoke' }, () => {
175
+ abortEarlySetup();
176
+ before(() => {
177
+ chartsBarPage.steps.navigateToCreateQuestion('charts');
178
+ cy.barsPreLoaderWait();
179
+ chartsBarPage.steps.addTextInQuestionInstructionsInputField('Set the bar on the chart for the profits of the years');
180
+ chartsBarPage.steps.selectAddBarOrPointToolbarOption();
181
+ chartsBarPage.steps.addBarOrPointInChartInSelectChartTypeSection();
182
+ chartsBarPage.steps.setGraphTitle('Graph of profits');
183
+ chartsBarPage.steps.setYAxisLabel('Profit');
184
+ chartsBarPage.steps.setXAxisLabel('Year');
185
+ chartsBarPage.steps.setMaxYValue(20);
186
+ chartsBarPage.steps.setBarValueInSelectChartTypeSection({ barIndex: 0, value: 1, range: 20 });
187
+ chartsBarPage.steps.setBarValueInSelectChartTypeSection({ barIndex: 1, value: 2, range: 20 });
188
+ chartsBarPage.steps.setBarValueInSelectChartTypeSection({ barIndex: 2, value: 3, range: 20 });
189
+ chartsBarPage.steps.setBarValueInSelectChartTypeSection({ barIndex: 3, value: 4, range: 20 });
190
+ chartsBarPage.steps.lockBar(1);
191
+ chartsBarPage.steps.allotPoints(10);
192
+ chartsBarPage.steps.setBarValueInSpecifyCorrectAnswerSection({ barIndex: 0, value: 2, range: 20 });
193
+ chartsBarPage.steps.setBarValueInSpecifyCorrectAnswerSection({ barIndex: 2, value: 5, range: 20 });
194
+ chartsBarPage.steps.setBarValueInSpecifyCorrectAnswerSection({ barIndex: 3, value: 1, range: 20 });
195
+ chartsBarPage.steps.addBarOrPointInChartInSpecifyCorrectAnswerSection();
196
+ chartsBarPage.steps.setBarValueInSpecifyCorrectAnswerSection({ barIndex: 4, value: 8, range: 20 });
197
+ chartsBarPage.steps.clickOnSaveQuestionButton();
198
+ utilities.verifyElementVisibilityState(itemPreviewPage.referenceID(), 'visible');
199
+ //Global variable issue, not working inside before
200
+ itemPreviewPage.referenceID()
201
+ .invoke('text')
202
+ .then(($refID) => {
203
+ itemReferenceID = $refID
204
+ cy.visit(`/item-engine/demo/render-item/correct-answer-view/${utilities.base64Encoding(itemReferenceID)}`);
205
+ });
206
+ });
207
+
208
+ it('Question instructions should be visible', () => {
209
+ utilities.verifyInnerText(chartsBarPage.questionInstructionsText(), 'Set the bar on the chart for the profits of the years');
210
+ utilities.verifyElementVisibilityState(chartsBarPage.questionInstructionsText(), 'visible');
211
+ });
212
+
213
+ it('Graph title, Y axis label and X axis label set by the user should be displayed in the chart', () => {
214
+ utilities.verifyInnerText(chartsBarPage.previewTabGraphTitle(), 'Graph of profits');
215
+ utilities.verifyInnerText(chartsBarPage.previewTabYAxisLabelButton(), 'Profit');
216
+ utilities.verifyInnerText(chartsBarPage.previewTabXAxisLabelButton(), 'Year');
217
+ });
218
+
219
+ it('Toolbar and control actions(Undo, Redo, Reset) should not be displayed', () => {
220
+ utilities.verifyElementVisibilityState(chartsBarPage.previewTabTool(), 'notExist');
221
+ utilities.verifyElementVisibilityState(chartsBarPage.previewTabToolBarWrapper(), 'notExist');
222
+ });
223
+
224
+ it('The correct answer set by user should be displayed in the correct answer view', () => {
225
+ chartsBarPage.steps.verifyBarHeightInPreviewTab({ barIndex: 0, barValue: 2, range: 20 });
226
+ chartsBarPage.steps.verifyBarHeightInPreviewTab({ barIndex: 1, barValue: 2, range: 20 });
227
+ chartsBarPage.steps.verifyBarHeightInPreviewTab({ barIndex: 2, barValue: 5, range: 20 });
228
+ chartsBarPage.steps.verifyBarHeightInPreviewTab({ barIndex: 3, barValue: 1, range: 20 });
229
+ chartsBarPage.steps.verifyBarHeightInPreviewTab({ barIndex: 4, barValue: 8, range: 20 });
230
+ chartsBarPage.steps.verifyBarCorrectIncorrectIconInPreviewTab(0, 'correct');
231
+ chartsBarPage.steps.verifyBarCorrectIncorrectIconNotExistsInPreviewTab(1);
232
+ chartsBarPage.steps.verifyBarIsLockedInPreviewTab(1);
233
+ chartsBarPage.steps.verifyBarCorrectIncorrectIconInPreviewTab(2, 'correct');
234
+ chartsBarPage.steps.verifyBarCorrectIncorrectIconInPreviewTab(3, 'correct');
235
+ chartsBarPage.steps.verifyBarCorrectIncorrectIconInPreviewTab(4, 'correct');
236
+ });
237
+
238
+ it('The points alloted to the question should be displayed', () => {
239
+ correctAnswerViewPage.steps.verifyAvailablePoints(10);
240
+ });
241
+
242
+ it('CSS of correct answer section', { tags: 'css' }, () => {
243
+ utilities.verifyCSS(chartsBarPage.previewTabGraphTitle(), {
244
+ 'color': css.color.text,
245
+ 'font-size': css.fontSize.default,
246
+ 'font-weight': css.fontWeight.bold
247
+ });
248
+ utilities.verifyCSS(chartsBarPage.previewTabYAxisLabelButton(), {
249
+ 'color': css.color.text,
250
+ 'font-size': css.fontSize.default,
251
+ 'font-weight': css.fontWeight.bold
252
+ });
253
+ utilities.verifyCSS(chartsBarPage.previewTabXAxisLabelButton(), {
254
+ 'color': css.color.text,
255
+ 'font-size': css.fontSize.default,
256
+ 'font-weight': css.fontWeight.bold
257
+ });
258
+ utilities.verifyCSS(chartsBarPage.previewTabBar().eq(0), {
259
+ 'background-color': barBackgroundColor[0]
260
+ });
261
+ utilities.verifyCSS(chartsBarPage.previewTabBar().eq(1), {
262
+ 'background-color': barBackgroundColor[1]
263
+ });
264
+ utilities.verifyCSS(chartsBarPage.previewTabBar().eq(2), {
265
+ 'background-color': barBackgroundColor[2]
266
+ });
267
+ utilities.verifyCSS(chartsBarPage.previewTabBar().eq(3), {
268
+ 'background-color': barBackgroundColor[3]
269
+ });
270
+ utilities.verifyCSS(chartsBarPage.previewTabBar().eq(4), {
271
+ 'background-color': barBackgroundColor[4]
272
+ });
273
+ utilities.verifyCSS(chartsBarPage.barLockIcon(), {
274
+ 'background-color': css.color.defaultBackground,
275
+ });
276
+ });
277
+
278
+ it('Accessibility of correct answer section', { tags: 'a11y' }, () => {
279
+ cy.checkAccessibility(chartsBarPage.previewTabBar().parents('[class*="question-preview-wrapper"]'));
280
+ });
281
+ });
282
+ }
283
+ });