itemengine-cypress-automation 1.0.349-TEMRegression4-f1b48a1.0 → 1.0.349

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (287) hide show
  1. package/Dockerfile +1 -0
  2. package/cypress/e2e/ILC/AudioResponseNew/editTabBasicSection.js +4 -16
  3. package/cypress/e2e/ILC/BrainingCampManipulative/editTabBasicSection.js +1 -1
  4. package/cypress/e2e/ILC/BrowseItems/browseReviewItems.js +398 -0
  5. package/cypress/e2e/ILC/BrowseItems/browseReviewItemsMobileView.js +329 -0
  6. package/cypress/e2e/ILC/BrowseItems/browseThinkSphereItems.js +260 -0
  7. package/cypress/e2e/ILC/BrowseItems/browseThinkSphereItemsMobileView.js +368 -0
  8. package/cypress/e2e/ILC/ChartsBar/HorizontalOrientationBarChart/gradingViewAndCorrectAnswerView.smoke.js +1 -1
  9. package/cypress/e2e/ILC/ChartsBar/Scoring/checkScoringLabelBannerAndCorrectAnswerSection.js +33 -0
  10. package/cypress/e2e/ILC/ChartsBar/Scoring/partialDifferentWeightBasic.js +2 -2
  11. package/cypress/e2e/ILC/ChartsBar/Scoring/partialDifferentWeightsAlternativePointsGreaterThanCorrectPoints.js +1 -0
  12. package/cypress/e2e/ILC/ChartsBar/Scoring/partialDifferentWeightsCorrectPointsEqualToAlternativePoints.js +1 -0
  13. package/cypress/e2e/ILC/ChartsBar/Scoring/partialDifferentWeightsCorrectPointsGreaterThanAlternativePoints.js +1 -0
  14. package/cypress/e2e/ILC/ChartsBar/Scoring/partialDifferentWeightsMinimumAndPenaltyScoring.js +1 -0
  15. package/cypress/e2e/ILC/ChartsBar/editTabBasicSection.js +37 -0
  16. package/cypress/e2e/ILC/ChartsBar/headerSection.js +50 -2
  17. package/cypress/e2e/ILC/ChartsLine/Scoring/partialDifferentWeightBasic.js +1 -0
  18. package/cypress/e2e/ILC/ChartsLine/Scoring/partialDifferentWeightsAlternativePointsGreaterThanCorrectPoints.js +1 -0
  19. package/cypress/e2e/ILC/ChartsLine/Scoring/partialDifferentWeightsCorrectPointsEqualToAlternativePoints.js +1 -0
  20. package/cypress/e2e/ILC/ChartsLine/Scoring/partialDifferentWeightsCorrectPointsGreaterThanAlternativePoints.js +1 -0
  21. package/cypress/e2e/ILC/ChartsLine/Scoring/partialDifferentWeightsMinimumAndPenaltyScoring.js +1 -0
  22. package/cypress/e2e/ILC/ChartsLine/headerSection.js +18 -1
  23. package/cypress/e2e/ILC/CkEditorAudioPlayer/audioPlayerEditTabAddFeatureRadioButton.js +2 -3
  24. package/cypress/e2e/ILC/CkEditorAudioPlayer/audioPlayerEditTabAddTranscriptRadioButton .js +2 -4
  25. package/cypress/e2e/ILC/CkEditorAudioPlayer/audioPlayerEditTabStudentViewSettings.js +3 -3
  26. package/cypress/e2e/ILC/CkEditorAudioPlayer/audioPlayerHeaderSectionAndButtons.js +2 -2
  27. package/cypress/e2e/ILC/CkEditorAudioPlayer/audioPlayerPreviewTab.js +1 -1
  28. package/cypress/e2e/ILC/CkEditorAudioPlayer/audioPlayerPreviewTabTranscript.js +2 -3
  29. package/cypress/e2e/ILC/CkEditorEquationEditor/equationEditorBasicFile.js +4 -4
  30. package/cypress/e2e/ILC/CkEditorInsertImage/imageInfo.js +4 -4
  31. package/cypress/e2e/ILC/CkEditorInsertTable/tableStyle.js +2 -2
  32. package/cypress/e2e/ILC/CkEditorLink/uploadSection.js +1 -1
  33. package/cypress/e2e/ILC/ContentBlocks/editTabBasics.js +62 -4
  34. package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/allOrNothingBasicForAllViews.smoke.js +115 -6
  35. package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/headerSection.js +2 -0
  36. package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/manuallyAndNonScoredScoringEditTab.js +4 -1
  37. package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/minimumScoringPenaltyPointsAndRoundingDropdown.js +3 -0
  38. package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/styleAndLayoutCustomizationLayoutProperties.js +3 -0
  39. package/cypress/e2e/ILC/DrawingResponse/drawingResponseAdditionalSettings.js +1 -0
  40. package/cypress/e2e/ILC/DrawingResponse/drawingResponseBackground.js +2 -8
  41. package/cypress/e2e/ILC/DrawingResponse/drawingResponseCustomizeAdditionalOptions.js +1 -0
  42. package/cypress/e2e/ILC/DrawingResponse/drawingResponseEditTabBasicSection.js +3 -3
  43. package/cypress/e2e/ILC/DrawingResponse/drawingResponsePreviewTabContents.smoke.js +3 -4
  44. package/cypress/e2e/ILC/EssayResponse/createCustomCategory.smoke.js +1 -1
  45. package/cypress/e2e/ILC/EssayResponse/editCategoryFlyout.js +0 -1
  46. package/cypress/e2e/ILC/EssayResponse/editTabBasicSections.js +23 -37
  47. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/Scoring/blankResponseScoring.js +29 -25
  48. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/allOrNothingForAllViews.smoke.js +210 -0
  49. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/dropzoneStyleAndLayoutCustomization.js +6 -3
  50. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/headerSection.js +1 -0
  51. package/cypress/e2e/ILC/FillInTheGapsDropdownNew/allOrNothingForAllView.smoke.js +201 -0
  52. package/cypress/e2e/ILC/FillInTheGapsDropdownNew/dropdownAndDropdownMenuSection.js +4 -1
  53. package/cypress/e2e/ILC/FillInTheGapsDropdownNew/dropdownOptionsSection.js +2 -2
  54. package/cypress/e2e/ILC/FillInTheGapsDropdownNew/specifyCorrectAnswerSection.js +0 -1
  55. package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/Scoring/blankResponseScoring.js +18 -20
  56. package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/allOrNothingForAllViews.smoke.js +216 -0
  57. package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/backgroundImageAndCanvasProperties.js +0 -1
  58. package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/headerSection.js +1 -0
  59. package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/studentViewSettings.js +5 -1
  60. package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/styleAndLayoutCustomization.js +2 -1
  61. package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/Scoring/blankResponseScoring.js +21 -30
  62. package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/allOrNothingForAllView.smoke.js +211 -0
  63. package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/dropdownAndDropdownMenuSection.js +4 -1
  64. package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/editTabBasicSection.js +0 -1
  65. package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/headerSection.js +2 -2
  66. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/HeaderSection.js +2 -2
  67. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/Scoring/blankResponseScoring.js +23 -30
  68. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/allOrNothingForAllViews.smoke.js +213 -0
  69. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/editTabScoringSection.js +2 -0
  70. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/responseAnswersAndAcceptedStudentInput.js +2 -0
  71. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/supportedFileTypes.js +1 -1
  72. package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/blankResponseScoring.js +25 -30
  73. package/cypress/e2e/ILC/FillInTheGapsTextNew/allOrNothingForAllViews.smoke.js +207 -0
  74. package/cypress/e2e/ILC/FillInTheGapsTextNew/editTabBasicSection.js +2 -10
  75. package/cypress/e2e/ILC/FillInTheGapsTextNew/editTabScoringSection.js +2 -0
  76. package/cypress/e2e/ILC/Graphing/Scoring/allOrNothingWithAlternativePointsGreaterThanCorrectPoints.js +73 -0
  77. package/cypress/e2e/ILC/Graphing/Scoring/allOrNothingWithCorrectPointsEqualToAlternatePoints.js +38 -0
  78. package/cypress/e2e/ILC/Graphing/Scoring/allOrNothingWithCorrectPointsGreaterThanAlternativePoints.js +38 -0
  79. package/cypress/e2e/ILC/Graphing/Scoring/checkScoringLabelBannerAndCorrectAnswerSection.js +87 -0
  80. package/cypress/e2e/ILC/Graphing/checkAddAlternativeButton.js +35 -0
  81. package/cypress/e2e/ILC/Graphing/editQuestion.smoke.js +28 -0
  82. package/cypress/e2e/ILC/Graphing/editTabBasicSection.js +38 -0
  83. package/cypress/e2e/ILC/Graphing/editTabScoringSection.js +1 -0
  84. package/cypress/e2e/ILC/Graphing/headerSection.js +36 -4
  85. package/cypress/e2e/ILC/Graphing/layoutAndGridOptions.js +6 -3
  86. package/cypress/e2e/ILC/GridFill/addAlternateButton.js +40 -0
  87. package/cypress/e2e/ILC/GridFill/customizeLayoutFillImageBackgroundImage.js +5 -6
  88. package/cypress/e2e/ILC/GridFill/customizeLayoutSectionShadeCellsGridBorders.js +2 -0
  89. package/cypress/e2e/ILC/GridFill/editTabScoringSection.js +3 -0
  90. package/cypress/e2e/ILC/GridFill/headerSection.js +1 -3
  91. package/cypress/e2e/ILC/GridFill/scoring/allOrNothingAlternativePointsGreaterThanCorrectPoints.js +39 -0
  92. package/cypress/e2e/ILC/GridFill/scoring/allOrNothingCorrectPointsEqualToAlternativePoints.js +39 -0
  93. package/cypress/e2e/ILC/GridFill/scoring/allOrNothingCorrectPointsGreaterThanAlternativePoints.js +39 -0
  94. package/cypress/e2e/ILC/GridFill/scoring/cellShadeCountAllOrNothingCorrectPointsGreaterThanAlternativePoints.js +37 -0
  95. package/cypress/e2e/ILC/GridFill/scoring/cellShadeCountallOrNothingCorrectPointsEqualToAlternativePoints.js +39 -0
  96. package/cypress/e2e/ILC/GridFill/scoring/cellshadeCountAllOrNothingAlternativePointsGreaterThanCorrectPoints.js +36 -0
  97. package/cypress/e2e/ILC/GridFill/scoring/checkLabelSaveAsYouGo.js +75 -0
  98. package/cypress/e2e/ILC/GridFill/specifyCorrectAnswerSection.js +2 -4
  99. package/cypress/e2e/ILC/ImageHighlight/Scoring/partialDifferentWeightsScoring.js +2 -1
  100. package/cypress/e2e/ILC/ImageHighlight/headerSection.js +2 -1
  101. package/cypress/e2e/ILC/ImageHighlight/studentViewSettings.js +2 -2
  102. package/cypress/e2e/ILC/ListOrderingDropdown/Scoring/allOrNothingAlternativePointsGreaterThanCorrectPoints.js +24 -0
  103. package/cypress/e2e/ILC/ListOrderingDropdown/Scoring/allOrNothingCorrectPointsEqualToAlternativePoints.js +24 -0
  104. package/cypress/e2e/ILC/ListOrderingDropdown/Scoring/allOrNothingCorrectPointsGreaterThanAlternativePoints.js +24 -0
  105. package/cypress/e2e/ILC/ListOrderingDropdown/Scoring/checkScoringLabelBannerAndCorrectAnswerSection.js +86 -0
  106. package/cypress/e2e/ILC/ListOrderingDropdown/Scoring/partialEqualWeightsBasic.js +1 -1
  107. package/cypress/e2e/ILC/ListOrderingDropdown/allOrNothingForAllViews.smoke.js +1 -1
  108. package/cypress/e2e/ILC/ListOrderingDropdown/checkAddAlternativeButton.js +35 -0
  109. package/cypress/e2e/ILC/ListOrderingDropdown/editTabBasicSection.js +24 -0
  110. package/cypress/e2e/ILC/ListOrderingDropdown/headerSection.js +108 -0
  111. package/cypress/e2e/ILC/ListOrderingDropdown/specifyCorrectAnswerSection.js +6 -10
  112. package/cypress/e2e/ILC/ListOrderingNew/HorizontalOrientation/specifyCorrectAnswerSection.js +2 -1
  113. package/cypress/e2e/ILC/ListOrderingNew/Scoring/checkScoringLabelBannerAndCorrectAnswerSection.js +52 -0
  114. package/cypress/e2e/ILC/ListOrderingNew/editTabBasicSection.js +23 -0
  115. package/cypress/e2e/ILC/ListOrderingNew/headerSection.js +35 -9
  116. package/cypress/e2e/ILC/ListOrderingReorderAsASeperateList/Scoring/allOrNothingAlternativePointsGreaterThanCorrectPoints.js +41 -0
  117. package/cypress/e2e/ILC/ListOrderingReorderAsASeperateList/Scoring/allOrNothingCorrectPointsEqualToAlternativePoints.js +30 -0
  118. package/cypress/e2e/ILC/ListOrderingReorderAsASeperateList/Scoring/allOrNothingCorrectPointsGreaterThanAlternativePoints.js +50 -0
  119. package/cypress/e2e/ILC/ListOrderingReorderAsASeperateList/Scoring/checkScoringLabelBannerAndCorrectAnswerSection.js +101 -0
  120. package/cypress/e2e/ILC/ListOrderingReorderAsASeperateList/checkAddAlternativeButton.js +38 -0
  121. package/cypress/e2e/ILC/ListOrderingReorderAsASeperateList/editTabBasicSection.js +24 -0
  122. package/cypress/e2e/ILC/ListOrderingReorderAsASeperateList/editTabScoring.js +4 -1
  123. package/cypress/e2e/ILC/ListOrderingReorderAsASeperateList/headerSection.js +35 -1
  124. package/cypress/e2e/ILC/Matching/Scoring/checkScoringLabelBannerAndCorrectAnswerSection.js +98 -0
  125. package/cypress/e2e/ILC/Matching/allOrNothingScoringForAllViews.smoke.js +210 -0
  126. package/cypress/e2e/ILC/Matching/checkAlternativeButton.js +38 -0
  127. package/cypress/e2e/ILC/Matching/clickAndDrop.js +3 -5
  128. package/cypress/e2e/ILC/Matching/draggableOptions.js +4 -0
  129. package/cypress/e2e/ILC/Matching/editTabBasicSection.js +41 -0
  130. package/cypress/e2e/ILC/Matching/headerSection.js +36 -11
  131. package/cypress/e2e/ILC/Matching/questionInstructionsAndPromptSection.js +2 -15
  132. package/cypress/e2e/ILC/MatchingDropdown/allOrNothingScoringForAllViews.smoke.js +208 -0
  133. package/cypress/e2e/ILC/MultipleSelection/allOrNothingBasicForAllViews.smoke.js +227 -0
  134. package/cypress/e2e/ILC/MultipleSelection/allOrNothingWithAlternativeAnswer.js +6 -3
  135. package/cypress/e2e/ILC/MultipleSelection/checkScoringLabelBannerAndCorrectAnswer.js +3 -1
  136. package/cypress/e2e/ILC/MultipleSelection/editTabScoringSection.js +6 -3
  137. package/cypress/e2e/ILC/MultipleSelection/headerSection.js +1 -0
  138. package/cypress/e2e/ILC/MultipleSelection/minimumScoringPenaltyPointsAndRoundingDropdown.js +1 -1
  139. package/cypress/e2e/ILC/MultipleSelection/partialDifferentWeightsBasic.js +1 -1
  140. package/cypress/e2e/ILC/MultipleSelection/partialDifferentWeightsWithAlternativeAnswer.js +69 -64
  141. package/cypress/e2e/ILC/MultipleSelection/partialEqualWeightsWithAlternativeAnswer.js +6 -4
  142. package/cypress/e2e/ILC/MultipleSelectionGridNew/Scoring/checkScoringLabelBannerAndCorrectAnswer.js +1 -0
  143. package/cypress/e2e/ILC/MultipleSelectionGridNew/allOrNothingBasicForAllViews.smoke.js +220 -0
  144. package/cypress/e2e/ILC/MultipleSelectionGridNew/editTabScoringSection.js +11 -5
  145. package/cypress/e2e/ILC/MultipleSelectionGridNew/styleAndLayoutCustomizationLayoutProperties.js +5 -2
  146. package/cypress/e2e/ILC/NumberLine/Scoring/allOrNothingWithAlternatePointsGreaterThanCorrectPoints.js +79 -0
  147. package/cypress/e2e/ILC/NumberLine/Scoring/allOrNothingWithCorrectPointsEqualToAlternatePoints.js +42 -0
  148. package/cypress/e2e/ILC/NumberLine/Scoring/allOrNothingWithCorrectPointsGreaterThanAlternativePoints.js +42 -0
  149. package/cypress/e2e/ILC/NumberLine/Scoring/checkScoringLabelBannerAndCorrectAnswerSection.js +75 -0
  150. package/cypress/e2e/ILC/NumberLine/checkAddAlternativeButton.js +32 -0
  151. package/cypress/e2e/ILC/NumberLine/editTabSection.js +38 -0
  152. package/cypress/e2e/ILC/NumberLine/headerSection.js +33 -4
  153. package/cypress/e2e/ILC/NumberLineLabel/Scoring/allOrNothingAlternativePointsGreaterThanCorrectPoints.js +81 -0
  154. package/cypress/e2e/ILC/NumberLineLabel/Scoring/allOrNothingCorrectPointsEqualToAlternativePoints.js +43 -0
  155. package/cypress/e2e/ILC/NumberLineLabel/Scoring/allOrNothingCorrectPointsGreaterThanAlternativePoints.js +43 -0
  156. package/cypress/e2e/ILC/NumberLineLabel/Scoring/checkScoringLabelBannerAndCorrectAnswerSection.js +76 -0
  157. package/cypress/e2e/ILC/NumberLineLabel/additionalSettingsBasic.js +1 -1
  158. package/cypress/e2e/ILC/NumberLineLabel/checkAddAlternativeButton.js +34 -0
  159. package/cypress/e2e/ILC/NumberLineLabel/editTabSection.js +38 -0
  160. package/cypress/e2e/ILC/NumberLineLabel/headerSection.js +37 -5
  161. package/cypress/e2e/ILC/NumberLineLabel/manuallyAndNonScoredEditTab.js +2 -1
  162. package/cypress/e2e/ILC/NumberLineLabel/verticalNumberLine/editQuestion.smoke.js +1 -1
  163. package/cypress/e2e/ILC/ShortTextResponseNew/editTabBasicSections.js +31 -48
  164. package/cypress/e2e/ILC/ShortTextResponseNew/headerSection.js +2 -4
  165. package/cypress/e2e/ILC/SingleSelection/allOrNothingBasicForAllViews.smoke.js +192 -0
  166. package/cypress/e2e/ILC/SingleSelection/checkScoringLabelBannerAndCorrectAnswer.js +3 -1
  167. package/cypress/e2e/ILC/SingleSelection/headerSection.js +1 -0
  168. package/cypress/e2e/ILC/SingleSelection/manuallyAndNonScoredScoring.js +94 -88
  169. package/cypress/e2e/ILC/SingleSelectionGridNew/Scoring/checkScoringLabelBannerAndCorrectAnswerSection.js +3 -1
  170. package/cypress/e2e/ILC/SingleSelectionGridNew/allOrNothingBasicForAllViews.smoke.js +209 -0
  171. package/cypress/e2e/ILC/SingleSelectionGridNew/editTabScoringSection.js +5 -0
  172. package/cypress/e2e/ILC/SingleSelectionGridNew/styleAndLayoutCustomizationLayoutProperties.js +8 -2
  173. package/cypress/e2e/ILC/TextEntryMath/MathTemplateScoring/allOrNothingAlternatePointsGreaterThanCorrectPoints.js +86 -0
  174. package/cypress/e2e/ILC/TextEntryMath/MathTemplateScoring/allOrNothingCorrectPointsEqualToAlternatePoints.js +86 -0
  175. package/cypress/e2e/ILC/TextEntryMath/MathTemplateScoring/allOrNothingCorrectPointsGreaterThanAlternatePoints.js +65 -0
  176. package/cypress/e2e/ILC/TextEntryMath/MathTemplateScoring/partialDifferentWeightsAlternativePointsGreaterThanCorrectPoints.js +3 -1
  177. package/cypress/e2e/ILC/TextEntryMath/MathTemplateScoring/partialDifferentWeightsCorrectPointsEqualToAlternativePoints.js +2 -0
  178. package/cypress/e2e/ILC/TextEntryMath/MathTemplateScoring/partialDifferentWeightsCorrectPointsGreaterThanAlternativePoints.js +2 -0
  179. package/cypress/e2e/ILC/TextEntryMath/MathTemplateScoring/partialDifferentWeightsScoringBasic.js +10 -3
  180. package/cypress/e2e/ILC/TextEntryMath/MathTemplateScoring/partialEqualWeightsAlternativePointsGreaterThanCorrectPoints.js +4 -2
  181. package/cypress/e2e/ILC/TextEntryMath/MathTemplateScoring/partialEqualWeightsCorrectPointsEqualToAlternativePoints.js +5 -3
  182. package/cypress/e2e/ILC/TextEntryMath/MathTemplateScoring/partialEqualWeightsCorrectPointsGreaterThanAlternativePoints.js +2 -0
  183. package/cypress/e2e/ILC/TextEntryMath/MathTemplateScoring/partialEqualWeightsScoringBasic.js +4 -0
  184. package/cypress/e2e/ILC/TextEntryMath/Scoring/allOrNothingAlternatePointsGreaterThanCorrectPoints.js +64 -0
  185. package/cypress/e2e/ILC/TextEntryMath/Scoring/allOrNothingBasicForAddEvaluation.js +2 -0
  186. package/cypress/e2e/ILC/TextEntryMath/Scoring/allOrNothingBasicForAlternateAnswer.js +2 -0
  187. package/cypress/e2e/ILC/TextEntryMath/Scoring/allOrNothingCorrectPointsEqualToAlternatePoints.js +64 -0
  188. package/cypress/e2e/ILC/TextEntryMath/Scoring/allOrNothingCorrectPointsGreaterThanAlternatePoints.js +65 -0
  189. package/cypress/e2e/ILC/TextEntryMath/Scoring/partialDifferentWeightsAlternativePointsGreaterThanCorrectPoints.js +2 -0
  190. package/cypress/e2e/ILC/TextEntryMath/Scoring/partialDifferentWeightsCorrectPointsEqualToAlternativePoints.js +2 -0
  191. package/cypress/e2e/ILC/TextEntryMath/Scoring/partialDifferentWeightsCorrectPointsGreaterThanAlternativePoints.js +2 -0
  192. package/cypress/e2e/ILC/TextEntryMath/Scoring/partialDifferentWeightsScoringBasic.js +8 -0
  193. package/cypress/e2e/ILC/TextEntryMath/Scoring/partialEqualWeightsAlternativePointsGreaterThanCorrectPoints.js +2 -0
  194. package/cypress/e2e/ILC/TextEntryMath/Scoring/partialEqualWeightsCorrectPointsEqualToAlternativePoints.js +2 -0
  195. package/cypress/e2e/ILC/TextEntryMath/Scoring/partialEqualWeightsCorrectPointsGreaterThanAlternativePoints.js +2 -0
  196. package/cypress/e2e/ILC/TextEntryMath/Scoring/partialEqualWeightsScoringBasic.js +1 -0
  197. package/cypress/e2e/ILC/TextEntryMath/Scoring/partialEqualWeightsScoringBasicForAlternateAnswer.js +2 -0
  198. package/cypress/e2e/ILC/TextEntryMath/allOrNothingBasicForAllViewsFormulaTemplate.smoke.js +2 -0
  199. package/cypress/e2e/ILC/TextEntryMath/editTabBasicSection.js +27 -3
  200. package/cypress/e2e/ILC/TextEntryMath/evaluationMethodEquivalentStructures.smoke.js +86 -0
  201. package/cypress/e2e/ILC/TextEntryMath/evaluationMethodMatchExact.smoke.js +97 -0
  202. package/cypress/e2e/ILC/TextEntryMath/evaluationMethodMatchValue.smoke.js +97 -0
  203. package/cypress/e2e/ILC/TextEntryMath/evaluationMethodSymbolsAreEquivalent.smoke.js +167 -0
  204. package/cypress/e2e/ILC/TextEntryMath/evaluationMethodValueIsEquivalent.smoke.js +167 -1
  205. package/cypress/e2e/ILC/TextEntryMath/headerSection.js +43 -0
  206. package/cypress/e2e/ILC/TextEntryMath/previewContentsForAllViews.smoke.js +7 -5
  207. package/cypress/e2e/ILC/TextSelection/ScoringParagraph/checkScoringLabelBannerAndCorrectAnswerSection.js +0 -1
  208. package/cypress/e2e/ILC/TextSelection/textSelectionModesInSpecifyPossibleOptionsSection.js +7 -12
  209. package/cypress/e2e/ILC/ThinkSphere/additionalSettings.js +52 -0
  210. package/cypress/e2e/ILC/ThinkSphere/createReviewItem.js +112 -0
  211. package/cypress/e2e/ILC/ThinkSphere/editTabBasicSection.js +561 -0
  212. package/cypress/e2e/ILC/ThinkSphere/editThinkSphereQuestion.smoke.js +276 -0
  213. package/cypress/e2e/ILC/ThinkSphere/equationEditorCreateCustomCategory.smoke.js +417 -0
  214. package/cypress/e2e/ILC/ThinkSphere/equationEditorEditCategoryFlyOut.js +291 -0
  215. package/cypress/e2e/ILC/ThinkSphere/headerSection.js +53 -0
  216. package/cypress/e2e/ILC/ThinkSphere/planPhase.js +621 -0
  217. package/cypress/e2e/ILC/ThinkSphere/previewTabPlanSection.js +541 -0
  218. package/cypress/e2e/ILC/ThinkSphere/previewTabReviewSection.js +97 -0
  219. package/cypress/e2e/ILC/ThinkSphere/solvePhase.js +296 -0
  220. package/cypress/e2e/ILC/ThinkSphere/studentViewPlanTabSection.js +393 -0
  221. package/cypress/e2e/ILC/ThinkSphere/studentViewReviewTabSection.js +141 -0
  222. package/cypress/e2e/ILC/ToolAudioPlayerNew/headerSection.js +90 -2
  223. package/cypress/e2e/ILC/UploadResponse/editTabBasicSection.js +34 -0
  224. package/cypress/e2e/ILC/UploadResponse/headerSection.js +38 -1
  225. package/cypress/e2e/ILC/VideoResponseNew/editTabBasicSection.js +14 -29
  226. package/cypress/e2e/ILC/chartsDotsPlot/headerSection.js +16 -1
  227. package/cypress/e2e/Sessions/fetchResponses.js +3 -3
  228. package/cypress/e2e/Sessions/scores.js +8 -10
  229. package/cypress/e2e/applitools.config.js +3 -3
  230. package/cypress/fixtures/theme/ilc.json +14 -1
  231. package/cypress/fixtures/uploads/sample.webm +0 -0
  232. package/cypress/fixtures/uploads/sample.wmv +0 -0
  233. package/cypress/fixtures/uploads/sample20MB.mp4 +0 -0
  234. package/cypress/fixtures/uploads/sample2MB.mp4 +0 -0
  235. package/cypress/fixtures/uploads/sample2MB_2.mp4 +0 -0
  236. package/cypress/fixtures/uploads/sample30MB.mp4 +0 -0
  237. package/cypress/pages/audioPlayerPage.js +47 -22
  238. package/cypress/pages/brainingCampManipulativePage.js +1 -1
  239. package/cypress/pages/chartsBarPage.js +20 -0
  240. package/cypress/pages/components/additionalSettingsPanel.js +3 -2
  241. package/cypress/pages/components/autoScoredScoringPreviewTab.js +7 -1
  242. package/cypress/pages/components/autoScoredScoringSectionMultiResponseType.js +2 -0
  243. package/cypress/pages/components/autoScoredSpecifyCorrectAnswerSection.js +16 -28
  244. package/cypress/pages/components/backgroundImageUploadComponent.js +32 -25
  245. package/cypress/pages/components/browseItemsPage.js +998 -7
  246. package/cypress/pages/components/ckEditorAudioPlayerComponent.js +1 -1
  247. package/cypress/pages/components/ckEditorEquationEditorComponent.js +5 -4
  248. package/cypress/pages/components/ckEditorInsertImageComponent.js +2 -2
  249. package/cypress/pages/components/ckEditorLinkComponent.js +8 -9
  250. package/cypress/pages/components/commonComponents.js +8 -1
  251. package/cypress/pages/components/createQuestionBasePage.js +15 -2
  252. package/cypress/pages/components/defaultToolDropdown.js +7 -6
  253. package/cypress/pages/components/editCategoryFlyout.js +2 -2
  254. package/cypress/pages/components/equationEditorSectionCommonComponent.js +10 -25
  255. package/cypress/pages/components/fillInTheGapsDropdownCommonComponent.js +3 -3
  256. package/cypress/pages/components/fillInTheGapsTextCommonComponent.js +29 -35
  257. package/cypress/pages/components/gridQuestionCommonComponent.js +8 -37
  258. package/cypress/pages/components/imageCanvasComponent.js +7 -6
  259. package/cypress/pages/components/mcqAdditionalSettingsBase.js +4 -0
  260. package/cypress/pages/components/questionInstructionsComponent.js +7 -0
  261. package/cypress/pages/components/scoringSectionBaseEditTab.js +5 -0
  262. package/cypress/pages/contentBlocksPage.js +2 -0
  263. package/cypress/pages/desmos3DGraphingPage.js +149 -4
  264. package/cypress/pages/desmosGeometryPage.js +184 -4
  265. package/cypress/pages/dialogBoxBase.js +2 -1
  266. package/cypress/pages/drawingResponsePage.js +6 -4
  267. package/cypress/pages/fillInTheGapsOverImageDropdownPage.js +1 -1
  268. package/cypress/pages/gradingViewPage.js +8 -0
  269. package/cypress/pages/graphingPage.js +27 -8
  270. package/cypress/pages/gridFillPage.js +15 -6
  271. package/cypress/pages/index.js +2 -1
  272. package/cypress/pages/listOrderingPage.js +32 -1
  273. package/cypress/pages/matchingPage.js +26 -7
  274. package/cypress/pages/multipleSelectionPage.js +10 -39
  275. package/cypress/pages/numberLineLabelPage.js +31 -8
  276. package/cypress/pages/numberLinePage.js +19 -7
  277. package/cypress/pages/selectQuestionResourceToolPage.js +8 -2
  278. package/cypress/pages/singleSelectionPage.js +0 -37
  279. package/cypress/pages/textEntryMathPage.js +24 -1
  280. package/cypress/pages/thinkSpherePage.js +2185 -0
  281. package/cypress/pages/uploadResponsePage.js +2 -1
  282. package/cypress/pages/videoResponsePage.js +3 -0
  283. package/cypress/support/commands.js +7 -4
  284. package/cypress/support/e2e.js +1 -0
  285. package/cypress/support/helpers/createItem.js +1200 -1
  286. package/cypress/support/helpers/utilities.js +88 -1
  287. package/package.json +3 -3
@@ -0,0 +1,2185 @@
1
+ import utilities from "../support/helpers/utilities";
2
+ import { browseItemsPage } from "../pages/components/browseItemsPage";
3
+ import { editCategoryFlyout } from "../pages/components/editCategoryFlyout";
4
+ import { dialogBoxBase } from "../pages/dialogBoxBase";
5
+ import { backgroundImageUploadComponent, createQuestionBasePage, scoringSectionBaseEditTab, commonComponents, additionalSettingsPanel, additionalSettingsAccessibilitySectionComponent, toolSettingsComponent, questionInstructionsComponent, studentViewSettingsLabelComponent, defaultToolDropdown, essayResponseCommonComponents, equationEditorSectionCommonComponent, equationEditorFlyout, createCustomCategoryFlyout } from "./components"
6
+ import { drawingResponsePage } from "./drawingResponsePage";
7
+ import { optionsWrapperComponent } from "../pages/components/optionsWrapperComponent";
8
+ import { selectQuestionResourceToolPage } from "./selectQuestionResourceToolPage";
9
+ import { videoResponsePage } from "./videoResponsePage";
10
+ import { singleSelectionPage } from "./singleSelectionPage";
11
+ import { essayResponsePage } from "./essayResponsePage";
12
+ import { equationEditorCategoriesAndSymbols } from "../fixtures/equationEditorCategoriesAndSymbols ";
13
+ const css = Cypress.env('css');
14
+
15
+ const selectors = {
16
+ ...essayResponsePage,
17
+ ...backgroundImageUploadComponent,
18
+ ...questionInstructionsComponent,
19
+ ...commonComponents,
20
+ ...scoringSectionBaseEditTab,
21
+ ...additionalSettingsPanel,
22
+ ...drawingResponsePage,
23
+ ...defaultToolDropdown,
24
+ ...optionsWrapperComponent,
25
+ ...essayResponseCommonComponents,
26
+ ...equationEditorSectionCommonComponent,
27
+ ...selectQuestionResourceToolPage,
28
+ ...browseItemsPage,
29
+ ...videoResponsePage,
30
+ ...dialogBoxBase,
31
+ ...editCategoryFlyout,
32
+ ...createCustomCategoryFlyout,
33
+ ...createQuestionBasePage,
34
+
35
+ editQuestionPencil: () => cy.get('[class*="Widgetstyles__HeaderContainer"] button.icon-pencil'),
36
+ widgetHeaderQuestionTitle: () => cy.get('[class*="Widgetstyles__HeaderContainer"] [class*="Widgetstyles__QuestionTypeText"]'),
37
+ imageUploadSection: () => cy.get('[class*="TabsComponentstyles__ImageUploadComponentWrapper"]'),
38
+ addThinkSphereQuestionButton: () => cy.get('.ngie-btn-contained').contains('add ThinkSphere question'),
39
+ whiteBoardCanvasAndControls: () => cy.get('[class*="WhiteboardPagesstyles__WhiteboardPagesWrapper"]'),
40
+ whiteBoardImageProperties: () => cy.get('[class*="WhiteBoardImagePropertiesstyles__ImagePropertiesWrapper"]'),
41
+ whiteBoardImagePropertiesInputTypeFile: () => cy.get('[class*="WhiteBoardImagePropertiesstyles__ImagePropertiesWrapper"] input[type="file"]'),
42
+ topLeftButton: () => utilities.getNthElement(cy.get('button[class*="WhiteBoardImagePropertiesstyles__StyledButton"]'), 0),
43
+ centerButton: () => utilities.getNthElement(cy.get('button[class*="WhiteBoardImagePropertiesstyles__StyledButton"]'), 1),
44
+ topRightButton: () => utilities.getNthElement(cy.get('button[class*="WhiteBoardImagePropertiesstyles__StyledButton"]'), 2),
45
+ opacityLabel: () => utilities.getNthElement(cy.get('h2[class*="WhiteBoardImagePropertiesstyles__LayoutLabel"]'), 1),
46
+ imageAlternativeTextLabel: () => cy.get('div[class*="InlineTextFieldWithDebouncestyles__PropertyLabel"]'),
47
+ imageAlternativeTextInputField: () => cy.get('input.text-field'),
48
+ imageRadioButton: () => cy.get('div[data-value="image"]'),
49
+ manageWhiteBoardTitle: () => cy.get('[class*="WhiteboardPagesstyles__HeadingLabel"]'),
50
+ whiteBoardPreviousButton: () => cy.get('[class*="whiteboard-pagination-prev-button"]'),
51
+ whiteBoardPageLabel: () => cy.get('[class*="WhiteboardPagesstyles__PageLabel"]'),
52
+ whiteBoardPageCounter: () => cy.get('[class*="WhiteboardPagesstyles__PageCounter"]'),
53
+ whiteBoardNextButton: () => cy.get('[class*="whiteboard-pagination-next-button"]'),
54
+ whiteBoardDeleteButton: () => cy.get('[class*="whiteboard-delete-page-button"]'),
55
+ whiteBoardAddNewPageButton: () => cy.get('[class*="whiteboard-add-new-page-button"]'),
56
+ imageRadioInput: () => cy.get('div[data-value="image"] input[type="radio"]'),
57
+ pageImageTitle: () => cy.get('div[class*="WhiteBoardImagePropertiesstyles__PageImageTitle"]'),
58
+ radioGroupWrapper: () => cy.get('div[class*="ngie-radio-group-wrapper"]'),
59
+ blankCanvasRadioInput: () => cy.get('div[data-value="blankCanvas"] input[type="radio"]'),
60
+ imageUploadSectionWrapper: () => cy.get('div[class*="UploadImagestyles__BackgroundImageWrapper"]'),
61
+ pageImagePropertiesTitle: () => cy.get('div[class*="WhiteBoardImagePropertiesstyles__PageImagePropertiesTitle"]'),
62
+ layoutLabel: () => cy.get('h2[class*="WhiteBoardImagePropertiesstyles__LayoutLabel"]'),
63
+ alignmentOptions: () => cy.get('ul[class*="WhiteBoardImagePropertiesstyles__AlignmentOptions"]'),
64
+ solvePhaseAccordion: () => utilities.getNthElement(cy.get('[class*="Solvestyles__SolvePhaseAccordionWrapper"] .ngie-accordion-summary'), 0),
65
+ solvePhaseAccordionLabel: () => utilities.getNthElement(cy.get('.thinksphere-author-phases-accordion [class*="Solvestyles__HeadingLabel"]'), 0),
66
+ solvePhaseAccordionExpandIcon: () => utilities.getNthElement(cy.get('.thinksphere-author-phases-accordion [class*="expandIconWrapper"]'), 0),
67
+ solveToolsAndControlsOptionsTiles: (formattingOption) => cy.get(`.icon-button-custom-format[aria-label*="${formattingOption}"]`),
68
+ solvePhaseAccordionContentWrapper: () => cy.get('.thinksphere-author-phases-accordion [class*="Solvestyles__ContentWrapper"]'),
69
+ customizeToolsAndControls: () => cy.get('.thinksphere-author-phases-accordion .customize-tools-and-controls-wrapper .ngie-accordion-summary'),
70
+ customizeToolsAndControlsIcon: () => cy.get('.thinksphere-author-phases-accordion .customize-tools-and-controls-wrapper [class*="expandIconWrapper"]'),
71
+ customizeToolsAndControlsLabel: () => cy.get('.thinksphere-author-phases-accordion .customize-tools-and-controls-wrapper [class*="Solvestyles__HeadingLabel"]'),
72
+ phasesSection: () => cy.get('[class*="Phasesstyles__PhasesWrapper"]'),
73
+ phasesSectionTitle: () => cy.get('[class*="Phasesstyles__PhasesTextWrapper"]'),
74
+ planPhaseSection: () => cy.get('[class*="Planstyles__PlanAccordianWrapper"]'),
75
+ planPhaseAccordian: () => cy.get('[class*="Planstyles__PlanAccordianWrapper"] [class~="MuiAccordionSummary-root"]'),
76
+ planPhaseAccordianLabel: () => cy.get('[class*="Planstyles__AccordionLabel"]'),
77
+ planPhaseSectionDescription: () => cy.get('[class*="Planstyles__PlanAccordianWrapper"] [class*="Planstyles__PlanDescriptionTextWrapper"]'),
78
+ planStrategySection: () => cy.get('[class*="Planstyles__StrategiesWrapper"]'),
79
+ planStrategyListHeader: () => cy.get('[class*="Planstyles__StrategiesWrapper"] [class*="Planstyles__HeadingTextWrapper"]'),
80
+ planStrategyListResetToDefault: () => cy.get('[class*="Planstyles__StrategiesWrapper"] [class*="Planstyles__DefaultResetWrapper"]'),
81
+ planStrategyAddItemButton: () => cy.get('[class*="Planstyles__StrategiesWrapper"] [class*="ListOptionsComponentstyles__AddItemWrapper"] [role="button"]'),
82
+ planStrategyCheckbox: () => cy.get('[class*="Planstyles__StrategiesWrapper"] .thinksphere-option-text-field-wrapper [data-ngie-testid*="-checkbox"]'),
83
+ videoLinkComponent: (nthElement = 0) => utilities.getNthElement(cy.get('[class*="ListOptionsComponentstyles__UploadVideoWrapper"]'), nthElement),
84
+ uploadVideoLinkButton: () => cy.get('[class*="ListOptionsComponentstyles__UploadVideoTextWrapper"]'),
85
+ planSentenceStarterSection: () => cy.get('[class*="Planstyles__SentenceFramesWrapper"]'),
86
+ planSentenceStarterListHeader: () => cy.get('[class*="Planstyles__SentenceFramesWrapper"] [class*="Planstyles__HeadingTextWrapper"]'),
87
+ planSentenceStarterListResetToDefault: () => cy.get('[class*="Planstyles__SentenceFramesWrapper"] [class*="Planstyles__DefaultResetWrapper"]'),
88
+ planSentenceStarterAddItemButton: () => cy.get('[class*="Planstyles__SentenceFramesWrapper"] [class*="ListOptionsComponentstyles__AddItemWrapper"] [role="button"]'),
89
+ planSentenceStarterCheckbox : () => cy.get('[class*="Planstyles__SentenceFramesWrapper"] .thinksphere-option-text-field-wrapper [data-ngie-testid*="-checkbox"]'),
90
+ solvePhaseAccordian: () => cy.get('[class*="Planstyles__SolveAccordianWrapper"] [class~="MuiAccordionSummary-root"] [role="button"]'),
91
+ solvePhaseAccordianLabel: () => cy.get('[class*="Solvestyles__AccordionLabel"]'),
92
+ inputTypeVideoFile: () => cy.get('[class*="Planstyles__StrategiesWrapper"] input[type="file"]'),
93
+ inputTypeFile: () => cy.get('[class*="TabsComponentstyles__ImageUploadComponentWrapper"] input[type="file"]'),
94
+ whiteBoardInputTypeFile: () => cy.get('[class*="UploadImagestyles__UploadWrapper"] input[type="file"]'),
95
+ warningPopupTitle: () => cy.get('.dialog-title-wrapper'),
96
+ warningPopupContentText: () => cy.get('.upload-question-preview-popup-error-msg'),
97
+ warningPopupOkButton: () => cy.get('.upload-question-preview-popup-ok-btn'),
98
+ editVideoButton: () => cy.get('[aria-label*="Change video"]'),
99
+ deleteVideoButton: () => cy.get('[aria-label*="Delete video"]'),
100
+ listInputField: () => cy.get('.option-component textarea[placeholder]'),
101
+ deleteButton: () => cy.get('button[aria-label*="Delete"].ngie-icon-btn-cls'),
102
+ optionNumeration: () => cy.get('[class*="MuiInputAdornment-positionStart"]'),
103
+ iconPencil: () => cy.get('div[class*="icon-pencil"]'),
104
+ iconXCircle: () => cy.get('div[class*="icon-x-circle"]'),
105
+ dragIcon: () => cy.get('[class*="drag-icon-edit"]'),
106
+ moreOptionsIcon: () => cy.get('[class*="more-options-icon"]'),
107
+ ThinkSphereQuestionHeaderPencilIcon: () => utilities.getNthElement(cy.get('[class*="Widgetstyles__HeaderContainer"] [class*="icon-pencil"]'), 0),
108
+ ThinkSphereMathQuestionHeaderSwapIcon: () => cy.get('[class*="Widgetstyles__HeaderContainer"] [class*="icon-swap"]'),
109
+ ThinkSphereMathQuestionHeaderPencilIcon: () => utilities.getNthElement(cy.get('[class*="Widgetstyles__HeaderContainer"] [class*="icon-pencil"]'), 1),
110
+ thinkSphereMathQuestionHeaderDeleteIcon: () => cy.get('[class*="Widgetstyles__HeaderContainer"] [class*="icon-Delete"]'),
111
+ addCheckMathQuestionButton: () => cy.get('.ngie-btn-typography').contains(`Add 'Check your math' question`),
112
+ firstAvailableItemLink: () => utilities.getNthElement(cy.get('.browse-item-styled-link'), 0),
113
+ saveButton: () => cy.get('.ngie-btn-typography').contains('save',{matchCase: false}),
114
+ cancelButton: () => cy.get('.ngie-btn-typography').contains('cancel',{matchCase: false}),
115
+ AddCheckMathQuestionHeader: () => cy.get('.browse-title-wrapper').contains(`Add 'Check your math' question`),
116
+ singleOptionTextFieldWrapper: () => cy.get('[class*="SingleOptionstyle__TextFieldWrapper"]'),
117
+ customizeStampComponent: () => cy.get('[class*="CustomizeStampstyles__CustomizeStampWrapper"]'),
118
+ customizeStampHeading: () => cy.get('[class*="CustomizeStampstyles__CustomizeStampHeading"]'),
119
+ customizeStampCard: (ariaLabel, checked) => cy.get(`[class*="CustomizeStampstyles__StampCard"]${ariaLabel ? ('[aria-label="' + ariaLabel + '"]') : ''}${checked ? ('[aria-checked="' + checked + '"]') : ''}`),
120
+ customizeStampCardImg: (ariaLabel) => cy.get('[class*="CustomizeStampstyles__QuestionImage"]'),
121
+ questionImage: () => cy.get('img[class*="QuestionImageComponentstyle__QuestionImage"]'),
122
+ stampsToolButton: () => cy.get('#stamps button[aria-label*="Stamps"]'),
123
+ imageUploadSectionImageLabel: () => thinkSpherePage.imageUploadSection().find('div[class*="edit-question-image-label"]'),
124
+ imageUploadSectionUploadFileContent: () => thinkSpherePage.imageUploadSection().find('div[class*="upload-file-content"]'),
125
+ imageUploadSectionUploadCloudIconWrapper: () => thinkSpherePage.imageUploadSection().find('div[class*="upload-question-upload-cloud-icon-wrapper"]'),
126
+ imageUploadSectionDragDropFileText: () => thinkSpherePage.imageUploadSection().find('span[class*="drag-and-drop-file-text"]'),
127
+ imageUploadSectionFileInputLabel: () => thinkSpherePage.imageUploadSection().find('div[class*="file-input-label"]'),
128
+ imageUploadSectionDeviceIcon: () => thinkSpherePage.imageUploadSection().find('span[class*="icon-Device"]'),
129
+ imageUploadSectionSupportedFileText: () => thinkSpherePage.imageUploadSection().find('span[class*="supported-file-text"]'),
130
+ imageUploadSectionSupportedFileIconWrapper: () => thinkSpherePage.imageUploadSection().find('div[class*="supported-file-icon-wrapper"]'),
131
+ imageUploadSectionMaximumFileSize: () => thinkSpherePage.imageUploadSection().find('div[class*="maximum-file-size"]'),
132
+ imageUploadSectionFileUploaderWrapper: () => thinkSpherePage.imageUploadSection().find('div[class*="QuestionImageComponentstyle__FileUploaderWrapper"]'),
133
+ imageUploadSectionQuestionImage: () => thinkSpherePage.imageUploadSection().find('div[class*="QuestionImageComponentstyle__QuestionImage"]'),
134
+ imageUploadSectionQuestionImageContainer: () => thinkSpherePage.imageUploadSection().find('div[class*="QuestionImageComponentstyle__QuestionImageContainer"]'),
135
+ imageUploadSectionQuestionImageEditIcon: () => thinkSpherePage.imageUploadSection().find('div[class*="QuestionImageComponentstyle__EditIcon"]'),
136
+ imageUploadSectionQuestionImageCrossIcon: () => thinkSpherePage.imageUploadSection().find('div[class*="QuestionImageComponentstyle__CrossIcon"]'),
137
+ imageRadioButtonParentSvg: () => thinkSpherePage.imageRadioButton().parent().find('svg'),
138
+ solvePhaseAccordionSvg: () => thinkSpherePage.solvePhaseAccordion().find('svg'),
139
+ customizeToolsAndControlsPath: () => thinkSpherePage.customizeToolsAndControls().find('path'),
140
+ solvePhaseToolsAndControlsOptionsTilesFeatherCheckIcon: () => thinkSpherePage.solveToolsAndControlsOptionsTiles('Text').find('[data-name="Icon feather-check"]'),
141
+ solvePhaseToolsAndControlsOptionsTilesRectangle: () => thinkSpherePage.solveToolsAndControlsOptionsTiles('Text').find('[data-name*="Rectangle"]'),
142
+ solvePhaseToolsAndControlsOptionsTilesDragItemFlexWrapperSvg: () => thinkSpherePage.solveToolsAndControlsOptionsTiles('Text').find('.drag-item-flex-wrapper svg'),
143
+ solvePhaseToolsAndControlsOptionsTilesTextDragIconSvgPath: () => thinkSpherePage.solveToolsAndControlsOptionsTiles('Text').find('.drag-icon-button-custom-format svg path'),
144
+ solvePhaseToolsAndControlsOptionsTilesArrayDragIconSvgPath: () => thinkSpherePage.solveToolsAndControlsOptionsTiles('Array').find('.drag-icon-button-custom-format svg path'),
145
+ playerTimer: () => cy.get('[class*="VideoPlayerstyles__PlayerTimerWrapper"]'),
146
+ strategiesPreviewHeader: () => cy.get('[class*="StrategiesPreviewstyles__HeadingWrapper"]'),
147
+ addNewStrategyButton: () => cy.get('[class*="StrategiesPreviewstyles__AddStrategyButton"]'),
148
+ strategiesInputBoxEditTab: () => cy.get('.video-upload-support-wrapper .edit-mcq-option-wrapper'),
149
+ strategiesBoxPreviewTab: () => cy.get('[class*="StrategiesPreviewstyles__ListWrapper"]'),
150
+ popupTitle: () => cy.get('[class*="dialog-title-wrapper"]'),
151
+ strategyNameLabel: () => cy.get('[class*="ThinkSpherePreviewstyles__StrategyNameTextWrapper"]'),
152
+ strategyNameInputField: () => cy.get('[class*="new-strategy-name-field"]'),
153
+ addStrategyPopupCancelButton: () =>
154
+ cy.get('.dialog-content').contains('Cancel'),
155
+ addStrategyPopupSaveButton: () =>
156
+ cy.get('.dialog-content').contains('Save'),
157
+ // preview tab plan section selection
158
+ questionInstructionPreviewTexWrapper: () => cy.get('.question-instruction.question-text-wrapper'),
159
+ questionInstructionPreviewImageWrapper: () => cy.get('[class*="ThinkSpherePreviewstyles__ImageWrapper"]'),
160
+ questionInstructionPreviewImageExpandButton: () => cy.get('[class*="ThinkSpherePreviewstyles__ExpandImageIconWrapper"]'),
161
+ questionInstructionImagePopup: () => cy.get('[class*="QuestionTextstyle__ImagePopupDiv"]'),
162
+ closeExpandImagePopupButton: () => cy.get('.close-popup-btn'),
163
+ PlanningPreviewWrapper : () => cy.get('[class*="PlanningPreviewstyles__PlanningPreviewWrapper"]'),
164
+ planningPreviewHeading: () => cy.get('[class*="PlanningPreviewstyles__HeadingWrapper"]'),
165
+ planningWriteWrapper : () => cy.get('[class*="PlanningPreviewstyles__WriteWrapper"]'),
166
+ problemAskingWrapper: () => cy.get('[class*="PlanningPreviewstyles__ProblemAskingWrapper"]'),
167
+ contentEditableDiv: () => cy.get('[class*="PlanningPreviewstyles__ContentEditableDiv"]'),
168
+ micIconWrapper: () => cy.get('[class*="PlanningPreviewstyles__MicIconWrapper"]'),
169
+ strategiesToPlanWrapper: () => cy.get('[class*="PlanningPreviewstyles__StrategiesToPlanWrapper"]'),
170
+ subheadingWrapper: () => cy.get('[class*="PlanningPreviewstyles__SubHeadingWrapper"]'),
171
+ writePlanWrapper: () => cy.get('[class*="PlanningPreviewstyles__WritePlanWrapper"]'),
172
+ strategyChipWrapper: () => cy.get('[class*="PlanningPreviewstyles__StrategyChipWrapper"]'),
173
+ strategyChip: () => cy.get('[class*="PlanningPreviewstyles__StrategyChip-"]'),
174
+ strategiesPreviewListLI: () => cy.get('[class*="StrategiesPreviewstyles__ListLI"]'),
175
+ chooseStarterLabel: () => cy.get('[class*="ThinkSpherePreviewstyles__DropDownLabel"]'),
176
+ chooseStarterDropdown: () => cy.get('[class*="drop-down-parent"]'),
177
+ chooseStarterTextIconWrapper: () => cy.get('[class*="DropDownstyles__StarterTextIconWrapper"]'),
178
+ chooseStartersListOptions: () => cy.get('.ngie-popover-container.dropdown-list-container li[role="option"]'),
179
+ chooseStartersListOptionLabels: () => cy.get('.ngie-popover-container.dropdown-list-container li[role="option"] .dropdown-label-text'),
180
+ starterTextWrapper: () => cy.get('.starter-text-wrapper'),
181
+ starterIocn: () => cy.get('[class*="DropDownstyles__StarterIconWrapper"]'),
182
+ addNewStrategyTextWrapper: () => cy.get('[class*="StrategiesPreviewstyles__AddStrategyTextWrapper"]'),
183
+ strategyTextWrapper: () => cy.get('[class*="StrategiesPreviewstyles__StrategyTextWrapper"]'),
184
+ videoIconWrapper: () => cy.get('[class*="StrategiesPreviewstyles__VideoIconWrapper"]'),
185
+ whiteBoardCanvas: () => cy.get('[class*="WhiteboardPagesstyles__Canvas"]'),
186
+ whiteBoardImage: () => cy.get('[class*="WhiteboardPagesstyles__BackgroundImage"]'),
187
+ videoPopupTitle: () => cy.get('[class*="dialog-title-wrapper"]'),
188
+ videoPopupCloseButton: () => cy.get('[class*="dialog-close-button"]'),
189
+ videoPreviewPopup: () => cy.get('[class*="video-preview-popup"]'),
190
+ gridItemsWrapper: (number) => cy.get('[class*="DragAndDropGridstyles__GridItemsWrapper"]').eq(number),
191
+ dragButton: (number) => cy.get('[type="button"]').eq(number),
192
+ customizeStampsButton: (customizeStampPosition) => cy.get(`button[aria-label="Stamp ${customizeStampPosition}"]`),
193
+ buttonSave: () => cy.get('.action-btn-wrapper button').eq(1),
194
+ buttonCancel: () => cy.get('.action-btn-wrapper button').eq(0),
195
+ nextGenThinkSphereCreateItemWrapper: () => cy.get('#nextgen-thinkshpere-create-item'),
196
+ equationEditorSectionTitle: () => cy.get('.equation-editor-text-title'),
197
+ referenceIdWrapper: () => cy.get('.edit-item-reference-id-wrapper'),
198
+ editBoxWrapper: () => cy.get('.edit-box-wrapper'),
199
+ editBoxText: () => cy.get('.edit-box-text'),
200
+ editBoxTextInput: () => thinkSpherePage.editBoxWrapper().find('input'),
201
+ editIconPencil: () => cy.get('.icon-pencil'),
202
+ thinkSphereQuestionHeader: () => cy.get('.edit-question-header-title'),
203
+ filterSectionQuestionTypesAccordion: () => cy.get('.filter-section-expansion-panel-summary-root'),
204
+ filterSectionQuestionAccordion: () => cy.get('.expansion-item-expansion-panel-summary-content'),
205
+ checkBox: () => cy.get('.MuiCheckbox-root'),
206
+ browseItemQuestionItem: () => cy.get('.browse-item-question-item'),
207
+ ErrorMessageContainer: () => cy.get('.ErrorMessageContainer'),
208
+ categoriesDropDown: () => cy.get('.dropdown-form-control[label="Categories"]'),
209
+ categoriesDropDownLabelText: () => cy.get('.dropdown-label-text'),
210
+ categoriesDropDownMenuItem: () => cy.get('.dropdown-menu-item .dropdown-label-text'),
211
+ categoriesDropDownParent: () => cy.get('.drop-down-parent'),
212
+ cardWrapper: () => cy.get('.card-wrapper'),
213
+ cardLabel: () => cy.get('.widget-card-label'),
214
+ thinkSphereQuestionInstructionCKEditor: () => cy.get('div.cke_editable[contenteditable="true"]'),
215
+ reviewTab: () => cy.get('div[aria-label="Review tab"]'),
216
+ planTab: () => cy.get('div[aria-label="Plan tab"]'),
217
+ checkYourMathHeading: () => utilities.getNthElement(cy.get('div[class*="ReviewTabstyles__CheckYourMathTextWrapper"]'), 0),
218
+ problemAskingToMeTextWrapper: () => utilities.getNthElement(cy.get('div[class*="ReviewTabstyles__ProblemAskingToMeTextWrapper"]'), 0),
219
+ reviewQuestionWrapper: () => utilities.getNthElement(cy.get('div[class*="ReviewTabstyles__QuestionWrapper"]'), 0),
220
+ reviewComponentWrapper: () => utilities.getNthElement(cy.get('div[class*="ReviewTabstyles__ComponentWrapper"]'), 0),
221
+ problemStatementWrapper: () => utilities.getNthElement(cy.get('div[class*="ReviewTabstyles__ProblemStatementWrapper"]'), 0),
222
+ gradingViewRadioButton: () => cy.get('label[aria-label="Grading View"]'),
223
+ studentViewRadioButton: () => cy.get('label[aria-label="Student View"]'),
224
+ correctAnswerLabelWrapper: () => cy.get('div[class*="CorrectAnswerLabelWrapper"]'),
225
+ };
226
+
227
+ const steps = {
228
+ ...essayResponsePage.steps,
229
+ ...backgroundImageUploadComponent.steps,
230
+ ...questionInstructionsComponent.steps,
231
+ ...scoringSectionBaseEditTab.steps,
232
+ ...commonComponents.steps,
233
+ ...additionalSettingsPanel.steps,
234
+ ...toolSettingsComponent.steps,
235
+ ...studentViewSettingsLabelComponent.tests,
236
+ ...defaultToolDropdown.steps,
237
+ ...optionsWrapperComponent.steps,
238
+ ...essayResponseCommonComponents.steps,
239
+ ...equationEditorFlyout.steps,
240
+ ...equationEditorSectionCommonComponent.steps,
241
+ ...selectQuestionResourceToolPage.steps,
242
+ ...browseItemsPage.steps,
243
+ ...videoResponsePage.steps,
244
+ ...createQuestionBasePage.steps,
245
+ ...createCustomCategoryFlyout.steps,
246
+
247
+ /**
248
+ * Navigates to the ThinkSphere create question page.
249
+ * @param {string} questionType - The type of question to create.
250
+ */
251
+ navigateToThinkSphereCreateQuestion: (questionType) => {
252
+ cy.visit('/item-engine/thinksphere/create-item');
253
+ thinkSpherePage.steps.addThinkSphereQuestion();
254
+ },
255
+
256
+ addThinkSphereQuestion: () => {
257
+ thinkSpherePage.addThinkSphereQuestionButton()
258
+ .click();
259
+ },
260
+
261
+ /**
262
+ * Verifies if the accordion is collapsed.
263
+ * @param {string} accordian - The accordion to verify ('plan' or 'solve').
264
+ * @param {boolean} isCollapsed - Whether the accordion should be collapsed.
265
+ */
266
+ verifyAccordianCollapsed: (accordian, isCollapsed) => {
267
+ if (accordian === 'plan') {
268
+ thinkSpherePage.planPhaseAccordian()
269
+ .should('have.attr', 'aria-expanded', isCollapsed ? 'false' : 'true');
270
+ } else if (accordian === 'solve') {
271
+ thinkSpherePage.solvePhaseAccordian()
272
+ .should('have.attr', 'aria-expanded', isCollapsed ? 'false' : 'true');
273
+ }
274
+ },
275
+
276
+ /**
277
+ * Clicks on the specified accordion.
278
+ * @param {string} accordian - The accordion to click ('plan' or 'solve').
279
+ */
280
+ clickOnAccordian: (accordian) => {
281
+ if (accordian === 'plan') {
282
+ thinkSpherePage.planPhaseAccordian()
283
+ .click();
284
+ } else if (accordian === 'solve') {
285
+ thinkSpherePage.solvePhaseAccordian()
286
+ .click();
287
+ }
288
+ cy.wait(500);
289
+ },
290
+
291
+ clickOnEditThinkSphereItem: () => {
292
+ browseItemsPage.steps.clickOnItemReferenceId('~zzz item name');
293
+ utilities.getNthElement(thinkSpherePage.editQuestionPencil(), 0)
294
+ .click();
295
+ cy.barsPreLoaderWait();
296
+ },
297
+
298
+ clickOnAddCheckMathQuestionButton: () => {
299
+ thinkSpherePage.addCheckMathQuestionButton()
300
+ .click();
301
+ cy.interceptGraphql('getItems');
302
+ },
303
+
304
+ clickOnFirstAvailableItemLink: () => {
305
+ thinkSpherePage.firstAvailableItemLink()
306
+ .click();
307
+ cy.interceptGraphql('getItems');
308
+ },
309
+
310
+ clickOnSaveButton: () => {
311
+ cy.interceptGraphql('setItem');
312
+ thinkSpherePage.saveButton()
313
+ .click();
314
+ cy.wait('@setItem');
315
+ },
316
+
317
+ clickOnCancelButton: () => {
318
+ cy.interceptGraphql('setItem');
319
+ thinkSpherePage.cancelButton()
320
+ .click();
321
+ },
322
+
323
+ clickOnSwapButton: () => {
324
+ thinkSpherePage.ThinkSphereMathQuestionHeaderSwapIcon()
325
+ .click();
326
+ cy.wait(2000);
327
+ },
328
+
329
+ clickOnEditButton: () => {
330
+ thinkSpherePage.ThinkSphereMathQuestionHeaderPencilIcon()
331
+ .click();
332
+ cy.wait(2000);
333
+ },
334
+
335
+ clickOnDeleteButton: () => {
336
+ thinkSpherePage.thinkSphereMathQuestionHeaderDeleteIcon()
337
+ .click();
338
+ cy.wait(2000);
339
+ },
340
+
341
+ /**
342
+ * Verifies the question title.
343
+ * @param {string} questionType - The type of question to verify.
344
+ */
345
+ verifyQuestionTitle: (questionType) => {
346
+ utilities.verifyInnerText(utilities.getNthElement(thinkSpherePage.widgetHeaderQuestionTitle(), 0), questionType);
347
+ },
348
+
349
+ verifyPlanSectionAccessibility: () => {
350
+ thinkSpherePage.planPhaseSection().find('div[class~="MuiAccordionSummary-root"]')
351
+ .should('have.attr', 'aria-expanded', 'true')
352
+ .should('have.attr', 'role', 'button')
353
+ .should('have.attr', 'tabindex', '0');
354
+ },
355
+
356
+ /**
357
+ * Uploads a file.
358
+ * @param {string} file - The file to upload.
359
+ */
360
+ uploadFile: (file) => {
361
+ thinkSpherePage.inputTypeFile()
362
+ .attachFile(file);
363
+ cy.wait(4000);
364
+ },
365
+
366
+ uploadWhiteBoardImage: (file) => {
367
+ thinkSpherePage.whiteBoardInputTypeFile()
368
+ .attachFile(file);
369
+ cy.wait(4000);
370
+ },
371
+
372
+ /**
373
+ * Uploads a video file.
374
+ * @param {string} file - The file to upload.
375
+ */
376
+ uploadVideoFile: (file) => {
377
+ const fileName = file.split('/').pop(); // Extracts only 'sample.mp4'
378
+
379
+ cy.fixture(file, 'binary') // Read the file as binary
380
+ .then(Cypress.Blob.binaryStringToBlob)
381
+ .then((blob) => {
382
+ const fileObj = new File([blob], fileName, { type: 'video/mp4' });
383
+ const dataTransfer = new DataTransfer();
384
+ dataTransfer.items.add(fileObj);
385
+
386
+ thinkSpherePage.inputTypeVideoFile().then(($input) => {
387
+ $input[0].files = dataTransfer.files;
388
+ cy.wrap($input).trigger('change', { force: true });
389
+ });
390
+ });
391
+
392
+ cy.wait(4000);
393
+ },
394
+
395
+ /**
396
+ * Uploads a file to the whiteboard.
397
+ * @param {string} file - The file to upload.
398
+ */
399
+ WhiteBoardUploadFile: (file) => {
400
+ thinkSpherePage.whiteBoardImagePropertiesInputTypeFile()
401
+ .attachFile(file);
402
+ cy.wait(4000);
403
+ },
404
+
405
+ navigateToThinkSphereCreateItem: () => {
406
+ cy.visit('/item-engine/thinksphere/create-item');
407
+ },
408
+
409
+ navigateToReviewItemBank: () => {
410
+ thinkSpherePage.addReviewQuestionButton().click();
411
+ },
412
+
413
+ clickOnAddThinkSphereQuestion: () => {
414
+ thinkSpherePage.addThinkSphereQuestionButton()
415
+ .click();
416
+ },
417
+
418
+ verifyCenterOptionAlignmentIsSelected: () => {
419
+ thinkSpherePage.centerButton()
420
+ .should('have.attr', 'aria-pressed', 'true');
421
+ },
422
+
423
+ /**
424
+ * Verifies the opacity slider value.
425
+ * @param {string} opacityValue - The expected opacity value.
426
+ */
427
+ verifyOpacitySliderValue: (opacityValue) => {
428
+ thinkSpherePage.opacitySlider()
429
+ .find('input')
430
+ .should('have.value', opacityValue)
431
+ },
432
+
433
+ /**
434
+ * Verifies the opacity input field value.
435
+ * @param {string} opacityValue - The expected opacity value.
436
+ */
437
+ verifyOpacityInputFieldValue: (opacityValue) => {
438
+ thinkSpherePage.opacityInputField()
439
+ .should('have.value', opacityValue)
440
+ },
441
+
442
+ clickOnOpacitySlider: () => {
443
+ thinkSpherePage.opacitySlider()
444
+ .click();
445
+ },
446
+
447
+ /**
448
+ * Adds input to the opacity input field.
449
+ * @param {string} value - The value to input.
450
+ */
451
+ addInputToOpacityInputField: (value) => {
452
+ thinkSpherePage.opacityInputField()
453
+ .clear()
454
+ .type(value, { delay: 0 })
455
+ },
456
+
457
+ /**
458
+ * Verifies the image alternative text input field.
459
+ * @param {string} imageAlternativeText - The expected alternative text.
460
+ */
461
+ verifyImageAlternativeTextInputField: (imageAlternativeText) => {
462
+ thinkSpherePage.imageAlternativeTextInputField()
463
+ .should('have.value', imageAlternativeText);
464
+ },
465
+ expandSolvePhaseAccordion: () => {
466
+ thinkSpherePage.solvePhaseAccordion()
467
+ .click()
468
+ .should('have.attr', 'aria-expanded', 'true');
469
+ },
470
+ expandCustomizeToolsAndControls: () => {
471
+ thinkSpherePage.customizeToolsAndControls()
472
+ .click()
473
+ .should('have.attr', 'aria-expanded', 'true');
474
+ },
475
+ /**
476
+ * Verifies the tools and controls options.
477
+ * @param {Array<string>} options - The options to verify.
478
+ */
479
+ verifyToolsAndControlsOptions: (options) => {
480
+ options.forEach(option => {
481
+ utilities.verifyElementVisibilityState(thinkSpherePage.solveToolsAndControlsOptionsTiles(option), 'visible');
482
+ });
483
+ },
484
+ /**
485
+ * Selects an option from tools and controls.
486
+ * @param {string} option - The option to select.
487
+ */
488
+ selectOptionFromToolsAndControls: (option) => {
489
+ thinkSpherePage.solveToolsAndControlsOptionsTiles(option)
490
+ .click();
491
+ thinkSpherePage.solveToolsAndControlsOptionsTiles(option)
492
+ .should('have.attr', 'data-aria-pressed', 'true');
493
+ },
494
+ /**
495
+ * Deselects an option from tools and controls.
496
+ * @param {string} option - The option to deselect.
497
+ */
498
+ deselectOptionFromToolsAndControls: (option) => {
499
+ thinkSpherePage.solveToolsAndControlsOptionsTiles(option)
500
+ .click();
501
+ thinkSpherePage.solveToolsAndControlsOptionsTiles(option)
502
+ .should('have.attr', 'data-aria-pressed', 'false');
503
+ },
504
+ /**
505
+ * Verifies if an option is selected.
506
+ * @param {string} option - The option to verify.
507
+ */
508
+ verifyOptionIsSelected: (option) => {
509
+ thinkSpherePage.solveToolsAndControlsOptionsTiles(option)
510
+ .should('have.attr', 'data-aria-pressed', 'true');
511
+ },
512
+ /**
513
+ * Verifies if an option is not selected.
514
+ * @param {string} option - The option to verify.
515
+ */
516
+ verifyOptionIsNotSelected: (option) => {
517
+ thinkSpherePage.solveToolsAndControlsOptionsTiles(option)
518
+ .should('have.attr', 'data-aria-pressed', 'false');
519
+ },
520
+
521
+ /**
522
+ * Verifies the options contents.
523
+ * @param {number} index - The index of the option.
524
+ * @param {string} text - The text to verify.
525
+ * @param {string} placeholder - The placeholder text to verify.
526
+ */
527
+ verifyOptionsContents: (index, text, placeholder) => {
528
+ utilities.getNthElement(thinkSpherePage.optionWrapper(), index)
529
+ .within(() => {
530
+ utilities.getNthElement(thinkSpherePage.listInputField(), 0)
531
+ .should('have.attr', 'placeholder', placeholder);
532
+ utilities.getNthElement(thinkSpherePage.listInputField(), 0)
533
+ .should('have.value', text);
534
+ thinkSpherePage.dragHandleButton()
535
+ .should('exist');
536
+ thinkSpherePage.deleteButton()
537
+ .should('be.visible');
538
+ thinkSpherePage.optionNumeration()
539
+ .should('have.text', index + 1);
540
+ });
541
+ },
542
+
543
+ /**
544
+ * Deletes an option.
545
+ * @param {number} index - The index of the option to delete.
546
+ */
547
+ deleteOption: (index) => {
548
+ utilities.getNthElement(thinkSpherePage.deleteButton(), index)
549
+ .click();
550
+ },
551
+
552
+ /**
553
+ * Verifies the delete option button disabled state.
554
+ * @param {string} list - The list to verify ('strategy' or other).
555
+ */
556
+ verifyDeleteOptionButtonDisabledState: (list) => {
557
+ if (list === "strategy") {
558
+ utilities.getNthElement(thinkSpherePage.optionsSectionWrapper(), 0)
559
+ .within(() => {
560
+ thinkSpherePage.deleteButton()
561
+ .each(($element) => {
562
+ utilities.verifyElementDisabled(cy.wrap($element))
563
+ });
564
+ });
565
+ } else {
566
+ utilities.getNthElement(thinkSpherePage.optionsSectionWrapper(), 1)
567
+ .within(() => {
568
+ thinkSpherePage.deleteButton()
569
+ .each(($element) => {
570
+ utilities.verifyElementDisabled(cy.wrap($element))
571
+ });
572
+ });
573
+ }
574
+ },
575
+
576
+ /**
577
+ * Verifies the checkbox button disabled state.
578
+ * @param {string} list - The list to verify ('strategy' or other).
579
+ * @param {number} optionCount - The number of options to verify.
580
+ */
581
+ verifyCheckboxButtonDisabledState: (list, optionCount) => {
582
+ if (list === 'strategy') {
583
+ utilities.getNthElement(utilities.getNthElement(thinkSpherePage.planStrategyCheckbox().find('span'), 0), optionCount)
584
+ .should('have.attr', 'aria-disabled', 'true');
585
+ } else {
586
+ utilities.getNthElement(utilities.getNthElement(thinkSpherePage.planSentenceStarterCheckbox().find('span'), 0), optionCount)
587
+ .should('have.attr', 'aria-disabled', 'true');
588
+ }
589
+ },
590
+
591
+ /**
592
+ * Add the option in the list.
593
+ * @param {string} list - The list to verify ('strategy' or other).
594
+ */
595
+ addOption: (list) => {
596
+ if (list === 'strategy') {
597
+ thinkSpherePage.planStrategyAddItemButton()
598
+ .click();
599
+ } else {
600
+ thinkSpherePage.planSentenceStarterAddItemButton()
601
+ .click()
602
+ .trigger('mouseout', { force: true });
603
+ }
604
+ },
605
+
606
+ /**
607
+ * Selects an option.
608
+ * @param {string} list - The list to select from ('strategy' or other).
609
+ * @param {number} optionCount - The number of options to select.
610
+ */
611
+ selectOption: (list, optionCount) => {
612
+ if (list === 'strategy') {
613
+ utilities.getNthElement(thinkSpherePage.planStrategyCheckbox(), optionCount)
614
+ .click();
615
+ } else {
616
+ utilities.getNthElement(thinkSpherePage.planSentenceStarterCheckbox(), optionCount)
617
+ .click();
618
+ }
619
+ },
620
+
621
+ /**
622
+ * Adds text to an option.
623
+ * @param {string} list - The list to add text to ('strategy' or other).
624
+ * @param {number} optionCount - The number of options to add text to.
625
+ * @param {string} text - The text to add.
626
+ */
627
+ addOptionText: (list, optionCount, text) => {
628
+ if (list === 'strategy') {
629
+ thinkSpherePage.planStrategySection()
630
+ .within(() => {
631
+ utilities.getNthElement(thinkSpherePage.listInputField(), optionCount)
632
+ .clear()
633
+ .type(text, { delay: 500 });
634
+ });
635
+ } else {
636
+ thinkSpherePage.planSentenceStarterSection()
637
+ .within(() => {
638
+ utilities.getNthElement(thinkSpherePage.listInputField(), optionCount)
639
+ .clear()
640
+ .type(text, { delay: 500 });
641
+ });
642
+ }
643
+ },
644
+
645
+ /**
646
+ * Verifies the warning popup.
647
+ * @param {string} heading - The heading of the warning popup.
648
+ * @param {string} content - The content of the warning popup.
649
+ */
650
+ verifyWarningPopup: (heading, content) => {
651
+ utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'visible');
652
+ dialogBoxBase.dialogBoxTitle().within(() => {
653
+ utilities.verifyInnerText(thinkSpherePage.warningPopupTitle(), heading);
654
+ });
655
+ dialogBoxBase.dialogBoxContent().within(() => {
656
+ utilities.verifyInnerText(thinkSpherePage.warningPopupContentText(), content);
657
+ utilities.verifyInnerText(thinkSpherePage.warningPopupOkButton(), 'OK');
658
+ });
659
+ },
660
+
661
+ verifyCustomizeStampsComponent: () => {
662
+ utilities.verifyElementVisibilityState(thinkSpherePage.customizeStampComponent(), 'visible');
663
+ },
664
+
665
+ /**
666
+ * Verifies the default stamps.
667
+ * @param {Array<string>} defaultStamps - The default stamps to verify.
668
+ */
669
+ verifyDefaultStamps: (defaultStamps = []) => {
670
+ thinkSpherePage.customizeStampComponent()
671
+ .within(() => {
672
+ thinkSpherePage.customizeStampCard()
673
+ .should('have.length', defaultStamps.length);
674
+ defaultStamps.forEach((ele) => {
675
+ utilities.verifyElementVisibilityState(thinkSpherePage.customizeStampCard(ele, 'true'), 'visible');
676
+ });
677
+ });
678
+ },
679
+
680
+ /**
681
+ * Clicks on a customize card.
682
+ * @param {number} index - The index of the card to click.
683
+ * @param {string} ariaLabel - The aria-label of the card to click.
684
+ */
685
+ clickOnCustomizeCard: (index, ariaLabel) => {
686
+ if (ariaLabel) {
687
+ thinkSpherePage.customizeStampCard(ariaLabel)
688
+ .click();
689
+
690
+ } else {
691
+ utilities.getNthElement(thinkSpherePage.customizeStampCard(), index)
692
+ .click();
693
+ }
694
+ },
695
+
696
+ verifySelectAndUnselectStamps: () => {
697
+ thinkSpherePage.customizeStampComponent()
698
+ .within(() => {
699
+ thinkSpherePage.steps.clickOnCustomizeCard(0);
700
+ utilities.verifyElementVisibilityState(thinkSpherePage.customizeStampCard('Stamp 1', 'false'), 'visible');
701
+ thinkSpherePage.steps.clickOnCustomizeCard(0);
702
+ utilities.verifyElementVisibilityState(thinkSpherePage.customizeStampCard('Stamp 1', 'true'), 'visible');
703
+ });
704
+ },
705
+
706
+ clickOnStampsTool: () => {
707
+ thinkSpherePage.stampsToolButton()
708
+ .click();
709
+ },
710
+
711
+ verifyQuestionImageCustomStamp: () => {
712
+ let imgSrc = '';
713
+ thinkSpherePage.questionImage()
714
+ .invoke('attr', 'src') // Get the value of the 'src' attribute
715
+ .then((src) => {
716
+ imgSrc = src; // Store the value in the imgSrc variable
717
+ cy.log(imgSrc); // Optional: Log the value to the Cypress console
718
+ });
719
+ utilities.verifyCSS(
720
+ utilities.getNthElement(thinkSpherePage.customizeStampCard(), 0),
721
+ {
722
+ border: `1px solid ${css.color.secondaryBtnDisabled}`,
723
+ },
724
+ );
725
+ utilities.getNthElement(thinkSpherePage.customizeStampCard(), 0)
726
+ .within(() => {
727
+ thinkSpherePage.customizeStampCardImg()
728
+ .invoke('attr', 'src') // Get the value of the 'src' attribute
729
+ .then((src) => {
730
+ expect(src).to.equal(imgSrc);
731
+ });
732
+ });
733
+ },
734
+ createReviewQuestion: () => {
735
+ const questionType = 'single selection'
736
+ const options = ['Animal', 'Vehicle', 'Birds', 'Insects'];
737
+ thinkSpherePage.steps.clickOnCreateItemButton();
738
+ thinkSpherePage.steps.selectQuestionType(questionType);
739
+ singleSelectionPage.steps.addQuestionInstructions();
740
+ singleSelectionPage.steps.addInputToOptionsInputField(options);
741
+ singleSelectionPage.steps.allotPoints(20);
742
+ singleSelectionPage.steps.checkOptionInSpecifyCorrectAnswerSection(1);
743
+ thinkSpherePage.steps.clickOnSaveButton();
744
+ },
745
+
746
+ clickOnVideoLink: () => {
747
+ thinkSpherePage.videoLinkComponent()
748
+ .click();
749
+ },
750
+
751
+ verifyVideoPlaybackTimer: (elapsedTime, totalTime) => {
752
+ thinkSpherePage.playerTimer()
753
+ .should('have.text', `${elapsedTime}/${totalTime}`);
754
+ },
755
+
756
+ waitForPlaybackToBegin: () => {
757
+ thinkSpherePage.playerTimer()
758
+ .should('contain', '0:01/');
759
+ },
760
+
761
+ expandChooseStarterDropdown: () => {
762
+ thinkSpherePage.chooseStarterDropdown()
763
+ .click();
764
+ },
765
+
766
+ verifyOptionAlignmentIsSelected: (direction) => {
767
+ if(direction === 'topLeft') {
768
+ thinkSpherePage.whiteBoardCanvas()
769
+ .should('not.have.css', 'justify-content', 'start');
770
+ } else {
771
+ thinkSpherePage.whiteBoardCanvas()
772
+ .should('have.css', 'justify-content', (direction === 'center' || direction === 'flex-end') ? 'normal' : direction);
773
+ if (direction === 'center') {
774
+ thinkSpherePage.whiteBoardCanvas()
775
+ .should('have.css', 'align-items', 'normal');
776
+ }
777
+ }
778
+ },
779
+
780
+ clickOnImageRadioButton: () => {
781
+ thinkSpherePage.imageRadioButton()
782
+ .click();
783
+ },
784
+
785
+ clickOnEditQuestionIcon: () => {
786
+ utilities.getNthElement(thinkSpherePage.editQuestionPencil(), 0)
787
+ .click();
788
+ cy.wait(1000);
789
+ },
790
+
791
+ clickOnQuestionInstructionExpandImageButton: () => {
792
+ utilities.getNthElement(thinkSpherePage.questionInstructionPreviewImageExpandButton(), 0)
793
+ .click();
794
+ },
795
+
796
+ clickOnCloseExpandImagePopupButton: () => {
797
+ thinkSpherePage.dialogBoxRoot()
798
+ .within(() => {
799
+ thinkSpherePage.closeExpandImagePopupButton()
800
+ .click();
801
+ });
802
+ },
803
+
804
+ clickOnStrategiesPreviewListLI: () => {
805
+ utilities.getNthElement(thinkSpherePage.strategiesPreviewListLI(), 1)
806
+ .click();
807
+ },
808
+
809
+ clickOnVideoIcon: () => {
810
+ utilities.getNthElement(thinkSpherePage.videoIconWrapper(), 0)
811
+ .click();
812
+ },
813
+
814
+ closeVideoPopup: () => {
815
+ thinkSpherePage.dialogBoxRoot()
816
+ .within(() => {
817
+ thinkSpherePage.buttonClose()
818
+ .click();
819
+ });
820
+ },
821
+
822
+ hoverOnVolumeControlButton: () => {
823
+ thinkSpherePage.volumeControlButton()
824
+ .realHover({ position: 'bottom' });
825
+ },
826
+
827
+ verifyPlaybackElapsedTime: (time) => {
828
+ const playbackTimeElement = thinkSpherePage.playerTimer();
829
+ playbackTimeElement
830
+ .invoke('text')
831
+ .then((text) => {
832
+ let elapsedTime = text.split('/')[0];
833
+ let currentElapsedTimerMinutes = Number(elapsedTime.split(':')[0]);
834
+ let currentElapsedTimerSeconds = Number(elapsedTime.split(':')[1]);
835
+ let currentTotalElapsedTimerSeconds = currentElapsedTimerMinutes * 60 + currentElapsedTimerSeconds;
836
+ expect(currentTotalElapsedTimerSeconds).to.eq(time);
837
+ });
838
+ },
839
+
840
+ getToolbarOptionCount: (number) => {
841
+ return thinkSpherePage.gridItemsWrapper(number).find('button').its('length');
842
+ },
843
+
844
+ selectTools: (array, number) => {
845
+ thinkSpherePage.steps.getToolbarOptionCount(number).then((count) => {
846
+ thinkSpherePage.gridItemsWrapper(number).within(() => {
847
+ for (let i = 0; i < count; i++) {
848
+ thinkSpherePage.dragButton(i)
849
+ .invoke('attr', 'aria-label')
850
+ .then((attr) => {
851
+ if (attr.includes('not-selected')) {
852
+ const toolName = attr.split(' ').slice(0, -1).join(' ');
853
+ if (array.includes(toolName)) {
854
+ thinkSpherePage.dragButton(i)
855
+ .click();
856
+ }
857
+ } else {
858
+ const toolName = attr.split(' ').slice(0, -1).join(' ');
859
+ if (!array.includes(toolName)) {
860
+ thinkSpherePage.dragButton(i)
861
+ .click();
862
+ }
863
+ }
864
+ })
865
+ }
866
+ });
867
+ });
868
+ },
869
+
870
+ verifySelectTools: (array, number) => {
871
+ thinkSpherePage.steps.getToolbarOptionCount(number).then((count) => {
872
+ thinkSpherePage.gridItemsWrapper(number).within(() => {
873
+ for (let i = 0; i < count; i++) {
874
+ thinkSpherePage.dragButton(i)
875
+ .invoke('attr', 'aria-label')
876
+ .then((attr) => {
877
+ const toolName = attr.split(' ').slice(0, -1).join(' ');
878
+ if (array.includes(toolName)) {
879
+ thinkSpherePage.dragButton(i)
880
+ .invoke('attr', 'aria-label')
881
+ .should('contain', ' selected');
882
+ } else {
883
+ thinkSpherePage.dragButton(i)
884
+ .invoke('attr', 'aria-label')
885
+ .should('contain', ' not-selected');
886
+ }
887
+ })
888
+ }
889
+ });
890
+ });
891
+ },
892
+
893
+ verifyUploadedImage: () => {
894
+ thinkSpherePage.whiteBoardImage()
895
+ .should('exist')
896
+ .and('have.attr', 'src')
897
+ .and('not.be.empty');
898
+ },
899
+
900
+ visitThinksphereBrowseItemsPage: () => {
901
+ cy.visit('/item-engine/thinksphere/browse-items');
902
+ cy.interceptGraphql('getItems');
903
+ cy.wait('@getItems');
904
+ },
905
+
906
+ clickOnCustomizeStamp: (customizeStampPosition) => {
907
+ thinkSpherePage.customizeStampsButton(customizeStampPosition)
908
+ .click();
909
+ cy.wait(1000);
910
+ },
911
+
912
+ verifyCustomizeStampSelectedUnselected: (selected, customizeStampPosition) => {
913
+ utilities.verifyElementAttribute(thinkSpherePage.customizeStampsButton(customizeStampPosition), 'aria-checked', selected ? 'true' : 'false');
914
+ },
915
+
916
+ saveCustomCategory: () => {
917
+ thinkSpherePage.buttonSave()
918
+ .click();
919
+ },
920
+
921
+ cancelCustomCategory: () => {
922
+ thinkSpherePage.buttonCancel()
923
+ .click();
924
+ },
925
+
926
+ createCustomCategoryWithMultipleCategoryCharacters: () => {
927
+ cy.log('Creating a custom category by selecting \'Keypad\' category, partially selecting \'Basic\' and \'Greek\' categories')
928
+ createCustomCategoryFlyout.steps.openCreateCustomCategoryFlyout();
929
+ createCustomCategoryFlyout.steps.checkCategoryAccordionCheckbox(`${equationEditorCategoriesAndSymbols['primary'].displayName}`);
930
+ cy.wait(2000);
931
+ createCustomCategoryFlyout.steps.verifyPartiallyCheckedStateOfCategoryAccordionCheckbox(`${equationEditorCategoriesAndSymbols['matrices'].displayName}`);
932
+ createCustomCategoryFlyout.steps.expandCategoryAccordion(`Greek Symbols`);
933
+ createCustomCategoryFlyout.steps.selectASymbolInCreateCustomCategoryFlyout(`${equationEditorCategoriesAndSymbols['greek'].displayName}`, `${equationEditorCategoriesAndSymbols.greek.symbols.gamma.ariaLabel}`);
934
+ createCustomCategoryFlyout.steps.selectASymbolInCreateCustomCategoryFlyout(`${equationEditorCategoriesAndSymbols['greek'].displayName}`, `${equationEditorCategoriesAndSymbols.greek.symbols.delta.ariaLabel}`);
935
+ createCustomCategoryFlyout.steps.addInputToCustomCategoryNameInputField('Custom category with name.');
936
+ thinkSpherePage.steps.saveCustomCategory();
937
+ utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'notExist');
938
+ },
939
+
940
+ createCustomCategoryWithNameAndIcon: () => {
941
+ cy.log('Creating a category by selecting \'Arrows\' category')
942
+ createCustomCategoryFlyout.steps.openCreateCustomCategoryFlyout();
943
+ createCustomCategoryFlyout.steps.checkCategoryAccordionCheckbox(`${equationEditorCategoriesAndSymbols['geo'].displayName}`);
944
+ createCustomCategoryFlyout.steps.addInputToCustomCategoryNameInputField('Custom category with name and icon.');
945
+ createCustomCategoryFlyout.steps.addInputToCategoryIconInputField('#');
946
+ thinkSpherePage.steps.saveCustomCategory();
947
+ },
948
+
949
+ verifyCategoryCharactersAndUnSelectedState: (arrayOfSymbolsAriaLabel) => {
950
+ thinkSpherePage.categoryCharacters()
951
+ .then(($symbols) => {
952
+ for (let index = 10; index < $symbols.length - 1; index++) {
953
+ editCategoryFlyout.categoryCharacters()
954
+ .eq(index)
955
+ .should('not.have.class', 'Mui-selected')
956
+ .invoke('attr', 'aria-label')
957
+ .then((ariaLabel) => {
958
+ const tooltipText = ariaLabel.split(' ').slice(0, -1).join(' ');
959
+ editCategoryFlyout.categoryCharacters()
960
+ .eq(index)
961
+ .verifyTooltip(tooltipText);
962
+ });
963
+ }
964
+ });
965
+ },
966
+
967
+ verifyCategoryCharactersAndSelectedState: (arrayOfSymbolsAriaLabel) => {
968
+ editCategoryFlyout.categoryCharacters()
969
+ .then(($symbols) => {
970
+ for (let index = 0; index < arrayOfSymbolsAriaLabel.length - 1; index++) {
971
+ editCategoryFlyout.categoryCharacters()
972
+ .eq(index)
973
+ .should('have.class', 'Mui-selected')
974
+ .invoke('attr', 'aria-label')
975
+ .then((ariaLabel) => {
976
+ const tooltipText = ariaLabel.split(' ').slice(0, -1).join(' ');
977
+ editCategoryFlyout.categoryCharacters()
978
+ .eq(index)
979
+ .verifyTooltip(tooltipText);
980
+ });
981
+ }
982
+ });
983
+ },
984
+
985
+ expandDropdown: () => {
986
+ thinkSpherePage.categoriesDropDownParent()
987
+ .click();
988
+ },
989
+
990
+ verifyDropdownOptions: (dropDownListArray) => {
991
+ thinkSpherePage.categoriesDropDownMenuItem().should('have.length', dropDownListArray.length).each(($item) => {
992
+ cy.wrap($item)
993
+ .invoke('text')
994
+ .then((text) => {
995
+ const trimmedText = text.trim();
996
+ expect(dropDownListArray).to.include(trimmedText);
997
+ });
998
+ });
999
+ },
1000
+
1001
+ clickOnDropDownCategory: (index) => {
1002
+ thinkSpherePage.categoriesDropDownMenuItem().eq(index).click();
1003
+ },
1004
+
1005
+ clickOnQuestionTypesAccordion: () => {
1006
+ thinkSpherePage.filterSectionQuestionTypesAccordion()
1007
+ .click()
1008
+ },
1009
+
1010
+ typeInSearchBar: (input) => {
1011
+ thinkSpherePage.searchBar()
1012
+ .clear()
1013
+ .type(input)
1014
+ .should('have.value', input);
1015
+ },
1016
+
1017
+ searchInSearchBar: (input) => {
1018
+ thinkSpherePage.searchBar()
1019
+ .clear()
1020
+ .type(input)
1021
+ .should('have.value', input)
1022
+ .type('{enter}');
1023
+ },
1024
+
1025
+ clickOnSolvePhaseAccordionIcon: (element) => {
1026
+ thinkSpherePage.solvePhaseAccordionExpandIcon()
1027
+ .click();
1028
+ },
1029
+
1030
+ verifyElementDoesNotHaveExpandedClass: (element) => {
1031
+ element.should('not.have.class', 'Mui-expanded');
1032
+ },
1033
+
1034
+ verifyElementDoesNotHaveCheckedClass: (element) => {
1035
+ element.should('not.have.class', 'Mui-checked');
1036
+ },
1037
+
1038
+ verifyThinkSphereSearchBarPlaceholder: () => {
1039
+ thinkSpherePage.searchBar().should('have.attr', 'placeholder', 'Search by title, tags and content');
1040
+ },
1041
+
1042
+ verifyReviewItemSearchBarPlaceholder: () => {
1043
+ thinkSpherePage.searchBar().should('have.attr', 'placeholder', 'Search by question type');
1044
+ },
1045
+
1046
+ verifyEquationEditorSectionCategoryNotPressed: () => {
1047
+ thinkSpherePage.equationEditorSectionCategories().eq(1).should('have.attr', 'data-aria-pressed', 'false');
1048
+ },
1049
+
1050
+ verifyEquationEditorSectionCategoryIsPressed: () => {
1051
+ thinkSpherePage.equationEditorSectionCategories().eq(10).should('have.attr', 'data-aria-pressed', 'true');
1052
+ },
1053
+
1054
+ verifyTypeCheckBoxStrategy: () => {
1055
+ utilities.getNthElement(thinkSpherePage.planStrategyCheckbox(), 5)
1056
+ .find('input').should('have.attr', 'type', 'checkbox');
1057
+ },
1058
+
1059
+ verifyTypeCheckBoxSentenceStarter: () => {
1060
+ utilities.getNthElement(thinkSpherePage.planSentenceStarterCheckbox(), 5)
1061
+ .find('input').should('have.attr', 'type', 'checkbox');
1062
+ },
1063
+
1064
+ verifyStrategyCheckBoxNotChecked: () => {
1065
+ utilities.getNthElement(thinkSpherePage.planStrategyCheckbox(), 5)
1066
+ .find('input').should('not.have.attr', 'checked');
1067
+ },
1068
+
1069
+ verifySentenceStrategyCheckBoxNotChecked: () => {
1070
+ utilities.getNthElement(thinkSpherePage.planSentenceStarterCheckbox(), 5)
1071
+ .find('input').should('not.have.attr', 'checked');
1072
+ },
1073
+
1074
+ verifyTextIsNotEmpty: (element) => {
1075
+ element.invoke('text')
1076
+ .should('not.be.empty');
1077
+ },
1078
+
1079
+ verifyLength: (element, length) => {
1080
+ element.should('have.length', length);
1081
+ },
1082
+
1083
+ verifyFilterSectionExpanded: () => {
1084
+ thinkSpherePage.filterSectionQuestionTypesAccordion().should('have.class', 'Mui-expanded');
1085
+ },
1086
+
1087
+ verifyFilterSectionCollapsed: () => {
1088
+ thinkSpherePage.filterSectionQuestionTypesAccordion().should('not.have.class', 'Mui-expanded');
1089
+ },
1090
+
1091
+ verifySolvePhaseAccordionExpanded: () => {
1092
+ thinkSpherePage.solvePhaseAccordionExpandIcon().should('have.class', 'Mui-expanded');
1093
+ },
1094
+
1095
+ verifySolvePhaseAccordionCollapsed: () => {
1096
+ thinkSpherePage.solvePhaseAccordionExpandIcon().should('not.have.class', 'Mui-expanded');
1097
+ },
1098
+
1099
+ addQuestionInstructionInnerHTML: (innerHTML) => {
1100
+ thinkSpherePage.thinkSphereQuestionInstructionCKEditor()
1101
+ .invoke('html', innerHTML);
1102
+ },
1103
+
1104
+ verifyQuestionInstructionIncreasedHeightAndScrollBar: () => {
1105
+ thinkSpherePage.thinkSphereQuestionInstructionCKEditor()
1106
+ .invoke('height') // Get the height of the element
1107
+ .should('be.gt', 198);
1108
+
1109
+ thinkSpherePage.thinkSphereQuestionInstructionCKEditor()
1110
+ .should(($el) => {
1111
+ const scrollWidth = $el[0].scrollWidth;
1112
+ const clientWidth = $el[0].clientWidth;
1113
+
1114
+ // Assert that horizontal scroll is present
1115
+ expect(scrollWidth).to.be.greaterThan(clientWidth);
1116
+ });
1117
+ },
1118
+
1119
+ verifyQuestionImagePopup: () => {
1120
+ thinkSpherePage.dialogBoxRoot()
1121
+ .within(() => {
1122
+ utilities.verifyElementVisibilityState(thinkSpherePage.questionInstructionImagePopup(), 'visible');
1123
+ utilities.verifyElementVisibilityState(thinkSpherePage.closeExpandImagePopupButton(), 'visible');
1124
+ });
1125
+ },
1126
+
1127
+ verifyAddNewStrategyPopupCloseFunctionality: () => {
1128
+ let countBeforeOpeningPopup, countAfterClosingPopup;
1129
+ cy.get(thinkSpherePage.strategiesBoxPreviewTab())
1130
+ .its('length')
1131
+ .then((count) => {
1132
+ countBeforeOpeningPopup = count;
1133
+ cy.log('Count before opening popup:', countBeforeOpeningPopup);
1134
+ });
1135
+ thinkSpherePage.addNewStrategyButton().click();
1136
+ thinkSpherePage.addStrategyPopupCancelButton().click();
1137
+ cy.get(thinkSpherePage.strategiesBoxPreviewTab())
1138
+ .its('length')
1139
+ .then((count) => {
1140
+ countAfterClosingPopup = count;
1141
+ cy.log('Count after closing popup:', countAfterClosingPopup);
1142
+ expect(countAfterClosingPopup).to.equal(countBeforeOpeningPopup);
1143
+ });
1144
+ },
1145
+
1146
+ verifyAddNewStrategyPopupSaveFunctionality: () => {
1147
+ let countBeforeOpeningPopup, countAfterClosingPopup;
1148
+ thinkSpherePage.strategiesBoxPreviewTab()
1149
+ .its('length')
1150
+ .then((count) => {
1151
+ countBeforeOpeningPopup = count;
1152
+ cy.log('Count before opening popup:', countBeforeOpeningPopup);
1153
+ });
1154
+ thinkSpherePage.addNewStrategyButton().click();
1155
+ thinkSpherePage.strategyNameInputField().type('Test Strategy');
1156
+ thinkSpherePage.addStrategyPopupSaveButton().click();
1157
+ thinkSpherePage.strategiesBoxPreviewTab()
1158
+ .its('length')
1159
+ .then((count) => {
1160
+ countAfterClosingPopup = count;
1161
+ cy.log('Count after closing popup:', countAfterClosingPopup);
1162
+ expect(countAfterClosingPopup).to.equal(countBeforeOpeningPopup + 1);
1163
+ });
1164
+ },
1165
+
1166
+ verifyVideoPopupDialogBox: () => {
1167
+ thinkSpherePage.dialogBoxRoot()
1168
+ .within(() => {
1169
+ utilities.verifyElementVisibilityState(thinkSpherePage.dialogBoxTitle(), 'visible');
1170
+ utilities.verifyInnerText(thinkSpherePage.dialogBoxTitle(), 'Create_a_model');
1171
+ utilities.verifyElementVisibilityState(thinkSpherePage.buttonClose(), 'visible');
1172
+ });
1173
+ },
1174
+
1175
+ verifySentenceStartersDropdown: () => {
1176
+ thinkSpherePage.chooseStarterTextIconWrapper()
1177
+ .within(() => {
1178
+ utilities.verifyElementVisibilityState(thinkSpherePage.starterIocn(), 'visible');
1179
+ utilities.verifyInnerText(thinkSpherePage.starterTextWrapper(), 'Starters');
1180
+ });
1181
+ thinkSpherePage.chooseStarterDropdown()
1182
+ .verifyPseudoClassBeforeProperty('content', '""');
1183
+ },
1184
+
1185
+ verifySentenceStartersDropdownOptions: (sentenceStartersTextDefault) => {
1186
+ sentenceStartersTextDefault.forEach((label, index) => {
1187
+ utilities.verifyInnerText(utilities.getNthElement(thinkSpherePage.chooseStartersListOptionLabels(), index), label);
1188
+ });
1189
+ },
1190
+
1191
+ verifySentenceStartersDropdownFunctionality: () => {
1192
+ thinkSpherePage.writePlanWrapper()
1193
+ .within(() => {
1194
+ thinkSpherePage.contentEditableDiv().clear();
1195
+ });
1196
+ thinkSpherePage.steps.expandChooseStarterDropdown();
1197
+ utilities.getNthElement(thinkSpherePage.chooseStartersListOptions(), 1).click();
1198
+ thinkSpherePage.writePlanWrapper()
1199
+ .within(() => {
1200
+ thinkSpherePage.contentEditableDiv().should('have.value', 'First, I will ');
1201
+ thinkSpherePage.contentEditableDiv().clear();
1202
+ });
1203
+ },
1204
+
1205
+ verifyProblemAskingHeading: () => {
1206
+ thinkSpherePage.problemAskingWrapper()
1207
+ .within(() => {
1208
+ utilities.verifyInnerText(thinkSpherePage.subheadingWrapper(), 'The problem is asking me to');
1209
+ utilities.verifyElementVisibilityState(thinkSpherePage.subheadingWrapper(), 'visible');
1210
+ });
1211
+ },
1212
+
1213
+ verifyProblemAskingTextArea: () => {
1214
+ thinkSpherePage.problemAskingWrapper()
1215
+ .within(() => {
1216
+ utilities.verifyElementVisibilityState(thinkSpherePage.contentEditableDiv(), 'visible');
1217
+ utilities.verifyElementAttribute(thinkSpherePage.contentEditableDiv(), 'placeholder', 'Enter your text here');
1218
+ });
1219
+ },
1220
+
1221
+ verifyProblemAskingMicSection: () => {
1222
+ thinkSpherePage.problemAskingWrapper()
1223
+ .within(() => {
1224
+ utilities.verifyElementVisibilityState(thinkSpherePage.micIconWrapper(), 'visible');
1225
+ utilities.verifyElementAttribute(thinkSpherePage.micIconWrapper(), 'role', 'button');
1226
+ utilities.verifyElementAttribute(thinkSpherePage.micIconWrapper(), 'aria-label', 'Mic button');
1227
+ });
1228
+ },
1229
+
1230
+ verifyProblemAskingTextAreaFunctionality: (textToEnter) => {
1231
+ thinkSpherePage.problemAskingWrapper()
1232
+ .within(() => {
1233
+ thinkSpherePage.contentEditableDiv().type(textToEnter);
1234
+ thinkSpherePage.contentEditableDiv().should('have.value', textToEnter);
1235
+ });
1236
+ },
1237
+
1238
+ verifyStrategiesToPlanHeading: () => {
1239
+ thinkSpherePage.strategiesToPlanWrapper()
1240
+ .within(() => {
1241
+ utilities.verifyInnerText(thinkSpherePage.subheadingWrapper(), 'Add strategies to plan');
1242
+ utilities.verifyElementVisibilityState(thinkSpherePage.subheadingWrapper(), 'visible');
1243
+ });
1244
+ },
1245
+
1246
+ verifyWritePlanHeading: () => {
1247
+ thinkSpherePage.writePlanWrapper()
1248
+ .within(() => {
1249
+ utilities.verifyInnerText(thinkSpherePage.subheadingWrapper(), 'Write your plan');
1250
+ utilities.verifyElementVisibilityState(thinkSpherePage.subheadingWrapper(), 'visible');
1251
+ });
1252
+ },
1253
+
1254
+ verifyWritePlanTextArea: () => {
1255
+ thinkSpherePage.writePlanWrapper()
1256
+ .within(() => {
1257
+ utilities.verifyElementVisibilityState(thinkSpherePage.contentEditableDiv(), 'visible');
1258
+ utilities.verifyElementAttribute(thinkSpherePage.contentEditableDiv(), 'placeholder', 'Enter your plan here');
1259
+ });
1260
+ },
1261
+
1262
+ verifyWritePlanMicSection: () => {
1263
+ thinkSpherePage.writePlanWrapper()
1264
+ .within(() => {
1265
+ utilities.verifyElementVisibilityState(thinkSpherePage.micIconWrapper(), 'visible');
1266
+ utilities.verifyElementAttribute(thinkSpherePage.micIconWrapper(), 'role', 'button');
1267
+ utilities.verifyElementAttribute(thinkSpherePage.micIconWrapper(), 'aria-label', 'Mic button');
1268
+ });
1269
+ },
1270
+
1271
+ verifyWritePlanTextAreaFunctionality: (planTextToEnter) => {
1272
+ thinkSpherePage.writePlanWrapper()
1273
+ .within(() => {
1274
+ thinkSpherePage.contentEditableDiv().type(planTextToEnter);
1275
+ thinkSpherePage.contentEditableDiv().should('have.value', planTextToEnter);
1276
+ thinkSpherePage.contentEditableDiv().clear();
1277
+ });
1278
+ },
1279
+
1280
+ verifyStrategyChipClickFunctionality: () => {
1281
+ thinkSpherePage.writePlanWrapper()
1282
+ .within(() => {
1283
+ thinkSpherePage.contentEditableDiv().clear();
1284
+ });
1285
+ thinkSpherePage.strategyChip().click();
1286
+ thinkSpherePage.writePlanWrapper()
1287
+ .within(() => {
1288
+ thinkSpherePage.contentEditableDiv().should('have.value', 'look for a pattern ');
1289
+ });
1290
+ },
1291
+ clickUploadVideoButton: () => {
1292
+ thinkSpherePage.uploadVideoLinkButton()
1293
+ .click();
1294
+ },
1295
+
1296
+ verifyPreAuthoredVideoTitles: (defaultStrategyTexts) => {
1297
+ defaultStrategyTexts.forEach((text,index) => {
1298
+ thinkSpherePage.videoLinkComponent(index)
1299
+ .within(() => {
1300
+ utilities.verifyInnerText(thinkSpherePage.uploadVideoLinkButton(), text);
1301
+ })
1302
+ });
1303
+ },
1304
+
1305
+ verifyPreAuthoredVideos: (preAuthoredVideos) => {
1306
+ preAuthoredVideos.forEach(({duration}, optionIndex) => {
1307
+ thinkSpherePage.videoLinkComponent(optionIndex)
1308
+ .within(thinkSpherePage.steps.clickUploadVideoButton);
1309
+ thinkSpherePage.steps.startPlayback();
1310
+ thinkSpherePage.steps.waitForPlaybackToBegin();
1311
+ thinkSpherePage.playerTimer()
1312
+ .should('contain', `/${duration}`);
1313
+ thinkSpherePage.steps.closeVideoPopup();
1314
+ })
1315
+ },
1316
+
1317
+ clickOnReviewTab: () => {
1318
+ thinkSpherePage.reviewTab()
1319
+ .click();
1320
+ },
1321
+
1322
+ clickOnPlanTab: () => {
1323
+ thinkSpherePage.planTab()
1324
+ .click();
1325
+ },
1326
+
1327
+ switchToGradingView: () => {
1328
+ thinkSpherePage.gradingViewRadioButton()
1329
+ .click();
1330
+ },
1331
+
1332
+ switchToStudentView: () => {
1333
+ thinkSpherePage.studentViewRadioButton()
1334
+ .click();
1335
+ },
1336
+
1337
+ verifyCorrectAnswerLabel: () => {
1338
+ utilities.verifyElementVisibilityState(thinkSpherePage.correctAnswerLabelWrapper(), 'visible');
1339
+ },
1340
+
1341
+ addImageAlternativeTextInputFieldText: (alternateTextForImage) => {
1342
+ thinkSpherePage.imageAlternativeTextInputField().type(alternateTextForImage);
1343
+ cy.wait(2000);
1344
+ },
1345
+
1346
+ verifyQuestionInstructionPreviewTexWrapperVisibility: (instructionText) => {
1347
+ utilities.verifyElementVisibilityState(thinkSpherePage.questionInstructionPreviewTexWrapper(), 'visible');
1348
+ utilities.verifyInnerText(thinkSpherePage.questionInstructionPreviewTexWrapper(), instructionText);
1349
+ },
1350
+
1351
+ verifyQuestionInstructionPreviewImageWrapperVisibility: () => {
1352
+ utilities.verifyElementVisibilityState(thinkSpherePage.questionInstructionPreviewImageWrapper(), 'visible');
1353
+ utilities.verifyElementVisibilityState(thinkSpherePage.questionInstructionPreviewImageExpandButton(), 'visible');
1354
+ },
1355
+ };
1356
+
1357
+ const tests = {
1358
+ ...essayResponsePage.tests,
1359
+ ...createQuestionBasePage.tests,
1360
+ ...backgroundImageUploadComponent.tests,
1361
+ ...questionInstructionsComponent.tests,
1362
+ ...commonComponents.tests,
1363
+ ...scoringSectionBaseEditTab.tests,
1364
+ ...additionalSettingsPanel.tests,
1365
+ ...additionalSettingsAccessibilitySectionComponent.tests,
1366
+ ...toolSettingsComponent.tests,
1367
+ ...studentViewSettingsLabelComponent.tests,
1368
+ ...defaultToolDropdown.tests,
1369
+ ...optionsWrapperComponent.tests,
1370
+ ...equationEditorFlyout.tests,
1371
+
1372
+ /**
1373
+ * Verifies the ThinkSphere cancel button functionality.
1374
+ * @param {string} questionType - The type of question.
1375
+ */
1376
+ verifyThinkSphereCancelButton: (questionType) => {
1377
+ it('When user has made no edits and clicks on cancel button, the user should be directed back to the \'Select a Question\' page', () => {
1378
+ createQuestionBasePage.cancelButton()
1379
+ .click();
1380
+ });
1381
+
1382
+ it('When user has made some edits/changes and clicks on cancel button, a popup should be displayed with message \'Are you sure you want to leave this page? Your changes have not been saved.\'', () => {
1383
+ thinkSpherePage.steps.navigateToThinkSphereCreateQuestion();
1384
+ questionInstructionsComponent.steps.addTextInQuestionInstructionsInputField('Edited');
1385
+ if (questionType !== 'feedback scale' && questionType !== 'highlight image' && questionType !== 'think sphere') {
1386
+ scoringSectionBaseEditTab.steps.allotPoints(20);
1387
+ };
1388
+ createQuestionBasePage.cancelButton()
1389
+ .click();
1390
+ utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'visible');
1391
+ utilities.verifyInnerText(dialogBoxBase.dialogBoxContentText(), 'Are you sure you want to leave this page? Your changes have not been saved.');
1392
+ utilities.verifyInnerText(dialogBoxBase.buttonAccept(), 'Yes, I want to leave this page');
1393
+ utilities.verifyInnerText(dialogBoxBase.buttonReject(), 'No, I\'d like to go back');
1394
+ });
1395
+
1396
+ it('CSS of popup', { tags: 'css' }, () => {
1397
+ utilities.verifyCSS(dialogBoxBase.dialogBox(), {
1398
+ 'background-color': css.color.defaultBackground
1399
+ })
1400
+
1401
+ utilities.verifyCSS(dialogBoxBase.dialogBoxContent(), {
1402
+ 'color': css.color.sectionHeading,
1403
+ 'font-size': css.fontSize.default,
1404
+ 'font-weight': css.fontWeight.regular
1405
+ });
1406
+ utilities.verifyCSS(dialogBoxBase.buttonAccept(), {
1407
+ 'color': css.color.primaryBtn,
1408
+ 'font-size': css.fontSize.default,
1409
+ 'font-weight': css.fontWeight.semibold,
1410
+ 'background-color': css.color.primaryBtnBg
1411
+ });
1412
+ utilities.verifyCSS(dialogBoxBase.buttonReject(), {
1413
+ 'color': css.color.secondaryBtn,
1414
+ 'font-size': css.fontSize.default,
1415
+ 'font-weight': css.fontWeight.semibold,
1416
+ 'background-color': css.color.transparent
1417
+ });
1418
+ });
1419
+
1420
+ it('Accessibility of popup', { tags: 'a11y' }, () => {
1421
+ cy.checkAccessibility(dialogBoxBase.dialogBox());
1422
+ });
1423
+
1424
+ it(`Clicking on \'No, I'd like to go back\' button should close the popup and user should remain on the edit interface of the question`, () => {
1425
+ dialogBoxBase.buttonReject()
1426
+ .click();
1427
+ createQuestionBasePage.editTab()
1428
+ .should('have.attr', 'aria-selected', 'true');
1429
+ utilities.verifyTextContent(questionInstructionsComponent.questionInstructionsInputField(), 'Edited');
1430
+ });
1431
+
1432
+ it(`Clicking on \'Yes, I want to leave this page\' button should should discard all changes and direct the user to the \'Select a question\' page.`, () => {
1433
+ createQuestionBasePage.cancelButton()
1434
+ .click();
1435
+ dialogBoxBase.buttonAccept()
1436
+ .click();
1437
+ });
1438
+ },
1439
+
1440
+ /**
1441
+ * Verifies the disabled delete button tooltip.
1442
+ * @param {number} NthElement - The index of the delete button.
1443
+ * @param {string} disableTooltipText - The tooltip text to verify.
1444
+ */
1445
+ verifyDisabledDeleteButtonTooltip: (NthElement, disableTooltipText) => {
1446
+ it('When the user hovers over the disabled delete buttons of the options then \'Minimum one option is required\' message should be displayed on a tooltip and the tooltip should disappear if focus is removed from the delete button', () => {
1447
+ utilities.getNthElement(thinkSpherePage.deleteButton(), NthElement)
1448
+ .trigger('mouseover', { force: true });
1449
+ utilities.verifyInnerText(thinkSpherePage.tooltipText(), disableTooltipText);
1450
+ utilities.getNthElement(thinkSpherePage.deleteButton(), NthElement)
1451
+ .trigger('mouseout', { force: true });
1452
+ utilities.verifyElementVisibilityState(thinkSpherePage.tooltipText(), 'notExist');
1453
+ });
1454
+
1455
+ it('CSS of disabled delete button tooltip', { tags: 'css' }, () => {
1456
+ utilities.getNthElement(thinkSpherePage.deleteButton(), NthElement)
1457
+ .trigger('mouseover', { force: true });
1458
+ utilities.verifyElementVisibilityState(thinkSpherePage.tooltipText(), 'visible')
1459
+ utilities.verifyCSS(thinkSpherePage.tooltipText(), {
1460
+ 'color': css.color.whiteText,
1461
+ 'font-size': css.fontSize.small,
1462
+ 'font-weight': css.fontWeight.regular
1463
+ });
1464
+ utilities.getNthElement(thinkSpherePage.deleteButton(), NthElement)
1465
+ .trigger('mouseout', { force: true });
1466
+ utilities.verifyElementVisibilityState(thinkSpherePage.tooltipText(), 'notExist');
1467
+ });
1468
+ },
1469
+
1470
+ /**
1471
+ * Verifies the add option functionality.
1472
+ * @param {string} list - The list to add the option to ('strategy' or other).
1473
+ * @param {Array<string>} optionList - The list of options.
1474
+ */
1475
+ verifyAddOptionFunctionality: (list, optionList) => {
1476
+ it('When user adds an option using \'Add Option\' button then the added option input field should be displayed and option numeration should increment', () => {
1477
+ let initialOptionCount;
1478
+ if (list === 'strategy') {
1479
+ thinkSpherePage.planStrategySection()
1480
+ .within(() => {
1481
+ thinkSpherePage.steps.getOptionCount().then((count) => {
1482
+ initialOptionCount = count;
1483
+ });
1484
+ });
1485
+
1486
+ thinkSpherePage.steps.addOption(list);
1487
+ thinkSpherePage.planStrategySection()
1488
+ .within(() => {
1489
+ thinkSpherePage.steps.getOptionCount().should('eq', initialOptionCount + 1);
1490
+ thinkSpherePage.steps.verifyOptionsContents(initialOptionCount, '', 'Enter strategy name');
1491
+ });
1492
+ thinkSpherePage.steps.deleteOption(5);
1493
+ } else {
1494
+ thinkSpherePage.planSentenceStarterSection()
1495
+ .within(() => {
1496
+ thinkSpherePage.steps.getOptionCount().then((count) => {
1497
+ initialOptionCount = count;
1498
+ });
1499
+ });
1500
+
1501
+ thinkSpherePage.steps.addOption(list);
1502
+ thinkSpherePage.planSentenceStarterSection()
1503
+ .within(() => {
1504
+ thinkSpherePage.steps.getOptionCount().should('eq', initialOptionCount + 1);
1505
+ thinkSpherePage.steps.verifyOptionsContents(initialOptionCount, '', 'Enter sentence starter name');
1506
+ });
1507
+ thinkSpherePage.steps.deleteOption(10);
1508
+ }
1509
+ });
1510
+ },
1511
+
1512
+ /**
1513
+ * Verifies the contents and styling of the 'Options' section.
1514
+ * @param {Object} params - The parameters for the function.
1515
+ * @param {number} params.optionFieldsCount - The expected number of option input fields.
1516
+ * @param {Array<string>} params.optionList - The list of options.
1517
+ * @param {string} params.placeholder - The placeholder text.
1518
+ * @param {string} params.list - The list to verify ('strategy' or other).
1519
+ */
1520
+ verifyListSectionContents: ({
1521
+ optionFieldsCount,
1522
+ optionList,
1523
+ placeholder,
1524
+ list,
1525
+ }) => {
1526
+ it(`By default ${optionFieldsCount} option input fields with placeholder text, drag handle and delete option icon buttons should be displayed`, () => {
1527
+ for (let index = 0; index < optionFieldsCount; index++) {
1528
+ if (list === 'strategy') {
1529
+ thinkSpherePage.planStrategySection()
1530
+ .within(() => {
1531
+ cy.log(optionList, optionList[index])
1532
+ thinkSpherePage.steps.verifyOptionsContents(index, optionList[index], placeholder);
1533
+ })
1534
+ } else {
1535
+ thinkSpherePage.planSentenceStarterSection()
1536
+ .within(() => {
1537
+ cy.log(optionList, optionList[index])
1538
+ thinkSpherePage.steps.verifyOptionsContents(index, optionList[index], placeholder);
1539
+ })
1540
+ }
1541
+ };
1542
+ });
1543
+
1544
+ it('\'Add Option\' button should be present', () => {
1545
+ if (list === 'strategy') {
1546
+ utilities.verifyInnerText(thinkSpherePage.planStrategyAddItemButton().find('p'), 'Add strategy');
1547
+ utilities.verifyElementVisibilityState(thinkSpherePage.planStrategyAddItemButton(), 'visible');
1548
+ } else {
1549
+ utilities.verifyInnerText(thinkSpherePage.planSentenceStarterAddItemButton().find('p'), 'Add sentence starter');
1550
+ utilities.verifyElementVisibilityState(thinkSpherePage.planSentenceStarterAddItemButton(), 'visible');
1551
+ }
1552
+ });
1553
+
1554
+ it('CSS of Options section', { tags: 'css' }, () => {
1555
+ const withinComponent = (list === 'strategy') ? thinkSpherePage.planStrategySection() : thinkSpherePage.planSentenceStarterSection();
1556
+
1557
+ withinComponent.within(() => {
1558
+ utilities.verifyCSS(thinkSpherePage.dragHandleButton().find('path'), {
1559
+ 'fill': css.color.secondaryBtnActive
1560
+ });
1561
+ thinkSpherePage.deleteButton()
1562
+ .verifyPseudoClassBeforeProperty('color', css.color.deleteIcon);
1563
+ utilities.verifyCSS(utilities.getNthElement(thinkSpherePage.listInputField(), 0), {
1564
+ 'color': css.color.text,
1565
+ 'font-size': css.fontSize.default,
1566
+ 'font-weight': css.fontWeight.regular
1567
+ });
1568
+ });
1569
+
1570
+ if (list === 'strategy') {
1571
+ utilities.verifyCSS(thinkSpherePage.planStrategyAddItemButton().find('p'), {
1572
+ 'color': css.color.secondaryBtnActive,
1573
+ 'font-size': css.fontSize.default,
1574
+ 'font-weight': css.fontWeight.regular
1575
+ });
1576
+ } else {
1577
+ utilities.verifyCSS(thinkSpherePage.planSentenceStarterAddItemButton().find('p'), {
1578
+ 'color': css.color.secondaryBtnActive,
1579
+ 'font-size': css.fontSize.default,
1580
+ 'font-weight': css.fontWeight.regular
1581
+ });
1582
+ }
1583
+ });
1584
+ },
1585
+
1586
+ /**
1587
+ * Verifies the drag handle tooltip.
1588
+ * @param {number} NthElement - The index of the drag handle.
1589
+ */
1590
+ verifyDragHandleTooltip: (NthElement) => {
1591
+ it('On hovering over the drag handle of the options, \'Drag to reorder\' message should be displayed on a tooltip and the tooltip should disappear if focus is removed from the drag handle', () => {
1592
+ utilities.triggerMouseover(utilities.getNthElement(thinkSpherePage.dragHandleButton(), NthElement));
1593
+ utilities.verifyInnerText(thinkSpherePage.tooltipText(), 'Drag to reorder');
1594
+ utilities.triggerMouseout(utilities.getNthElement(thinkSpherePage.dragHandleButton(), NthElement));
1595
+ utilities.verifyElementVisibilityState(thinkSpherePage.tooltipText(), 'notExist');
1596
+ });
1597
+
1598
+ it('CSS of drag handle tooltip', { tags: 'css' }, () => {
1599
+ utilities.getNthElement(thinkSpherePage.optionWrapper(), NthElement)
1600
+ .within(() => {
1601
+ utilities.triggerMouseover(thinkSpherePage.dragHandleButton());
1602
+ });
1603
+ utilities.verifyCSS(thinkSpherePage.tooltipText(), {
1604
+ 'color': css.color.whiteText,
1605
+ 'font-size': css.fontSize.small,
1606
+ 'font-weight': css.fontWeight.regular
1607
+ });
1608
+ utilities.getNthElement(thinkSpherePage.optionWrapper(), NthElement)
1609
+ .within(() => {
1610
+ utilities.triggerMouseout(thinkSpherePage.dragHandleButton())
1611
+ });
1612
+ utilities.verifyElementVisibilityState(thinkSpherePage.tooltipText(), 'notExist');
1613
+ });
1614
+
1615
+ it('Accessibility of drag handle tooltip', { tags: 'a11y' }, () => {
1616
+ utilities.getNthElement(thinkSpherePage.optionWrapper(), NthElement)
1617
+ .within(() => {
1618
+ utilities.triggerMouseover(thinkSpherePage.dragHandleButton());
1619
+ });
1620
+ utilities.verifyElementVisibilityState(thinkSpherePage.tooltipText(), 'visible');
1621
+ utilities.getNthElement(thinkSpherePage.optionWrapper(), NthElement)
1622
+ .within(() => {
1623
+ utilities.triggerMouseout(thinkSpherePage.dragHandleButton())
1624
+ });
1625
+ utilities.verifyElementVisibilityState(thinkSpherePage.tooltipText(), 'notExist');
1626
+ });
1627
+ },
1628
+
1629
+ /**
1630
+ * Verifies the enabled delete button and tooltip.
1631
+ * @param {string} list - The list to verify ('strategy' or other).
1632
+ * @param {number} NthElement - The index of the delete button.
1633
+ */
1634
+ verifyEnabledDeleteButtonAndTooltip: (list, NthElement) => {
1635
+ it('When the number of options are greater than 1 and both the options are selected then the \'Delete\' icon buttons should get enabled', () => {
1636
+ thinkSpherePage.steps.selectOption(list, 1);
1637
+ thinkSpherePage.deleteButton()
1638
+ .should('be.enabled');
1639
+ });
1640
+
1641
+ it('CSS of enabled \'Delete\' option button', { tags: 'css' }, () => {
1642
+ utilities.verifyCSS(utilities.getNthElement(thinkSpherePage.deleteButton(), NthElement), {
1643
+ 'opacity': '1'
1644
+ });
1645
+ utilities.getNthElement(thinkSpherePage.deleteButton(), NthElement)
1646
+ .verifyPseudoClassBeforeProperty('color', css.color.deleteIcon)
1647
+ });
1648
+
1649
+ it('Accessibility of enabled \'Delete\' option button', { tags: 'a11y' }, () => {
1650
+ cy.checkAccessibility(thinkSpherePage.deleteButton());
1651
+ });
1652
+
1653
+ it('when the user hovers over the enabled \'Delete\' icon buttons, then \'Delete option\' message should be displayed on a tooltip and the tooltip should disappear if focus is removed from the \'Delete\' icon button', () => {
1654
+ utilities.getNthElement(thinkSpherePage.deleteButton(), NthElement)
1655
+ .verifyTooltip(list === 'strategy' ? 'Delete strategy' : 'Delete sentence starter');
1656
+ });
1657
+
1658
+ it('CSS of enabled delete button tooltip', { tags: 'css' }, () => {
1659
+ utilities.triggerMouseover(utilities.getNthElement(thinkSpherePage.deleteButton(), NthElement));
1660
+ utilities.verifyElementVisibilityState(thinkSpherePage.tooltipText(), 'visible')
1661
+ utilities.verifyCSS(thinkSpherePage.tooltipText(), {
1662
+ 'color': css.color.whiteText,
1663
+ 'font-size': css.fontSize.small,
1664
+ 'font-weight': css.fontWeight.regular
1665
+ });
1666
+ utilities.triggerMouseout(utilities.getNthElement(thinkSpherePage.deleteButton(), NthElement));
1667
+ utilities.verifyElementVisibilityState(thinkSpherePage.tooltipText(), 'notExist');
1668
+ });
1669
+ },
1670
+
1671
+ /**
1672
+ * Verifies the options checkbox component.
1673
+ * @param {string} list - The list to verify ('strategy' or other).
1674
+ */
1675
+ verifyOptionsCheckboxComponent: (list) => {
1676
+ it('Option checkbox button should be present', () => {
1677
+ if (list === 'strategy') {
1678
+ utilities.getNthElement(thinkSpherePage.planStrategyCheckbox(), 0)
1679
+ .find('input')
1680
+ .should('have.attr', 'type', 'checkbox')
1681
+ .should('have.attr', 'checked');
1682
+ } else {
1683
+ utilities.getNthElement(thinkSpherePage.planSentenceStarterCheckbox(), 0)
1684
+ .find('input')
1685
+ .should('have.attr', 'type', 'checkbox')
1686
+ .should('have.attr', 'checked');
1687
+ }
1688
+ });
1689
+
1690
+ it('CSS of checked checkbox button', { tags: 'css' }, () => {
1691
+ if (list === 'strategy') {
1692
+ utilities.verifyCSS(
1693
+ utilities.getNthElement(thinkSpherePage.planStrategyCheckbox().find('svg g g'), 0), {
1694
+ 'fill': css.color.primaryBtnBg,
1695
+ });
1696
+ utilities.verifyCSS(
1697
+ utilities.getNthElement(thinkSpherePage.planStrategyCheckbox().find('svg'), 0), {
1698
+ 'width': '12px',
1699
+ 'height': '12px',
1700
+ });
1701
+ } else {
1702
+ utilities.verifyCSS(
1703
+ utilities.getNthElement(thinkSpherePage.planSentenceStarterCheckbox().find('svg g g'), 0), {
1704
+ 'fill': css.color.primaryBtnBg,
1705
+ });
1706
+ utilities.verifyCSS(
1707
+ utilities.getNthElement(thinkSpherePage.planSentenceStarterCheckbox().find('svg'), 0), {
1708
+ 'width': '12px',
1709
+ 'height': '12px',
1710
+ });
1711
+ }
1712
+ });
1713
+
1714
+ it('When user clicks on the checkbox button then the checkbox should get unchecked', () => {
1715
+ if (list === 'strategy') {
1716
+ thinkSpherePage.steps.selectOption(list, 0);
1717
+ utilities.getNthElement(thinkSpherePage.planStrategyCheckbox(), 0)
1718
+ .find('input')
1719
+ .should('not.be.checked');
1720
+ thinkSpherePage.steps.selectOption(list, 0);
1721
+ } else {
1722
+ thinkSpherePage.steps.selectOption(list, 0);
1723
+ utilities.getNthElement(thinkSpherePage.planSentenceStarterCheckbox(), 0)
1724
+ .find('input')
1725
+ .should('not.be.checked');
1726
+ thinkSpherePage.steps.selectOption(list, 0);
1727
+ }
1728
+ });
1729
+
1730
+ it('CSS of unchecked checkbox button', { tags: 'css' }, () => {
1731
+ if (list === 'strategy') {
1732
+ thinkSpherePage.steps.selectOption(list, 1);
1733
+ utilities.verifyCSS(
1734
+ utilities.getNthElement(thinkSpherePage.planStrategyCheckbox().find('svg'), 1), {
1735
+ 'fill': css.color.uncheckedCheckbox,
1736
+ 'width': '12px',
1737
+ 'height': '12px',
1738
+ });
1739
+ } else {
1740
+ thinkSpherePage.steps.selectOption(list, 1);
1741
+ utilities.verifyCSS(
1742
+ utilities.getNthElement(thinkSpherePage.planSentenceStarterCheckbox().find('svg'), 1), {
1743
+ 'fill': css.color.uncheckedCheckbox,
1744
+ 'width': '12px',
1745
+ 'height': '12px',
1746
+ });
1747
+ }
1748
+ });
1749
+
1750
+ it('Accessibility of checked \'Checkbox\' button', { tags: 'a11y' }, () => {
1751
+ if (list === 'strategy') {
1752
+ cy.checkAccessibility(thinkSpherePage.planStrategyCheckbox());
1753
+ } else {
1754
+ cy.checkAccessibility(thinkSpherePage.planSentenceStarterCheckbox());
1755
+ }
1756
+ });
1757
+ },
1758
+
1759
+ /**
1760
+ * Verifies the CSS of the 'Option' input field.
1761
+ * @param {string} list - The list type ('strategy' or other).
1762
+ */
1763
+ verifyOptionsInput: (list) => {
1764
+ it('CSS of \'Option\' input field', () => {
1765
+ if (list === 'strategy') {
1766
+ utilities.verifyCSS(utilities.getNthElement(thinkSpherePage.listInputField().parent(), 0), {
1767
+ 'border': `1px solid ${css.color.figDefaultComponentBorder}`,
1768
+ 'border-radius': '8px',
1769
+ 'font-size': css.fontSize.default,
1770
+ 'font-weight': css.fontWeight.regular,
1771
+ });
1772
+ } else {
1773
+ utilities.verifyCSS(utilities.getNthElement(thinkSpherePage.listInputField().parent(), 5), {
1774
+ 'border': `1px solid ${css.color.figDefaultComponentBorder}`,
1775
+ 'border-radius': '8px',
1776
+ 'font-size': css.fontSize.default,
1777
+ 'font-weight': css.fontWeight.regular,
1778
+ });
1779
+ }
1780
+ });
1781
+ },
1782
+
1783
+ /**
1784
+ * Verifies that at least one option is required.
1785
+ * @param {string} list - The list type ('strategy' or other).
1786
+ * @param {Array<string>} listOptions - The list of options.
1787
+ * @param {string} disableTooltipText - The tooltip text to display when the delete button is disabled.
1788
+ */
1789
+ verifyAtleastOneOptionIsRequired: (list, listOptions, disableTooltipText) => {
1790
+ const optionsToBeDeleted = listOptions.filter((el) => el !== listOptions[0]);
1791
+
1792
+ it('When the user deletes the last option, then the \'Delete\' icon button should get disabled', () => {
1793
+ optionsToBeDeleted.forEach(() => { thinkSpherePage.steps.deleteOption(list === 'strategy' ? 1 : 6) });
1794
+ thinkSpherePage.steps.verifyDeleteOptionButtonDisabledState(list);
1795
+ optionsToBeDeleted.forEach(() => { thinkSpherePage.steps.addOption(list) });
1796
+ listOptions.forEach((inputFieldText, optionIndex) => {
1797
+ thinkSpherePage.steps.addOptionText(list, optionIndex, inputFieldText);
1798
+ });
1799
+ });
1800
+
1801
+ it('When the user hovers over the disabled delete buttons of the options then \'Minimum one option is required\' message should be displayed on a tooltip and the tooltip should disappear if focus is removed from the delete button', () => {
1802
+ utilities.getNthElement(thinkSpherePage.deleteButton(), list === 'strategy' ? 0 : 5)
1803
+ .trigger('mouseover', { force: true });
1804
+ utilities.verifyInnerText(thinkSpherePage.tooltipText(), disableTooltipText);
1805
+ utilities.getNthElement(thinkSpherePage.deleteButton(), list === 'strategy' ? 0 : 5)
1806
+ .trigger('mouseout', { force: true });
1807
+ utilities.verifyElementVisibilityState(thinkSpherePage.tooltipText(), 'notExist');
1808
+ });
1809
+
1810
+ it('When the user uncheck the last option, then the \'Checkbox\' icon button should get disabled', () => {
1811
+ thinkSpherePage.steps.verifyCheckboxButtonDisabledState(list, 0);
1812
+ });
1813
+ },
1814
+
1815
+ verifyUploadImageSectionContentWithCSSAndA11y: () => {
1816
+ it('\'Upload\' label and \'Choose file\' button should be displayed', () => {
1817
+ utilities.verifyInnerText(backgroundImageUploadComponent.uploadLabel(), 'Upload');
1818
+ utilities.verifyElementVisibilityState(backgroundImageUploadComponent.uploadLabel(), 'visible');
1819
+ utilities.verifyInnerText(backgroundImageUploadComponent.chooseFileButton(), 'Choose file');
1820
+ utilities.verifyElementVisibilityState(backgroundImageUploadComponent.chooseFileButton(), 'visible');
1821
+ });
1822
+
1823
+ it('\'File name\' label should be displayed and by default \'No file chosen\' text should be displayed below the \'File name\' label.', () => {
1824
+ utilities.verifyInnerText(backgroundImageUploadComponent.fileNameLabel(), 'File name');
1825
+ utilities.verifyElementVisibilityState(backgroundImageUploadComponent.fileNameLabel(), 'visible');
1826
+ utilities.verifyInnerText(backgroundImageUploadComponent.noFileChosenLabel(), 'No file chosen');
1827
+ utilities.verifyElementVisibilityState(backgroundImageUploadComponent.noFileChosenLabel(), 'visible');
1828
+ });
1829
+
1830
+ backgroundImageUploadComponent.tests.verifyCSSAndA11yBeforeUpload();
1831
+
1832
+ backgroundImageUploadComponent.tests.verifyImageUploadFunctionality('thinkSphere');
1833
+ },
1834
+
1835
+ verifyQuestionInstructionsInputFieldThinkSpherePreviewTab: () => {
1836
+ it('When user has not entered any text in the Question instructions input field in the \'Edit\' tab then nothing should be displayed in the \'Preview\' tab', () => {
1837
+ createQuestionBasePage.steps.switchToPreviewTab();
1838
+ //Failing due to https://redmine.zeuslearning.com/issues/553382
1839
+ utilities.verifyElementVisibilityState(questionInstructionsComponent.questionInstructionsText(), 'notExist')
1840
+ });
1841
+
1842
+ it('When the user specifies question instructions, then the added question instructions should be displayed in the \'Preview\' tab', () => {
1843
+ createQuestionBasePage.steps.switchToEditTab();
1844
+ questionInstructionsComponent.steps.addTextInQuestionInstructionsInputField('Which of the following is the major contributor to increased carbon dioxide levels because of urbanization? Select your answer from the options below.');
1845
+ // UNCOMMENT BELOW CODE WHEN PREVIEW TAB IS AVAILABLE FOR THINKSPHERE
1846
+ // createQuestionBasePage.steps.switchToPreviewTab();
1847
+ // utilities.verifyTextContent(questionInstructionsComponent.questionInstructionsTextPreviewTab(), 'Which of the following is the major contributor to increased carbon dioxide levels because of urbanization? Select your answer from the options below.');
1848
+ });
1849
+ },
1850
+
1851
+ verifyResetToDefaultFunctionality: (optionList, listType) => {
1852
+ if (listType === 'strategy') {
1853
+ it('When user clicks on \'Reset to default\' button then the strategy list should be reset to default', () => {
1854
+ thinkSpherePage.planStrategyListResetToDefault()
1855
+ .click();
1856
+ optionList.forEach((option, index) => {
1857
+ thinkSpherePage.steps.verifyOptionsContents(index, option, 'Enter strategy name');
1858
+ });
1859
+ });
1860
+ } else {
1861
+ it('When user clicks on \'Reset to default\' button then the sentence starter list should be reset to default', () => {
1862
+ thinkSpherePage.planSentenceStarterListResetToDefault()
1863
+ .click();
1864
+ thinkSpherePage.planSentenceStarterSection()
1865
+ .within(() => {
1866
+ optionList.forEach((option, index) => {
1867
+ thinkSpherePage.steps.verifyOptionsContents(index, option, 'Enter sentence starter name');
1868
+ });
1869
+ })
1870
+ });
1871
+ }
1872
+ },
1873
+
1874
+ verifyVideoLinkComponent: () => {
1875
+ it('Video link component should be displayed', () => {
1876
+ utilities.verifyElementVisibilityState(thinkSpherePage.videoLinkComponent(), 'visible');
1877
+ utilities.verifyInnerText(thinkSpherePage.videoLinkComponent(), 'Upload video');
1878
+ });
1879
+
1880
+ it('CSS of video link component', { tags: 'css' }, () => {
1881
+ thinkSpherePage.videoLinkComponent()
1882
+ .within(() => {
1883
+ utilities.verifyCSS(thinkSpherePage.uploadVideoLinkButton(), {
1884
+ 'color': css.color.linkText,
1885
+ 'font-size': css.fontSize.default,
1886
+ 'font-weight': css.fontWeight.regular,
1887
+ 'font-family': '"Nunito Sans"',
1888
+ 'text-decoration-line': 'underline',
1889
+ });
1890
+
1891
+ cy.log('CSS of video link component on hover state');
1892
+ utilities.hoverOverElement(thinkSpherePage.uploadVideoLinkButton());
1893
+ utilities.verifyCSS(thinkSpherePage.uploadVideoLinkButton(), {
1894
+ 'text-decoration-line': 'none',
1895
+ });
1896
+ });
1897
+ });
1898
+
1899
+ it('When user upload a file whose extension is not supported then an error message should be displayed', () => {
1900
+ thinkSpherePage.videoLinkComponent()
1901
+ .within(() => {
1902
+ thinkSpherePage.uploadVideoLinkButton()
1903
+ .click();
1904
+ });
1905
+ thinkSpherePage.steps.uploadVideoFile('uploads/sample.wmv');
1906
+ thinkSpherePage.steps.verifyWarningPopup('File upload error', 'The file type is not supported. Please upload files with the following supported formats: mp4, webm.');
1907
+ });
1908
+
1909
+ it('CSS of warning popup', { tags: 'css' }, () => {
1910
+ utilities.verifyCSS(dialogBoxBase.dialogBox(), {
1911
+ 'border': `1px solid ${css.color.secondaryBtnBorder}`,
1912
+ 'border-radius': '8px',
1913
+ 'background-color': css.color.primaryBtn,
1914
+ 'box-shadow': `${css.color.dialogBoxBoxShadow} 0px 0px 10px 0px`,
1915
+ });
1916
+
1917
+ dialogBoxBase.dialogBoxTitle().within(() => {
1918
+ utilities.verifyCSS(thinkSpherePage.warningPopupTitle(), {
1919
+ 'color': css.color.secondaryBtn,
1920
+ 'font-size': css.fontSize.heading,
1921
+ 'font-weight': css.fontWeight.bold
1922
+ });
1923
+ });
1924
+
1925
+ dialogBoxBase.dialogBoxContent().within(() => {
1926
+ utilities.verifyCSS(thinkSpherePage.warningPopupContentText(), {
1927
+ 'color': css.color.sectionHeading,
1928
+ 'font-size': css.fontSize.default,
1929
+ 'font-weight': css.fontWeight.regular,
1930
+ 'font-family': 'Inter'
1931
+ });
1932
+
1933
+ utilities.verifyCSS(thinkSpherePage.warningPopupOkButton(), {
1934
+ 'background-color': css.color.primaryBtnBg,
1935
+ 'border': `1px solid ${css.color.primaryBtnBorder}`,
1936
+ 'color': css.color.primaryBtn,
1937
+ 'border-radius': '8px',
1938
+ 'font-size': css.fontSize.default,
1939
+ 'font-weight': css.fontWeight.semibold,
1940
+ 'font-family': '"Nunito Sans"',
1941
+ 'box-shadow': `${css.color.primaryBtnBorder} 0px 5px 0px 0px`
1942
+ });
1943
+ });
1944
+ });
1945
+
1946
+ it('When user click on OK button of warning popup then the popup should be closed', () => {
1947
+ dialogBoxBase.dialogBoxContent().within(() => {
1948
+ thinkSpherePage.warningPopupOkButton()
1949
+ .click();
1950
+ });
1951
+ utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'notExist');
1952
+ });
1953
+
1954
+ it('When user upload a file whose extension is supported then no error message should be displayed', () => {
1955
+ thinkSpherePage.videoLinkComponent()
1956
+ .within(() => {
1957
+ thinkSpherePage.uploadVideoLinkButton()
1958
+ .click();
1959
+ });
1960
+ thinkSpherePage.steps.uploadVideoFile('uploads/sample.webm');
1961
+ utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'notExist');
1962
+ thinkSpherePage.videoLinkComponent()
1963
+ .within(() => {
1964
+ thinkSpherePage.deleteVideoButton()
1965
+ .click();
1966
+ });
1967
+ });
1968
+
1969
+ it('When user upload a file of size more than 25MB then an error message should be displayed', () => {
1970
+ thinkSpherePage.videoLinkComponent()
1971
+ .within(() => {
1972
+ thinkSpherePage.uploadVideoLinkButton()
1973
+ .click();
1974
+ });
1975
+ thinkSpherePage.steps.uploadVideoFile('uploads/sample30MB.mp4');
1976
+ thinkSpherePage.steps.verifyWarningPopup('File upload error', 'The file could not be uploaded. The file is 31 MB exceeding the maximum size of 25 MB.');
1977
+ });
1978
+
1979
+ it('When user click on OK button of warning popup then the popup should be closed', () => {
1980
+ dialogBoxBase.dialogBoxContent().within(() => {
1981
+ thinkSpherePage.warningPopupOkButton()
1982
+ .click();
1983
+ });
1984
+ utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'notExist');
1985
+ });
1986
+
1987
+ it('When user upload a file of size less than 25MB then no error message should be displayed and video uploaded successfully', () => {
1988
+ thinkSpherePage.videoLinkComponent()
1989
+ .within(() => {
1990
+ thinkSpherePage.uploadVideoLinkButton()
1991
+ .click();
1992
+ });
1993
+ thinkSpherePage.steps.uploadVideoFile('uploads/sample2MB.mp4');
1994
+ cy.interceptGraphql('getFileScanStatus');
1995
+ cy.wait(5000);
1996
+ utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'notExist');
1997
+ });
1998
+
1999
+ it('When user upload correct file then uploaded file name, edit video button along with delete video button should present', () => {
2000
+ thinkSpherePage.videoLinkComponent().within(() => {
2001
+ utilities.verifyInnerText(thinkSpherePage.uploadVideoLinkButton(), 'sample2MB.mp4');
2002
+ utilities.verifyElementVisibilityState(thinkSpherePage.editVideoButton(), 'visible');
2003
+ utilities.verifyElementVisibilityState(thinkSpherePage.deleteVideoButton(), 'visible');
2004
+ });
2005
+ });
2006
+
2007
+ it('CSS of edit video button and delete video button', { tags: 'css' }, () => {
2008
+ thinkSpherePage.videoLinkComponent().within(() => {
2009
+ utilities.verifyCSS(thinkSpherePage.editVideoButton(), {
2010
+ 'width': '24px',
2011
+ 'height': '24px',
2012
+ 'background-color': css.color.transparent,
2013
+ });
2014
+ utilities.verifyCSS(thinkSpherePage.deleteVideoButton(), {
2015
+ 'width': '24px',
2016
+ 'height': '24px',
2017
+ 'background-color': css.color.transparent,
2018
+ });
2019
+ });
2020
+ });
2021
+
2022
+ it('When user upload another file size less than 25MB then no error message should be displayed and video uploaded successfully', () => {
2023
+ thinkSpherePage.videoLinkComponent()
2024
+ .within(() => {
2025
+ thinkSpherePage.editVideoButton()
2026
+ .click();
2027
+ });
2028
+ thinkSpherePage.steps.uploadVideoFile('uploads/sample2MB_2.mp4');
2029
+ cy.interceptGraphql('getFileScanStatus');
2030
+ cy.wait(5000);
2031
+ utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'notExist');
2032
+ });
2033
+
2034
+ it('When user upload another correct file then uploaded file name, edit video button along with delete video button should present', () => {
2035
+ thinkSpherePage.videoLinkComponent().within(() => {
2036
+ utilities.verifyInnerText(thinkSpherePage.uploadVideoLinkButton(), 'sample2MB_2.mp4');
2037
+ utilities.verifyElementVisibilityState(thinkSpherePage.editVideoButton(), 'visible');
2038
+ utilities.verifyElementVisibilityState(thinkSpherePage.deleteVideoButton(), 'visible');
2039
+ });
2040
+ });
2041
+
2042
+ it('When user click on delete video button then the video should be deleted', () => {
2043
+ thinkSpherePage.videoLinkComponent()
2044
+ .within(() => {
2045
+ thinkSpherePage.deleteVideoButton()
2046
+ .click();
2047
+ });
2048
+ utilities.verifyInnerText(thinkSpherePage.videoLinkComponent(), 'Upload video');
2049
+ });
2050
+
2051
+ it('Accessibility of video link component', { tags: 'a11y' }, () => {
2052
+ cy.checkAccessibility(thinkSpherePage.singleOptionTextFieldWrapper());
2053
+ });
2054
+ },
2055
+
2056
+ verifyErrorMessageCSSAndA11y: () => {
2057
+ it('CSS of error message', { tags: 'css' }, () => {
2058
+ utilities.verifyCSS(commonComponents.errorMessage(), {
2059
+ 'color': css.color.errorText,
2060
+ 'font-size': css.fontSize.small,
2061
+ 'font-weight': css.fontWeight.regular
2062
+ });
2063
+ });
2064
+
2065
+ it('Accessibility of error message', { tags: 'a11y' }, () => {
2066
+ cy.checkAccessibility(thinkSpherePage.nextGenThinkSphereCreateItemWrapper());
2067
+ });
2068
+ },
2069
+
2070
+ verifyQuestionAccordion: () => {
2071
+ it('Author should be able to expand and collapse the question accordion by clicking on the expand icon', () => {
2072
+ thinkSpherePage.filterSectionQuestionAccordion().each(($accordion) => {
2073
+ cy.wrap($accordion).find('.expansion-item-icon-wrapper').click();
2074
+ cy.wrap($accordion).should('have.class', 'Mui-expanded');
2075
+ });
2076
+
2077
+ thinkSpherePage.filterSectionQuestionAccordion().each(($accordion) => {
2078
+ cy.wrap($accordion).find('.expansion-item-icon-wrapper').click();
2079
+ cy.wrap($accordion).should('not.have.class', 'Mui-expanded');
2080
+ });
2081
+ });
2082
+ },
2083
+
2084
+ verifyCreateItemHeaderSection: () => {
2085
+ it('The page displays a unique Reference ID at the top left corner in the format "Ref ID:"', () => {
2086
+ utilities.verifyElementVisibilityState(thinkSpherePage.referenceIdWrapper(), 'visible');
2087
+ utilities.verifyInnerText(thinkSpherePage.referenceIdWrapper().children('div').first(), 'Ref ID:\u00A0');
2088
+ const initialRefId = thinkSpherePage.referenceIdWrapper().children('div').eq(1).invoke('text');
2089
+ initialRefId.then((refId) => {
2090
+ expect(refId).to.be.a('string').and.not.be.empty;
2091
+ cy.reload();
2092
+ thinkSpherePage.referenceIdWrapper().children('div').eq(1).invoke('text').should((newRefId) => {
2093
+ expect(newRefId).to.be.a('string').and.not.be.empty;
2094
+ expect(newRefId).to.not.equal(refId);
2095
+ });
2096
+ });
2097
+ });
2098
+
2099
+ it('Edit text box and edit icon pencil should exist, and on clicking the edit input field with placeholder \'Enter title\ should allow the user to add title' , () => {
2100
+ utilities.verifyElementVisibilityState(thinkSpherePage.editBoxTextInput(), 'visible');
2101
+ thinkSpherePage.editBoxTextInput().blur();
2102
+ utilities.verifyElementVisibilityState(thinkSpherePage.editIconPencil(), 'visible');
2103
+ thinkSpherePage.editIconPencil().click();
2104
+ thinkSpherePage.editBoxTextInput().should('have.attr', 'placeholder', 'Enter title');
2105
+ thinkSpherePage.editBoxTextInput().type('Test Title');
2106
+ thinkSpherePage.editBoxTextInput().blur();
2107
+ utilities.verifyInnerText(thinkSpherePage.editBoxText(),'Test Title');
2108
+ });
2109
+ },
2110
+
2111
+ verifyDefaultTab: () => {
2112
+ it('By default edit tab should be selected', () => {
2113
+ thinkSpherePage.editTab().should('have.class', 'Mui-selected');
2114
+ });
2115
+ },
2116
+
2117
+ /**
2118
+ * Verifies the functionality of editing, selecting, and unselecting strategies and sentence starters.
2119
+ * Ensures that changes are saved successfully and reflected in the preview section.
2120
+ *
2121
+ * @param {Object} sentenceStartersObject - The object containing strategies and sentence starters data.
2122
+ * @param {Array<string>} sentenceStartersObject.editedStrategies - The list of edited strategies to verify.
2123
+ * @param {Array<string>} sentenceStartersObject.editedSentenceStarters - The list of edited sentence starters to verify.
2124
+ * @param {Array<string>} sentenceStartersObject.selectStrategies - The list of strategies to select and verify.
2125
+ * @param {Array<string>} sentenceStartersObject.selectSentenceStarters - The list of sentence starters to select and verify.
2126
+ */
2127
+ verifyStrategiesAndSentenceStartersSection: (sentenceStartersObject) => {
2128
+ const {
2129
+ editedStrategies, editedSentenceStarters, selectStrategies, selectSentenceStarters
2130
+ } = sentenceStartersObject || {};
2131
+ it('When user edits the strategies and sentence starers, then the changes should be saved successfully and edited strategies and sentence starers should get displayed in preview side', () => {
2132
+ thinkSpherePage.steps.switchToEditTab();
2133
+ thinkSpherePage.steps.clickOnEditQuestionIcon();
2134
+ editedStrategies.forEach((strategy, index) => {
2135
+ thinkSpherePage.steps.addOptionText('strategy', index, strategy);
2136
+ });
2137
+ editedSentenceStarters.forEach((sentenceStarter, index) => {
2138
+ thinkSpherePage.steps.addOptionText('sentenceStarter', index, sentenceStarter);
2139
+ });
2140
+ thinkSpherePage.steps.saveAQuestionAndVerifySnackbar();
2141
+ thinkSpherePage.steps.switchToPreviewTab();
2142
+ editedStrategies.forEach((label, index) => {
2143
+ utilities.verifyInnerText(utilities.getNthElement(thinkSpherePage.strategyTextWrapper(), index), label);
2144
+ });
2145
+ thinkSpherePage.steps.expandChooseStarterDropdown();
2146
+ editedSentenceStarters.forEach((label, index) => {
2147
+ utilities.verifyInnerText(utilities.getNthElement(thinkSpherePage.chooseStartersListOptionLabels(), index), label);
2148
+ });
2149
+ utilities.clickOnBody();
2150
+ });
2151
+
2152
+ it('When user select unselect the strategies and sentence starers, then the changes should be saved successfully and selected strategies and sentence starers should get displayed in preview side', () => {
2153
+ thinkSpherePage.steps.switchToEditTab();
2154
+ thinkSpherePage.steps.clickOnEditQuestionIcon();
2155
+ editedStrategies.forEach((strategy, index) => {
2156
+ if(!selectStrategies.includes(strategy)){
2157
+ thinkSpherePage.steps.selectOption('strategy', index);
2158
+ }
2159
+ });
2160
+ cy.wait(2000);
2161
+ editedSentenceStarters.forEach((sentenceStarter, index) => {
2162
+ if(!selectSentenceStarters.includes(sentenceStarter)){
2163
+ thinkSpherePage.steps.selectOption('sentenceStarter', index);
2164
+ }
2165
+ });
2166
+ cy.wait(2000);
2167
+ thinkSpherePage.steps.saveAQuestionAndVerifySnackbar();
2168
+ thinkSpherePage.steps.switchToPreviewTab();
2169
+ selectStrategies.forEach((label, index) => {
2170
+ utilities.verifyInnerText(utilities.getNthElement(thinkSpherePage.strategyTextWrapper(), index), label);
2171
+ });
2172
+ thinkSpherePage.steps.expandChooseStarterDropdown();
2173
+ selectSentenceStarters.forEach((label, index) => {
2174
+ utilities.verifyInnerText(utilities.getNthElement(thinkSpherePage.chooseStartersListOptionLabels(), index), label);
2175
+ });
2176
+ utilities.clickOnBody();
2177
+ });
2178
+ },
2179
+ };
2180
+
2181
+ export const thinkSpherePage = {
2182
+ ...selectors,
2183
+ steps,
2184
+ tests
2185
+ };