itemengine-cypress-automation 1.0.129 → 1.0.131-smokeTestFixes6March-aa053ff.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (116) hide show
  1. package/cypress/e2e/ILC/AudioResponseNew/barRecorderStyle.smoke.js +2 -4
  2. package/cypress/e2e/ILC/AudioResponseNew/compactRecorderStyle.smoke.js +2 -4
  3. package/cypress/e2e/ILC/AudioResponseNew/standardRecorderStyle.smoke.js +3 -7
  4. package/cypress/e2e/ILC/ContentBlocks/editTabBasics.js +210 -0
  5. package/cypress/e2e/ILC/ContentBlocks/previewContents.smoke.js +91 -0
  6. package/cypress/e2e/ILC/ContentBlocks/styleAndLayoutCustomizationSection.js +392 -0
  7. package/cypress/e2e/ILC/DrawingResponse/drawingResponseAdditionalSettings.js +1 -1
  8. package/cypress/e2e/ILC/DrawingResponse/drawingResponseBackground.js +1 -1
  9. package/cypress/e2e/ILC/DrawingResponse/drawingResponseCustomizeAdditionalOptions.js +2 -1
  10. package/cypress/e2e/ILC/DrawingResponse/drawingResponseGradingViewAndCorrectAnswerViewContents.smoke.js +2 -1
  11. package/cypress/e2e/ILC/EssayResponse/essayResponseCustomizeFormattingOptions1.smoke.js +2 -0
  12. package/cypress/e2e/ILC/EssayResponse/essayResponseSpecialCharacters.js +1 -0
  13. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/Scoring/allOrNothingGroupedScoring.js +152 -0
  14. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/Scoring/allOrNothingWithAlternativePointsGreaterThanCorrectPoints.js +196 -0
  15. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/Scoring/allOrNothingWithCorrectPointsEqualToAlternativePoints.js +195 -0
  16. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/Scoring/allOrNothingWithCorrectPointsGreaterThanAlternativePoints.js +288 -0
  17. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/Scoring/manuallyAndNonScored.js +141 -0
  18. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/Scoring/partialDifferentWeightsAlternativePointsGreaterThanCorrectPoints.js +245 -0
  19. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/Scoring/partialDifferentWeightsBasic.js +413 -0
  20. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/Scoring/partialDifferentWeightsWithCorrectPointsEqualToAlternativePoints.js +218 -0
  21. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/Scoring/partialDifferentWeightsWithCorrectPointsGreaterThanAlternativePoints.js +245 -0
  22. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/Scoring/partialEqualWeightsBasic.js +163 -0
  23. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/Scoring/partialEqualWeightsWithAlternativePointsGreaterThanCorrectPoints.js +224 -0
  24. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/Scoring/partialEqualWeightsWithCorrectPointsEqualToAlternativePoints.js +196 -0
  25. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/Scoring/partialEqualWeightsWithCorrectPointsGreaterThanAlternativePoints.js +224 -0
  26. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/Scoring/responseLevelAlternateAnswerBasicScoring.js +83 -0
  27. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/clickAndDrop.js +653 -0
  28. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/draggableOptions.js +180 -0
  29. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/editTabScoringSection.js +229 -0
  30. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/specifyCorrectAnswerSection.js +90 -0
  31. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/switchingCasesBetweenOptionsLayout.js +50 -0
  32. package/cypress/e2e/ILC/FillInTheGapsDropdownNew/Scoring/allOrNothingAlternativePointsGreaterThanCorrectPoints.js +204 -0
  33. package/cypress/e2e/ILC/FillInTheGapsDropdownNew/Scoring/allOrNothingCorrectPointsEqualToAlternativePoints.js +204 -0
  34. package/cypress/e2e/ILC/FillInTheGapsDropdownNew/Scoring/allOrNothingCorrectPointsGreaterThanAlternativePoints.js +298 -0
  35. package/cypress/e2e/ILC/FillInTheGapsDropdownNew/Scoring/allOrNothingPenaltyScoring.js +63 -0
  36. package/cypress/e2e/ILC/FillInTheGapsDropdownNew/Scoring/manuallyAndNonScored.js +111 -0
  37. package/cypress/e2e/ILC/FillInTheGapsDropdownNew/Scoring/partialDifferentWeightsAlternativePointsGreaterThanCorrectPoints.js +231 -0
  38. package/cypress/e2e/ILC/FillInTheGapsDropdownNew/Scoring/partialDifferentWeightsBasic.js +90 -0
  39. package/cypress/e2e/ILC/FillInTheGapsDropdownNew/Scoring/partialDifferentWeightsMinimumAndPenaltyScoring.js +300 -0
  40. package/cypress/e2e/ILC/FillInTheGapsDropdownNew/Scoring/partialDifferentWeightsWithCorrectPointsEqualToAlternativePoints.js +232 -0
  41. package/cypress/e2e/ILC/FillInTheGapsDropdownNew/Scoring/partialDifferentWeightsWithCorrectPointsGreaterThanAlternativePoints.js +231 -0
  42. package/cypress/e2e/ILC/FillInTheGapsDropdownNew/Scoring/partialEqualWeightsBasic.js +138 -0
  43. package/cypress/e2e/ILC/FillInTheGapsDropdownNew/Scoring/partialEqualWeightsWithAlternativePointsGreaterThanCorrectPoints.js +213 -0
  44. package/cypress/e2e/ILC/FillInTheGapsDropdownNew/Scoring/partialEqualWeightsWithCorrectPointsEqualToAlternativePoints.js +186 -0
  45. package/cypress/e2e/ILC/FillInTheGapsDropdownNew/Scoring/partialEqualWeightsWithCorrectPointsGreaterThanAlternativePoints.js +214 -0
  46. package/cypress/e2e/ILC/FillInTheGapsDropdownNew/dropdownAndDropdownMenuSection.js +161 -0
  47. package/cypress/e2e/ILC/FillInTheGapsDropdownNew/dropdownOptionsSection.js +328 -0
  48. package/cypress/e2e/ILC/FillInTheGapsDropdownNew/editTabBasicSection.js +144 -0
  49. package/cypress/e2e/ILC/FillInTheGapsDropdownNew/editTabScoringSection.js +250 -0
  50. package/cypress/e2e/ILC/FillInTheGapsDropdownNew/headerSection.js +75 -0
  51. package/cypress/e2e/ILC/FillInTheGapsDropdownNew/minimumScoringPenaltyPointsAndRoundingDropdown.js +194 -0
  52. package/cypress/e2e/ILC/FillInTheGapsDropdownNew/specifyCorrectAnswerSection.js +74 -0
  53. package/cypress/e2e/ILC/FillInTheGapsDropdownNew/studentViewSettings.js +188 -0
  54. package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/clickAndDrop.js +8 -8
  55. package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/editTabScoring.js +0 -1
  56. package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/specifyCorrectAnswerSection.js +4 -2
  57. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/editTabScoringSection.js +1 -52
  58. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/responseAnswersAndAcceptedStudentInput.js +3 -211
  59. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/setLimitSection.js +39 -3
  60. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/specialCharactersSection.js +1 -8
  61. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/specifyCorrectAnswerSection.js +3 -1
  62. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/studentViewSettings.js +2 -50
  63. package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/conditionalCheckboxScoring.js +325 -0
  64. package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/partialDifferentWeightsBasic.js +1 -146
  65. package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/partialDifferentWeightsMinimumAndPenaltyScoring.js +300 -0
  66. package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/responseLevelAlternateAnswersBasicScoring.js +78 -0
  67. package/cypress/e2e/ILC/FillInTheGapsTextNew/editTabScoringSection.js +265 -0
  68. package/cypress/e2e/ILC/FillInTheGapsTextNew/headerSection.js +75 -0
  69. package/cypress/e2e/ILC/FillInTheGapsTextNew/minimumScoringPenaltyPointsAndRoundingDropdown.js +194 -0
  70. package/cypress/e2e/ILC/FillInTheGapsTextNew/responseAnswersAndAcceptedStudentInput.js +56 -0
  71. package/cypress/e2e/ILC/FillInTheGapsTextNew/setLimitSection.js +40 -2
  72. package/cypress/e2e/ILC/FillInTheGapsTextNew/specialCharactersSection.js +249 -0
  73. package/cypress/e2e/ILC/FillInTheGapsTextNew/specifyCorrectAnswerSection.js +64 -0
  74. package/cypress/e2e/ILC/FillInTheGapsTextNew/studentViewSettings.js +128 -0
  75. package/cypress/e2e/ILC/Graphing/allOrNothingForAllViews.smoke.js +889 -0
  76. package/cypress/e2e/ILC/Graphing/checkAnswerFunctionalityForAllViews.smoke.js +168 -0
  77. package/cypress/e2e/ILC/Graphing/gradingViewAndCorrectAnswerView.smoke.js +203 -0
  78. package/cypress/e2e/ILC/Graphing/previewContentsForAllViews.smoke.js +222 -0
  79. package/cypress/e2e/ILC/SimpleCalculator/calculatorFunctionality.js +349 -0
  80. package/cypress/e2e/ILC/SimpleCalculator/previewContents.smoke.js +132 -0
  81. package/cypress/e2e/ILC/UploadResponse/previewContentsForAllViews.smoke.js +35 -7
  82. package/cypress/e2e/ILC/UploadResponse/studentViewSettingsSection.js +213 -0
  83. package/cypress/e2e/ILC/UploadResponse/uploadResponseAdditionalSettings.js +41 -0
  84. package/cypress/e2e/ILC/UploadResponse/uploadResponseEditTabBasicSections.js +377 -0
  85. package/cypress/e2e/ILC/UploadResponse/uploadResponsePreview.js +161 -0
  86. package/cypress/e2e/ILC/UploadResponse/uplodResponsePreviewUploadedFileProperties.js +250 -0
  87. package/cypress/fixtures/drawingToolbarOptionsAdditionalOptionsAndSpecialAndMathCharacters.js +2 -2
  88. package/cypress/fixtures/theme/ilc.json +6 -1
  89. package/cypress/fixtures/uploadResponseFileType.js +5 -0
  90. package/cypress/pages/audioResponsePage.js +1 -1
  91. package/cypress/pages/components/autoScoredSpecifyCorrectAnswerSection.js +13 -13
  92. package/cypress/pages/components/customizeSpecialCharacterComponent.js +24 -6
  93. package/cypress/pages/components/draggableOptionContainer.js +1 -0
  94. package/cypress/pages/components/fillInTheGapsDragAndDropCommonComponents.js +42 -4
  95. package/cypress/pages/components/fillInTheGapsDropdownCommonComponent.js +149 -5
  96. package/cypress/pages/components/fillInTheGapsTextCommonComponent.js +954 -77
  97. package/cypress/pages/components/questionInputFieldComponent.js +1 -1
  98. package/cypress/pages/components/questionInstructionsComponent.js +2 -1
  99. package/cypress/pages/contentBlocksPage.js +515 -0
  100. package/cypress/pages/drawingResponsePage.js +2 -2
  101. package/cypress/pages/fillInTheGapsDragAndDropPage.js +359 -3
  102. package/cypress/pages/fillInTheGapsDropdownPage.js +21 -1
  103. package/cypress/pages/fillInTheGapsOverImageDragAndDropPage.js +5 -57
  104. package/cypress/pages/fillInTheGapsOverImageDropdownPage.js +3 -24
  105. package/cypress/pages/fillInTheGapsOverImageTextPage.js +1 -435
  106. package/cypress/pages/fillInTheGapsTextPage.js +9 -2
  107. package/cypress/pages/graphingPage.js +484 -0
  108. package/cypress/pages/index.js +4 -1
  109. package/cypress/pages/simpleCalculatorPage.js +310 -0
  110. package/cypress/pages/uploadResponsePage.js +260 -92
  111. package/package.json +2 -2
  112. package/cypress/e2e/ILC/Passage/multipageContentEditTab.js +0 -242
  113. package/cypress/e2e/ILC/Passage/passageAdditionalSettings.js +0 -99
  114. package/cypress/e2e/ILC/Passage/passageEditTab.js +0 -241
  115. package/cypress/e2e/ILC/Passage/passageHeaderSection.js +0 -73
  116. package/cypress/e2e/ILC/Passage/passagePreviewTab.js +0 -246
@@ -0,0 +1,484 @@
1
+ import utilities from "../support/helpers/utilities";
2
+ import { questionInstructionsComponent, createQuestionBasePage, scoringSectionBaseEditTab, autoScoredScoringPreviewTab, autoScoredStudentViewSettings, autoScoredSpecifyCorrectAnswerSection, commonComponents } from "./components";
3
+ const css = Cypress.env('css');
4
+
5
+ const selectors = {
6
+ ...createQuestionBasePage,
7
+ ...questionInstructionsComponent,
8
+ ...autoScoredScoringPreviewTab,
9
+ ...commonComponents,
10
+
11
+ //Edit tab
12
+ graphEditTab: () => cy.get('[class*="GraphingWrapper"] .ngie-jxgbox svg'),
13
+ snapToGridCheckbox: () => cy.get('[data-ngie-testid="snap-to-grid-checkbox"] input'),
14
+ graphLine: () => cy.get('line[tabindex="null"]'),
15
+ graphCircle: () => cy.get('ellipse[stroke-linecap="butt"]'),
16
+ graphPolygon: () => cy.get('polygon'),
17
+ graphSine: () => cy.get('path[stroke-linecap="butt"][stroke-opacity="1"]'),
18
+ graphPoint: (cx, cy) => cy.get(`[class*="GraphingWrapper"] .ngie-jxgbox svg ellipse[display="inline"][cx="${cx}"][cy="${cy}"]`),
19
+ toolOptions: (toolOptionAriaLabel = null) => {
20
+ if (toolOptionAriaLabel) {
21
+ return cy.get('[class*="CustomizedToolBarOptionsstyles__DragAndDropWrapper"]').eq(0).find(`.icon-button-custom-format[aria-label*=${toolOptionAriaLabel}]`)
22
+ } else {
23
+ return cy.get('[class*="CustomizedToolBarOptionsstyles__DragAndDropWrapper"]').eq(0).find(`.icon-button-custom-format`)
24
+ }
25
+ },
26
+ graphToolOptionEditTab: (toolOptionAriaLabel = null) => {
27
+ if (toolOptionAriaLabel) {
28
+ return cy.get('.graph-tools-wrapper').eq(0).find(`.single-select-toggle-group-double button[aria-label*=${toolOptionAriaLabel}]`)
29
+ } else {
30
+ return cy.get('.graph-tools-wrapper').eq(0).find('.single-select-toggle-group-double button')
31
+ }
32
+ },
33
+ graphToolOptionSpecifyCorrectAnswer: (toolOptionAriaLabel = null) => {
34
+ if (toolOptionAriaLabel) {
35
+ return cy.get('.graph-tools-wrapper').eq(1).find(`.single-select-toggle-group-double button[aria-label*=${toolOptionAriaLabel}]`)
36
+ } else {
37
+ return cy.get('.graph-tools-wrapper').eq(1).find('.single-select-toggle-group-double button')
38
+ }
39
+ },
40
+ graphToolOptionPreviewTab: (toolOptionAriaLabel = null) => {
41
+ if (toolOptionAriaLabel) {
42
+ return cy.get(`[class*="GraphingQuestion"] .single-select-toggle-group-double button[aria-label*=${toolOptionAriaLabel}]`)
43
+ } else {
44
+ return cy.get('[class*="GraphingQuestion"] .single-select-toggle-group-double button')
45
+ }
46
+ },
47
+ controlOptions: (toolOptionAriaLabel = null) => {
48
+ if (toolOptionAriaLabel) {
49
+ return cy.get('[class*="CustomizedToolBarOptionsstyles__DragAndDropWrapper"]').eq(1).find(`.icon-button-custom-format[aria-label*=${toolOptionAriaLabel}]`)
50
+ } else {
51
+ return cy.get('[class*="CustomizedToolBarOptionsstyles__DragAndDropWrapper"]').eq(1).find('.icon-button-custom-format')
52
+ }
53
+ },
54
+ graphControlOptionEditTab: (controlOptionAriaLabel = null) => {
55
+ if (controlOptionAriaLabel) {
56
+ return cy.get('[class*="GraphingToolsstyles__ControlsWrapper"]').eq(0).find(`button[aria-label*=${controlOptionAriaLabel}]`)
57
+ } else {
58
+ return cy.get('[class*="GraphingToolsstyles__ControlsWrapper"]').eq(0).find('button')
59
+ }
60
+ },
61
+ graphControlOptionSpecifyCorrectAnswer: (controlOptionAriaLabel = null) => {
62
+ if (controlOptionAriaLabel) {
63
+ return cy.get('[class*="GraphingToolsstyles__ControlsWrapper"]').eq(1).find(`button[aria-label*=${controlOptionAriaLabel}]`)
64
+ } else {
65
+ return cy.get('[class*="GraphingToolsstyles__ControlsWrapper"]').eq(1).find('button')
66
+ }
67
+ },
68
+ graphControlOptionPreviewTab: (controlOptionAriaLabel = null) => {
69
+ if (controlOptionAriaLabel) {
70
+ return cy.get(`[class*="GraphingQuestion"] [class*="GraphingToolsstyles__ControlsWrapper"] button[aria-label*=${controlOptionAriaLabel}]`)
71
+ } else {
72
+ return cy.get('[class*="GraphingQuestion"] [class*="GraphingToolsstyles__ControlsWrapper"] button')
73
+ }
74
+ },
75
+ graphSpecifyCorrectAnswerSection: () => cy.get('.MuiAccordion-region .ngie-jxgbox svg'),
76
+ graphPreviewTab: () => cy.get('[class*="GraphingQuestion"] .ngie-jxgbox svg'),
77
+ graphLinePreviewTab: () => cy.get('[class*="GraphingQuestion"] .ngie-jxgbox svg').eq(0).find('line[tabindex="null"]'),
78
+ graphLineSegmentsPreviewTab: () => cy.get('[class*="GraphingQuestion"] .ngie-jxgbox svg').eq(0).find('line[tabindex="0"]'),
79
+ graphCirclePreviewTab: () => cy.get('[class*="GraphingQuestion"] .ngie-jxgbox svg').eq(0).find('ellipse[stroke-linecap="butt"]'),
80
+ graphPolygonPreviewTab: () => cy.get('[class*="GraphingQuestion"] .ngie-jxgbox svg').eq(0).find('polygon'),
81
+ graphSineAndParabolaPreviewTab: () => cy.get('[class*="GraphingQuestion"] .ngie-jxgbox svg').eq(0).find('path[stroke-linecap="butt"][stroke-opacity="1"]'),
82
+ graphLabelInputField: () => cy.get('.label-tool:visible'),
83
+
84
+ //Background
85
+ patternRadioButton: () => cy.get('[type="radio"][aria-label="Pattern"]'),
86
+
87
+ //Reset popup
88
+ resetPopupConfirmResetButton: () => cy.get('.accept-button'),
89
+
90
+ //Grading view
91
+ gradingViewQuestionSineWave: () => cy.get('.ngie-jxgbox').eq(0).find('path[stroke-linecap="butt"][stroke-opacity="1"]'),
92
+ gradingViewQuestionCircle: () => cy.get('.ngie-jxgbox').eq(0).find('ellipse[stroke-linecap="butt"]'),
93
+ gradingViewQuestionLine: () => cy.get('.ngie-jxgbox').eq(0).find('line[tabindex="null"]'),
94
+
95
+ //Correct answer section
96
+ correctAnswerLabel: () => cy.get('[class*="AnswerLabel"]'),
97
+ graphCorrectAnswerSection: () => cy.get('[class*="GraphingQuestion"] .ngie-jxgbox svg'),
98
+ graphSineWaveCorrectAnswerSection: () => cy.get('[class*="GraphingQuestion"] .ngie-jxgbox').eq(1).find('path[stroke-linecap="butt"][stroke-opacity="1"]'),
99
+ graphCircleCorrectAnswerSection: () => cy.get('[class*="GraphingQuestion"] .ngie-jxgbox').eq(1).find('ellipse[stroke-linecap="butt"]'),
100
+ graphLineCorrectAnswerSection: () => cy.get('[class*="GraphingQuestion"] .ngie-jxgbox').eq(1).find('line[tabindex="null"]'),
101
+ graphPolygonCorrectAnswerSection: () => cy.get('[class*="GraphingQuestion"] .ngie-jxgbox').eq(1).find('polygon'),
102
+ graphSineWaveCorrectAnswerSection: () => cy.get('[class*="GraphingQuestion"] .ngie-jxgbox').eq(1).find('path[stroke-linecap="butt"][stroke-opacity="1"]'),
103
+ correctIncorrectStatusMessageText: () => cy.get('[class*="Graphingstyles__CorrectIncorrectWrapper"]'),
104
+ incorrectIcon: () => cy.get('[data-icon="Incorrect"]'),
105
+ correctIcon: () => cy.get('[data-icon="CorrectAnswer"]'),
106
+ }
107
+
108
+ const steps = {
109
+ ...createQuestionBasePage.steps,
110
+ ...questionInstructionsComponent.steps,
111
+ ...scoringSectionBaseEditTab.steps,
112
+ ...autoScoredScoringPreviewTab.steps,
113
+ ...autoScoredStudentViewSettings.steps,
114
+ ...autoScoredSpecifyCorrectAnswerSection.steps,
115
+
116
+ //Edit tab
117
+ /**
118
+ * This function selects tool options
119
+ * @param {string[]} toolOptionAriaLabelArray array aria-label of tool options
120
+ */
121
+ selectToolOptions: (toolOptionAriaLabelArray) => {
122
+ toolOptionAriaLabelArray.forEach((toolOptionAriaLabel) => {
123
+ graphingPage.toolOptions(toolOptionAriaLabel)
124
+ .click();
125
+ });
126
+ },
127
+
128
+ checkSnapToGridCheckbox: () => {
129
+ graphingPage.snapToGridCheckbox()
130
+ .click();
131
+ },
132
+
133
+ checkPatternBackground: () => {
134
+ graphingPage.patternRadioButton()
135
+ .click();
136
+ },
137
+
138
+ /**
139
+ * This function plots points on the graph on Edit tab
140
+ * @param {Object[]} coordinates - An array containing x and y coordinates along with their ranges
141
+ * @param {number} coordinates[].x - x coordinate to be plotted on the graph
142
+ * @param {number} coordinates[].xRange - range of x coordinate
143
+ * @param {number} coordinates[].y - y coordinate to be plotted on the graph
144
+ * @param {number} coordinates[].yRange - range of y coordinate
145
+ */
146
+ plotPointsOnGraphEditTab: (coordinates) => {
147
+ coordinates.forEach(({ x, xRange, y, yRange }) => {
148
+ graphingPage.graphEditTab()
149
+ .then(($graphElement) => {
150
+ const graphWidth = $graphElement[0].clientWidth;
151
+ const graphHeight = $graphElement[0].clientHeight;
152
+ const originX = graphWidth / 2;
153
+ const originY = graphHeight / 2;
154
+ const xPixel = originX + x * (graphWidth / xRange);
155
+ const yPixel = originY - y * (graphHeight / yRange);
156
+ graphingPage.graphEditTab()
157
+ .click(xPixel, yPixel, { force: true });
158
+ });
159
+ });
160
+ },
161
+
162
+ /**
163
+ * This function verifies the plotted points on the graph on Edit tab
164
+ * @param {Object[]} coordinates - An array containing x and y coordinates along with their ranges
165
+ * @param {number} coordinates[].x - x coordinate to be plotted on the graph
166
+ * @param {number} coordinates[].xRange - range of x coordinate
167
+ * @param {number} coordinates[].y - y coordinate to be plotted on the graph
168
+ * @param {number} coordinates[].yRange - range of y coordinate
169
+ */
170
+ verifyPointsPlottedOnEditTabGraph: (coordinates) => {
171
+ coordinates.forEach(({ x, xRange, y, yRange }) => {
172
+ graphingPage.graphEditTab()
173
+ .then(($graphElement) => {
174
+ const graphWidth = $graphElement[0].clientWidth;
175
+ const graphHeight = $graphElement[0].clientHeight;
176
+ const originX = graphWidth / 2;
177
+ const originY = graphHeight / 2;
178
+ const xPixel = originX + x * (graphWidth / xRange);
179
+ const yPixel = originY - y * (graphHeight / yRange);
180
+ cy.get(`[class*="GraphingWrapper"] .ngie-jxgbox svg ellipse[display="inline"][cx="${xPixel}"][cy="${yPixel}"]`)
181
+ .should('be.visible');
182
+ });
183
+ });
184
+ },
185
+
186
+ /**
187
+ * @description This function selects the tool option from graph
188
+ * @param {string} toolOption aria label of the tool option to be selected
189
+ */
190
+ selectGraphToolOptionEditTab: (toolOption) => {
191
+ graphingPage.graphToolOptionEditTab(toolOption)
192
+ .click();
193
+ },
194
+
195
+
196
+ //Specify correct answer section
197
+ /**
198
+ * This function plots points on the graph in set correct answer section
199
+ * @param {Object[]} coordinates - An array containing x and x coordinates along with their range
200
+ * @param {number} coordinates[].x - x coordinate to be plotted on the graph
201
+ * @param {number} coordinates[].xRange - range of x coordinate
202
+ * @param {number} coordinates[].y - y coordinate to be plotted on the graph
203
+ * @param {number} coordinates[].yRange - range of y coordinate
204
+ */
205
+ plotPointsOnGraphSpecifyCorrectAnswerSection: (coordinates) => {
206
+ coordinates.forEach(({ x, xRange, y, yRange }) => {
207
+ graphingPage.graphSpecifyCorrectAnswerSection()
208
+ .then(($graphElement) => {
209
+ const graphWidth = $graphElement[0].clientWidth;
210
+ const graphHeight = $graphElement[0].clientHeight;
211
+ const originX = graphWidth / 2;
212
+ const originY = graphHeight / 2;
213
+ const xPixel = originX + x * (graphWidth / xRange);
214
+ const yPixel = originY - y * (graphHeight / yRange);
215
+ graphingPage.graphSpecifyCorrectAnswerSection()
216
+ .click(xPixel, yPixel, { force: true });
217
+ });
218
+ });
219
+ },
220
+
221
+ /**
222
+ * This function verifies plotted points on the graph in set correct answer section
223
+ * @param {Object[]} coordinates - An array containing x and x coordinates along with their range
224
+ * @param {number} coordinates[].x - x coordinate to be plotted on the graph
225
+ * @param {number} coordinates[].xRange - range of x coordinate
226
+ * @param {number} coordinates[].y - y coordinate to be plotted on the graph
227
+ * @param {number} coordinates[].yRange - range of y coordinate
228
+ */
229
+ verifyPointsPlottedOnSpecifyCorrectAnswerSection: (coordinates) => {
230
+ coordinates.forEach(({ x, xRange, y, yRange }) => {
231
+ graphingPage.graphSpecifyCorrectAnswerSection()
232
+ .then(($graphElement) => {
233
+ const graphWidth = $graphElement[0].clientWidth;
234
+ const graphHeight = $graphElement[0].clientHeight;
235
+ const originX = graphWidth / 2;
236
+ const originY = graphHeight / 2;
237
+ const xPixel = originX + x * (graphWidth / xRange);
238
+ const yPixel = originY - y * (graphHeight / yRange);
239
+ cy.get(`.MuiAccordion-region .ngie-jxgbox svg ellipse[display="inline"][cx="${xPixel}"][cy="${yPixel}"]`)
240
+ .should('be.visible');
241
+ });
242
+ });
243
+ },
244
+
245
+ /**
246
+ * @description This function selects the tool option from graph
247
+ * @param {string} toolOption aria label of the tool option to be selected
248
+ */
249
+ selectGraphToolOptionSpecifyCorrectAnswer: (toolOption) => {
250
+ graphingPage.graphToolOptionSpecifyCorrectAnswer(toolOption)
251
+ .click();
252
+ },
253
+
254
+
255
+ //Preview tab
256
+ /**
257
+ * This function plots points on the graph in preview tab
258
+ * @param {Object[]} coordinates - An array containing x and x coordinates along with their range
259
+ * @param {number} coordinates[].x - x coordinate to be plotted on the graph
260
+ * @param {number} coordinates[].xRange - range of x coordinate
261
+ * @param {number} coordinates[].y - y coordinate to be plotted on the graph
262
+ * @param {number} coordinates[].yRange - range of y coordinate
263
+ */
264
+ plotPointsOnGraphPreviewTab: (coordinates) => {
265
+ coordinates.forEach(({ x, xRange, y, yRange }) => {
266
+ graphingPage.graphPreviewTab()
267
+ .then(($graphElement) => {
268
+ const graphWidth = $graphElement[0].clientWidth;
269
+ const graphHeight = $graphElement[0].clientHeight;
270
+ const originX = graphWidth / 2;
271
+ const originY = graphHeight / 2;
272
+ const xPixel = originX + x * (graphWidth / xRange);
273
+ const yPixel = originY - y * (graphHeight / yRange);
274
+ graphingPage.graphPreviewTab()
275
+ .click(xPixel, yPixel, { force: true });
276
+ });
277
+ });
278
+ },
279
+
280
+ /**
281
+ * This function verifies plotted points on the graph in preview tab
282
+ * @param {Object[]} coordinates - An array containing x and x coordinates along with their range
283
+ * @param {number} coordinates[].x - x coordinate to be plotted on the graph
284
+ * @param {number} coordinates[].xRange - range of x coordinate
285
+ * @param {number} coordinates[].y - y coordinate to be plotted on the graph
286
+ * @param {number} coordinates[].yRange - range of y coordinate
287
+ */
288
+ verifyPointsPlottedOnPreviewTab: (coordinates) => {
289
+ coordinates.forEach(({ x, xRange, y, yRange }) => {
290
+ graphingPage.graphPreviewTab()
291
+ .then(($graphElement) => {
292
+ const graphWidth = $graphElement[0].clientWidth;
293
+ const graphHeight = $graphElement[0].clientHeight;
294
+ const originX = graphWidth / 2;
295
+ const originY = graphHeight / 2;
296
+ const xPixel = originX + x * (graphWidth / xRange);
297
+ const yPixel = originY - y * (graphHeight / yRange);
298
+ cy.get(`[class*="GraphingQuestion"] .ngie-jxgbox svg ellipse[display="inline"][cx="${xPixel}"][cy="${yPixel}"]`)
299
+ .should('be.visible');
300
+ });
301
+ });
302
+ },
303
+
304
+ /**
305
+ * This function verifies the plotted points are incorrect
306
+ * @param {Object[]} coordinates - An array containing x and x coordinates along with their range
307
+ * @param {number} coordinates[].x - x coordinate to be plotted on the graph
308
+ * @param {number} coordinates[].xRange - range of x coordinate
309
+ * @param {number} coordinates[].y - y coordinate to be plotted on the graph
310
+ * @param {number} coordinates[].yRange - range of y coordinate
311
+ */
312
+ verifyIncorrectPointsPlottedOnGraphPreviewTab: (coordinates) => {
313
+ coordinates.forEach(({ x, xRange, y, yRange }) => {
314
+ graphingPage.graphPreviewTab()
315
+ .then(($graphElement) => {
316
+ const graphWidth = $graphElement[0].clientWidth;
317
+ const graphHeight = $graphElement[0].clientHeight;
318
+ const originX = graphWidth / 2;
319
+ const originY = graphHeight / 2;
320
+ const xPixel = originX + x * (graphWidth / xRange);
321
+ const yPixel = originY - y * (graphHeight / yRange);
322
+ cy.get(`[class*="GraphingQuestion"] .ngie-jxgbox svg ellipse[display="inline"][cx="${xPixel}"][cy="${yPixel}"]`)
323
+ .should('have.css', 'fill', css.color.incorrectAnswer);
324
+ });
325
+ });
326
+ },
327
+
328
+ /**
329
+ * This function verifies the plotted points are correct
330
+ * @param {Object[]} coordinates - An array containing x and x coordinates along with their range
331
+ * @param {number} coordinates[].x - x coordinate to be plotted on the graph
332
+ * @param {number} coordinates[].xRange - range of x coordinate
333
+ * @param {number} coordinates[].y - y coordinate to be plotted on the graph
334
+ * @param {number} coordinates[].yRange - range of y coordinate
335
+ */
336
+ verifyCorrectPointsPlottedOnGraphPreviewTab: (coordinates) => {
337
+ coordinates.forEach(({ x, xRange, y, yRange }) => {
338
+ graphingPage.graphPreviewTab()
339
+ .then(($graphElement) => {
340
+ const graphWidth = $graphElement[0].clientWidth;
341
+ const graphHeight = $graphElement[0].clientHeight;
342
+ const originX = graphWidth / 2;
343
+ const originY = graphHeight / 2;
344
+ const xPixel = originX + x * (graphWidth / xRange);
345
+ const yPixel = originY - y * (graphHeight / yRange);
346
+ cy.get(`[class*="GraphingQuestion"] .ngie-jxgbox svg ellipse[display="inline"][cx="${xPixel}"][cy="${yPixel}"]`)
347
+ .should('have.css', 'fill', css.color.correctAnswer);
348
+ });
349
+ });
350
+ },
351
+
352
+ /**
353
+ * @description This function selects the tool option from graph
354
+ * @param {string} toolOption aria label of the tool option to be selected
355
+ */
356
+ selectGraphToolOptionPreviewTab: (toolOption) => {
357
+ graphingPage.graphToolOptionPreviewTab(toolOption)
358
+ .click();
359
+ },
360
+
361
+ /**
362
+ * @description This function selects the control option from graph
363
+ * @param {string} controlOption aria label of the control option to be selected
364
+ */
365
+ selectGraphControlOptionPreviewTab: (controlOption) => {
366
+ graphingPage.graphControlOptionPreviewTab(controlOption)
367
+ .click();
368
+ },
369
+
370
+ /**
371
+ * @description This function verifies the tool option is in selected state
372
+ * @param {string} toolOption aria label of the tool option to be verified selected
373
+ */
374
+ verifyToolOptionSelectedPreviewTab: (toolOptionAriaLabel) => {
375
+ graphingPage.graphToolOptionPreviewTab(toolOptionAriaLabel)
376
+ .should('have.class', 'single-select-toggle-button-selected');
377
+ },
378
+
379
+ /**
380
+ * @description This function verifies the tool option is not in selected state
381
+ * @param {string} toolOption aria label of the tool option to be verified not selected
382
+ */
383
+ verifyToolOptionNotSelectedPreviewTab: (toolOptionAriaLabelArray) => {
384
+ toolOptionAriaLabelArray.forEach((toolOptionAriaLabel) => {
385
+ graphingPage.graphToolOptionPreviewTab(toolOptionAriaLabel)
386
+ .should('not.have.class', 'single-select-toggle-button-selected');
387
+ });
388
+ },
389
+
390
+ /**
391
+ * This function enters text in the label input field
392
+ * @param {string} input Label to be input
393
+ */
394
+ enterTextInGraphLabelInputField: (input) => {
395
+ graphingPage.graphLabelInputField()
396
+ .type(input)
397
+ .should('have.text', input);
398
+ },
399
+
400
+ confirmReset: () => {
401
+ graphingPage.resetPopupConfirmResetButton()
402
+ .click();
403
+ },
404
+
405
+ /**
406
+ * This function plots points on the graph in correct answer section
407
+ * @param {Object[]} coordinates - An array containing x and x coordinates along with their range
408
+ * @param {number} coordinates[].x - x coordinate to be plotted on the graph
409
+ * @param {number} coordinates[].xRange - range of x coordinate
410
+ * @param {number} coordinates[].y - y coordinate to be plotted on the graph
411
+ * @param {number} coordinates[].yRange - range of y coordinate
412
+ */
413
+ verifyPointsPlottedOnCorrectAnswerSection: (coordinates) => {
414
+ coordinates.forEach(({ x, xRange, y, yRange }) => {
415
+ graphingPage.graphCorrectAnswerSection()
416
+ .then(($graphElement) => {
417
+ const graphWidth = $graphElement[0].clientWidth;
418
+ const graphHeight = $graphElement[0].clientHeight;
419
+ const originX = graphWidth / 2;
420
+ const originY = graphHeight / 2;
421
+ const xPixel = originX + x * (graphWidth / xRange);
422
+ const yPixel = originY - y * (graphHeight / yRange);
423
+ cy.get('[class*="GraphingQuestion"] .ngie-jxgbox svg').eq(1).find(`ellipse[display="inline"][cx="${xPixel}"][cy="${yPixel}"]`)
424
+ .should('be.visible');
425
+ });
426
+ });
427
+ },
428
+
429
+ /**
430
+ * This function verifies the plotted points are correct
431
+ * @param {Object[]} coordinates - An array containing x and x coordinates along with their range
432
+ * @param {number} coordinates[].x - x coordinate to be plotted on the graph
433
+ * @param {number} coordinates[].xRange - range of x coordinate
434
+ * @param {number} coordinates[].y - y coordinate to be plotted on the graph
435
+ * @param {number} coordinates[].yRange - range of y coordinate
436
+ */
437
+ verifyCorrectPointsPlottedOnGraphCorrectAnswerSection: (coordinates) => {
438
+ coordinates.forEach(({ x, xRange, y, yRange }) => {
439
+ graphingPage.graphCorrectAnswerSection()
440
+ .then(($graphElement) => {
441
+ const graphWidth = $graphElement[0].clientWidth;
442
+ const graphHeight = $graphElement[0].clientHeight;
443
+ const originX = graphWidth / 2;
444
+ const originY = graphHeight / 2;
445
+ const xPixel = originX + x * (graphWidth / xRange);
446
+ const yPixel = originY - y * (graphHeight / yRange);
447
+ cy.get('[class*="GraphingQuestion"] .ngie-jxgbox svg').eq(1).find(`ellipse[display="inline"][cx="${xPixel}"][cy="${yPixel}"]`)
448
+ .should('have.css', 'fill', css.color.correctAnswer);
449
+ });
450
+ });
451
+ },
452
+
453
+ /**
454
+ * @param {("correct" | "incorrect")} answerStatus - The status of the answer.
455
+ * @description Verifies the visibility and content of the correct/incorrect answer label block.
456
+ * If the answer is correct, it also verifies the visibility of the correct icon;
457
+ * otherwise, it verifies the visibility of the incorrect icon.
458
+ */
459
+ verifyCorrectIncorrectAnswerLabel: (answerStatus) => {
460
+ utilities.verifyInnerText(graphingPage.correctIncorrectStatusMessageText(), `Your answer is\n${answerStatus}`)
461
+ graphingPage.correctIncorrectStatusMessageText()
462
+ .within(() => {
463
+ if (answerStatus === 'correct') {
464
+ utilities.verifyElementVisibilityState(graphingPage.correctIcon(), 'visible');
465
+ } else {
466
+ utilities.verifyElementVisibilityState(graphingPage.incorrectIcon(), 'visible');
467
+ }
468
+ });
469
+ },
470
+
471
+ verifyCorrectAnswerSectionNotExist: () => {
472
+ utilities.verifyElementVisibilityState(utilities.getNthElement(graphingPage.graphCorrectAnswerSection(), 1), 'notExist');
473
+ }
474
+ }
475
+
476
+ const tests = {
477
+ ...autoScoredScoringPreviewTab.tests,
478
+ }
479
+
480
+ export const graphingPage = {
481
+ ...selectors,
482
+ steps,
483
+ tests
484
+ }
@@ -40,4 +40,7 @@ export * from './drawingResponsePage';
40
40
  export * from './protractorPage';
41
41
  export * from './textEntryMathPage';
42
42
  export * from './fillInTheGapsOverImageDragAndDropPage';
43
- export * from './textEntryMathWithImagePage';
43
+ export * from './textEntryMathWithImagePage';
44
+ export * from './graphingPage';
45
+ export * from './simpleCalculatorPage'
46
+ export * from './contentBlocksPage';