itemengine-cypress-automation 1.0.210 → 1.0.211

Sign up to get free protection for your applications and to get access to all the features.
Files changed (140) hide show
  1. package/cypress/e2e/ILC/AudioResponseNew/compactRecorderStyle.smoke.js +1 -0
  2. package/cypress/e2e/ILC/AudioResponseNew/gradingViewAndCorrectAnswerViewContents.smoke.js +2 -2
  3. package/cypress/e2e/ILC/AudioResponseNew/previewContentsForAllViews.smoke.js +1 -1
  4. package/cypress/e2e/ILC/AudioResponseNew/standardRecorderStyle.smoke.js +1 -0
  5. package/cypress/e2e/ILC/BrainingCampManipulative/gradingViewAndCorrectAnswerViewContents.smoke.js +2 -2
  6. package/cypress/e2e/ILC/BrainingCampManipulative/previewTabContent.smoke.js +1 -1
  7. package/cypress/e2e/ILC/ChartsBar/Scoring/partialEqualWeightsAlternativePointsGreaterThanCorrectPoints.js +1 -0
  8. package/cypress/e2e/ILC/ChartsBar/Scoring/partialEqualWeightsCorrectPointsGreaterThanAlternativePoints.js +1 -0
  9. package/cypress/e2e/ILC/ChartsLine/chartFunctionalitySpecifyCorrectAnswerSection.js +254 -0
  10. package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/Scoring/allOrNothingAlternativePointsGreaterThanCorrectPoints.js +1 -1
  11. package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/Scoring/allOrNothingBasicForGroupedOptionsLayout.js +1 -1
  12. package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/Scoring/perCorrectOptionAlternativePointsGreaterThanCorrectPoints.js +1 -0
  13. package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/Scoring/perCorrectOptionBasic.js +5 -5
  14. package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/Scoring/perDropzoneBasic.js +2 -2
  15. package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/Scoring/perDropzoneCorrectPointsEqualToAlternativePoints.js +2 -2
  16. package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/Scoring/perDropzoneCorrectPointsGreaterThanAlternativePoints.js +3 -3
  17. package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/allOrNothingBasicForAllViews.smoke.js +1 -1
  18. package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/studentViewSettings.js +2 -1
  19. package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/studentViewSettingsForGroupedLayout.js +2 -1
  20. package/cypress/e2e/ILC/DrawingResponse/drawingResponseGradingViewAndCorrectAnswerViewContents.smoke.js +2 -2
  21. package/cypress/e2e/ILC/DrawingResponse/drawingResponsePreviewTabContents.smoke.js +1 -1
  22. package/cypress/e2e/ILC/EssayResponse/editAndPreviewTabScoringSection.js +1 -1
  23. package/cypress/e2e/ILC/EssayResponse/gradingViewAndCorrectAnswerViewContents.smoke.js +2 -2
  24. package/cypress/e2e/ILC/EssayResponse/previewContentsForAllViews.smoke.js +1 -1
  25. package/cypress/e2e/ILC/EssayResponseBasic/gradingViewAndCorrectAnswerViewContents.smoke.js +2 -2
  26. package/cypress/e2e/ILC/EssayResponseBasic/previewContentsForAllViews.smoke.js +1 -1
  27. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/Scoring/allOrNothingGroupedScoring.js +1 -1
  28. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/Scoring/allOrNothingWithAlternativePointsGreaterThanCorrectPoints.js +1 -1
  29. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/Scoring/allOrNothingWithCorrectPointsEqualToAlternativePoints.js +1 -1
  30. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/Scoring/allOrNothingWithCorrectPointsGreaterThanAlternativePoints.js +1 -1
  31. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/Scoring/partialEqualWeightsWithAlternativePointsGreaterThanCorrectPoints.js +1 -1
  32. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/Scoring/partialEqualWeightsWithCorrectPointsEqualToAlternativePoints.js +1 -1
  33. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/Scoring/partialEqualWeightsWithCorrectPointsGreaterThanAlternativePoints.js +1 -1
  34. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/Scoring/responseLevelAlternateAnswerBasicScoring.js +1 -1
  35. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/allOrNothingForAllViews.smoke.js +1 -1
  36. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/previewContentsForAllViews.smoke.js +1 -1
  37. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/studentViewSettings.js +1 -1
  38. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/studentViewSettingsForGroupedLayout.js +1 -1
  39. package/cypress/e2e/ILC/FillInTheGapsDropdownNew/Scoring/allOrNothingAlternativePointsGreaterThanCorrectPoints.js +1 -1
  40. package/cypress/e2e/ILC/FillInTheGapsDropdownNew/Scoring/allOrNothingCorrectPointsEqualToAlternativePoints.js +1 -1
  41. package/cypress/e2e/ILC/FillInTheGapsDropdownNew/Scoring/allOrNothingCorrectPointsGreaterThanAlternativePoints.js +1 -1
  42. package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/Scoring/allOrNothingGroupedScoring.js +1 -1
  43. package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/Scoring/allOrNothingWithAlternativePointsGreaterThanCorrectPoints.js +1 -1
  44. package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/Scoring/allOrNothingWithCorrectPointsEqualToAlternativePoints.js +1 -1
  45. package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/Scoring/allOrNothingWithCorrectPointsGreaterThanAlternativePoints.js +1 -1
  46. package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/Scoring/partialEqualWeightsBasic.js +1 -1
  47. package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/Scoring/partialEqualWeightsWithAlternativePointsGreaterThanCorrectPoints.js +1 -1
  48. package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/Scoring/partialEqualWeightsWithCorrectPointsEqualToAlternativePoints.js +1 -1
  49. package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/Scoring/partialEqualWeightsWithCorrectPointsGreaterThanAlternativePoints.js +1 -1
  50. package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/allOrNothingForAllViews.smoke.js +1 -1
  51. package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/previewContentsForAllViews.smoke.js +1 -1
  52. package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/Scoring/allOrNothingAlternativePointsGreaterThanCorrectPoints.js +1 -1
  53. package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/Scoring/allOrNothingCorrectPointsEqualToAlternativePoints.js +1 -1
  54. package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/Scoring/allOrNothingCorrectPointsGreaterThanAlternativePoints.js +1 -1
  55. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/Scoring/allOrNothingAlternativePointsGreaterThanCorrectPoints.js +1 -1
  56. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/Scoring/allOrNothingCorrectPointsEqualToAlternativePoints.js +1 -1
  57. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/Scoring/allOrNothingCorrectPointsGreaterThanAlternativePoints.js +1 -1
  58. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/Scoring/partialEqualWeightsBasic.js +2 -2
  59. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/Scoring/partialEqualWeightsWithAlternativePointsGreaterThanCorrectPoints.js +1 -1
  60. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/Scoring/partialEqualWeightsWithCorrectPointsEqualToAlternativePoints.js +1 -1
  61. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/Scoring/partialEqualWeightsWithCorrectPointsGreaterThanAlternativePoints.js +1 -1
  62. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/Scoring/responseLevelAlternateAnswersBasicScoring.js +1 -1
  63. package/cypress/e2e/ILC/Graphing/Scoring/allOrNothingWithAlternativePointsGreaterThanCorrectPoints.js +1 -1
  64. package/cypress/e2e/ILC/Graphing/Scoring/allOrNothingWithCorrectPointsEqualToAlternatePoints.js +1 -1
  65. package/cypress/e2e/ILC/Graphing/Scoring/allOrNothingWithCorrectPointsGreaterThanAlternativePoints.js +1 -1
  66. package/cypress/e2e/ILC/Graphing/allOrNothingForAllViews.smoke.js +28 -14
  67. package/cypress/e2e/ILC/GridFill/allOrNothingBasicForAllViews.smoke.js +1 -1
  68. package/cypress/e2e/ILC/GridFill/scoring/allOrNothingAlternativePointsGreaterThanCorrectPoints.js +1 -1
  69. package/cypress/e2e/ILC/GridFill/scoring/allOrNothingCorrectPointsEqualToAlternativePoints.js +1 -1
  70. package/cypress/e2e/ILC/GridFill/scoring/allOrNothingCorrectPointsGreaterThanAlternativePoints.js +1 -1
  71. package/cypress/e2e/ILC/GridFill/scoring/cellShadeCountAllOrNothingCorrectPointsGreaterThanAlternativePoints.js +1 -1
  72. package/cypress/e2e/ILC/GridFill/scoring/cellShadeCountPartialEqualWeightsWithAlternativePointsGreaterThanCorrectPoints.js +1 -1
  73. package/cypress/e2e/ILC/GridFill/scoring/cellShadeCountPartialEqualWeightsWithCorrectPointsEqualToAlternativePoints.js +1 -1
  74. package/cypress/e2e/ILC/GridFill/scoring/cellShadeCountPartialEqualWeightsWithCorrectPointsGreaterThanAlternativePoints.js +1 -1
  75. package/cypress/e2e/ILC/GridFill/scoring/cellShadeCountallOrNothingCorrectPointsEqualToAlternativePoints.js +1 -1
  76. package/cypress/e2e/ILC/GridFill/scoring/cellshadeCountAllOrNothingAlternativePointsGreaterThanCorrectPoints.js +1 -1
  77. package/cypress/e2e/ILC/GridFill/scoring/matchExactAndCellShadeCountCombinedScoring.js +1 -1
  78. package/cypress/e2e/ILC/GridFill/scoring/partialEqualWeightsBasic.js +2 -2
  79. package/cypress/e2e/ILC/GridFill/scoring/partialEqualWeightsWithAlternativePointsGreaterThanCorrectPoints.js +1 -1
  80. package/cypress/e2e/ILC/GridFill/scoring/partialEqualWeightsWithCorrectPointsGreaterThanAlternativePoints.js +1 -1
  81. package/cypress/e2e/ILC/ImageHighlight/previewContentsForAllViews.smoke.js +1 -1
  82. package/cypress/e2e/ILC/ImageHighlight/studentViewSettings.js +1 -1
  83. package/cypress/e2e/ILC/ListOrderingNew/HorizontalOrientation/partialEqualWeightsBasic.js +2 -2
  84. package/cypress/e2e/ILC/ListOrderingNew/Scoring/allOrNothingAlternativePointsGreaterThanCorrectPoints.js +1 -1
  85. package/cypress/e2e/ILC/ListOrderingNew/Scoring/allOrNothingCorrectPointsEqualToAlternativePoints.js +1 -1
  86. package/cypress/e2e/ILC/ListOrderingNew/Scoring/allOrNothingCorrectPointsGreaterThanAlternativePoints.js +1 -1
  87. package/cypress/e2e/ILC/ListOrderingNew/Scoring/partialEqualWeightsAlternativePointsGreaterThanCorrectPoints.js +1 -1
  88. package/cypress/e2e/ILC/ListOrderingNew/Scoring/partialEqualWeightsBasic.js +4 -4
  89. package/cypress/e2e/ILC/ListOrderingNew/Scoring/partialEqualWeightsCorrectPointsEqualToAlternativePoints.js +1 -1
  90. package/cypress/e2e/ILC/ListOrderingNew/Scoring/partialEqualWeightsCorrectPointsGreaterThanAlternativePoints.js +1 -1
  91. package/cypress/e2e/ILC/Matching/Scoring/allOrNothingWithAlternativePointsGreaterThanCorrectPoints.js +1 -1
  92. package/cypress/e2e/ILC/Matching/Scoring/allOrNothingWithCorrectPointsEqualToAlternativePoints.js +1 -1
  93. package/cypress/e2e/ILC/Matching/Scoring/allOrNothingWithCorrectPointsGreaterThanAlternativePoints.js +1 -1
  94. package/cypress/e2e/ILC/Matching/Scoring/partialEqualWeightsBasic.js +2 -2
  95. package/cypress/e2e/ILC/Matching/Scoring/partialEqualWeightsWithAlternativePointsGreaterThanCorrectPoints.js +1 -1
  96. package/cypress/e2e/ILC/Matching/Scoring/partialEqualWeightsWithCorrectPointsEqualToAlternativePoints.js +1 -1
  97. package/cypress/e2e/ILC/Matching/Scoring/partialEqualWeightsWithCorrectPointsGreaterThanAlternativePoints.js +1 -1
  98. package/cypress/e2e/ILC/Matching/maximumCapacityPerDropzoneSection.js +29 -29
  99. package/cypress/e2e/ILC/Matching/studentViewSettings.js +1 -1
  100. package/cypress/e2e/ILC/Matching/studentViewSettingsForGroupedLayout.js +1 -1
  101. package/cypress/e2e/ILC/MultipleSelection/allOrNothingBasicForAllViews.smoke.js +2 -2
  102. package/cypress/e2e/ILC/MultipleSelection/allOrNothingWithAlternativeAnswer.js +3 -3
  103. package/cypress/e2e/ILC/MultipleSelection/multipleSelectionBasicAccessibility.js +1 -1
  104. package/cypress/e2e/ILC/MultipleSelection/partialEqualWeightsWithAlternativeAnswer.js +3 -3
  105. package/cypress/e2e/ILC/MultipleSelectionGridNew/Scoring/partialEqualWeightsBasic.js +1 -1
  106. package/cypress/e2e/ILC/ShortTextResponseNew/allOrNothingBasicForAllViews.smoke.js +1 -1
  107. package/cypress/e2e/ILC/ShortTextResponseNew/allOrNothingWithAlternativeAnswer.js +3 -3
  108. package/cypress/e2e/ILC/SingleSelection/allOrNothingBasicForAllViews.smoke.js +3 -3
  109. package/cypress/e2e/ILC/SingleSelection/allOrNothingWithAlternativeAnswer.js +3 -3
  110. package/cypress/e2e/ILC/SingleSelectionGridNew/Scoring/partialEqualWeightsBasic.js +3 -3
  111. package/cypress/e2e/ILC/TextEntryMath/allOrNothingBasicForAllViews.smoke.js +2 -2
  112. package/cypress/e2e/ILC/TextEntryMath/previewContentsForAllViews.smoke.js +1 -1
  113. package/cypress/e2e/ILC/TextEntryMathWithImage/allOrNothingScoringForAllViews.smoke.js +2 -2
  114. package/cypress/e2e/ILC/TextEntryMathWithImage/previewTabContentsForAllViews.smoke.js +1 -1
  115. package/cypress/e2e/ILC/TextSelection/Scoring/allOrNothingAlternatePointsMoreThanCorrectPoints.js +1 -1
  116. package/cypress/e2e/ILC/TextSelection/Scoring/allOrNothingCorrectPointsEqualToAlternatePoints.js +1 -1
  117. package/cypress/e2e/ILC/TextSelection/Scoring/allOrNothingCorrectPointsMoreThanAlternatePoints.js +1 -1
  118. package/cypress/e2e/ILC/TextSelection/Scoring/basicScoringForAllTextSelectionTypes.smoke.js +3 -3
  119. package/cypress/e2e/ILC/TextSelection/Scoring/partialEqualWeightsWithAlternativePointsGreaterThanCorrectPoints.js +1 -1
  120. package/cypress/e2e/ILC/TextSelection/Scoring/partialEqualWeightsWithCorrectPointsEqualToAlternativePoints.js +1 -1
  121. package/cypress/e2e/ILC/TextSelection/Scoring/partialEqualWeightsWithCorrectPointsGreaterThanAlternativePoints.js +1 -1
  122. package/cypress/e2e/ILC/TextSelection/allOrNothingScoringForAllViews.smoke.js +1 -1
  123. package/cypress/e2e/ILC/TextSelection/previewContentsForAllViews.smoke.js +1 -1
  124. package/cypress/e2e/ILC/TextSelection/studentViewSettings.js +1 -1
  125. package/cypress/e2e/ILC/UploadResponse/gradingViewAndCorrectAnswerViewContents.smoke.js +2 -2
  126. package/cypress/e2e/ILC/UploadResponse/previewContentsForAllViews.smoke.js +1 -1
  127. package/cypress/e2e/ILC/VideoResponseNew/editAndPreviewTabScoringSection.js +1 -1
  128. package/cypress/e2e/ILC/VideoResponseNew/gradingViewAndCorrectAnswerViewContents.smoke.js +2 -2
  129. package/cypress/e2e/ILC/VideoResponseNew/previewContentsForAllViews.smoke.js +1 -1
  130. package/cypress/e2e/ILC/VideoResponseNew/standardRecorderStyle.js +1 -1
  131. package/cypress/e2e/ILC/chartsDotsPlot/allOrNothingForAllViews.smoke.js +1 -1
  132. package/cypress/pages/components/maximumRecorderLengthComponent.js +4 -1
  133. package/cypress/pages/components/scoringSectionBaseEditTab.js +14 -3
  134. package/cypress/pages/dragAndDropIntoCategoriesPage.js +1 -1
  135. package/cypress/pages/feedbackScalePage.js +1 -1
  136. package/cypress/pages/index.js +0 -2
  137. package/cypress/pages/listOrderingPage.js +2 -2
  138. package/package.json +1 -1
  139. package/cypress/pages/highlightImagePage.js +0 -1320
  140. package/cypress/pages/highlightPage.js +0 -499
@@ -1,1320 +0,0 @@
1
- import utilities from "../support/helpers/utilities";
2
- import { dialogBoxBase } from "./dialogBoxBase";
3
- import { createQuestionBasePage, questionInstructionsComponent, commonComponents, autoScoredScoringSection, scoringSectionBase, previewScoringAndShowCorrectAnswerComponent, additionalSettingsPanel, autoScoredAdditionalSettings, autoScoredPreviewBase, autoScoredSetCorrectAnswerSection, autoScoredScoringSectionMultipleResponsesType, answerNumerationComponent } from "./components"
4
- import { customizeHighlightPropertiesComponent } from './components/customizeHighlightPropertiesComponent'
5
-
6
- const css = Cypress.env('css');
7
- let imageWidth = 500;
8
- let imageHeight = 500;
9
-
10
- const selectors = {
11
- ...commonComponents,
12
- ...autoScoredPreviewBase,
13
- ...previewScoringAndShowCorrectAnswerComponent,
14
- ...autoScoredScoringSectionMultipleResponsesType,
15
- ...scoringSectionBase,
16
- ...autoScoredSetCorrectAnswerSection,
17
- ...autoScoredAdditionalSettings,
18
- ...dialogBoxBase,
19
- ...answerNumerationComponent,
20
- ...additionalSettingsPanel,
21
- ...questionInstructionsComponent,
22
- ...customizeHighlightPropertiesComponent,
23
- highlightImageLabel: () => cy.get('[class*="HighlightImageLabel"]'),
24
- selectTool: () => cy.get('.drawing-tool__button-select'),
25
- penTool: () => cy.get('.drawing-tool__button-polygon'),
26
- undoTool: () => cy.get('.drawing-tool__button-undo'),
27
- redoTool: () => cy.get('.drawing-tool__button-redo'),
28
- itemEraserTool: () => cy.get('.drawing-tool__button-itemEraser'),
29
- clearAllTool: () => cy.get('.drawing-tool__button-clearAll'),
30
- highlightCount: () => cy.get('[class*="HighlightImagestyles__HighlightCountWrapper"]'),
31
- tooltipText: () => cy.get('[class*="Tooltipstyles__TooltipContent"]:visible'),
32
- highlightImageSectionWrapper: () => cy.get('.highlight-image-drawing-tool .drawing-tool__wrapper'),
33
- widthLabel: () => cy.get('.width-alternative-text-wrapper .highlight-image-property-label'),
34
- widthInputField: () => cy.get('.highlight-image-input-field input'),
35
- imageAlternativeTextLabel: () => cy.get('.image-alternative-text-wrapper .inline-text-property-label'),
36
- imageAlternativeTextInputField: () => cy.get('.inline-text-question-prefix-wrapper input'),
37
- highlighImageCanvasWrapper: () => cy.get('.drawing-tool__wrapper .drawing-tool__canvas'),
38
- highlighImageCanvas: () => cy.get('.drawing-tool__wrapper .upper-canvas'),
39
- setCorrectAnswerSectionHighlight: () => cy.get('[class*="HighlightImageControlstyles__ShapeWrapper"] a'),
40
- setCorrectAnswerSectionHighlightFillColor: () => cy.get('[class*="HighlightImageControlstyles__ShapeWrapper"] a [class*="HighlightImageControlstyles__DiamondPatternWrapper"]'),
41
- setCorrectAnswerSectionHighlightPolygon: () => cy.get('[class*="HighlightImageControlstyles__PolygonWrapper"]'),
42
- highlightNumeration: () => cy.get('[class*="styles__TextWrapper"]'),
43
- setCorrectAnswerSectionImage: () => cy.get('.highlight-svg-responseive image'),
44
- previewTabHighlight: () => cy.get('.edit-question-preview-wrapper [class*="HighlightImageControlstyles__ShapeWrapper"] a'),
45
- previewTabHighlightFillColor: () => cy.get('.edit-question-preview-wrapper [class*="HighlightImageControlstyles__ShapeWrapper"] a [class*="HighlightImageControlstyles__DiamondPatternWrapper"]'),
46
- previewTabHighlightPolygon: () => cy.get('.edit-question-preview-wrapper [class*="HighlightImageControlstyles__PolygonWrapper"]'),
47
- multipleSelectionCheckboxLabel: () => cy.get('[data-ngie-testid="multiple-selection-checkbox"] .MuiFormControlLabel-label'),
48
- multipleSelectionCheckbox: () => cy.get('[data-ngie-testid="multiple-selection-checkbox"] input'),
49
- hideHighlightsCheckboxLabel: () => cy.get('[data-ngie-testid="hide-highlights-checkbox"] .MuiFormControlLabel-label'),
50
- hideHighlightsCheckbox: () => cy.get('[data-ngie-testid="hide-highlights-checkbox"] input'),
51
- //Customize highlight property panel
52
- customizeHighlightPropertiesPanel: () => cy.get('.customize-highlight-properties-wrapper .ngie-accordion-summary'),
53
- customizeHighlightPropertiesLabel: () => cy.get('.customize-highlight-properties-label'),
54
- customizeHighlightPropertiesTab: () => cy.get('.customize-highlight-properties-wrapper .ngie-tablist-box-wrapper button'),
55
- highlightColorLabel: () => cy.get('[class*=CustomizeHighlightPropertiesstyles__HighlightColorWrapper]'),
56
- labelTitle: () => cy.get('[class*="CustomizeHighlightPropertiesstyles__LabelWrapper"]'),
57
- ariaLabelInputFieldLabel: () => cy.get('.aria-label-wrapper .text-label'),
58
- ariaLabelInputField: () => cy.get('.aria-label-wrapper input'),
59
- optionLabelInputFieldLabel: () => cy.get('[class*=CustomizeHighlightPropertiesstyles__OptionLabelWrapper] .text-label'),
60
- optionLabelInputField: () => cy.get('[class*=CustomizeHighlightPropertiesstyles__OptionLabelWrapper] input'),
61
- resetToGlobalColorButton: () => cy.get('.reset-color-wrapper button'),
62
- //Correct answer container
63
- correctAnswerContainerLabel: () => cy.get('.edit-question-preview-wrapper [class*="CorrectAnswerLabel"]'),
64
- correctAnswerContainerAnswerWrapper: () => cy.get('[class*="ItemWrapperDiv"]'),
65
- correctAnswerNumeration: () => cy.get('[class*="NumerationWrapper"]'),
66
- correctIncorrectAnswerBorder: () => cy.get('.edit-question-preview-wrapper .highlight-svg-responseive'),
67
- checkmarkCrossmarkIcon: () => cy.get('g[id*="Rectangle"]'),
68
- //Scoring
69
- pointsPerResponseLabel: () => cy.get('.alternate-points-points-per-text-span'),
70
- partialEqualWeightsPointsPerResponseScore: () => cy.get('.alternate-points-points-per-value-span'),
71
- partialDifferentWeightsPointsOptionsLabel: () => cy.get('.highlight-image-partial-points-per-response-form-control-wrapper .points-label'),
72
- studentResponseAreaAndLayoutLabel: () => cy.get('.highlight-image-wrapper [role="heading"]').eq(0),
73
- canvasMaximumWidthLabel: () => cy.get('.canvas-max-width-wrapper .additional-settings-label'),
74
- canvasMaximumWidthInputField: () => cy.get('.canvas-max-width-wrapper input'),
75
- //Preview tab
76
- previewTabImage: () => cy.get('.edit-question-preview-wrapper .highlight-svg-responseive image')
77
- }
78
-
79
- const steps = {
80
- ...createQuestionBasePage.steps,
81
- ...questionInstructionsComponent.steps,
82
- ...scoringSectionBase.steps,
83
- ...previewScoringAndShowCorrectAnswerComponent.steps,
84
- ...additionalSettingsPanel.steps,
85
- ...autoScoredAdditionalSettings.steps,
86
- ...autoScoredPreviewBase.steps,
87
- ...autoScoredSetCorrectAnswerSection.steps,
88
- ...autoScoredScoringSectionMultipleResponsesType.steps,
89
- ...autoScoredScoringSection.steps,
90
- ...dialogBoxBase.steps,
91
- ...commonComponents.steps,
92
- ...answerNumerationComponent.steps,
93
- ...customizeHighlightPropertiesComponent.steps,
94
- verifyImageUploadedInHighlightRegion: () => {
95
- highlightImagePage.highlighImageCanvasWrapper()
96
- .should('be.visible')
97
- .and('have.css', 'background-image');
98
- highlightImagePage.highlighImageCanvasWrapper()
99
- .should('have.css', 'background-size')
100
- .and('eq', '100% 100%');
101
- highlightImagePage.highlighImageCanvas()
102
- .should('be.visible')
103
- .should('have.css', 'cursor');
104
- },
105
-
106
- /**
107
- * @param {number} imageWidth width of highlight image wrapper
108
- * @description this function verifies the width of highlight image wrapper
109
- */
110
- verifyImageWidthInHighlightImageSection: (imageWidth) => {
111
- highlightImagePage.highlighImageCanvasWrapper()
112
- .should('be.visible')
113
- .and('have.css', 'width', `${imageWidth}px`)
114
- },
115
-
116
- verifyImageUploadedInSetCorrectAnswerSection: () => {
117
- utilities.verifyElementVisibilityState(highlightImagePage.setCorrectAnswerSectionImage(), 'visible')
118
- },
119
-
120
- /**
121
- * @param {number} index of highlighted region
122
- * @param {number[]} hotspotCoordsInPercentage co-ordinates of the highlighted image in set correct answer section
123
- * @description this function verifies the co-ordinates of region highlighted in set correct answer section
124
- */
125
- verifyHighlightRegionsInSetCorrectAnswerSection: (index, hotspotCoordsInPercentage) => {
126
- let flattenedArr = hotspotCoordsInPercentage.flat();
127
- highlightImagePage.setCorrectAnswerSectionHighlightPolygon()
128
- .eq(index)
129
- .then(($element) => {
130
- const pointsValue = $element.attr('points');
131
- const pointsArray = pointsValue.split(',');
132
- let wholeNumbersArray = pointsArray.map((point) => {
133
- return Math.floor(Number(point))
134
- });
135
- wholeNumbersArray.forEach((actualPointsValue, index) => {
136
- const expectedPointsValue = flattenedArr[index] * imageWidth / 100;
137
- cy.wrap(actualPointsValue).should('be.closeTo', expectedPointsValue, 2);
138
- });
139
- });
140
- highlightImagePage.setCorrectAnswerSectionHighlight()
141
- .eq(index)
142
- .within(() => {
143
- highlightImagePage.highlightNumeration()
144
- .should('have.text', index + 1);
145
- });
146
- },
147
-
148
- /**
149
- * @param {number[]} arrayOfPoints co-ordinates of the region to be highlighted
150
- * @description this function draws the region to be highlighted
151
- */
152
- highlightRegionInImage: (arrayOfPoints) => {
153
- highlightImagePage.steps.clickOnPenTool();
154
- highlightImagePage.highlighImageCanvas()
155
- .then(($element) => {
156
- const clientWidth = $element[0].clientWidth;
157
- arrayOfPoints.forEach((coordinates) => {
158
- highlightImagePage.highlighImageCanvas()
159
- .click(coordinates[0] * clientWidth / 100, coordinates[1] * clientWidth / 100);
160
- });
161
- highlightImagePage.highlighImageCanvas()
162
- .click(arrayOfPoints[0][0] * clientWidth / 100, arrayOfPoints[0][1] * clientWidth / 100);
163
- highlightImagePage.highlighImageCanvas()
164
- .click(arrayOfPoints[0][0] * clientWidth / 100, arrayOfPoints[0][1] * clientWidth / 100);
165
- });
166
- },
167
-
168
- /**
169
- * @param {number} index of highlighted region
170
- * @param {number[]} hotspotCoordsInPercentage co-ordinates of the highlighted image in preview tab
171
- * @description this function verifies the co-ordinates of region highlighted in preview tab
172
- */
173
- verifyHighlightRegionsInPreviewTab: (index, hotspotCoordsInPercentage) => {
174
- let flattenedArr = hotspotCoordsInPercentage.flat();
175
- highlightImagePage.previewTabHighlightPolygon()
176
- .eq(index)
177
- .then(($element) => {
178
- const pointsValue = $element.attr('points');
179
- const pointsArray = pointsValue.split(',');
180
- let wholeNumbersArray = pointsArray.map((point) => {
181
- return Math.floor(Number(point))
182
- });
183
- wholeNumbersArray.forEach((actualValue, index) => {
184
- const targetValue = flattenedArr[index] * imageWidth / 100;
185
- cy.wrap(actualValue).should('be.closeTo', targetValue, 2);
186
- });
187
- });
188
- },
189
-
190
- /**
191
- * @param {number} index of region to be highlighted in set correct answer section
192
- * @description this function verifies if the region is highlighted
193
- */
194
- verifySelectedHighlightRegionInSetCorrectAnswerSection: (index) => {
195
- highlightImagePage.setCorrectAnswerSectionHighlight()
196
- .eq(index)
197
- .should('have.attr', 'aria-checked', 'true');
198
- },
199
-
200
- verifySelectedStateOfPenTool: () => {
201
- highlightImagePage.penTool()
202
- .should('have.class', 'drawing-tool__button--active');
203
- },
204
-
205
- verifyUnselectedStateOfSelectTool: () => {
206
- highlightImagePage.selectTool()
207
- .should('not.have.class', 'drawing-tool__button--active');
208
- },
209
-
210
- verifyUnselectedStateOfUndoTool: () => {
211
- highlightImagePage.undoTool()
212
- .should('not.have.class', 'drawing-tool__button--active');
213
- },
214
-
215
- verifyUnselectedStateOfRedoTool: () => {
216
- highlightImagePage.redoTool()
217
- .should('not.have.class', 'drawing-tool__button--active');
218
- },
219
-
220
- verifyUnselectedStateOfItemEraserTool: () => {
221
- highlightImagePage.itemEraserTool()
222
- .should('not.have.class', 'drawing-tool__button--active');
223
- },
224
-
225
- verifySelectedStateOfItemEraserTool: () => {
226
- highlightImagePage.itemEraserTool()
227
- .should('have.class', 'drawing-tool__button--active');
228
- },
229
-
230
- verifyUnselectedStateOfClearAllTool: () => {
231
- highlightImagePage.clearAllTool()
232
- .should('not.have.class', 'drawing-tool__button--active');
233
- },
234
-
235
- /**
236
- * @description verify the highlight count
237
- * @param {number} count shows the count of highlight
238
- */
239
- verifyHighlightCountInHighlightImageSection: (count) => {
240
- highlightImagePage.highlightCount()
241
- .verifyInnerText(`Highlight count: ${count}`)
242
- },
243
-
244
- //TODO: Need to update script after https://redmine.zeuslearning.com/issues/518498 is resolved
245
- /**
246
- * @description verify the tooltip text
247
- * @param {tool selector} button cy.get selector
248
- * @param {string} tooltipText shows the tooltip text
249
- */
250
- verifyTooltip: (tool, tooltipText) => {
251
- tool
252
- .trigger('mouseover')
253
- highlightImagePage.tooltipText()
254
- .and('be.visible')
255
- .should('have.text', tooltipText)
256
- tool
257
- .trigger('mouseout')
258
- highlightImagePage.tooltipText()
259
- .should('not.exist')
260
- },
261
-
262
- /**
263
- * @param {number} imageWidth width of the image
264
- * @description this function enters and verifies width input field value
265
- */
266
- addInputToEditTabWidthInputField: (imageWidth) => {
267
- highlightImagePage.widthInputField()
268
- .clear()
269
- .type(imageWidth);
270
- steps.verifyEditTabWidthInputFieldValue(imageWidth);
271
- },
272
-
273
- /**
274
- * @param {number} imageWidth width of the image
275
- * @description this function verifies width input field value
276
- */
277
- verifyEditTabWidthInputFieldValue: (imageWidth) => {
278
- highlightImagePage.widthInputField()
279
- .should('have.value', imageWidth);
280
- },
281
-
282
- /**
283
- * @param {number} index of highlight region
284
- * @description this function verifies the numeration displayed for highlight regions
285
- */
286
- verifyHighlightNumerationSetCorrectAnswer: (index) => {
287
- highlightImagePage.setCorrectAnswerSectionHighlight()
288
- .eq(index)
289
- .within(() => {
290
- utilities.verifyTextContent(highlightImagePage.highlightNumeration(), index + 1);
291
- });
292
- },
293
-
294
- /**
295
- * @param {string} imageAlternativeText alternate input field
296
- * @description this function enters and verifies text present in image alternative text input
297
- */
298
- addInputToImageAlternativeTextInputField: (imageAlternativeText) => {
299
- highlightImagePage.imageAlternativeTextInputField()
300
- .clear()
301
- .type(imageAlternativeText);
302
- steps.verifyImageAlternativeTextInputField(imageAlternativeText);
303
- },
304
-
305
- clearImageAlternativeTextInputField: () => {
306
- highlightImagePage.imageAlternativeTextInputField()
307
- .clear();
308
- steps.verifyImageAlternativeTextInputField('');
309
- },
310
-
311
- /**
312
- * @param {string} imageAlternativeText alternate input field
313
- * @description this function verifies text present in image alternative text input
314
- */
315
- verifyImageAlternativeTextInputField: (imageAlternativeText) => {
316
- highlightImagePage.imageAlternativeTextInputField()
317
- .should('have.value', imageAlternativeText);
318
- },
319
-
320
- /**
321
- * @param {number} index of region to be highlighted in set correct answer section
322
- * @description this function verifies if the region is highlighted
323
- */
324
- verifySelectedHighlightRegionInPreviewTab: (index) => {
325
- highlightImagePage.previewTabHighlight()
326
- .eq(index)
327
- .should('have.attr', 'aria-checked', 'true');
328
- },
329
-
330
- /**
331
- * @param {number} index of highlight region
332
- * @description this functions highlights a region in set correct answer section
333
- */
334
- highlightARegionInSetCorrectAnswerSection: (index) => {
335
- highlightImagePage.setCorrectAnswerSectionHighlightPolygon()
336
- .eq(index)
337
- .click();
338
- steps.verifySelectedHighlightRegionInSetCorrectAnswerSection(index);
339
- },
340
-
341
- /**
342
- * @param {number} index of highlight region
343
- * @description this functions highlights a region in set correct answer section
344
- */
345
- removeHighlightOfARegionInSetCorrectAnswerSection: (index) => {
346
- highlightImagePage.setCorrectAnswerSectionHighlightPolygon()
347
- .eq(index)
348
- .click();
349
- steps.verifyRegionIsNotHighlightedInSetCorrectAnswerSection(index);
350
- },
351
-
352
- /**
353
- * @param {number} index of highlight region
354
- * @description this functions highlights a region in preview tab
355
- */
356
- highlightARegionInPreviewTab: (index) => {
357
- highlightImagePage.previewTabHighlightPolygon()
358
- .eq(index)
359
- .click();
360
- steps.verifySelectedHighlightRegionInPreviewTab(index);
361
- },
362
-
363
- /**
364
- * @param {number} index of highlight region
365
- * @description this functions highlights a region in set correct answer section
366
- */
367
- removeHighlightOfARegionInPreviewTab: (index) => {
368
- highlightImagePage.previewTabHighlightPolygon()
369
- .eq(index)
370
- .click();
371
- steps.verifyRegionIsNotHighlighted(index)
372
- },
373
-
374
- /**
375
- * @param {number} index of highlight region
376
- * @description this function verifies if aa highlight region is not selected
377
- */
378
- verifyRegionIsNotHighlighted: (index) => {
379
- highlightImagePage.previewTabHighlight()
380
- .eq(index)
381
- .should('have.attr', 'aria-checked', 'false');
382
- },
383
-
384
- /**
385
- * @param {number} index of highlight region
386
- * @description this function verifies if a highlight region is not selected
387
- */
388
- verifyRegionIsNotHighlightedInSetCorrectAnswerSection: (index) => {
389
- highlightImagePage.setCorrectAnswerSectionHighlight()
390
- .eq(index)
391
- .should('have.attr', 'aria-checked', 'false');
392
- },
393
-
394
- checkMultipleSelectionCheckbox: () => {
395
- highlightImagePage.multipleSelectionCheckbox()
396
- .click()
397
- .should('be.checked');
398
- },
399
-
400
- uncheckMultipleSelectionCheckbox: () => {
401
- highlightImagePage.multipleSelectionCheckbox()
402
- .click()
403
- .should('not.be.checked');
404
- },
405
-
406
- //Scoring
407
- /**
408
- * @param {*} index of highlight region
409
- * @description this function verifies the highlight region is correct
410
- */
411
- verifyCorrectHighlightRegion: (index) => {
412
- utilities.verifyCSS(highlightImagePage.previewTabHighlightPolygon().eq(index), {
413
- 'fill': css.color.correctAnswerHighlightRegion,
414
- 'stroke': css.color.correctAnswer
415
- });
416
- highlightImagePage.previewTabHighlight()
417
- .eq(index)
418
- .within(() => {
419
- utilities.verifyCSS(highlightImagePage.checkmarkCrossmarkIcon(), {
420
- 'fill': css.color.correctAnswer
421
- });
422
- });
423
- },
424
-
425
- /**
426
- * @param {*} index of highlight region
427
- * @description this function verifies the highlight region is incorrect
428
- */
429
- verifyIncorrectHighlightRegion: (index) => {
430
- utilities.verifyCSS(highlightImagePage.previewTabHighlightPolygon().eq(index), {
431
- 'fill': css.color.incorrectAnswerHighlightRegion,
432
- 'stroke': css.color.incorrectAnswer
433
- });
434
- highlightImagePage.previewTabHighlight()
435
- .eq(index)
436
- .within(() => {
437
- utilities.verifyCSS(highlightImagePage.checkmarkCrossmarkIcon(), {
438
- 'fill': css.color.incorrectAnswer
439
- });
440
- });
441
- },
442
-
443
- /**
444
- * @param {*} index of highlight region
445
- * @description this function verifies the highlight region is neither correct nor incorrect
446
- */
447
- verifyDefaultHighlightRegion: (index) => {
448
- utilities.verifyCSS(highlightImagePage.previewTabHighlightPolygon().eq(index), {
449
- 'stroke': css.color.activeButtons
450
- });
451
- },
452
-
453
- /**
454
- * @param {number} index of highlight region
455
- * @param {number} numeration numeration displayed beside the highlight region
456
- * @description this function verifies the numeration displayed for highlight regions
457
- */
458
- verifyHighlightNumerationPreviewTab: (index, numeration) => {
459
- highlightImagePage.previewTabHighlight()
460
- .eq(index)
461
- .within(() => {
462
- utilities.verifyTextContent(highlightImagePage.highlightNumeration(), numeration);
463
- });
464
- },
465
-
466
- eraseAHighlightRegion: (arrayOfCoordinates) => {
467
- highlightImagePage.itemEraserTool()
468
- .click();
469
- highlightImagePage.highlighImageCanvas()
470
- .then(($element) => {
471
- const clientWidth = $element[0].clientWidth;
472
- arrayOfCoordinates.forEach((coordinates) => {
473
- highlightImagePage.highlighImageCanvas()
474
- .click(coordinates[0] * clientWidth / 100, coordinates[1] * clientWidth / 100);
475
- });
476
- });
477
- },
478
-
479
- clickOnPenTool: () => {
480
- highlightImagePage.penTool()
481
- .click()
482
- .blur();
483
- },
484
-
485
- clickOnUndoTool: () => {
486
- highlightImagePage.undoTool()
487
- .click();
488
- steps.clickOnPenTool();
489
- },
490
-
491
- clickOnRedoTool: () => {
492
- highlightImagePage.redoTool()
493
- .click();
494
- steps.clickOnPenTool();
495
- },
496
-
497
- clickOnClearAllTool: () => {
498
- highlightImagePage.clearAllTool()
499
- .click()
500
- .blur();
501
- },
502
-
503
- /**
504
- * @description verify count of highlight in set correct anser section
505
- * @param {number} count count of the element
506
- */
507
- verifyHighlightRegionCountInSetCorrectAnswerSection: (count) => {
508
- highlightImagePage.setCorrectAnswerSectionHighlight()
509
- .should('have.length', count);
510
- },
511
-
512
- verifyCorrectAnswerContainerDoesNotExist: () => {
513
- highlightImagePage.correctAnswerContainerLabel()
514
- .should('not.exist');
515
- highlightImagePage.correctAnswerContainerAnswerWrapper()
516
- .should('not.exist');
517
- },
518
-
519
- /**
520
- * @param {string[]} numerationArray array of numeration numbers, lowercase, uppercase
521
- * @description this function verifies the numeration of Correct Answer Container
522
- */
523
- verifyCorrectAnswerContainerNumeration: (numerationArray) => {
524
- numerationArray.forEach((optionNumeration, index) => {
525
- highlightImagePage.correctAnswerNumeration()
526
- .eq(index)
527
- .should('have.text', optionNumeration);
528
- });
529
- },
530
-
531
- /**
532
- * @param {string[]} optionsTextArray array of options in the correct answer container
533
- * @param {string[]} numerationArray array of numeration numbers, lowercase, uppercase
534
- * @description this function verifies the contents of Correct Answer Container
535
- */
536
- verifyCorrectAnswerContainerContents: (optionsTextArray, numerationArray) => {
537
- optionsTextArray.forEach((optionsText, index) => {
538
- highlightImagePage.correctAnswerContainerAnswerWrapper()
539
- .eq(index)
540
- .should('have.text', optionsText);
541
- });
542
- steps.verifyCorrectAnswerContainerNumeration(numerationArray);
543
- },
544
-
545
- verifyCorrectIncorrectBorderNotVisible: () => {
546
- highlightImagePage.correctIncorrectAnswerBorder()
547
- .should('have.css', 'border')
548
- .and('match', /0px none/);
549
- },
550
-
551
- verifyCorrectAttemptBorder: () => {
552
- highlightImagePage.correctIncorrectAnswerBorder()
553
- .should('have.css', 'border', `1px solid ${css.color.correctAnswer}`);
554
- },
555
-
556
- verifyIncorrectAttemptBorder: () => {
557
- highlightImagePage.correctIncorrectAnswerBorder()
558
- .should('have.css', 'border', `1px solid ${css.color.incorrectAnswer}`);
559
- },
560
-
561
- verifyQuestionPreviewStateWhenShowCorrectAnswerIsUnchecked: () => {
562
- cy.log('After deselecting Show correct answer checkbox, the question preview should return to the previous state');
563
- previewScoringAndShowCorrectAnswerComponent.steps.uncheckShowCorrectAnswerCheckbox();
564
- autoScoredPreviewBase.correctIncorrectAnswerLabel()
565
- .should('not.exist');
566
- highlightImagePage.steps.verifyCorrectIncorrectBorderNotVisible();
567
- },
568
-
569
- /**
570
- * @description verify count of highlight in set correct answer section
571
- * @param {number} count count of the element
572
- */
573
- verifyHighlightRegionCountInPreviewTab: (count) => {
574
- highlightImagePage.previewTabHighlight()
575
- .should('have.length', count);
576
- },
577
-
578
- verifyCustomizeHighlightPropertiesCollapsedState: () => {
579
- highlightImagePage.customizeHighlightPropertiesPanel()
580
- .should('have.attr', 'aria-expanded', 'false');
581
- },
582
-
583
- expandCustomizeHighlightProperties: () => {
584
- highlightImagePage.customizeHighlightPropertiesPanel()
585
- .click()
586
- .should('have.attr', 'aria-expanded', 'true');
587
- },
588
-
589
- /**
590
- * @param {number} tabIndex index of the tab in customize highlight properties accordion
591
- * @description this function verifies active state of the tab
592
- */
593
- verifyActiveStateOfCustomizeHighlightPropertiesTab: (tabIndex) => {
594
- highlightImagePage.customizeHighlightPropertiesTab()
595
- .eq(tabIndex)
596
- .should('have.attr', 'aria-selected', 'true');
597
- },
598
-
599
- /**
600
- * @param {number} tabIndex index of the tab in customize highlight properties accordion
601
- * @description this function verifies Inactive state of the tab
602
- */
603
- verifyInactiveStateOfCustomizeHighlightPropertiesTab: (tabIndex) => {
604
- highlightImagePage.customizeHighlightPropertiesTab()
605
- .eq(tabIndex)
606
- .should('have.attr', 'aria-selected', 'false');
607
- },
608
- /**
609
- * @param {number} points points displayed in partial equal weights points per response
610
- * @description Verify points displayed in partial equal weights points per response
611
- */
612
- verifyPartialEqualWeightsPointsPerResponseScore: (points) => {
613
- highlightImagePage.partialEqualWeightsPointsPerResponseScore()
614
- .verifyInnerText(`${points}`);
615
- },
616
-
617
- /**
618
- * @param {number} index of points input field
619
- * @param {number} points alloted in the points input field
620
- * @description this function verifies the Options label and points input field
621
- */
622
- verifyPartialDifferentWeightsOptionLabelAndPoints: (index, points) => {
623
- utilities.verifyInnerText(highlightImagePage.partialDifferentWeightsPointsOptionsLabel().eq(index), `Option ${index + 1}`);
624
- highlightImagePage.pointsInputField()
625
- .eq(index)
626
- .should('have.value', points);
627
- utilities.verifyElementVisibilityState(highlightImagePage.pointsInputField().eq(index), 'visible');
628
- },
629
-
630
- //TODO: Need to check if common function verifyPartialDifferentWeightsPointsInputFieldIsDisabled can be used once https://redmine.zeuslearning.com/issues/545223 is resolved
631
- /**
632
- * @param {number} index of points input field
633
- * @description this function verifies if points field is disabled
634
- */
635
- verifyPartialDifferentWeightsPointsInputFieldDisabled: (index) => {
636
- scoringSectionBase.pointsInputField()
637
- .eq(index)
638
- .should('be.disabled');
639
- },
640
-
641
- /**
642
- * @param {number} index of points input field
643
- * @description this function verifies if points field is enabled
644
- */
645
- verifyPartialDifferentWeightsPointsInputFieldEnabled: (index) => {
646
- scoringSectionBase.pointsInputField()
647
- .eq(index)
648
- .should('be.enabled');
649
- },
650
-
651
- /**
652
- * @param {number} imageWidth canvas maximum width input field
653
- * @description this verifies input of canvas maximum width input field
654
- */
655
- verifyCanvasMaximumWidthInputField: (imageWidth) => {
656
- highlightImagePage.canvasMaximumWidthInputField()
657
- .should('have.value', imageWidth)
658
- },
659
-
660
- clearCanvasMaximumWidthInputField: () => {
661
- highlightImagePage.canvasMaximumWidthInputField()
662
- .clear()
663
- .blur();
664
- },
665
-
666
- /**
667
- * @param {number} imageWidth canvas maximum width input field
668
- * @description this function adds input to canvas maximum width input field
669
- */
670
- addInputToCanvasMaximumWidthInputField: (imageWidth) => {
671
- highlightImagePage.canvasMaximumWidthInputField()
672
- .type(imageWidth)
673
- .blur();
674
- steps.verifyCanvasMaximumWidthInputField(imageWidth)
675
- },
676
-
677
- /**
678
- * @param {number} imageHeight expected height of image
679
- * @param {number} imageWidth expected width of image
680
- * @description this function verifies height and width of image in set correct answer section
681
- */
682
- verifyHeightAndWidthOfImageInSetCorrectAnswerSection: (imageHeight, imageWidth) => {
683
- highlightImagePage.setCorrectAnswerSectionImage()
684
- .should('have.attr', 'height', imageHeight)
685
- .and('have.attr', 'width', imageWidth);
686
- },
687
-
688
- /**
689
- * @param {string} imageAlternativeText alternate text of image
690
- * @description this function verifies the alt attribute of the image
691
- */
692
- verifyImageAlternativeTextOfImageInSetCorrectAnswerSection: (imageAlternativeText) => {
693
- highlightImagePage.setCorrectAnswerSectionImage()
694
- .should('have.attr', 'alt', imageAlternativeText);
695
- },
696
-
697
- /**
698
- * @param {number} imageHeight expected height of image
699
- * @param {number} imageWidth expected width of image
700
- * @description this function verifies height and width of image in preview tab
701
- */
702
- verifyHeightAndWidthOfImageInPreviewTab: (imageHeight, imageWidth) => {
703
- highlightImagePage.previewTabImage()
704
- .should('have.attr', 'height', imageHeight)
705
- .and('have.attr', 'width', imageWidth);
706
- },
707
-
708
- /**
709
- * @param {string} imageAlternativeText alternate text of image
710
- * @description this function verifies the alt attribute of the image
711
- */
712
- verifyImageAlternativeTextOfImageInPreviewTab: (imageAlternativeText) => {
713
- highlightImagePage.previewTabImage()
714
- .should('have.attr', 'alt', imageAlternativeText);
715
- },
716
-
717
- //Conditional checkboxes
718
- verifyMultipleSelectionCheckboxIsUnchecked: () => {
719
- highlightImagePage.multipleSelectionCheckbox()
720
- .should('not.be.checked');
721
- },
722
-
723
- verifyHideHighlightsCheckboxIsUnchecked: () => {
724
- highlightImagePage.hideHighlightsCheckbox()
725
- .should('not.be.checked');
726
- },
727
-
728
- checkHideHighlightsCheckbox: () => {
729
- highlightImagePage.hideHighlightsCheckbox()
730
- .click()
731
- .should('be.checked');
732
- },
733
-
734
- /**
735
- * @param {number} index of highlight region
736
- * @description this function hovers over highlight region
737
- */
738
- hoverOverHighlightRegionInSetCorrectSection: (index) => {
739
- utilities.hoverOverElement(highlightImagePage.setCorrectAnswerSectionHighlightPolygon().eq(index));
740
- },
741
-
742
- /**
743
- * @param {number} index of highlight region
744
- * @description this function hovers over highlight region
745
- */
746
- hoverOverHighlightRegionInPreviewTab: (index) => {
747
- utilities.hoverOverElement(highlightImagePage.previewTabHighlightPolygon().eq(index));
748
- },
749
-
750
- /**
751
- * @param {number} index of highlight region
752
- * @description this function verifies that the highlight region is visible
753
- */
754
- verifyHighlightRegionVisibleInSetCorrectAnswerSection: (index) => {
755
- highlightImagePage.setCorrectAnswerSectionHighlightPolygon()
756
- .eq(index)
757
- .should('have.attr', 'fill-opacity', '40')
758
- .and('have.attr', 'stroke-opacity', '100');
759
- },
760
-
761
- /**
762
- * @param {number} index of highlight region
763
- * @description this function verifies that the highlight region is visible
764
- */
765
- verifySelectedHighlightRegionVisibleInSetCorrectAnswerSection: (index) => {
766
- highlightImagePage.setCorrectAnswerSectionHighlightPolygon()
767
- .eq(index)
768
- .should('have.attr', 'fill-opacity', '70')
769
- .and('have.attr', 'stroke-opacity', '100');
770
- },
771
-
772
- /**
773
- * @param {number} index of highlight region
774
- * @description this function verifies that the highlight region is not visible
775
- */
776
- verifyHighlightRegionHiddenInSetCorrectAnswerSection: (index) => {
777
- highlightImagePage.setCorrectAnswerSectionHighlightPolygon()
778
- .eq(index)
779
- .should('have.attr', 'fill-opacity', 'transparent')
780
- .and('have.attr', 'stroke-opacity', 'transparent');
781
- },
782
-
783
- /**
784
- * @param {number} index of highlight region
785
- * @description this function verifies that the highlight region is visible
786
- */
787
- verifyHighlightRegionVisibleInPreviewTab: (index) => {
788
- highlightImagePage.previewTabHighlightPolygon()
789
- .eq(index)
790
- .should('have.attr', 'fill-opacity', '40')
791
- .and('have.attr', 'stroke-opacity', '100');
792
- },
793
-
794
- /**
795
- * @param {number} index of highlight region
796
- * @description this function verifies that the highlight region is visible
797
- */
798
- verifySelectedHighlightRegionVisibleInPreviewTab: (index) => {
799
- highlightImagePage.previewTabHighlightPolygon()
800
- .eq(index)
801
- .should('have.attr', 'fill-opacity', '70')
802
- .and('have.attr', 'stroke-opacity', '100');
803
- },
804
-
805
- /**
806
- * @param {number} index of highlight region
807
- * @description this function verifies that the highlight region is not visible
808
- */
809
- verifyHighlightRegionHiddenInPreviewTab: (index) => {
810
- highlightImagePage.previewTabHighlightPolygon()
811
- .eq(index)
812
- .should('have.attr', 'fill-opacity', 'transparent')
813
- .and('have.attr', 'stroke-opacity', 'transparent');
814
- },
815
-
816
- /**
817
- * @param {string} fileFormat format of the uploaded file in the highlight region
818
- * @description this function verifies the attribute of the image has the expected file format
819
- */
820
- verifyUploadedImageFormatInSetCorrectAnswerSection: (fileFormat) => {
821
- highlightImagePage.setCorrectAnswerSectionImage()
822
- .should(($element) => {
823
- const hrefAttributeValue = $element.attr('href');
824
- expect(hrefAttributeValue).to.include(fileFormat);
825
- });
826
- },
827
-
828
- /**
829
- * @param {string} fileFormat format of the uploaded file in the highlight region
830
- * @description this function verifies the attribute of the image has the expected file format
831
- */
832
- verifyUploadedImageFormatInPreviewTab: (fileFormat) => {
833
- highlightImagePage.previewTabImage()
834
- .should(($element) => {
835
- const hrefAttributeValue = $element.attr('href');
836
- expect(hrefAttributeValue).to.include(fileFormat);
837
- });
838
- },
839
-
840
- /**
841
- * @param {number} count of tabs in customize highlight properties accordion
842
- * @description this function verifies the count of tabs in customize highlight properties accordion
843
- */
844
- verifyCountOfCustomizePropertiesTab: (count) => {
845
- utilities.verifyElementCount(highlightImagePage.customizeHighlightPropertiesTab(), count)
846
- },
847
-
848
- verifyResetToGlobalColorButtonEnabled: () => {
849
- highlightImagePage.resetToGlobalColorButton()
850
- .should('be.enabled');
851
- },
852
-
853
- verifyResetToGlobalColorButtonDisabled: () => {
854
- highlightImagePage.resetToGlobalColorButton()
855
- .should('be.disabled');
856
- },
857
-
858
- /**
859
- * @param {string} text to enter in option label input field
860
- * @description this function adds and verifies the text in option label input field
861
- */
862
- addAndVerifyTextInOptionLabelInputField: (text) => {
863
- highlightImagePage.optionLabelInputField()
864
- .type(text, { delay: 0 })
865
- .blur()
866
- .should('have.attr', 'value', text);
867
- },
868
-
869
- /**
870
- * @param {string} text to enter in aria label input field
871
- * @description this function adds and verifies the text in aria label input field
872
- */
873
- addAndVerifyTextInAriaLabelInputField: (text) => {
874
- highlightImagePage.ariaLabelInputField()
875
- .type(text, { delay: 0 })
876
- .blur()
877
- .should('have.attr', 'value', text);
878
- },
879
-
880
- /**
881
- * @param {number} index of the option tab
882
- * @description this function verifies that option tab is displayed
883
- */
884
- verifyOptionTabIsDisplayed: (index) => {
885
- utilities.verifyInnerText(highlightImagePage.customizeHighlightPropertiesTab().eq(index), `Option ${index}`);
886
- utilities.verifyElementVisibilityState(highlightImagePage.customizeHighlightPropertiesTab().eq(index), 'visible');
887
- },
888
-
889
- /**
890
- * @param {number} tabIndex of the option tab to navigate
891
- * @description this function navigates to option tab
892
- */
893
- navigateToOptionTab: (tabIndex) => {
894
- highlightImagePage.customizeHighlightPropertiesTab().eq(tabIndex)
895
- .click();
896
- },
897
-
898
- navigateToGlobalTab: () => {
899
- highlightImagePage.customizeHighlightPropertiesTab().eq(0)
900
- .click();
901
- },
902
-
903
- verifyHighlightColorLabelIsDisplayed: () => {
904
- highlightImagePage.highlightColorLabel()
905
- .invoke('text')
906
- .then(text => {
907
- const highlightColorLabel = text.split('R')[0];
908
- expect(highlightColorLabel).to.deep.eq('Highlight color');
909
- });
910
- utilities.verifyElementVisibilityState(highlightImagePage.highlightColorLabel(), 'visible');
911
- },
912
-
913
- /**
914
- * @param {string} highlightColorBlock 'defaultFillColor' | 'defaultBorderColor' | 'hoverFillColor' | 'hoverBorderColor' | 'activeFillColor' | 'activeBorderColor'
915
- * @description this function clicks on the highlight color block
916
- */
917
- clickOnHighlightColorBlock: (highlightColorBlock) => {
918
- switch (highlightColorBlock) {
919
- case 'defaultFillColor':
920
- highlightImagePage.defaultFillColorBlock()
921
- .click();
922
- break;
923
- case 'defaultBorderColor':
924
- highlightImagePage.defaultBorderColorBlock()
925
- .click();
926
- break;
927
- case 'hoverFillColor':
928
- highlightImagePage.hoverFillColorBlock()
929
- .click();
930
- break;
931
- case 'hoverBorderColor':
932
- highlightImagePage.hoverBorderColorBlock()
933
- .click();
934
- break;
935
- case 'activeFillColor':
936
- highlightImagePage.activeFillColorBlock()
937
- .click();
938
- break;
939
- case 'activeBorderColor':
940
- highlightImagePage.activeBorderColorBlock()
941
- .click();
942
- break;
943
- default:
944
- throw new Error('Invalid highlight color block');
945
- }
946
- },
947
-
948
- /**
949
- * @param {number} index of highlight region
950
- * @param {string} fillColor of highlight region
951
- * @param {string} fillOpacity of highlight region
952
- * @description this function verifies default state fill color and opacity of a highlight region in set correct answer section
953
- */
954
- verifyDefaultFillColorOfHighlightRegionInSetCorrectAnswerSection: (index, fillColor, fillOpacity) => {
955
- highlightImagePage.setCorrectAnswerSectionHighlightFillColor()
956
- .eq(index)
957
- .should('have.css', 'fill', fillColor)
958
- .and('have.css', 'fill-opacity', fillOpacity);
959
- },
960
-
961
- /**
962
- * @param {number} index of highlight region
963
- * @param {string} fillColor of highlight region
964
- * @param {string} fillOpacity of highlight region
965
- * @description this function verifies default state fill color and opacity of a highlight region in preview tab
966
- */
967
- verifyDefaultFillColorOfHighlightRegionInPreviewTab: (index, fillColor, fillOpacity) => {
968
- highlightImagePage.previewTabHighlightFillColor()
969
- .eq(index)
970
- .should('have.css', 'fill', fillColor)
971
- .and('have.css', 'fill-opacity', fillOpacity);
972
- },
973
-
974
- /**
975
- * @param {number} index of highlight region
976
- * @param {string} borderColor of highlight region
977
- * @param {string} borderOpacity of highlight region
978
- * @description this function verifies default state border color and opacity of a highlight region in set correct answer section
979
- */
980
- verifyDefaultBorderColorOfHighlightRegionInSetCorrectAnswerSection: (index, borderColor, borderOpacity) => {
981
- highlightImagePage.setCorrectAnswerSectionHighlightPolygon()
982
- .eq(index)
983
- .should('have.css', 'stroke', borderColor)
984
- .and('have.css', 'stroke-opacity', borderOpacity);
985
- },
986
-
987
- /**
988
- * @param {number} index of highlight region
989
- * @param {string} borderColor of highlight region
990
- * @param {string} borderOpacity of highlight region
991
- * @description this function verifies default state border color and opacity of a highlight region in preview tab
992
- */
993
- verifyDefaultBorderColorOfHighlightRegionInPreviewTab: (index, borderColor, borderOpacity) => {
994
- highlightImagePage.previewTabHighlightPolygon()
995
- .eq(index)
996
- .should('have.css', 'stroke', borderColor)
997
- .and('have.css', 'stroke-opacity', borderOpacity);
998
- },
999
-
1000
- /**
1001
- * @param {number} index of highlight region
1002
- * @param {string} fillColor of highlight region
1003
- * @param {string} fillOpacity of highlight region
1004
- * @description this function verifies hover state fill color and opacity of a highlight region in set correct answer section
1005
- */
1006
- verifyHoverFillColorOfHighlightRegionInSetCorrectAnswerSection: (index, fillColor, fillOpacity) => {
1007
- utilities.hoverOverElement(highlightImagePage.setCorrectAnswerSectionHighlightPolygon().eq(index));
1008
- highlightImagePage.setCorrectAnswerSectionHighlightFillColor()
1009
- .eq(index)
1010
- .should('have.css', 'fill', fillColor)
1011
- .and('have.css', 'fill-opacity', fillOpacity);
1012
- utilities.hoverAwayFromElement(highlightImagePage.setCorrectAnswerSectionHighlightPolygon().eq(index));
1013
- },
1014
-
1015
- /**
1016
- * @param {number} index of highlight region
1017
- * @param {string} fillColor of highlight region
1018
- * @param {string} fillOpacity of highlight region
1019
- * @description this function verifies hover state fill color and opacity of a highlight region in preview tab
1020
- */
1021
- verifyHoverFillColorOfHighlightRegionInPreviewTab: (index, fillColor, fillOpacity) => {
1022
- utilities.hoverOverElement(highlightImagePage.previewTabHighlightPolygon().eq(index));
1023
- highlightImagePage.previewTabHighlightFillColor()
1024
- .eq(index)
1025
- .should('have.css', 'fill', fillColor)
1026
- .and('have.css', 'fill-opacity', fillOpacity);
1027
- utilities.hoverAwayFromElement(highlightImagePage.previewTabHighlightPolygon().eq(index));
1028
- },
1029
-
1030
- /**
1031
- * @param {number} index of highlight region
1032
- * @param {string} borderColor of highlight region
1033
- * @param {string} borderOpacity of highlight region
1034
- * @description this function verifies hover state border color and opacity of a highlight region in set correct answer section
1035
- */
1036
- verifyHoverBorderColorOfHighlightRegionInSetCorrectAnswerSection: (index, borderColor, borderOpacity) => {
1037
- utilities.hoverOverElement(highlightImagePage.setCorrectAnswerSectionHighlightPolygon().eq(index));
1038
- highlightImagePage.setCorrectAnswerSectionHighlightPolygon()
1039
- .eq(index)
1040
- .should('have.css', 'stroke', borderColor)
1041
- .and('have.css', 'stroke-opacity', borderOpacity);
1042
- utilities.hoverAwayFromElement(highlightImagePage.setCorrectAnswerSectionHighlightPolygon().eq(index));
1043
- },
1044
-
1045
- /**
1046
- * @param {number} index of highlight region
1047
- * @param {string} borderColor of highlight region
1048
- * @param {string} borderOpacity of highlight region
1049
- * @description this function verifies hover state border color and opacity of a highlight region in preview tab
1050
- */
1051
-
1052
- verifyHoverBorderColorOfHighlightRegionInPreviewTab: (index, borderColor, borderOpacity) => {
1053
- utilities.hoverOverElement(highlightImagePage.previewTabHighlightPolygon().eq(index));
1054
- highlightImagePage.previewTabHighlightPolygon()
1055
- .eq(index)
1056
- .should('have.css', 'stroke', borderColor)
1057
- .and('have.css', 'stroke-opacity', borderOpacity);
1058
- utilities.hoverAwayFromElement(highlightImagePage.previewTabHighlightPolygon().eq(index));
1059
- },
1060
-
1061
- /**
1062
- * @param {number} index of highlight region
1063
- * @param {string} fillColor of highlight region
1064
- * @param {string} fillOpacity of highlight region
1065
- * @description this function verifies active state fill color and opacity of a highlight region in set correct answer section
1066
- */
1067
- verifyActiveFillColorOfHighlightRegionInSetCorrectAnswerSection: (index, fillColor, fillOpacity) => {
1068
- highlightImagePage.steps.highlightARegionInSetCorrectAnswerSection(index);
1069
- highlightImagePage.setCorrectAnswerSectionHighlightFillColor()
1070
- .eq(index)
1071
- .should('have.css', 'fill', fillColor)
1072
- .and('have.css', 'fill-opacity', fillOpacity);
1073
- highlightImagePage.steps.removeHighlightOfARegionInSetCorrectAnswerSection(index);
1074
- },
1075
-
1076
- /**
1077
- * @param {number} index of highlight region
1078
- * @param {string} fillColor of highlight region
1079
- * @param {string} fillOpacity of highlight region
1080
- * @description this function verifies active state fill color and opacity of a highlight region in preview tab
1081
- */
1082
- verifyActiveFillColorOfHighlightRegionInPreviewTab: (index, fillColor, fillOpacity) => {
1083
- highlightImagePage.steps.highlightARegionInPreviewTab(index);
1084
- highlightImagePage.previewTabHighlightFillColor()
1085
- .eq(index)
1086
- .should('have.css', 'fill', fillColor)
1087
- .and('have.css', 'fill-opacity', fillOpacity);
1088
- highlightImagePage.steps.removeHighlightOfARegionInPreviewTab(index);
1089
- },
1090
-
1091
- /**
1092
- * @param {number} index of highlight region
1093
- * @param {string} borderColor of highlight region
1094
- * @param {string} borderOpacity of highlight region
1095
- * @description this function verifies active state border color and opacity of a highlight region in set correct answer section
1096
- */
1097
- verifyActiveBorderColorOfHighlightRegionInSetCorrectAnswerSection: (index, borderColor, borderOpacity) => {
1098
- highlightImagePage.steps.highlightARegionInSetCorrectAnswerSection(index);
1099
- highlightImagePage.setCorrectAnswerSectionHighlightPolygon()
1100
- .eq(index)
1101
- .should('have.css', 'stroke', borderColor)
1102
- .and('have.css', 'stroke-opacity', borderOpacity);
1103
- highlightImagePage.steps.removeHighlightOfARegionInSetCorrectAnswerSection(index);
1104
- },
1105
-
1106
- /**
1107
- * @param {number} index of highlight region
1108
- * @param {string} borderColor of highlight region
1109
- * @param {string} borderOpacity of highlight region
1110
- * @description this function verifies active state border color and opacity of a highlight region in preview tab
1111
- */
1112
- verifyActiveBorderColorOfHighlightRegionInPreviewTab: (index, borderColor, borderOpacity) => {
1113
- highlightImagePage.steps.highlightARegionInPreviewTab(index);
1114
- highlightImagePage.previewTabHighlightPolygon()
1115
- .eq(index)
1116
- .should('have.css', 'stroke', borderColor)
1117
- .and('have.css', 'stroke-opacity', borderOpacity);
1118
- highlightImagePage.steps.removeHighlightOfARegionInPreviewTab(index);
1119
- },
1120
-
1121
- clickOnResetToGlobalColorButton: () => {
1122
- highlightImagePage.resetToGlobalColorButton()
1123
- .click();
1124
- },
1125
-
1126
- verifyHideHighlightsCheckboxIsChecked: () => {
1127
- highlightImagePage.hideHighlightsCheckbox()
1128
- .should('be.checked');
1129
- },
1130
-
1131
- checkApplyPatternOnActiveStateCheckbox: () => {
1132
- highlightImagePage.applyPatternOnActiveStateCheckbox()
1133
- .click()
1134
- .should('be.checked');
1135
- },
1136
-
1137
- uncheckApplyPatternOnActiveStateCheckbox: () => {
1138
- highlightImagePage.applyPatternOnActiveStateCheckbox()
1139
- .click()
1140
- .should('not.be.checked');
1141
- },
1142
-
1143
- //TODO: Need to update script after https://redmine.zeuslearning.com/issues/518498 is resolved
1144
- /**
1145
- * @param {number} index of highlight region
1146
- * @description this function verifies that active pattern is displayed on the highlight region in Set correct answer section
1147
- */
1148
- verifyActivePatternIsDisplayedOnHighlightRegionInSetCorrectAnswerSection: (index) => {
1149
- highlightImagePage.setCorrectAnswerSectionHighlight()
1150
- .eq(index)
1151
- .find('[class*="HighlightImageControlstyles__DiamondPattern-"]')
1152
- .should('exist');
1153
- },
1154
-
1155
- /**
1156
- * @param {number} index of highlight region
1157
- * @description this function verifies that active pattern is displayed on the highlight region in Preview tab
1158
- */
1159
- verifyActivePatternIsDisplayedOnHighlightRegionInPreviewTab: (index) => {
1160
- highlightImagePage.previewTabHighlight()
1161
- .eq(index)
1162
- .find('[class*="HighlightImageControlstyles__DiamondPattern-"]')
1163
- .should('exist');
1164
- },
1165
-
1166
- /**
1167
- * @param {number} index of highlight region
1168
- * @description this function verifies that active pattern is not displayed on the highlight region in Set correct answer section
1169
- */
1170
- verifyActivePatternIsNotDisplayedOnHighlightRegionInSetCorrectAnswerSection: (index) => {
1171
- highlightImagePage.setCorrectAnswerSectionHighlight()
1172
- .eq(index)
1173
- .find('[class*="HighlightImageControlstyles__DiamondPattern-"]')
1174
- .should('not.exist');
1175
- },
1176
-
1177
- /**
1178
- * @param {number} index of highlight region
1179
- * @description this function verifies that active pattern is not displayed on the highlight region in Preview Tab
1180
- */
1181
- verifyActivePatternIsNotDisplayedOnHighlightRegionInPreviewTab: (index) => {
1182
- highlightImagePage.previewTabHighlight()
1183
- .eq(index)
1184
- .find('[class*="HighlightImageControlstyles__DiamondPattern-"]')
1185
- .should('not.exist');
1186
- }
1187
- }
1188
-
1189
- const tests = {
1190
- ...questionInstructionsComponent.tests,
1191
- ...autoScoredScoringSection.tests,
1192
- ...previewScoringAndShowCorrectAnswerComponent.tests,
1193
- ...commonComponents.tests,
1194
- ...scoringSectionBase.tests,
1195
- ...autoScoredScoringSectionMultipleResponsesType.tests,
1196
- ...autoScoredSetCorrectAnswerSection.tests,
1197
- ...additionalSettingsPanel.tests,
1198
- ...answerNumerationComponent.tests,
1199
- ...autoScoredAdditionalSettings.tests,
1200
- ...createQuestionBasePage.tests,
1201
- /**
1202
- *
1203
- * @param {number} totalPoints total points scored by user
1204
- * @description this verifies the minimum score functionality when user attempts the question incorrectly
1205
- */
1206
- verifyMinimumScoreAwardedIfAttemptedFunctionalityForIncorrectAnswer: (totalPoints) => {
1207
- it('When user has provided minimum score awarded (if attempted) points, then in Preview tab on entering incorrect answer, minimum score should be provided for the question', () => {
1208
- cy.log('Switch to edit tab and set minimum score if attempted points')
1209
- createQuestionBasePage.steps.switchToEditTab();
1210
- scoringSectionBase.steps.expandMinimumScoringDropdown();
1211
- scoringSectionBase.steps.selectMinimumScoringTypeListOption('Award minimum score only if attempted');
1212
- scoringSectionBase.steps.allotMinimumScoreAwardedIfAttempted('1')
1213
- createQuestionBasePage.steps.switchToPreviewTab()
1214
- highlightImagePage.steps.highlightARegionInPreviewTab(2);
1215
- previewScoringAndShowCorrectAnswerComponent.steps.verifyPreviewTabScoreText(1, `${totalPoints}`)
1216
- });
1217
-
1218
- it('When user removes minimum score awarded (if attempted) points, then in Preview tab on selecting any options other than correct answers, points should not be provided', () => {
1219
- cy.log('Switch to edit tab and remove minimum score if attempted points')
1220
- createQuestionBasePage.steps.switchToEditTab();
1221
- scoringSectionBase.steps.clearMinimumScoreIfAttemptedPointsField();
1222
- createQuestionBasePage.steps.switchToPreviewTab();
1223
- highlightImagePage.steps.highlightARegionInPreviewTab(2);
1224
- previewScoringAndShowCorrectAnswerComponent.steps.verifyPreviewTabScoreText(0, `${totalPoints}`)
1225
- });
1226
- },
1227
-
1228
- /**
1229
- *
1230
- * @param {number} scoredPoints the points scored by the user when penalty points are reduced
1231
- * @param {number} totalPoints the maximum points that can be scored by the user
1232
- * @description this function verifies the functionality of Penalty points when minimum points are not set and user attempts incorrect answer
1233
- */
1234
- verifyPenaltyPointsFunctionalityForIncorrectAnswer: (scoredPoints, totalPoints) => {
1235
- it('When user has defined penalty points', () => {
1236
- cy.log('Pre-step: Switch to edit tab and set penalty points');
1237
- createQuestionBasePage.steps.switchToEditTab();
1238
- autoScoredScoringSectionMultipleResponsesType.steps.allotPenaltyPoints(3)
1239
-
1240
- cy.log('After switching to preview tab, when user adds an incorrect answer input, then 0 points should be awarded(no negative points)');
1241
- createQuestionBasePage.steps.switchToPreviewTab();
1242
- highlightImagePage.steps.highlightARegionInPreviewTab(2);
1243
- highlightImagePage.steps.verifyPreviewTabScoreText(0, `${totalPoints}`)
1244
-
1245
- cy.log('When user adds a partially correct answer input, the points should be updated accordingly with deducted penalty points');
1246
- createQuestionBasePage.steps.resetQuestionPreview()
1247
- highlightImagePage.steps.highlightARegionInPreviewTab(0);
1248
- highlightImagePage.steps.highlightARegionInPreviewTab(2);
1249
- highlightImagePage.steps.verifyPreviewTabScoreText(`${scoredPoints}`, `${totalPoints}`);
1250
-
1251
- cy.log('Post step: Clearing the Penalty points field')
1252
- createQuestionBasePage.steps.switchToEditTab();
1253
- autoScoredScoringSectionMultipleResponsesType.penaltyPointsInputField()
1254
- .clear();
1255
- });
1256
- },
1257
-
1258
- /**
1259
- * @param {number[]} scoredPointsArray An array of numbers representing points scored in different cases.
1260
- * - The first element represents points scored for incorrect answers.
1261
- * - The second element represents points scored for partially correct answers.
1262
- * - The third element represents points scored when minimum score awarded (if attempted) points is greater than the points achieved by attempting the question partially correct
1263
- * @param {number} minimumPointsForPartialCorrectAnswers minimum score awarded (if attempted) points on attempting the question partially correct
1264
- * @param {number} totalPoints the maximum points that can be achieved by the user
1265
- * @description this function verifies the functionality of Minimum score if attempted points when penalty points are set and user attempts incorrect answer
1266
- * - For all incorrect responses
1267
- * - For partially correct responses, when points scored > minimum score awarded(if attempted) points
1268
- * - For partially correct responses, when minimum score awarded(if attempted) points > points scored
1269
- */
1270
- verifyMinimumScoreIfAttemptedAndPenaltyPointsFunctionalityForIncorrectAnswer: (scoredPointsArray, minimumPointsForPartialCorrectAnswers, totalPoints) => {
1271
- it('When user has defined both penalty points and minimum score awarded (if attempted) points', () => {
1272
- cy.log('Pre-step: Switch to edit tab and set minimum score awarded (if attempted) points and Penalty points');
1273
- createQuestionBasePage.steps.switchToEditTab();
1274
- scoringSectionBase.steps.expandMinimumScoringDropdown();
1275
- scoringSectionBase.steps.selectMinimumScoringTypeListOption('Award minimum score only if attempted');
1276
- scoringSectionBase.steps.allotMinimumScoreAwardedIfAttempted(1);
1277
- autoScoredScoringSectionMultipleResponsesType.steps.allotPenaltyPoints(3);
1278
-
1279
- cy.log('Switch to preview tab and give incorrect answer input to check that minimum points are displayed');
1280
- createQuestionBasePage.steps.switchToPreviewTab();
1281
- highlightImagePage.steps.highlightARegionInPreviewTab(2);
1282
- highlightImagePage.steps.verifyPreviewTabScoreText(`${scoredPointsArray[0]}`, `${totalPoints}`);
1283
-
1284
- cy.log('When user adds a partially correct answer such that the points of the attempt(with penalty points deducted) is more than the minimum score awarded(if attempted) points');
1285
- createQuestionBasePage.steps.resetQuestionPreview();
1286
- highlightImagePage.steps.highlightARegionInPreviewTab(0);
1287
- highlightImagePage.steps.highlightARegionInPreviewTab(2);
1288
- highlightImagePage.steps.verifyPreviewTabScoreText(`${scoredPointsArray[1]}`, `${totalPoints}`);
1289
-
1290
- cy.log('When user switches to edit tab and increases the minimum score awarded (if attempted) points to check the case for an attempt in which points of the attempt is less than minimum score awarded (if attempted) points, then the minimum score awarded (if attempted) points should be displayed to the user');
1291
- createQuestionBasePage.steps.switchToEditTab();
1292
- scoringSectionBase.steps.clearMinimumScoreIfAttemptedPointsField()
1293
- scoringSectionBase.steps.allotMinimumScoreAwardedIfAttempted(minimumPointsForPartialCorrectAnswers)
1294
- cy.log('Switching to preview tab');
1295
- createQuestionBasePage.steps.switchToPreviewTab();
1296
- highlightImagePage.steps.highlightARegionInPreviewTab(0);
1297
- highlightImagePage.steps.verifyPreviewTabScoreText(`${scoredPointsArray[2]}`, `${totalPoints}`);
1298
- });
1299
- },
1300
-
1301
- /**
1302
- * @param {string} scoringType scoring type 'All or nothing| Partial equal weights| Partial different weights'
1303
- * @description this function verifies the contents of Set correct answer section for different scoring types
1304
- */
1305
- verifyResponseContentsOfSetCorrectAnswerSection: () => {
1306
- it(`When user has selected a scoring type then the uploaded image with highlight regions should be displayed in the set correct answer section`, () => {
1307
- highlightImagePage.steps.verifyImageUploadedInSetCorrectAnswerSection();
1308
- utilities.verifyElementCount(highlightImagePage.setCorrectAnswerSectionHighlightPolygon(), 3);
1309
- highlightImagePage.steps.verifyRegionIsNotHighlightedInSetCorrectAnswerSection(0);
1310
- highlightImagePage.steps.verifyRegionIsNotHighlightedInSetCorrectAnswerSection(1);
1311
- highlightImagePage.steps.verifyRegionIsNotHighlightedInSetCorrectAnswerSection(2);
1312
- });
1313
- }
1314
- }
1315
-
1316
- export const highlightImagePage = {
1317
- ...selectors,
1318
- steps,
1319
- tests
1320
- }