itemengine-cypress-automation 1.0.204 → 1.0.205

Sign up to get free protection for your applications and to get access to all the features.
Files changed (107) hide show
  1. package/cypress/e2e/ILC/AudioPlayerNew/audioOverviewAndTranscript.js +2 -2
  2. package/cypress/e2e/ILC/ChartsBar/Scoring/addAndDeleteBarAllOrNothingScoring.js +302 -0
  3. package/cypress/e2e/ILC/ChartsBar/Scoring/manuallyAndNonScored.js +282 -0
  4. package/cypress/e2e/ILC/ChartsBar/Scoring/partialDifferentWeightsAlternativePointsGreaterThanCorrectPoints.js +385 -0
  5. package/cypress/e2e/ILC/ChartsBar/Scoring/partialDifferentWeightsCorrectPointsEqualToAlternativePoints.js +386 -0
  6. package/cypress/e2e/ILC/ChartsBar/Scoring/partialDifferentWeightsCorrectPointsGreaterThanAlternativePoints.js +386 -0
  7. package/cypress/e2e/ILC/ChartsBar/Scoring/partialDifferentWeightsMinimumAndPenaltyScoring.js +337 -0
  8. package/cypress/e2e/ILC/ChartsBar/Scoring/partialEqualWeightsCorrectPointsGreaterThanAlternativePoints.js +0 -1
  9. package/cypress/e2e/ILC/ChartsBar/chartFunctionalitySpecifyCorrectAnswerSection.js +258 -0
  10. package/cypress/e2e/ILC/ChartsBar/checkAnswerFunctionalityForAllViews.smoke.js +1 -1
  11. package/cypress/e2e/ILC/ChartsBar/gridSettings.js +439 -0
  12. package/cypress/e2e/ILC/ChartsBar/headerSection.js +105 -0
  13. package/cypress/e2e/ILC/ChartsBar/labelOptionsSection.js +450 -0
  14. package/cypress/e2e/ILC/ChartsBar/specifyCorrectAnswerSection.js +91 -0
  15. package/cypress/e2e/ILC/ChartsBar/toolSettings.js +73 -0
  16. package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/Scoring/manuallyAndNonScoredScoring.js +1 -1
  17. package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/Scoring/perDropzoneAlternativePointsGreaterThanCorrectPoints.js +3 -2
  18. package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/Scoring/perDropzoneCorrectPointsEqualToAlternativePoints.js +1 -1
  19. package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/Scoring/perDropzoneCorrectPointsGreaterThanAlternativePoints.js +1 -1
  20. package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/Scoring/perDropzoneMinimumAndPenaltyScoring.js +6 -6
  21. package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/additionalSettings.js +169 -0
  22. package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/editTabBasicSection.js +1 -1
  23. package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/styleAndLayoutCustomizationDraggableOptionProperties.js +223 -0
  24. package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/styleAndLayoutCustomizationDraggableOptionsPanel.js +119 -0
  25. package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/styleAndLayoutCustomizationDropzoneBorderStyleProperties.js +113 -0
  26. package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/styleAndLayoutCustomizationDropzoneProperties.js +251 -0
  27. package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/styleAndLayoutCustomizationLayoutProperties.js +277 -0
  28. package/cypress/e2e/ILC/EssayResponse/essayResponseCustomizeFormattingOptions1.smoke.js +0 -2
  29. package/cypress/e2e/ILC/EssayResponse/previewHyperlink.js +1 -5
  30. package/cypress/e2e/ILC/FeedbackScaleNew/editTabBasicSection.js +1 -0
  31. package/cypress/e2e/ILC/FillInTheGapsDropdownNew/editTabBasicSection.js +4 -4
  32. package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/dropdownOptionsSection.js +1 -0
  33. package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/editTabBasicSection.js +14 -1
  34. package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/styleAndLayoutCutomization.js +378 -0
  35. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/Scoring/partialDifferentWeightsAlternativePointsGreaterThanCorrectPoints.js +3 -3
  36. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/specifyCorrectAnswerSection.js +3 -1
  37. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/styleAndLayoutCustomization.js +479 -0
  38. package/cypress/e2e/ILC/GridFill/allOrNothingBasicForAllViews.smoke.js +3 -1
  39. package/cypress/e2e/ILC/GridFill/scoring/partialEqualWeightsCellShadeCountBasics.js +7 -7
  40. package/cypress/e2e/ILC/ListOrderingDropdown/Scoring/allOrNothingPenaltyScoring.js +1 -0
  41. package/cypress/e2e/ILC/ListOrderingDropdown/Scoring/manuallyAndNonScored.js +1 -0
  42. package/cypress/e2e/ILC/ListOrderingDropdown/Scoring/partialEqualWeightsAlternativePointsGreaterThanCorrectPoints.js +2 -2
  43. package/cypress/e2e/ILC/ListOrderingDropdown/Scoring/partialEqualWeightsCorrectPointsGreaterThanAlternativePoints.js +2 -3
  44. package/cypress/e2e/ILC/ListOrderingDropdown/minimumScoringPenaltyPointsAndRoundingDropdown.js +7 -7
  45. package/cypress/e2e/ILC/ListOrderingDropdown/studentViewSettings.js +1 -1
  46. package/cypress/e2e/ILC/ListOrderingNew/HorizontalOrientation/partialDifferentWeightsCorrectPointsGreaterThanAlternativePoints.js +3 -4
  47. package/cypress/e2e/ILC/ListOrderingNew/minimumScoringPenaltyPointsAndRoundingDropdown.js +10 -9
  48. package/cypress/e2e/ILC/Matching/toolSettings.js +1 -0
  49. package/cypress/e2e/ILC/MultipleSelection/additionalSettings.js +1 -0
  50. package/cypress/e2e/ILC/MultipleSelection/allOrNothingBasicForAllViews.smoke.js +36 -16
  51. package/cypress/e2e/ILC/MultipleSelection/allOrNothingWithAlternativeAnswer.js +326 -176
  52. package/cypress/e2e/ILC/MultipleSelection/blockCreateItem.js +2 -2
  53. package/cypress/e2e/ILC/MultipleSelection/manuallyAndNonScoredScoring.js +37 -15
  54. package/cypress/e2e/ILC/MultipleSelection/partialDifferentWeightsBasic.js +38 -17
  55. package/cypress/e2e/ILC/MultipleSelection/partialDifferentWeightsWithAlternativeAnswer.js +441 -186
  56. package/cypress/e2e/ILC/MultipleSelection/partialEqualWeightsBasic.js +33 -14
  57. package/cypress/e2e/ILC/MultipleSelection/partialEqualWeightsWithAlternativeAnswer.js +330 -164
  58. package/cypress/e2e/ILC/MultipleSelectionGridNew/Scoring/manuallyAndNonScored.js +1 -1
  59. package/cypress/e2e/ILC/MultipleSelectionGridNew/Scoring/partialDifferentWeightsAlternativePointsGreaterThanCorrectPoints.js +1 -1
  60. package/cypress/e2e/ILC/ShortTextResponseNew/manuallyAndNonScoredScoring.js +4 -4
  61. package/cypress/e2e/ILC/SingleSelection/allOrNothingBasicForAllViews.smoke.js +20 -7
  62. package/cypress/e2e/ILC/SingleSelection/allOrNothingWithAlternativeAnswer.js +83 -66
  63. package/cypress/e2e/ILC/SingleSelection/blockCreateItem.js +2 -2
  64. package/cypress/e2e/ILC/SingleSelection/manuallyAndNonScoredScoring.js +25 -17
  65. package/cypress/e2e/ILC/SingleSelection/trueOrFalseCreateItem.js +2 -2
  66. package/cypress/e2e/ILC/SingleSelectionGridNew/additionalSettings.js +89 -0
  67. package/cypress/e2e/ILC/SingleSelectionGridNew/editTabBasicSection.js +3 -3
  68. package/cypress/e2e/ILC/TextEntryMath/evaluationMethodEquivalentStructures.js +2 -2
  69. package/cypress/e2e/ILC/TextEntryMath/evaluationMethodValueIsEquivalent.js +2 -2
  70. package/cypress/e2e/ILC/TextEntryMathWithImage/backgroundImageAndCanvasProperties.js +2 -2
  71. package/cypress/e2e/ILC/VideoResponseNew/studentViewSettingsCompactRecorderStyle.js +0 -2
  72. package/cypress/e2e/ILC/chartsDotsPlot/allOrNothingForAllViews.smoke.js +2 -2
  73. package/cypress/e2e/ILC/chartsDotsPlot/scoring/allOrNothingPenaltyScoring.js +1 -1
  74. package/cypress/e2e/ILC/chartsDotsPlot/scoring/partialDifferentWeightsBasic.js +15 -15
  75. package/cypress/e2e/ILC/chartsDotsPlot/scoring/partialDifferentWeightsWithAlternativePointsGreaterThanCorrectPoints.js +21 -21
  76. package/cypress/e2e/ILC/chartsDotsPlot/scoring/partialDifferentWeightsWithCorrectPointsEqualToAlternativePoints.js +17 -17
  77. package/cypress/e2e/ILC/chartsDotsPlot/scoring/partialDifferentWeightsWithCorrectPointsGreaterThanAlternativePoints.js +21 -21
  78. package/cypress/e2e/ILC/chartsDotsPlot/scoring/toleranceThresholdScoring.js +1 -1
  79. package/cypress/e2e/ILC/chartsDotsPlot/selectChartTypeSection.js +8 -4
  80. package/cypress/e2e/ILC/chartsDotsPlot/toolSettings.js +0 -1
  81. package/cypress/fixtures/drawingToolbarOptionsAdditionalOptionsAndSpecialAndMathCharacters.js +2 -2
  82. package/cypress/pages/audioResponsePage.js +1 -1
  83. package/cypress/pages/chartsBarPage.js +785 -5
  84. package/cypress/pages/components/autoScoredScoringSectionMultiResponseType.js +1 -0
  85. package/cypress/pages/components/backgroundImageUploadComponent.js +1 -1
  86. package/cypress/pages/components/barAndLineChartComponent.js +180 -9
  87. package/cypress/pages/components/chartsCommonComponent.js +1 -0
  88. package/cypress/pages/components/connectorStyleStyleAndLayoutCustomizationComponent.js +77 -0
  89. package/cypress/pages/components/essayResponseCommonComponents.js +2 -3
  90. package/cypress/pages/components/figCommonStyleAndLayoutComponent.js +1 -1
  91. package/cypress/pages/components/fillInTheGapsDropdownCommonComponent.js +24 -7
  92. package/cypress/pages/components/fillInTheGapsTextCommonComponent.js +8 -4
  93. package/cypress/pages/components/gridQuestionCommonComponent.js +1 -1
  94. package/cypress/pages/components/imageCanvasComponent.js +112 -2
  95. package/cypress/pages/components/index.js +1 -0
  96. package/cypress/pages/components/layoutSectionComponent.js +4 -3
  97. package/cypress/pages/dragAndDropIntoCategoriesPage.js +960 -3
  98. package/cypress/pages/drawingResponsePage.js +2 -2
  99. package/cypress/pages/fillInTheGapsDragAndDropPage.js +4 -3
  100. package/cypress/pages/fillInTheGapsOverImageDropdownPage.js +18 -3
  101. package/cypress/pages/fillInTheGapsOverImageTextPage.js +65 -3
  102. package/cypress/pages/listOrderingPage.js +3 -3
  103. package/cypress/pages/multipleSelectionPage.js +77 -25
  104. package/cypress/pages/rulerPage.js +5 -0
  105. package/cypress/pages/singleSelectionPage.js +40 -1
  106. package/cypress/pages/videoResponsePage.js +1 -1
  107. package/package.json +1 -1
@@ -1,6 +1,7 @@
1
1
  import utilities from "../support/helpers/utilities"
2
- import { barAndLineChartComponent, chartsCommonComponent, createQuestionBasePage, questionInstructionsComponent, resetPopupComponent, scoringSectionBaseEditTab, commonComponents, autoScoredStudentViewSettings, autoScoredScoringPreviewTab, autoScoredScoringSectionMultiResponseType, autoScoredSpecifyCorrectAnswerSection, correctIncorrectAnswerLabelComponent, studentViewSettingsLabelComponent } from "./components";
2
+ import { barAndLineChartComponent, chartsCommonComponent, createQuestionBasePage, questionInstructionsComponent, resetPopupComponent, scoringSectionBaseEditTab, commonComponents, autoScoredStudentViewSettings, autoScoredScoringPreviewTab, autoScoredScoringSectionMultiResponseType, autoScoredSpecifyCorrectAnswerSection, correctIncorrectAnswerLabelComponent, studentViewSettingsLabelComponent, layoutSectionComponent } from "./components";
3
3
  import { dialogBoxBase } from "./dialogBoxBase";
4
+ import { selectQuestionResourceToolPage } from "./selectQuestionResourceToolPage";
4
5
  const css = Cypress.env('css');
5
6
 
6
7
  const selectors = {
@@ -13,6 +14,10 @@ const selectors = {
13
14
  ...autoScoredScoringPreviewTab,
14
15
  ...correctIncorrectAnswerLabelComponent,
15
16
  ...chartsCommonComponent,
17
+ ...selectQuestionResourceToolPage,
18
+ ...autoScoredSpecifyCorrectAnswerSection,
19
+ ...layoutSectionComponent,
20
+
16
21
  barDragHandle: () => cy.get('.bar-drag-handle'),
17
22
  bar: () => cy.get('.ngie-chart-point'),
18
23
  selectChartTypeMaxXLabel: () => cy.get('[class*="ChartsPreviewstyles__CustomInputFieldLabel"]'),
@@ -22,15 +27,47 @@ const selectors = {
22
27
  barLockIcon: () => cy.get('[class*="ChartGridstyle__BarLockIconWrapper"]'),
23
28
  selectChartTypeBarLabel: () => cy.get('[class*="Chartsstyles__ChartsQuestionWrapper"] [class*="ChartGridstyle__NameDiv-"]'),
24
29
  selectChartTypeMaxBarCountInputField: () => cy.get('[id="max bar count"]'),
30
+ barOptionsLabel: () => cy.get('.bar-options-wrapper .chart-option-label'),
31
+ directionLabel: () => cy.get('.bar-options .additional-settings-label').eq(0),
32
+ verticalDirectionRadioButton: () => cy.get('.bar-options input[id*="vertical"]'),
33
+ verticalDirectionLabel: () => cy.get('.bar-options [data-value="vertical"] .title-casing'),
34
+ horizontalDirectionRadioButton: () => cy.get('.bar-options input[id*="horizontal"]'),
35
+ horizontalDirectionLabel: () => cy.get('.bar-options [data-value="horizontal"] .title-casing'),
36
+ barSpacingLabel: () => cy.get('.bar-options .additional-settings-label').eq(1),
37
+ addGapBetweenBarsCheckbox: () => cy.get('[data-ngie-testid="add-gap-between-bars-checkbox"] input'),
38
+ addGapBetweenBarsLabel: () => cy.get('[data-ngie-testid="add-gap-between-bars-checkbox"] .MuiFormControlLabel-label'),
39
+ maxBarCountLabel: () => cy.get('.bar-options-wrapper [class*="NumberFieldWrapper"] .input-label-fields'),
40
+ barLabelsLabel: () => cy.get('[data-ngie-testid="bar-labels-checkbox"] .MuiFormControlLabel-label'),
41
+ barLabelsCheckbox: () => cy.get('[data-ngie-testid="bar-labels-checkbox"] input'),
42
+ newBarLabelLabel: () => cy.get('.label-options-wrapper [class*="PropertyLabel"]'),
43
+ newBarLabelInputField: () => cy.get('.label-options-wrapper .text-field'),
44
+ tickIntervalPositionLabel: () => cy.get('.tick-position-options-wrapper .chart-option-label'),
45
+ labelLocationLabel: () => cy.get('.tick-position-options-wrapper .additional-settings-label'),
46
+ centeredRadioButton: () => cy.get('[data-value="centered"] input'),
47
+ centeredLabel: () => cy.get('[data-value="centered"] .ngie-radio-label'),
48
+ atIntervalRadioButton: () => cy.get('[data-value="atInterval"] input'),
49
+ atIntervalLabel: () => cy.get('[data-value="atInterval"] .ngie-radio-label'),
50
+ xAxisCoordinateSelectChartType: () => cy.get('[class*="Chartsstyles__ChartsQuestionWrapper"] [class*="ChartGridstyle__HorizontalNameDiv"]'),
51
+ barLabelHorizontalSelectChartType: () => cy.get('[class*="Chartsstyles__ChartsQuestionWrapper"] [class*="ChartGridstyle__ValueDiv"]'),
52
+ selectChartTypeMaxXAndYLabel: () => cy.get('[class*="ChartsPreviewstyles__CustomInputFieldLabel"]'),
53
+ selectChartTypeMaxXAndYInputField: () => cy.get('[class*="ChartsPreviewstyles__CustomInputFieldWrapper"] input'),
54
+
25
55
  //specify correct answer section
26
56
  specifyCorrectAnswerBarDragHandle: () => cy.get('.ngie-accordion .bar-drag-handle'),
27
57
  specifyCorrectAnswerBar: () => cy.get('.ngie-accordion .ngie-chart-point'),
58
+ specifyCorrectAnswerBarLabel: () => cy.get('.ngie-accordion [class*="ChartGridstyle__NameDiv-"]'),
59
+ colorBlockBarTooltipSpecifyCorrectAnswer: () => cy.get('.ngie-accordion [class*="ChartTooltipstyles__ColorBox"]'),
60
+ barLabelBarToolTipSpecifyCorrectAnswer: () => cy.get('.ngie-accordion [class*="ChartTooltipstyles__Label"]'),
61
+ xAxisCoordinateSpecifyCorrectAnswer: () => cy.get('.ngie-accordion [class*="ChartGridstyle__HorizontalNameDiv"]'),
62
+ barLabelHorizontalSpecifyCorrectAnswer: () => cy.get('.ngie-accordion [class*="ChartGridstyle__ValueDiv"]'),
28
63
 
29
64
  //Preview tab
30
65
  previewTabBarDragHandle: () => cy.get('[class*="question-preview-wrapper"] [class*="ChartsPreviewstyles__PreviewWrapper"] .bar-drag-handle'),
31
66
  previewTabBar: () => cy.get('[class*="question-preview-wrapper"] [class*="ChartsPreviewstyles__PreviewWrapper"] .ngie-chart-point'),
32
67
  previewTabBarLabel: () => cy.get('[class*="question-preview-wrapper"] [class*="ChartsPreviewstyles__PreviewWrapper"] [class*="ChartGridstyle__NameDiv-"]'),
33
- previewTabBarTooltipColorBlock: () => cy.get('[class*="question-preview-wrapper"] [class*="ChartsPreviewstyles__PreviewWrapper"] [class*="ChartTooltipstyles__ColorBox"]')
68
+ previewTabBarTooltipColorBlock: () => cy.get('[class*="question-preview-wrapper"] [class*="ChartsPreviewstyles__PreviewWrapper"] [class*="ChartTooltipstyles__ColorBox"]'),
69
+ xAxisCoordinatePreviewTab: () => cy.get('[class*="question-preview-wrapper"] [class*="ChartsPreviewstyles__PreviewWrapper"] [class*="ChartGridstyle__HorizontalNameDiv"]'),
70
+ barLabelHorizontalPreviewTab: () => cy.get('[class*="question-preview-wrapper"] [class*="ChartsPreviewstyles__PreviewWrapper"] [class*="ChartGridstyle__ValueDiv"]'),
34
71
  }
35
72
 
36
73
  const steps = {
@@ -44,7 +81,9 @@ const steps = {
44
81
  ...autoScoredScoringSectionMultiResponseType.steps,
45
82
  ...autoScoredSpecifyCorrectAnswerSection.steps,
46
83
  ...correctIncorrectAnswerLabelComponent.steps,
84
+ ...layoutSectionComponent.steps,
47
85
  ...chartsCommonComponent.steps,
86
+ ...dialogBoxBase.steps,
48
87
  /**
49
88
  * @description set the bar height/value in the select chart type section chart
50
89
  * @param {Object} barProperties - The properties and changes to be done on the bar
@@ -77,8 +116,32 @@ const steps = {
77
116
  });
78
117
  },
79
118
 
119
+ /**
120
+ * @description updates height of bar once
121
+ * @param {number} barIndex index of bar
122
+ */
123
+ keyBoardUpBarInSelectChartType: (barIndex) => {
124
+ utilities.getNthElement(chartsBarPage.selectChartTypeBarDragHandle(), barIndex)
125
+ .focus()
126
+ .type('{upArrow}');
127
+ },
128
+
129
+ /**
130
+ * Verify the bar height
131
+ * @param {Object} barProperties - The properties of the bar
132
+ * @param {number} barProperties.barIndex index of the bar
133
+ * @param {number} barProperties.barValue Height of the bar as per the axis
134
+ * @param {number} barProperties.range Maximum value of the axis on which bar value is determined
135
+ */
136
+ verifyBarHeightInSelectChartType: ({ barIndex, barValue, range }) => {
137
+ let barHeight = barValue / range
138
+ utilities.getNthElement(chartsBarPage.selectChartTypeBar(), barIndex)
139
+ .should('have.attr', 'height', barHeight);
140
+ },
141
+
80
142
  /**
81
143
  * @description increase the bar height/value in the specify correct answer section chart
144
+ * @description set the bar height/value in the specify correct answer section chart
82
145
  * @param {Object} barProperties - The properties and changes to be done on the bar
83
146
  * @param {number} barProperties.barIndex index of the bar
84
147
  * @param {number} barProperties.value value by which the bar height is to be increased as per Y axis
@@ -109,6 +172,29 @@ const steps = {
109
172
  });
110
173
  },
111
174
 
175
+ /**
176
+ * @description updates height of bar once
177
+ * @param {number} barIndex index of bar
178
+ */
179
+ keyBoardUpBarInSpecifyCorrectAnswer: (barIndex) => {
180
+ utilities.getNthElement(chartsBarPage.specifyCorrectAnswerBarDragHandle(), barIndex)
181
+ .focus()
182
+ .type('{upArrow}');
183
+ },
184
+
185
+ /**
186
+ * Verify the bar height
187
+ * @param {Object} barProperties - The properties of the bar
188
+ * @param {number} barProperties.barIndex index of the bar
189
+ * @param {number} barProperties.barValue Height of the bar as per the axis
190
+ * @param {number} barProperties.range Maximum value of the axis on which bar value is determined
191
+ */
192
+ verifyBarHeightInSpecifyCorrectAnswer: ({ barIndex, barValue, range }) => {
193
+ let barHeight = barValue / range
194
+ utilities.getNthElement(chartsBarPage.specifyCorrectAnswerBar(), barIndex)
195
+ .should('have.attr', 'height', barHeight);
196
+ },
197
+
112
198
  /**
113
199
  * @description Lock the bar in select chart type section chart
114
200
  * @param {number} barIndex Index of the bar to be locked
@@ -153,6 +239,103 @@ const steps = {
153
239
  .blur();
154
240
  },
155
241
 
242
+ /**
243
+ * @description verifies Max bar count value
244
+ * @param {number} value Max bar value to be verified
245
+ */
246
+ verifyMaxBarCountValue: (value) => {
247
+ chartsBarPage.selectChartTypeMaxBarCountInputField()
248
+ .should('have.value', value);
249
+ },
250
+
251
+ /**
252
+ * Verify the bar height
253
+ * @param {Object} barProperties - The properties of the bar
254
+ * @param {number} barProperties.barIndex index of the bar
255
+ * @param {number} barProperties.barValue Height of the bar as per the axis
256
+ * @param {number} barProperties.range Maximum value of the axis on which bar value is determined
257
+ */
258
+ verifyBarHeightInSpecifyCorrectAnswer: ({ barIndex, barValue, range }) => {
259
+ const barHeight = barValue / range;
260
+ chartsBarPage.chartContainerSpecifyCorrectAnswer()
261
+ .within(() => {
262
+ utilities.getNthElement(chartsBarPage.bar(), barIndex)
263
+ .should('have.attr', 'height', barHeight);
264
+ });
265
+ },
266
+
267
+ /**
268
+ * Verify the bar is locked in correct answer section
269
+ * @param {number} barIndex index of the bar
270
+ */
271
+ verifyBarIsLockedInSpecifyCorrectAnswer: (barIndex) => {
272
+ chartsBarPage.chartContainerSpecifyCorrectAnswer()
273
+ .within(() => {
274
+ utilities.getNthElement(chartsBarPage.bar(), barIndex)
275
+ .within(() => {
276
+ utilities.verifyElementVisibilityState(chartsBarPage.barLockIcon(), 'visible');
277
+ utilities.verifyElementVisibilityState(chartsBarPage.barDragHandle().find('svg'), 'notExist');
278
+ });
279
+ });
280
+ },
281
+
282
+ /**
283
+ * Verify the correct/incorrect icon not exists for bar
284
+ * @param {number} barIndex index of the bar
285
+ */
286
+ verifyBarCorrectIncorrectIconNotExistsInSpecifyCorrectAnswer: (barIndex) => {
287
+ chartsBarPage.chartContainerSpecifyCorrectAnswer()
288
+ .within(() => {
289
+ utilities.getNthElement(chartsBarPage.bar(), barIndex)
290
+ .within(() => {
291
+ utilities.verifyElementVisibilityState(chartsBarPage.tickIconWrapper(), 'notExist');
292
+ });
293
+ });
294
+ },
295
+
296
+ /**
297
+ * @description verify locked bar
298
+ * @param {Object} barProperties - The properties and changes to be done on the bar
299
+ * @param {number} barProperties.barIndex index of the bar
300
+ * @param {number} barProperties.barValue value of th bar as per Y axis
301
+ * @param {number} barProperties.range Maximum value of the axis on which bar value is determined
302
+ */
303
+ verifyLockedBarInSpecifyCorrectAnswer: ({ barIndex, barValue, range }) => {
304
+ chartsBarPage.steps.verifyBarHeightInSpecifyCorrectAnswer({ barIndex, barValue, range });
305
+ chartsBarPage.steps.verifyBarIsLockedInSpecifyCorrectAnswer(barIndex);
306
+ chartsBarPage.steps.verifyBarCorrectIncorrectIconNotExistsInSpecifyCorrectAnswer(barIndex);
307
+ },
308
+
309
+ /**
310
+ * Verify locked bar is uneditable in preview tab
311
+ * @param {number} barIndex index of the bar
312
+ */
313
+ verifyLockedBarIsUneditableInSpecifyCorrectAnswer: (barIndex) => {
314
+ utilities.getNthElement(chartsBarPage.specifyCorrectAnswerBar(), barIndex)
315
+ .invoke('attr', 'height')
316
+ .then((barValue) => {
317
+ let originalBarValue = barValue;
318
+ utilities.verifyElementVisibilityState(chartsBarPage.dragHandleButton(), 'notExist');
319
+ utilities.getNthElement(chartsBarPage.specifyCorrectAnswerBar(), barIndex)
320
+ .should('have.attr', 'height', originalBarValue);
321
+ });
322
+ },
323
+
324
+ /**
325
+ * @description Edit bar label
326
+ * @param {number} barIndex Index of the bar to be edited
327
+ * @param {string} barLabel Label to be given to the bar
328
+ */
329
+ editBarLabelInSpecifyCorrectAnswer: (barIndex, barLabel) => {
330
+ utilities.triggerMouseover(utilities.getNthElement(chartsBarPage.specifyCorrectAnswerBar(), barIndex))
331
+ chartsBarPage.barAndPointTooltipLabelButton()
332
+ .click();
333
+ chartsBarPage.steps.addInputToChartLabelPopupInputField(barLabel);
334
+ chartsBarPage.steps.saveGraphLabelPopup();
335
+ utilities.triggerMouseout(utilities.getNthElement(chartsBarPage.specifyCorrectAnswerBar(), barIndex));
336
+ utilities.verifyInnerText(utilities.getNthElement(chartsBarPage.specifyCorrectAnswerBarLabel(), barIndex), barLabel);
337
+ },
338
+
156
339
  //Preview tab
157
340
  /**
158
341
  * Verify the bar height in preview tab
@@ -261,7 +444,7 @@ const steps = {
261
444
 
262
445
  /**
263
446
  * @description Delete bar in preview tab
264
- * @param {number} barIndex Index of the bar to be deleted
447
+ *@param {number} barIndex Index of the bar to be deleted
265
448
  */
266
449
  deleteBarInPreviewTab: (barIndex) => {
267
450
  utilities.triggerMouseover(utilities.getNthElement(chartsBarPage.previewTabBar(), barIndex))
@@ -269,6 +452,16 @@ const steps = {
269
452
  .click();
270
453
  },
271
454
 
455
+ /**
456
+ * @description Delete bar in specify correct answer section
457
+ * @param {number} barIndex Index of the bar to be deleted
458
+ */
459
+ deleteBarInSpecifyCorrectAnswerSection: (barIndex) => {
460
+ utilities.triggerMouseover(utilities.getNthElement(chartsBarPage.specifyCorrectAnswerBar(), barIndex))
461
+ chartsBarPage.barAndPointTooltipDeleteButton()
462
+ .click();
463
+ },
464
+
272
465
  /**
273
466
  * Verify the bar height in correct answer section tab
274
467
  * @param {Object} barProperties - The properties of the bar
@@ -399,6 +592,25 @@ const steps = {
399
592
  },
400
593
 
401
594
  /**
595
+ * @description Delete bar
596
+ *@param {number} barIndex Index of the bar to be deleted
597
+ */
598
+ deleteBarInSpecifyCorrectAnswer: (barIndex) => {
599
+ utilities.triggerMouseover(utilities.getNthElement(chartsBarPage.specifyCorrectAnswerBar(), barIndex))
600
+ chartsBarPage.barAndPointTooltipDeleteButton()
601
+ .click();
602
+ },
603
+
604
+ /**
605
+ * Verifies if the label of a bar at the specified index matches the specified correct answer.
606
+ * @param {number} index - The index of the bar whose label is to be verified.
607
+ * @param {string} label - The expected label of the bar.
608
+ */
609
+ verifyBarLabelSpecifyCorrectAnswer: (index, label) => {
610
+ utilities.verifyInnerText(utilities.getNthElement(chartsBarPage.specifyCorrectAnswerBarLabel(), index), label);
611
+ },
612
+
613
+ /**
402
614
  * @param {("correct" | "incorrect")} answerStatus - The status of the answer.
403
615
  * @description Verifies the visibility and content of the correct/incorrect answer label block.
404
616
  * If the answer is correct, it also verifies the visibility of the correct icon;
@@ -412,14 +624,473 @@ const steps = {
412
624
  } else {
413
625
  utilities.verifyElementVisibilityState(autoScoredScoringPreviewTab.incorrectIcon(), 'visible');
414
626
  }
415
- }
627
+ },
628
+
629
+ /**
630
+ * Verifies labels in the y-axis of the select chart type chart.
631
+ * @param {number} max - The maximum value.
632
+ * @param {number} interval - The interval between values.
633
+ */
634
+ verifyLabelsInSelectChartType: (max, interval) => {
635
+ cy.wait(2000);
636
+ barAndLineChartComponent.yAxisCoordinate()
637
+ .its('length').then((len) => {
638
+ for (let index = 0; index < len; index++) {
639
+ barAndLineChartComponent.yAxisCoordinate()
640
+ .eq(index)
641
+ .should('have.text', max);
642
+ max -= interval;
643
+ }
644
+ });
645
+ },
646
+
647
+ /**
648
+ * Verifies annotated labels in the y-axis of the select chart type chart.
649
+ * @param {number} max - The maximum value.
650
+ * @param {number} annotateEvery - The interval for annotations
651
+ */
652
+ verifyAnnotatedLabelsSelectChartType: (max, annotateEvery) => {
653
+ cy.wait(2000);
654
+ barAndLineChartComponent.yAxisCoordinate()
655
+ .each(($element, index) => {
656
+ if (index % annotateEvery === 0) {
657
+ cy.wrap($element).should('have.text', max);
658
+ max -= annotateEvery;
659
+ }
660
+ });
661
+ },
662
+
663
+ /**
664
+ * Verifies the maximum value label on the y-axis of the select chart type chart.
665
+ * @param {number} max - The expected maximum value.
666
+ */
667
+ verifyMaxValueOnYAxis: (max) => {
668
+ chartsBarPage.selectChartTypeBarLabel()
669
+ .eq(0)
670
+ .should('have.text', max);
671
+ },
672
+
673
+ verifyCenteredRadioButtonSelected: () => {
674
+ chartsBarPage.centeredRadioButton()
675
+ .should('be.checked');
676
+ },
677
+
678
+ verifyAtIntervalRadioButtonSelected: () => {
679
+ chartsBarPage.atIntervalRadioButton()
680
+ .should('be.checked');
681
+ },
682
+
683
+ selectCenteredRadioButton: () => {
684
+ chartsBarPage.centeredRadioButton()
685
+ .click()
686
+ .should('be.checked');
687
+ },
688
+
689
+ selectAtIntervalRadioButton: () => {
690
+ chartsBarPage.atIntervalRadioButton()
691
+ .click()
692
+ .should('be.checked');
693
+ },
694
+
695
+ verifyBarLabelsCheckboxChecked: () => {
696
+ chartsBarPage.barLabelsCheckbox()
697
+ .should('be.checked');
698
+ },
699
+
700
+ uncheckBarLabelsCheckbox: () => {
701
+ chartsBarPage.barLabelsCheckbox()
702
+ .click()
703
+ .should('not.be.checked');
704
+ },
705
+
706
+ /**
707
+ * Updates the value of the input field for new bar labels.
708
+ * @param {string} text - The text to be entered into the input field.
709
+ */
710
+ updateNewBarLabelInputFieldValue: (text) => {
711
+ chartsBarPage.newBarLabelInputField()
712
+ .clear()
713
+ .type(text)
714
+ .should('have.value', text);
715
+ },
716
+
717
+ /**
718
+ * Verifies the value of the input field for new bar labels.
719
+ * @param {string} text - The expected value of the input field.
720
+ */
721
+ verifyNewBarLabelInputFieldValue: (text) => {
722
+ chartsBarPage.newBarLabelInputField()
723
+ .should('have.value', text);
724
+ },
725
+
726
+
727
+ verifyAddGapBetweenBarsCheckboxChecked: () => {
728
+ chartsBarPage.addGapBetweenBarsCheckbox()
729
+ .should('be.checked');
730
+ },
731
+
732
+ uncheckAddGapBetweenBarsCheckbox: () => {
733
+ chartsBarPage.addGapBetweenBarsCheckbox()
734
+ .click()
735
+ .should('not.be.checked');
736
+ },
737
+
738
+ verifyVerticalDirectionRadioButtonSelected: () => {
739
+ chartsBarPage.verticalDirectionRadioButton()
740
+ .should('be.checked');
741
+ },
742
+
743
+ selectVerticalDirectionRadioButton: () => {
744
+ chartsBarPage.verticalDirectionRadioButton()
745
+ .click()
746
+ .should('be.checked');
747
+ },
748
+
749
+ verifyHorizontalDirectionRadioButtonSelected: () => {
750
+ chartsBarPage.horizontalDirectionRadioButton()
751
+ .should('be.checked');
752
+ },
753
+
754
+ selectHorizontalDirectionRadioButton: () => {
755
+ chartsBarPage.horizontalDirectionRadioButton()
756
+ .click()
757
+ .should('be.checked');
758
+ },
759
+
760
+ /**
761
+ * Verify labels in the specify correct answer chart's y-axis.
762
+ * @param {number} max - The maximum value.
763
+ * @param {number} interval - The interval between values.
764
+ */
765
+ verifyLabelsInSpecifyCorrectAnswer: (max, interval) => {
766
+ barAndLineChartComponent.yAxisCoordinateSpecifyCorrectAnswer()
767
+ .its('length').then((len) => {
768
+ for (let index = 0; index < len; index++) {
769
+ barAndLineChartComponent.yAxisCoordinateSpecifyCorrectAnswer()
770
+ .eq(index)
771
+ .should('have.text', max);
772
+ max -= interval;
773
+ }
774
+ });
775
+ },
776
+
777
+ /**
778
+ * Verify annotated labels in the specify correct answer chart's y-axis.
779
+ * @param {number} max - The maximum value.
780
+ * @param {number} annotateEvery - The interval for annotations.
781
+ */
782
+ verifyAnnotatedLabelsSpecifyCorrectAnswer: (max, annotateEvery) => {
783
+ barAndLineChartComponent.yAxisCoordinateSpecifyCorrectAnswer()
784
+ .each(($element, index) => {
785
+ if (index % annotateEvery === 0) {
786
+ cy.wrap($element).should('have.text', max);
787
+ max -= annotateEvery;
788
+ }
789
+ });
790
+ },
791
+
792
+ /**
793
+ * Verify labels in the preview tab's y-axis.
794
+ * @param {number} max - The maximum value.
795
+ * @param {number} interval - The interval between values.
796
+ */
797
+ verifyLabelsInPreviewTab: (max, interval) => {
798
+ barAndLineChartComponent.previewTabYAxisCoordinate()
799
+ .its('length').then((len) => {
800
+ for (let index = 0; index < len; index++) {
801
+ barAndLineChartComponent.previewTabYAxisCoordinate()
802
+ .eq(index)
803
+ .should('have.text', max);
804
+ max -= interval;
805
+ }
806
+ });
807
+ },
808
+
809
+ /**
810
+ * Verify annotated labels in the preview tab's y-axis.
811
+ * @param {number} max - The maximum value.
812
+ * @param {number} annotateEvery - The interval for annotations.
813
+ */
814
+ verifyAnnotatedLabelsPreviewTab: (max, annotateEvery) => {
815
+ barAndLineChartComponent.previewTabYAxisCoordinate()
816
+ .each(($element, index) => {
817
+ if (index % annotateEvery === 0) {
818
+ cy.wrap($element).should('have.text', max);
819
+ max -= annotateEvery;
820
+ }
821
+ });
822
+ },
823
+
824
+ /**
825
+ * @description verifies chart orientation
826
+ * @param {('Horizontal'|'Vertical')} chart orientation
827
+ */
828
+ verifyChartOrientationSelectChartType: (orientation) => {
829
+ if (orientation === 'Horizontal') {
830
+ barAndLineChartComponent.chartContainerSelectChartType()
831
+ .should('have.css', 'height', '605px');
832
+ }
833
+ else if (orientation === 'Vertical') {
834
+ barAndLineChartComponent.chartContainerSelectChartType()
835
+ .should('have.css', 'height', '616px');
836
+ } else {
837
+ cy.log('Invalid orientation');
838
+ }
839
+ },
840
+
841
+ /**
842
+ * @description verifies chart orientation
843
+ * @param {('Horizontal'|'Vertical')} chart orientation
844
+ */
845
+ verifyChartOrientationSpecifyCorrectAnswer: (orientation) => {
846
+ if (orientation === 'Horizontal') {
847
+ barAndLineChartComponent.chartContainerSpecifyCorrectAnswer()
848
+ .should('have.css', 'height', '605px');
849
+ }
850
+ else if (orientation === 'Vertical') {
851
+ barAndLineChartComponent.chartContainerSpecifyCorrectAnswer()
852
+ .should('have.css', 'height', '616px');
853
+ } else {
854
+ cy.log('Invalid orientation');
855
+ }
856
+ },
857
+
858
+ /**
859
+ * @description verifies chart orientation
860
+ * @param {('Horizontal'|'Vertical')} chart orientation
861
+ */
862
+ verifyChartOrientationPreviewTab: (orientation) => {
863
+ if (orientation === 'Horizontal') {
864
+ chartsBarPage.chartsContainerPreviewTab()
865
+ .should('have.css', 'height', '605px');
866
+ }
867
+ else if (orientation === 'Vertical') {
868
+ chartsBarPage.chartsContainerPreviewTab()
869
+ .should('have.css', 'height', '616px');
870
+ } else {
871
+ cy.log('Invalid orientation');
872
+ }
873
+ },
874
+
875
+ verifySpaceBetweenBarsSelectChartType: () => {
876
+ chartsBarPage.selectChartTypeBar()
877
+ .eq(0)
878
+ .invoke('width')
879
+ .then(width => {
880
+ const roundedWidth = Math.round(parseFloat(width));
881
+ expect(roundedWidth).to.be.closeTo(154, 1);
882
+ });
883
+ },
884
+
885
+ verifyNoSpaceBetweenBarsSelectChartType: () => {
886
+ chartsBarPage.selectChartTypeBar()
887
+ .eq(0)
888
+ .invoke('width')
889
+ .then(width => {
890
+ const roundedWidth = Math.round(parseFloat(width));
891
+ expect(roundedWidth).to.be.closeTo(253, 1);
892
+ });
893
+ },
894
+
895
+ verifySpaceBetweenBarsSpecifyCorrectAnswer: () => {
896
+ chartsBarPage.specifyCorrectAnswerBar()
897
+ .eq(0)
898
+ .invoke('width')
899
+ .then(width => {
900
+ const roundedWidth = Math.round(parseFloat(width));
901
+ expect(roundedWidth).to.be.closeTo(157, 1);
902
+ });
903
+ },
904
+
905
+ verifyNoSpaceBetweenBarsSpecifyCorrectAnswer: () => {
906
+ chartsBarPage.specifyCorrectAnswerBar()
907
+ .eq(0)
908
+ .invoke('width')
909
+ .then(width => {
910
+ const roundedWidth = Math.round(parseFloat(width));
911
+ expect(roundedWidth).to.be.closeTo(258, 1);
912
+ });
913
+ },
914
+
915
+ verifySpaceBetweenBarsPreviewTab: () => {
916
+ chartsBarPage.previewTabBar()
917
+ .eq(0)
918
+ .invoke('width')
919
+ .then(width => {
920
+ const roundedWidth = Math.round(parseFloat(width));
921
+ expect(roundedWidth).to.be.closeTo(159, 1);
922
+ });
923
+ },
924
+
925
+ verifyNoSpaceBetweenBarsPreviewTab: () => {
926
+ chartsBarPage.previewTabBar()
927
+ .eq(0)
928
+ .invoke('width')
929
+ .then(width => {
930
+ const roundedWidth = Math.round(parseFloat(width));
931
+ expect(roundedWidth).to.be.closeTo(261, 1);
932
+ });
933
+ },
934
+
935
+ /**
936
+ * Verifies if the label of a bar
937
+ * @param {number} index - The index of the bar whose label is to be verified.
938
+ * @param {string} label - The expected label of the bar.
939
+ */
940
+ verifyBarLabelSelectChartType: (index, label) => {
941
+ utilities.verifyInnerText(utilities.getNthElement(chartsBarPage.selectChartTypeBarLabel(), index), label);
942
+ },
943
+
944
+ verifyBarLabelAtIntervalSelectChartType: () => {
945
+ chartsBarPage.selectChartTypeBarLabel()
946
+ .eq(0)
947
+ .should('have.css', 'margin-left');
948
+ },
949
+
950
+ verifyBarLabelCenteredSelectChartType: () => {
951
+ chartsBarPage.selectChartTypeBarLabel()
952
+ .eq(0)
953
+ .should('not.have.css', 'margin-left')
954
+ },
955
+
956
+ verifyBarLabelAtIntervalSpecifyCorrectAnswer: () => {
957
+ chartsBarPage.specifyCorrectAnswerBarLabel()
958
+ .eq(0)
959
+ .should('have.css', 'margin-left');
960
+ },
961
+
962
+ verifyBarLabelCenteredSpecifyCorrectAnswer: () => {
963
+ chartsBarPage.specifyCorrectAnswerBarLabel()
964
+ .eq(0)
965
+ .should('not.have.css', 'margin-left')
966
+ },
967
+
968
+ verifyBarLabelAtIntervalPreviewTab: () => {
969
+ chartsBarPage.previewTabBarLabel()
970
+ .eq(0)
971
+ .should('have.css', 'margin-left');
972
+ },
973
+
974
+ verifyBarLabelCenteredPreviewTab: () => {
975
+ chartsBarPage.previewTabBarLabel()
976
+ .eq(0)
977
+ .should('not.have.css', 'margin-left')
978
+ },
979
+
980
+ /**
981
+ * Verify bar labels in the horizontal specify correct answer chart.
982
+ * @param {string[]} values - Array of expected label values.
983
+ */
984
+ verifyBarLabelHorizontalSpecifyCorrectAnswer: (values) => {
985
+ values.forEach((value, index) => {
986
+ utilities.getNthElement(chartsBarPage.barLabelHorizontalSpecifyCorrectAnswer(), index)
987
+ .should('have.text', value);
988
+ });
989
+ },
990
+
991
+ /**
992
+ * Verify bar labels in the horizontal select chart type chart.
993
+ * @param {string[]} values - Array of expected label values.
994
+ */
995
+ verifyBarLabelHorizontalSelectChartType: (values) => {
996
+ values.forEach((value, index) => {
997
+ utilities.getNthElement(chartsBarPage.barLabelHorizontalSelectChartType(), index)
998
+ .should('have.text', value);
999
+ });
1000
+ },
1001
+
1002
+ /**
1003
+ * Verify bar labels in the horizontal preview tab chart.
1004
+ * @param {string[]} values - Array of expected label values.
1005
+ */
1006
+ verifyBarLabelHorizontalPreviewTab: (values) => {
1007
+ values.forEach((value, index) => {
1008
+ utilities.getNthElement(chartsBarPage.barLabelHorizontalPreviewTab(), index)
1009
+ .should('have.text', value);
1010
+ });
1011
+ },
1012
+
1013
+ /**
1014
+ * Verify labels in the horizontal select chart type chart.
1015
+ * @param {number} min - The minimum value.
1016
+ * @param {number} interval - The interval between values.
1017
+ */
1018
+ verifyLabelsInHorizontalSelectChartType: (min, interval) => {
1019
+ chartsBarPage.xAxisCoordinateSelectChartType()
1020
+ .its('length').then((len) => {
1021
+ for (let index = 0; index < len; index++) {
1022
+ chartsBarPage.xAxisCoordinateSelectChartType()
1023
+ .eq(index)
1024
+ .should('have.text', value);
1025
+ min += interval;
1026
+ }
1027
+ });
1028
+ },
1029
+
1030
+ /**
1031
+ * Verify labels in the horizontal specify correct answer chart.
1032
+ * @param {number} min - The minimum value.
1033
+ * @param {number} interval - The interval between values.
1034
+ */
1035
+ verifyLabelsInHorizontalSpecifyCorrectAnswer: (min, interval) => {
1036
+ chartsBarPage.xAxisCoordinateSpecifyCorrectAnswer()
1037
+ .its('length').then((len) => {
1038
+ for (let index = 0; index < len; index++) {
1039
+ chartsBarPage.xAxisCoordinateSpecifyCorrectAnswer()
1040
+ .eq(index)
1041
+ .should('have.text', value);
1042
+ min += interval;
1043
+ }
1044
+ });
1045
+ },
1046
+
1047
+ /**
1048
+ * Verify labels in the horizontal preview tab.
1049
+ * @param {number} min - The minimum value.
1050
+ * @param {number} interval - The interval between values.
1051
+ */
1052
+ verifyLabelsInHorizontalPreviewTab: (min, interval) => {
1053
+ chartsBarPage.xAxisCoordinatePreviewTab()
1054
+ .its('length').then((len) => {
1055
+ for (let index = 0; index < len; index++) {
1056
+ chartsBarPage.xAxisCoordinatePreviewTab()
1057
+ .eq(index)
1058
+ .should('have.text', value);
1059
+ min += interval;
1060
+ }
1061
+ });
1062
+ },
1063
+
1064
+ /**
1065
+ * @description Set the Max Y value in its input field
1066
+ * @param {number} value Max Y value to be set
1067
+ */
1068
+ setMaxXAndYValue: (value) => {
1069
+ chartsBarPage.selectChartTypeMaxXAndYInputField()
1070
+ .type(`{backspace}{backspace}${value}`, { force: true })
1071
+ .should('have.value', value)
1072
+ .blur();
1073
+ },
1074
+
1075
+ /**
1076
+ * @description Verifies Max Y value in its input field
1077
+ * @param {number} value Max Y value
1078
+ */
1079
+ verifyMaxXAndYValue: (value) => {
1080
+ chartsBarPage.selectChartTypeMaxXAndYInputField()
1081
+ .should('have.value', value);
1082
+ },
416
1083
  }
417
1084
 
418
1085
  const tests = {
419
1086
  ...autoScoredScoringPreviewTab.tests,
420
1087
  ...resetPopupComponent.tests,
1088
+ ...autoScoredSpecifyCorrectAnswerSection.tests,
421
1089
  ...autoScoredStudentViewSettings.tests,
422
1090
  ...studentViewSettingsLabelComponent.tests,
1091
+ ...createQuestionBasePage.tests,
1092
+ ...commonComponents.tests,
1093
+ ...layoutSectionComponent.tests,
423
1094
 
424
1095
  /**
425
1096
  * Verify bar tooltip contents with css and a11y in preview tab
@@ -464,7 +1135,116 @@ const tests = {
464
1135
  utilities.triggerMouseout(utilities.getNthElement(chartsBarPage.previewTabBar(), barIndex));
465
1136
  utilities.verifyElementVisibilityState(chartsBarPage.barAndPointTooltipWrapper(), 'notExist');
466
1137
  });
467
- }
1138
+ },
1139
+
1140
+ /**
1141
+ * Verifies the contents and functionality of the 'Specify correct answer' accordion for multiple selection questions.
1142
+ * @param {{'Correct' | 'Alternative'}} accordionName - The name of the accordion to be used in the validation.
1143
+ * @example - verifySpecifyCorrectAnswerAccordionContentsAndFunctionality('Correct');
1144
+ */
1145
+ verifySpecifyCorrectAnswerAccordionContentsAndFunctionality: (accordionName) => {
1146
+ it('Bar chart should be present with y axis label from 1 to 10 and 3 bars', () => {
1147
+ utilities.verifyElementVisibilityState(chartsBarPage.chartContainerSpecifyCorrectAnswer(), 'visible');
1148
+ utilities.verifyElementCount(chartsBarPage.specifyCorrectAnswerBar(), 3);
1149
+ });
1150
+
1151
+ it(`The user should be able to set bars on chart in the specify correct answer section ${accordionName} accordion`, () => {
1152
+ steps.setBarValueInSpecifyCorrectAnswerSection({ barIndex: 2, value: 4, range: 10 });
1153
+ steps.setBarValueInSpecifyCorrectAnswerSection({ barIndex: 1, value: 2, range: 10 });
1154
+ });
1155
+
1156
+ it(`User should be able to delete bar in ${accordionName} accordion and labels for other bars should not change`, () => {
1157
+ steps.deleteBarInSpecifyCorrectAnswer(1);
1158
+ steps.verifyBarLabelSpecifyCorrectAnswer(0, 'Bar 1');
1159
+ steps.verifyBarLabelSpecifyCorrectAnswer(1, 'Bar 3');
1160
+ });
1161
+
1162
+ it(`When the user resets the charts in the ${accordionName} accordion, error message should not be thrown on the \'${accordionName}\' accordion`, () => {
1163
+ chartsBarPage.steps.selectControlOptionSpecifyCorrectAnswer('Reset');
1164
+ chartsBarPage.steps.confirmReset();
1165
+ utilities.verifyElementVisibilityState(commonComponents.errorMessage(), 'notExist');
1166
+ if (accordionName == 'Correct') {
1167
+ autoScoredSpecifyCorrectAnswerSection.correctAnswerAccordion()
1168
+ .within(() => {
1169
+ utilities.verifyElementVisibilityState(autoScoredSpecifyCorrectAnswerSection.specifyCorrectAnswerErrorIcon(), 'notExist');
1170
+ });
1171
+ } else {
1172
+ autoScoredSpecifyCorrectAnswerSection.alternativeAnswerAccordion()
1173
+ .within(() => {
1174
+ utilities.verifyElementVisibilityState(autoScoredSpecifyCorrectAnswerSection.specifyCorrectAnswerErrorIcon(), 'notExist');
1175
+ });
1176
+ };
1177
+ });
1178
+
1179
+ it(`When the user focuses in and out of the empty points input field, no points error message should be displayed below the points input field and error icon should not be displayed on the \'${accordionName}\' accordion`, () => {
1180
+ scoringSectionBaseEditTab.pointsInputField()
1181
+ .eq(0)
1182
+ .focus();
1183
+ scoringSectionBaseEditTab.pointsInputField()
1184
+ .eq(0)
1185
+ .blur();
1186
+ utilities.verifyElementVisibilityState(scoringSectionBaseEditTab.pleaseEnterPointsErrorMessage(), 'notExist')
1187
+ if (accordionName == 'Correct') {
1188
+ autoScoredSpecifyCorrectAnswerSection.correctAnswerAccordion()
1189
+ .within(() => {
1190
+ autoScoredSpecifyCorrectAnswerSection.steps.verifySpecifyCorrectAnswerErrorIconNotExists();
1191
+ });
1192
+ } else {
1193
+ autoScoredSpecifyCorrectAnswerSection.alternativeAnswerAccordion()
1194
+ .within(() => {
1195
+ autoScoredSpecifyCorrectAnswerSection.steps.verifySpecifyCorrectAnswerErrorIconNotExists();
1196
+ });
1197
+ };
1198
+ });
1199
+
1200
+ it('Accessibility of \'Correct\' accordion contents', { tags: 'a11y' }, () => {
1201
+ cy.checkAccessibility(chartsDotPlotPage.numberLineAxisSpecifyCorrectAnswer().parents('.ngie-accordion-detail'));
1202
+ });
1203
+ },
1204
+
1205
+ /**
1206
+ * Verify bar tooltip contents with css and a11y
1207
+ * @param {number} barIndex index of the bar
1208
+ * @param {string} barBackground rgb value of the bar background
1209
+ * @param {string} barLabel label of the bar
1210
+ */
1211
+ verifyBarTooltipContentsCSSAndA11yInSpecifyCorrectAnswer: (barIndex, barBackground, barLabel) => {
1212
+ it('When user hovers over the bar, then bar tooltip should be displayed', () => {
1213
+ utilities.triggerMouseover(utilities.getNthElement(chartsBarPage.specifyCorrectAnswerBar(), barIndex));
1214
+ utilities.verifyElementVisibilityState(chartsBarPage.barAndPointTooltipWrapper(), 'visible');
1215
+ });
1216
+
1217
+ it('The bar tooltip should contain, bar background color block, bar label button, and delete button', () => {
1218
+ utilities.verifyCSS(chartsBarPage.colorBlockBarTooltipSpecifyCorrectAnswer(), {
1219
+ 'background-color': barBackground
1220
+ });
1221
+ utilities.verifyInnerText(barAndLineChartComponent.barAndPointTooltipLabelButton(), barLabel);
1222
+ utilities.verifyElementVisibilityState(barAndLineChartComponent.barAndPointTooltipDeleteButton(), 'visible');
1223
+ });
1224
+
1225
+ it('When user hovers on the delete button, then \'Delete bar\' tooltip should be displayed', () => {
1226
+ chartsBarPage.barAndPointTooltipDeleteButton()
1227
+ .verifyTooltip('Delete bar');
1228
+ });
1229
+
1230
+ it('CSS of delete bar tooltip', { tags: 'css' }, () => {
1231
+ utilities.triggerMouseover(utilities.getNthElement(chartsBarPage.specifyCorrectAnswerBar(), barIndex));
1232
+ utilities.triggerMouseover(chartsBarPage.barAndPointTooltipDeleteButton());
1233
+ barAndLineChartComponent.barAndPointTooltipDeleteButton()
1234
+ .verifyPseudoClassBeforeProperty('color', css.color.deleteIcon);
1235
+ });
1236
+
1237
+ it('Accessibility of delete bar tooltip', { tags: 'a11y' }, () => {
1238
+ utilities.triggerMouseover(chartsBarPage.barAndPointTooltipDeleteButton());
1239
+ cy.checkAccessibility(chartsBarPage.barAndPointTooltipWrapper());
1240
+ utilities.triggerMouseout(chartsBarPage.barAndPointTooltipDeleteButton());
1241
+ });
1242
+
1243
+ it('When user hovers away from the bar, then bar tooltip should be not be displayed', () => {
1244
+ utilities.triggerMouseout(utilities.getNthElement(chartsBarPage.specifyCorrectAnswerBar(), barIndex));
1245
+ utilities.verifyElementVisibilityState(chartsBarPage.barAndPointTooltipWrapper(), 'notExist');
1246
+ });
1247
+ },
468
1248
  }
469
1249
 
470
1250
  export const chartsBarPage = {