itemengine-cypress-automation 1.0.174-uploadResponseMigrationScript-45ca862.0 → 1.0.174
Sign up to get free protection for your applications and to get access to all the features.
- package/cypress/e2e/ILC/DrawingResponse/drawingResponseCustomizeAdditionalOptions.js +0 -18
- package/cypress/e2e/ILC/DrawingResponse/drawingResponseEditTabBasicSection.js +1 -1
- package/cypress/e2e/ILC/EssayResponse/createCustomCategory.smoke.js +10 -7
- package/cypress/e2e/ILC/FeedbackScaleNew/additionalSettings.js +111 -0
- package/cypress/e2e/ILC/FeedbackScaleNew/colorPopup.js +206 -0
- package/cypress/e2e/ILC/FeedbackScaleNew/editTabBasicSection.js +262 -0
- package/cypress/e2e/ILC/FeedbackScaleNew/headerSection.js +51 -0
- package/cypress/e2e/ILC/FeedbackScaleNew/numbersFeedbackScaleStyle.js +17 -17
- package/cypress/e2e/ILC/FeedbackScaleNew/thumbsFeedbackScaleStyle.js +1 -1
- package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/additionalSettings.js +2 -2
- package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/clickAndDrop.js +3 -3
- package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/conditionalCheckboxScoring.js +1 -0
- package/cypress/e2e/ILC/Graphing/addBackgroundShapesSection.js +6 -7
- package/cypress/e2e/ILC/Graphing/additionalSettingsBasic.js +3 -3
- package/cypress/e2e/ILC/Graphing/allOrNothingForAllViews.smoke.js +0 -1
- package/cypress/e2e/ILC/Graphing/checkAnswerFunctionalityForAllViews.smoke.js +0 -1
- package/cypress/e2e/ILC/Graphing/toolsControlsAndBackgroundSection.js +0 -1
- package/cypress/e2e/ILC/GridFill/checkAnswerFunctionalityForAllViews.smoke.js +2 -0
- package/cypress/e2e/ILC/GridFill/gridLayoutContents.js +3 -4
- package/cypress/e2e/ILC/GridFill/gridLayoutEditTabFunctionality.js +2 -2
- package/cypress/e2e/ILC/GridFill/previewContentsForAllViews.smoke.js +12 -12
- package/cypress/e2e/ILC/NumberLine/Scoring/allOrNothingWithAlternatePointsGreaterThanCorrectPoints.js +91 -90
- package/cypress/e2e/ILC/NumberLine/Scoring/allOrNothingWithCorrectPointsEqualToAlternatePoints.js +93 -92
- package/cypress/e2e/ILC/NumberLine/Scoring/allOrNothingWithCorrectPointsGreaterThanAlternativePoints.js +97 -95
- package/cypress/e2e/ILC/NumberLine/Scoring/manualAndNonScoredScoring.js +62 -62
- package/cypress/e2e/ILC/NumberLine/Scoring/partialEqualWeightsBasic.js +118 -117
- package/cypress/e2e/ILC/NumberLine/Scoring/partialEqualWeightsWithAlternatePointsGreaterThanCorrectPoints.js +124 -120
- package/cypress/e2e/ILC/NumberLine/Scoring/partialEqualWeightsWithCorrectPointsGreaterThanAlternatePoints.js +128 -125
- package/cypress/e2e/ILC/NumberLine/Scoring/partialEqualWeigtsWithCorrectPointsEqualToAlternatePoints.js +97 -96
- package/cypress/e2e/ILC/NumberLine/allOrNothingScoringForAllViews.smoke.js +222 -196
- package/cypress/e2e/ILC/NumberLine/checkAnswerFunctionalityForAllViews.smoke.js +34 -34
- package/cypress/e2e/ILC/NumberLine/editTabScoringSection.js +20 -20
- package/cypress/e2e/ILC/NumberLine/gradingViewAndCorrectAnswerView.smoke.js +29 -29
- package/cypress/e2e/ILC/NumberLine/headerSection.js +3 -2
- package/cypress/e2e/ILC/NumberLine/previewTabContentsForAllViews.smoke.js +40 -37
- package/cypress/e2e/ILC/NumberLine/specifyCorrectAnswerSection.js +7 -4
- package/cypress/e2e/ILC/NumberLine/studentViewSettings.js +14 -12
- package/cypress/e2e/ILC/NumberLine/toolsAndControls.js +24 -23
- package/cypress/e2e/ILC/ShortTextResponseNew/studentViewSettings.js +2 -2
- package/cypress/e2e/ILC/SimpleCalculator/previewContents.smoke.js +1 -1
- package/cypress/e2e/ILC/TextEntryMath/evaluationMethodEquivalentStructures.js +2 -0
- package/cypress/e2e/ILC/TextEntryMath/evaluationMethodMatchExact.js +1 -0
- package/cypress/e2e/ILC/TextEntryMath/evaluationMethodMatchValue.js +1 -0
- package/cypress/e2e/ILC/TextEntryMath/evaluationMethodSymbolsAreEquivalent.js +1 -0
- package/cypress/e2e/ILC/TextEntryMath/evaluationMethodValueIsEquivalent.js +1 -0
- package/cypress/e2e/ILC/TextEntryMath/evaluationMethodsWithoutSetResponse.js +4 -0
- package/cypress/e2e/ILC/TextEntryMath/responseEvaluationMethodsAndCustomSettings.js +8 -15
- package/cypress/e2e/ILC/TextEntryMath/specifyCorrectAnswerSection.js +1 -0
- package/cypress/e2e/ILC/TextEntryMathWithImage/allOrNothingScoringForAllViews.smoke.js +1 -0
- package/cypress/e2e/ILC/TextEntryMathWithImage/backgroundImageAndCanvasProperties.js +1 -1
- package/cypress/e2e/ILC/TextSelection/Scoring/basicScoringForAllTextSelectionTypes.smoke.js +332 -0
- package/cypress/e2e/ILC/TextSelection/Scoring/manuallyAndNonScored.js +149 -0
- package/cypress/e2e/ILC/TextSelection/Scoring/partialDifferentWeightsBasic.js +0 -1
- package/cypress/e2e/ILC/TextSelection/Scoring/partialEqualWeightsBasic.js +0 -1
- package/cypress/e2e/ILC/TextSelection/allOrNothingScoringForAllViews.smoke.js +11 -11
- package/cypress/e2e/ILC/TextSelection/checkAnswerFunctionalityForAllViews.smoke.js +3 -3
- package/cypress/e2e/ILC/TextSelection/editTabScoringSection.js +337 -0
- package/cypress/e2e/ILC/TextSelection/minimumScoringPenaltyPointsAndRoundingDropdown.js +206 -0
- package/cypress/e2e/ILC/TextSelection/{previewContentsForAllViews.js → previewContentsForAllViews.smoke.js} +3 -3
- package/cypress/e2e/ILC/UploadResponse/uplodResponsePreviewUploadedFileProperties.js +87 -87
- package/cypress/fixtures/equationEditorCategoriesAndSymbols .js +5 -5
- package/cypress/pages/audioResponsePage.js +1 -0
- package/cypress/pages/components/autoScoredScoringSectionMultiResponseType.js +2 -1
- package/cypress/pages/components/autoScoredStudentViewSettings.js +1 -1
- package/cypress/pages/components/backgroundImageUploadComponent.js +1 -4
- package/cypress/pages/components/colorPopupComponent.js +11 -0
- package/cypress/pages/components/createCustomCategoryFlyout.js +13 -9
- package/cypress/pages/components/draggableOptionContainer.js +1 -0
- package/cypress/pages/components/equationEditorFlyout.js +0 -1
- package/cypress/pages/components/essayResponseCommonComponents.js +1 -1
- package/cypress/pages/components/imageCanvasComponent.js +1 -1
- package/cypress/pages/components/index.js +2 -1
- package/cypress/pages/components/optionsWrapperComponent.js +2 -1
- package/cypress/pages/components/questionInputFieldComponent.js +1 -1
- package/cypress/pages/components/questionInstructionsComponent.js +19 -7
- package/cypress/pages/components/setPointsPopupBase.js +17 -4
- package/cypress/pages/components/studentViewSettingsLabelComponent.js +2 -2
- package/cypress/pages/drawingResponsePage.js +2 -3
- package/cypress/pages/feedbackScalePage.js +143 -2
- package/cypress/pages/fillInTheGapsDragAndDropPage.js +1 -1
- package/cypress/pages/fillInTheGapsOverImageDragAndDropPage.js +12 -12
- package/cypress/pages/graphingPage.js +6 -6
- package/cypress/pages/gridFillPage.js +64 -7
- package/cypress/pages/matchingPage.js +3 -3
- package/cypress/pages/numberLinePage.js +342 -215
- package/cypress/pages/readingRulerPage.js +1 -1
- package/cypress/pages/textEntryMathPage.js +9 -0
- package/cypress/pages/textEntryMathWithImagePage.js +11 -11
- package/cypress/pages/textSelectionPage.js +125 -57
- package/package.json +2 -2
- package/cypress/e2e/ILC/FeedbackScaleNew/feedbackScaleStylePreviewTab.js +0 -161
- package/cypress/e2e/ILC/FillInTheGapsDragAndDrop/fillInTheGapsDragAndDropAdditionalSettings.js +0 -356
- package/cypress/e2e/ILC/FillInTheGapsDragAndDrop/fillInTheGapsDragAndDropAdditionalSettingsResponseAccordion.js +0 -299
- package/cypress/e2e/ILC/Graphing/Scoring/allOrNothingWithCorrectPointsEqualToCorrectPoints.js +0 -355
- package/cypress/e2e/ILC/MultipleSelectionGridNew/test.js +0 -28
- 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[
|
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[
|
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
|
101
|
-
* @param {
|
102
|
-
* @param {number}
|
103
|
-
* @param {number
|
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: (
|
106
|
-
|
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 /
|
114
|
-
|
115
|
-
.
|
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
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
coordinates.forEach(({
|
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
|
135
|
-
|
136
|
-
|
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
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
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 +
|
158
|
-
const
|
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
|
167
|
-
* @param {
|
168
|
-
* @param {number} coordinates
|
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(
|
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 /
|
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
|
202
|
-
* @param {
|
203
|
-
* @param {number}
|
204
|
-
* @param {number
|
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: (
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
const xPixel = originX +
|
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 {
|
224
|
-
* @param {number} coordinates
|
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(
|
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 /
|
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
|
244
|
-
* @param {
|
245
|
-
* @param {number} coordinates
|
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(
|
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 /
|
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
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
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 /
|
278
|
-
cy.get('[class*="question-preview-wrapper"] .ngie-jxgbox').eq(0).find(`svg ellipse[cx*="${Math.floor(xPixel)}"][cy*="${Math.floor(originY)}"][
|
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
|
286
|
-
* @param {
|
287
|
-
* @param {number} coordinates
|
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(
|
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 /
|
299
|
-
cy.get('[class*="question-preview-wrapper"] .ngie-jxgbox').eq(0).find(`svg ellipse[cx*="${Math.floor(xPixel)}"][cy*="${Math.floor(originY)}"][
|
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
|
307
|
-
* @param {
|
308
|
-
* @param {
|
309
|
-
*
|
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,
|
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 /
|
322
|
-
const x2Pixel = originX + x2 * (graphWidth /
|
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
|
332
|
-
* @param {
|
333
|
-
* @param {
|
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,
|
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 /
|
347
|
-
const x2Pixel = originX + x2 * (graphWidth /
|
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
|
-
|
356
|
-
|
357
|
-
|
358
|
-
|
359
|
-
|
360
|
-
|
361
|
-
|
362
|
-
|
363
|
-
|
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 /
|
371
|
-
const x2Pixel = originX + x2 * (graphWidth /
|
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
|
-
|
380
|
-
|
381
|
-
|
382
|
-
|
383
|
-
|
384
|
-
|
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,
|
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 /
|
395
|
-
const x2Pixel = originX + x2 * (graphWidth /
|
396
|
-
cy.get(
|
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(
|
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 /
|
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(
|
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 /
|
498
|
-
cy.get('[class*="question-preview-wrapper"] .ngie-jxgbox').eq(1).find(`svg ellipse[cx*="${Math.floor(xPixel)}"][cy*="${Math.floor(originY)}"][
|
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
|
507
|
-
* @param {
|
508
|
-
* @param {
|
509
|
-
*
|
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
|
-
|
512
|
-
coordinates.forEach(({
|
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
|
520
|
-
|
521
|
-
|
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
|
-
|
528
|
-
|
529
|
-
|
530
|
-
|
531
|
-
|
532
|
-
|
533
|
-
|
534
|
-
|
535
|
-
|
536
|
-
|
537
|
-
|
538
|
-
|
539
|
-
|
540
|
-
|
541
|
-
|
542
|
-
|
543
|
-
|
544
|
-
|
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
|
-
|
552
|
-
|
553
|
-
|
554
|
-
|
555
|
-
|
556
|
-
|
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 /
|
567
|
-
const x2Pixel = originX + x2 * (graphWidth /
|
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
|
-
|
576
|
-
|
577
|
-
|
578
|
-
|
579
|
-
|
580
|
-
|
581
|
-
|
582
|
-
|
583
|
-
|
584
|
-
|
585
|
-
|
586
|
-
|
587
|
-
|
588
|
-
|
589
|
-
|
590
|
-
|
591
|
-
|
592
|
-
|
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
|
-
|
600
|
-
|
601
|
-
|
602
|
-
|
603
|
-
|
604
|
-
|
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 /
|
615
|
-
const x2Pixel = originX + x2 * (graphWidth /
|
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(
|
682
|
-
numberLinePage.steps.
|
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(
|
707
|
-
numberLinePage.steps.
|
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);
|