itemengine-cypress-automation 1.0.173 → 1.0.174

Sign up to get free protection for your applications and to get access to all the features.
Files changed (96) hide show
  1. package/cypress/e2e/ILC/DrawingResponse/drawingResponseCustomizeAdditionalOptions.js +0 -18
  2. package/cypress/e2e/ILC/DrawingResponse/drawingResponseEditTabBasicSection.js +1 -1
  3. package/cypress/e2e/ILC/EssayResponse/createCustomCategory.smoke.js +10 -7
  4. package/cypress/e2e/ILC/FeedbackScaleNew/additionalSettings.js +111 -0
  5. package/cypress/e2e/ILC/FeedbackScaleNew/colorPopup.js +206 -0
  6. package/cypress/e2e/ILC/FeedbackScaleNew/editTabBasicSection.js +262 -0
  7. package/cypress/e2e/ILC/FeedbackScaleNew/headerSection.js +51 -0
  8. package/cypress/e2e/ILC/FeedbackScaleNew/numbersFeedbackScaleStyle.js +17 -17
  9. package/cypress/e2e/ILC/FeedbackScaleNew/thumbsFeedbackScaleStyle.js +1 -1
  10. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/additionalSettings.js +2 -2
  11. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/clickAndDrop.js +3 -3
  12. package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/conditionalCheckboxScoring.js +1 -0
  13. package/cypress/e2e/ILC/Graphing/addBackgroundShapesSection.js +6 -7
  14. package/cypress/e2e/ILC/Graphing/additionalSettingsBasic.js +3 -3
  15. package/cypress/e2e/ILC/Graphing/allOrNothingForAllViews.smoke.js +0 -1
  16. package/cypress/e2e/ILC/Graphing/checkAnswerFunctionalityForAllViews.smoke.js +0 -1
  17. package/cypress/e2e/ILC/Graphing/toolsControlsAndBackgroundSection.js +0 -1
  18. package/cypress/e2e/ILC/GridFill/checkAnswerFunctionalityForAllViews.smoke.js +2 -0
  19. package/cypress/e2e/ILC/GridFill/gridLayoutContents.js +3 -4
  20. package/cypress/e2e/ILC/GridFill/gridLayoutEditTabFunctionality.js +2 -2
  21. package/cypress/e2e/ILC/GridFill/previewContentsForAllViews.smoke.js +12 -12
  22. package/cypress/e2e/ILC/NumberLine/Scoring/allOrNothingWithAlternatePointsGreaterThanCorrectPoints.js +91 -90
  23. package/cypress/e2e/ILC/NumberLine/Scoring/allOrNothingWithCorrectPointsEqualToAlternatePoints.js +93 -92
  24. package/cypress/e2e/ILC/NumberLine/Scoring/allOrNothingWithCorrectPointsGreaterThanAlternativePoints.js +97 -95
  25. package/cypress/e2e/ILC/NumberLine/Scoring/manualAndNonScoredScoring.js +62 -62
  26. package/cypress/e2e/ILC/NumberLine/Scoring/partialEqualWeightsBasic.js +118 -117
  27. package/cypress/e2e/ILC/NumberLine/Scoring/partialEqualWeightsWithAlternatePointsGreaterThanCorrectPoints.js +124 -120
  28. package/cypress/e2e/ILC/NumberLine/Scoring/partialEqualWeightsWithCorrectPointsGreaterThanAlternatePoints.js +128 -125
  29. package/cypress/e2e/ILC/NumberLine/Scoring/partialEqualWeigtsWithCorrectPointsEqualToAlternatePoints.js +97 -96
  30. package/cypress/e2e/ILC/NumberLine/allOrNothingScoringForAllViews.smoke.js +222 -196
  31. package/cypress/e2e/ILC/NumberLine/checkAnswerFunctionalityForAllViews.smoke.js +34 -34
  32. package/cypress/e2e/ILC/NumberLine/editTabScoringSection.js +20 -20
  33. package/cypress/e2e/ILC/NumberLine/gradingViewAndCorrectAnswerView.smoke.js +29 -29
  34. package/cypress/e2e/ILC/NumberLine/headerSection.js +3 -2
  35. package/cypress/e2e/ILC/NumberLine/previewTabContentsForAllViews.smoke.js +40 -37
  36. package/cypress/e2e/ILC/NumberLine/specifyCorrectAnswerSection.js +7 -4
  37. package/cypress/e2e/ILC/NumberLine/studentViewSettings.js +14 -12
  38. package/cypress/e2e/ILC/NumberLine/toolsAndControls.js +24 -23
  39. package/cypress/e2e/ILC/ShortTextResponseNew/studentViewSettings.js +2 -2
  40. package/cypress/e2e/ILC/SimpleCalculator/previewContents.smoke.js +1 -1
  41. package/cypress/e2e/ILC/TextEntryMath/evaluationMethodEquivalentStructures.js +2 -0
  42. package/cypress/e2e/ILC/TextEntryMath/evaluationMethodMatchExact.js +1 -0
  43. package/cypress/e2e/ILC/TextEntryMath/evaluationMethodMatchValue.js +1 -0
  44. package/cypress/e2e/ILC/TextEntryMath/evaluationMethodSymbolsAreEquivalent.js +1 -0
  45. package/cypress/e2e/ILC/TextEntryMath/evaluationMethodValueIsEquivalent.js +1 -0
  46. package/cypress/e2e/ILC/TextEntryMath/evaluationMethodsWithoutSetResponse.js +4 -0
  47. package/cypress/e2e/ILC/TextEntryMath/responseEvaluationMethodsAndCustomSettings.js +8 -15
  48. package/cypress/e2e/ILC/TextEntryMath/specifyCorrectAnswerSection.js +1 -0
  49. package/cypress/e2e/ILC/TextEntryMathWithImage/allOrNothingScoringForAllViews.smoke.js +1 -0
  50. package/cypress/e2e/ILC/TextEntryMathWithImage/backgroundImageAndCanvasProperties.js +1 -1
  51. package/cypress/e2e/ILC/TextSelection/Scoring/basicScoringForAllTextSelectionTypes.smoke.js +332 -0
  52. package/cypress/e2e/ILC/TextSelection/Scoring/manuallyAndNonScored.js +149 -0
  53. package/cypress/e2e/ILC/TextSelection/Scoring/partialDifferentWeightsBasic.js +0 -1
  54. package/cypress/e2e/ILC/TextSelection/Scoring/partialEqualWeightsBasic.js +0 -1
  55. package/cypress/e2e/ILC/TextSelection/allOrNothingScoringForAllViews.smoke.js +11 -11
  56. package/cypress/e2e/ILC/TextSelection/checkAnswerFunctionalityForAllViews.smoke.js +3 -3
  57. package/cypress/e2e/ILC/TextSelection/editTabScoringSection.js +337 -0
  58. package/cypress/e2e/ILC/TextSelection/minimumScoringPenaltyPointsAndRoundingDropdown.js +206 -0
  59. package/cypress/e2e/ILC/TextSelection/{previewContentsForAllViews.js → previewContentsForAllViews.smoke.js} +3 -3
  60. package/cypress/e2e/ILC/UploadResponse/uplodResponsePreviewUploadedFileProperties.js +87 -87
  61. package/cypress/fixtures/equationEditorCategoriesAndSymbols .js +5 -5
  62. package/cypress/pages/audioResponsePage.js +1 -0
  63. package/cypress/pages/components/autoScoredScoringSectionMultiResponseType.js +2 -1
  64. package/cypress/pages/components/autoScoredStudentViewSettings.js +1 -1
  65. package/cypress/pages/components/backgroundImageUploadComponent.js +1 -4
  66. package/cypress/pages/components/colorPopupComponent.js +11 -0
  67. package/cypress/pages/components/createCustomCategoryFlyout.js +13 -9
  68. package/cypress/pages/components/draggableOptionContainer.js +1 -0
  69. package/cypress/pages/components/equationEditorFlyout.js +0 -1
  70. package/cypress/pages/components/essayResponseCommonComponents.js +1 -1
  71. package/cypress/pages/components/imageCanvasComponent.js +1 -1
  72. package/cypress/pages/components/index.js +2 -1
  73. package/cypress/pages/components/optionsWrapperComponent.js +2 -1
  74. package/cypress/pages/components/questionInputFieldComponent.js +1 -1
  75. package/cypress/pages/components/questionInstructionsComponent.js +19 -7
  76. package/cypress/pages/components/setPointsPopupBase.js +17 -4
  77. package/cypress/pages/components/studentViewSettingsLabelComponent.js +2 -2
  78. package/cypress/pages/drawingResponsePage.js +2 -3
  79. package/cypress/pages/feedbackScalePage.js +143 -2
  80. package/cypress/pages/fillInTheGapsDragAndDropPage.js +1 -1
  81. package/cypress/pages/fillInTheGapsOverImageDragAndDropPage.js +12 -12
  82. package/cypress/pages/graphingPage.js +6 -6
  83. package/cypress/pages/gridFillPage.js +64 -7
  84. package/cypress/pages/matchingPage.js +3 -3
  85. package/cypress/pages/numberLinePage.js +342 -215
  86. package/cypress/pages/readingRulerPage.js +1 -1
  87. package/cypress/pages/textEntryMathPage.js +9 -0
  88. package/cypress/pages/textEntryMathWithImagePage.js +11 -11
  89. package/cypress/pages/textSelectionPage.js +125 -57
  90. package/package.json +1 -1
  91. package/cypress/e2e/ILC/FeedbackScaleNew/feedbackScaleStylePreviewTab.js +0 -161
  92. package/cypress/e2e/ILC/FillInTheGapsDragAndDrop/fillInTheGapsDragAndDropAdditionalSettings.js +0 -356
  93. package/cypress/e2e/ILC/FillInTheGapsDragAndDrop/fillInTheGapsDragAndDropAdditionalSettingsResponseAccordion.js +0 -299
  94. package/cypress/e2e/ILC/Graphing/Scoring/allOrNothingWithCorrectPointsEqualToCorrectPoints.js +0 -355
  95. package/cypress/e2e/ILC/MultipleSelectionGridNew/test.js +0 -28
  96. package/cypress/pages/feedbackScalePage copy.js +0 -716
@@ -1,6 +1,7 @@
1
1
  import utilities from '../support/helpers/utilities';
2
2
  import { createQuestionBasePage, toolsAndControlsComponent, questionInstructionsComponent, resetPopupComponent, scoringSectionBaseEditTab, autoScoredScoringPreviewTab, autoScoredSpecifyCorrectAnswerSection, commonComponents, autoScoredScoringSectionMultiResponseType, toolSettingsComponent, additionalSettingsPanel, additionalSettingsAccessibilitySectionComponent, autoScoredStudentViewSettings, randomizeOptionsComponent, studentViewSettingsLabelComponent, defaultToolDropdown } from './components';
3
3
  const css = Cypress.env('css');
4
+ const range = 20.4472843;
4
5
 
5
6
  const selectors = {
6
7
  ...toolsAndControlsComponent,
@@ -13,7 +14,9 @@ const selectors = {
13
14
  ...commonComponents,
14
15
  ...defaultToolDropdown,
15
16
  ...autoScoredScoringSectionMultiResponseType,
16
-
17
+ //layout
18
+ staggerResponseCheckbox: () => cy.get('[data-ngie-testid="stagger-response-checkbox"] input'),
19
+ limitNumberOfResponsesInputField: () => cy.get('.limit-number-line-response-wrapper .text-input-field input'),
17
20
  //Specify correct answer
18
21
  numberLineSpecifyCorrectAnswer: () => cy.get('.ngie-accordion .ngie-jxgbox svg'),
19
22
  numberLineToolOptionSpecifyCorrectAnswer: (toolOptionAriaLabel = null) => {
@@ -36,7 +39,7 @@ const selectors = {
36
39
 
37
40
  //Preview Tab
38
41
  numberLinePreviewTab: () => cy.get('[class*="question-preview-wrapper"] .ngie-jxgbox svg').eq(0),
39
- numberLinePointPreviewTab: () => cy.get('[class*="question-preview-wrapper"] .ngie-jxgbox').eq(0).find('svg ellipse[tabindex="0"]'),
42
+ numberLinePointPreviewTab: () => cy.get('[class*="question-preview-wrapper"] .ngie-jxgbox').eq(0).find('svg ellipse[display="inline"]'),
40
43
  numberLineSegmentPreviewTab: () => cy.get('[class*="question-preview-wrapper"] .ngie-jxgbox').eq(0).find('[stroke-linecap="butt"]'),
41
44
  numberLineToolOptionPreviewTab: (toolOptionAriaLabel = null) => {
42
45
  if (toolOptionAriaLabel) {
@@ -59,7 +62,7 @@ const selectors = {
59
62
  correctIcon: () => cy.get('[data-icon="CorrectAnswer"]'),
60
63
  incorrectIcon: () => cy.get('[data-icon="Incorrect"]'),
61
64
  numberLineCorrectAnswerSection: () => cy.get('[class*="question-preview-wrapper"] .ngie-jxgbox svg:visible').eq(1),
62
- numberLinePointCorrectAnswerSection: () => cy.get('[class*="question-preview-wrapper"] .ngie-jxgbox').eq(1).find('svg ellipse[tabindex="0"]'),
65
+ numberLinePointCorrectAnswerSection: () => cy.get('[class*="question-preview-wrapper"] .ngie-jxgbox').eq(1).find('svg ellipse[display="inline"]'),
63
66
  correctIncorrectAnswerTextWrapper: () => cy.get('[class*="CorrectIncorrectWrapper"]'),
64
67
  numberLineTitleCorrectAnswerSection: () => cy.get('[class*="LineGraphstyles__TitleText"]').last()
65
68
  }
@@ -97,86 +100,107 @@ const steps = {
97
100
  },
98
101
 
99
102
  /**
100
- * This function plots points on the number line on Edit tab
101
- * @param {Object[]} coordinates - An array containing x and y coordinates along with their ranges
102
- * @param {number} coordinates[].x - x coordinate to be plotted on the graph
103
- * @param {number} coordinates[].xRange - range of x coordinate
103
+ * This function plots coordinate on the number line on the preview tab.
104
+ * @param {("horizontal"|"vertical")} orientation of the number line
105
+ * @param {number} range - The range of coordinate.
106
+ * @param {number[]} points - An array of coordinates to be plotted on the graph.
104
107
  */
105
- plotPointOnNumberLineSpecifyCorrectAnswer: (coordinates) => {
106
- coordinates.forEach(({ x, xRange }) => {
108
+ plotPointOnNumberLineSpecifyCorrectAnswer: (orientation, range, coordinate) => {
109
+ numberLinePage.numberLineSpecifyCorrectAnswer()
110
+ .then(($graphElement) => {
111
+ const graphWidth = $graphElement[0].clientWidth;
112
+ const graphHeight = $graphElement[0].clientHeight;
113
+ const originX = graphWidth / 2;
114
+ const originY = graphHeight / 2;
115
+ if (orientation === 'horizontal') {
116
+ const xPixel = originX + coordinate * (graphWidth / range);
117
+ numberLinePage.numberLineSpecifyCorrectAnswer()
118
+ .click(xPixel, originY, { force: true });
119
+ } else {
120
+ const yPixel = originY - coordinate * (graphWidth / range);
121
+ numberLinePage.numberLineSpecifyCorrectAnswer()
122
+ .click(originX, yPixel, { force: true });
123
+ }
124
+ });
125
+ },
126
+
127
+ /**
128
+ * This function verifies plotted points on the number line on the Edit tab.
129
+ * @param {number} range - The range of x coordinates.
130
+ * @param {number[]} coordinates - An array containing x coordinates to be plotted on the graph.
131
+ */
132
+ verifyPointsPlottedOnNumberLineSpecifyCorrectAnswer: (range, coordinates) => {
133
+ coordinates.forEach(x => {
107
134
  numberLinePage.numberLineSpecifyCorrectAnswer()
108
135
  .then(($graphElement) => {
109
136
  const graphWidth = $graphElement[0].clientWidth;
110
137
  const graphHeight = $graphElement[0].clientHeight;
111
138
  const originX = graphWidth / 2;
112
139
  const originY = graphHeight / 2;
113
- const xPixel = originX + x * (graphWidth / xRange);
114
- numberLinePage.numberLineSpecifyCorrectAnswer()
115
- .click(xPixel, originY, { force: true });
140
+ const xPixel = originX + x * (graphWidth / range);
141
+ cy.get(`.ngie-accordion .ngie-jxgbox svg ellipse[cx*="${Math.floor(xPixel)}"][cy*="${Math.floor(originY)}"][tabindex="0"]`)
142
+ .should('exist');
116
143
  });
117
144
  });
118
145
  },
119
146
 
120
147
  /**
121
- * This function verifies plotted points on the number line on Edit tab
122
- * @param {Object[]} coordinates - An array containing x and y coordinates along with their ranges
123
- * @param {number} coordinates[].x - x coordinate to be plotted on the graph
124
- * @param {number} coordinates[].xRange - range of x coordinate
125
- */
126
- verifyPointsPlottedOnNumberLineSpecifyCorrectAnswer: (coordinates) => {
127
- coordinates.forEach(({ x, xRange }) => {
148
+ * This function verifies the presence of line segments on the number line in the edit tab, given a uniform range for all coordinates.
149
+ * @param {number} range - The uniform range of coordinates.
150
+ * @param {Object[]} coordinates - An array of objects, each with x1 and x2 properties representing the points of each line segment.
151
+ * Usage - verifyLineSegmentOnNumberLineSpecifyCorrectAnswer(20, [{ x1: 2, x2: 4 }]);
152
+ */
153
+ verifyLineSegmentOnNumberLineSpecifyCorrectAnswer: (range, coordinates) => {
154
+ coordinates.forEach(({ x1, x2 }) => {
128
155
  numberLinePage.numberLineSpecifyCorrectAnswer()
129
156
  .then(($graphElement) => {
130
157
  const graphWidth = $graphElement[0].clientWidth;
131
158
  const graphHeight = $graphElement[0].clientHeight;
132
159
  const originX = graphWidth / 2;
133
160
  const originY = graphHeight / 2;
134
- const xPixel = originX + x * (graphWidth / xRange);
135
- cy.get(`.ngie-accordion .ngie-jxgbox svg ellipse[cx*="${Math.floor(xPixel)}"][cy*="${Math.floor(originY)}"][tabindex="0"]`)
136
- .should('exist');
161
+ const x1Pixel = originX + x1 * (graphWidth / range);
162
+ const x2Pixel = originX + x2 * (graphWidth / range);
163
+ cy.get(`.ngie-accordion .ngie-jxgbox svg [stroke-linecap="butt"][x1*="${Math.floor(x1Pixel)}"][y1*="${Math.floor(originY)}"][x2*="${Math.floor(x2Pixel)}"][y2*="${Math.floor(originY)}"]`)
164
+ .should('be.visible');
137
165
  });
138
166
  });
139
167
  },
140
168
 
141
169
  /**
142
- * This verifies line segment on the number line on Edit tab
143
- * @param {Object[]} coordinates - An array containing x and y coordinates along with their ranges
144
- * @param {number} coordinates[].x1 - x coordinate to be plotted on the graph
145
- * @param {number} coordinates[].x1Range - range of x coordinate
146
- * @param {number} coordinates[].x2 - x coordinate to be plotted on the graph
147
- * @param {number} coordinates[].x2Range - range of x coordinate
148
- */
149
- verifyLineSegmentOnNumberLineSpecifyCorrectAnswer: (coordinates) => {
150
- coordinates.forEach(({ x1, x1Range, x2, x2Range }) => {
170
+ * Verifies the presence of a ray on the number line in the "Specify Correct Answer" section.
171
+ * @param {("left"|"right")} direction - The direction of the ray ("left" or "right").
172
+ * @param {number} range - The range of the number line.
173
+ * @param {number} startingPoint - It representing the starting point of the ray.
174
+ */
175
+ verifyRayOnNumberLineSpecifyCorrectAnswer: (direction, range, startingPoint) => {
151
176
  numberLinePage.numberLineSpecifyCorrectAnswer()
152
177
  .then(($graphElement) => {
153
178
  const graphWidth = $graphElement[0].clientWidth;
154
179
  const graphHeight = $graphElement[0].clientHeight;
155
180
  const originX = graphWidth / 2;
156
181
  const originY = graphHeight / 2;
157
- const x1Pixel = originX + x1 * (graphWidth / x1Range);
158
- const x2Pixel = originX + x2 * (graphWidth / x2Range);
182
+ const x1Pixel = originX + startingPoint * (graphWidth / range);
183
+ const rayArrowWidth = 42;
184
+ const x2Pixel = direction === "left" ? rayArrowWidth : graphWidth - rayArrowWidth;
159
185
  cy.get(`.ngie-accordion .ngie-jxgbox svg [stroke-linecap="butt"][x1*="${Math.floor(x1Pixel)}"][y1*="${Math.floor(originY)}"][x2*="${Math.floor(x2Pixel)}"][y2*="${Math.floor(originY)}"]`)
160
186
  .should('be.visible');
161
187
  });
162
- });
163
188
  },
164
189
 
165
190
  /**
166
- * This function verifies plotted points not exist on the number line on Edit tab
167
- * @param {Object[]} coordinates - An array containing x and y coordinates along with their ranges
168
- * @param {number} coordinates[].x - x coordinate to be plotted on the graph
169
- * @param {number} coordinates[].xRange - range of x coordinate
191
+ * This function verifies plotted points on the number line do not exist on the Edit tab.
192
+ * @param {number} range - The range of x coordinates.
193
+ * @param {number[]} coordinates - An array containing x coordinates to be plotted on the graph.
170
194
  */
171
- verifyPointsPlottedOnNumberLineNotExistSpecifyCorrectAnswer: (coordinates) => {
172
- coordinates.forEach(({ x, xRange }) => {
195
+ verifyPointsPlottedOnNumberLineNotExistSpecifyCorrectAnswer: (range, coordinates) => {
196
+ coordinates.forEach(x => {
173
197
  numberLinePage.numberLineSpecifyCorrectAnswer()
174
198
  .then(($graphElement) => {
175
199
  const graphWidth = $graphElement[0].clientWidth;
176
200
  const graphHeight = $graphElement[0].clientHeight;
177
201
  const originX = graphWidth / 2;
178
202
  const originY = graphHeight / 2;
179
- const xPixel = originX + x * (graphWidth / xRange);
203
+ const xPixel = originX + x * (graphWidth / range);
180
204
  cy.get(`.ngie-accordion .ngie-jxgbox svg ellipse[cx*="${Math.floor(xPixel)}"][cy*="${Math.floor(originY)}"][tabindex="0"]`)
181
205
  .should('not.exist');
182
206
  });
@@ -198,41 +222,45 @@ const steps = {
198
222
  },
199
223
 
200
224
  /**
201
- * This function plots points on the number line on preview tab
202
- * @param {Object[]} coordinates - An array containing x and y coordinates along with their ranges
203
- * @param {number} coordinates[].x - x coordinate to be plotted on the graph
204
- * @param {number} coordinates[].xRange - range of x coordinate
225
+ * This function plots coordinate on the number line on the preview tab.
226
+ * @param {("horizontal"|"vertical")} orientation of the number line
227
+ * @param {number} range - The range of coordinate.
228
+ * @param {number[]} points - An array of coordinates to be plotted on the graph.
229
+ * Usage - plotPointOnNumberLinePreviewTab('vertical', 20, 2);
205
230
  */
206
- plotPointOnNumberLinePreviewTab: (coordinates) => {
207
- coordinates.forEach(({ x, xRange }) => {
208
- numberLinePage.numberLinePreviewTab()
209
- .then(($graphElement) => {
210
- const graphWidth = $graphElement[0].clientWidth;
211
- const graphHeight = $graphElement[0].clientHeight;
212
- const originX = graphWidth / 2;
213
- const originY = graphHeight / 2;
214
- const xPixel = originX + x * (graphWidth / xRange);
231
+ plotPointOnNumberLinePreviewTab: (orientation, range, coordinate) => {
232
+ numberLinePage.numberLinePreviewTab()
233
+ .then(($graphElement) => {
234
+ const graphWidth = $graphElement[0].clientWidth;
235
+ const graphHeight = $graphElement[0].clientHeight;
236
+ const originX = graphWidth / 2;
237
+ const originY = graphHeight / 2;
238
+ if (orientation === 'horizontal') {
239
+ const xPixel = originX + coordinate * (graphWidth / range);
215
240
  numberLinePage.numberLinePreviewTab()
216
241
  .click(xPixel, originY, { force: true });
217
- });
218
- });
242
+ } else {
243
+ const yPixel = originY + coordinate * (graphWidth / range);
244
+ numberLinePage.numberLinePreviewTab()
245
+ .click(originX, yPixel, { force: true });
246
+ }
247
+ });
219
248
  },
220
249
 
221
250
  /**
222
- * This verifies plotted points on the number line on preview tab
223
- * @param {Object[]} coordinates - An array containing x and y coordinates along with their ranges
224
- * @param {number} coordinates[].x - x coordinate to be plotted on the graph
225
- * @param {number} coordinates[].xRange - range of x coordinate
251
+ * This function verifies plotted points on the number line on the preview tab.
252
+ * @param {number} range - The range of x coordinates.
253
+ * @param {number[]} coordinates - An array containing x coordinates to be plotted on the graph.
226
254
  */
227
- verifyPointsPlottedOnNumberLinePreviewTab: (coordinates) => {
228
- coordinates.forEach(({ x, xRange }) => {
255
+ verifyPointsPlottedOnNumberLinePreviewTab: (range, coordinates) => {
256
+ coordinates.forEach(x => {
229
257
  numberLinePage.numberLinePreviewTab()
230
258
  .then(($graphElement) => {
231
259
  const graphWidth = $graphElement[0].clientWidth;
232
260
  const graphHeight = $graphElement[0].clientHeight;
233
261
  const originX = graphWidth / 2;
234
262
  const originY = graphHeight / 2;
235
- const xPixel = originX + x * (graphWidth / xRange);
263
+ const xPixel = originX + x * (graphWidth / range);
236
264
  cy.get('[class*="question-preview-wrapper"] .ngie-jxgbox').eq(0).find(`svg ellipse[cx*="${Math.floor(xPixel)}"][cy*="${Math.floor(originY)}"][tabindex="0"]`)
237
265
  .should('exist');
238
266
  });
@@ -240,20 +268,19 @@ const steps = {
240
268
  },
241
269
 
242
270
  /**
243
- * This function verifies points not exist on the number line on preview tab
244
- * @param {Object[]} coordinates - An array containing x and y coordinates along with their ranges
245
- * @param {number} coordinates[].x - x coordinate to be plotted on the graph
246
- * @param {number} coordinates[].xRange - range of x coordinate
271
+ * This function verifies plotted points on the number line do not exist on the preview tab.
272
+ * @param {number} range - The range of x coordinates.
273
+ * @param {number[]} coordinates - An array containing x coordinates to be plotted on the graph.
247
274
  */
248
- verifyPointsNotExistOnNumberLinePreviewTab: (coordinates) => {
249
- coordinates.forEach(({ x, xRange }) => {
275
+ verifyPointsNotExistOnNumberLinePreviewTab: (range, coordinates) => {
276
+ coordinates.forEach(x => {
250
277
  numberLinePage.numberLinePreviewTab()
251
278
  .then(($graphElement) => {
252
279
  const graphWidth = $graphElement[0].clientWidth;
253
280
  const graphHeight = $graphElement[0].clientHeight;
254
281
  const originX = graphWidth / 2;
255
282
  const originY = graphHeight / 2;
256
- const xPixel = originX + x * (graphWidth / xRange);
283
+ const xPixel = originX + x * (graphWidth / range);
257
284
  cy.get('[class*="question-preview-wrapper"] .ngie-jxgbox').eq(0).find(`svg ellipse[cx*="${Math.floor(xPixel)}"][cy*="${Math.floor(originY)}"][tabindex="0"]`)
258
285
  .should('not.exist');
259
286
  });
@@ -261,90 +288,103 @@ const steps = {
261
288
  },
262
289
 
263
290
  /**
264
- * This function verifies correct points on the number line on Edit tab
265
- * @param {Object[]} coordinates - An array containing x and y coordinates along with their ranges
266
- * @param {number} coordinates[].x - x coordinate to be plotted on the graph
267
- * @param {number} coordinates[].xRange - range of x coordinate
268
- */
269
- verifyCorrectPointsOnNumberLinePreviewTab: (coordinates) => {
270
- coordinates.forEach(({ x, xRange }) => {
291
+ * This function verifies correct plotted points on the number line.
292
+ * @param {number} range - The range of x coordinates.
293
+ * @param {number[]} coordinates - An array containing x coordinates to be plotted on the graph.
294
+ */
295
+ verifyCorrectPointsOnNumberLinePreviewTab: (range, coordinates) => {
296
+ coordinates.forEach(x => {
271
297
  numberLinePage.numberLinePreviewTab()
272
298
  .then(($graphElement) => {
273
299
  const graphWidth = $graphElement[0].clientWidth;
274
300
  const graphHeight = $graphElement[0].clientHeight;
275
301
  const originX = graphWidth / 2;
276
302
  const originY = graphHeight / 2;
277
- const xPixel = originX + x * (graphWidth / xRange);
278
- cy.get('[class*="question-preview-wrapper"] .ngie-jxgbox').eq(0).find(`svg ellipse[cx*="${Math.floor(xPixel)}"][cy*="${Math.floor(originY)}"][tabindex="0"]`)
303
+ const xPixel = originX + x * (graphWidth / range);
304
+ cy.get('[class*="question-preview-wrapper"] .ngie-jxgbox').eq(0).find(`svg ellipse[cx*="${Math.floor(xPixel)}"][cy*="${Math.floor(originY)}"][display="inline"]`)
279
305
  .should('have.css', 'stroke', css.color.correctAnswer);
280
306
  });
281
307
  });
282
308
  },
283
309
 
284
310
  /**
285
- * This function verifies incorrect points on the number line on preview tab
286
- * @param {Object[]} coordinates - An array containing x and y coordinates along with their ranges
287
- * @param {number} coordinates[].x - x coordinate to be plotted on the graph
288
- * @param {number} coordinates[].xRange - range of x coordinate
311
+ * This function verifies incorrect plotted points on the number line
312
+ * @param {number} range - The range of x coordinates.
313
+ * @param {number[]} coordinates - An array containing x coordinates to be plotted on the graph.
289
314
  */
290
- verifyIncorrectPointsOnNumberLinePreviewTab: (coordinates) => {
291
- coordinates.forEach(({ x, xRange }) => {
315
+ verifyIncorrectPointsOnNumberLinePreviewTab: (range, coordinates) => {
316
+ coordinates.forEach(x => {
292
317
  numberLinePage.numberLinePreviewTab()
293
318
  .then(($graphElement) => {
294
319
  const graphWidth = $graphElement[0].clientWidth;
295
320
  const graphHeight = $graphElement[0].clientHeight;
296
321
  const originX = graphWidth / 2;
297
322
  const originY = graphHeight / 2;
298
- const xPixel = originX + x * (graphWidth / xRange);
299
- cy.get('[class*="question-preview-wrapper"] .ngie-jxgbox').eq(0).find(`svg ellipse[cx*="${Math.floor(xPixel)}"][cy*="${Math.floor(originY)}"][tabindex="0"]`)
323
+ const xPixel = originX + x * (graphWidth / range);
324
+ cy.get('[class*="question-preview-wrapper"] .ngie-jxgbox').eq(0).find(`svg ellipse[cx*="${Math.floor(xPixel)}"][cy*="${Math.floor(originY)}"][display="inline"]`)
300
325
  .should('have.css', 'stroke', css.color.incorrectAnswer);
301
326
  });
302
327
  });
303
328
  },
304
329
 
305
330
  /**
306
- * This function plots points on the number line on Edit tab
307
- * @param {Object[]} coordinates - An array containing x and y coordinates along with their ranges
308
- * @param {number} coordinates[].x1 - x coordinate to be plotted on the graph
309
- * @param {number} coordinates[].x1Range - range of x coordinate
310
- * @param {number} coordinates[].x2 - x coordinate to be plotted on the graph
311
- * @param {number} coordinates[].x2Range - range of x coordinate
331
+ * This function verifies the presence of line segments on the number line in the preview tab, given a uniform range for all coordinates.
332
+ * @param {number} range - The uniform range of coordinates.
333
+ * @param {Object[]} coordinates - An array of objects, each with x1 and x2 properties representing the points of each line segment.
334
+ * Usage - verifyLineSegmentOnNumberLinePreviewTab(20, [{ x1: 2, x2: 4 }]);
312
335
  */
313
- verifyLineSegmentOnNumberLinePreviewTab: (coordinates) => {
314
- coordinates.forEach(({ x1, x1Range, x2, x2Range }) => {
336
+ verifyLineSegmentOnNumberLinePreviewTab: (range, coordinates) => {
337
+ coordinates.forEach(({ x1, x2 }) => {
315
338
  numberLinePage.numberLinePreviewTab()
316
339
  .then(($graphElement) => {
317
340
  const graphWidth = $graphElement[0].clientWidth;
318
341
  const graphHeight = $graphElement[0].clientHeight;
319
342
  const originX = graphWidth / 2;
320
343
  const originY = graphHeight / 2;
321
- const x1Pixel = originX + x1 * (graphWidth / x1Range);
322
- const x2Pixel = originX + x2 * (graphWidth / x2Range);
344
+ const x1Pixel = originX + x1 * (graphWidth / range);
345
+ const x2Pixel = originX + x2 * (graphWidth / range);
323
346
  cy.get('[class*="question-preview-wrapper"] .ngie-jxgbox').eq(0).find(`[stroke-linecap="butt"][x1*="${Math.floor(x1Pixel)}"][y1*="${Math.floor(originY)}"][x2*="${Math.floor(x2Pixel)}"][y2*="${Math.floor(originY)}"]`)
324
347
  .should('be.visible');
325
348
  });
326
349
  });
327
350
  },
328
351
 
352
+ /**
353
+ * Verifies the presence of a ray on the number line in the "Preview" tab.
354
+ * @param {("left" | "right")} direction - The direction of the ray ("left" or "right").
355
+ * @param {number} range - The range of the number line.
356
+ * @param {number} startingPoint - It representing the starting point of the ray.
357
+ */
358
+ verifyRayOnNumberLinePreviewTab: (direction, range, startingPoint) => {
359
+ numberLinePage.numberLinePreviewTab()
360
+ .then(($graphElement) => {
361
+ const graphWidth = $graphElement[0].clientWidth;
362
+ const graphHeight = $graphElement[0].clientHeight;
363
+ const originX = graphWidth / 2;
364
+ const originY = graphHeight / 2;
365
+ const x1Pixel = originX + startingPoint * (graphWidth / range);
366
+ const rayArrowWidth = 42;
367
+ const x2Pixel = direction === "left" ? rayArrowWidth : graphWidth - rayArrowWidth;
368
+ cy.get('[class*="question-preview-wrapper"] .ngie-jxgbox').eq(0).find(`[stroke-linecap="butt"][x1*="${Math.floor(x1Pixel)}"][y1*="${Math.floor(originY)}"][x2*="${Math.floor(x2Pixel)}"][y2*="${Math.floor(originY)}"]`)
369
+ .should('be.visible');
370
+ });
371
+ },
329
372
 
330
373
  /**
331
- * This function verifies correct points on the number line on Edit tab
332
- * @param {Object[]} coordinates - An array containing x and y coordinates along with their ranges
333
- * @param {number} coordinates[].x1 - x coordinate to be plotted on the graph
334
- * @param {number} coordinates[].x1Range - range of x coordinate
335
- * @param {number} coordinates[].x2 - x coordinate to be plotted on the graph
336
- * @param {number} coordinates[].x2Range - range of x coordinate
374
+ * This function verifies the presence of correct line segments on the number line in the preview tab, given a uniform range for all coordinates.
375
+ * @param {number} range - The uniform range of coordinates.
376
+ * @param {Object[]} coordinates - An array of objects, each with x1 and x2 properties representing the points of each line segment.
337
377
  */
338
- verifyCorrectLineSegmentOnNumberLinePreviewTab: (coordinates) => {
339
- coordinates.forEach(({ x1, x1Range, x2, x2Range }) => {
378
+ verifyCorrectLineSegmentOnNumberLinePreviewTab: (range, coordinates) => {
379
+ coordinates.forEach(({ x1, x2 }) => {
340
380
  numberLinePage.numberLinePreviewTab()
341
381
  .then(($graphElement) => {
342
382
  const graphWidth = $graphElement[0].clientWidth;
343
383
  const graphHeight = $graphElement[0].clientHeight;
344
384
  const originX = graphWidth / 2;
345
385
  const originY = graphHeight / 2;
346
- const x1Pixel = originX + x1 * (graphWidth / x1Range);
347
- const x2Pixel = originX + x2 * (graphWidth / x2Range);
386
+ const x1Pixel = originX + x1 * (graphWidth / range);
387
+ const x2Pixel = originX + x2 * (graphWidth / range);
348
388
  cy.get('[class*="question-preview-wrapper"] .ngie-jxgbox').eq(0).find(`[stroke-linecap="butt"][x1*="${Math.floor(x1Pixel)}"][y1*="${Math.floor(originY)}"][x2*="${Math.floor(x2Pixel)}"][y2*="${Math.floor(originY)}"]`)
349
389
  .should('have.css', 'stroke', css.color.correctAnswer);
350
390
  });
@@ -352,23 +392,41 @@ const steps = {
352
392
  },
353
393
 
354
394
  /**
355
- * This function verifies incorrect points on the number line on Edit tab
356
- * @param {Object[]} coordinates - An array containing x and y coordinates along with their ranges
357
- * @param {number} coordinates[].x1 - x coordinate to be plotted on the graph
358
- * @param {number} coordinates[].x1Range - range of x coordinate
359
- * @param {number} coordinates[].x2 - x coordinate to be plotted on the graph
360
- * @param {number} coordinates[].x2Range - range of x coordinate
361
- */
362
- verifyIncorrectLineSegmentOnNumberLinePreviewTab: (coordinates) => {
363
- coordinates.forEach(({ x1, x1Range, x2, x2Range }) => {
395
+ * Verifies the presence of a correct ray on the number line in the "Preview" tab.
396
+ * @param {("left" | "right")} direction - The direction of the ray ("left" or "right").
397
+ * @param {number} range - The range of the number line.
398
+ * @param {number} startingPoint -It representing the starting point of the ray.
399
+ */
400
+ verifyCorrectRayOnNumberLinePreviewTab: (direction, range, startingPoint) => {
401
+ numberLinePage.numberLinePreviewTab()
402
+ .then(($graphElement) => {
403
+ const graphWidth = $graphElement[0].clientWidth;
404
+ const graphHeight = $graphElement[0].clientHeight;
405
+ const originX = graphWidth / 2;
406
+ const originY = graphHeight / 2;
407
+ const x1Pixel = originX + startingPoint * (graphWidth / range);
408
+ const rayArrowWidth = 42;
409
+ const x2Pixel = direction === "left" ? rayArrowWidth : graphWidth - rayArrowWidth;
410
+ cy.get('[class*="question-preview-wrapper"] .ngie-jxgbox').eq(0).find(`[stroke-linecap="butt"][x1*="${Math.floor(x1Pixel)}"][y1*="${Math.floor(originY)}"][x2*="${Math.floor(x2Pixel)}"][y2*="${Math.floor(originY)}"]`)
411
+ .should('have.css', 'stroke', css.color.correctAnswer);
412
+ });
413
+ },
414
+
415
+ /**
416
+ * This function verifies the presence of incorrect line segments on the number line in the preview tab, given a uniform range for all coordinates.
417
+ * @param {number} range - The uniform range of coordinates.
418
+ * @param {Object[]} coordinates - An array of objects, each with x1 and x2 properties representing the points of each line segment.
419
+ */
420
+ verifyIncorrectLineSegmentOnNumberLinePreviewTab: (range, coordinates) => {
421
+ coordinates.forEach(({ x1, x2 }) => {
364
422
  numberLinePage.numberLinePreviewTab()
365
423
  .then(($graphElement) => {
366
424
  const graphWidth = $graphElement[0].clientWidth;
367
425
  const graphHeight = $graphElement[0].clientHeight;
368
426
  const originX = graphWidth / 2;
369
427
  const originY = graphHeight / 2;
370
- const x1Pixel = originX + x1 * (graphWidth / x1Range);
371
- const x2Pixel = originX + x2 * (graphWidth / x2Range);
428
+ const x1Pixel = originX + x1 * (graphWidth / range);
429
+ const x2Pixel = originX + x2 * (graphWidth / range);
372
430
  cy.get('[class*="question-preview-wrapper"] .ngie-jxgbox').eq(0).find(`[stroke-linecap="butt"][x1*="${Math.floor(x1Pixel)}"][y1*="${Math.floor(originY)}"][x2*="${Math.floor(x2Pixel)}"][y2*="${Math.floor(originY)}"]`)
373
431
  .should('have.css', 'stroke', css.color.incorrectAnswer);
374
432
  });
@@ -376,29 +434,69 @@ const steps = {
376
434
  },
377
435
 
378
436
  /**
379
- * This function verifies points does not exist on the number line on Edit tab
380
- * @param {Object[]} coordinates - An array containing x and y coordinates along with their ranges
381
- * @param {number} coordinates[].x1 - x coordinate to be plotted on the graph
382
- * @param {number} coordinates[].x1Range - range of x coordinate
383
- * @param {number} coordinates[].x2 - x coordinate to be plotted on the graph
384
- * @param {number} coordinates[].x2Range - range of x coordinate
437
+ * Verifies the presence of an incorrect ray on the number line in the "Preview" tab.
438
+ * @param { ("left" | "right")} direction - The direction of the ray ("left" or "right").
439
+ * @param {number} range - The range of the number line.
440
+ * @param {number} startingPoint- It representing the starting point of the ray.
441
+ */
442
+ verifyIncorrectRayOnNumberLinePreviewTab: (direction, range, startingPoint) => {
443
+ numberLinePage.numberLinePreviewTab()
444
+ .then(($graphElement) => {
445
+ const graphWidth = $graphElement[0].clientWidth;
446
+ const graphHeight = $graphElement[0].clientHeight;
447
+ const originX = graphWidth / 2;
448
+ const originY = graphHeight / 2;
449
+ const x1Pixel = originX + startingPoint * (graphWidth / range);
450
+ const rayArrowWidth = 42;
451
+ const x2Pixel = direction === "left" ? rayArrowWidth : graphWidth - rayArrowWidth;
452
+ cy.get('[class*="question-preview-wrapper"] .ngie-jxgbox').eq(0).find(`[stroke-linecap="butt"][x1*="${Math.floor(x1Pixel)}"][y1*="${Math.floor(originY)}"][x2*="${Math.floor(x2Pixel)}"][y2*="${Math.floor(originY)}"]`)
453
+ .should('have.css', 'stroke', css.color.incorrectAnswer);
454
+ });
455
+ },
456
+
457
+ /**
458
+ * This function verifies points does not exist on the number line on Edit tab, given a uniform range for all coordinates.
459
+ * @param {number} range - The uniform range of coordinates.
460
+ * @param {Object[]} coordinates - An array of objects, each with x1 and x2 properties representing the points of each line segment.
461
+ * Usage - verifyLineSegmentOnNumberLineNotExistPreviewTab(20, [{ x1: 2, x2: 4 }]);
385
462
  */
386
- verifyLineSegmentOnNumberLineNotExistPreviewTab: (coordinates) => {
387
- coordinates.forEach(({ x1, x1Range, x2, x2Range }) => {
463
+ verifyLineSegmentOnNumberLineNotExistPreviewTab: (range, coordinates) => {
464
+ coordinates.forEach(({ x1, x2 }) => {
388
465
  numberLinePage.numberLinePreviewTab()
389
466
  .then(($graphElement) => {
390
467
  const graphWidth = $graphElement[0].clientWidth;
391
468
  const graphHeight = $graphElement[0].clientHeight;
392
469
  const originX = graphWidth / 2;
393
470
  const originY = graphHeight / 2;
394
- const x1Pixel = originX + x1 * (graphWidth / x1Range);
395
- const x2Pixel = originX + x2 * (graphWidth / x2Range);
396
- cy.get(`[class*="PreviewTabstyles__ContentWrapper"] .ngie-jxgbox svg [stroke-linecap="butt"][x1*="${Math.floor(x1Pixel)}"][y1*="${Math.floor(originY)}"][x2*="${Math.floor(x2Pixel)}"][y2*="${Math.floor(originY)}"]`)
471
+ const x1Pixel = originX + x1 * (graphWidth / range);
472
+ const x2Pixel = originX + x2 * (graphWidth / range);
473
+ cy.get('[class*="question-preview-wrapper"] .ngie-jxgbox').eq(0).find(`[stroke-linecap="butt"][x1*="${Math.floor(x1Pixel)}"][y1*="${Math.floor(originY)}"][x2*="${Math.floor(x2Pixel)}"][y2*="${Math.floor(originY)}"]`)
397
474
  .should('not.exist');
398
475
  });
399
476
  });
400
477
  },
401
478
 
479
+ /**
480
+ * Verifies the absence of a ray on the number line in the "Preview" tab.
481
+ * @param {("left"| "right")} direction - The direction of the ray ("left" or "right").
482
+ * @param {number} range - The range of the number line.
483
+ * @param {number} startingPoint - It represents starting point of ray
484
+ */
485
+ verifyRayOnNumberLineNotExistPreviewTab: (direction, range, startingPoint) => {
486
+ numberLinePage.numberLinePreviewTab()
487
+ .then(($graphElement) => {
488
+ const graphWidth = $graphElement[0].clientWidth;
489
+ const graphHeight = $graphElement[0].clientHeight;
490
+ const originX = graphWidth / 2;
491
+ const originY = graphHeight / 2;
492
+ const x1Pixel = originX + startingPoint * (graphWidth / range);
493
+ const rayArrowWidth = 42;
494
+ const x2Pixel = direction === "left" ? rayArrowWidth : graphWidth - rayArrowWidth;
495
+ cy.get('[class*="question-preview-wrapper"] .ngie-jxgbox').eq(0).find(`[stroke-linecap="butt"][x1*="${Math.floor(x1Pixel)}"][y1*="${Math.floor(originY)}"][x2*="${Math.floor(x2Pixel)}"][y2*="${Math.floor(originY)}"]`)
496
+ .should('not.exist');
497
+ });
498
+ },
499
+
402
500
  /**
403
501
  * @description This function selects the tool option from graph
404
502
  * @param {string} toolOption aria label of the tool option to be selected
@@ -457,23 +555,23 @@ const steps = {
457
555
  .should('not.have.class', 'single-select-toggle-button-selected');
458
556
  });
459
557
  },
460
- //Correct answer section
461
558
 
559
+ //Correct answer section
462
560
  /**
463
561
  * This function verifies plotted points on the number line on c tab
464
562
  * @param {Object[]} coordinates - An array containing x and y coordinates along with their ranges
465
563
  * @param {number} coordinates[].x - x coordinate to be plotted on the graph
466
564
  * @param {number} coordinates[].xRange - range of x coordinate
467
565
  */
468
- verifyPointsPlottedOnNumberLineCorrectAnswerSection: (coordinates) => {
469
- coordinates.forEach(({ x, xRange }) => {
566
+ verifyPointsPlottedOnNumberLineCorrectAnswerSection: (range, coordinates) => {
567
+ coordinates.forEach(x => {
470
568
  numberLinePage.numberLineCorrectAnswerSection()
471
569
  .then(($graphElement) => {
472
570
  const graphWidth = $graphElement[0].clientWidth;
473
571
  const graphHeight = $graphElement[0].clientHeight;
474
572
  const originX = graphWidth / 2;
475
573
  const originY = graphHeight / 2;
476
- const xPixel = originX + x * (graphWidth / xRange);
574
+ const xPixel = originX + x * (graphWidth / range);
477
575
  cy.get('[class*="question-preview-wrapper"] .ngie-jxgbox').eq(1).find(`svg ellipse[cx*="${Math.floor(xPixel)}"][cy*="${Math.floor(originY)}"][pointer-events="visiblePainted"]`)
478
576
  .should('exist');
479
577
  });
@@ -486,85 +584,79 @@ const steps = {
486
584
  * @param {number} coordinates[].x - x coordinate to be plotted on the graph
487
585
  * @param {number} coordinates[].xRange - range of x coordinate
488
586
  */
489
- verifyCorrectPointsOnNumberLineCorrectAnswerSection: (coordinates) => {
490
- coordinates.forEach(({ x, xRange }) => {
587
+ verifyCorrectPointsOnNumberLineCorrectAnswerSection: (range, coordinates) => {
588
+ coordinates.forEach(x => {
491
589
  numberLinePage.numberLineCorrectAnswerSection()
492
590
  .then(($graphElement) => {
493
591
  const graphWidth = $graphElement[0].clientWidth;
494
592
  const graphHeight = $graphElement[0].clientHeight;
495
593
  const originX = graphWidth / 2;
496
594
  const originY = graphHeight / 2;
497
- const xPixel = originX + x * (graphWidth / xRange);
498
- cy.get('[class*="question-preview-wrapper"] .ngie-jxgbox').eq(1).find(`svg ellipse[cx*="${Math.floor(xPixel)}"][cy*="${Math.floor(originY)}"][pointer-events="visiblePainted"]`)
595
+ const xPixel = originX + x * (graphWidth / range);
596
+ cy.get('[class*="question-preview-wrapper"] .ngie-jxgbox').eq(1).find(`svg ellipse[cx*="${Math.floor(xPixel)}"][cy*="${Math.floor(originY)}"][display="inline"]`)
499
597
  .should('have.css', 'stroke', css.color.correctAnswer);
500
598
  });
501
599
  });
502
600
  },
503
601
 
504
-
505
602
  /**
506
- * This function verifies incorrect plotted points on the number line on c tab
507
- * @param {Object[]} coordinates - An array containing x and y coordinates along with their ranges
508
- * @param {number} coordinates[].x - x coordinate to be plotted on the graph
509
- * @param {number} coordinates[].xRange - range of x coordinate
603
+ * This function verifies the presence of line segments on the number line in the preview tab, given a uniform range for all coordinates.
604
+ * @param {number} range - The uniform range of coordinates.
605
+ * @param {Object[]} coordinates - An array of objects, each with x1 and x2 properties representing the points of each line segment.
606
+ * Usage - verifyLineSegmentOnNumberLineCorrectAnswerSection(20, [{ x1: 2, x2: 4 }]);
510
607
  */
511
- verifyIncorrectPointsOnNumberLineCorrectAnswerSection: (coordinates) => {
512
- coordinates.forEach(({ x, xRange }) => {
608
+ verifyLineSegmentOnNumberLineCorrectAnswerSection: (range, coordinates) => {
609
+ coordinates.forEach(({ x1, x2 }) => {
513
610
  numberLinePage.numberLineCorrectAnswerSection()
514
611
  .then(($graphElement) => {
515
612
  const graphWidth = $graphElement[0].clientWidth;
516
613
  const graphHeight = $graphElement[0].clientHeight;
517
614
  const originX = graphWidth / 2;
518
615
  const originY = graphHeight / 2;
519
- const xPixel = originX + x * (graphWidth / xRange);
520
- cy.get('[class*="question-preview-wrapper"] .ngie-jxgbox').eq(1).find(`svg ellipse[cx*="${Math.floor(xPixel)}"][cy*="${Math.floor(originY)}"][pointer-events="visiblePainted"]`)
521
- .should('have.css', 'stroke', css.color.incorrectAnswer);
616
+ const x1Pixel = originX + x1 * (graphWidth / range);
617
+ const x2Pixel = originX + x2 * (graphWidth / range);
618
+ cy.get('[class*="question-preview-wrapper"] .ngie-jxgbox').eq(1).find(`[stroke-linecap="butt"][x1*="${Math.floor(x1Pixel)}"][y1*="${Math.floor(originY)}"][x2*="${Math.floor(x2Pixel)}"][y2*="${Math.floor(originY)}"]`)
619
+ .should('be.visible');
522
620
  });
523
621
  });
524
622
  },
525
623
 
526
624
  /**
527
- * This function verifies line plotted points on the number line on c tab
528
- * @param {Object[]} coordinates - An array containing x and y coordinates along with their ranges
529
- * @param {number} coordinates[].x1 - x coordinate to be plotted on the graph
530
- * @param {number} coordinates[].x1Range - range of x coordinate
531
- * @param {number} coordinates[].x2 - x coordinate to be plotted on the graph
532
- * @param {number} coordinates[].x2Range - range of x coordinate
533
- */
534
- verifyLineSegmentOnNumberLineCorrectAnswerSection: (coordinates) => {
535
- coordinates.forEach(({ x1, x1Range, x2, x2Range }) => {
536
- numberLinePage.numberLineCorrectAnswerSection()
537
- .then(($graphElement) => {
538
- const graphWidth = $graphElement[0].clientWidth;
539
- const graphHeight = $graphElement[0].clientHeight;
540
- const originX = graphWidth / 2;
541
- const originY = graphHeight / 2;
542
- const x1Pixel = originX + x1 * (graphWidth / x1Range);
543
- const x2Pixel = originX + x2 * (graphWidth / x2Range);
544
- cy.get('[class*="question-preview-wrapper"] .ngie-jxgbox').eq(1).find(`[stroke-linecap="butt"][x1*="${Math.floor(x1Pixel)}"][y1*="${Math.floor(originY)}"][x2*="${Math.floor(x2Pixel)}"][y2*="${Math.floor(originY)}"]`)
545
- .should('be.visible');
546
- });
547
- });
625
+ * Verifies the presence of a ray on the number line in the "Correct Answer" section.
626
+ * @param {("left" | "right")} direction - The direction of the ray ("left" or "right").
627
+ * @param {number} range - The range of the number line.
628
+ * @param {number} startingPoint - It representing the coordinates of the starting point of the ray.
629
+ */
630
+ verifyRayOnNumberLineCorrectAnswerSection: (direction, range, startingPoint) => {
631
+ numberLinePage.numberLineCorrectAnswerSection()
632
+ .then(($graphElement) => {
633
+ const graphWidth = $graphElement[0].clientWidth;
634
+ const graphHeight = $graphElement[0].clientHeight;
635
+ const originX = graphWidth / 2;
636
+ const originY = graphHeight / 2;
637
+ const x1Pixel = originX + startingPoint * (graphWidth / range);
638
+ const rayArrowWidth = 42;
639
+ const x2Pixel = direction === "left" ? rayArrowWidth : graphWidth - rayArrowWidth;
640
+ cy.get('[class*="question-preview-wrapper"] .ngie-jxgbox').eq(1).find(`[stroke-linecap="butt"][x1*="${Math.floor(x1Pixel)}"][y1*="${Math.floor(originY)}"][x2*="${Math.floor(x2Pixel)}"][y2*="${Math.floor(originY)}"]`)
641
+ .should('be.visible');
642
+ });
548
643
  },
549
644
 
550
645
  /**
551
- * This function verifies correct plotted points on the number line on c tab
552
- * @param {Object[]} coordinates - An array containing x and y coordinates along with their ranges
553
- * @param {number} coordinates[].x1 - x coordinate to be plotted on the graph
554
- * @param {number} coordinates[].x1Range - range of x coordinate
555
- * @param {number} coordinates[].x2 - x coordinate to be plotted on the graph
556
- * @param {number} coordinates[].x2Range - range of x coordinate
557
- */
558
- verifyCorrectLineSegmentOnNumberLineCorrectAnswerSection: (coordinates) => {
559
- coordinates.forEach(({ x1, x1Range, x2, x2Range }) => {
646
+ * This function verifies the presence of correct line segments on the number line in the preview tab, given a uniform range for all coordinates.
647
+ * @param {number} range - The uniform range of coordinates.
648
+ * @param {Object[]} coordinates - An array of objects, each with x1 and x2 properties representing the points of each line segment.
649
+ */
650
+ verifyCorrectLineSegmentOnNumberLineCorrectAnswerSection: (range, coordinates) => {
651
+ coordinates.forEach(({ x1, x2 }) => {
560
652
  numberLinePage.numberLineCorrectAnswerSection()
561
653
  .then(($graphElement) => {
562
654
  const graphWidth = $graphElement[0].clientWidth;
563
655
  const graphHeight = $graphElement[0].clientHeight;
564
656
  const originX = graphWidth / 2;
565
657
  const originY = graphHeight / 2;
566
- const x1Pixel = originX + x1 * (graphWidth / x1Range);
567
- const x2Pixel = originX + x2 * (graphWidth / x2Range);
658
+ const x1Pixel = originX + x1 * (graphWidth / range);
659
+ const x2Pixel = originX + x2 * (graphWidth / range);
568
660
  cy.get('[class*="question-preview-wrapper"] .ngie-jxgbox').eq(1).find(`[stroke-linecap="butt"][x1*="${Math.floor(x1Pixel)}"][y1*="${Math.floor(originY)}"][x2*="${Math.floor(x2Pixel)}"][y2*="${Math.floor(originY)}"]`)
569
661
  .should('have.css', 'stroke', css.color.correctAnswer);
570
662
  });
@@ -572,53 +664,69 @@ const steps = {
572
664
  },
573
665
 
574
666
  /**
575
- * This function verifies incorrect plotted points on the number line on c tab
576
- * @param {Object[]} coordinates - An array containing x and y coordinates along with their ranges
577
- * @param {number} coordinates[].x1 - x coordinate to be plotted on the graph
578
- * @param {number} coordinates[].x1Range - range of x coordinate
579
- * @param {number} coordinates[].x2 - x coordinate to be plotted on the graph
580
- * @param {number} coordinates[].x2Range - range of x coordinate
581
- */
582
- verifyIncorrectLineSegmentOnNumberLineCorrectAnswerSection: (coordinates) => {
583
- coordinates.forEach(({ x1, x1Range, x2, x2Range }) => {
584
- numberLinePage.numberLineCorrectAnswerSection()
585
- .then(($graphElement) => {
586
- const graphWidth = $graphElement[0].clientWidth;
587
- const graphHeight = $graphElement[0].clientHeight;
588
- const originX = graphWidth / 2;
589
- const originY = graphHeight / 2;
590
- const x1Pixel = originX + x1 * (graphWidth / x1Range);
591
- const x2Pixel = originX + x2 * (graphWidth / x2Range);
592
- cy.get('[class*="question-preview-wrapper"] .ngie-jxgbox').eq(1).find(`[stroke-linecap="butt"][x1*="${Math.floor(x1Pixel)}"][y1*="${Math.floor(originY)}"][x2*="${Math.floor(x2Pixel)}"][y2*="${Math.floor(originY)}"]`)
593
- .should('have.css', 'stroke', css.color.incorrectAnswer);
594
- });
595
- });
667
+ * Verifies the presence of a correct ray on the number line in the "Correct Answer" section.
668
+ * @param {("left" | "right")} direction - The direction of the ray ("left" or "right").
669
+ * @param {number} range - The range of the number line.
670
+ * @param {number} startingPoint - It representing the starting point of the ray.
671
+ */
672
+ verifyCorrectRayOnNumberLineCorrectAnswerSection: (direction, range, startingPoint) => {
673
+ numberLinePage.numberLineCorrectAnswerSection()
674
+ .then(($graphElement) => {
675
+ const graphWidth = $graphElement[0].clientWidth;
676
+ const graphHeight = $graphElement[0].clientHeight;
677
+ const originX = graphWidth / 2;
678
+ const originY = graphHeight / 2;
679
+ const x1Pixel = originX + startingPoint * (graphWidth / range);
680
+ const rayArrowWidth = 42;
681
+ const x2Pixel = direction === "left" ? rayArrowWidth : graphWidth - rayArrowWidth;
682
+ cy.get('[class*="question-preview-wrapper"] .ngie-jxgbox').eq(1).find(`[stroke-linecap="butt"][x1*="${Math.floor(x1Pixel)}"][y1*="${Math.floor(originY)}"][x2*="${Math.floor(x2Pixel)}"][y2*="${Math.floor(originY)}"]`)
683
+ .should('have.css', 'stroke', css.color.correctAnswer);
684
+ });
596
685
  },
597
686
 
598
687
  /**
599
- * This function verifies plotted points not exist on the number line on c tab
600
- * @param {Object[]} coordinates - An array containing x and y coordinates along with their ranges
601
- * @param {number} coordinates[].x1 - x coordinate to be plotted on the graph
602
- * @param {number} coordinates[].x1Range - range of x coordinate
603
- * @param {number} coordinates[].x2 - x coordinate to be plotted on the graph
604
- * @param {number} coordinates[].x2Range - range of x coordinate
605
- */
606
- verifyLineSegmentOnNumberLineNotExistCorrectAnswerSection: (coordinates) => {
607
- coordinates.forEach(({ x1, x1Range, x2, x2Range }) => {
688
+ * This function verifies the presence of line segments do not exist on the number line in the preview tab, given a uniform range for all coordinates.
689
+ * @param {number} range - The uniform range of coordinates.
690
+ * @param {Object[]} coordinates - An array of objects, each with x1 and x2 properties representing the points of each line segment.
691
+ * Usage - verifyLineSegmentOnNumberLineCorrectAnswerSection(20, [{ x1: 2, x2: 4 }]);
692
+ */
693
+ verifyLineSegmentOnNumberLineNotExistCorrectAnswerSection: (range, coordinates) => {
694
+ coordinates.forEach(({ x1, x2 }) => {
608
695
  numberLinePage.numberLineCorrectAnswerSection()
609
696
  .then(($graphElement) => {
610
697
  const graphWidth = $graphElement[0].clientWidth;
611
698
  const graphHeight = $graphElement[0].clientHeight;
612
699
  const originX = graphWidth / 2;
613
700
  const originY = graphHeight / 2;
614
- const x1Pixel = originX + x1 * (graphWidth / x1Range);
615
- const x2Pixel = originX + x2 * (graphWidth / x2Range);
701
+ const x1Pixel = originX + x1 * (graphWidth / range);
702
+ const x2Pixel = originX + x2 * (graphWidth / range);
616
703
  cy.get('[class*="question-preview-wrapper"] .ngie-jxgbox').eq(1).find(`svg [stroke-linecap="butt"][x1*="${Math.floor(x1Pixel)}"][y1*="${Math.floor(originY)}"][x2*="${Math.floor(x2Pixel)}"][y2*="${Math.floor(originY)}"]`)
617
704
  .should('not.exist');
618
705
  });
619
706
  });
620
707
  },
621
708
 
709
+ /**
710
+ * Verifies the ray doesn't exist on the number line in the "Correct Answer" section.
711
+ * @param {("left" | "right")} direction - The direction of the ray ("left" or "right").
712
+ * @param {number} range - The range of the number line.
713
+ * @param {number} startingPoint - It representing the starting point of the ray.
714
+ */
715
+ verifyRayOnNumberLineNotExistCorrectAnswerSection: (direction, range, startingPoint) => {
716
+ numberLinePage.numberLineCorrectAnswerSection()
717
+ .then(($graphElement) => {
718
+ const graphWidth = $graphElement[0].clientWidth;
719
+ const graphHeight = $graphElement[0].clientHeight;
720
+ const originX = graphWidth / 2;
721
+ const originY = graphHeight / 2;
722
+ const x1Pixel = originX + startingPoint * (graphWidth / range);
723
+ const rayArrowWidth = 42;
724
+ const x2Pixel = direction === "left" ? rayArrowWidth : graphWidth - rayArrowWidth;
725
+ cy.get('[class*="question-preview-wrapper"] .ngie-jxgbox').eq(1).find(`svg [stroke-linecap="butt"][x1*="${Math.floor(x1Pixel)}"][y1*="${Math.floor(originY)}"][x2*="${Math.floor(x2Pixel)}"][y2*="${Math.floor(originY)}"]`)
726
+ .should('not.exist');
727
+ });
728
+ },
729
+
622
730
  verifyPlotNumberLineSelected: () => {
623
731
  numberLinePage.plotNumberLineToggleButton()
624
732
  .should('have.attr', 'aria-selected', 'true');
@@ -644,6 +752,23 @@ const steps = {
644
752
  utilities.verifyElementVisibilityState(numberLinePage.incorrectIcon(), 'visible');
645
753
  }
646
754
  });
755
+ },
756
+
757
+ /**
758
+ * Enters a value into the Limit Number of Responses input field.
759
+ * @param {string | number} value - The value to be entered into the input field.
760
+ * @description This function clears the input field and then enters the specified value into the Limit Number of Responses input field on the page.
761
+ */
762
+ enterValueInLimitNumberOfResponsesInputField: (value) => {
763
+ numberLinePage.limitNumberOfResponsesInputField()
764
+ .clear()
765
+ .type(value)
766
+ .blur()
767
+ },
768
+
769
+ uncheckStaggerResponseCheckbox: () => {
770
+ numberLinePage.staggerResponseCheckbox()
771
+ .click();
647
772
  }
648
773
  }
649
774
 
@@ -678,8 +803,9 @@ const tests = {
678
803
  */
679
804
  verifySpecifyCorrectAnswerAccordionContentsAndFunctionality: (accordionName) => {
680
805
  it(`The user should be able to plot points on number line in the specify correct answer section ${accordionName} accordion`, () => {
681
- numberLinePage.steps.plotPointOnNumberLineSpecifyCorrectAnswer([{ x: 0, xRange: 20 }, { x: 1, xRange: 20 }]);
682
- numberLinePage.steps.verifyPointsPlottedOnNumberLineSpecifyCorrectAnswer([{ x: 0, xRange: 20 }, { x: 1, xRange: 20 }]);
806
+ numberLinePage.steps.plotPointOnNumberLineSpecifyCorrectAnswer("horizontal", range, 0);
807
+ numberLinePage.steps.plotPointOnNumberLineSpecifyCorrectAnswer("horizontal", range, 1);
808
+ numberLinePage.steps.verifyPointsPlottedOnNumberLineSpecifyCorrectAnswer(range, [0, 1]);
683
809
  });
684
810
 
685
811
  it(`When the user resets the number line in the ${accordionName} accordion, \'Error: Please set a correct answer.\' error message should be thrown along with an error icon on the \'${accordionName}\' accordion`, () => {
@@ -703,8 +829,9 @@ const tests = {
703
829
  autoScoredSpecifyCorrectAnswerSection.tests.verifyAutoScoredCorrectAnswerErrorMessageCSSAndA11y();
704
830
 
705
831
  it('When the user plots on the number line then the error message should disappear', () => {
706
- numberLinePage.steps.plotPointOnNumberLineSpecifyCorrectAnswer([{ x: 0, xRange: 20 }, { x: 1, xRange: 20 }]);
707
- numberLinePage.steps.verifyPointsPlottedOnNumberLineSpecifyCorrectAnswer([{ x: 0, xRange: 20 }, { x: 1, xRange: 20 }]);
832
+ numberLinePage.steps.plotPointOnNumberLineSpecifyCorrectAnswer("horizontal", range, 0);
833
+ numberLinePage.steps.plotPointOnNumberLineSpecifyCorrectAnswer("horizontal", range, 1);
834
+ numberLinePage.steps.verifyPointsPlottedOnNumberLineSpecifyCorrectAnswer(range, [0, 1]);
708
835
  });
709
836
 
710
837
  autoScoredSpecifyCorrectAnswerSection.tests.verifyAutoScoredPointsErrorMessageWhenPointsFieldIsEmpty(accordionName);