itemengine-cypress-automation 1.0.185-repoUpdate26April-b17eb46.0 → 1.0.185

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,36 +0,0 @@
1
- import utilities from "../../support/helpers/utilities";
2
-
3
- const selectors = {
4
- numberLineSpecifyCorrectAnswer: () => cy.get('.ngie-accordion .ngie-jxgbox svg').eq(0),
5
- numberLinePreviewTab: () => cy.get('[class*="question-preview-wrapper"] .ngie-jxgbox svg').eq(0),
6
- numberLinePointPreviewTab: () => cy.get('[class*="question-preview-wrapper"] .ngie-jxgbox').eq(0).find('svg ellipse[display="inline"]'),
7
- correctAnswersLabel: () => cy.get('[class*="AnswerLabel"]'),
8
- correctIcon: () => cy.get('[data-icon="CorrectAnswer"]'),
9
- incorrectIcon: () => cy.get('[data-icon="Incorrect"]'),
10
- correctIncorrectAnswerTextWrapper: () => cy.get('[class*="CorrectIncorrectWrapper"]'),
11
- }
12
-
13
- const steps = {
14
- /**
15
- * @param {("correct" | "incorrect")} answerStatus - The status of the answer.
16
- * @description Verifies the visibility and content of the correct/incorrect answer label block.
17
- * If the answer is correct, it also verifies the visibility of the correct icon;
18
- * otherwise, it verifies the visibility of the incorrect icon.
19
- */
20
- verifyCorrectIncorrectAnswerLabel: (answerStatus) => {
21
- utilities.verifyInnerText(numberLineCommonComponent.correctIncorrectAnswerTextWrapper(), `Your answer is\n${answerStatus}`)
22
- numberLineCommonComponent.correctIncorrectAnswerTextWrapper()
23
- .within(() => {
24
- if (answerStatus === 'correct') {
25
- utilities.verifyElementVisibilityState(numberLineCommonComponent.correctIcon(), 'visible');
26
- } else {
27
- utilities.verifyElementVisibilityState(numberLineCommonComponent.incorrectIcon(), 'visible');
28
- }
29
- });
30
- },
31
- }
32
-
33
- export const numberLineCommonComponent = {
34
- ...selectors,
35
- steps
36
- }
@@ -1,46 +0,0 @@
1
- import utilities from "../../support/helpers/utilities";
2
-
3
- const css = Cypress.env('css');
4
-
5
- const selectors = {
6
- styleAndLayoutCustomizationAccordion: () => cy.get('.style-and-layout-customization-wrapper .MuiAccordionSummary-root'),
7
- }
8
-
9
- const steps = {
10
- expandStyleAndLayoutCustomizationAccordion: () => {
11
- styleAndLayoutCustomizationAccordionComponent.styleAndLayoutCustomizationAccordion()
12
- .click()
13
- .should('have.attr', 'aria-expanded', 'true');
14
- },
15
- }
16
-
17
- const tests = {
18
- verifyStyleAndLayoutCustomizationAccordionProperties: () => {
19
- it('By default \'Style and layout customization\' accordion should be collapsed and by clicking on the \'Style and layout customization\' accordion, user should be able to expand the accordion', () => {
20
- styleAndLayoutCustomizationAccordionComponent.styleAndLayoutCustomizationAccordion()
21
- .should('have.attr', 'aria-expanded', 'false');
22
- styleAndLayoutCustomizationAccordionComponent.steps.expandStyleAndLayoutCustomizationAccordion();
23
- });
24
-
25
- it('CSS of \'Style and layout customization\' accordion', { tags: 'css' }, () => {
26
- utilities.verifyCSS(styleAndLayoutCustomizationAccordionComponent.styleAndLayoutCustomizationAccordion().find('.accordion_label'), {
27
- 'color': css.color.accordionLabel,
28
- 'font-size': css.fontSize.default,
29
- 'font-weight': css.fontWeight.bold
30
- });
31
- utilities.verifyCSS(styleAndLayoutCustomizationAccordionComponent.styleAndLayoutCustomizationAccordion().find('svg'), {
32
- 'fill': css.color.activeButtons
33
- });
34
- });
35
-
36
- it('Accessibility of \'Style and layout customization\' accordion', { tags: 'a11y' }, () => {
37
- cy.checkAccessibility(styleAndLayoutCustomizationAccordionComponent.styleAndLayoutCustomizationAccordion().parents('.style-and-layout-customization-wrapper'));
38
- });
39
- }
40
- }
41
-
42
- export const styleAndLayoutCustomizationAccordionComponent = {
43
- ...selectors,
44
- steps,
45
- tests
46
- }
@@ -1,333 +0,0 @@
1
- import constants from '../fixtures/constants';
2
- import utilities from '../support/helpers/utilities';
3
- import { createQuestionBasePage, questionInstructionsComponent, scoringSectionBaseEditTab, ckEditorToolbar, equationEditorFlyout, autoScoredScoringPreviewTab, autoScoredStudentViewSettings, numberLineCommonComponent, autoScoredSpecifyCorrectAnswerSection, autoScoredScoringSectionMultiResponseType } from './components';
4
- const css = Cypress.env('css');
5
-
6
- const selectors = {
7
- ...questionInstructionsComponent,
8
- ...numberLineCommonComponent,
9
- //Label section
10
- labelInputField: () => cy.get('.edit-question-enter-option-form-element [role="textbox"]'),
11
- addLabelButton: () => cy.get('.inline-add-option-button-wrapper button'),
12
- labelNumberLineTab: () => cy.get('[data-ngie-testid="label-number-line-tab"]'),
13
- //Specify correct answer section
14
- draggableLabelsSpecifyCorrectAnswer: () => cy.get('.label-tool'),
15
-
16
- //Preview tab
17
- draggableLabelsPreviewTab: () => cy.get('[class*="question-preview-wrapper"] .label-tool'),
18
- labelContainerPreviewTab: () => cy.get('[class*="question-preview-wrapper"] .items-container'),
19
-
20
- //Correct answer section
21
- numberLineCorrectAnswerSection: () => cy.get('[class*="question-preview-wrapper"] .ngie-jxgbox svg').eq(2),
22
- numberLinePointCorrectAnswerSection: () => cy.get('[class*="question-preview-wrapper"] .ngie-jxgbox').last().find('svg ellipse[display="inline"]')
23
- }
24
-
25
- const steps = {
26
- ...createQuestionBasePage.steps,
27
- ...questionInstructionsComponent.steps,
28
- ...scoringSectionBaseEditTab.steps,
29
- ...ckEditorToolbar.steps,
30
- ...equationEditorFlyout.steps,
31
- ...autoScoredScoringPreviewTab.steps,
32
- ...autoScoredStudentViewSettings.steps,
33
- ...numberLineCommonComponent.steps,
34
- ...autoScoredSpecifyCorrectAnswerSection.steps,
35
- ...autoScoredScoringSectionMultiResponseType.steps,
36
-
37
- navigateToLabelNumberLineTab: () => {
38
- numberLineLabelPage.labelNumberLineTab()
39
- .click();
40
- },
41
-
42
- addLabel: () => {
43
- numberLineLabelPage.addLabelButton()
44
- .click()
45
- },
46
-
47
- /**
48
- * This function is used to focus in the label input field
49
- * @param {number} index of the label input field
50
- */
51
- focusInLabelInputField: (index) => {
52
- utilities.getNthElement(numberLineLabelPage.labelInputField(), index)
53
- .click();
54
- },
55
-
56
- /**
57
- * @param {number} index of label input field
58
- * @param {string} textContent to enter text in the label input field
59
- */
60
- enterTextInLabelInputField: (index, textContent) => {
61
- numberLineLabelPage.labelInputField()
62
- .eq(index)
63
- .type(textContent)
64
- },
65
-
66
- enterTextInMultipleLabelInputFields: (labelsArray) => {
67
- labelsArray.forEach((label, index) => {
68
- numberLineLabelPage.labelInputField()
69
- .eq(index)
70
- .type(label)
71
- .blur()
72
- .should('have.text', label)
73
- });
74
- },
75
-
76
- //Specify correct answer section
77
- /**
78
- * This function clicks and drops label on the specify correct answer section line
79
- * @param {string} label to be dropped on the number line
80
- * @param {(horizontal|vertical)} orientation of the number line
81
- * @param {number} range of the number line
82
- * @param {number} coordinate of the number line to drop the label
83
- */
84
- clickAndDropLabelOnNumberLineSpecifyCorrectAnswer: (label, orientation, range, coordinate) => {
85
- numberLineLabelPage.draggableLabelsSpecifyCorrectAnswer()
86
- .contains(label)
87
- .click();
88
- numberLineLabelPage.numberLineSpecifyCorrectAnswer()
89
- .then(($graphElement) => {
90
- const graphWidth = $graphElement[0].clientWidth;
91
- const graphHeight = 180;
92
- const originX = graphWidth / 2;
93
- const originY = graphHeight / 2;
94
- if (orientation === 'horizontal') {
95
- const xPixel = originX + coordinate * (graphWidth / range);
96
- numberLineLabelPage.numberLineSpecifyCorrectAnswer()
97
- .click(xPixel, originY, { force: true });
98
- } else {
99
- const yPixel = originY - coordinate * (graphWidth / range);
100
- numberLineLabelPage.numberLineSpecifyCorrectAnswer()
101
- .click(originX, yPixel, { force: true });
102
- }
103
- });
104
- },
105
-
106
- /**
107
- * This function verifies plotted points on the number line on the Edit tab.
108
- * @param {number} range - The range of x coordinates.
109
- * @param {number[]} coordinates - An array containing x coordinates to be plotted on the graph.
110
- */
111
- verifyPointsPlottedOnNumberLineSpecifyCorrectAnswer: (range, coordinates) => {
112
- coordinates.forEach(x => {
113
- numberLineLabelPage.numberLineSpecifyCorrectAnswer()
114
- .then(($graphElement) => {
115
- let graphWidth = $graphElement[0].clientWidth;
116
- const originX = graphWidth / 2;
117
- const xPixel = originX + x * (graphWidth / range);
118
- cy.get(`.ngie-accordion .ngie-jxgbox svg ellipse[cx*="${Math.floor(xPixel)}"]`)
119
- .should('exist');
120
- });
121
- });
122
- },
123
-
124
- /**
125
- * @description Verifies that the image in the Preview tab has the correct source and alt text.
126
- * @param {number} index - The index of the option in the Preview tab.
127
- */
128
- verifyImageInPreviewTab: (index) => {
129
- numberLineLabelPage.draggableLabelsPreviewTab()
130
- .eq(index)
131
- .find('img')
132
- .should('have.attr', 'src', constants.foxImageLink)
133
- .and('have.attr', 'alt', constants.foxImageAltText);
134
- },
135
-
136
- /**
137
- * @description Verifies that the bold text in the Preview tab is correct.
138
- * @param {number} index - The index of the option in the Preview tab.
139
- */
140
- verifyBoldTextInPreviewTab: (index) => {
141
- numberLineLabelPage.draggableLabelsPreviewTab()
142
- .eq(index)
143
- .find('strong')
144
- .should('have.text', 'This is a bold option');
145
- },
146
-
147
- /**
148
- * @description Verifies that the equation text in the Preview tab is correct.
149
- * @param {number} index - The index of the option in the Preview tab.
150
- */
151
- verifyEquationTextInPreviewTab: (index) => {
152
- numberLineLabelPage.draggableLabelsPreviewTab()
153
- .eq(index)
154
- .find('[role="math"]')
155
- .should('have.attr', 'aria-label', constants.CKEditorInputFieldEnteredEquationAriaLabel)
156
- .contains(constants.CKEditorInputFieldEnteredEquationText);
157
- },
158
-
159
- /**
160
- * This function verifies the text content of label
161
- * @param {number} index of the draggable label
162
- * @param {string} textContent of the label
163
- */
164
- verifyLabelTextContentPreviewTab: (index, textContent) => {
165
- utilities.verifyInnerText(utilities.getNthElement(numberLineLabelPage.draggableLabelsPreviewTab(), index), textContent)
166
- },
167
-
168
- //Preview tab
169
- /**
170
- * This function clicks and drops label on the specify correct answer section line
171
- * @param {string} label to be dropped on the number line
172
- * @param {(horizontal|vertical)} orientation of the number line
173
- * @param {number} range of the number line
174
- * @param {number} coordinate of the number line to drop the label
175
- */
176
- clickAndDropLabelOnNumberLinePreviewTab: (label, orientation, range, coordinate) => {
177
- numberLineLabelPage.draggableLabelsPreviewTab()
178
- .contains(label)
179
- .click();
180
- numberLineLabelPage.numberLinePreviewTab()
181
- .then(($graphElement) => {
182
- const graphWidth = $graphElement[0].clientWidth;
183
- const graphHeight = 120;
184
- const originX = graphWidth / 2;
185
- const originY = graphHeight / 2;
186
- if (orientation === 'horizontal') {
187
- const xPixel = originX + coordinate * (graphWidth / range);
188
- numberLineLabelPage.numberLinePreviewTab()
189
- .click(xPixel, originY, { force: true });
190
- } else {
191
- const yPixel = originY - coordinate * (graphWidth / range);
192
- numberLineLabelPage.numberLinePreviewTab()
193
- .click(originX, yPixel, { force: true });
194
- }
195
- });
196
- },
197
-
198
- /**
199
- * This function verifies plotted points on the number line on the preview tab.
200
- * @param {number} range - The range of x coordinates.
201
- * @param {number[]} coordinates - An array containing x coordinates to be plotted on the graph.
202
- */
203
- verifyPointsPlottedOnNumberLinePreviewTab: (range, coordinates) => {
204
- coordinates.forEach(x => {
205
- numberLineLabelPage.numberLinePreviewTab()
206
- .then(($graphElement) => {
207
- const graphWidth = $graphElement[0].clientWidth;
208
- const originX = graphWidth / 2;
209
- const xPixel = originX + x * (graphWidth / range);
210
- cy.get('[class*="question-preview-wrapper"] .ngie-jxgbox').eq(0).find(`svg ellipse[cx*="${Math.floor(xPixel)}"]`)
211
- .should('exist');
212
- });
213
- });
214
- },
215
-
216
- /**
217
- * This function verifies plotted points on the number line on the preview tab.
218
- * @param {number} range - The range of x coordinates.
219
- * @param {number[]} coordinates - An array containing x coordinates to be plotted on the graph.
220
- */
221
- verifyIncorrectResponseOnNumberLinePreviewTab: (label, range, coordinate) => {
222
- numberLineLabelPage.numberLinePreviewTab()
223
- .then(($graphElement) => {
224
- const graphWidth = $graphElement[0].clientWidth;
225
- const originX = graphWidth / 2;
226
- const xPixel = originX + coordinate * (graphWidth / range);
227
- cy.get('[class*="question-preview-wrapper"] .ngie-jxgbox').eq(0).find(`svg ellipse[cx*="${Math.floor(xPixel)}"]`)
228
- .should('have.css', 'stroke', css.color.incorrectAnswer);
229
- });
230
- numberLineLabelPage.numberLinePreviewTab()
231
- .parents('.ngie-jxgbox')
232
- .within(() => {
233
- numberLineLabelPage.draggableLabelsSpecifyCorrectAnswer()
234
- .contains(label)
235
- .should('have.class', 'icon-incorrect-cross')
236
- .should('have.css', 'border', `1px solid ${css.color.incorrectAnswer}`)
237
- .verifyPseudoClassBeforeProperty('color', css.color.incorrectAnswer);
238
- });
239
- },
240
-
241
- /**
242
- * This function verifies plotted points on the number line on the preview tab.
243
- * @param {number} range - The range of x coordinates.
244
- * @param {number[]} coordinates - An array containing x coordinates to be plotted on the graph.
245
- */
246
- verifyCorrectResponseOnNumberLinePreviewTab: (label, range, coordinate) => {
247
- numberLineLabelPage.numberLinePreviewTab()
248
- .then(($graphElement) => {
249
- const graphWidth = $graphElement[0].clientWidth;
250
- const originX = graphWidth / 2;
251
- const xPixel = originX + coordinate * (graphWidth / range);
252
- cy.get('[class*="question-preview-wrapper"] .ngie-jxgbox').eq(0).find(`svg ellipse[cx*="${Math.floor(xPixel)}"]`)
253
- .should('have.css', 'stroke', css.color.correctAnswer);
254
- });
255
- numberLineLabelPage.numberLinePreviewTab()
256
- .parents('.ngie-jxgbox')
257
- .within(() => {
258
- numberLineLabelPage.draggableLabelsSpecifyCorrectAnswer()
259
- .contains(label)
260
- .should('have.class', 'icon-correct-tick')
261
- .should('have.css', 'border', `1px solid ${css.color.correctAnswer}`)
262
- .verifyPseudoClassBeforeProperty('color', css.color.correctAnswer);
263
- });
264
- },
265
-
266
- /**
267
- * This function verifies plotted points on the number line do not exist on the preview tab.
268
- * @param {number} range - The range of x coordinates.
269
- * @param {number[]} coordinates - An array containing x coordinates to be plotted on the graph.
270
- */
271
- verifyPointsNotExistOnNumberLinePreviewTab: (range, coordinates) => {
272
- coordinates.forEach(x => {
273
- numberLineLabelPage.numberLinePreviewTab()
274
- .then(($graphElement) => {
275
- const graphWidth = $graphElement[0].clientWidth;
276
- const originX = graphWidth / 2;
277
- const xPixel = originX + x * (graphWidth / range);
278
- cy.get('[class*="question-preview-wrapper"] .ngie-jxgbox').eq(0).find(`svg ellipse[cx*="${Math.floor(xPixel)}"]`)
279
- .should('not.exist');
280
- });
281
- });
282
- },
283
-
284
- //Correct answer section
285
- /**
286
- * This function verifies correct plotted points on the number line on c tab
287
- * @param {Object[]} coordinates - An array containing x and y coordinates along with their ranges
288
- * @param {number} range - range of x coordinate
289
- */
290
- verifyCorrectResponseOnNumberLineCorrectAnswerSection: (label, range, coordinate) => {
291
- numberLineLabelPage.numberLineCorrectAnswerSection()
292
- .then(($graphElement) => {
293
- const graphWidth = $graphElement[0].clientWidth;
294
- const originX = graphWidth / 2;
295
- const xPixel = originX + coordinate * (graphWidth / range);
296
- cy.get('[class*="question-preview-wrapper"] .ngie-jxgbox').eq(1).find(`svg ellipse[cx*="${Math.floor(xPixel)}"][display="inline"]`)
297
- .should('have.css', 'stroke', css.color.correctAnswer);
298
- });
299
- numberLineLabelPage.numberLineCorrectAnswerSection()
300
- .parents('.ngie-jxgbox')
301
- .within(() => {
302
- numberLineLabelPage.draggableLabelsSpecifyCorrectAnswer()
303
- .contains(label)
304
- .should('have.class', 'icon-correct-tick')
305
- .should('have.css', 'border', `1px solid ${css.color.correctAnswer}`)
306
- .verifyPseudoClassBeforeProperty('color', css.color.correctAnswer);
307
- });
308
- },
309
-
310
- /**
311
- * This function verifies the label in container and is disabled
312
- * @param {string} label in the container
313
- */
314
- verifyLabelIsDisabledForGradingView: (label) => {
315
- numberLineLabelPage.draggableLabelsPreviewTab()
316
- .contains(label)
317
- .should('have.class', 'disable-label-tool');
318
- },
319
-
320
- verifyCorrectAnswerSectionNotExist: () => {
321
- utilities.verifyElementVisibilityState(numberLineLabelPage.numberLineCorrectAnswerSection(), 'notExist');
322
- }
323
- }
324
-
325
- const tests = {
326
- ...autoScoredScoringPreviewTab.tests
327
- }
328
-
329
- export const numberLineLabelPage = {
330
- ...selectors,
331
- steps,
332
- tests
333
- }