itemengine-cypress-automation 1.0.180-essayResponseLazyLoadingFix-63cd8a3.0 → 1.0.182-repoUpdate22April-92d01da.0
Sign up to get free protection for your applications and to get access to all the features.
- package/cypress/e2e/ILC/AudioPlayerNew/previewContents.smoke.js +162 -0
- package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/clickAndDrop.js +1 -1
- package/cypress/e2e/ILC/DrawingResponse/drawingResponseGradingViewAndCorrectAnswerViewContents.smoke.js +4 -5
- package/cypress/e2e/ILC/EditTabSettingPage/itemPreviewSettingsTabFunctionality.js +64 -3
- 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/previewContentsForAllViews.smoke.js +3 -3
- package/cypress/e2e/ILC/GridFill/studentViewSettingsSection.js +1 -1
- 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/allOrNothingForAllViews.smoke.js +243 -0
- package/cypress/e2e/ILC/ListOrderingNew/checkAnswerFunctionalityForAllViews.smoke.js +128 -0
- package/cypress/e2e/ILC/ListOrderingNew/previewContentsForAllViews.smoke.js +176 -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 +530 -0
- package/cypress/e2e/ILC/NumberLine/Scoring/allOrNothingWithCorrectPointsGreaterThanAlternativePoints.js +3 -3
- package/cypress/e2e/ILC/NumberLine/lineSettingsSection.js +119 -0
- package/cypress/e2e/ILC/NumberLine/numberLineSection.js +263 -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/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 +0 -1
- 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 +2 -2
- package/cypress/e2e/ILC/TextSelection/questionInstructionsAndQuestion.smoke.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/fixtures/constants.js +1 -1
- package/cypress/fixtures/equationEditorCategoriesAndSymbols .js +20 -20
- package/cypress/fixtures/theme/ilc.json +16 -16
- package/cypress/pages/audioPlayerPage.js +55 -543
- package/cypress/pages/brainingCampManipulativePage.js +1 -1
- package/cypress/pages/components/autoScoredSpecifyCorrectAnswerSection.js +3 -3
- package/cypress/pages/components/autoScoredStudentViewSettings.js +4 -4
- 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 +1 -0
- package/cypress/pages/components/optionsWrapperComponent.js +11 -0
- package/cypress/pages/components/styleAndLayoutCustomizationAccordionComponent.js +46 -0
- package/cypress/pages/components/toolSettingsComponent.js +6 -0
- package/cypress/pages/contentBlocksPage.js +2 -2
- package/cypress/pages/createItemPage.js +29 -0
- package/cypress/pages/dialogBoxBase.js +2 -2
- package/cypress/pages/drawingResponsePage.js +23 -4
- package/cypress/pages/feedbackScalePage.js +3 -0
- package/cypress/pages/graphingPage.js +18 -0
- package/cypress/pages/gridFillPage.js +18 -2
- package/cypress/pages/index.js +1 -1
- package/cypress/pages/itemPreviewSettingsPage.js +4 -0
- package/cypress/pages/listOrderingPage.js +122 -647
- package/cypress/pages/matchingPage.js +1 -1
- package/cypress/pages/multipleSelectionPage.js +23 -1
- package/cypress/pages/numberLinePage.js +1196 -59
- package/cypress/pages/rulerPage.js +6 -2
- package/cypress/pages/textSelectionPage.js +460 -22
- package/cypress/support/migrationHelpers/extractLrnQuestionData.js +2 -1
- package/cypress/support/migrationHelpers/verifyIeQuestionData.js +4 -1
- package/package.json +1 -1
- package/cypress/e2e/ILC/EssayResponse/essayResponseAdditionalSettings.js +0 -432
- package/cypress/e2e/ILC/EssayResponse/essayResponseAdditionalSettingsBasic.js +0 -134
@@ -1,5 +1,6 @@
|
|
1
1
|
import utilities from '../support/helpers/utilities';
|
2
2
|
import { createQuestionBasePage, toolsAndControlsComponent, questionInstructionsComponent, resetPopupComponent, scoringSectionBaseEditTab, autoScoredScoringPreviewTab, autoScoredSpecifyCorrectAnswerSection, commonComponents, autoScoredScoringSectionMultiResponseType, toolSettingsComponent, additionalSettingsPanel, additionalSettingsAccessibilitySectionComponent, autoScoredStudentViewSettings, randomizeOptionsComponent, studentViewSettingsLabelComponent, defaultToolDropdown } from './components';
|
3
|
+
import { dialogBoxBase } from './dialogBoxBase';
|
3
4
|
const css = Cypress.env('css');
|
4
5
|
const range = 20.4472843;
|
5
6
|
|
@@ -14,11 +15,90 @@ const selectors = {
|
|
14
15
|
...commonComponents,
|
15
16
|
...defaultToolDropdown,
|
16
17
|
...autoScoredScoringSectionMultiResponseType,
|
17
|
-
|
18
|
+
...dialogBoxBase,
|
19
|
+
//Layout
|
20
|
+
layoutLabel: () => cy.get('.customized-options-label'),
|
21
|
+
layoutAccordionChevronButton: () => cy.get('.number-line-response-accordion [class*="MuiAccordionSummary-expandIconWrapper"]'),
|
22
|
+
layoutAccordionButton: () => cy.get('.number-line-response-accordion .ngie-accordion-summary'),
|
23
|
+
orientationLabel: () => cy.get('.number-line-layout-options .single-select-toggle-group-title'),
|
24
|
+
orientationToggleButton: (ariaLabel = null) => {
|
25
|
+
if (ariaLabel !== null) {
|
26
|
+
return cy.get(`.number-line-layout-options [class*="SingleSelectToggleGroupstyles__ButtonContainer"] button[aria-label*="${ariaLabel}"]`);
|
27
|
+
} else {
|
28
|
+
return cy.get('.number-line-layout-options [class*="SingleSelectToggleGroupstyles__ButtonContainer"] button');
|
29
|
+
}
|
30
|
+
},
|
31
|
+
widthLabel: () => cy.get('.number-line-layout-options [aria-labelledby="Width (px)"]'),
|
32
|
+
widthInputField: () => cy.get('.number-line-layout-options input[aria-label="Width (px)"]'),
|
33
|
+
heightLabel: () => cy.get('.number-line-layout-options [aria-labelledby="Height (px)"]'),
|
34
|
+
heightInputField: () => cy.get('.number-line-layout-options input[aria-label="Height (px)"]'),
|
35
|
+
marginLabel: () => cy.get('.margin-input-wrapper [aria-labelledby="Margin (px)"]'),
|
36
|
+
marginInputField: () => cy.get('.number-line-layout-options input[aria-label="Margin (px)"]'),
|
37
|
+
responseSpacingLabel: () => cy.get('.dropdown-wrapper [aria-labelledby="Response Spacing"]'),
|
38
|
+
responseSpacingInputField: () => cy.get('.dropdown-wrapper input[aria-label="Response Spacing"]'),
|
39
|
+
makeResponsiveLabel: () => cy.get('.mobile-responsive-wrapper .MuiFormControlLabel-label'),
|
40
|
+
makeResponsiveCheckbox: () => cy.get('.mobile-responsive-wrapper input'),
|
41
|
+
makeResponsiveCheckboxIcon: () => cy.get('.mobile-responsive-wrapper .MuiSwitch-thumb'),
|
42
|
+
whatIsThisLabel: () => cy.get('.what-is-wrapper [class*="StyledLink"]'),
|
43
|
+
makeResponsiveHelpText: () => cy.get('[class*="WhatIsThisDescriptionWrapper"]'),
|
44
|
+
showMinArrowLabel: () => cy.get('[data-ngie-testid="show-min-arrow-checkbox"] .MuiFormControlLabel-label'),
|
45
|
+
showMinArrowCheckbox: () => cy.get('[data-ngie-testid="show-min-arrow-checkbox"] input'),
|
46
|
+
showMaxArrowLabel: () => cy.get('[data-ngie-testid="show-max-arrow-checkbox"] .MuiFormControlLabel-label'),
|
47
|
+
showMaxArrowCheckbox: () => cy.get('[data-ngie-testid="show-max-arrow-checkbox"] input'),
|
48
|
+
stackResponsesLabel: () => cy.get('[data-ngie-testid="stack-responses-checkbox"] .MuiFormControlLabel-label'),
|
49
|
+
stackResponsesCheckbox: () => cy.get('[data-ngie-testid="stack-responses-checkbox"] input'),
|
50
|
+
staggerResponseLabel: () => cy.get('[data-ngie-testid="stagger-response-checkbox"] .MuiFormControlLabel-label'),
|
18
51
|
staggerResponseCheckbox: () => cy.get('[data-ngie-testid="stagger-response-checkbox"] input'),
|
19
|
-
|
52
|
+
showLabelsLabel: () => cy.get('[data-ngie-testid="show-labels-checkbox"] .MuiFormControlLabel-label'),
|
53
|
+
showLabelsCheckbox: () => cy.get('[data-ngie-testid="show-labels-checkbox"] input'),
|
54
|
+
showTicksLabel: () => cy.get('[data-ngie-testid="show-ticks-checkbox"] .MuiFormControlLabel-label'),
|
55
|
+
showTicksCheckbox: () => cy.get('[data-ngie-testid="show-ticks-checkbox"] input'),
|
56
|
+
showMinLabel: () => cy.get('[data-ngie-testid="show-min-checkbox"] .MuiFormControlLabel-label'),
|
57
|
+
showMinCheckbox: () => cy.get('[data-ngie-testid="show-min-checkbox"] input'),
|
58
|
+
showMaxLabel: () => cy.get('[data-ngie-testid="show-max-checkbox"] .MuiFormControlLabel-label'),
|
59
|
+
showMaxCheckbox: () => cy.get('[data-ngie-testid="show-max-checkbox"] input'),
|
60
|
+
limitNumbersOfResponsesLabel: () => cy.get('[data-ngie-testid="limit-number-of-responses-checkbox"] .MuiFormControlLabel-label'),
|
61
|
+
limitNumbersOfResponsesCheckbox: () => cy.get('[data-ngie-testid="limit-number-of-responses-checkbox"] input'),
|
62
|
+
limitNumbersOfResponsesInputField: () => cy.get('.limit-number-line-response-wrapper .text-input-field input'),
|
63
|
+
//Number line section
|
64
|
+
titlePopupAddLabelLabel: () => cy.get('[aria-labelledby="alert-dialog-title"] .inline-text-property-label'),
|
65
|
+
titlePopupAddLabelInputField: () => cy.get('[aria-labelledby="alert-dialog-title"] input'),
|
66
|
+
titlePopupCancelButton: () => cy.get('.compact-popup-action-button-wrapper button').eq(0),
|
67
|
+
titlePopupSaveButton: () => cy.get('.compact-popup-action-button-wrapper button').eq(1),
|
68
|
+
numberLineNumberLineSection: () => cy.get('.number-line-grid-setting .ngie-jxgbox svg'),
|
69
|
+
numberLineAxisNumberLineSection: () => cy.get('.number-line-grid-setting .ngie-jxgbox svg line'),
|
70
|
+
numberLineTitleNumberLineSection: () => cy.get('[class*="LineGraphComponentsstyles__TitleContainer"]'),
|
71
|
+
minLabel: () => cy.get('[class*="LineGraphComponentsstyles__GraphRightLeft"] [class*="LineGraphComponentsstyles__CustomInputFieldLabel"]').eq(0),
|
72
|
+
minInputField: () => cy.get('[class*="LineGraphComponentsstyles__GraphRightLeft"] input').eq(0),
|
73
|
+
maxLabel: () => cy.get('[class*="LineGraphComponentsstyles__GraphRightLeft"] [class*="LineGraphComponentsstyles__CustomInputFieldLabel"]').eq(1),
|
74
|
+
maxInputField: () => cy.get('[class*="LineGraphComponentsstyles__GraphRightLeft"] input').eq(1),
|
75
|
+
intervalLabel: () => cy.get('[class*="LineGridSettingstyles__LineSettingFlexWrapper"] [aria-labelledby="Interval"]'),
|
76
|
+
intervalInputField: () => cy.get('[class*="LineGridSettingstyles__LineSettingFlexWrapper"] input[id="Interval"]'),
|
77
|
+
annotateEveryLabel: () => cy.get('[class*="LineGridSettingstyles__LineSettingFlexWrapper"] [aria-labelledby="Annotate every"]'),
|
78
|
+
annotateEveryInputField: () => cy.get('[class*="LineGridSettingstyles__LineSettingFlexWrapper"] input[id="Annotate every"]'),
|
79
|
+
lineSettingsToggleButtonWrapper: () => cy.get('[class*="LineGridSettingstyles__LineSettingFlexWrapper"] [class*="SingleSelectToggleGroupstyles__ToggleButtonWrapper"]').eq(0),
|
80
|
+
lineSettingsLabel: () => cy.get('[class*="LineGridSettingstyles__LineSettingFlexWrapper"] .single-select-toggle-group-title').eq(0),
|
81
|
+
lineSettingsToggleButton: (ariaLabel = null) => {
|
82
|
+
if (ariaLabel !== null) {
|
83
|
+
return cy.get('[class*="LineGridSettingstyles__LineSettingFlexWrapper"] [class*="SingleSelectToggleGroupstyles__ButtonContainer"]').eq(0).find(`button[aria-label*="${ariaLabel}"]`);
|
84
|
+
} else {
|
85
|
+
return cy.get('[class*="LineGridSettingstyles__LineSettingFlexWrapper"] [class*="SingleSelectToggleGroupstyles__ButtonContainer"]').eq(0).find('button');
|
86
|
+
}
|
87
|
+
},
|
88
|
+
displayNumbersToggleButtonWrapper: () => cy.get('[class*="LineGridSettingstyles__LineSettingFlexWrapper"] [class*="SingleSelectToggleGroupstyles__ToggleButtonWrapper"]').eq(1),
|
89
|
+
displayNumbersLabel: () => cy.get('[class*="LineGridSettingstyles__LineSettingFlexWrapper"] .single-select-toggle-group-title').eq(1),
|
90
|
+
displayNumbersToggleButton: (ariaLabel = null) => {
|
91
|
+
if (ariaLabel !== null) {
|
92
|
+
return cy.get('[class*="LineGridSettingstyles__LineSettingFlexWrapper"] [class*="SingleSelectToggleGroupstyles__ButtonContainer"]').eq(1).find(`button[aria-label*="${ariaLabel}"]`);
|
93
|
+
} else {
|
94
|
+
return cy.get('[class*="LineGridSettingstyles__LineSettingFlexWrapper"] [class*="SingleSelectToggleGroupstyles__ButtonContainer"]').eq(1).find('button');
|
95
|
+
}
|
96
|
+
},
|
97
|
+
displaySpecificAnnotationLabel: () => cy.get('[class*="LineGridSettingstyles__SpecificAnnotationWrapper"] .inline-text-property-label'),
|
98
|
+
displaySpecificAnnotationInputField: () => cy.get('[class*="LineGridSettingstyles__SpecificAnnotationWrapper"] input'),
|
20
99
|
//Specify correct answer
|
21
100
|
numberLineSpecifyCorrectAnswer: () => cy.get('.ngie-accordion .ngie-jxgbox svg'),
|
101
|
+
numberLineAxisSpecifyCorrectAnswer: () => cy.get('.ngie-accordion .ngie-jxgbox svg line'),
|
22
102
|
numberLineToolOptionSpecifyCorrectAnswer: (toolOptionAriaLabel = null) => {
|
23
103
|
if (toolOptionAriaLabel) {
|
24
104
|
return cy.get(`.graph-tools-wrapper .single-select-toggle-group-double button[aria-label*="${toolOptionAriaLabel}"]`).eq(0)
|
@@ -39,6 +119,7 @@ const selectors = {
|
|
39
119
|
|
40
120
|
//Preview Tab
|
41
121
|
numberLinePreviewTab: () => cy.get('[class*="question-preview-wrapper"] .ngie-jxgbox svg').eq(0),
|
122
|
+
numberLineAxisPreviewTab: () => cy.get('[class*="question-preview-wrapper"] .ngie-jxgbox svg line').eq(0),
|
42
123
|
numberLinePointPreviewTab: () => cy.get('[class*="question-preview-wrapper"] .ngie-jxgbox').eq(0).find('svg ellipse[display="inline"]'),
|
43
124
|
numberLineSegmentPreviewTab: () => cy.get('[class*="question-preview-wrapper"] .ngie-jxgbox').eq(0).find('[stroke-linecap="butt"]'),
|
44
125
|
numberLineToolOptionPreviewTab: (toolOptionAriaLabel = null) => {
|
@@ -64,7 +145,10 @@ const selectors = {
|
|
64
145
|
numberLineCorrectAnswerSection: () => cy.get('[class*="question-preview-wrapper"] .ngie-jxgbox svg:visible').eq(1),
|
65
146
|
numberLinePointCorrectAnswerSection: () => cy.get('[class*="question-preview-wrapper"] .ngie-jxgbox').eq(1).find('svg ellipse[display="inline"]'),
|
66
147
|
correctIncorrectAnswerTextWrapper: () => cy.get('[class*="CorrectIncorrectWrapper"]'),
|
67
|
-
numberLineTitleCorrectAnswerSection: () => cy.get('[class*="LineGraphstyles__TitleText"]').last()
|
148
|
+
numberLineTitleCorrectAnswerSection: () => cy.get('[class*="LineGraphstyles__TitleText"]').last(),
|
149
|
+
|
150
|
+
warningMessage: () => cy.get('.disabled-wrapper-cls [class*="DisabledTextWrapper"]'),
|
151
|
+
warningMessageContainer: () => cy.get('.disabled-wrapper-cls'),
|
68
152
|
}
|
69
153
|
|
70
154
|
const steps = {
|
@@ -173,18 +257,18 @@ const steps = {
|
|
173
257
|
* @param {number} startingPoint - It representing the starting point of the ray.
|
174
258
|
*/
|
175
259
|
verifyRayOnNumberLineSpecifyCorrectAnswer: (direction, range, startingPoint) => {
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
260
|
+
numberLinePage.numberLineSpecifyCorrectAnswer()
|
261
|
+
.then(($graphElement) => {
|
262
|
+
const graphWidth = $graphElement[0].clientWidth;
|
263
|
+
const graphHeight = $graphElement[0].clientHeight;
|
264
|
+
const originX = graphWidth / 2;
|
265
|
+
const originY = graphHeight / 2;
|
266
|
+
const x1Pixel = originX + startingPoint * (graphWidth / range);
|
267
|
+
const rayArrowWidth = 42;
|
268
|
+
const x2Pixel = direction === "left" ? rayArrowWidth : graphWidth - rayArrowWidth;
|
269
|
+
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)}"]`)
|
270
|
+
.should('be.visible');
|
271
|
+
});
|
188
272
|
},
|
189
273
|
|
190
274
|
/**
|
@@ -356,18 +440,18 @@ const steps = {
|
|
356
440
|
* @param {number} startingPoint - It representing the starting point of the ray.
|
357
441
|
*/
|
358
442
|
verifyRayOnNumberLinePreviewTab: (direction, range, startingPoint) => {
|
359
|
-
|
360
|
-
|
361
|
-
|
362
|
-
|
363
|
-
|
364
|
-
|
365
|
-
|
366
|
-
|
367
|
-
|
368
|
-
|
369
|
-
|
370
|
-
|
443
|
+
numberLinePage.numberLinePreviewTab()
|
444
|
+
.then(($graphElement) => {
|
445
|
+
const graphWidth = $graphElement[0].clientWidth;
|
446
|
+
const graphHeight = $graphElement[0].clientHeight;
|
447
|
+
const originX = graphWidth / 2;
|
448
|
+
const originY = graphHeight / 2;
|
449
|
+
const x1Pixel = originX + startingPoint * (graphWidth / range);
|
450
|
+
const rayArrowWidth = 42;
|
451
|
+
const x2Pixel = direction === "left" ? rayArrowWidth : graphWidth - rayArrowWidth;
|
452
|
+
cy.get('[class*="question-preview-wrapper"] .ngie-jxgbox').eq(0).find(`[stroke-linecap="butt"][x1*="${Math.floor(x1Pixel)}"][y1*="${Math.floor(originY)}"][x2*="${Math.floor(x2Pixel)}"][y2*="${Math.floor(originY)}"]`)
|
453
|
+
.should('be.visible');
|
454
|
+
});
|
371
455
|
},
|
372
456
|
|
373
457
|
/**
|
@@ -398,18 +482,18 @@ const steps = {
|
|
398
482
|
* @param {number} startingPoint -It representing the starting point of the ray.
|
399
483
|
*/
|
400
484
|
verifyCorrectRayOnNumberLinePreviewTab: (direction, range, startingPoint) => {
|
401
|
-
|
402
|
-
|
403
|
-
|
404
|
-
|
405
|
-
|
406
|
-
|
407
|
-
|
408
|
-
|
409
|
-
|
410
|
-
|
411
|
-
|
412
|
-
|
485
|
+
numberLinePage.numberLinePreviewTab()
|
486
|
+
.then(($graphElement) => {
|
487
|
+
const graphWidth = $graphElement[0].clientWidth;
|
488
|
+
const graphHeight = $graphElement[0].clientHeight;
|
489
|
+
const originX = graphWidth / 2;
|
490
|
+
const originY = graphHeight / 2;
|
491
|
+
const x1Pixel = originX + startingPoint * (graphWidth / range);
|
492
|
+
const rayArrowWidth = 42;
|
493
|
+
const x2Pixel = direction === "left" ? rayArrowWidth : graphWidth - rayArrowWidth;
|
494
|
+
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)}"]`)
|
495
|
+
.should('have.css', 'stroke', css.color.correctAnswer);
|
496
|
+
});
|
413
497
|
},
|
414
498
|
|
415
499
|
/**
|
@@ -440,18 +524,18 @@ const steps = {
|
|
440
524
|
* @param {number} startingPoint- It representing the starting point of the ray.
|
441
525
|
*/
|
442
526
|
verifyIncorrectRayOnNumberLinePreviewTab: (direction, range, startingPoint) => {
|
443
|
-
|
444
|
-
|
445
|
-
|
446
|
-
|
447
|
-
|
448
|
-
|
449
|
-
|
450
|
-
|
451
|
-
|
452
|
-
|
453
|
-
|
454
|
-
|
527
|
+
numberLinePage.numberLinePreviewTab()
|
528
|
+
.then(($graphElement) => {
|
529
|
+
const graphWidth = $graphElement[0].clientWidth;
|
530
|
+
const graphHeight = $graphElement[0].clientHeight;
|
531
|
+
const originX = graphWidth / 2;
|
532
|
+
const originY = graphHeight / 2;
|
533
|
+
const x1Pixel = originX + startingPoint * (graphWidth / range);
|
534
|
+
const rayArrowWidth = 42;
|
535
|
+
const x2Pixel = direction === "left" ? rayArrowWidth : graphWidth - rayArrowWidth;
|
536
|
+
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)}"]`)
|
537
|
+
.should('have.css', 'stroke', css.color.incorrectAnswer);
|
538
|
+
});
|
455
539
|
},
|
456
540
|
|
457
541
|
/**
|
@@ -754,21 +838,1074 @@ const steps = {
|
|
754
838
|
});
|
755
839
|
},
|
756
840
|
|
841
|
+
//Layout
|
842
|
+
verifyLayoutAccordionIsCollapsed: () => {
|
843
|
+
numberLinePage.layoutAccordionButton()
|
844
|
+
.should('have.attr', 'aria-expanded', 'false');
|
845
|
+
numberLinePage.layoutAccordionChevronButton()
|
846
|
+
.should('not.have.class', 'Mui-expanded');
|
847
|
+
},
|
848
|
+
|
849
|
+
verifyLayoutAccordionIsExpanded: () => {
|
850
|
+
numberLinePage.layoutAccordionButton()
|
851
|
+
.should('have.attr', 'aria-expanded', 'true');
|
852
|
+
numberLinePage.layoutAccordionChevronButton()
|
853
|
+
.should('have.class', 'Mui-expanded');
|
854
|
+
},
|
855
|
+
|
856
|
+
expandLayoutAccordion: () => {
|
857
|
+
numberLinePage.layoutAccordionButton()
|
858
|
+
.click();
|
859
|
+
numberLinePage.layoutAccordionButton()
|
860
|
+
.should('have.attr', 'aria-expanded', 'true');
|
861
|
+
numberLinePage.layoutAccordionChevronButton()
|
862
|
+
.should('have.class', 'Mui-expanded');
|
863
|
+
},
|
864
|
+
|
865
|
+
collapseLayoutAccordion: () => {
|
866
|
+
numberLinePage.layoutAccordionButton()
|
867
|
+
.click();
|
868
|
+
numberLinePage.layoutAccordionButton()
|
869
|
+
.should('have.attr', 'aria-expanded', 'false');
|
870
|
+
numberLinePage.layoutAccordionChevronButton()
|
871
|
+
.should('not.have.class', 'Mui-expanded');
|
872
|
+
},
|
873
|
+
|
874
|
+
verifyMakeResponsiveCheckboxChecked: () => {
|
875
|
+
numberLinePage.makeResponsiveCheckboxIcon()
|
876
|
+
.should('have.class', 'icon-ILC-tick-icon');
|
877
|
+
},
|
878
|
+
|
879
|
+
verifyMakeResponsiveCheckboxUnchecked: () => {
|
880
|
+
numberLinePage.makeResponsiveCheckboxIcon()
|
881
|
+
.should('have.class', 'icon-x-circle');
|
882
|
+
},
|
883
|
+
|
884
|
+
checkMakeResponsiveCheckbox: () => {
|
885
|
+
numberLinePage.makeResponsiveCheckboxIcon()
|
886
|
+
.click({ force: true });
|
887
|
+
steps.verifyMakeResponsiveCheckboxChecked();
|
888
|
+
},
|
889
|
+
|
890
|
+
uncheckMakeResponsiveCheckbox: () => {
|
891
|
+
numberLinePage.makeResponsiveCheckboxIcon()
|
892
|
+
.click({ force: true });
|
893
|
+
steps.verifyMakeResponsiveCheckboxUnchecked();
|
894
|
+
},
|
895
|
+
|
757
896
|
/**
|
758
|
-
* Enters
|
759
|
-
* @param {
|
760
|
-
* @description This function clears the input field and then enters the specified value into the Limit Number of Responses input field on the page.
|
897
|
+
* Enters the specified value into the input field.
|
898
|
+
* @param {number} value - The value to enter into the input field.
|
761
899
|
*/
|
762
|
-
|
763
|
-
numberLinePage.
|
900
|
+
enterTextInWidthInputField: (value) => {
|
901
|
+
numberLinePage.widthInputField()
|
902
|
+
.clear()
|
903
|
+
.type(value);
|
904
|
+
},
|
905
|
+
|
906
|
+
/**
|
907
|
+
* Verifies that the input field has the specified value.
|
908
|
+
* @param {number} value - The expected value of the input field
|
909
|
+
*/
|
910
|
+
verifyTextInWidthInputField: (value) => {
|
911
|
+
numberLinePage.widthInputField()
|
912
|
+
.should('have.value', value);
|
913
|
+
},
|
914
|
+
|
915
|
+
/**
|
916
|
+
* Enters the specified value into the input field.
|
917
|
+
* @param {number} value - The value to enter into the input field.
|
918
|
+
*/
|
919
|
+
enterTextInMarginInputField: (value) => {
|
920
|
+
numberLinePage.marginInputField()
|
921
|
+
.clear()
|
922
|
+
.type(value);
|
923
|
+
},
|
924
|
+
|
925
|
+
/**
|
926
|
+
* Verifies that the input field has the specified value.
|
927
|
+
* @param {number} value - The expected value of the input field
|
928
|
+
*/
|
929
|
+
verifyTextInMarginInputField: (value) => {
|
930
|
+
numberLinePage.marginInputField()
|
931
|
+
.should('have.value', value);
|
932
|
+
},
|
933
|
+
|
934
|
+
/**
|
935
|
+
* Enters the specified value into the input field.
|
936
|
+
* @param {number} value - The value to enter into the input field.
|
937
|
+
*/
|
938
|
+
enterTextInResponseSpacingInputField: (value) => {
|
939
|
+
numberLinePage.responseSpacingInputField()
|
940
|
+
.clear()
|
941
|
+
.type(value);
|
942
|
+
},
|
943
|
+
|
944
|
+
/**
|
945
|
+
* Verifies that the input field has the specified value.
|
946
|
+
* @param {number} value - The expected value of the input field
|
947
|
+
*/
|
948
|
+
verifyTextInResponseSpacingInputField: (value) => {
|
949
|
+
numberLinePage.responseSpacingInputField()
|
950
|
+
.should('have.value', value);
|
951
|
+
},
|
952
|
+
|
953
|
+
/**
|
954
|
+
* Enters the specified value into the input field.
|
955
|
+
* @param {number} value - The value to enter into the input field.
|
956
|
+
*/
|
957
|
+
enterTextInLimitNumberOfResponsesInputField: (value) => {
|
958
|
+
numberLinePage.limitNumbersOfResponsesInputField()
|
959
|
+
.clear()
|
960
|
+
.type(value);
|
961
|
+
},
|
962
|
+
|
963
|
+
/**
|
964
|
+
* Verifies that the input field has the specified value.
|
965
|
+
* @param {number} value - The expected value of the input field
|
966
|
+
*/
|
967
|
+
verifyTextInLimitNumberOfResponsesInputField: (value) => {
|
968
|
+
numberLinePage.limitNumbersOfResponsesInputField()
|
969
|
+
.should('have.value', value);
|
970
|
+
},
|
971
|
+
|
972
|
+
/**
|
973
|
+
* @description Verify that the specified checkbox is checked.
|
974
|
+
* @param {('Stagger response'|'Show labels'|'Show ticks'|'Show min'|'Show max'|'Limit number of responses'|'Show min arrow'|'Show max arrow'|'Stack responses')} checkboxName - The name of the checkbox to verify.
|
975
|
+
*/
|
976
|
+
verifyCheckboxChecked: (checkboxName) => {
|
977
|
+
switch (checkboxName) {
|
978
|
+
case 'Show min arrow':
|
979
|
+
numberLinePage.showMinArrowCheckbox()
|
980
|
+
.should('be.checked');
|
981
|
+
break;
|
982
|
+
case 'Show max arrow':
|
983
|
+
numberLinePage.showMaxArrowCheckbox()
|
984
|
+
.should('be.checked');
|
985
|
+
break;
|
986
|
+
case 'Stack responses':
|
987
|
+
numberLinePage.stackResponsesCheckbox()
|
988
|
+
.should('be.checked');
|
989
|
+
break;
|
990
|
+
case 'Stagger response':
|
991
|
+
numberLinePage.staggerResponseCheckbox()
|
992
|
+
.should('be.checked');
|
993
|
+
break;
|
994
|
+
case 'Show labels':
|
995
|
+
numberLinePage.showLabelsCheckbox()
|
996
|
+
.should('be.checked');
|
997
|
+
break;
|
998
|
+
case 'Show ticks':
|
999
|
+
numberLinePage.showTicksCheckbox()
|
1000
|
+
.should('be.checked');
|
1001
|
+
break;
|
1002
|
+
case 'Show min':
|
1003
|
+
numberLinePage.showMinCheckbox()
|
1004
|
+
.should('be.checked');
|
1005
|
+
break;
|
1006
|
+
case 'Show max':
|
1007
|
+
numberLinePage.showMaxCheckbox()
|
1008
|
+
.should('be.checked');
|
1009
|
+
break;
|
1010
|
+
case 'Limit number of responses':
|
1011
|
+
numberLinePage.limitNumbersOfResponsesCheckbox()
|
1012
|
+
.should('be.checked');
|
1013
|
+
break;
|
1014
|
+
default:
|
1015
|
+
throw new Error('invalid state string');
|
1016
|
+
}
|
1017
|
+
},
|
1018
|
+
|
1019
|
+
/**
|
1020
|
+
* @description Verify that the specified checkbox is unchecked.
|
1021
|
+
* @param {('Stagger response'|'Show labels'|'Show ticks'|'Show min'|'Show max'|'Limit number of responses'|'Show min arrow'|'Show max arrow'|'Stack responses')} checkboxName - The name of the checkbox to verify.
|
1022
|
+
*/
|
1023
|
+
verifyCheckboxUnchecked: (checkboxName) => {
|
1024
|
+
switch (checkboxName) {
|
1025
|
+
case 'Show min arrow':
|
1026
|
+
numberLinePage.showMinArrowCheckbox()
|
1027
|
+
.should('not.be.checked');
|
1028
|
+
break;
|
1029
|
+
case 'Show max arrow':
|
1030
|
+
numberLinePage.showMaxArrowCheckbox()
|
1031
|
+
.should('not.be.checked');
|
1032
|
+
break;
|
1033
|
+
case 'Stack responses':
|
1034
|
+
numberLinePage.stackResponsesCheckbox()
|
1035
|
+
.should('not.be.checked');
|
1036
|
+
break;
|
1037
|
+
case 'Stagger response':
|
1038
|
+
numberLinePage.staggerResponseCheckbox()
|
1039
|
+
.should('not.be.checked');
|
1040
|
+
break;
|
1041
|
+
case 'Show labels':
|
1042
|
+
numberLinePage.showLabelsCheckbox()
|
1043
|
+
.should('not.be.checked');
|
1044
|
+
break;
|
1045
|
+
case 'Show ticks':
|
1046
|
+
numberLinePage.showTicksCheckbox()
|
1047
|
+
.should('not.be.checked');
|
1048
|
+
break;
|
1049
|
+
case 'Show min':
|
1050
|
+
numberLinePage.showMinCheckbox()
|
1051
|
+
.should('not.be.checked');
|
1052
|
+
break;
|
1053
|
+
case 'Show max':
|
1054
|
+
numberLinePage.showMaxCheckbox()
|
1055
|
+
.should('not.be.checked');
|
1056
|
+
break;
|
1057
|
+
case 'Limit number of responses':
|
1058
|
+
numberLinePage.limitNumbersOfResponsesCheckbox()
|
1059
|
+
.should('not.be.checked');
|
1060
|
+
break;
|
1061
|
+
default:
|
1062
|
+
throw new Error('invalid state string');
|
1063
|
+
}
|
1064
|
+
},
|
1065
|
+
|
1066
|
+
/**
|
1067
|
+
*@description Checks the specified checkbox
|
1068
|
+
* @param {('Stagger response'|'Show labels'|'Show ticks'|'Show min'|'Show max'|'Limit number of responses'|'Show min arrow'|'Show max arrow'|'Stack responses')} checkboxName - The name of the checkbox.
|
1069
|
+
*/
|
1070
|
+
checkCheckbox: (checkboxName) => {
|
1071
|
+
switch (checkboxName) {
|
1072
|
+
case 'Show min arrow':
|
1073
|
+
numberLinePage.showMinArrowCheckbox()
|
1074
|
+
.click()
|
1075
|
+
.should('be.checked');
|
1076
|
+
break;
|
1077
|
+
case 'Show max arrow':
|
1078
|
+
numberLinePage.showMaxArrowCheckbox()
|
1079
|
+
.click()
|
1080
|
+
.should('be.checked');
|
1081
|
+
break;
|
1082
|
+
case 'Stack responses':
|
1083
|
+
numberLinePage.stackResponsesCheckbox()
|
1084
|
+
.click()
|
1085
|
+
.should('be.checked');
|
1086
|
+
break;
|
1087
|
+
case 'Stagger response':
|
1088
|
+
numberLinePage.staggerResponseCheckbox()
|
1089
|
+
.click()
|
1090
|
+
.should('be.checked');
|
1091
|
+
break;
|
1092
|
+
case 'Show labels':
|
1093
|
+
numberLinePage.showLabelsCheckbox()
|
1094
|
+
.click()
|
1095
|
+
.should('be.checked');
|
1096
|
+
break;
|
1097
|
+
case 'Show ticks':
|
1098
|
+
numberLinePage.showTicksCheckbox()
|
1099
|
+
.click()
|
1100
|
+
.should('be.checked');
|
1101
|
+
break;
|
1102
|
+
case 'Show min':
|
1103
|
+
numberLinePage.showMinCheckbox()
|
1104
|
+
.click()
|
1105
|
+
.should('be.checked');
|
1106
|
+
break;
|
1107
|
+
case 'Show max':
|
1108
|
+
numberLinePage.showMaxCheckbox()
|
1109
|
+
.click()
|
1110
|
+
.should('be.checked');
|
1111
|
+
break;
|
1112
|
+
case 'Limit number of responses':
|
1113
|
+
numberLinePage.limitNumbersOfResponsesCheckbox()
|
1114
|
+
.click()
|
1115
|
+
.should('be.checked');
|
1116
|
+
break;
|
1117
|
+
default:
|
1118
|
+
throw new Error('invalid state string');
|
1119
|
+
}
|
1120
|
+
},
|
1121
|
+
|
1122
|
+
/**
|
1123
|
+
*@description Unhecks the specified checkbox
|
1124
|
+
* @param {('Stagger response'|'Show labels'|'Show ticks'|'Show min'|'Show max'|'Limit number of responses'|'Show min arrow'|'Show max arrow'|'Stack responses')} checkboxName - The name of the checkbox.
|
1125
|
+
*/
|
1126
|
+
uncheckCheckbox: (checkboxName) => {
|
1127
|
+
switch (checkboxName) {
|
1128
|
+
case 'Show min arrow':
|
1129
|
+
numberLinePage.showMinArrowCheckbox()
|
1130
|
+
.click()
|
1131
|
+
.should('not.be.checked');
|
1132
|
+
break;
|
1133
|
+
case 'Show max arrow':
|
1134
|
+
numberLinePage.showMaxArrowCheckbox()
|
1135
|
+
.click()
|
1136
|
+
.should('not.be.checked');
|
1137
|
+
break;
|
1138
|
+
case 'Stack responses':
|
1139
|
+
numberLinePage.stackResponsesCheckbox()
|
1140
|
+
.click()
|
1141
|
+
.should('not.be.checked');
|
1142
|
+
break;
|
1143
|
+
case 'Stagger response':
|
1144
|
+
numberLinePage.staggerResponseCheckbox()
|
1145
|
+
.click()
|
1146
|
+
.should('not.be.checked');
|
1147
|
+
break;
|
1148
|
+
case 'Show labels':
|
1149
|
+
numberLinePage.showLabelsCheckbox()
|
1150
|
+
.click()
|
1151
|
+
.should('not.be.checked');
|
1152
|
+
break;
|
1153
|
+
case 'Show ticks':
|
1154
|
+
numberLinePage.showTicksCheckbox()
|
1155
|
+
.click()
|
1156
|
+
.should('not.be.checked');
|
1157
|
+
break;
|
1158
|
+
case 'Show min':
|
1159
|
+
numberLinePage.showMinCheckbox()
|
1160
|
+
.click()
|
1161
|
+
.should('not.be.checked');
|
1162
|
+
break;
|
1163
|
+
case 'Show max':
|
1164
|
+
numberLinePage.showMaxCheckbox()
|
1165
|
+
.click()
|
1166
|
+
.should('not.be.checked');
|
1167
|
+
break;
|
1168
|
+
case 'Limit number of responses':
|
1169
|
+
numberLinePage.limitNumbersOfResponsesCheckbox()
|
1170
|
+
.click()
|
1171
|
+
.should('not.be.checked');
|
1172
|
+
break;
|
1173
|
+
default:
|
1174
|
+
throw new Error('invalid state string');
|
1175
|
+
}
|
1176
|
+
},
|
1177
|
+
|
1178
|
+
/**
|
1179
|
+
* Clicks on the orientation toggle button with the specified ARIA label and verifies it is selected.
|
1180
|
+
* @param {string} ariaLabel - The ARIA label of the orientation toggle button to select.
|
1181
|
+
*/
|
1182
|
+
selectOrientationToggleButton: (ariaLabel) => {
|
1183
|
+
numberLinePage.orientationToggleButton(ariaLabel)
|
1184
|
+
.click();
|
1185
|
+
steps.verifyOrientationToggleButtonSelected(ariaLabel);
|
1186
|
+
},
|
1187
|
+
|
1188
|
+
/**
|
1189
|
+
* Verifies that the toggle button with the specified ARIA label is selected.
|
1190
|
+
* @param {string} ariaLabel - The ARIA label of the toggle button to verify.
|
1191
|
+
*/
|
1192
|
+
verifyOrientationToggleButtonSelected: (ariaLabel) => {
|
1193
|
+
numberLinePage.orientationToggleButton(ariaLabel)
|
1194
|
+
.should('have.attr', 'aria-pressed', 'true');
|
1195
|
+
},
|
1196
|
+
|
1197
|
+
/**
|
1198
|
+
* Verifies that the toggle button with the specified ARIA label is unselected.
|
1199
|
+
* @param {string} ariaLabel - The ARIA label of the toggle button to verify.
|
1200
|
+
*/
|
1201
|
+
verifyOrientationToggleButtonUnselected: (ariaLabel) => {
|
1202
|
+
numberLinePage.orientationToggleButton(ariaLabel)
|
1203
|
+
.should('have.attr', 'aria-pressed', 'false');
|
1204
|
+
},
|
1205
|
+
|
1206
|
+
/**
|
1207
|
+
* Verifies the orientation and size of the number line section.
|
1208
|
+
* @param {string} orientation - The orientation of the number line section ('Horizontal' or 'Vertical').
|
1209
|
+
* @param {string} value - The value representing the width or height of the number line section.
|
1210
|
+
*/
|
1211
|
+
verifyNumberLineOrientationAndSizeNumberLineSection: (orientation, value) => {
|
1212
|
+
const isHorizontal = orientation === 'Horizontal';
|
1213
|
+
const width = isHorizontal ? value : '120';
|
1214
|
+
const height = isHorizontal ? '120' : value;
|
1215
|
+
numberLinePage.numberLineNumberLineSection()
|
1216
|
+
.should('have.attr', 'width', width)
|
1217
|
+
.and('have.attr', 'height', height);
|
1218
|
+
},
|
1219
|
+
|
1220
|
+
/**
|
1221
|
+
* Verifies the orientation and size of the specify correct answer section.
|
1222
|
+
* @param {string} orientation - The orientation of the specify correct answer section ('Horizontal' or 'Vertical').
|
1223
|
+
* @param {string} value - The value representing the width or height of the specify correct answer section.
|
1224
|
+
*/
|
1225
|
+
verifyNumberLineOrientationAndSizeSpecifyCorrectAnswerSection: (orientation, value) => {
|
1226
|
+
const isHorizontal = orientation === 'Horizontal';
|
1227
|
+
const width = isHorizontal ? value : '120';
|
1228
|
+
const height = isHorizontal ? '120' : value;
|
1229
|
+
numberLinePage.numberLineSpecifyCorrectAnswer()
|
1230
|
+
.should('have.attr', 'width', width)
|
1231
|
+
.and('have.attr', 'height', height);
|
1232
|
+
},
|
1233
|
+
|
1234
|
+
/**
|
1235
|
+
* Verifies the orientation and size of the preview tab of the number line.
|
1236
|
+
* @param {string} orientation - The orientation of the preview tab ('Horizontal' or 'Vertical').
|
1237
|
+
* @param {string} value - The value representing the width or height of the preview tab.
|
1238
|
+
*/
|
1239
|
+
verifyNumberLineOrientationAndSizePreviewTab: (orientation, value) => {
|
1240
|
+
const isHorizontal = orientation === 'Horizontal';
|
1241
|
+
const width = isHorizontal ? value : '120';
|
1242
|
+
const height = isHorizontal ? '120' : value;
|
1243
|
+
numberLinePage.numberLinePreviewTab()
|
1244
|
+
.should('have.attr', 'width', width)
|
1245
|
+
.and('have.attr', 'height', height);
|
1246
|
+
},
|
1247
|
+
|
1248
|
+
/**
|
1249
|
+
* Verifies the margin for the specify correct answer section of the number line.
|
1250
|
+
* @param {number} value - The expected margin value in pixels.
|
1251
|
+
*/
|
1252
|
+
verifyMarginForNumberLineSpecifyCorrectAnswerSection: (value) => {
|
1253
|
+
numberLinePage.numberLineSpecifyCorrectAnswer()
|
1254
|
+
.parents('[class*="LineGraphstyles__GraphContainer"]')
|
1255
|
+
.should('have.css', 'padding', `${value}px`);
|
1256
|
+
},
|
1257
|
+
|
1258
|
+
/**
|
1259
|
+
* Verifies the margin for the preview tab of the number line.
|
1260
|
+
* @param {number} value - The expected margin value in pixels.
|
1261
|
+
*/
|
1262
|
+
verifyMarginForNumberLinePreviewTab: (value) => {
|
1263
|
+
numberLinePage.numberLinePreviewTab()
|
1264
|
+
.parents('[class*="LineGraphstyles__GraphContainer"]')
|
1265
|
+
.should('have.css', 'padding', `${value}px`);
|
1266
|
+
},
|
1267
|
+
|
1268
|
+
/**
|
1269
|
+
* Verifies the response spacing for the specify correct answer section of the number line.
|
1270
|
+
* @param {string} orientation - The orientation of the number line ('Horizontal' or 'Vertical').
|
1271
|
+
* @param {number} value - The expected response spacing value.
|
1272
|
+
*/
|
1273
|
+
verifyResponseSpacingSpecifyCorrectAnswerSection: (orientation, value) => {
|
1274
|
+
const attribute = orientation === 'Horizontal' ? 'height' : 'width';
|
1275
|
+
numberLinePage.numberLineSpecifyCorrectAnswer()
|
1276
|
+
.should('have.attr', attribute, value * 4);
|
1277
|
+
},
|
1278
|
+
|
1279
|
+
/**
|
1280
|
+
* Verifies the response spacing for the preview tab of the number line.
|
1281
|
+
* @param {string} orientation - The orientation of the number line ('Horizontal' or 'Vertical').
|
1282
|
+
* @param {number} value - The expected response spacing value.
|
1283
|
+
*/
|
1284
|
+
verifyResponseSpacingPreviewTab: (orientation, value) => {
|
1285
|
+
const attribute = orientation === 'Horizontal' ? 'height' : 'width';
|
1286
|
+
numberLinePage.numberLinePreviewTab()
|
1287
|
+
.should('have.attr', attribute, value * 4);
|
1288
|
+
},
|
1289
|
+
|
1290
|
+
/**
|
1291
|
+
* Verifies the visibility of the minimum arrow .
|
1292
|
+
* @param {string} visibility - The expected visibility ('visible' or 'hidden').
|
1293
|
+
* @throws {Error} Throws an error if the provided visibility string is invalid.
|
1294
|
+
*/
|
1295
|
+
verifyMinArrowVisibilitySpecifyCorrectAnswerSection: (visibility) => {
|
1296
|
+
if (visibility === 'visible') {
|
1297
|
+
numberLinePage.numberLineAxisSpecifyCorrectAnswer()
|
1298
|
+
.should('have.attr', 'marker-start');
|
1299
|
+
}
|
1300
|
+
else if (visibility === 'hidden') {
|
1301
|
+
numberLinePage.numberLineAxisSpecifyCorrectAnswer()
|
1302
|
+
.should('not.have.attr', 'marker-start');
|
1303
|
+
}
|
1304
|
+
else {
|
1305
|
+
throw new Error('invalid state string');
|
1306
|
+
}
|
1307
|
+
},
|
1308
|
+
|
1309
|
+
/**
|
1310
|
+
* Verifies the visibility of the minimum arrow
|
1311
|
+
* @param {string} visibility - The expected visibility ('visible' or 'hidden').
|
1312
|
+
* @throws {Error} Throws an error if the provided visibility string is invalid.
|
1313
|
+
*/
|
1314
|
+
verifyMinArrowVisibilityNumberLineSection: (visibility) => {
|
1315
|
+
if (visibility === 'visible') {
|
1316
|
+
numberLinePage.numberLineAxisNumberLineSection()
|
1317
|
+
.should('have.attr', 'marker-start');
|
1318
|
+
}
|
1319
|
+
else if (visibility === 'hidden') {
|
1320
|
+
numberLinePage.numberLineAxisNumberLineSection()
|
1321
|
+
.should('not.have.attr', 'marker-start');
|
1322
|
+
}
|
1323
|
+
else {
|
1324
|
+
throw new Error('invalid state string');
|
1325
|
+
}
|
1326
|
+
},
|
1327
|
+
|
1328
|
+
/**
|
1329
|
+
* Verifies the visibility of the minimum arrow
|
1330
|
+
* @param {string} visibility - The expected visibility ('visible' or 'hidden').
|
1331
|
+
* @throws {Error} Throws an error if the provided visibility string is invalid.
|
1332
|
+
*/
|
1333
|
+
verifyMinArrowVisibilityPreviewTab: (visibility) => {
|
1334
|
+
if (visibility === 'visible') {
|
1335
|
+
numberLinePage.numberLineAxisPreviewTab()
|
1336
|
+
.should('have.attr', 'marker-start');
|
1337
|
+
}
|
1338
|
+
else if (visibility === 'hidden') {
|
1339
|
+
numberLinePage.numberLineAxisPreviewTab()
|
1340
|
+
.should('not.have.attr', 'marker-start');
|
1341
|
+
}
|
1342
|
+
else {
|
1343
|
+
throw new Error('invalid state string');
|
1344
|
+
}
|
1345
|
+
},
|
1346
|
+
|
1347
|
+
/**
|
1348
|
+
* Verifies the visibility of the maximum arrow
|
1349
|
+
* @param {string} visibility - The expected visibility ('visible' or 'hidden').
|
1350
|
+
* @throws {Error} Throws an error if the provided visibility string is invalid.
|
1351
|
+
*/
|
1352
|
+
verifyMaxArrowVisibilitySpecifyCorrectAnswerSection: (visibility) => {
|
1353
|
+
if (visibility === 'visible') {
|
1354
|
+
numberLinePage.numberLineAxisSpecifyCorrectAnswer()
|
1355
|
+
.should('have.attr', 'marker-end');
|
1356
|
+
}
|
1357
|
+
else if (visibility === 'hidden') {
|
1358
|
+
numberLinePage.numberLineAxisSpecifyCorrectAnswer()
|
1359
|
+
.should('not.have.attr', 'marker-end');
|
1360
|
+
}
|
1361
|
+
else {
|
1362
|
+
throw new Error('invalid state string');
|
1363
|
+
}
|
1364
|
+
},
|
1365
|
+
|
1366
|
+
/**
|
1367
|
+
* Verifies the visibility of the maximum arrow
|
1368
|
+
* @param {string} visibility - The expected visibility ('visible' or 'hidden').
|
1369
|
+
* @throws {Error} Throws an error if the provided visibility string is invalid.
|
1370
|
+
*/
|
1371
|
+
verifyMaxArrowVisibilityNumberLineSection: (visibility) => {
|
1372
|
+
if (visibility === 'visible') {
|
1373
|
+
numberLinePage.numberLineAxisNumberLineSection()
|
1374
|
+
.should('have.attr', 'marker-end');
|
1375
|
+
}
|
1376
|
+
else if (visibility === 'hidden') {
|
1377
|
+
numberLinePage.numberLineAxisNumberLineSection()
|
1378
|
+
.should('not.have.attr', 'marker-end');
|
1379
|
+
}
|
1380
|
+
else {
|
1381
|
+
throw new Error('invalid state string');
|
1382
|
+
}
|
1383
|
+
},
|
1384
|
+
|
1385
|
+
/**
|
1386
|
+
* Verifies the visibility of the maximum arrow
|
1387
|
+
* @param {string} visibility - The expected visibility ('visible' or 'hidden').
|
1388
|
+
* @throws {Error} Throws an error if the provided visibility string is invalid.
|
1389
|
+
*/
|
1390
|
+
verifyMaxArrowVisibilityPreviewTab: (visibility) => {
|
1391
|
+
if (visibility === 'visible') {
|
1392
|
+
numberLinePage.numberLineAxisPreviewTab()
|
1393
|
+
.should('have.attr', 'marker-end');
|
1394
|
+
}
|
1395
|
+
else if (visibility === 'hidden') {
|
1396
|
+
numberLinePage.numberLineAxisPreviewTab()
|
1397
|
+
.should('not.have.attr', 'marker-end');
|
1398
|
+
}
|
1399
|
+
else {
|
1400
|
+
throw new Error('invalid state string');
|
1401
|
+
}
|
1402
|
+
},
|
1403
|
+
|
1404
|
+
/**
|
1405
|
+
* Verifies the visibility and text of labels on the specify correct answer section of the number line.
|
1406
|
+
* @param {string} value - The initial value of the labels.
|
1407
|
+
* @param {number} interval - The interval between consecutive labels.
|
1408
|
+
*/
|
1409
|
+
verifyLabelsVisibleOnNumberLineSpecifyCorrectAnswerSection: (value, interval) => {
|
1410
|
+
cy.wait(3000)
|
1411
|
+
numberLinePage.numberLineSpecifyCorrectAnswer()
|
1412
|
+
.parents('.ngie-jxgbox')
|
1413
|
+
.find('.JXGtext')
|
1414
|
+
.its('length').then((len) => {
|
1415
|
+
for (let index = 0; index < len; index++) {
|
1416
|
+
numberLinePage.numberLineSpecifyCorrectAnswer()
|
1417
|
+
.parents('.ngie-jxgbox')
|
1418
|
+
.find('.JXGtext')
|
1419
|
+
.eq(index)
|
1420
|
+
.should('have.text', value);
|
1421
|
+
value += interval;
|
1422
|
+
}
|
1423
|
+
});
|
1424
|
+
},
|
1425
|
+
|
1426
|
+
/**
|
1427
|
+
* Verifies the visibility and text of labels on the number line section.
|
1428
|
+
* @param {string} value - The initial value of the labels.
|
1429
|
+
* @param {number} interval - The interval between consecutive labels.
|
1430
|
+
*/
|
1431
|
+
verifyLabelsVisibleOnNumberLineNumberLineSection: (value, interval) => {
|
1432
|
+
cy.wait(3000);
|
1433
|
+
numberLinePage.numberLineNumberLineSection()
|
1434
|
+
.parents('.ngie-jxgbox')
|
1435
|
+
.find('.JXGtext')
|
1436
|
+
.its('length').then((len) => {
|
1437
|
+
for (let index = 0; index < len; index++) {
|
1438
|
+
numberLinePage.numberLineNumberLineSection()
|
1439
|
+
.parents('.ngie-jxgbox')
|
1440
|
+
.find('.JXGtext')
|
1441
|
+
.eq(index)
|
1442
|
+
.should('have.text', value);
|
1443
|
+
value += interval;
|
1444
|
+
}
|
1445
|
+
});
|
1446
|
+
},
|
1447
|
+
|
1448
|
+
/**
|
1449
|
+
* Verifies the visibility and text of labels on the preview tab of the number line.
|
1450
|
+
* @param {string} value - The initial value of the labels.
|
1451
|
+
* @param {number} interval - The interval between consecutive labels.
|
1452
|
+
*/
|
1453
|
+
verifyLabelsVisibleOnNumberLinePreviewTab: (value, interval) => {
|
1454
|
+
numberLinePage.numberLinePreviewTab()
|
1455
|
+
.parents('.ngie-jxgbox')
|
1456
|
+
.find('.JXGtext')
|
1457
|
+
.its('length').then((len) => {
|
1458
|
+
for (let index = 0; index < len; index++) {
|
1459
|
+
numberLinePage.numberLinePreviewTab()
|
1460
|
+
.parents('.ngie-jxgbox')
|
1461
|
+
.find('.JXGtext')
|
1462
|
+
.eq(index)
|
1463
|
+
.should('have.text', value);
|
1464
|
+
value += interval;
|
1465
|
+
}
|
1466
|
+
});
|
1467
|
+
},
|
1468
|
+
|
1469
|
+
|
1470
|
+
verifyLabelsNotVisibleOnNumberLinePreviewTab: () => {
|
1471
|
+
numberLinePage.numberLinePreviewTab()
|
1472
|
+
.parents('.ngie-jxgbox')
|
1473
|
+
.find('.JXGtext')
|
1474
|
+
.should('not.exist');
|
1475
|
+
},
|
1476
|
+
|
1477
|
+
verifyLabelsNotVisibleOnNumberLineSpecifyCorrectAnswerSection: () => {
|
1478
|
+
numberLinePage.numberLineSpecifyCorrectAnswer()
|
1479
|
+
.parents('.ngie-jxgbox')
|
1480
|
+
.find('.JXGtext')
|
1481
|
+
.should('not.exist');
|
1482
|
+
},
|
1483
|
+
|
1484
|
+
verifyLabelsNotVisibleOnNumberLineNumberLineSection: () => {
|
1485
|
+
numberLinePage.numberLineNumberLineSection()
|
1486
|
+
.parents('.ngie-jxgbox')
|
1487
|
+
.find('.JXGtext')
|
1488
|
+
.should('not.exist');
|
1489
|
+
},
|
1490
|
+
|
1491
|
+
clickOnToolOptionsSpecifyCorrectAnswer: () => {
|
1492
|
+
cy.log('Clicking on control options to remove error message');
|
1493
|
+
numberLinePage.numberLineToolOptionSpecifyCorrectAnswer()
|
1494
|
+
.parents('.graph-tools-wrapper')
|
1495
|
+
.click();
|
1496
|
+
},
|
1497
|
+
|
1498
|
+
clickOnToolOptionsPreviewTab: () => {
|
1499
|
+
cy.log('Clicking on control options to remove error message');
|
1500
|
+
numberLinePage.numberLineToolOptionPreviewTab()
|
1501
|
+
.parents('.graph-tools-wrapper')
|
1502
|
+
.click();
|
1503
|
+
},
|
1504
|
+
|
1505
|
+
/**
|
1506
|
+
* Enters the specified value into the input field.
|
1507
|
+
* @param {number} value - The value to enter into the input field.
|
1508
|
+
*/
|
1509
|
+
enterTextInMinInputField: (value) => {
|
1510
|
+
numberLinePage.minInputField()
|
764
1511
|
.clear()
|
765
1512
|
.type(value)
|
766
|
-
.blur()
|
1513
|
+
.blur();
|
1514
|
+
},
|
1515
|
+
|
1516
|
+
/**
|
1517
|
+
* Verifies that the input field has the specified value.
|
1518
|
+
* @param {number} value - The expected value of the input field
|
1519
|
+
*/
|
1520
|
+
verifyTextInMinInputField: (value) => {
|
1521
|
+
numberLinePage.minInputField()
|
1522
|
+
.should('have.value', value);
|
1523
|
+
},
|
1524
|
+
|
1525
|
+
/**
|
1526
|
+
* Enters the specified value into the input field.
|
1527
|
+
* @param {number} value - The value to enter into the input field.
|
1528
|
+
*/
|
1529
|
+
enterTextInMaxInputField: (value) => {
|
1530
|
+
numberLinePage.maxInputField()
|
1531
|
+
.clear()
|
1532
|
+
.type(value);
|
1533
|
+
},
|
1534
|
+
|
1535
|
+
/**
|
1536
|
+
* Verifies that the input field has the specified value.
|
1537
|
+
* @param {number} value - The expected value of the input field
|
1538
|
+
*/
|
1539
|
+
verifyTextInMaxInputField: (value) => {
|
1540
|
+
numberLinePage.maxInputField()
|
1541
|
+
.should('have.value', value);
|
1542
|
+
},
|
1543
|
+
|
1544
|
+
/**
|
1545
|
+
* Enters the specified value into the input field.
|
1546
|
+
* @param {number} value - The value to enter into the input field.
|
1547
|
+
*/
|
1548
|
+
enterTextInIntervalInputField: (value) => {
|
1549
|
+
numberLinePage.intervalInputField()
|
1550
|
+
.clear()
|
1551
|
+
.type(value);
|
1552
|
+
},
|
1553
|
+
|
1554
|
+
/**
|
1555
|
+
* Verifies that the input field has the specified value.
|
1556
|
+
* @param {number} value - The expected value of the input field
|
1557
|
+
*/
|
1558
|
+
verifyTextInIntervalInputField: (value) => {
|
1559
|
+
numberLinePage.intervalInputField()
|
1560
|
+
.should('have.value', value);
|
1561
|
+
},
|
1562
|
+
|
1563
|
+
/**
|
1564
|
+
* Enters the specified value into the input field.
|
1565
|
+
* @param {number} value - The value to enter into the input field.
|
1566
|
+
*/
|
1567
|
+
enterTextInAnnotateEveryInputField: (value) => {
|
1568
|
+
numberLinePage.annotateEveryInputField()
|
1569
|
+
.clear()
|
1570
|
+
.type(value);
|
1571
|
+
},
|
1572
|
+
|
1573
|
+
/**
|
1574
|
+
* Verifies that the input field has the specified value.
|
1575
|
+
* @param {number} value - The expected value of the input field
|
1576
|
+
*/
|
1577
|
+
verifyTextInAnnotateEveryInputField: (value) => {
|
1578
|
+
numberLinePage.annotateEveryInputField()
|
1579
|
+
.should('have.value', value);
|
1580
|
+
},
|
1581
|
+
|
1582
|
+
/**
|
1583
|
+
* Enters the specified value into the input field.
|
1584
|
+
* @param {number} value - The value to enter into the input field.
|
1585
|
+
*/
|
1586
|
+
enterTextInDisplaySpecificAnnotationInputField: (value) => {
|
1587
|
+
numberLinePage.displaySpecificAnnotationInputField()
|
1588
|
+
.clear()
|
1589
|
+
.type(value);
|
1590
|
+
},
|
1591
|
+
|
1592
|
+
/**
|
1593
|
+
* Verifies that the input field has the specified value.
|
1594
|
+
* @param {number} value - The expected value of the input field
|
1595
|
+
*/
|
1596
|
+
verifyTextInDisplaySpecificAnnotationInputField: (value) => {
|
1597
|
+
numberLinePage.displaySpecificAnnotationInputField()
|
1598
|
+
.should('have.value', value);
|
1599
|
+
},
|
1600
|
+
|
1601
|
+
/**
|
1602
|
+
* Clicks on the toggle button with the specified ARIA label and verifies it is selected.
|
1603
|
+
* @param {string} ariaLabel - The ARIA label of the toggle button to select.
|
1604
|
+
*/
|
1605
|
+
selectDisplayNumbersToggleButton: (ariaLabel) => {
|
1606
|
+
numberLinePage.displayNumbersToggleButton(ariaLabel)
|
1607
|
+
.click();
|
1608
|
+
steps.verifyDisplayNumbersToggleButtonSelected(ariaLabel);
|
1609
|
+
},
|
1610
|
+
|
1611
|
+
/**
|
1612
|
+
* Verifies that the toggle button with the specified ARIA label is selected.
|
1613
|
+
* @param {string} ariaLabel - The ARIA label of the toggle button to verify.
|
1614
|
+
*/
|
1615
|
+
verifyDisplayNumbersToggleButtonSelected: (ariaLabel) => {
|
1616
|
+
numberLinePage.displayNumbersToggleButton(ariaLabel)
|
1617
|
+
.should('have.attr', 'aria-pressed', 'true');
|
1618
|
+
},
|
1619
|
+
|
1620
|
+
/**
|
1621
|
+
* Verifies that the toggle button with the specified ARIA label is unselected.
|
1622
|
+
* @param {string} ariaLabel - The ARIA label of the toggle button to verify.
|
1623
|
+
*/
|
1624
|
+
verifyDisplayNumbersToggleButtonUnselected: (ariaLabel) => {
|
1625
|
+
numberLinePage.displayNumbersToggleButton(ariaLabel)
|
1626
|
+
.should('have.attr', 'aria-pressed', 'false');
|
1627
|
+
},
|
1628
|
+
|
1629
|
+
/**
|
1630
|
+
* Clicks on the toggle button with the specified ARIA label and verifies it is selected.
|
1631
|
+
* @param {string} ariaLabel - The ARIA label of the toggle button to select.
|
1632
|
+
*/
|
1633
|
+
selectLineSettingsToggleButton: (ariaLabel) => {
|
1634
|
+
numberLinePage.lineSettingsToggleButton(ariaLabel)
|
1635
|
+
.click();
|
1636
|
+
steps.verifyLineSettingsToggleButtonSelected(ariaLabel);
|
1637
|
+
},
|
1638
|
+
|
1639
|
+
/**
|
1640
|
+
* Verifies that the toggle button with the specified ARIA label is selected.
|
1641
|
+
* @param {string} ariaLabel - The ARIA label of the toggle button to verify.
|
1642
|
+
*/
|
1643
|
+
verifyLineSettingsToggleButtonSelected: (ariaLabel) => {
|
1644
|
+
numberLinePage.lineSettingsToggleButton(ariaLabel)
|
1645
|
+
.should('have.attr', 'aria-pressed', 'true');
|
1646
|
+
},
|
1647
|
+
|
1648
|
+
/**
|
1649
|
+
* Verifies that the toggle button with the specified ARIA label is unselected.
|
1650
|
+
* @param {string} ariaLabel - The ARIA label of the toggle button to verify.
|
1651
|
+
*/
|
1652
|
+
verifyLineSettingsToggleButtonUnselected: (ariaLabel) => {
|
1653
|
+
numberLinePage.lineSettingsToggleButton(ariaLabel)
|
1654
|
+
.should('have.attr', 'aria-pressed', 'false');
|
1655
|
+
},
|
1656
|
+
|
1657
|
+
|
1658
|
+
/**
|
1659
|
+
* Verifies the label on the number line.
|
1660
|
+
* @param {Array} values - An array of objects containing the value and index of each label.
|
1661
|
+
*/
|
1662
|
+
verifyLabelOnNumberLineSpecifyCorrectAnswerSection: (values) => {
|
1663
|
+
values.forEach(({ value, index }) => {
|
1664
|
+
numberLinePage.numberLineSpecifyCorrectAnswer()
|
1665
|
+
.parents('.ngie-jxgbox')
|
1666
|
+
.find('.JXGtext')
|
1667
|
+
.eq(index)
|
1668
|
+
.then(($el) => {
|
1669
|
+
const innerText = $el[0].innerText;
|
1670
|
+
expect(innerText.trim()).to.equal(value.toString());
|
1671
|
+
});
|
1672
|
+
});
|
1673
|
+
},
|
1674
|
+
|
1675
|
+
/**
|
1676
|
+
* Verifies the label on the number line.
|
1677
|
+
* @param {Array} values - An array of objects containing the value and index of each label.
|
1678
|
+
*/
|
1679
|
+
verifyLabelOnNumberLineNumberLineSection: (values) => {
|
1680
|
+
values.forEach(({ value, index }) => {
|
1681
|
+
numberLinePage.numberLineNumberLineSection()
|
1682
|
+
.parents('.ngie-jxgbox')
|
1683
|
+
.find('.JXGtext')
|
1684
|
+
.eq(index)
|
1685
|
+
.then(($el) => {
|
1686
|
+
const innerText = $el[0].innerText;
|
1687
|
+
expect(innerText.trim()).to.equal(value.toString());
|
1688
|
+
});
|
1689
|
+
});
|
1690
|
+
},
|
1691
|
+
|
1692
|
+
/**
|
1693
|
+
* Verifies the label on the number line.
|
1694
|
+
* @param {Array} values - An array of objects containing the value and index of each label.
|
1695
|
+
*/
|
1696
|
+
verifyLabelOnNumberLinePreviewTab: (values) => {
|
1697
|
+
values.forEach(({ value, index }) => {
|
1698
|
+
numberLinePage.numberLinePreviewTab()
|
1699
|
+
.parents('.ngie-jxgbox')
|
1700
|
+
.find('.JXGtext')
|
1701
|
+
.eq(index)
|
1702
|
+
.then(($el) => {
|
1703
|
+
const innerText = $el[0].innerText;
|
1704
|
+
expect(innerText.trim()).to.equal(value.toString());
|
1705
|
+
});
|
1706
|
+
});
|
1707
|
+
},
|
1708
|
+
|
1709
|
+
/**
|
1710
|
+
* Verifies the display numbers orientation in the specify correct answer section of the number line.
|
1711
|
+
* @param {string} numberLineOrientation - The orientation of the number line ('Horizontal' or 'Vertical').
|
1712
|
+
* @param {string} numberOrientation - The orientation of the numbers ('Below' or 'Left').
|
1713
|
+
* @throws {Error} Thrown if the number line orientation is invalid.
|
1714
|
+
*/
|
1715
|
+
verifyDisplayNumbersOrientationSpecifyCorrectAnswerSection: (numberLineOrientation, numberOrientation) => {
|
1716
|
+
let property, value;
|
1717
|
+
switch (numberLineOrientation) {
|
1718
|
+
case 'Horizontal':
|
1719
|
+
property = numberOrientation === 'Below' ? 'top' : 'bottom';
|
1720
|
+
value = '83px';
|
1721
|
+
break;
|
1722
|
+
case 'Vertical':
|
1723
|
+
property = numberOrientation === 'Left' ? 'right' : 'left';
|
1724
|
+
value = '85px';
|
1725
|
+
break;
|
1726
|
+
default:
|
1727
|
+
throw new Error('Invalid Number line orientation');
|
1728
|
+
}
|
1729
|
+
numberLinePage.numberLineSpecifyCorrectAnswer()
|
1730
|
+
.parents('.ngie-jxgbox')
|
1731
|
+
.find('.JXGtext')
|
1732
|
+
.eq(0)
|
1733
|
+
.should('have.css', property, value);
|
1734
|
+
},
|
1735
|
+
|
1736
|
+
/**
|
1737
|
+
* Verifies the display numbers orientation in the number line section.
|
1738
|
+
* @param {string} numberLineOrientation - The orientation of the number line ('Horizontal' or 'Vertical').
|
1739
|
+
* @param {string} numberOrientation - The orientation of the numbers ('Below' or 'Left').
|
1740
|
+
* @throws {Error} Thrown if the number line orientation is invalid.
|
1741
|
+
*/
|
1742
|
+
verifyDisplayNumbersOrientationNumberLineSection: (numberLineOrientation, numberOrientation) => {
|
1743
|
+
let property, value;
|
1744
|
+
switch (numberLineOrientation) {
|
1745
|
+
case 'Horizontal':
|
1746
|
+
property = numberOrientation === 'Below' ? 'top' : 'bottom';
|
1747
|
+
value = '83px';
|
1748
|
+
break;
|
1749
|
+
case 'Vertical':
|
1750
|
+
property = numberOrientation === 'Left' ? 'right' : 'left';
|
1751
|
+
value = '85px';
|
1752
|
+
break;
|
1753
|
+
default:
|
1754
|
+
throw new Error('Invalid Number line orientation');
|
1755
|
+
}
|
1756
|
+
numberLinePage.numberLineNumberLineSection()
|
1757
|
+
.parents('.ngie-jxgbox')
|
1758
|
+
.find('.JXGtext')
|
1759
|
+
.eq(0)
|
1760
|
+
.should('have.css', property, value);
|
1761
|
+
},
|
1762
|
+
|
1763
|
+
/**
|
1764
|
+
* Verifies the display numbers orientation in the number line section.
|
1765
|
+
* @param {string} numberLineOrientation - The orientation of the number line ('Horizontal' or 'Vertical').
|
1766
|
+
* @param {string} numberOrientation - The orientation of the numbers ('Below' or 'Left').
|
1767
|
+
* @throws {Error} Thrown if the number line orientation is invalid.
|
1768
|
+
*/
|
1769
|
+
verifyDisplayNumbersOrientationPreviewTab: (numberLineOrientation, numberOrientation) => {
|
1770
|
+
let property, value;
|
1771
|
+
switch (numberLineOrientation) {
|
1772
|
+
case 'Horizontal':
|
1773
|
+
property = numberOrientation === 'Below' ? 'top' : 'bottom';
|
1774
|
+
value = '83px';
|
1775
|
+
break;
|
1776
|
+
case 'Vertical':
|
1777
|
+
property = numberOrientation === 'Left' ? 'right' : 'left';
|
1778
|
+
value = '85px';
|
1779
|
+
break;
|
1780
|
+
default:
|
1781
|
+
throw new Error('Invalid Number line orientation');
|
1782
|
+
}
|
1783
|
+
|
1784
|
+
numberLinePage.numberLinePreviewTab()
|
1785
|
+
.parents('.ngie-jxgbox')
|
1786
|
+
.find('.JXGtext')
|
1787
|
+
.eq(0)
|
1788
|
+
.should('have.css', property, value);
|
1789
|
+
},
|
1790
|
+
|
1791
|
+
clickOnNumberLineTitle: () => {
|
1792
|
+
numberLinePage.numberLineTitleNumberLineSection()
|
1793
|
+
.click();
|
1794
|
+
},
|
1795
|
+
|
1796
|
+
/**
|
1797
|
+
* Enters the specified value into the input field.
|
1798
|
+
* @param {number} value - The value to enter into the input field.
|
1799
|
+
*/
|
1800
|
+
enterTextInTitlePopupAddLabelInputField: (text) => {
|
1801
|
+
numberLinePage.titlePopupAddLabelInputField()
|
1802
|
+
.clear()
|
1803
|
+
.type(text)
|
1804
|
+
.should('have.value', text);
|
767
1805
|
},
|
768
1806
|
|
769
|
-
|
770
|
-
|
1807
|
+
/**
|
1808
|
+
* Verifies that the input field has the specified value.
|
1809
|
+
* @param {number} value - The expected value of the input field
|
1810
|
+
*/
|
1811
|
+
verifyTextInTitlePopupAddLabelInputField: (text) => {
|
1812
|
+
numberLinePage.titlePopupAddLabelInputField()
|
1813
|
+
.should('have.value', text);
|
1814
|
+
},
|
1815
|
+
|
1816
|
+
clickOnTitlePopupCancelButton: () => {
|
1817
|
+
numberLinePage.titlePopupCancelButton()
|
1818
|
+
.click();
|
1819
|
+
},
|
1820
|
+
|
1821
|
+
clickOnTitlePopupSaveButton: () => {
|
1822
|
+
numberLinePage.titlePopupSaveButton()
|
771
1823
|
.click();
|
1824
|
+
},
|
1825
|
+
|
1826
|
+
verifyAnnotatedLabelsOnNumberLineSpecifyCorrectAnswerSection: (value, annotateEvery) => {
|
1827
|
+
cy.wait(3000);
|
1828
|
+
numberLinePage.numberLineSpecifyCorrectAnswer()
|
1829
|
+
.parents('.ngie-jxgbox')
|
1830
|
+
.find('.JXGtext')
|
1831
|
+
.each(($element, index) => {
|
1832
|
+
if (index % annotateEvery === 0) {
|
1833
|
+
cy.wrap($element).should('have.text', value);
|
1834
|
+
value += annotateEvery;
|
1835
|
+
}
|
1836
|
+
});
|
1837
|
+
},
|
1838
|
+
|
1839
|
+
/**
|
1840
|
+
* Verifies the annotated labels on the number line section.
|
1841
|
+
* @param {string} value - The value of the annotated label.
|
1842
|
+
* @param {number} annotateEvery - The frequency of annotation.
|
1843
|
+
*/
|
1844
|
+
verifyAnnotatedLabelsOnNumberLineNumberLineSection: (value, annotateEvery) => {
|
1845
|
+
cy.wait(3000);
|
1846
|
+
numberLinePage.numberLineNumberLineSection()
|
1847
|
+
.parents('.ngie-jxgbox')
|
1848
|
+
.find('.JXGtext')
|
1849
|
+
.each(($element, index) => {
|
1850
|
+
if (index % annotateEvery === 0) {
|
1851
|
+
cy.wrap($element).should('have.text', value);
|
1852
|
+
value += annotateEvery;
|
1853
|
+
}
|
1854
|
+
});
|
1855
|
+
},
|
1856
|
+
|
1857
|
+
/**
|
1858
|
+
* Verifies the annotated labels on the preview tab of the number line.
|
1859
|
+
* @param {string} value - The value of the annotated label.
|
1860
|
+
* @param {number} annotateEvery - The frequency of annotation.
|
1861
|
+
*/
|
1862
|
+
verifyAnnotatedLabelsOnNumberLinePreviewTab: (value, annotateEvery) => {
|
1863
|
+
numberLinePage.numberLinePreviewTab()
|
1864
|
+
.parents('.ngie-jxgbox')
|
1865
|
+
.find('.JXGtext')
|
1866
|
+
.each(($element, index) => {
|
1867
|
+
if (index % annotateEvery === 0) {
|
1868
|
+
cy.wrap($element).should('have.text', value);
|
1869
|
+
value += annotateEvery;
|
1870
|
+
}
|
1871
|
+
});
|
1872
|
+
},
|
1873
|
+
|
1874
|
+
verifyDisplayNumbersAndLineSettingsSectionDisabled: () => {
|
1875
|
+
utilities.verifyCSS(numberLinePage.lineSettingsToggleButtonWrapper(), {
|
1876
|
+
'opacity': '0.4'
|
1877
|
+
});
|
1878
|
+
utilities.verifyCSS(numberLinePage.displayNumbersToggleButtonWrapper(), {
|
1879
|
+
'opacity': '0.4'
|
1880
|
+
});
|
1881
|
+
},
|
1882
|
+
|
1883
|
+
verifyDisplayNumbersAndLineSettingsSectionEnabled: () => {
|
1884
|
+
utilities.verifyCSS(numberLinePage.lineSettingsToggleButtonWrapper(), {
|
1885
|
+
'opacity': '1'
|
1886
|
+
});
|
1887
|
+
utilities.verifyCSS(numberLinePage.displayNumbersToggleButtonWrapper(), {
|
1888
|
+
'opacity': '1'
|
1889
|
+
});
|
1890
|
+
},
|
1891
|
+
|
1892
|
+
/**
|
1893
|
+
* Enters the specified value into the input field.
|
1894
|
+
* @param {number} value - The value to enter into the input field.
|
1895
|
+
*/
|
1896
|
+
enterTextInHeightInputField: (value) => {
|
1897
|
+
numberLinePage.heightInputField()
|
1898
|
+
.clear()
|
1899
|
+
.type(value);
|
1900
|
+
},
|
1901
|
+
|
1902
|
+
/**
|
1903
|
+
* Verifies that the input field has the specified value.
|
1904
|
+
* @param {number} value - The expected value of the input field
|
1905
|
+
*/
|
1906
|
+
verifyTextInHeightInputField: (value) => {
|
1907
|
+
numberLinePage.heightInputField()
|
1908
|
+
.should('have.value', value);
|
772
1909
|
}
|
773
1910
|
}
|
774
1911
|
|