itemengine-cypress-automation 1.0.185-repoUpdate26April-b17eb46.0 → 1.0.186-packageUpdate-5632086.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (146) hide show
  1. package/cypress/e2e/ILC/AudioResponseNew/barRecorderStyle.smoke.js +1 -1
  2. package/cypress/e2e/ILC/AudioResponseNew/compactRecorderStyle.smoke.js +1 -1
  3. package/cypress/e2e/ILC/AudioResponseNew/standardRecorderStyle.smoke.js +1 -1
  4. package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/clickAndDrop.js +1 -1
  5. package/cypress/e2e/ILC/DrawingResponse/drawingResponseGradingViewAndCorrectAnswerViewContents.smoke.js +8 -5
  6. package/cypress/e2e/ILC/EditTabSettingPage/itemPreviewSettingsTabFunctionality.js +28 -417
  7. package/cypress/e2e/ILC/EssayResponse/editCategoryFlyout.js +1 -1
  8. package/cypress/e2e/ILC/FeedbackScaleNew/headerSection.js +1 -29
  9. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/previewContentsForAllViews.smoke.js +2 -2
  10. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/studentViewSettings.js +1 -1
  11. package/cypress/e2e/ILC/FillInTheGapsDropdownNew/studentViewSettings.js +1 -1
  12. package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/editTabScoring.js +0 -1
  13. package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/previewContentsForAllViews.smoke.js +2 -2
  14. package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/studentViewSettings.js +1 -1
  15. package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/studentViewSettings.js +1 -1
  16. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/Scoring/partialDifferentWeightsWithCorrectPointsEqualToAlternativePoints.js +4 -4
  17. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/Scoring/partialEqualWeightsWithAlternativePointsGreaterThanCorrectPoints.js +1 -1
  18. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/studentViewSettings.js +1 -1
  19. package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/partialDifferentWeightsAlternativePointsGreaterThanCorrectPoints.js +5 -5
  20. package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/partialDifferentWeightsWithCorrectPointsEqualToAlternativePoints.js +4 -3
  21. package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/partialEqualWeightsWithAlternativePointsGreaterThanCorrectPoints.js +1 -1
  22. package/cypress/e2e/ILC/FillInTheGapsTextNew/headerSection.js +0 -1
  23. package/cypress/e2e/ILC/FillInTheGapsTextNew/studentViewSettings.js +1 -1
  24. package/cypress/e2e/ILC/Graphing/Scoring/allOrNothingWithAlternativePointsGreaterThanCorrectPoints.js +2 -2
  25. package/cypress/e2e/ILC/Graphing/Scoring/allOrNothingWithCorrectPointsEqualToAlternatePoints.js +2 -2
  26. package/cypress/e2e/ILC/Graphing/Scoring/allOrNothingWithCorrectPointsGreaterThanAlternativePoints.js +2 -2
  27. package/cypress/e2e/ILC/Graphing/addBackgroundShapesSection.js +2 -2
  28. package/cypress/e2e/ILC/Graphing/studentViewSettings.js +1 -1
  29. package/cypress/e2e/ILC/GridFill/checkAnswerFunctionalityForAllViews.smoke.js +2 -2
  30. package/cypress/e2e/ILC/GridFill/gridLayoutContents.js +3 -11
  31. package/cypress/e2e/ILC/GridFill/previewContentsForAllViews.smoke.js +3 -3
  32. package/cypress/e2e/ILC/GridFill/studentViewSettingsSection.js +1 -1
  33. package/cypress/e2e/ILC/Matching/studentViewSettings.js +1 -1
  34. package/cypress/e2e/ILC/MultipleSelection/allOrNothingWithAlternativeAnswer.js +0 -1
  35. package/cypress/e2e/ILC/MultipleSelectionGridNew/studentViewSettings.js +1 -1
  36. package/cypress/e2e/ILC/NumberLine/Scoring/allOrNothingWithCorrectPointsGreaterThanAlternativePoints.js +3 -3
  37. package/cypress/e2e/ILC/NumberLine/allOrNothingScoringForAllViews.smoke.js +1 -57
  38. package/cypress/e2e/ILC/NumberLine/previewTabContentsForAllViews.smoke.js +1 -1
  39. package/cypress/e2e/ILC/NumberLine/studentViewSettings.js +1 -1
  40. package/cypress/e2e/ILC/NumberLine/toolSettings.js +1 -2
  41. package/cypress/e2e/ILC/Protractor/protractorPreviewContents.smoke.js +1 -1
  42. package/cypress/e2e/ILC/ReadingRuler/readingRulerEditTabBasicsSection.js +1 -49
  43. package/cypress/e2e/ILC/ShortTextResponseNew/studentViewSettings.js +1 -1
  44. package/cypress/e2e/ILC/SingleSelectionGridNew/studentViewSettings.js +1 -1
  45. package/cypress/e2e/ILC/TextEntryMath/responseEvaluationMethodsAndCustomSettings.js +2 -2
  46. package/cypress/e2e/ILC/TextSelection/Scoring/allOrNothingAlternatePointsMoreThanCorrectPoints.js +1 -0
  47. package/cypress/e2e/ILC/TextSelection/Scoring/allOrNothingCorrectPointsEqualToAlternatePoints.js +1 -0
  48. package/cypress/e2e/ILC/TextSelection/Scoring/allOrNothingCorrectPointsMoreThanAlternatePoints.js +1 -0
  49. package/cypress/e2e/ILC/TextSelection/Scoring/basicScoringForAllTextSelectionTypes.smoke.js +1 -0
  50. package/cypress/e2e/ILC/TextSelection/allOrNothingScoringForAllViews.smoke.js +1 -0
  51. package/cypress/e2e/ILC/TextSelection/checkAnswerFunctionalityForAllViews.smoke.js +2 -1
  52. package/cypress/e2e/ILC/TextSelection/editTabScoringSection.js +4 -5
  53. package/cypress/e2e/ILC/TextSelection/previewContentsForAllViews.smoke.js +7 -6
  54. package/cypress/e2e/ILC/ToolSettings/toolSettingsContent.js +5 -5
  55. package/cypress/e2e/ILC/ToolSettings/toolSettingsPreviewContents.smoke.js +3 -3
  56. package/cypress/fixtures/constants.js +1 -1
  57. package/cypress/fixtures/equationEditorCategoriesAndSymbols .js +20 -20
  58. package/cypress/fixtures/theme/ilc.json +18 -20
  59. package/cypress/pages/audioPlayerPage.js +504 -274
  60. package/cypress/pages/brainingCampManipulativePage.js +1 -1
  61. package/cypress/pages/components/autoScoredSpecifyCorrectAnswerSection.js +3 -3
  62. package/cypress/pages/components/autoScoredStudentViewSettings.js +5 -5
  63. package/cypress/pages/components/commonComponents.js +0 -1
  64. package/cypress/pages/components/draggableOptionContainer.js +0 -1
  65. package/cypress/pages/components/equationEditorFlyout.js +2 -3
  66. package/cypress/pages/components/essayResponseCommonComponents.js +2 -8
  67. package/cypress/pages/components/fillInTheGapsDropdownCommonComponent.js +0 -1
  68. package/cypress/pages/components/imageCanvasComponent.js +1 -2
  69. package/cypress/pages/components/index.js +0 -3
  70. package/cypress/pages/components/optionsWrapperComponent.js +2 -13
  71. package/cypress/pages/components/playbackControlsBaseComponent.js +13 -20
  72. package/cypress/pages/components/toolSettingsComponent.js +0 -6
  73. package/cypress/pages/contentBlocksPage.js +2 -18
  74. package/cypress/pages/createItemPage.js +8 -75
  75. package/cypress/pages/dialogBoxBase.js +2 -2
  76. package/cypress/pages/drawingResponsePage.js +4 -24
  77. package/cypress/pages/feedbackScalePage.js +0 -3
  78. package/cypress/pages/graphingPage.js +1 -19
  79. package/cypress/pages/gridFillPage.js +8 -25
  80. package/cypress/pages/index.js +1 -2
  81. package/cypress/pages/itemPreviewSettingsPage.js +0 -4
  82. package/cypress/pages/listOrderingPage.js +557 -435
  83. package/cypress/pages/matchingPage.js +1 -1
  84. package/cypress/pages/multipleSelectionPage.js +1 -23
  85. package/cypress/pages/numberLinePage.js +132 -1370
  86. package/cypress/pages/rulerPage.js +2 -6
  87. package/cypress/pages/textSelectionPage.js +23 -461
  88. package/package.json +1 -1
  89. package/cypress/e2e/ILC/AudioPlayerNew/allSupportedFileTypes.js +0 -79
  90. package/cypress/e2e/ILC/AudioPlayerNew/barAudioPlayerStyle.js +0 -345
  91. package/cypress/e2e/ILC/AudioPlayerNew/compactAudioPlayerStyle.js +0 -429
  92. package/cypress/e2e/ILC/AudioPlayerNew/previewContents.smoke.js +0 -162
  93. package/cypress/e2e/ILC/AudioPlayerNew/standardAudioPlayerStyle.js +0 -489
  94. package/cypress/e2e/ILC/AudioPlayerNew/uploadAndAddAudioFile.js +0 -313
  95. package/cypress/e2e/ILC/ListOrderingDropdown/allOrNothingForAllViews.smoke.js +0 -230
  96. package/cypress/e2e/ILC/ListOrderingDropdown/checkAnswerFunctionalityForAllViews.smoke.js +0 -124
  97. package/cypress/e2e/ILC/ListOrderingDropdown/previewContentsForAllViews.smoke.js +0 -201
  98. package/cypress/e2e/ILC/ListOrderingNew/Scoring/allOrNothingAlternativePointsGreaterThanCorrectPoints.js +0 -216
  99. package/cypress/e2e/ILC/ListOrderingNew/Scoring/allOrNothingCorrectPointsEqualToAlternativePoints.js +0 -214
  100. package/cypress/e2e/ILC/ListOrderingNew/Scoring/allOrNothingCorrectPointsGreaterThanAlternativePoints.js +0 -251
  101. package/cypress/e2e/ILC/ListOrderingNew/Scoring/allOrNothingPenaltyScoring.js +0 -52
  102. package/cypress/e2e/ILC/ListOrderingNew/Scoring/manuallyAndNonScored.js +0 -128
  103. package/cypress/e2e/ILC/ListOrderingNew/Scoring/partialDifferentWeightsAlternativePointsGreaterThanCorrectPoints.js +0 -279
  104. package/cypress/e2e/ILC/ListOrderingNew/Scoring/partialDifferentWeightsBasic.js +0 -109
  105. package/cypress/e2e/ILC/ListOrderingNew/Scoring/partialDifferentWeightsCorrectPointsEqualToAlternativePoints.js +0 -278
  106. package/cypress/e2e/ILC/ListOrderingNew/Scoring/partialDifferentWeightsCorrectPointsGreaterThanAlternativePoints.js +0 -278
  107. package/cypress/e2e/ILC/ListOrderingNew/Scoring/partialDifferentWeightsMinimumAndPenaltyScoring.js +0 -335
  108. package/cypress/e2e/ILC/ListOrderingNew/Scoring/partialEqualWeightsAlternativePointsGreaterThanCorrectPoints.js +0 -250
  109. package/cypress/e2e/ILC/ListOrderingNew/Scoring/partialEqualWeightsBasic.js +0 -161
  110. package/cypress/e2e/ILC/ListOrderingNew/Scoring/partialEqualWeightsCorrectPointsEqualToAlternativePoints.js +0 -216
  111. package/cypress/e2e/ILC/ListOrderingNew/Scoring/partialEqualWeightsCorrectPointsGreaterThanAlternativePoints.js +0 -252
  112. package/cypress/e2e/ILC/ListOrderingNew/additionalSettings.js +0 -118
  113. package/cypress/e2e/ILC/ListOrderingNew/allOrNothingForAllViews.smoke.js +0 -243
  114. package/cypress/e2e/ILC/ListOrderingNew/checkAnswerFunctionalityForAllViews.smoke.js +0 -128
  115. package/cypress/e2e/ILC/ListOrderingNew/editTabBasicSection.js +0 -155
  116. package/cypress/e2e/ILC/ListOrderingNew/editTabScoring.js +0 -195
  117. package/cypress/e2e/ILC/ListOrderingNew/headerSection.js +0 -78
  118. package/cypress/e2e/ILC/ListOrderingNew/minimumScoringPenaltyPointsAndRoundingDropdown.js +0 -194
  119. package/cypress/e2e/ILC/ListOrderingNew/previewContentsForAllViews.smoke.js +0 -176
  120. package/cypress/e2e/ILC/ListOrderingNew/specifyCorrectAnswerSection.js +0 -112
  121. package/cypress/e2e/ILC/ListOrderingNew/studentViewSettings.js +0 -244
  122. package/cypress/e2e/ILC/NumberLine/LayoutSection.js +0 -181
  123. package/cypress/e2e/ILC/NumberLine/lineSettingsSection.js +0 -33
  124. package/cypress/e2e/ILC/NumberLine/numberLineSection.js +0 -46
  125. package/cypress/e2e/ILC/NumberLine/verticalNumberLine/allOrNothingScoringForAllViews.smoke.js +0 -696
  126. package/cypress/e2e/ILC/NumberLine/verticalNumberLine/gradingViewAndCorrectAnswerView.smoke.js +0 -173
  127. package/cypress/e2e/ILC/NumberLine/verticalNumberLine/layoutSection.js +0 -183
  128. package/cypress/e2e/ILC/NumberLine/verticalNumberLine/numberLineSection.js +0 -73
  129. package/cypress/e2e/ILC/NumberLine/verticalNumberLine/previewTabContentsForAllViews.smoke.js +0 -204
  130. package/cypress/e2e/ILC/NumberLineLabel/allOrNothingForAllViews.smoke.js +0 -288
  131. package/cypress/e2e/ILC/NumberLineLabel/checkAnswerFunctionalityForAllViews.smoke.js +0 -153
  132. package/cypress/e2e/ILC/NumberLineLabel/gradingViewAndCorrectAnswerView.smoke.js +0 -164
  133. package/cypress/e2e/ILC/NumberLineLabel/previewContentsForAllViews.smoke.js +0 -120
  134. package/cypress/e2e/ILC/TextSelection/additionalSettings.js +0 -125
  135. package/cypress/e2e/ILC/TextSelection/headerSection.js +0 -73
  136. package/cypress/e2e/ILC/TextSelection/questionInstructionsAndQuestion.js +0 -179
  137. package/cypress/e2e/ILC/TextSelection/specifyCorrectAnswerSection.js +0 -89
  138. package/cypress/e2e/ILC/TextSelection/studentViewSettings.js +0 -436
  139. package/cypress/e2e/ILC/TextSelection/styleAndLayoutCustomizationAccordion.js +0 -277
  140. package/cypress/e2e/ILC/TextSelection/textSelectionModesInPreviewTab.js +0 -222
  141. package/cypress/e2e/ILC/TextSelection/textSelectionModesInSpecifyCorrectAnswerSection.js +0 -260
  142. package/cypress/e2e/ILC/TextSelection/textSelectionModesInSpecifyPossibleOptionsSection.js +0 -380
  143. package/cypress/pages/components/layoutSectionComponent.js +0 -1191
  144. package/cypress/pages/components/numberLineCommonComponent.js +0 -36
  145. package/cypress/pages/components/styleAndLayoutCustomizationAccordionComponent.js +0 -46
  146. package/cypress/pages/numberLineLabelPage.js +0 -333
@@ -1,10 +1,7 @@
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, layoutSectionComponent, numberLineCommonComponent } from './components';
3
- import { dialogBoxBase } from './dialogBoxBase';
2
+ import { createQuestionBasePage, toolsAndControlsComponent, questionInstructionsComponent, resetPopupComponent, scoringSectionBaseEditTab, autoScoredScoringPreviewTab, autoScoredSpecifyCorrectAnswerSection, commonComponents, autoScoredScoringSectionMultiResponseType, toolSettingsComponent, additionalSettingsPanel, additionalSettingsAccessibilitySectionComponent, autoScoredStudentViewSettings, randomizeOptionsComponent, studentViewSettingsLabelComponent, defaultToolDropdown } from './components';
4
3
  const css = Cypress.env('css');
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"]
4
+ const range = 20.4472843;
8
5
 
9
6
  const selectors = {
10
7
  ...toolsAndControlsComponent,
@@ -17,12 +14,11 @@ const selectors = {
17
14
  ...commonComponents,
18
15
  ...defaultToolDropdown,
19
16
  ...autoScoredScoringSectionMultiResponseType,
20
- ...dialogBoxBase,
21
- ...numberLineCommonComponent,
22
- ...layoutSectionComponent,
23
-
17
+ //layout
18
+ staggerResponseCheckbox: () => cy.get('[data-ngie-testid="stagger-response-checkbox"] input'),
19
+ limitNumberOfResponsesInputField: () => cy.get('.limit-number-line-response-wrapper .text-input-field input'),
24
20
  //Specify correct answer
25
- numberLineAxisSpecifyCorrectAnswer: () => cy.get('.ngie-accordion .ngie-jxgbox svg line'),
21
+ numberLineSpecifyCorrectAnswer: () => cy.get('.ngie-accordion .ngie-jxgbox svg'),
26
22
  numberLineToolOptionSpecifyCorrectAnswer: (toolOptionAriaLabel = null) => {
27
23
  if (toolOptionAriaLabel) {
28
24
  return cy.get(`.graph-tools-wrapper .single-select-toggle-group-double button[aria-label*="${toolOptionAriaLabel}"]`).eq(0)
@@ -42,7 +38,8 @@ const selectors = {
42
38
  partialEqualWeightsPointsPerResponseScore: () => cy.get('.alternate-points-points-per-value-span'),
43
39
 
44
40
  //Preview Tab
45
- numberLineAxisPreviewTab: () => cy.get('[class*="question-preview-wrapper"] .ngie-jxgbox svg line').eq(0),
41
+ numberLinePreviewTab: () => cy.get('[class*="question-preview-wrapper"] .ngie-jxgbox svg').eq(0),
42
+ numberLinePointPreviewTab: () => cy.get('[class*="question-preview-wrapper"] .ngie-jxgbox').eq(0).find('svg ellipse[display="inline"]'),
46
43
  numberLineSegmentPreviewTab: () => cy.get('[class*="question-preview-wrapper"] .ngie-jxgbox').eq(0).find('[stroke-linecap="butt"]'),
47
44
  numberLineToolOptionPreviewTab: (toolOptionAriaLabel = null) => {
48
45
  if (toolOptionAriaLabel) {
@@ -61,11 +58,13 @@ const selectors = {
61
58
  numberLineTitlePreviewTab: () => cy.get('.edit-question-preview-wrapper [class*="LineGraphstyles__TitleText"]'),
62
59
 
63
60
  //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
- numberLineTitleCorrectAnswerSection: () => cy.get('[class*="LineGraphstyles__TitleText"]').last(),
67
- warningMessage: () => cy.get('.disabled-wrapper-cls [class*="DisabledTextWrapper"]'),
68
- warningMessageContainer: () => cy.get('.disabled-wrapper-cls'),
66
+ correctIncorrectAnswerTextWrapper: () => cy.get('[class*="CorrectIncorrectWrapper"]'),
67
+ numberLineTitleCorrectAnswerSection: () => cy.get('[class*="LineGraphstyles__TitleText"]').last()
69
68
  }
70
69
 
71
70
  const steps = {
@@ -81,8 +80,6 @@ const steps = {
81
80
  ...commonComponents.steps,
82
81
  ...autoScoredScoringSectionMultiResponseType.steps,
83
82
  ...defaultToolDropdown.steps,
84
- ...numberLineCommonComponent.steps,
85
- ...layoutSectionComponent.steps,
86
83
 
87
84
  /**
88
85
  * @description This function selects the tool option from graph
@@ -120,7 +117,7 @@ const steps = {
120
117
  numberLinePage.numberLineSpecifyCorrectAnswer()
121
118
  .click(xPixel, originY, { force: true });
122
119
  } else {
123
- const yPixel = originY - coordinate * (graphHeight / range);
120
+ const yPixel = originY - coordinate * (graphWidth / range);
124
121
  numberLinePage.numberLineSpecifyCorrectAnswer()
125
122
  .click(originX, yPixel, { force: true });
126
123
  }
@@ -176,18 +173,18 @@ const steps = {
176
173
  * @param {number} startingPoint - It representing the starting point of the ray.
177
174
  */
178
175
  verifyRayOnNumberLineSpecifyCorrectAnswer: (direction, range, startingPoint) => {
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
- });
176
+ numberLinePage.numberLineSpecifyCorrectAnswer()
177
+ .then(($graphElement) => {
178
+ const graphWidth = $graphElement[0].clientWidth;
179
+ const graphHeight = $graphElement[0].clientHeight;
180
+ const originX = graphWidth / 2;
181
+ const originY = graphHeight / 2;
182
+ const x1Pixel = originX + startingPoint * (graphWidth / range);
183
+ const rayArrowWidth = 42;
184
+ const x2Pixel = direction === "left" ? rayArrowWidth : graphWidth - rayArrowWidth;
185
+ cy.get(`.ngie-accordion .ngie-jxgbox svg [stroke-linecap="butt"][x1*="${Math.floor(x1Pixel)}"][y1*="${Math.floor(originY)}"][x2*="${Math.floor(x2Pixel)}"][y2*="${Math.floor(originY)}"]`)
186
+ .should('be.visible');
187
+ });
191
188
  },
192
189
 
193
190
  /**
@@ -243,7 +240,7 @@ const steps = {
243
240
  numberLinePage.numberLinePreviewTab()
244
241
  .click(xPixel, originY, { force: true });
245
242
  } else {
246
- const yPixel = originY - coordinate * (graphHeight / range);
243
+ const yPixel = originY + coordinate * (graphWidth / range);
247
244
  numberLinePage.numberLinePreviewTab()
248
245
  .click(originX, yPixel, { force: true });
249
246
  }
@@ -359,18 +356,18 @@ const steps = {
359
356
  * @param {number} startingPoint - It representing the starting point of the ray.
360
357
  */
361
358
  verifyRayOnNumberLinePreviewTab: (direction, range, startingPoint) => {
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
- });
359
+ numberLinePage.numberLinePreviewTab()
360
+ .then(($graphElement) => {
361
+ const graphWidth = $graphElement[0].clientWidth;
362
+ const graphHeight = $graphElement[0].clientHeight;
363
+ const originX = graphWidth / 2;
364
+ const originY = graphHeight / 2;
365
+ const x1Pixel = originX + startingPoint * (graphWidth / range);
366
+ const rayArrowWidth = 42;
367
+ const x2Pixel = direction === "left" ? rayArrowWidth : graphWidth - rayArrowWidth;
368
+ cy.get('[class*="question-preview-wrapper"] .ngie-jxgbox').eq(0).find(`[stroke-linecap="butt"][x1*="${Math.floor(x1Pixel)}"][y1*="${Math.floor(originY)}"][x2*="${Math.floor(x2Pixel)}"][y2*="${Math.floor(originY)}"]`)
369
+ .should('be.visible');
370
+ });
374
371
  },
375
372
 
376
373
  /**
@@ -401,18 +398,18 @@ const steps = {
401
398
  * @param {number} startingPoint -It representing the starting point of the ray.
402
399
  */
403
400
  verifyCorrectRayOnNumberLinePreviewTab: (direction, range, startingPoint) => {
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
- });
401
+ numberLinePage.numberLinePreviewTab()
402
+ .then(($graphElement) => {
403
+ const graphWidth = $graphElement[0].clientWidth;
404
+ const graphHeight = $graphElement[0].clientHeight;
405
+ const originX = graphWidth / 2;
406
+ const originY = graphHeight / 2;
407
+ const x1Pixel = originX + startingPoint * (graphWidth / range);
408
+ const rayArrowWidth = 42;
409
+ const x2Pixel = direction === "left" ? rayArrowWidth : graphWidth - rayArrowWidth;
410
+ cy.get('[class*="question-preview-wrapper"] .ngie-jxgbox').eq(0).find(`[stroke-linecap="butt"][x1*="${Math.floor(x1Pixel)}"][y1*="${Math.floor(originY)}"][x2*="${Math.floor(x2Pixel)}"][y2*="${Math.floor(originY)}"]`)
411
+ .should('have.css', 'stroke', css.color.correctAnswer);
412
+ });
416
413
  },
417
414
 
418
415
  /**
@@ -443,18 +440,18 @@ const steps = {
443
440
  * @param {number} startingPoint- It representing the starting point of the ray.
444
441
  */
445
442
  verifyIncorrectRayOnNumberLinePreviewTab: (direction, range, startingPoint) => {
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
- });
443
+ numberLinePage.numberLinePreviewTab()
444
+ .then(($graphElement) => {
445
+ const graphWidth = $graphElement[0].clientWidth;
446
+ const graphHeight = $graphElement[0].clientHeight;
447
+ const originX = graphWidth / 2;
448
+ const originY = graphHeight / 2;
449
+ const x1Pixel = originX + startingPoint * (graphWidth / range);
450
+ const rayArrowWidth = 42;
451
+ const x2Pixel = direction === "left" ? rayArrowWidth : graphWidth - rayArrowWidth;
452
+ cy.get('[class*="question-preview-wrapper"] .ngie-jxgbox').eq(0).find(`[stroke-linecap="butt"][x1*="${Math.floor(x1Pixel)}"][y1*="${Math.floor(originY)}"][x2*="${Math.floor(x2Pixel)}"][y2*="${Math.floor(originY)}"]`)
453
+ .should('have.css', 'stroke', css.color.incorrectAnswer);
454
+ });
458
455
  },
459
456
 
460
457
  /**
@@ -757,1328 +754,93 @@ const steps = {
757
754
  });
758
755
  },
759
756
 
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
-
907
757
  /**
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.
758
+ * Enters a value into the Limit Number of Responses input field.
759
+ * @param {string | number} value - The value to be entered into the input field.
760
+ * @description This function clears the input field and then enters the specified value into the Limit Number of Responses input field on the page.
911
761
  */
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
- });
762
+ enterValueInLimitNumberOfResponsesInputField: (value) => {
763
+ numberLinePage.limitNumberOfResponsesInputField()
764
+ .clear()
765
+ .type(value)
766
+ .blur()
927
767
  },
928
768
 
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')
769
+ uncheckStaggerResponseCheckbox: () => {
770
+ numberLinePage.staggerResponseCheckbox()
969
771
  .click();
970
- },
772
+ }
773
+ }
971
774
 
972
- clickOnToolOptionsPreviewTab: () => {
973
- cy.log('Clicking on control options to remove error message');
974
- numberLinePage.numberLineToolOptionPreviewTab()
975
- .parents('.graph-tools-wrapper')
976
- .click();
977
- },
775
+ const tests = {
776
+ ...resetPopupComponent.tests,
777
+ ...toolSettingsComponent.tests,
778
+ ...additionalSettingsAccessibilitySectionComponent.tests,
779
+ ...additionalSettingsPanel.tests,
780
+ ...studentViewSettingsLabelComponent.tests,
781
+ ...autoScoredStudentViewSettings.tests,
782
+ ...autoScoredSpecifyCorrectAnswerSection.tests,
783
+ ...createQuestionBasePage.tests,
784
+ ...commonComponents.tests,
785
+ ...autoScoredScoringPreviewTab.tests,
786
+ ...defaultToolDropdown.tests,
787
+ ...scoringSectionBaseEditTab.tests,
788
+ ...autoScoredScoringSectionMultiResponseType.tests,
978
789
 
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
- });
790
+ verifyContentsOfSpecifyCorrectAnswerSection: () => {
791
+ it('When user selects a scoring type then in the \'Correct\' accordion, all the contents should be displayed', () => {
792
+ utilities.verifyElementVisibilityState(numberLinePage.numberLineSpecifyCorrectAnswer(), 'visible');
793
+ utilities.verifyElementVisibilityState(numberLinePage.numberLineToolOptionSpecifyCorrectAnswer(), 'visible');
794
+ utilities.verifyElementVisibilityState(numberLinePage.numberLineControlOptionSpecifyCorrectAnswer(), 'visible');
795
+ utilities.verifyElementVisibilityState(numberLinePage.numberLineTitleSpecifyCorrectAnswerSection(), 'exist');
993
796
  });
994
797
  },
995
798
 
996
799
  /**
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
- });
800
+ * Verifies the contents and functionality of the 'Specify correct answer' accordion for multiple selection questions.
801
+ * @param {{'Correct' | 'Alternative'}} accordionName - The name of the accordion to be used in the validation.
802
+ * @example - verifySpecifyCorrectAnswerAccordionContentsAndFunctionality('Correct');
803
+ */
804
+ verifySpecifyCorrectAnswerAccordionContentsAndFunctionality: (accordionName) => {
805
+ it(`The user should be able to plot points on number line in the specify correct answer section ${accordionName} accordion`, () => {
806
+ numberLinePage.steps.plotPointOnNumberLineSpecifyCorrectAnswer("horizontal", range, 0);
807
+ numberLinePage.steps.plotPointOnNumberLineSpecifyCorrectAnswer("horizontal", range, 1);
808
+ numberLinePage.steps.verifyPointsPlottedOnNumberLineSpecifyCorrectAnswer(range, [0, 1]);
1010
809
  });
1011
- },
1012
810
 
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
- },
811
+ it(`When the user resets the number line in the ${accordionName} accordion, \'Error: Please set a correct answer.\' error message should be thrown along with an error icon on the \'${accordionName}\' accordion`, () => {
812
+ numberLinePage.steps.selectNumberLineControlOptionSpecifyCorrectAnswerSection('Reset');
813
+ numberLinePage.steps.confirmReset();
814
+ utilities.verifyElementVisibilityState(commonComponents.errorMessage(), 'visible');
815
+ utilities.verifyInnerText(commonComponents.errorMessage(), 'Error: Please set a correct answer.');
816
+ if (accordionName == 'Correct') {
817
+ autoScoredSpecifyCorrectAnswerSection.correctAnswerAccordion()
818
+ .within(() => {
819
+ utilities.verifyElementVisibilityState(autoScoredSpecifyCorrectAnswerSection.specifyCorrectAnswerErrorIcon(), 'visible');
820
+ });
821
+ } else {
822
+ autoScoredSpecifyCorrectAnswerSection.alternativeAnswerAccordion()
823
+ .within(() => {
824
+ utilities.verifyElementVisibilityState(autoScoredSpecifyCorrectAnswerSection.specifyCorrectAnswerErrorIcon(), 'visible');
825
+ });
826
+ };
827
+ });
1039
828
 
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
- }
829
+ autoScoredSpecifyCorrectAnswerSection.tests.verifyAutoScoredCorrectAnswerErrorMessageCSSAndA11y();
1060
830
 
1061
- numberLinePage.numberLinePreviewTab()
1062
- .parents('.ngie-jxgbox')
1063
- .find('.number-line-tick-font')
1064
- .eq(0)
1065
- .should('have.css', property, value);
1066
- },
831
+ it('When the user plots on the number line then the error message should disappear', () => {
832
+ numberLinePage.steps.plotPointOnNumberLineSpecifyCorrectAnswer("horizontal", range, 0);
833
+ numberLinePage.steps.plotPointOnNumberLineSpecifyCorrectAnswer("horizontal", range, 1);
834
+ numberLinePage.steps.verifyPointsPlottedOnNumberLineSpecifyCorrectAnswer(range, [0, 1]);
835
+ });
1067
836
 
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
- },
837
+ autoScoredSpecifyCorrectAnswerSection.tests.verifyAutoScoredPointsErrorMessageWhenPointsFieldIsEmpty(accordionName);
1085
838
 
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
- },
839
+ it('Accessibility of \'Correct\' accordion contents', { tags: 'a11y' }, () => {
840
+ cy.checkAccessibility(numberLinePage.numberLineSpecifyCorrectAnswer());
841
+ });
842
+ }
1102
843
 
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
- }
2082
844
  }
2083
845
 
2084
846
  export const numberLinePage = {