itemengine-cypress-automation 1.0.184-e2e-execution-crash-3b9d0d0.0 → 1.0.184
Sign up to get free protection for your applications and to get access to all the features.
- package/cypress/e2e/ILC/AudioPlayerNew/allSupportedFileTypes.js +79 -0
- package/cypress/e2e/ILC/AudioPlayerNew/barAudioPlayerStyle.js +345 -0
- package/cypress/e2e/ILC/AudioPlayerNew/compactAudioPlayerStyle.js +429 -0
- package/cypress/e2e/ILC/AudioPlayerNew/previewContents.smoke.js +162 -0
- package/cypress/e2e/ILC/AudioPlayerNew/standardAudioPlayerStyle.js +489 -0
- package/cypress/e2e/ILC/AudioPlayerNew/uploadAndAddAudioFile.js +313 -0
- package/cypress/e2e/ILC/AudioResponseNew/barRecorderStyle.smoke.js +1 -1
- package/cypress/e2e/ILC/AudioResponseNew/compactRecorderStyle.smoke.js +1 -1
- package/cypress/e2e/ILC/AudioResponseNew/standardRecorderStyle.smoke.js +1 -1
- package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/clickAndDrop.js +1 -1
- package/cypress/e2e/ILC/DrawingResponse/drawingResponseGradingViewAndCorrectAnswerViewContents.smoke.js +5 -8
- package/cypress/e2e/ILC/EditTabSettingPage/itemPreviewSettingsTabFunctionality.js +417 -28
- package/cypress/e2e/ILC/EssayResponse/editCategoryFlyout.js +1 -1
- package/cypress/e2e/ILC/FeedbackScaleNew/headerSection.js +29 -1
- package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/previewContentsForAllViews.smoke.js +2 -2
- package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/studentViewSettings.js +1 -1
- package/cypress/e2e/ILC/FillInTheGapsDropdownNew/studentViewSettings.js +1 -1
- package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/editTabScoring.js +1 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/previewContentsForAllViews.smoke.js +2 -2
- package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/studentViewSettings.js +1 -1
- package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/studentViewSettings.js +1 -1
- package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/Scoring/partialDifferentWeightsWithCorrectPointsEqualToAlternativePoints.js +4 -4
- package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/Scoring/partialEqualWeightsWithAlternativePointsGreaterThanCorrectPoints.js +1 -1
- package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/studentViewSettings.js +1 -1
- package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/partialDifferentWeightsAlternativePointsGreaterThanCorrectPoints.js +5 -5
- package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/partialDifferentWeightsWithCorrectPointsEqualToAlternativePoints.js +3 -4
- package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/partialEqualWeightsWithAlternativePointsGreaterThanCorrectPoints.js +1 -1
- package/cypress/e2e/ILC/FillInTheGapsTextNew/headerSection.js +1 -0
- package/cypress/e2e/ILC/FillInTheGapsTextNew/studentViewSettings.js +1 -1
- package/cypress/e2e/ILC/Graphing/Scoring/allOrNothingWithAlternativePointsGreaterThanCorrectPoints.js +2 -2
- package/cypress/e2e/ILC/Graphing/Scoring/allOrNothingWithCorrectPointsEqualToAlternatePoints.js +2 -2
- package/cypress/e2e/ILC/Graphing/Scoring/allOrNothingWithCorrectPointsGreaterThanAlternativePoints.js +2 -2
- package/cypress/e2e/ILC/Graphing/addBackgroundShapesSection.js +2 -2
- package/cypress/e2e/ILC/Graphing/studentViewSettings.js +1 -1
- package/cypress/e2e/ILC/GridFill/checkAnswerFunctionalityForAllViews.smoke.js +2 -2
- package/cypress/e2e/ILC/GridFill/gridLayoutContents.js +11 -3
- package/cypress/e2e/ILC/GridFill/previewContentsForAllViews.smoke.js +3 -3
- package/cypress/e2e/ILC/GridFill/studentViewSettingsSection.js +1 -1
- package/cypress/e2e/ILC/ListOrderingDropdown/allOrNothingForAllViews.smoke.js +230 -0
- package/cypress/e2e/ILC/ListOrderingDropdown/checkAnswerFunctionalityForAllViews.smoke.js +124 -0
- package/cypress/e2e/ILC/ListOrderingDropdown/previewContentsForAllViews.smoke.js +201 -0
- package/cypress/e2e/ILC/ListOrderingNew/Scoring/allOrNothingAlternativePointsGreaterThanCorrectPoints.js +216 -0
- package/cypress/e2e/ILC/ListOrderingNew/Scoring/allOrNothingCorrectPointsEqualToAlternativePoints.js +214 -0
- package/cypress/e2e/ILC/ListOrderingNew/Scoring/allOrNothingCorrectPointsGreaterThanAlternativePoints.js +251 -0
- package/cypress/e2e/ILC/ListOrderingNew/Scoring/allOrNothingPenaltyScoring.js +52 -0
- package/cypress/e2e/ILC/ListOrderingNew/Scoring/manuallyAndNonScored.js +128 -0
- package/cypress/e2e/ILC/ListOrderingNew/Scoring/partialDifferentWeightsAlternativePointsGreaterThanCorrectPoints.js +279 -0
- package/cypress/e2e/ILC/ListOrderingNew/Scoring/partialDifferentWeightsBasic.js +109 -0
- package/cypress/e2e/ILC/ListOrderingNew/Scoring/partialDifferentWeightsCorrectPointsEqualToAlternativePoints.js +278 -0
- package/cypress/e2e/ILC/ListOrderingNew/Scoring/partialDifferentWeightsCorrectPointsGreaterThanAlternativePoints.js +278 -0
- package/cypress/e2e/ILC/ListOrderingNew/Scoring/partialDifferentWeightsMinimumAndPenaltyScoring.js +335 -0
- package/cypress/e2e/ILC/ListOrderingNew/Scoring/partialEqualWeightsAlternativePointsGreaterThanCorrectPoints.js +250 -0
- package/cypress/e2e/ILC/ListOrderingNew/Scoring/partialEqualWeightsBasic.js +161 -0
- package/cypress/e2e/ILC/ListOrderingNew/Scoring/partialEqualWeightsCorrectPointsEqualToAlternativePoints.js +216 -0
- package/cypress/e2e/ILC/ListOrderingNew/Scoring/partialEqualWeightsCorrectPointsGreaterThanAlternativePoints.js +252 -0
- package/cypress/e2e/ILC/ListOrderingNew/additionalSettings.js +118 -0
- package/cypress/e2e/ILC/ListOrderingNew/allOrNothingForAllViews.smoke.js +243 -0
- package/cypress/e2e/ILC/ListOrderingNew/checkAnswerFunctionalityForAllViews.smoke.js +128 -0
- package/cypress/e2e/ILC/ListOrderingNew/editTabBasicSection.js +155 -0
- package/cypress/e2e/ILC/ListOrderingNew/editTabScoring.js +195 -0
- package/cypress/e2e/ILC/ListOrderingNew/headerSection.js +78 -0
- package/cypress/e2e/ILC/ListOrderingNew/minimumScoringPenaltyPointsAndRoundingDropdown.js +194 -0
- package/cypress/e2e/ILC/ListOrderingNew/previewContentsForAllViews.smoke.js +176 -0
- package/cypress/e2e/ILC/ListOrderingNew/specifyCorrectAnswerSection.js +112 -0
- package/cypress/e2e/ILC/ListOrderingNew/studentViewSettings.js +244 -0
- package/cypress/e2e/ILC/Matching/studentViewSettings.js +1 -1
- package/cypress/e2e/ILC/MultipleSelection/allOrNothingWithAlternativeAnswer.js +1 -0
- package/cypress/e2e/ILC/MultipleSelectionGridNew/studentViewSettings.js +1 -1
- package/cypress/e2e/ILC/NumberLine/LayoutSection.js +181 -0
- package/cypress/e2e/ILC/NumberLine/Scoring/allOrNothingWithCorrectPointsGreaterThanAlternativePoints.js +3 -3
- package/cypress/e2e/ILC/NumberLine/allOrNothingScoringForAllViews.smoke.js +57 -1
- package/cypress/e2e/ILC/NumberLine/lineSettingsSection.js +33 -0
- package/cypress/e2e/ILC/NumberLine/numberLineSection.js +46 -0
- package/cypress/e2e/ILC/NumberLine/previewTabContentsForAllViews.smoke.js +1 -1
- package/cypress/e2e/ILC/NumberLine/studentViewSettings.js +1 -1
- package/cypress/e2e/ILC/NumberLine/toolSettings.js +2 -1
- package/cypress/e2e/ILC/NumberLine/verticalNumberLine/allOrNothingScoringForAllViews.smoke.js +696 -0
- package/cypress/e2e/ILC/NumberLine/verticalNumberLine/gradingViewAndCorrectAnswerView.smoke.js +173 -0
- package/cypress/e2e/ILC/NumberLine/verticalNumberLine/layoutSection.js +183 -0
- package/cypress/e2e/ILC/NumberLine/verticalNumberLine/numberLineSection.js +73 -0
- package/cypress/e2e/ILC/NumberLine/verticalNumberLine/previewTabContentsForAllViews.smoke.js +204 -0
- package/cypress/e2e/ILC/NumberLineLabel/allOrNothingForAllViews.smoke.js +288 -0
- package/cypress/e2e/ILC/NumberLineLabel/checkAnswerFunctionalityForAllViews.smoke.js +153 -0
- package/cypress/e2e/ILC/NumberLineLabel/gradingViewAndCorrectAnswerView.smoke.js +164 -0
- package/cypress/e2e/ILC/NumberLineLabel/previewContentsForAllViews.smoke.js +120 -0
- package/cypress/e2e/ILC/Protractor/protractorPreviewContents.smoke.js +1 -1
- package/cypress/e2e/ILC/ReadingRuler/readingRulerEditTabBasicsSection.js +49 -1
- package/cypress/e2e/ILC/ShortTextResponseNew/studentViewSettings.js +1 -1
- package/cypress/e2e/ILC/SingleSelectionGridNew/studentViewSettings.js +1 -1
- package/cypress/e2e/ILC/TextEntryMath/responseEvaluationMethodsAndCustomSettings.js +2 -2
- package/cypress/e2e/ILC/TextSelection/Scoring/allOrNothingAlternatePointsMoreThanCorrectPoints.js +0 -1
- package/cypress/e2e/ILC/TextSelection/Scoring/allOrNothingCorrectPointsEqualToAlternatePoints.js +0 -1
- package/cypress/e2e/ILC/TextSelection/Scoring/allOrNothingCorrectPointsMoreThanAlternatePoints.js +0 -1
- package/cypress/e2e/ILC/TextSelection/Scoring/basicScoringForAllTextSelectionTypes.smoke.js +0 -1
- package/cypress/e2e/ILC/TextSelection/additionalSettings.js +125 -0
- package/cypress/e2e/ILC/TextSelection/allOrNothingScoringForAllViews.smoke.js +0 -1
- package/cypress/e2e/ILC/TextSelection/checkAnswerFunctionalityForAllViews.smoke.js +1 -2
- package/cypress/e2e/ILC/TextSelection/editTabScoringSection.js +5 -4
- package/cypress/e2e/ILC/TextSelection/headerSection.js +73 -0
- package/cypress/e2e/ILC/TextSelection/previewContentsForAllViews.smoke.js +6 -7
- package/cypress/e2e/ILC/TextSelection/questionInstructionsAndQuestion.js +179 -0
- package/cypress/e2e/ILC/TextSelection/specifyCorrectAnswerSection.js +89 -0
- package/cypress/e2e/ILC/TextSelection/studentViewSettings.js +436 -0
- package/cypress/e2e/ILC/TextSelection/styleAndLayoutCustomizationAccordion.js +277 -0
- package/cypress/e2e/ILC/TextSelection/textSelectionModesInPreviewTab.js +222 -0
- package/cypress/e2e/ILC/TextSelection/textSelectionModesInSpecifyCorrectAnswerSection.js +260 -0
- package/cypress/e2e/ILC/TextSelection/textSelectionModesInSpecifyPossibleOptionsSection.js +380 -0
- package/cypress/e2e/ILC/ToolSettings/toolSettingsContent.js +5 -5
- package/cypress/e2e/ILC/ToolSettings/toolSettingsPreviewContents.smoke.js +3 -3
- package/cypress/fixtures/constants.js +1 -1
- package/cypress/fixtures/equationEditorCategoriesAndSymbols .js +20 -20
- package/cypress/fixtures/theme/ilc.json +20 -18
- package/cypress/pages/audioPlayerPage.js +274 -504
- package/cypress/pages/brainingCampManipulativePage.js +1 -1
- package/cypress/pages/components/autoScoredSpecifyCorrectAnswerSection.js +3 -3
- package/cypress/pages/components/autoScoredStudentViewSettings.js +5 -5
- package/cypress/pages/components/commonComponents.js +1 -0
- package/cypress/pages/components/draggableOptionContainer.js +1 -0
- package/cypress/pages/components/equationEditorFlyout.js +3 -2
- package/cypress/pages/components/essayResponseCommonComponents.js +8 -2
- package/cypress/pages/components/fillInTheGapsDropdownCommonComponent.js +1 -0
- package/cypress/pages/components/imageCanvasComponent.js +2 -1
- package/cypress/pages/components/index.js +3 -0
- package/cypress/pages/components/layoutSectionComponent.js +1191 -0
- package/cypress/pages/components/numberLineCommonComponent.js +36 -0
- package/cypress/pages/components/optionsWrapperComponent.js +13 -2
- package/cypress/pages/components/playbackControlsBaseComponent.js +20 -13
- package/cypress/pages/components/styleAndLayoutCustomizationAccordionComponent.js +46 -0
- package/cypress/pages/components/toolSettingsComponent.js +6 -0
- package/cypress/pages/contentBlocksPage.js +18 -2
- package/cypress/pages/createItemPage.js +75 -8
- package/cypress/pages/dialogBoxBase.js +2 -2
- package/cypress/pages/drawingResponsePage.js +24 -4
- package/cypress/pages/feedbackScalePage.js +3 -0
- package/cypress/pages/graphingPage.js +19 -1
- package/cypress/pages/gridFillPage.js +25 -8
- package/cypress/pages/index.js +2 -1
- package/cypress/pages/itemPreviewSettingsPage.js +4 -0
- package/cypress/pages/listOrderingPage.js +435 -557
- package/cypress/pages/matchingPage.js +1 -1
- package/cypress/pages/multipleSelectionPage.js +23 -1
- package/cypress/pages/numberLineLabelPage.js +333 -0
- package/cypress/pages/numberLinePage.js +1370 -132
- package/cypress/pages/rulerPage.js +6 -2
- package/cypress/pages/textSelectionPage.js +461 -23
- package/package.json +1 -1
@@ -1,7 +1,10 @@
|
|
1
1
|
import utilities from '../support/helpers/utilities';
|
2
|
-
import { createQuestionBasePage, toolsAndControlsComponent, questionInstructionsComponent, resetPopupComponent, scoringSectionBaseEditTab, autoScoredScoringPreviewTab, autoScoredSpecifyCorrectAnswerSection, commonComponents, autoScoredScoringSectionMultiResponseType, toolSettingsComponent, additionalSettingsPanel, additionalSettingsAccessibilitySectionComponent, autoScoredStudentViewSettings, randomizeOptionsComponent, studentViewSettingsLabelComponent, defaultToolDropdown } from './components';
|
2
|
+
import { createQuestionBasePage, toolsAndControlsComponent, questionInstructionsComponent, resetPopupComponent, scoringSectionBaseEditTab, autoScoredScoringPreviewTab, autoScoredSpecifyCorrectAnswerSection, commonComponents, autoScoredScoringSectionMultiResponseType, toolSettingsComponent, additionalSettingsPanel, additionalSettingsAccessibilitySectionComponent, autoScoredStudentViewSettings, randomizeOptionsComponent, studentViewSettingsLabelComponent, defaultToolDropdown, layoutSectionComponent, numberLineCommonComponent } from './components';
|
3
|
+
import { dialogBoxBase } from './dialogBoxBase';
|
3
4
|
const css = Cypress.env('css');
|
4
|
-
const range = 20.
|
5
|
+
const range = 20.75;
|
6
|
+
const lineSettingsOptions = ['Whole numbers', 'Decimals', 'Fractions', 'Mixed fractions'];
|
7
|
+
const numbers = ['-10', '-10.00', "−\n10\n1", "−\n10\n0\n1"]
|
5
8
|
|
6
9
|
const selectors = {
|
7
10
|
...toolsAndControlsComponent,
|
@@ -14,11 +17,12 @@ const selectors = {
|
|
14
17
|
...commonComponents,
|
15
18
|
...defaultToolDropdown,
|
16
19
|
...autoScoredScoringSectionMultiResponseType,
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
+
...dialogBoxBase,
|
21
|
+
...numberLineCommonComponent,
|
22
|
+
...layoutSectionComponent,
|
23
|
+
|
20
24
|
//Specify correct answer
|
21
|
-
|
25
|
+
numberLineAxisSpecifyCorrectAnswer: () => cy.get('.ngie-accordion .ngie-jxgbox svg line'),
|
22
26
|
numberLineToolOptionSpecifyCorrectAnswer: (toolOptionAriaLabel = null) => {
|
23
27
|
if (toolOptionAriaLabel) {
|
24
28
|
return cy.get(`.graph-tools-wrapper .single-select-toggle-group-double button[aria-label*="${toolOptionAriaLabel}"]`).eq(0)
|
@@ -38,8 +42,7 @@ const selectors = {
|
|
38
42
|
partialEqualWeightsPointsPerResponseScore: () => cy.get('.alternate-points-points-per-value-span'),
|
39
43
|
|
40
44
|
//Preview Tab
|
41
|
-
|
42
|
-
numberLinePointPreviewTab: () => cy.get('[class*="question-preview-wrapper"] .ngie-jxgbox').eq(0).find('svg ellipse[display="inline"]'),
|
45
|
+
numberLineAxisPreviewTab: () => cy.get('[class*="question-preview-wrapper"] .ngie-jxgbox svg line').eq(0),
|
43
46
|
numberLineSegmentPreviewTab: () => cy.get('[class*="question-preview-wrapper"] .ngie-jxgbox').eq(0).find('[stroke-linecap="butt"]'),
|
44
47
|
numberLineToolOptionPreviewTab: (toolOptionAriaLabel = null) => {
|
45
48
|
if (toolOptionAriaLabel) {
|
@@ -58,13 +61,11 @@ const selectors = {
|
|
58
61
|
numberLineTitlePreviewTab: () => cy.get('.edit-question-preview-wrapper [class*="LineGraphstyles__TitleText"]'),
|
59
62
|
|
60
63
|
//Correct answer section
|
61
|
-
correctAnswersLabel: () => cy.get('[class*="AnswerLabel"]'),
|
62
|
-
correctIcon: () => cy.get('[data-icon="CorrectAnswer"]'),
|
63
|
-
incorrectIcon: () => cy.get('[data-icon="Incorrect"]'),
|
64
64
|
numberLineCorrectAnswerSection: () => cy.get('[class*="question-preview-wrapper"] .ngie-jxgbox svg:visible').eq(1),
|
65
65
|
numberLinePointCorrectAnswerSection: () => cy.get('[class*="question-preview-wrapper"] .ngie-jxgbox').eq(1).find('svg ellipse[display="inline"]'),
|
66
|
-
|
67
|
-
|
66
|
+
numberLineTitleCorrectAnswerSection: () => cy.get('[class*="LineGraphstyles__TitleText"]').last(),
|
67
|
+
warningMessage: () => cy.get('.disabled-wrapper-cls [class*="DisabledTextWrapper"]'),
|
68
|
+
warningMessageContainer: () => cy.get('.disabled-wrapper-cls'),
|
68
69
|
}
|
69
70
|
|
70
71
|
const steps = {
|
@@ -80,6 +81,8 @@ const steps = {
|
|
80
81
|
...commonComponents.steps,
|
81
82
|
...autoScoredScoringSectionMultiResponseType.steps,
|
82
83
|
...defaultToolDropdown.steps,
|
84
|
+
...numberLineCommonComponent.steps,
|
85
|
+
...layoutSectionComponent.steps,
|
83
86
|
|
84
87
|
/**
|
85
88
|
* @description This function selects the tool option from graph
|
@@ -117,7 +120,7 @@ const steps = {
|
|
117
120
|
numberLinePage.numberLineSpecifyCorrectAnswer()
|
118
121
|
.click(xPixel, originY, { force: true });
|
119
122
|
} else {
|
120
|
-
const yPixel = originY - coordinate * (
|
123
|
+
const yPixel = originY - coordinate * (graphHeight / range);
|
121
124
|
numberLinePage.numberLineSpecifyCorrectAnswer()
|
122
125
|
.click(originX, yPixel, { force: true });
|
123
126
|
}
|
@@ -173,18 +176,18 @@ const steps = {
|
|
173
176
|
* @param {number} startingPoint - It representing the starting point of the ray.
|
174
177
|
*/
|
175
178
|
verifyRayOnNumberLineSpecifyCorrectAnswer: (direction, range, startingPoint) => {
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
179
|
+
numberLinePage.numberLineSpecifyCorrectAnswer()
|
180
|
+
.then(($graphElement) => {
|
181
|
+
const graphWidth = $graphElement[0].clientWidth;
|
182
|
+
const graphHeight = $graphElement[0].clientHeight;
|
183
|
+
const originX = graphWidth / 2;
|
184
|
+
const originY = graphHeight / 2;
|
185
|
+
const x1Pixel = originX + startingPoint * (graphWidth / range);
|
186
|
+
const rayArrowWidth = 42;
|
187
|
+
const x2Pixel = direction === "left" ? rayArrowWidth : graphWidth - rayArrowWidth;
|
188
|
+
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)}"]`)
|
189
|
+
.should('be.visible');
|
190
|
+
});
|
188
191
|
},
|
189
192
|
|
190
193
|
/**
|
@@ -240,7 +243,7 @@ const steps = {
|
|
240
243
|
numberLinePage.numberLinePreviewTab()
|
241
244
|
.click(xPixel, originY, { force: true });
|
242
245
|
} else {
|
243
|
-
const yPixel = originY
|
246
|
+
const yPixel = originY - coordinate * (graphHeight / range);
|
244
247
|
numberLinePage.numberLinePreviewTab()
|
245
248
|
.click(originX, yPixel, { force: true });
|
246
249
|
}
|
@@ -356,18 +359,18 @@ const steps = {
|
|
356
359
|
* @param {number} startingPoint - It representing the starting point of the ray.
|
357
360
|
*/
|
358
361
|
verifyRayOnNumberLinePreviewTab: (direction, range, startingPoint) => {
|
359
|
-
|
360
|
-
|
361
|
-
|
362
|
-
|
363
|
-
|
364
|
-
|
365
|
-
|
366
|
-
|
367
|
-
|
368
|
-
|
369
|
-
|
370
|
-
|
362
|
+
numberLinePage.numberLinePreviewTab()
|
363
|
+
.then(($graphElement) => {
|
364
|
+
const graphWidth = $graphElement[0].clientWidth;
|
365
|
+
const graphHeight = $graphElement[0].clientHeight;
|
366
|
+
const originX = graphWidth / 2;
|
367
|
+
const originY = graphHeight / 2;
|
368
|
+
const x1Pixel = originX + startingPoint * (graphWidth / range);
|
369
|
+
const rayArrowWidth = 42;
|
370
|
+
const x2Pixel = direction === "left" ? rayArrowWidth : graphWidth - rayArrowWidth;
|
371
|
+
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)}"]`)
|
372
|
+
.should('be.visible');
|
373
|
+
});
|
371
374
|
},
|
372
375
|
|
373
376
|
/**
|
@@ -398,18 +401,18 @@ const steps = {
|
|
398
401
|
* @param {number} startingPoint -It representing the starting point of the ray.
|
399
402
|
*/
|
400
403
|
verifyCorrectRayOnNumberLinePreviewTab: (direction, range, startingPoint) => {
|
401
|
-
|
402
|
-
|
403
|
-
|
404
|
-
|
405
|
-
|
406
|
-
|
407
|
-
|
408
|
-
|
409
|
-
|
410
|
-
|
411
|
-
|
412
|
-
|
404
|
+
numberLinePage.numberLinePreviewTab()
|
405
|
+
.then(($graphElement) => {
|
406
|
+
const graphWidth = $graphElement[0].clientWidth;
|
407
|
+
const graphHeight = $graphElement[0].clientHeight;
|
408
|
+
const originX = graphWidth / 2;
|
409
|
+
const originY = graphHeight / 2;
|
410
|
+
const x1Pixel = originX + startingPoint * (graphWidth / range);
|
411
|
+
const rayArrowWidth = 42;
|
412
|
+
const x2Pixel = direction === "left" ? rayArrowWidth : graphWidth - rayArrowWidth;
|
413
|
+
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)}"]`)
|
414
|
+
.should('have.css', 'stroke', css.color.correctAnswer);
|
415
|
+
});
|
413
416
|
},
|
414
417
|
|
415
418
|
/**
|
@@ -440,18 +443,18 @@ const steps = {
|
|
440
443
|
* @param {number} startingPoint- It representing the starting point of the ray.
|
441
444
|
*/
|
442
445
|
verifyIncorrectRayOnNumberLinePreviewTab: (direction, range, startingPoint) => {
|
443
|
-
|
444
|
-
|
445
|
-
|
446
|
-
|
447
|
-
|
448
|
-
|
449
|
-
|
450
|
-
|
451
|
-
|
452
|
-
|
453
|
-
|
454
|
-
|
446
|
+
numberLinePage.numberLinePreviewTab()
|
447
|
+
.then(($graphElement) => {
|
448
|
+
const graphWidth = $graphElement[0].clientWidth;
|
449
|
+
const graphHeight = $graphElement[0].clientHeight;
|
450
|
+
const originX = graphWidth / 2;
|
451
|
+
const originY = graphHeight / 2;
|
452
|
+
const x1Pixel = originX + startingPoint * (graphWidth / range);
|
453
|
+
const rayArrowWidth = 42;
|
454
|
+
const x2Pixel = direction === "left" ? rayArrowWidth : graphWidth - rayArrowWidth;
|
455
|
+
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)}"]`)
|
456
|
+
.should('have.css', 'stroke', css.color.incorrectAnswer);
|
457
|
+
});
|
455
458
|
},
|
456
459
|
|
457
460
|
/**
|
@@ -754,93 +757,1328 @@ const steps = {
|
|
754
757
|
});
|
755
758
|
},
|
756
759
|
|
760
|
+
//Layout
|
761
|
+
/**
|
762
|
+
* Verifies the orientation and size of the specify correct answer section.
|
763
|
+
* @param {string} orientation - The orientation of the specify correct answer section ('Horizontal' or 'Vertical').
|
764
|
+
* @param {string} value - The value representing the width or height of the specify correct answer section.
|
765
|
+
*/
|
766
|
+
verifyNumberLineOrientationAndSizeSpecifyCorrectAnswerSection: (orientation, value) => {
|
767
|
+
const isHorizontal = orientation === 'Horizontal';
|
768
|
+
const width = isHorizontal ? value : '120';
|
769
|
+
const height = isHorizontal ? '120' : value;
|
770
|
+
numberLinePage.numberLineSpecifyCorrectAnswer()
|
771
|
+
.should('have.attr', 'width', width)
|
772
|
+
.and('have.attr', 'height', height);
|
773
|
+
},
|
774
|
+
|
775
|
+
/**
|
776
|
+
* Verifies the orientation and size of the preview tab of the number line.
|
777
|
+
* @param {string} orientation - The orientation of the preview tab ('Horizontal' or 'Vertical').
|
778
|
+
* @param {string} value - The value representing the width or height of the preview tab.
|
779
|
+
*/
|
780
|
+
verifyNumberLineOrientationAndSizePreviewTab: (orientation, value) => {
|
781
|
+
const isHorizontal = orientation === 'Horizontal';
|
782
|
+
const width = isHorizontal ? value : '120';
|
783
|
+
const height = isHorizontal ? '120' : value;
|
784
|
+
numberLinePage.numberLinePreviewTab()
|
785
|
+
.should('have.attr', 'width', width)
|
786
|
+
.and('have.attr', 'height', height);
|
787
|
+
},
|
788
|
+
|
789
|
+
/**
|
790
|
+
* Verifies the margin for the specify correct answer section of the number line.
|
791
|
+
* @param {number} value - The expected margin value in pixels.
|
792
|
+
*/
|
793
|
+
verifyMarginForNumberLineSpecifyCorrectAnswerSection: (value) => {
|
794
|
+
numberLinePage.numberLineSpecifyCorrectAnswer()
|
795
|
+
.parents('[class*="LineGraphstyles__GraphContainer"]')
|
796
|
+
.should('have.css', 'padding', `${value}px`);
|
797
|
+
},
|
798
|
+
|
799
|
+
/**
|
800
|
+
* Verifies the margin for the preview tab of the number line.
|
801
|
+
* @param {number} value - The expected margin value in pixels.
|
802
|
+
*/
|
803
|
+
verifyMarginForNumberLinePreviewTab: (value) => {
|
804
|
+
numberLinePage.numberLinePreviewTab()
|
805
|
+
.parents('[class*="LineGraphstyles__GraphContainer"]')
|
806
|
+
.should('have.css', 'padding', `${value}px`);
|
807
|
+
},
|
808
|
+
|
809
|
+
/**
|
810
|
+
* Verifies the response spacing for the specify correct answer section of the number line.
|
811
|
+
* @param {string} orientation - The orientation of the number line ('Horizontal' or 'Vertical').
|
812
|
+
* @param {number} value - The expected response spacing value.
|
813
|
+
*/
|
814
|
+
verifyResponseSpacingSpecifyCorrectAnswerSection: (orientation, value) => {
|
815
|
+
const attribute = orientation === 'Horizontal' ? 'height' : 'width';
|
816
|
+
numberLinePage.numberLineSpecifyCorrectAnswer()
|
817
|
+
.should('have.attr', attribute, value * 4);
|
818
|
+
},
|
819
|
+
|
820
|
+
/**
|
821
|
+
* Verifies the response spacing for the preview tab of the number line.
|
822
|
+
* @param {string} orientation - The orientation of the number line ('Horizontal' or 'Vertical').
|
823
|
+
* @param {number} value - The expected response spacing value.
|
824
|
+
*/
|
825
|
+
verifyResponseSpacingPreviewTab: (orientation, value) => {
|
826
|
+
const attribute = orientation === 'Horizontal' ? 'height' : 'width';
|
827
|
+
numberLinePage.numberLinePreviewTab()
|
828
|
+
.should('have.attr', attribute, value * 4);
|
829
|
+
},
|
830
|
+
|
831
|
+
/**
|
832
|
+
* Verifies the visibility of the minimum arrow .
|
833
|
+
* @param {string} visibility - The expected visibility ('visible' or 'hidden').
|
834
|
+
* @throws {Error} Throws an error if the provided visibility string is invalid.
|
835
|
+
*/
|
836
|
+
verifyMinArrowVisibilitySpecifyCorrectAnswerSection: (visibility) => {
|
837
|
+
if (visibility === 'visible') {
|
838
|
+
numberLinePage.numberLineAxisSpecifyCorrectAnswer()
|
839
|
+
.should('have.attr', 'marker-start');
|
840
|
+
}
|
841
|
+
else if (visibility === 'hidden') {
|
842
|
+
numberLinePage.numberLineAxisSpecifyCorrectAnswer()
|
843
|
+
.should('not.have.attr', 'marker-start');
|
844
|
+
}
|
845
|
+
else {
|
846
|
+
throw new Error('invalid state string');
|
847
|
+
}
|
848
|
+
},
|
849
|
+
|
850
|
+
/**
|
851
|
+
* Verifies the visibility of the minimum arrow
|
852
|
+
* @param {string} visibility - The expected visibility ('visible' or 'hidden').
|
853
|
+
* @throws {Error} Throws an error if the provided visibility string is invalid.
|
854
|
+
*/
|
855
|
+
verifyMinArrowVisibilityPreviewTab: (visibility) => {
|
856
|
+
if (visibility === 'visible') {
|
857
|
+
numberLinePage.numberLineAxisPreviewTab()
|
858
|
+
.should('have.attr', 'marker-start');
|
859
|
+
}
|
860
|
+
else if (visibility === 'hidden') {
|
861
|
+
numberLinePage.numberLineAxisPreviewTab()
|
862
|
+
.should('not.have.attr', 'marker-start');
|
863
|
+
}
|
864
|
+
else {
|
865
|
+
throw new Error('invalid state string');
|
866
|
+
}
|
867
|
+
},
|
868
|
+
|
869
|
+
/**
|
870
|
+
* Verifies the visibility of the maximum arrow
|
871
|
+
* @param {string} visibility - The expected visibility ('visible' or 'hidden').
|
872
|
+
* @throws {Error} Throws an error if the provided visibility string is invalid.
|
873
|
+
*/
|
874
|
+
verifyMaxArrowVisibilitySpecifyCorrectAnswerSection: (visibility) => {
|
875
|
+
if (visibility === 'visible') {
|
876
|
+
numberLinePage.numberLineAxisSpecifyCorrectAnswer()
|
877
|
+
.should('have.attr', 'marker-end');
|
878
|
+
}
|
879
|
+
else if (visibility === 'hidden') {
|
880
|
+
numberLinePage.numberLineAxisSpecifyCorrectAnswer()
|
881
|
+
.should('not.have.attr', 'marker-end');
|
882
|
+
}
|
883
|
+
else {
|
884
|
+
throw new Error('invalid state string');
|
885
|
+
}
|
886
|
+
},
|
887
|
+
|
888
|
+
/**
|
889
|
+
* Verifies the visibility of the maximum arrow
|
890
|
+
* @param {string} visibility - The expected visibility ('visible' or 'hidden').
|
891
|
+
* @throws {Error} Throws an error if the provided visibility string is invalid.
|
892
|
+
*/
|
893
|
+
verifyMaxArrowVisibilityPreviewTab: (visibility) => {
|
894
|
+
if (visibility === 'visible') {
|
895
|
+
numberLinePage.numberLineAxisPreviewTab()
|
896
|
+
.should('have.attr', 'marker-end');
|
897
|
+
}
|
898
|
+
else if (visibility === 'hidden') {
|
899
|
+
numberLinePage.numberLineAxisPreviewTab()
|
900
|
+
.should('not.have.attr', 'marker-end');
|
901
|
+
}
|
902
|
+
else {
|
903
|
+
throw new Error('invalid state string');
|
904
|
+
}
|
905
|
+
},
|
906
|
+
|
757
907
|
/**
|
758
|
-
*
|
759
|
-
* @param {string
|
760
|
-
* @
|
908
|
+
* Verifies the visibility and text of labels on the specify correct answer section of the number line.
|
909
|
+
* @param {string} value - The initial value of the labels.
|
910
|
+
* @param {number} interval - The interval between consecutive labels.
|
761
911
|
*/
|
762
|
-
|
763
|
-
|
764
|
-
|
765
|
-
.
|
766
|
-
.
|
912
|
+
verifyLabelsVisibleOnNumberLineSpecifyCorrectAnswerSection: (value, interval) => {
|
913
|
+
cy.wait(3000)
|
914
|
+
numberLinePage.numberLineSpecifyCorrectAnswer()
|
915
|
+
.parents('.ngie-jxgbox')
|
916
|
+
.find('.number-line-tick-font')
|
917
|
+
.its('length').then((len) => {
|
918
|
+
for (let index = 0; index < len; index++) {
|
919
|
+
numberLinePage.numberLineSpecifyCorrectAnswer()
|
920
|
+
.parents('.ngie-jxgbox')
|
921
|
+
.find('.number-line-tick-font')
|
922
|
+
.eq(index)
|
923
|
+
.should('have.text', value);
|
924
|
+
value += interval;
|
925
|
+
}
|
926
|
+
});
|
767
927
|
},
|
768
928
|
|
769
|
-
|
770
|
-
|
929
|
+
/**
|
930
|
+
* Verifies the visibility and text of labels on the preview tab of the number line.
|
931
|
+
* @param {string} value - The initial value of the labels.
|
932
|
+
* @param {number} interval - The interval between consecutive labels.
|
933
|
+
*/
|
934
|
+
verifyLabelsVisibleOnNumberLinePreviewTab: (value, interval) => {
|
935
|
+
numberLinePage.numberLinePreviewTab()
|
936
|
+
.parents('.ngie-jxgbox')
|
937
|
+
.find('.number-line-tick-font')
|
938
|
+
.its('length').then((len) => {
|
939
|
+
for (let index = 0; index < len; index++) {
|
940
|
+
numberLinePage.numberLinePreviewTab()
|
941
|
+
.parents('.ngie-jxgbox')
|
942
|
+
.find('.number-line-tick-font')
|
943
|
+
.eq(index)
|
944
|
+
.should('have.text', value);
|
945
|
+
value += interval;
|
946
|
+
}
|
947
|
+
});
|
948
|
+
},
|
949
|
+
|
950
|
+
|
951
|
+
verifyLabelsNotVisibleOnNumberLinePreviewTab: () => {
|
952
|
+
numberLinePage.numberLinePreviewTab()
|
953
|
+
.parents('.ngie-jxgbox')
|
954
|
+
.find('.number-line-tick-font')
|
955
|
+
.should('not.exist');
|
956
|
+
},
|
957
|
+
|
958
|
+
verifyLabelsNotVisibleOnNumberLineSpecifyCorrectAnswerSection: () => {
|
959
|
+
numberLinePage.numberLineSpecifyCorrectAnswer()
|
960
|
+
.parents('.ngie-jxgbox')
|
961
|
+
.find('.number-line-tick-font')
|
962
|
+
.should('not.exist');
|
963
|
+
},
|
964
|
+
|
965
|
+
clickOnToolOptionsSpecifyCorrectAnswer: () => {
|
966
|
+
cy.log('Clicking on control options to remove error message');
|
967
|
+
numberLinePage.numberLineToolOptionSpecifyCorrectAnswer()
|
968
|
+
.parents('.graph-tools-wrapper')
|
771
969
|
.click();
|
772
|
-
}
|
773
|
-
}
|
970
|
+
},
|
774
971
|
|
775
|
-
|
776
|
-
|
777
|
-
|
778
|
-
|
779
|
-
|
780
|
-
|
781
|
-
...autoScoredStudentViewSettings.tests,
|
782
|
-
...autoScoredSpecifyCorrectAnswerSection.tests,
|
783
|
-
...createQuestionBasePage.tests,
|
784
|
-
...commonComponents.tests,
|
785
|
-
...autoScoredScoringPreviewTab.tests,
|
786
|
-
...defaultToolDropdown.tests,
|
787
|
-
...scoringSectionBaseEditTab.tests,
|
788
|
-
...autoScoredScoringSectionMultiResponseType.tests,
|
972
|
+
clickOnToolOptionsPreviewTab: () => {
|
973
|
+
cy.log('Clicking on control options to remove error message');
|
974
|
+
numberLinePage.numberLineToolOptionPreviewTab()
|
975
|
+
.parents('.graph-tools-wrapper')
|
976
|
+
.click();
|
977
|
+
},
|
789
978
|
|
790
|
-
|
791
|
-
|
792
|
-
|
793
|
-
|
794
|
-
|
795
|
-
|
979
|
+
/**
|
980
|
+
* Verifies the label on the number line.
|
981
|
+
* @param {Array} values - An array of objects containing the value and index of each label.
|
982
|
+
*/
|
983
|
+
verifyLabelOnNumberLineSpecifyCorrectAnswerSection: (values) => {
|
984
|
+
values.forEach(({ value, index }) => {
|
985
|
+
numberLinePage.numberLineSpecifyCorrectAnswer()
|
986
|
+
.parents('.ngie-jxgbox')
|
987
|
+
.find('.number-line-tick-font')
|
988
|
+
.eq(index)
|
989
|
+
.then(($el) => {
|
990
|
+
const innerText = $el[0].innerText;
|
991
|
+
expect(innerText.trim()).to.equal(value.toString());
|
992
|
+
});
|
796
993
|
});
|
797
994
|
},
|
798
995
|
|
799
996
|
/**
|
800
|
-
|
801
|
-
|
802
|
-
|
803
|
-
|
804
|
-
|
805
|
-
|
806
|
-
|
807
|
-
|
808
|
-
|
997
|
+
* Verifies the label on the number line.
|
998
|
+
* @param {Array} values - An array of objects containing the value and index of each label.
|
999
|
+
*/
|
1000
|
+
verifyLabelOnNumberLinePreviewTab: (values) => {
|
1001
|
+
values.forEach(({ value, index }) => {
|
1002
|
+
numberLinePage.numberLinePreviewTab()
|
1003
|
+
.parents('.ngie-jxgbox')
|
1004
|
+
.find('.number-line-tick-font')
|
1005
|
+
.eq(index)
|
1006
|
+
.then(($el) => {
|
1007
|
+
const innerText = $el[0].innerText;
|
1008
|
+
expect(innerText.trim()).to.equal(value.toString());
|
1009
|
+
});
|
809
1010
|
});
|
1011
|
+
},
|
810
1012
|
|
811
|
-
|
812
|
-
|
813
|
-
|
814
|
-
|
815
|
-
|
816
|
-
|
817
|
-
|
818
|
-
|
819
|
-
|
820
|
-
|
821
|
-
|
822
|
-
|
823
|
-
|
824
|
-
|
825
|
-
|
826
|
-
|
827
|
-
|
1013
|
+
/**
|
1014
|
+
* Verifies the display numbers orientation in the specify correct answer section of the number line.
|
1015
|
+
* @param {string} numberLineOrientation - The orientation of the number line ('Horizontal' or 'Vertical').
|
1016
|
+
* @param {string} numberOrientation - The orientation of the numbers ('Below' or 'Left').
|
1017
|
+
* @throws {Error} Thrown if the number line orientation is invalid.
|
1018
|
+
*/
|
1019
|
+
verifyDisplayNumbersOrientationSpecifyCorrectAnswerSection: (numberLineOrientation, numberOrientation) => {
|
1020
|
+
let property, value;
|
1021
|
+
switch (numberLineOrientation) {
|
1022
|
+
case 'Horizontal':
|
1023
|
+
property = numberOrientation === 'Below' ? 'top' : 'bottom';
|
1024
|
+
value = '83px';
|
1025
|
+
break;
|
1026
|
+
case 'Vertical':
|
1027
|
+
property = numberOrientation === 'Left of' ? 'right' : 'left';
|
1028
|
+
value = '85px';
|
1029
|
+
break;
|
1030
|
+
default:
|
1031
|
+
throw new Error('Invalid Number line orientation');
|
1032
|
+
}
|
1033
|
+
numberLinePage.numberLineSpecifyCorrectAnswer()
|
1034
|
+
.parents('.ngie-jxgbox')
|
1035
|
+
.find('.number-line-tick-font')
|
1036
|
+
.eq(0)
|
1037
|
+
.should('have.css', property, value);
|
1038
|
+
},
|
828
1039
|
|
829
|
-
|
1040
|
+
/**
|
1041
|
+
* Verifies the display numbers orientation in the number line section.
|
1042
|
+
* @param {string} numberLineOrientation - The orientation of the number line ('Horizontal' or 'Vertical').
|
1043
|
+
* @param {string} numberOrientation - The orientation of the numbers ('Below' or 'Left').
|
1044
|
+
* @throws {Error} Thrown if the number line orientation is invalid.
|
1045
|
+
*/
|
1046
|
+
verifyDisplayNumbersOrientationPreviewTab: (numberLineOrientation, numberOrientation) => {
|
1047
|
+
let property, value;
|
1048
|
+
switch (numberLineOrientation) {
|
1049
|
+
case 'Horizontal':
|
1050
|
+
property = numberOrientation === 'Below' ? 'top' : 'bottom';
|
1051
|
+
value = '83px';
|
1052
|
+
break;
|
1053
|
+
case 'Vertical':
|
1054
|
+
property = numberOrientation === 'Left of' ? 'right' : 'left';
|
1055
|
+
value = '85px';
|
1056
|
+
break;
|
1057
|
+
default:
|
1058
|
+
throw new Error('Invalid Number line orientation');
|
1059
|
+
}
|
830
1060
|
|
831
|
-
|
832
|
-
|
833
|
-
|
834
|
-
|
835
|
-
|
1061
|
+
numberLinePage.numberLinePreviewTab()
|
1062
|
+
.parents('.ngie-jxgbox')
|
1063
|
+
.find('.number-line-tick-font')
|
1064
|
+
.eq(0)
|
1065
|
+
.should('have.css', property, value);
|
1066
|
+
},
|
836
1067
|
|
837
|
-
|
1068
|
+
/**
|
1069
|
+
* Verifies the annotated labels on the number line.
|
1070
|
+
* @param {string} value - The value of the annotated label.
|
1071
|
+
* @param {number} annotateEvery - The frequency of annotation.
|
1072
|
+
*/
|
1073
|
+
verifyAnnotatedLabelsOnNumberLineSpecifyCorrectAnswerSection: (value, annotateEvery) => {
|
1074
|
+
cy.wait(3000);
|
1075
|
+
numberLinePage.numberLineSpecifyCorrectAnswer()
|
1076
|
+
.parents('.ngie-jxgbox')
|
1077
|
+
.find('.number-line-tick-font')
|
1078
|
+
.each(($element, index) => {
|
1079
|
+
if (index % annotateEvery === 0) {
|
1080
|
+
cy.wrap($element).should('have.text', value);
|
1081
|
+
value += annotateEvery;
|
1082
|
+
}
|
1083
|
+
});
|
1084
|
+
},
|
838
1085
|
|
839
|
-
|
840
|
-
|
841
|
-
|
842
|
-
|
1086
|
+
/**
|
1087
|
+
* Verifies the annotated labels on the number line.
|
1088
|
+
* @param {string} value - The value of the annotated label.
|
1089
|
+
* @param {number} annotateEvery - The frequency of annotation.
|
1090
|
+
*/
|
1091
|
+
verifyAnnotatedLabelsOnNumberLinePreviewTab: (value, annotateEvery) => {
|
1092
|
+
numberLinePage.numberLinePreviewTab()
|
1093
|
+
.parents('.ngie-jxgbox')
|
1094
|
+
.find('.number-line-tick-font')
|
1095
|
+
.each(($element, index) => {
|
1096
|
+
if (index % annotateEvery === 0) {
|
1097
|
+
cy.wrap($element).should('have.text', value);
|
1098
|
+
value += annotateEvery;
|
1099
|
+
}
|
1100
|
+
});
|
1101
|
+
},
|
843
1102
|
|
1103
|
+
//Vertical orientation
|
1104
|
+
/**
|
1105
|
+
* This function verifies plotted points on the vertical number line on the specify correct answer section.
|
1106
|
+
* @param {number} range - The range of y coordinates.
|
1107
|
+
* @param {number[]} coordinates - An array containing y coordinates to be plotted on the graph.
|
1108
|
+
*/
|
1109
|
+
verifyPointsPlottedOnVerticalNumberLineSpecifyCorrectAnswer: (range, coordinates) => {
|
1110
|
+
coordinates.forEach(y => {
|
1111
|
+
numberLinePage.numberLineSpecifyCorrectAnswer()
|
1112
|
+
.then(($graphElement) => {
|
1113
|
+
const graphWidth = $graphElement[0].clientWidth;
|
1114
|
+
const graphHeight = $graphElement[0].clientHeight;
|
1115
|
+
const originX = graphWidth / 2;
|
1116
|
+
const originY = graphHeight / 2;
|
1117
|
+
const yPixel = originY - y * (graphHeight / range);
|
1118
|
+
cy.get(`.ngie-accordion .ngie-jxgbox svg ellipse[cx*="${Math.floor(originX)}"][cy*="${Math.floor(yPixel)}"][tabindex="0"]`)
|
1119
|
+
.should('exist');
|
1120
|
+
});
|
1121
|
+
});
|
1122
|
+
},
|
1123
|
+
|
1124
|
+
/**
|
1125
|
+
* This function verifies plotted points on the vertical number line do not exist on the Edit tab.
|
1126
|
+
* @param {number} range - The range of y coordinates.
|
1127
|
+
* @param {number[]} coordinates - An array containing y coordinates to be plotted on the graph.
|
1128
|
+
*/
|
1129
|
+
verifyPointsPlottedOnVerticalNumberLineNotExistSpecifyCorrectAnswer: (range, coordinates) => {
|
1130
|
+
coordinates.forEach(y => {
|
1131
|
+
numberLinePage.numberLineSpecifyCorrectAnswer()
|
1132
|
+
.then(($graphElement) => {
|
1133
|
+
const graphWidth = $graphElement[0].clientWidth;
|
1134
|
+
const graphHeight = $graphElement[0].clientHeight;
|
1135
|
+
const originX = graphWidth / 2;
|
1136
|
+
const originY = graphHeight / 2;
|
1137
|
+
const yPixel = originY + y * (graphHeight / range);
|
1138
|
+
cy.get(`.ngie-accordion .ngie-jxgbox svg ellipse[cx*="${Math.floor(originX)}"][cy*="${Math.floor(yPixel)}"][tabindex="0"]`)
|
1139
|
+
.should('not.exist');
|
1140
|
+
});
|
1141
|
+
});
|
1142
|
+
},
|
1143
|
+
|
1144
|
+
/**
|
1145
|
+
* This function verifies plotted points on the vertical number line on the preview tab.
|
1146
|
+
* @param {number} range - The range of y coordinates.
|
1147
|
+
* @param {number[]} coordinates - An array containing y coordinates to be plotted on the graph.
|
1148
|
+
*/
|
1149
|
+
verifyPointsPlottedOnVerticalNumberLinePreviewTab: (range, coordinates) => {
|
1150
|
+
coordinates.forEach(y => {
|
1151
|
+
numberLinePage.numberLinePreviewTab()
|
1152
|
+
.then(($graphElement) => {
|
1153
|
+
const graphWidth = $graphElement[0].clientWidth;
|
1154
|
+
const graphHeight = $graphElement[0].clientHeight;
|
1155
|
+
const originX = graphWidth / 2;
|
1156
|
+
const originY = graphHeight / 2;
|
1157
|
+
const yPixel = originY - y * (graphHeight / range);
|
1158
|
+
cy.get('[class*="question-preview-wrapper"] .ngie-jxgbox').eq(0).find(`svg ellipse[cx*="${Math.floor(originX)}"][cy*="${Math.floor(yPixel)}"][tabindex="0"]`)
|
1159
|
+
.should('exist');
|
1160
|
+
});
|
1161
|
+
});
|
1162
|
+
},
|
1163
|
+
|
1164
|
+
verifyCorrectPointsOnVerticalNumberLinePreviewTab: (range, coordinates) => {
|
1165
|
+
coordinates.forEach(y => {
|
1166
|
+
numberLinePage.numberLinePreviewTab()
|
1167
|
+
.then(($graphElement) => {
|
1168
|
+
const graphWidth = $graphElement[0].clientWidth;
|
1169
|
+
const graphHeight = $graphElement[0].clientHeight;
|
1170
|
+
const originX = graphWidth / 2;
|
1171
|
+
const originY = graphHeight / 2;
|
1172
|
+
const yPixel = originY - y * (graphHeight / range);
|
1173
|
+
cy.get('[class*="question-preview-wrapper"] .ngie-jxgbox').eq(0).find(`svg ellipse[cx*="${Math.floor(originX)}"][cy*="${Math.floor(yPixel)}"][display="inline"]`)
|
1174
|
+
.should('have.css', 'stroke', css.color.correctAnswer);
|
1175
|
+
});
|
1176
|
+
});
|
1177
|
+
},
|
1178
|
+
|
1179
|
+
verifyIncorrectPointsOnVerticalNumberLinePreviewTab: (range, coordinates) => {
|
1180
|
+
coordinates.forEach(y => {
|
1181
|
+
numberLinePage.numberLinePreviewTab()
|
1182
|
+
.then(($graphElement) => {
|
1183
|
+
const graphWidth = $graphElement[0].clientWidth;
|
1184
|
+
const graphHeight = $graphElement[0].clientHeight;
|
1185
|
+
const originX = graphWidth / 2;
|
1186
|
+
const originY = graphHeight / 2;
|
1187
|
+
const yPixel = originY - y * (graphHeight / range);
|
1188
|
+
cy.get('[class*="question-preview-wrapper"] .ngie-jxgbox').eq(0).find(`svg ellipse[cx*="${Math.floor(originX)}"][cy*="${Math.floor(yPixel)}"][display="inline"]`)
|
1189
|
+
.should('have.css', 'stroke', css.color.incorrectAnswer);
|
1190
|
+
});
|
1191
|
+
});
|
1192
|
+
},
|
1193
|
+
|
1194
|
+
/**
|
1195
|
+
* Verifies that the points do not exist on the vertical number line in the preview tab.
|
1196
|
+
* @param {number} range - The range of the number line.
|
1197
|
+
* @param {number[]} coordinates - The y-coordinates of the points.
|
1198
|
+
*/
|
1199
|
+
verifyPointsNotExistOnVerticalNumberLinePreviewTab: (range, coordinates) => {
|
1200
|
+
coordinates.forEach(y => {
|
1201
|
+
numberLinePage.numberLinePreviewTab()
|
1202
|
+
.then(($graphElement) => {
|
1203
|
+
const graphWidth = $graphElement[0].clientWidth;
|
1204
|
+
const graphHeight = $graphElement[0].clientHeight;
|
1205
|
+
const originX = graphWidth / 2;
|
1206
|
+
const originY = graphHeight / 2;
|
1207
|
+
const yPixel = originY - y * (graphHeight / range);
|
1208
|
+
cy.get('[class*="question-preview-wrapper"] .ngie-jxgbox').eq(0).find(`svg ellipse[cx*="${Math.floor(originX)}"][cy*="${Math.floor(yPixel)}"][tabindex="0"]`)
|
1209
|
+
.should('not.exist');
|
1210
|
+
});
|
1211
|
+
});
|
1212
|
+
},
|
1213
|
+
|
1214
|
+
/**
|
1215
|
+
* This function verifies plotted points on the vertical number line on c tab
|
1216
|
+
* @param {Object[]} coordinates - An array containing x and y coordinates along with their ranges
|
1217
|
+
* @param {number} coordinates[].x - x coordinate to be plotted on the graph
|
1218
|
+
* @param {number} coordinates[].xRange - range of x coordinate
|
1219
|
+
*/
|
1220
|
+
verifyPointsPlottedOnVerticalNumberLineCorrectAnswerSection: (range, coordinates) => {
|
1221
|
+
coordinates.forEach(y => {
|
1222
|
+
numberLinePage.numberLineCorrectAnswerSection()
|
1223
|
+
.then(($graphElement) => {
|
1224
|
+
const graphWidth = $graphElement[0].clientWidth;
|
1225
|
+
const graphHeight = $graphElement[0].clientHeight;
|
1226
|
+
const originX = graphWidth / 2;
|
1227
|
+
const originY = graphHeight / 2;
|
1228
|
+
const yPixel = originY - y * (graphHeight / range);
|
1229
|
+
cy.get('[class*="question-preview-wrapper"] .ngie-jxgbox').eq(1).find(`svg ellipse[cx*="${Math.floor(originX)}"][cy*="${Math.floor(yPixel)}"][pointer-events="visiblePainted"]`)
|
1230
|
+
.should('exist');
|
1231
|
+
});
|
1232
|
+
});
|
1233
|
+
},
|
1234
|
+
|
1235
|
+
/**
|
1236
|
+
* Verifies that the correct points exist on the vertical number line in the correct answer section.
|
1237
|
+
* @param {number} range - The range of the number line.
|
1238
|
+
* @param {number[]} coordinates - The y-coordinates of the points.
|
1239
|
+
*/
|
1240
|
+
verifyCorrectPointsOnVerticalNumberLineCorrectAnswerSection: (range, coordinates) => {
|
1241
|
+
coordinates.forEach(y => {
|
1242
|
+
numberLinePage.numberLineCorrectAnswerSection()
|
1243
|
+
.then(($graphElement) => {
|
1244
|
+
const graphWidth = $graphElement[0].clientWidth;
|
1245
|
+
const graphHeight = $graphElement[0].clientHeight;
|
1246
|
+
const originX = graphWidth / 2;
|
1247
|
+
const originY = graphHeight / 2;
|
1248
|
+
const yPixel = originY - y * (graphHeight / range);
|
1249
|
+
cy.get('[class*="question-preview-wrapper"] .ngie-jxgbox').eq(1).find(`svg ellipse[cx*="${Math.floor(originX)}"][cy*="${Math.floor(yPixel)}"][display="inline"]`)
|
1250
|
+
.should('have.css', 'stroke', css.color.correctAnswer);
|
1251
|
+
});
|
1252
|
+
});
|
1253
|
+
},
|
1254
|
+
|
1255
|
+
/**
|
1256
|
+
* Verifies the line segment on the vertical number line in the specify correct answer section.
|
1257
|
+
* @param {number} range - The range of the number line.
|
1258
|
+
* @param {Object[]} coordinates - The coordinates of the line segment.
|
1259
|
+
* @param {number} coordinates[].y1 - The y-coordinate of the starting point.
|
1260
|
+
* @param {number} coordinates[].y2 - The y-coordinate of the ending point.
|
1261
|
+
*/
|
1262
|
+
verifyLineSegmentOnVerticalNumberLineSpecifyCorrectAnswer: (range, coordinates) => {
|
1263
|
+
coordinates.forEach(({ y1, y2 }) => {
|
1264
|
+
numberLinePage.numberLineSpecifyCorrectAnswer()
|
1265
|
+
.then(($graphElement) => {
|
1266
|
+
const graphWidth = $graphElement[0].clientWidth;
|
1267
|
+
const graphHeight = $graphElement[0].clientHeight;
|
1268
|
+
const originX = graphWidth / 2;
|
1269
|
+
const originY = graphHeight / 2;
|
1270
|
+
const y1Pixel = originY - y1 * (graphHeight / range);
|
1271
|
+
const y2Pixel = originY - y2 * (graphHeight / range);
|
1272
|
+
cy.get(`.ngie-accordion .ngie-jxgbox svg [stroke-linecap="butt"][x1*="${Math.floor(originX)}"][y1*="${Math.floor(y1Pixel)}"][x2*="${Math.floor(originX)}"][y2*="${Math.floor(y2Pixel)}"]`)
|
1273
|
+
.should('be.visible');
|
1274
|
+
});
|
1275
|
+
});
|
1276
|
+
},
|
1277
|
+
|
1278
|
+
/**
|
1279
|
+
* Verifies the line segment on the vertical number line preview tab.
|
1280
|
+
* @param {number} range - The range of the number line.
|
1281
|
+
* @param {Object[]} coordinates - The coordinates of the line segment.
|
1282
|
+
* @param {number} coordinates[].y1 - The y-coordinate of the starting point.
|
1283
|
+
* @param {number} coordinates[].y2 - The y-coordinate of the ending point.
|
1284
|
+
*/
|
1285
|
+
verifyLineSegmentOnVerticalNumberLinePreviewTab: (range, coordinates) => {
|
1286
|
+
coordinates.forEach(({ y1, y2 }) => {
|
1287
|
+
numberLinePage.numberLinePreviewTab()
|
1288
|
+
.then(($graphElement) => {
|
1289
|
+
const graphWidth = $graphElement[0].clientWidth;
|
1290
|
+
const graphHeight = $graphElement[0].clientHeight;
|
1291
|
+
const originX = graphWidth / 2;
|
1292
|
+
const originY = graphHeight / 2;
|
1293
|
+
const y1Pixel = originY - y1 * (graphHeight / range);
|
1294
|
+
const y2Pixel = originY - y2 * (graphHeight / range);
|
1295
|
+
cy.get('[class*="question-preview-wrapper"] .ngie-jxgbox').eq(0).find(`[stroke-linecap="butt"][x1*="${Math.floor(originX)}"][y1*="${Math.floor(y1Pixel)}"][x2*="${Math.floor(originX)}"][y2*="${Math.floor(y2Pixel)}"]`)
|
1296
|
+
.should('be.visible');
|
1297
|
+
});
|
1298
|
+
});
|
1299
|
+
},
|
1300
|
+
|
1301
|
+
/**
|
1302
|
+
* Verifies the correct line segment on the vertical number line preview tab.
|
1303
|
+
* @param {number} range - The range of the number line.
|
1304
|
+
* @param {Object[]} coordinates - The coordinates of the line segment.
|
1305
|
+
* @param {number} coordinates[].y1 - The y-coordinate of the starting point.
|
1306
|
+
* @param {number} coordinates[].y2 - The y-coordinate of the ending point.
|
1307
|
+
*/
|
1308
|
+
verifyCorrectLineSegmentOnVerticalNumberLinePreviewTab: (range, coordinates) => {
|
1309
|
+
coordinates.forEach(({ y1, y2 }) => {
|
1310
|
+
numberLinePage.numberLinePreviewTab()
|
1311
|
+
.then(($graphElement) => {
|
1312
|
+
const graphWidth = $graphElement[0].clientWidth;
|
1313
|
+
const graphHeight = $graphElement[0].clientHeight;
|
1314
|
+
const originX = graphWidth / 2;
|
1315
|
+
const originY = graphHeight / 2;
|
1316
|
+
const y1Pixel = originY - y1 * (graphHeight / range);
|
1317
|
+
const y2Pixel = originY - y2 * (graphHeight / range);
|
1318
|
+
cy.get('[class*="question-preview-wrapper"] .ngie-jxgbox').eq(0).find(`[stroke-linecap="butt"][x1*="${Math.floor(originX)}"][y1*="${Math.floor(y1Pixel)}"][x2*="${Math.floor(originX)}"][y2*="${Math.floor(y2Pixel)}"]`)
|
1319
|
+
.should('have.css', 'stroke', css.color.correctAnswer);
|
1320
|
+
});
|
1321
|
+
});
|
1322
|
+
},
|
1323
|
+
|
1324
|
+
/**
|
1325
|
+
* Verifies the incorrect line segment on the vertical number line in the preview tab.
|
1326
|
+
* @param {number} range - The range of the number line.
|
1327
|
+
* @param {Object[]} coordinates - The coordinates of the line segment.
|
1328
|
+
* @param {number} coordinates[].y1 - The y-coordinate of the starting point.
|
1329
|
+
* @param {number} coordinates[].y2 - The y-coordinate of the ending point.
|
1330
|
+
*/
|
1331
|
+
verifyIncorrectLineSegmentOnVerticalNumberLinePreviewTab: (range, coordinates) => {
|
1332
|
+
coordinates.forEach(({ y1, y2 }) => {
|
1333
|
+
numberLinePage.numberLinePreviewTab()
|
1334
|
+
.then(($graphElement) => {
|
1335
|
+
const graphWidth = $graphElement[0].clientWidth;
|
1336
|
+
const graphHeight = $graphElement[0].clientHeight;
|
1337
|
+
const originX = graphWidth / 2;
|
1338
|
+
const originY = graphHeight / 2;
|
1339
|
+
const y1Pixel = originY - y1 * (graphHeight / range);
|
1340
|
+
const y2Pixel = originY - y2 * (graphHeight / range);
|
1341
|
+
cy.get('[class*="question-preview-wrapper"] .ngie-jxgbox').eq(0).find(`[stroke-linecap="butt"][x1*="${Math.floor(originX)}"][y1*="${Math.floor(y1Pixel)}"][x2*="${Math.floor(originX)}"][y2*="${Math.floor(y2Pixel)}"]`)
|
1342
|
+
.should('have.css', 'stroke', css.color.incorrectAnswer);
|
1343
|
+
});
|
1344
|
+
});
|
1345
|
+
},
|
1346
|
+
|
1347
|
+
/**
|
1348
|
+
* Verifies that the line segment on the vertical number line does not exist in the preview tab.
|
1349
|
+
* @param {number} range - The range of the number line.
|
1350
|
+
* @param {Object[]} coordinates - The coordinates of the line segment.
|
1351
|
+
* @param {number} coordinates[].y1 - The y-coordinate of the starting point.
|
1352
|
+
* @param {number} coordinates[].y2 - The y-coordinate of the ending point.
|
1353
|
+
*/
|
1354
|
+
verifyLineSegmentOnVerticalNumberLineNotExistPreviewTab: (range, coordinates) => {
|
1355
|
+
coordinates.forEach(({ y1, y2 }) => {
|
1356
|
+
numberLinePage.numberLinePreviewTab()
|
1357
|
+
.then(($graphElement) => {
|
1358
|
+
const graphWidth = $graphElement[0].clientWidth;
|
1359
|
+
const graphHeight = $graphElement[0].clientHeight;
|
1360
|
+
const originX = graphWidth / 2;
|
1361
|
+
const originY = graphHeight / 2;
|
1362
|
+
const y1Pixel = originY - y1 * (graphHeight / range);
|
1363
|
+
const y2Pixel = originY - y2 * (graphHeight / range);
|
1364
|
+
cy.get('[class*="question-preview-wrapper"] .ngie-jxgbox').eq(0).find(`[stroke-linecap="butt"][x1*="${Math.floor(originX)}"][y1*="${Math.floor(y1Pixel)}"][x2*="${Math.floor(originX)}"][y2*="${Math.floor(y2Pixel)}"]`)
|
1365
|
+
.should('not.exist');
|
1366
|
+
});
|
1367
|
+
});
|
1368
|
+
},
|
1369
|
+
|
1370
|
+
/**
|
1371
|
+
* Verifies that the line segment on the vertical number line exists in the correct answer section.
|
1372
|
+
* @param {number} range - The range of the number line.
|
1373
|
+
* @param {Object[]} coordinates - The coordinates of the line segment.
|
1374
|
+
* @param {number} coordinates[].y1 - The y-coordinate of the starting point.
|
1375
|
+
* @param {number} coordinates[].y2 - The y-coordinate of the ending point.
|
1376
|
+
*/
|
1377
|
+
verifyLineSegmentOnVerticalNumberLineCorrectAnswerSection: (range, coordinates) => {
|
1378
|
+
coordinates.forEach(({ y1, y2 }) => {
|
1379
|
+
numberLinePage.numberLineCorrectAnswerSection()
|
1380
|
+
.then(($graphElement) => {
|
1381
|
+
const graphWidth = $graphElement[0].clientWidth;
|
1382
|
+
const graphHeight = $graphElement[0].clientHeight;
|
1383
|
+
const originX = graphWidth / 2;
|
1384
|
+
const originY = graphHeight / 2;
|
1385
|
+
const y1Pixel = originY - y1 * (graphHeight / range);
|
1386
|
+
const y2Pixel = originY - y2 * (graphHeight / range);
|
1387
|
+
cy.get('[class*="question-preview-wrapper"] .ngie-jxgbox').eq(1).find(`[stroke-linecap="butt"][x1*="${Math.floor(originX)}"][y1*="${Math.floor(y1Pixel)}"][x2*="${Math.floor(originX)}"][y2*="${Math.floor(y2Pixel)}"]`)
|
1388
|
+
.should('be.visible');
|
1389
|
+
});
|
1390
|
+
});
|
1391
|
+
},
|
1392
|
+
|
1393
|
+
/**
|
1394
|
+
* Verifies that the line segment on the vertical number line in the correct answer section has the correct appearance.
|
1395
|
+
* @param {number} range - The range of the number line.
|
1396
|
+
* @param {Object[]} coordinates - The coordinates of the line segment.
|
1397
|
+
* @param {number} coordinates[].y1 - The y-coordinate of the starting point.
|
1398
|
+
* @param {number} coordinates[].y2 - The y-coordinate of the ending point.
|
1399
|
+
*/
|
1400
|
+
verifyCorrectLineSegmentOnVerticalNumberLineCorrectAnswerSection: (range, coordinates) => {
|
1401
|
+
coordinates.forEach(({ y1, y2 }) => {
|
1402
|
+
numberLinePage.numberLineCorrectAnswerSection()
|
1403
|
+
.then(($graphElement) => {
|
1404
|
+
const graphWidth = $graphElement[0].clientWidth;
|
1405
|
+
const graphHeight = $graphElement[0].clientHeight;
|
1406
|
+
const originX = graphWidth / 2;
|
1407
|
+
const originY = graphHeight / 2;
|
1408
|
+
const y1Pixel = originY - y1 * (graphHeight / range);
|
1409
|
+
const y2Pixel = originY - y2 * (graphHeight / range);
|
1410
|
+
cy.get('[class*="question-preview-wrapper"] .ngie-jxgbox').eq(1).find(`[stroke-linecap="butt"][x1*="${Math.floor(originX)}"][y1*="${Math.floor(y1Pixel)}"][x2*="${Math.floor(originX)}"][y2*="${Math.floor(y2Pixel)}"]`)
|
1411
|
+
.should('have.css', 'stroke', css.color.correctAnswer);
|
1412
|
+
});
|
1413
|
+
});
|
1414
|
+
},
|
1415
|
+
|
1416
|
+
/**
|
1417
|
+
* Verifies that the line segment on the vertical number line does not exist in the correct answer section.
|
1418
|
+
* @param {number} range - The range of the number line.
|
1419
|
+
* @param {Object[]} coordinates - The coordinates of the line segment.
|
1420
|
+
* @param {number} coordinates[].y1 - The y-coordinate of the starting point.
|
1421
|
+
* @param {number} coordinates[].y2 - The y-coordinate of the ending point.
|
1422
|
+
*/
|
1423
|
+
verifyLineSegmentOnVerticalNumberLineNotExistCorrectAnswerSection: (range, coordinates) => {
|
1424
|
+
coordinates.forEach(({ y1, y2 }) => {
|
1425
|
+
numberLinePage.numberLineCorrectAnswerSection()
|
1426
|
+
.then(($graphElement) => {
|
1427
|
+
const graphWidth = $graphElement[0].clientWidth;
|
1428
|
+
const graphHeight = $graphElement[0].clientHeight;
|
1429
|
+
const originX = graphWidth / 2;
|
1430
|
+
const originY = graphHeight / 2;
|
1431
|
+
const y1Pixel = originY - y1 * (graphHeight / range);
|
1432
|
+
const y2Pixel = originY - y2 * (graphHeight / range);
|
1433
|
+
cy.get('[class*="question-preview-wrapper"] .ngie-jxgbox').eq(1).find(`svg [stroke-linecap="butt"][x1*="${Math.floor(originX)}"][y1*="${Math.floor(y1Pixel)}"][x2*="${Math.floor(originX)}"][y2*="${Math.floor(y2Pixel)}"]`)
|
1434
|
+
.should('not.exist');
|
1435
|
+
});
|
1436
|
+
});
|
1437
|
+
},
|
1438
|
+
|
1439
|
+
/**
|
1440
|
+
* Verifies the ray on the vertical number line in the specify correct answer section.
|
1441
|
+
* @param {string} direction - The direction of the ray ('left' or 'right').
|
1442
|
+
* @param {number} range - The range of the number line.
|
1443
|
+
* @param {number} startingPoint - The starting point of the ray.
|
1444
|
+
*/
|
1445
|
+
verifyRayOnVerticalNumberLineSpecifyCorrectAnswer: (direction, range, startingPoint) => {
|
1446
|
+
numberLinePage.numberLineSpecifyCorrectAnswer().then(($graphElement) => {
|
1447
|
+
const graphWidth = $graphElement[0].clientWidth;
|
1448
|
+
const graphHeight = $graphElement[0].clientHeight;
|
1449
|
+
const originX = graphWidth / 2;
|
1450
|
+
const originY = graphHeight / 2;
|
1451
|
+
const y1Pixel = originY - startingPoint * (graphHeight / range);
|
1452
|
+
const rayArrowHeight = 42;
|
1453
|
+
const y2Pixel = direction === 'up' ? rayArrowHeight : graphHeight - rayArrowHeight;
|
1454
|
+
cy.get(`.ngie-accordion .ngie-jxgbox svg [stroke-linecap="butt"][x1*="${Math.floor(originX)}"][y1*="${Math.floor(y1Pixel)}"][x2*="${Math.floor(originX)}"][y2*="${Math.floor(y2Pixel)}"]`)
|
1455
|
+
.should('be.visible');
|
1456
|
+
});
|
1457
|
+
},
|
1458
|
+
|
1459
|
+
/**
|
1460
|
+
* Verifies the ray on the vertical number line preview tab.
|
1461
|
+
* @param {string} direction - The direction of the ray ('up' or 'down').
|
1462
|
+
* @param {number} range - The range of the number line.
|
1463
|
+
* @param {number} startingPoint - The starting point of the ray.
|
1464
|
+
*/
|
1465
|
+
verifyRayOnVerticalNumberLinePreviewTab: (direction, range, startingPoint) => {
|
1466
|
+
numberLinePage.numberLinePreviewTab().then(($graphElement) => {
|
1467
|
+
const graphWidth = $graphElement[0].clientWidth;
|
1468
|
+
const graphHeight = $graphElement[0].clientHeight;
|
1469
|
+
const originX = graphWidth / 2;
|
1470
|
+
const originY = graphHeight / 2;
|
1471
|
+
const y1Pixel = originY - startingPoint * (graphHeight / range);
|
1472
|
+
const rayArrowHeight = 42;
|
1473
|
+
const y2Pixel = direction === 'up' ? rayArrowHeight : graphHeight - rayArrowHeight;
|
1474
|
+
cy.get('[class*="question-preview-wrapper"] .ngie-jxgbox').eq(0).find(`[stroke-linecap="butt"][x1*="${Math.floor(originX)}"][y1*="${Math.floor(y1Pixel)}"][x2*="${Math.floor(originX)}"][y2*="${Math.floor(y2Pixel)}"]`)
|
1475
|
+
.should('be.visible');
|
1476
|
+
});
|
1477
|
+
},
|
1478
|
+
|
1479
|
+
/**
|
1480
|
+
* Verifies the correct ray on the vertical number line preview tab.
|
1481
|
+
* @param {string} direction - The direction of the ray ('up' or 'down').
|
1482
|
+
* @param {number} range - The range of the number line.
|
1483
|
+
* @param {number} startingPoint - The starting point of the ray.
|
1484
|
+
*/
|
1485
|
+
verifyCorrectRayOnVerticalNumberLinePreviewTab: (direction, range, startingPoint) => {
|
1486
|
+
numberLinePage.numberLinePreviewTab()
|
1487
|
+
.then(($graphElement) => {
|
1488
|
+
const graphWidth = $graphElement[0].clientWidth;
|
1489
|
+
const graphHeight = $graphElement[0].clientHeight;
|
1490
|
+
const originX = graphWidth / 2;
|
1491
|
+
const originY = graphHeight / 2;
|
1492
|
+
const y1Pixel = originY - startingPoint * (graphHeight / range);
|
1493
|
+
const rayArrowHeight = 42;
|
1494
|
+
const y2Pixel = direction === "up" ? rayArrowHeight : graphHeight - rayArrowHeight;
|
1495
|
+
cy.get('[class*="question-preview-wrapper"] .ngie-jxgbox').eq(0).find(`[stroke-linecap="butt"][x1*="${Math.floor(originX)}"][y1*="${Math.floor(y1Pixel)}"][x2*="${Math.floor(originX)}"][y2*="${Math.floor(y2Pixel)}"]`)
|
1496
|
+
.should('have.css', 'stroke', css.color.correctAnswer);
|
1497
|
+
});
|
1498
|
+
},
|
1499
|
+
|
1500
|
+
/**
|
1501
|
+
* Verifies the incorrect ray on the vertical number line preview tab.
|
1502
|
+
* @param {string} direction - The direction of the ray ('up' or 'down').
|
1503
|
+
* @param {number} range - The range of the number line.
|
1504
|
+
* @param {number} startingPoint - The starting point of the ray.
|
1505
|
+
*/
|
1506
|
+
verifyIncorrectRayOnVerticalNumberLinePreviewTab: (direction, range, startingPoint) => {
|
1507
|
+
numberLinePage.numberLinePreviewTab().then(($graphElement) => {
|
1508
|
+
const graphWidth = $graphElement[0].clientWidth;
|
1509
|
+
const graphHeight = $graphElement[0].clientHeight;
|
1510
|
+
const originX = graphWidth / 2;
|
1511
|
+
const originY = graphHeight / 2;
|
1512
|
+
const y1Pixel = originY - startingPoint * (graphHeight / range);
|
1513
|
+
const rayArrowHeight = 42;
|
1514
|
+
const y2Pixel = direction === "up" ? rayArrowHeight : graphHeight - rayArrowHeight;
|
1515
|
+
cy.get('[class*="question-preview-wrapper"] .ngie-jxgbox').eq(0).find(`[stroke-linecap="butt"][x1*="${Math.floor(originX)}"][y1*="${Math.floor(y1Pixel)}"][x2*="${Math.floor(originX)}"][y2*="${Math.floor(y2Pixel)}"]`)
|
1516
|
+
.should('have.css', 'stroke', css.color.incorrectAnswer);
|
1517
|
+
});
|
1518
|
+
},
|
1519
|
+
|
1520
|
+
/**
|
1521
|
+
* Verifies the ray on the vertical number line does not exist on the preview tab.
|
1522
|
+
* @param {string} direction - The direction of the ray ('up' or 'down').
|
1523
|
+
* @param {number} range - The range of the number line.
|
1524
|
+
* @param {number} startingPoint - The starting point of the ray.
|
1525
|
+
*/
|
1526
|
+
verifyRayOnVerticalNumberLineNotExistPreviewTab: (direction, range, startingPoint) => {
|
1527
|
+
numberLinePage.numberLinePreviewTab().then(($graphElement) => {
|
1528
|
+
const graphWidth = $graphElement[0].clientWidth;
|
1529
|
+
const graphHeight = $graphElement[0].clientHeight;
|
1530
|
+
const originX = graphWidth / 2;
|
1531
|
+
const originY = graphHeight / 2;
|
1532
|
+
const y1Pixel = originY - startingPoint * (graphHeight / range);
|
1533
|
+
const rayArrowHeight = 42;
|
1534
|
+
const y2Pixel = direction === "up" ? rayArrowHeight : graphHeight - rayArrowHeight;
|
1535
|
+
cy.get('[class*="question-preview-wrapper"] .ngie-jxgbox').eq(0).find(`[stroke-linecap="butt"][x1*="${Math.floor(originX)}"][y1*="${Math.floor(y1Pixel)}"][x2*="${Math.floor(originX)}"][y2*="${Math.floor(y2Pixel)}"]`)
|
1536
|
+
.should('not.exist');
|
1537
|
+
});
|
1538
|
+
},
|
1539
|
+
|
1540
|
+
/**
|
1541
|
+
* Verifies the ray on the vertical number line in the correct answer section.
|
1542
|
+
* @param {string} direction - The direction of the ray ('up' or 'down').
|
1543
|
+
* @param {number} range - The range of the number line.
|
1544
|
+
* @param {number} startingPoint - The starting point of the ray.
|
1545
|
+
*/
|
1546
|
+
verifyRayOnVerticalNumberLineCorrectAnswerSection: (direction, range, startingPoint) => {
|
1547
|
+
numberLinePage.numberLineCorrectAnswerSection().then(($graphElement) => {
|
1548
|
+
const graphWidth = $graphElement[0].clientWidth;
|
1549
|
+
const graphHeight = $graphElement[0].clientHeight;
|
1550
|
+
const originX = graphWidth / 2;
|
1551
|
+
const originY = graphHeight / 2;
|
1552
|
+
const y1Pixel = originY - startingPoint * (graphHeight / range);
|
1553
|
+
const rayArrowHeight = 42;
|
1554
|
+
const y2Pixel = direction === "up" ? rayArrowHeight : graphHeight - rayArrowHeight;
|
1555
|
+
cy.get('[class*="question-preview-wrapper"] .ngie-jxgbox').eq(1).find(`[stroke-linecap="butt"][x1*="${Math.floor(originX)}"][y1*="${Math.floor(y1Pixel)}"][x2*="${Math.floor(originX)}"][y2*="${Math.floor(y2Pixel)}"]`)
|
1556
|
+
.should('be.visible');
|
1557
|
+
});
|
1558
|
+
},
|
1559
|
+
|
1560
|
+
/**
|
1561
|
+
* Verifies the correct ray on the vertical number line in the correct answer section.
|
1562
|
+
* @param {string} direction - The direction of the ray ('up' or 'down').
|
1563
|
+
* @param {number} range - The range of the number line.
|
1564
|
+
* @param {number} startingPoint - The starting point of the ray.
|
1565
|
+
*/
|
1566
|
+
verifyCorrectRayOnVerticalNumberLineCorrectAnswerSection: (direction, range, startingPoint) => {
|
1567
|
+
numberLinePage.numberLineCorrectAnswerSection().then(($graphElement) => {
|
1568
|
+
const graphWidth = $graphElement[0].clientWidth;
|
1569
|
+
const graphHeight = $graphElement[0].clientHeight;
|
1570
|
+
const originX = graphWidth / 2;
|
1571
|
+
const originY = graphHeight / 2;
|
1572
|
+
const y1Pixel = originY - startingPoint * (graphHeight / range);
|
1573
|
+
const rayArrowHeight = 42;
|
1574
|
+
const y2Pixel = direction === "up" ? rayArrowHeight : graphHeight - rayArrowHeight;
|
1575
|
+
cy.get('[class*="question-preview-wrapper"] .ngie-jxgbox').eq(1).find(`[stroke-linecap="butt"][x1*="${Math.floor(originX)}"][y1*="${Math.floor(y1Pixel)}"][x2*="${Math.floor(originX)}"][y2*="${Math.floor(y2Pixel)}"]`)
|
1576
|
+
.should('have.css', 'stroke', css.color.correctAnswer);
|
1577
|
+
});
|
1578
|
+
},
|
1579
|
+
|
1580
|
+
/**
|
1581
|
+
* Verifies that the ray does not exist on the vertical number line in the correct answer section.
|
1582
|
+
* @param {string} direction - The direction of the ray ('up' or 'down').
|
1583
|
+
* @param {number} range - The range of the number line.
|
1584
|
+
* @param {number} startingPoint - The starting point of the ray.
|
1585
|
+
*/
|
1586
|
+
verifyRayOnVerticalNumberLineNotExistCorrectAnswerSection: (direction, range, startingPoint) => {
|
1587
|
+
numberLinePage.numberLineCorrectAnswerSection().then(($graphElement) => {
|
1588
|
+
const graphWidth = $graphElement[0].clientWidth;
|
1589
|
+
const graphHeight = $graphElement[0].clientHeight;
|
1590
|
+
const originX = graphWidth / 2;
|
1591
|
+
const originY = graphHeight / 2;
|
1592
|
+
const y1Pixel = originY - startingPoint * (graphHeight / range);
|
1593
|
+
const rayArrowHeight = 42;
|
1594
|
+
const y2Pixel = direction === "up" ? rayArrowHeight : graphHeight - rayArrowHeight;
|
1595
|
+
cy.get('[class*="question-preview-wrapper"] .ngie-jxgbox').eq(1).find(`svg [stroke-linecap="butt"][x1*="${Math.floor(originX)}"][y1*="${Math.floor(y1Pixel)}"][x2*="${Math.floor(originX)}"][y2*="${Math.floor(y2Pixel)}"]`)
|
1596
|
+
.should('not.exist');
|
1597
|
+
});
|
1598
|
+
},
|
1599
|
+
}
|
1600
|
+
|
1601
|
+
|
1602
|
+
const tests = {
|
1603
|
+
...resetPopupComponent.tests,
|
1604
|
+
...toolSettingsComponent.tests,
|
1605
|
+
...additionalSettingsAccessibilitySectionComponent.tests,
|
1606
|
+
...additionalSettingsPanel.tests,
|
1607
|
+
...studentViewSettingsLabelComponent.tests,
|
1608
|
+
...autoScoredStudentViewSettings.tests,
|
1609
|
+
...autoScoredSpecifyCorrectAnswerSection.tests,
|
1610
|
+
...createQuestionBasePage.tests,
|
1611
|
+
...commonComponents.tests,
|
1612
|
+
...autoScoredScoringPreviewTab.tests,
|
1613
|
+
...defaultToolDropdown.tests,
|
1614
|
+
...scoringSectionBaseEditTab.tests,
|
1615
|
+
...autoScoredScoringSectionMultiResponseType.tests,
|
1616
|
+
...layoutSectionComponent.tests,
|
1617
|
+
|
1618
|
+
verifyContentsOfSpecifyCorrectAnswerSection: () => {
|
1619
|
+
it('When user selects a scoring type then in the \'Correct\' accordion, all the contents should be displayed', () => {
|
1620
|
+
utilities.verifyElementVisibilityState(numberLinePage.numberLineSpecifyCorrectAnswer(), 'visible');
|
1621
|
+
utilities.verifyElementVisibilityState(numberLinePage.numberLineToolOptionSpecifyCorrectAnswer(), 'visible');
|
1622
|
+
utilities.verifyElementVisibilityState(numberLinePage.numberLineControlOptionSpecifyCorrectAnswer(), 'visible');
|
1623
|
+
utilities.verifyElementVisibilityState(numberLinePage.numberLineTitleSpecifyCorrectAnswerSection(), 'exist');
|
1624
|
+
});
|
1625
|
+
},
|
1626
|
+
|
1627
|
+
/**
|
1628
|
+
* Verifies the contents and functionality of the 'Specify correct answer' accordion for multiple selection questions.
|
1629
|
+
* @param {{'Correct' | 'Alternative'}} accordionName - The name of the accordion to be used in the validation.
|
1630
|
+
* @example - verifySpecifyCorrectAnswerAccordionContentsAndFunctionality('Correct');
|
1631
|
+
*/
|
1632
|
+
verifySpecifyCorrectAnswerAccordionContentsAndFunctionality: (accordionName) => {
|
1633
|
+
it(`The user should be able to plot points on number line in the specify correct answer section ${accordionName} accordion`, () => {
|
1634
|
+
numberLinePage.steps.plotPointOnNumberLineSpecifyCorrectAnswer("horizontal", range, 0);
|
1635
|
+
numberLinePage.steps.plotPointOnNumberLineSpecifyCorrectAnswer("horizontal", range, 1);
|
1636
|
+
numberLinePage.steps.verifyPointsPlottedOnNumberLineSpecifyCorrectAnswer(range, [0, 1]);
|
1637
|
+
});
|
1638
|
+
|
1639
|
+
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`, () => {
|
1640
|
+
numberLinePage.steps.selectNumberLineControlOptionSpecifyCorrectAnswerSection('Reset');
|
1641
|
+
numberLinePage.steps.confirmReset();
|
1642
|
+
utilities.verifyElementVisibilityState(commonComponents.errorMessage(), 'visible');
|
1643
|
+
utilities.verifyInnerText(commonComponents.errorMessage(), 'Error: Please set a correct answer.');
|
1644
|
+
if (accordionName == 'Correct') {
|
1645
|
+
autoScoredSpecifyCorrectAnswerSection.correctAnswerAccordion()
|
1646
|
+
.within(() => {
|
1647
|
+
utilities.verifyElementVisibilityState(autoScoredSpecifyCorrectAnswerSection.specifyCorrectAnswerErrorIcon(), 'visible');
|
1648
|
+
});
|
1649
|
+
} else {
|
1650
|
+
autoScoredSpecifyCorrectAnswerSection.alternativeAnswerAccordion()
|
1651
|
+
.within(() => {
|
1652
|
+
utilities.verifyElementVisibilityState(autoScoredSpecifyCorrectAnswerSection.specifyCorrectAnswerErrorIcon(), 'visible');
|
1653
|
+
});
|
1654
|
+
};
|
1655
|
+
});
|
1656
|
+
|
1657
|
+
autoScoredSpecifyCorrectAnswerSection.tests.verifyAutoScoredCorrectAnswerErrorMessageCSSAndA11y();
|
1658
|
+
|
1659
|
+
it('When the user plots on the number line then the error message should disappear', () => {
|
1660
|
+
numberLinePage.steps.plotPointOnNumberLineSpecifyCorrectAnswer("horizontal", range, 0);
|
1661
|
+
numberLinePage.steps.plotPointOnNumberLineSpecifyCorrectAnswer("horizontal", range, 1);
|
1662
|
+
numberLinePage.steps.verifyPointsPlottedOnNumberLineSpecifyCorrectAnswer(range, [0, 1]);
|
1663
|
+
});
|
1664
|
+
|
1665
|
+
autoScoredSpecifyCorrectAnswerSection.tests.verifyAutoScoredPointsErrorMessageWhenPointsFieldIsEmpty(accordionName);
|
1666
|
+
|
1667
|
+
it('Accessibility of \'Correct\' accordion contents', { tags: 'a11y' }, () => {
|
1668
|
+
cy.checkAccessibility(numberLinePage.numberLineSpecifyCorrectAnswer());
|
1669
|
+
});
|
1670
|
+
},
|
1671
|
+
|
1672
|
+
/**
|
1673
|
+
* Verifies the functionality of the layout section in the edit tab.
|
1674
|
+
* @param {string} orientation - The orientation of the number line ('Horizontal' or 'Vertical').
|
1675
|
+
*/
|
1676
|
+
verifyLayoutSectionEditTabFunctionality: (orientation) => {
|
1677
|
+
it(`When user selects ${orientation} orientation, then number line in Number line section and Specify correct answer section should be updated to ${orientation} number line`, () => {
|
1678
|
+
numberLinePage.steps.selectOrientationToggleButton(orientation);
|
1679
|
+
numberLinePage.steps.verifyNumberLineOrientationAndSizeNumberLineSection(orientation, '640');
|
1680
|
+
numberLinePage.steps.verifyNumberLineOrientationAndSizeSpecifyCorrectAnswerSection(orientation, '640');
|
1681
|
+
});
|
1682
|
+
|
1683
|
+
if (orientation === "Horizontal") {
|
1684
|
+
it('When user updates value for Width input field, it should get updated in Number line section and Specify correct answer section', () => {
|
1685
|
+
numberLinePage.steps.enterTextInWidthInputField(600);
|
1686
|
+
numberLinePage.steps.verifyTextInWidthInputField(600);
|
1687
|
+
numberLinePage.steps.verifyNumberLineOrientationAndSizeNumberLineSection(orientation, '600');
|
1688
|
+
numberLinePage.steps.verifyNumberLineOrientationAndSizeSpecifyCorrectAnswerSection(orientation, '600');
|
1689
|
+
});
|
1690
|
+
} else {
|
1691
|
+
it('When user updates value for Height input field, it should get updated in Number line section and Specify correct answer section', () => {
|
1692
|
+
numberLinePage.steps.enterTextInHeightInputField(600);
|
1693
|
+
numberLinePage.steps.verifyTextInHeightInputField(600);
|
1694
|
+
numberLinePage.steps.verifyNumberLineOrientationAndSizeNumberLineSection(orientation, '600');
|
1695
|
+
numberLinePage.steps.verifyNumberLineOrientationAndSizeSpecifyCorrectAnswerSection(orientation, '600');
|
1696
|
+
});
|
1697
|
+
}
|
1698
|
+
|
1699
|
+
it('When user updates value for Margin input field, it should get updated in Specify correct answer section', () => {
|
1700
|
+
numberLinePage.steps.enterTextInMarginInputField(12);
|
1701
|
+
numberLinePage.steps.verifyTextInMarginInputField(12);
|
1702
|
+
numberLinePage.steps.verifyMarginForNumberLineSpecifyCorrectAnswerSection(12);
|
1703
|
+
});
|
1704
|
+
|
1705
|
+
it('When user updates value for Response spacing input field, it should get updated in Number line section and Specify correct answer section', () => {
|
1706
|
+
numberLinePage.steps.enterTextInResponseSpacingInputField(28);
|
1707
|
+
numberLinePage.steps.verifyTextInResponseSpacingInputField(28);
|
1708
|
+
numberLinePage.steps.verifyResponseSpacingSpecifyCorrectAnswerSection(orientation, 28);
|
1709
|
+
});
|
1710
|
+
|
1711
|
+
it('When user checks Show min arrow checkbox, then arrow should be displayed on left end of number line and arrow should not be displayed on right end of number line in number line section and specify correct answer section', () => {
|
1712
|
+
numberLinePage.steps.checkCheckbox('Show min arrow');
|
1713
|
+
numberLinePage.steps.verifyMinArrowVisibilitySpecifyCorrectAnswerSection('visible');
|
1714
|
+
numberLinePage.steps.verifyMinArrowVisibilityNumberLineSection('visible');
|
1715
|
+
});
|
1716
|
+
|
1717
|
+
it('When user unchecks Show min arrow checkbox, then arrow should not be displayed on left end of number line in number line section and specify correct answer section', () => {
|
1718
|
+
numberLinePage.steps.uncheckCheckbox('Show min arrow');
|
1719
|
+
numberLinePage.steps.verifyMinArrowVisibilitySpecifyCorrectAnswerSection('hidden');
|
1720
|
+
numberLinePage.steps.verifyMinArrowVisibilityNumberLineSection('hidden');
|
1721
|
+
});
|
1722
|
+
|
1723
|
+
it('When user checks Show max arrow checkbox, then arrow should be displayed on right end of number line and arrow should not be displayed on left end of number line in number line section and specify correct answer section', () => {
|
1724
|
+
numberLinePage.steps.checkCheckbox('Show max arrow');
|
1725
|
+
numberLinePage.steps.verifyMaxArrowVisibilitySpecifyCorrectAnswerSection('visible');
|
1726
|
+
numberLinePage.steps.verifyMaxArrowVisibilityNumberLineSection('visible');
|
1727
|
+
});
|
1728
|
+
|
1729
|
+
it('When user unchecks Show max arrow checkbox, then arrow should not be displayed on right end of number line in number line section and specify correct answer section', () => {
|
1730
|
+
numberLinePage.steps.uncheckCheckbox('Show max arrow');
|
1731
|
+
numberLinePage.steps.verifyMaxArrowVisibilitySpecifyCorrectAnswerSection('hidden');
|
1732
|
+
numberLinePage.steps.verifyMaxArrowVisibilityNumberLineSection('hidden');
|
1733
|
+
});
|
1734
|
+
|
1735
|
+
//Note: Only for Label number line
|
1736
|
+
it('When user unchecks Stagger response checkbox', () => {
|
1737
|
+
numberLinePage.steps.uncheckCheckbox('Stagger response');
|
1738
|
+
});
|
1739
|
+
|
1740
|
+
//Note: Only for Label number line
|
1741
|
+
it('When user uncheck Stagger response checkbox', () => {
|
1742
|
+
numberLinePage.steps.checkCheckbox('Stagger response');
|
1743
|
+
});
|
1744
|
+
|
1745
|
+
it('When user unchecks Show labels checkbox, then labels on number line should disappear in number line section and specify correct answer section', () => {
|
1746
|
+
numberLinePage.steps.uncheckCheckbox('Show labels');
|
1747
|
+
numberLinePage.steps.verifyLabelsNotVisibleOnNumberLineNumberLineSection();
|
1748
|
+
numberLinePage.steps.verifyLabelsNotVisibleOnNumberLineSpecifyCorrectAnswerSection();
|
1749
|
+
});
|
1750
|
+
|
1751
|
+
it('When Show labels checkbox is unchecked, then Line settings and Display numbers section should be in disabled state', () => {
|
1752
|
+
numberLinePage.steps.verifyDisplayNumbersAndLineSettingsSectionDisabled();
|
1753
|
+
});
|
1754
|
+
|
1755
|
+
it('When user checks Show labels checkbox, then labels on number line should be displayed in number line section and specify correct answer section', () => {
|
1756
|
+
numberLinePage.steps.checkCheckbox('Show labels');
|
1757
|
+
numberLinePage.steps.verifyLabelsVisibleOnNumberLineNumberLineSection(-10, 1);
|
1758
|
+
numberLinePage.steps.verifyLabelsVisibleOnNumberLineSpecifyCorrectAnswerSection(-10, 1);
|
1759
|
+
});
|
1760
|
+
|
1761
|
+
it('When Show labels checkbox is checked, then Line settings and Display numbers section should be in enabled state', () => {
|
1762
|
+
numberLinePage.steps.verifyDisplayNumbersAndLineSettingsSectionEnabled();
|
1763
|
+
});
|
1764
|
+
|
1765
|
+
//Note: Unable to check on cypress, added to manual sheet
|
1766
|
+
it('When user unchecks Show ticks checkbox, then ticks on number line should disappear in number line section and specify correct answer section', () => {
|
1767
|
+
|
1768
|
+
});
|
1769
|
+
|
1770
|
+
//Note: Unable to check on cypress, added to manual sheet
|
1771
|
+
it('When user checks Show ticks checkbox, then ticks on number line should be displayed in number line section and specify correct answer section', () => {
|
1772
|
+
|
1773
|
+
});
|
1774
|
+
},
|
1775
|
+
|
1776
|
+
/**
|
1777
|
+
* Verifies the functionality of the layout section in the preview tab.
|
1778
|
+
* @param {string} orientation - The orientation of the number line ('Horizontal' or 'Vertical').
|
1779
|
+
*/
|
1780
|
+
verifyLayoutSectionPreviewTabFunctionality: (orientation) => {
|
1781
|
+
it(`When user selects ${orientation} orientation, then ${orientation} number line should be displayed in preview tab`, () => {
|
1782
|
+
numberLinePage.steps.switchToEditTab();
|
1783
|
+
numberLinePage.steps.selectOrientationToggleButton(orientation);
|
1784
|
+
numberLinePage.steps.switchToPreviewTab();
|
1785
|
+
numberLinePage.steps.verifyNumberLineOrientationAndSizePreviewTab(orientation, '640');
|
1786
|
+
});
|
1787
|
+
|
1788
|
+
if (orientation === "Horizontal") {
|
1789
|
+
it('When user updates value for Width input field, it should get updated in preview tab', () => {
|
1790
|
+
numberLinePage.steps.switchToEditTab();
|
1791
|
+
numberLinePage.steps.enterTextInWidthInputField(600);
|
1792
|
+
numberLinePage.steps.verifyTextInWidthInputField(600);
|
1793
|
+
numberLinePage.steps.switchToPreviewTab();
|
1794
|
+
numberLinePage.steps.verifyNumberLineOrientationAndSizePreviewTab(orientation, '600');
|
1795
|
+
});
|
1796
|
+
} else {
|
1797
|
+
it('When user updates value for Height input field, it should get updated in preview tab', () => {
|
1798
|
+
numberLinePage.steps.switchToEditTab();
|
1799
|
+
numberLinePage.steps.enterTextInHeightInputField(600);
|
1800
|
+
numberLinePage.steps.verifyTextInHeightInputField(600);
|
1801
|
+
numberLinePage.steps.switchToPreviewTab();
|
1802
|
+
numberLinePage.steps.verifyNumberLineOrientationAndSizePreviewTab(orientation, '600');
|
1803
|
+
});
|
1804
|
+
}
|
1805
|
+
|
1806
|
+
it('When user updates value for Margin input field, it should get updated in preview tab', () => {
|
1807
|
+
numberLinePage.steps.switchToEditTab();
|
1808
|
+
numberLinePage.steps.enterTextInMarginInputField(12);
|
1809
|
+
numberLinePage.steps.verifyTextInMarginInputField(12);
|
1810
|
+
numberLinePage.steps.switchToPreviewTab();
|
1811
|
+
numberLinePage.steps.verifyMarginForNumberLinePreviewTab(12);
|
1812
|
+
});
|
1813
|
+
|
1814
|
+
it('When user updates value for Response spacing input field, it should get updated in preview tab', () => {
|
1815
|
+
numberLinePage.steps.switchToEditTab();
|
1816
|
+
numberLinePage.steps.enterTextInResponseSpacingInputField(28);
|
1817
|
+
numberLinePage.steps.verifyTextInResponseSpacingInputField(28);
|
1818
|
+
numberLinePage.steps.switchToPreviewTab();
|
1819
|
+
numberLinePage.steps.verifyResponseSpacingPreviewTab(orientation, 28);
|
1820
|
+
});
|
1821
|
+
|
1822
|
+
it('When user checks Show min arrow checkbox, then arrow should be displayed on left end of number line and arrow should not be displayed on right end of number line in preview tab', () => {
|
1823
|
+
numberLinePage.steps.switchToEditTab();
|
1824
|
+
numberLinePage.steps.checkCheckbox('Show min arrow');
|
1825
|
+
numberLinePage.steps.switchToPreviewTab();
|
1826
|
+
numberLinePage.steps.verifyMinArrowVisibilityPreviewTab('visible');
|
1827
|
+
});
|
1828
|
+
|
1829
|
+
it('When user unchecks Show min arrow checkbox, then arrow should not be displayed on left end of number line in preview tab', () => {
|
1830
|
+
numberLinePage.steps.switchToEditTab();
|
1831
|
+
numberLinePage.steps.uncheckCheckbox('Show min arrow');
|
1832
|
+
numberLinePage.steps.switchToPreviewTab();
|
1833
|
+
numberLinePage.steps.verifyMinArrowVisibilityPreviewTab('hidden');
|
1834
|
+
});
|
1835
|
+
|
1836
|
+
it('When user checks Show max arrow checkbox, then arrow should be displayed on right end of number line and arrow should not be displayed on left end of number line in preview tab', () => {
|
1837
|
+
numberLinePage.steps.switchToEditTab();
|
1838
|
+
numberLinePage.steps.checkCheckbox('Show max arrow');
|
1839
|
+
numberLinePage.steps.switchToPreviewTab();
|
1840
|
+
numberLinePage.steps.verifyMaxArrowVisibilityPreviewTab('visible');
|
1841
|
+
});
|
1842
|
+
|
1843
|
+
it('When user unchecks Show max arrow checkbox, then arrow should not be displayed on right end of number line in preview tab', () => {
|
1844
|
+
numberLinePage.steps.switchToEditTab();
|
1845
|
+
numberLinePage.steps.uncheckCheckbox('Show max arrow');
|
1846
|
+
numberLinePage.steps.switchToPreviewTab();
|
1847
|
+
numberLinePage.steps.verifyMaxArrowVisibilityPreviewTab('hidden');
|
1848
|
+
});
|
1849
|
+
|
1850
|
+
it('When user unchecks Show labels checkbox, then labels on number line should disappear in preview tab', () => {
|
1851
|
+
numberLinePage.steps.switchToEditTab();
|
1852
|
+
numberLinePage.steps.uncheckCheckbox('Show labels');
|
1853
|
+
numberLinePage.steps.switchToPreviewTab();
|
1854
|
+
numberLinePage.steps.verifyLabelsNotVisibleOnNumberLinePreviewTab();
|
1855
|
+
});
|
1856
|
+
|
1857
|
+
it('When user checks Show labels checkbox, then labels on number line should be displayed in preview tab', () => {
|
1858
|
+
numberLinePage.steps.switchToEditTab();
|
1859
|
+
numberLinePage.steps.checkCheckbox('Show labels');
|
1860
|
+
numberLinePage.steps.switchToPreviewTab();
|
1861
|
+
numberLinePage.steps.verifyLabelsVisibleOnNumberLinePreviewTab(-10, 1);
|
1862
|
+
});
|
1863
|
+
|
1864
|
+
//Note: Unable to check on cypress, added to manual sheet
|
1865
|
+
it('When user unchecks Show ticks checkbox, then ticks on number line should disappear in preview tab', () => {
|
1866
|
+
|
1867
|
+
});
|
1868
|
+
|
1869
|
+
//Note: Unable to check on cypress, added to manual sheet
|
1870
|
+
it('When user checks Show ticks checkbox, then ticks on number line should be displayed in preview tab', () => {
|
1871
|
+
|
1872
|
+
});
|
1873
|
+
},
|
1874
|
+
|
1875
|
+
/**
|
1876
|
+
* Verifies the functionality of the number line title popup in the edit tab.
|
1877
|
+
* @param {string} orientation - The orientation of the number line ('Horizontal' or 'Vertical').
|
1878
|
+
*/
|
1879
|
+
verifyNumberLineTitlePopupEditTabFunctionality: (title) => {
|
1880
|
+
it('When the user edits the Number line title and clicks on \'Cancel\' button then the changes should not be displayed in the Number line section and \'Specify correct answer\' section Number line', () => {
|
1881
|
+
numberLinePage.steps.enterTextInTitlePopupAddLabelInputField(title);
|
1882
|
+
numberLinePage.steps.clickOnTitlePopupCancelButton();
|
1883
|
+
utilities.verifyInnerText(numberLinePage.numberLineTitleNumberLineSection(), 'Number line title');
|
1884
|
+
utilities.verifyInnerText(numberLinePage.numberLineTitleSpecifyCorrectAnswerSection(), 'Number line title');
|
1885
|
+
});
|
1886
|
+
|
1887
|
+
it('When the user clicks on the \'Number line title\' then the original text should be displayed in the popup', () => {
|
1888
|
+
numberLinePage.steps.clickOnNumberLineTitle();
|
1889
|
+
numberLinePage.steps.verifyTextInTitlePopupAddLabelInputField('Number line title');
|
1890
|
+
});
|
1891
|
+
|
1892
|
+
it('When the user clicks on \'Save\' after updating the input field the updated label should be displayed in the Number line section and \'Specify correct answer\' section Number line', () => {
|
1893
|
+
numberLinePage.steps.enterTextInTitlePopupAddLabelInputField(title);
|
1894
|
+
numberLinePage.steps.clickOnTitlePopupSaveButton();
|
1895
|
+
utilities.verifyInnerText(numberLinePage.numberLineTitleNumberLineSection(), title);
|
1896
|
+
utilities.verifyInnerText(numberLinePage.numberLineTitleSpecifyCorrectAnswerSection(), title);
|
1897
|
+
});
|
1898
|
+
},
|
1899
|
+
|
1900
|
+
/**
|
1901
|
+
* Verifies the functionality of the number line title popup in the preview tab.
|
1902
|
+
* @param {string} orientation - The orientation of the number line ('Horizontal' or 'Vertical').
|
1903
|
+
*/
|
1904
|
+
verifyNumberLineTitlePopupPreviewTabFunctionality: (title) => {
|
1905
|
+
it('When the user edits the number line title and clicks on \'Cancel\' button then the changes should not be displayed in the preview tab', () => {
|
1906
|
+
numberLinePage.steps.clickOnNumberLineTitle();
|
1907
|
+
numberLinePage.steps.enterTextInTitlePopupAddLabelInputField(title);
|
1908
|
+
numberLinePage.steps.clickOnTitlePopupCancelButton();
|
1909
|
+
numberLinePage.steps.switchToPreviewTab();
|
1910
|
+
utilities.verifyInnerText(numberLinePage.numberLineTitlePreviewTab(), 'Number line title');
|
1911
|
+
});
|
1912
|
+
|
1913
|
+
it('When the user clicks on \'Save\' after updating the input field the updated label should be displayed in the preview tab', () => {
|
1914
|
+
numberLinePage.steps.switchToEditTab();
|
1915
|
+
numberLinePage.steps.clickOnNumberLineTitle();
|
1916
|
+
numberLinePage.steps.enterTextInTitlePopupAddLabelInputField(title);
|
1917
|
+
numberLinePage.steps.clickOnTitlePopupSaveButton();
|
1918
|
+
numberLinePage.steps.switchToPreviewTab();
|
1919
|
+
utilities.verifyInnerText(numberLinePage.numberLineTitlePreviewTab(), title);
|
1920
|
+
});
|
1921
|
+
},
|
1922
|
+
|
1923
|
+
/**
|
1924
|
+
* Verifies the functionality of the number line section in the edit tab.
|
1925
|
+
* @param {string} orientation - The orientation of the number line ('Horizontal' or 'Vertical').
|
1926
|
+
*/
|
1927
|
+
verifyNumberLineSectionEditTabFunctionality: (orientation) => {
|
1928
|
+
it('When user updates value in Min input field then it should be updated in Specify correct answer section', () => {
|
1929
|
+
numberLinePage.steps.enterTextInMinInputField(-12);
|
1930
|
+
numberLinePage.steps.verifyTextInMinInputField(-12);
|
1931
|
+
numberLinePage.steps.verifyLabelOnNumberLineNumberLineSection([{ value: -12, index: 0 }]);
|
1932
|
+
numberLinePage.steps.verifyLabelOnNumberLineSpecifyCorrectAnswerSection([{ value: -12, index: 0 }]);
|
1933
|
+
});
|
1934
|
+
|
1935
|
+
it('When user updates value in Max input field then it should be updated in Specify correct answer section', () => {
|
1936
|
+
numberLinePage.steps.enterTextInMaxInputField(12);
|
1937
|
+
numberLinePage.steps.verifyTextInMaxInputField(12);
|
1938
|
+
numberLinePage.steps.verifyLabelOnNumberLineNumberLineSection([{ value: 12, index: 24 }]);
|
1939
|
+
numberLinePage.steps.verifyLabelOnNumberLineSpecifyCorrectAnswerSection([{ value: 12, index: 24 }]);
|
1940
|
+
});
|
1941
|
+
|
1942
|
+
//Note- Can't check ticks are not annotated so adding it to manual sheet
|
1943
|
+
it('When user updates value in Interval input field then interval of labels and ticks should be updated in number line section and specify correct answer section', () => {
|
1944
|
+
numberLinePage.steps.enterTextInIntervalInputField(2);
|
1945
|
+
numberLinePage.steps.verifyTextInIntervalInputField(2);
|
1946
|
+
numberLinePage.steps.verifyLabelsVisibleOnNumberLineNumberLineSection(-12, 2);
|
1947
|
+
numberLinePage.steps.verifyLabelsVisibleOnNumberLineSpecifyCorrectAnswerSection(-12, 2);
|
1948
|
+
});
|
1949
|
+
|
1950
|
+
//Note- Can't check ticks are not annotated so adding it to manual sheet
|
1951
|
+
it('When user updates value in Annotate every input field then labels should be annotated appropriately and ticks should not get annotated for the number line in the number line section and the specify correct answer section.', () => {
|
1952
|
+
cy.log('Changing interval input fields value to its default value');
|
1953
|
+
numberLinePage.steps.enterTextInIntervalInputField(1);
|
1954
|
+
numberLinePage.steps.enterTextInAnnotateEveryInputField(2);
|
1955
|
+
numberLinePage.steps.verifyTextInAnnotateEveryInputField(2);
|
1956
|
+
numberLinePage.steps.verifyAnnotatedLabelsOnNumberLineNumberLineSection(-12, 2);
|
1957
|
+
numberLinePage.steps.verifyAnnotatedLabelsOnNumberLineSpecifyCorrectAnswerSection(-12, 2);
|
1958
|
+
});
|
1959
|
+
|
1960
|
+
const displayNumbersOptions = (orientation === "Horizontal") ? ["Below line", "Above line"] : ["Left of line", "Right of line"];
|
1961
|
+
const direction = (orientation === "Horizontal") ? "Below" : "Left of";
|
1962
|
+
it(`When "${displayNumbersOptions[0]}" is selected, labels should be displayed ${direction} number line in both the number line section and the specify correct answer section.`, () => {
|
1963
|
+
numberLinePage.steps.verifyDisplayNumbersToggleButtonSelected(displayNumbersOptions[0]);
|
1964
|
+
numberLinePage.steps.verifyDisplayNumbersOrientationNumberLineSection(orientation, direction);
|
1965
|
+
numberLinePage.steps.verifyDisplayNumbersOrientationSpecifyCorrectAnswerSection(orientation, direction);
|
1966
|
+
});
|
1967
|
+
|
1968
|
+
const oppositeDirection = (orientation === "Horizontal") ? "Above" : "Right of";
|
1969
|
+
it(`When "${displayNumbersOptions[1]}" is selected, labels should be displayed ${oppositeDirection} number line in both the number line section and the specify correct answer section.`, () => {
|
1970
|
+
numberLinePage.steps.selectDisplayNumbersToggleButton(displayNumbersOptions[1]);
|
1971
|
+
numberLinePage.steps.verifyDisplayNumbersOrientationNumberLineSection(orientation, oppositeDirection);
|
1972
|
+
numberLinePage.steps.verifyDisplayNumbersOrientationSpecifyCorrectAnswerSection(orientation, oppositeDirection);
|
1973
|
+
});
|
1974
|
+
},
|
1975
|
+
|
1976
|
+
/**
|
1977
|
+
* Verifies the functionality of the display specific annotation and line settings in the edit tab.
|
1978
|
+
* @param {string} orientation - The orientation of the number line ('Horizontal' or 'Vertical').
|
1979
|
+
*/
|
1980
|
+
verifyDisplaySpecificAnnotationAndLineSettingsEditTabFunctionality: () => {
|
1981
|
+
lineSettingsOptions.forEach((option, index) => {
|
1982
|
+
it(`When user selects ${option} in line settings section, then number displayed on number line should be ${option} in number line section and specify correct answer section`, () => {
|
1983
|
+
numberLinePage.steps.selectLineSettingsToggleButton(option);
|
1984
|
+
numberLinePage.steps.verifyLineSettingsToggleButtonSelected(option);
|
1985
|
+
numberLinePage.steps.verifyLabelOnNumberLineNumberLineSection([{ value: numbers[index], index: 0 }]);
|
1986
|
+
numberLinePage.steps.verifyLabelOnNumberLineSpecifyCorrectAnswerSection([{ value: numbers[index], index: 0 }]);
|
1987
|
+
});
|
1988
|
+
});
|
1989
|
+
|
1990
|
+
it('When user enters value in Display specific annotation (use semicolons to separate) input field then it should be displayed on number line in Number line section and Specify correct answer section', () => {
|
1991
|
+
numberLinePage.steps.selectLineSettingsToggleButton(lineSettingsOptions[0]);
|
1992
|
+
numberLinePage.steps.enterTextInDisplaySpecificAnnotationInputField('-9;');
|
1993
|
+
numberLinePage.steps.verifyTextInDisplaySpecificAnnotationInputField('-9;');
|
1994
|
+
numberLinePage.steps.verifyLabelOnNumberLineSpecifyCorrectAnswerSection([{ value: -9, index: 1 }]);
|
1995
|
+
numberLinePage.steps.verifyLabelOnNumberLineNumberLineSection([{ value: -9, index: 1 }]);
|
1996
|
+
});
|
1997
|
+
},
|
1998
|
+
|
1999
|
+
/**
|
2000
|
+
* Verifies the functionality of the number line section in the preview tab.
|
2001
|
+
* @param {string} orientation - The orientation of the number line ('Horizontal' or 'Vertical').
|
2002
|
+
*/
|
2003
|
+
verifyNumberLineSectionPreviewTabFunctionality: (orientation) => {
|
2004
|
+
it('When user updates value in Min input field then it should be updated in preview tab', () => {
|
2005
|
+
numberLinePage.steps.switchToEditTab();
|
2006
|
+
numberLinePage.steps.enterTextInMinInputField(-12);
|
2007
|
+
numberLinePage.steps.verifyTextInMinInputField(-12);
|
2008
|
+
numberLinePage.steps.switchToPreviewTab();
|
2009
|
+
numberLinePage.steps.verifyLabelOnNumberLinePreviewTab([{ value: -12, index: 0 }]);
|
2010
|
+
});
|
2011
|
+
|
2012
|
+
it('When user updates value in Max input field then it should be updated in preview tab', () => {
|
2013
|
+
numberLinePage.steps.switchToEditTab();
|
2014
|
+
numberLinePage.steps.enterTextInMaxInputField(12);
|
2015
|
+
numberLinePage.steps.verifyTextInMaxInputField(12);
|
2016
|
+
numberLinePage.steps.switchToPreviewTab();
|
2017
|
+
numberLinePage.steps.verifyLabelOnNumberLinePreviewTab([{ value: 12, index: 24 }]);
|
2018
|
+
});
|
2019
|
+
|
2020
|
+
//Note- Can't check ticks are not annotated so adding it to manual sheet
|
2021
|
+
it('When user updates value in Interval input field then interval of labels and ticks should be updated in preview tab', () => {
|
2022
|
+
numberLinePage.steps.switchToEditTab();
|
2023
|
+
numberLinePage.steps.enterTextInIntervalInputField(2);
|
2024
|
+
numberLinePage.steps.verifyTextInIntervalInputField(2);
|
2025
|
+
numberLinePage.steps.switchToPreviewTab();
|
2026
|
+
numberLinePage.steps.verifyLabelsVisibleOnNumberLinePreviewTab(-12, 2);
|
2027
|
+
});
|
2028
|
+
|
2029
|
+
//Note- Can't check ticks are not annotated so adding it to manual sheet
|
2030
|
+
it('When user updates value in Annotate every input field then labels should be annotated appropriately for the number line and ticks should not get annotated in the preview tab.', () => {
|
2031
|
+
numberLinePage.steps.switchToEditTab();
|
2032
|
+
cy.log('Changing interval input fields value to its default value');
|
2033
|
+
numberLinePage.steps.enterTextInIntervalInputField(1);
|
2034
|
+
numberLinePage.steps.enterTextInAnnotateEveryInputField(2);
|
2035
|
+
numberLinePage.steps.verifyTextInAnnotateEveryInputField(2);
|
2036
|
+
numberLinePage.steps.switchToPreviewTab();
|
2037
|
+
numberLinePage.steps.verifyAnnotatedLabelsOnNumberLinePreviewTab(-12, 2);
|
2038
|
+
});
|
2039
|
+
|
2040
|
+
const displayNumbersOptions = (orientation === "Horizontal") ? ["Below line", "Above line"] : ["Left of line", "Right of line"];
|
2041
|
+
const direction = (orientation === "Horizontal") ? "Below" : "Left of";
|
2042
|
+
it(`When ${displayNumbersOptions[0]} is selected then labels should be displayed ${direction} number line in the preview tab.`, () => {
|
2043
|
+
numberLinePage.steps.switchToEditTab();
|
2044
|
+
numberLinePage.steps.verifyDisplayNumbersToggleButtonSelected(displayNumbersOptions[0]);
|
2045
|
+
numberLinePage.steps.switchToPreviewTab();
|
2046
|
+
numberLinePage.steps.verifyDisplayNumbersOrientationPreviewTab(orientation, direction);
|
2047
|
+
});
|
2048
|
+
|
2049
|
+
const oppositeDirection = (orientation === "Horizontal") ? "Above" : "Right of";
|
2050
|
+
it(`When user selects ${displayNumbersOptions[1]} then labels should labels should be displayed ${oppositeDirection} number line in the preview tab.`, () => {
|
2051
|
+
numberLinePage.steps.switchToEditTab();
|
2052
|
+
numberLinePage.steps.selectDisplayNumbersToggleButton(displayNumbersOptions[1]);
|
2053
|
+
numberLinePage.steps.switchToPreviewTab();
|
2054
|
+
numberLinePage.steps.verifyDisplayNumbersOrientationPreviewTab(orientation, oppositeDirection);
|
2055
|
+
});
|
2056
|
+
},
|
2057
|
+
|
2058
|
+
/**
|
2059
|
+
* Verifies the functionality of the display specific annotation and line settings in the preview tab.
|
2060
|
+
* @param {string} orientation - The orientation of the number line ('Horizontal' or 'Vertical').
|
2061
|
+
*/
|
2062
|
+
verifyDisplaySpecificAnnotationAndLineSettingsPreviewTabFunctionality: () => {
|
2063
|
+
lineSettingsOptions.forEach((option, index) => {
|
2064
|
+
it(`When user selects ${option} in line settings section, then number displayed on number line should be ${option} in preview tab`, () => {
|
2065
|
+
numberLinePage.steps.switchToEditTab();
|
2066
|
+
numberLinePage.steps.selectLineSettingsToggleButton(option);
|
2067
|
+
numberLinePage.steps.verifyLineSettingsToggleButtonSelected(option);
|
2068
|
+
numberLinePage.steps.switchToPreviewTab();
|
2069
|
+
numberLinePage.steps.verifyLabelOnNumberLinePreviewTab([{ value: numbers[index], index: 0 }]);
|
2070
|
+
});
|
2071
|
+
});
|
2072
|
+
|
2073
|
+
it('When user enters value in Display specific annotation (use semicolons to separate) input field then it should be displayed on number line in preview tab', () => {
|
2074
|
+
numberLinePage.steps.switchToEditTab();
|
2075
|
+
numberLinePage.steps.selectLineSettingsToggleButton(lineSettingsOptions[0]);
|
2076
|
+
numberLinePage.steps.enterTextInDisplaySpecificAnnotationInputField('-9;');
|
2077
|
+
numberLinePage.steps.verifyTextInDisplaySpecificAnnotationInputField('-9;');
|
2078
|
+
numberLinePage.steps.switchToPreviewTab();
|
2079
|
+
numberLinePage.steps.verifyLabelOnNumberLinePreviewTab([{ value: -9, index: 1 }]);
|
2080
|
+
});
|
2081
|
+
}
|
844
2082
|
}
|
845
2083
|
|
846
2084
|
export const numberLinePage = {
|