itemengine-cypress-automation 1.0.372-mcq-flakiness-22ad93f.0 → 1.0.373-IEI-5907-b092308.0
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.
- package/Dockerfile +1 -0
- package/cypress/e2e/ILC/AudioResponseNew/editTabBasicSection.js +4 -16
- package/cypress/e2e/ILC/BrainingCampManipulative/editTabBasicSection.js +1 -1
- package/cypress/e2e/ILC/BrowseItems/browseReviewItems.js +39 -7
- package/cypress/e2e/ILC/ChartsBar/HorizontalOrientationBarChart/gradingViewAndCorrectAnswerView.smoke.js +1 -1
- package/cypress/e2e/ILC/ChartsBar/Scoring/checkScoringLabelBannerAndCorrectAnswerSection.js +33 -0
- package/cypress/e2e/ILC/ChartsBar/Scoring/partialDifferentWeightBasic.js +25 -25
- package/cypress/e2e/ILC/ChartsBar/Scoring/partialDifferentWeightsAlternativePointsGreaterThanCorrectPoints.js +37 -36
- package/cypress/e2e/ILC/ChartsBar/Scoring/partialDifferentWeightsCorrectPointsEqualToAlternativePoints.js +37 -36
- package/cypress/e2e/ILC/ChartsBar/Scoring/partialDifferentWeightsCorrectPointsGreaterThanAlternativePoints.js +37 -36
- package/cypress/e2e/ILC/ChartsBar/Scoring/partialDifferentWeightsMinimumAndPenaltyScoring.js +1 -0
- package/cypress/e2e/ILC/ChartsBar/Scoring/partialEqualWeightBasic.js +26 -25
- package/cypress/e2e/ILC/ChartsBar/Scoring/partialEqualWeightsAlternativePointsGreaterThanCorrectPoints.js +39 -38
- package/cypress/e2e/ILC/ChartsBar/Scoring/partialEqualWeightsCorrectPointsEqualToAlternativePoints.js +31 -30
- package/cypress/e2e/ILC/ChartsBar/Scoring/partialEqualWeightsCorrectPointsGreaterThanAlternativePoints.js +35 -34
- package/cypress/e2e/ILC/ChartsBar/Scoring/partialEqualWeightsCorrectPointsGreaterThanAlternativePointsLocked.js +247 -0
- package/cypress/e2e/ILC/ChartsBar/editTabBasicSection.js +37 -0
- package/cypress/e2e/ILC/ChartsBar/headerSection.js +50 -2
- package/cypress/e2e/ILC/ChartsBar/specifyCorrectAnswerSection.js +92 -0
- package/cypress/e2e/ILC/ChartsDotsPlot/scoring/partialEqualWeightsWithCorrectPointsGreaterThanAlternativePointsLocked.js +220 -0
- package/cypress/e2e/ILC/ChartsLine/Scoring/partialDifferentWeightBasic.js +25 -25
- package/cypress/e2e/ILC/ChartsLine/Scoring/partialDifferentWeightsAlternativePointsGreaterThanCorrectPoints.js +47 -46
- package/cypress/e2e/ILC/ChartsLine/Scoring/partialDifferentWeightsCorrectPointsEqualToAlternativePoints.js +25 -24
- package/cypress/e2e/ILC/ChartsLine/Scoring/partialDifferentWeightsCorrectPointsGreaterThanAlternativePoints.js +25 -24
- package/cypress/e2e/ILC/ChartsLine/Scoring/partialDifferentWeightsMinimumAndPenaltyScoring.js +1 -0
- package/cypress/e2e/ILC/ChartsLine/Scoring/partialEqualWeightBasic.js +25 -25
- package/cypress/e2e/ILC/ChartsLine/Scoring/partialEqualWeightsAlternativePointsGreaterThanCorrectPoints.js +24 -23
- package/cypress/e2e/ILC/ChartsLine/Scoring/partialEqualWeightsCorrectPointsEqualToAlternativePoints.js +21 -20
- package/cypress/e2e/ILC/ChartsLine/Scoring/partialEqualWeightsCorrectPointsGreaterThanAlternativePoints.js +48 -46
- package/cypress/e2e/ILC/ChartsLine/Scoring/partialEqualWeightsCorrectPointsGreaterThanAlternativePointsLocked.js +249 -0
- package/cypress/e2e/ILC/ChartsLine/editQuestion.smoke.js +3 -1
- package/cypress/e2e/ILC/ChartsLine/headerSection.js +18 -1
- package/cypress/e2e/ILC/ChartsLine/specifyCorrectAnswerSection.js +94 -0
- package/cypress/e2e/ILC/CkEditorAudioPlayer/audioPlayerEditTabAddFeatureRadioButton.js +2 -3
- package/cypress/e2e/ILC/CkEditorAudioPlayer/audioPlayerEditTabAddTranscriptRadioButton .js +2 -4
- package/cypress/e2e/ILC/CkEditorAudioPlayer/audioPlayerEditTabStudentViewSettings.js +3 -3
- package/cypress/e2e/ILC/CkEditorAudioPlayer/audioPlayerHeaderSectionAndButtons.js +2 -2
- package/cypress/e2e/ILC/CkEditorAudioPlayer/audioPlayerPreviewTab.js +1 -1
- package/cypress/e2e/ILC/CkEditorAudioPlayer/audioPlayerPreviewTabSupportedFileTypes.js +6 -0
- package/cypress/e2e/ILC/CkEditorAudioPlayer/audioPlayerPreviewTabTranscript.js +2 -3
- package/cypress/e2e/ILC/CkEditorEquationEditor/equationEditorBasicFile.js +4 -4
- package/cypress/e2e/ILC/CkEditorInsertImage/imageInfo.js +4 -4
- package/cypress/e2e/ILC/CkEditorInsertTable/tableDimension&FooterProperties.js +3 -3
- package/cypress/e2e/ILC/CkEditorInsertTable/tableStyle.js +11 -11
- package/cypress/e2e/ILC/CkEditorLink/uploadSection.js +1 -1
- package/cypress/e2e/ILC/ContentBlocks/editTabBasics.js +62 -4
- package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/allOrNothingBasicForAllViews.smoke.js +119 -10
- package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/editTabScoring.js +1 -0
- package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/headerSection.js +2 -0
- package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/manuallyAndNonScoredScoringEditTab.js +4 -1
- package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/minimumScoringPenaltyPointsAndRoundingDropdown.js +3 -0
- package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/pagination.js +1 -1
- package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/studentViewSettingsForGroupedLayout.js +3 -0
- package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/styleAndLayoutCustomizationLayoutProperties.js +3 -0
- package/cypress/e2e/ILC/DrawingResponse/drawingResponseAdditionalSettings.js +1 -0
- package/cypress/e2e/ILC/DrawingResponse/drawingResponseBackground.js +2 -8
- package/cypress/e2e/ILC/DrawingResponse/drawingResponseCustomizeAdditionalOptions.js +1 -0
- package/cypress/e2e/ILC/DrawingResponse/drawingResponseEditTabBasicSection.js +3 -3
- package/cypress/e2e/ILC/DrawingResponse/drawingResponsePreviewTabContents.smoke.js +1 -3
- package/cypress/e2e/ILC/EssayResponse/createCustomCategory.smoke.js +2 -2
- package/cypress/e2e/ILC/EssayResponse/editCategoryFlyout.js +0 -1
- package/cypress/e2e/ILC/EssayResponse/editTabBasicSections.js +23 -37
- package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/allOrNothingForAllViews.smoke.js +210 -0
- package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/draggableOptions.js +2 -0
- package/cypress/e2e/ILC/FillInTheGapsDropdownNew/editQuestion.smoke.js +40 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/allOrNothingForAllViews.smoke.js +216 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/editQuestion.smoke.js +45 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/allOrNothingForAllViews.smoke.js +213 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/backgroundImageAndCanvasProperties.js +1 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/supportedFileTypes.js +3 -1
- package/cypress/e2e/ILC/FillInTheGapsTextNew/allOrNothingForAllViews.smoke.js +207 -0
- package/cypress/e2e/ILC/Graphing/Scoring/allOrNothingWithAlternativePointsGreaterThanCorrectPoints.js +73 -0
- package/cypress/e2e/ILC/Graphing/Scoring/allOrNothingWithCorrectPointsEqualToAlternatePoints.js +38 -0
- package/cypress/e2e/ILC/Graphing/Scoring/allOrNothingWithCorrectPointsGreaterThanAlternativePoints.js +38 -0
- package/cypress/e2e/ILC/Graphing/Scoring/checkScoringLabelBannerAndCorrectAnswerSection.js +87 -0
- package/cypress/e2e/ILC/Graphing/checkAddAlternativeButton.js +35 -0
- package/cypress/e2e/ILC/Graphing/editQuestion.smoke.js +28 -0
- package/cypress/e2e/ILC/Graphing/editTabBasicSection.js +38 -0
- package/cypress/e2e/ILC/Graphing/editTabScoringSection.js +1 -0
- package/cypress/e2e/ILC/Graphing/headerSection.js +36 -4
- package/cypress/e2e/ILC/Graphing/layoutAndGridOptions.js +6 -3
- package/cypress/e2e/ILC/GridFill/addAlternateButton.js +40 -0
- package/cypress/e2e/ILC/GridFill/allOrNothingBasicForAllViews.smoke.js +210 -0
- package/cypress/e2e/ILC/GridFill/customizeLayoutFillImageBackgroundImage.js +5 -6
- package/cypress/e2e/ILC/GridFill/customizeLayoutSectionShadeCellsGridBorders.js +2 -0
- package/cypress/e2e/ILC/GridFill/editTabScoringSection.js +3 -0
- package/cypress/e2e/ILC/GridFill/headerSection.js +1 -3
- package/cypress/e2e/ILC/GridFill/scoring/allOrNothingAlternativePointsGreaterThanCorrectPoints.js +39 -0
- package/cypress/e2e/ILC/GridFill/scoring/allOrNothingCorrectPointsEqualToAlternativePoints.js +39 -0
- package/cypress/e2e/ILC/GridFill/scoring/allOrNothingCorrectPointsGreaterThanAlternativePoints.js +39 -0
- package/cypress/e2e/ILC/GridFill/scoring/cellShadeCountAllOrNothingCorrectPointsGreaterThanAlternativePoints.js +37 -0
- package/cypress/e2e/ILC/GridFill/scoring/cellShadeCountallOrNothingCorrectPointsEqualToAlternativePoints.js +39 -0
- package/cypress/e2e/ILC/GridFill/scoring/cellshadeCountAllOrNothingAlternativePointsGreaterThanCorrectPoints.js +36 -0
- package/cypress/e2e/ILC/GridFill/scoring/checkLabelSaveAsYouGo.js +75 -0
- package/cypress/e2e/ILC/GridFill/scoring/partialEqualWeightsWithCorrectPointsEqualToAlternativePoints.js +2 -1
- package/cypress/e2e/ILC/GridFill/specifyCorrectAnswerSection.js +2 -4
- package/cypress/e2e/ILC/ImageHighlight/Scoring/partialDifferentWeightsScoring.js +2 -1
- package/cypress/e2e/ILC/ImageHighlight/allOrNothingForAllViews.smoke.js +212 -0
- package/cypress/e2e/ILC/ImageHighlight/customiseHighlightStyle.js +29 -0
- package/cypress/e2e/ILC/ImageHighlight/headerSection.js +2 -1
- package/cypress/e2e/ILC/ImageHighlight/studentViewSettings.js +2 -2
- package/cypress/e2e/ILC/ListOrderingDropdown/Scoring/allOrNothingAlternativePointsGreaterThanCorrectPoints.js +24 -0
- package/cypress/e2e/ILC/ListOrderingDropdown/Scoring/allOrNothingCorrectPointsEqualToAlternativePoints.js +24 -0
- package/cypress/e2e/ILC/ListOrderingDropdown/Scoring/allOrNothingCorrectPointsGreaterThanAlternativePoints.js +24 -0
- package/cypress/e2e/ILC/ListOrderingDropdown/Scoring/checkScoringLabelBannerAndCorrectAnswerSection.js +86 -0
- package/cypress/e2e/ILC/ListOrderingDropdown/Scoring/manuallyAndNonScored.js +2 -4
- package/cypress/e2e/ILC/ListOrderingDropdown/Scoring/partialEqualWeightsBasic.js +1 -1
- package/cypress/e2e/ILC/ListOrderingDropdown/allOrNothingForAllViews.smoke.js +237 -1
- package/cypress/e2e/ILC/ListOrderingDropdown/checkAddAlternativeButton.js +35 -0
- package/cypress/e2e/ILC/ListOrderingDropdown/editTabBasicSection.js +24 -0
- package/cypress/e2e/ILC/ListOrderingDropdown/headerSection.js +108 -0
- package/cypress/e2e/ILC/ListOrderingDropdown/manuallyAndNonScoredEditTab.js +2 -1
- package/cypress/e2e/ILC/ListOrderingDropdown/previewContentsForAllViews.smoke.js +2 -4
- package/cypress/e2e/ILC/ListOrderingDropdown/specifyCorrectAnswerSection.js +7 -12
- package/cypress/e2e/ILC/ListOrderingNew/HorizontalOrientation/specifyCorrectAnswerSection.js +10 -14
- package/cypress/e2e/ILC/ListOrderingNew/Scoring/checkScoringLabelBannerAndCorrectAnswerSection.js +52 -0
- package/cypress/e2e/ILC/ListOrderingNew/allOrNothingForAllViews.smoke.js +215 -0
- package/cypress/e2e/ILC/ListOrderingNew/editTabBasicSection.js +23 -0
- package/cypress/e2e/ILC/ListOrderingNew/headerSection.js +36 -9
- package/cypress/e2e/ILC/ListOrderingNew/manuallyAndNonScoredEditTab.js +2 -0
- package/cypress/e2e/ILC/ListOrderingNew/specifyCorrectAnswerSection.js +7 -23
- package/cypress/e2e/ILC/ListOrderingReorderAsASeperateList/Scoring/allOrNothingAlternativePointsGreaterThanCorrectPoints.js +41 -0
- package/cypress/e2e/ILC/ListOrderingReorderAsASeperateList/Scoring/allOrNothingCorrectPointsEqualToAlternativePoints.js +30 -0
- package/cypress/e2e/ILC/ListOrderingReorderAsASeperateList/Scoring/allOrNothingCorrectPointsGreaterThanAlternativePoints.js +50 -0
- package/cypress/e2e/ILC/ListOrderingReorderAsASeperateList/Scoring/checkScoringLabelBannerAndCorrectAnswerSection.js +101 -0
- package/cypress/e2e/ILC/ListOrderingReorderAsASeperateList/allOrNothingForAllViews.smoke.js +309 -0
- package/cypress/e2e/ILC/ListOrderingReorderAsASeperateList/checkAddAlternativeButton.js +38 -0
- package/cypress/e2e/ILC/ListOrderingReorderAsASeperateList/editTabBasicSection.js +24 -0
- package/cypress/e2e/ILC/ListOrderingReorderAsASeperateList/editTabScoring.js +4 -1
- package/cypress/e2e/ILC/ListOrderingReorderAsASeperateList/headerSection.js +36 -1
- package/cypress/e2e/ILC/Matching/Scoring/blankResponseScoring.js +38 -41
- package/cypress/e2e/ILC/Matching/Scoring/checkScoringLabelBannerAndCorrectAnswerSection.js +98 -0
- package/cypress/e2e/ILC/Matching/allOrNothingScoringForAllViews.smoke.js +210 -0
- package/cypress/e2e/ILC/Matching/checkAlternativeButton.js +38 -0
- package/cypress/e2e/ILC/Matching/clickAndDrop.js +5 -5
- package/cypress/e2e/ILC/Matching/draggableOptions.js +7 -0
- package/cypress/e2e/ILC/Matching/editQuestion.smoke.js +3 -2
- package/cypress/e2e/ILC/Matching/editTabBasicSection.js +41 -0
- package/cypress/e2e/ILC/Matching/headerSection.js +38 -12
- package/cypress/e2e/ILC/Matching/questionInstructionsAndPromptSection.js +2 -15
- package/cypress/e2e/ILC/Matching/studentViewSettings.js +2 -0
- package/cypress/e2e/ILC/Matching/studentViewSettingsForGroupedLayout.js +1 -1
- package/cypress/e2e/ILC/MatchingDropdown/Scoring/blankResponseScoring.js +6 -6
- package/cypress/e2e/ILC/MatchingDropdown/allOrNothingScoringForAllViews.smoke.js +208 -0
- package/cypress/e2e/ILC/MultipleSelection/allOrNothingBasicForAllViews.smoke.js +2 -1
- package/cypress/e2e/ILC/MultipleSelectionGridNew/Scoring/checkScoringLabelBannerAndCorrectAnswer.js +1 -0
- package/cypress/e2e/ILC/MultipleSelectionGridNew/previewContentsForAllViews.smoke.js +100 -69
- package/cypress/e2e/ILC/MultipleSelectionGridNew/styleAndLayoutCustomizationLayoutProperties.js +1 -0
- package/cypress/e2e/ILC/NumberLine/Scoring/allOrNothingWithAlternatePointsGreaterThanCorrectPoints.js +79 -0
- package/cypress/e2e/ILC/NumberLine/Scoring/allOrNothingWithCorrectPointsEqualToAlternatePoints.js +42 -0
- package/cypress/e2e/ILC/NumberLine/Scoring/allOrNothingWithCorrectPointsGreaterThanAlternativePoints.js +42 -0
- package/cypress/e2e/ILC/NumberLine/Scoring/checkScoringLabelBannerAndCorrectAnswerSection.js +75 -0
- package/cypress/e2e/ILC/NumberLine/checkAddAlternativeButton.js +32 -0
- package/cypress/e2e/ILC/NumberLine/editTabSection.js +38 -0
- package/cypress/e2e/ILC/NumberLine/headerSection.js +33 -4
- package/cypress/e2e/ILC/NumberLineLabel/Scoring/allOrNothingAlternativePointsGreaterThanCorrectPoints.js +81 -0
- package/cypress/e2e/ILC/NumberLineLabel/Scoring/allOrNothingCorrectPointsEqualToAlternativePoints.js +43 -0
- package/cypress/e2e/ILC/NumberLineLabel/Scoring/allOrNothingCorrectPointsGreaterThanAlternativePoints.js +43 -0
- package/cypress/e2e/ILC/NumberLineLabel/Scoring/checkScoringLabelBannerAndCorrectAnswerSection.js +76 -0
- package/cypress/e2e/ILC/NumberLineLabel/additionalSettingsBasic.js +1 -1
- package/cypress/e2e/ILC/NumberLineLabel/checkAddAlternativeButton.js +34 -0
- package/cypress/e2e/ILC/NumberLineLabel/editTabSection.js +38 -0
- package/cypress/e2e/ILC/NumberLineLabel/headerSection.js +37 -5
- package/cypress/e2e/ILC/NumberLineLabel/manuallyAndNonScoredEditTab.js +2 -1
- package/cypress/e2e/ILC/NumberLineLabel/verticalNumberLine/editQuestion.smoke.js +1 -1
- package/cypress/e2e/ILC/ShortTextResponseNew/allOrNothingBasicForAllViews.smoke.js +186 -0
- package/cypress/e2e/ILC/ShortTextResponseNew/editTabBasicSections.js +35 -51
- package/cypress/e2e/ILC/ShortTextResponseNew/headerSection.js +2 -4
- package/cypress/e2e/ILC/SingleSelectionGridNew/editTabScoringSection.js +4 -1
- package/cypress/e2e/ILC/SingleSelectionGridNew/previewContentsForAllViews.smoke.js +101 -70
- package/cypress/e2e/ILC/TextEntryMath/MathTemplateScoring/allOrNothingAlternatePointsGreaterThanCorrectPoints.js +86 -0
- package/cypress/e2e/ILC/TextEntryMath/MathTemplateScoring/allOrNothingCorrectPointsEqualToAlternatePoints.js +86 -0
- package/cypress/e2e/ILC/TextEntryMath/MathTemplateScoring/allOrNothingCorrectPointsGreaterThanAlternatePoints.js +65 -0
- package/cypress/e2e/ILC/TextEntryMath/MathTemplateScoring/partialDifferentWeightsAlternativePointsGreaterThanCorrectPoints.js +3 -1
- package/cypress/e2e/ILC/TextEntryMath/MathTemplateScoring/partialDifferentWeightsCorrectPointsEqualToAlternativePoints.js +2 -0
- package/cypress/e2e/ILC/TextEntryMath/MathTemplateScoring/partialDifferentWeightsCorrectPointsGreaterThanAlternativePoints.js +2 -0
- package/cypress/e2e/ILC/TextEntryMath/MathTemplateScoring/partialDifferentWeightsScoringBasic.js +10 -3
- package/cypress/e2e/ILC/TextEntryMath/MathTemplateScoring/partialEqualWeightsAlternativePointsGreaterThanCorrectPoints.js +4 -2
- package/cypress/e2e/ILC/TextEntryMath/MathTemplateScoring/partialEqualWeightsCorrectPointsEqualToAlternativePoints.js +5 -3
- package/cypress/e2e/ILC/TextEntryMath/MathTemplateScoring/partialEqualWeightsCorrectPointsGreaterThanAlternativePoints.js +2 -0
- package/cypress/e2e/ILC/TextEntryMath/MathTemplateScoring/partialEqualWeightsScoringBasic.js +4 -0
- package/cypress/e2e/ILC/TextEntryMath/Scoring/allOrNothingAlternatePointsGreaterThanCorrectPoints.js +64 -0
- package/cypress/e2e/ILC/TextEntryMath/Scoring/allOrNothingBasicForAddEvaluation.js +2 -0
- package/cypress/e2e/ILC/TextEntryMath/Scoring/allOrNothingBasicForAlternateAnswer.js +2 -0
- package/cypress/e2e/ILC/TextEntryMath/Scoring/allOrNothingCorrectPointsEqualToAlternatePoints.js +64 -0
- package/cypress/e2e/ILC/TextEntryMath/Scoring/allOrNothingCorrectPointsGreaterThanAlternatePoints.js +65 -0
- package/cypress/e2e/ILC/TextEntryMath/Scoring/partialDifferentWeightsAlternativePointsGreaterThanCorrectPoints.js +2 -0
- package/cypress/e2e/ILC/TextEntryMath/Scoring/partialDifferentWeightsCorrectPointsEqualToAlternativePoints.js +2 -0
- package/cypress/e2e/ILC/TextEntryMath/Scoring/partialDifferentWeightsCorrectPointsGreaterThanAlternativePoints.js +2 -0
- package/cypress/e2e/ILC/TextEntryMath/Scoring/partialDifferentWeightsScoringBasic.js +8 -0
- package/cypress/e2e/ILC/TextEntryMath/Scoring/partialEqualWeightsAlternativePointsGreaterThanCorrectPoints.js +2 -0
- package/cypress/e2e/ILC/TextEntryMath/Scoring/partialEqualWeightsCorrectPointsEqualToAlternativePoints.js +2 -0
- package/cypress/e2e/ILC/TextEntryMath/Scoring/partialEqualWeightsCorrectPointsGreaterThanAlternativePoints.js +2 -0
- package/cypress/e2e/ILC/TextEntryMath/Scoring/partialEqualWeightsScoringBasic.js +1 -0
- package/cypress/e2e/ILC/TextEntryMath/Scoring/partialEqualWeightsScoringBasicForAlternateAnswer.js +2 -0
- package/cypress/e2e/ILC/TextEntryMath/allOrNothingBasicForAllViewsFormulaTemplate.smoke.js +2 -0
- package/cypress/e2e/ILC/TextEntryMath/editTabBasicSection.js +27 -3
- package/cypress/e2e/ILC/TextEntryMath/headerSection.js +43 -0
- package/cypress/e2e/ILC/TextSelection/ScoringParagraph/checkScoringLabelBannerAndCorrectAnswerSection.js +0 -1
- package/cypress/e2e/ILC/TextSelection/allOrNothingScoringForAllViews.smoke.js +231 -0
- package/cypress/e2e/ILC/TextSelection/textSelectionModesInSpecifyPossibleOptionsSection.js +7 -12
- package/cypress/e2e/ILC/ThinkSphere/createReviewItem.js +54 -1
- package/cypress/e2e/ILC/ThinkSphere/editTabBasicSection.js +53 -2
- package/cypress/e2e/ILC/ThinkSphere/editThinkSphereQuestion.smoke.js +145 -54
- package/cypress/e2e/ILC/ThinkSphere/equationEditorCreateCustomCategory.smoke.js +417 -0
- package/cypress/e2e/ILC/ThinkSphere/equationEditorEditCategoryFlyOut.js +291 -0
- package/cypress/e2e/ILC/ThinkSphere/gradingViewPlanTabSection.js +334 -0
- package/cypress/e2e/ILC/ThinkSphere/planPhase.js +91 -9
- package/cypress/e2e/ILC/ThinkSphere/previewTabPlanSection.js +12 -12
- package/cypress/e2e/ILC/ThinkSphere/previewTabReviewSection.js +97 -0
- package/cypress/e2e/ILC/ThinkSphere/solvePhase.js +35 -2
- package/cypress/e2e/ILC/ThinkSphere/studentViewPlanTabSection.js +393 -0
- package/cypress/e2e/ILC/ThinkSphere/studentViewReviewTabSection.js +141 -0
- package/cypress/e2e/ILC/ToolAudioPlayerNew/headerSection.js +90 -2
- package/cypress/e2e/ILC/UploadResponse/editTabBasicSection.js +34 -0
- package/cypress/e2e/ILC/UploadResponse/headerSection.js +38 -1
- package/cypress/e2e/ILC/UploadResponse/uploadResponsePreview.js +50 -13
- package/cypress/e2e/ILC/VideoResponseNew/editTabBasicSection.js +14 -29
- package/cypress/e2e/ILC/chartsDotsPlot/headerSection.js +16 -1
- package/cypress/e2e/ILC/chartsDotsPlot/scoring/partialDifferentWeightsBasic.js +27 -28
- package/cypress/e2e/ILC/chartsDotsPlot/scoring/partialDifferentWeightsWithAlternativePointsGreaterThanCorrectPoints.js +31 -30
- package/cypress/e2e/ILC/chartsDotsPlot/scoring/partialDifferentWeightsWithCorrectPointsEqualToAlternativePoints.js +24 -24
- package/cypress/e2e/ILC/chartsDotsPlot/scoring/partialDifferentWeightsWithCorrectPointsGreaterThanAlternativePoints.js +39 -37
- package/cypress/e2e/ILC/chartsDotsPlot/scoring/partialEqualWeightsBasic.js +22 -23
- package/cypress/e2e/ILC/chartsDotsPlot/scoring/partialEqualWeightsWithAlternativePointsGreaterThanCorrectPoints.js +31 -30
- package/cypress/e2e/ILC/chartsDotsPlot/scoring/partialEqualWeightsWithCorrectPointsEqualToAlternativePoints.js +25 -24
- package/cypress/e2e/ILC/chartsDotsPlot/scoring/partialEqualWeightsWithCorrectPointsGreaterThanAlternativePoints.js +31 -31
- package/cypress/e2e/ILC/chartsDotsPlot/scoring/toleranceThresholdScoring.js +18 -19
- package/cypress/e2e/ILC/chartsDotsPlot/specifyCorrectAnswerSection.js +96 -0
- package/cypress/e2e/Sessions/fetchResponses.js +6 -6
- package/cypress/e2e/Sessions/saveResponseScores.js +2 -2
- package/cypress/fixtures/theme/ilc.json +3 -1
- package/cypress/pages/audioPlayerPage.js +47 -22
- package/cypress/pages/brainingCampManipulativePage.js +1 -1
- package/cypress/pages/chartsBarPage.js +45 -0
- package/cypress/pages/chartsDotPlotPage.js +25 -0
- package/cypress/pages/chartsLinePage.js +28 -3
- package/cypress/pages/components/additionalSettingsPanel.js +1 -0
- package/cypress/pages/components/autoScoredSpecifyCorrectAnswerSection.js +5 -1
- package/cypress/pages/components/browseItemsPage.js +109 -2
- package/cypress/pages/components/chartsCommonComponent.js +6 -2
- package/cypress/pages/components/ckEditorEquationEditorComponent.js +5 -4
- package/cypress/pages/components/ckEditorInsertImageComponent.js +2 -2
- package/cypress/pages/components/ckEditorInsertTableComponent.js +3 -3
- package/cypress/pages/components/ckEditorLinkComponent.js +8 -9
- package/cypress/pages/components/colorPopupComponent.js +6 -0
- package/cypress/pages/components/commonComponents.js +4 -0
- package/cypress/pages/components/createQuestionBasePage.js +14 -1
- package/cypress/pages/components/defaultToolDropdown.js +1 -1
- package/cypress/pages/components/draggableOptionsSectionComponent.js +2 -0
- package/cypress/pages/components/editCategoryFlyout.js +2 -2
- package/cypress/pages/components/equationEditorSectionCommonComponent.js +10 -25
- package/cypress/pages/components/fillInTheGapsDropdownCommonComponent.js +28 -0
- package/cypress/pages/components/gridQuestionCommonComponent.js +55 -0
- package/cypress/pages/components/questionInstructionsComponent.js +2 -0
- package/cypress/pages/components/scoringSectionBaseEditTab.js +3 -0
- package/cypress/pages/contentBlocksPage.js +2 -0
- package/cypress/pages/desmos3DGraphingPage.js +149 -4
- package/cypress/pages/desmosGeometryPage.js +184 -4
- package/cypress/pages/drawingResponsePage.js +2 -0
- package/cypress/pages/graphingPage.js +27 -8
- package/cypress/pages/gridFillPage.js +15 -6
- package/cypress/pages/imageHighlightPage.js +32 -0
- package/cypress/pages/listOrderingPage.js +40 -1
- package/cypress/pages/matchingPage.js +26 -7
- package/cypress/pages/numberLineLabelPage.js +31 -8
- package/cypress/pages/numberLinePage.js +19 -7
- package/cypress/pages/textEntryMathPage.js +24 -1
- package/cypress/pages/thinkSpherePage.js +2877 -11
- package/cypress/pages/uploadResponsePage.js +17 -1
- package/cypress/pages/videoResponsePage.js +3 -0
- package/cypress/support/commands.js +9 -0
- package/cypress/support/helpers/createItem.js +22 -3
- package/cypress/support/helpers/utilities.js +14 -1
- package/package.json +2 -2
- /package/cypress/e2e/ILC/{ChartsDotsPlot → chartsDotsPlot}/checkAnswerFunctionalityForAllViews.js +0 -0
- /package/cypress/e2e/ILC/{ChartsDotsPlot → chartsDotsPlot}/editQuestion.smoke.js +0 -0
@@ -1,15 +1,19 @@
|
|
1
1
|
import utilities from "../support/helpers/utilities";
|
2
2
|
import { browseItemsPage } from "../pages/components/browseItemsPage";
|
3
|
+
import { editCategoryFlyout } from "../pages/components/editCategoryFlyout";
|
3
4
|
import { dialogBoxBase } from "../pages/dialogBoxBase";
|
4
|
-
import { backgroundImageUploadComponent, createQuestionBasePage, scoringSectionBaseEditTab, commonComponents, additionalSettingsPanel, additionalSettingsAccessibilitySectionComponent, toolSettingsComponent, questionInstructionsComponent, studentViewSettingsLabelComponent, defaultToolDropdown, essayResponseCommonComponents, equationEditorSectionCommonComponent, equationEditorFlyout } from "./components"
|
5
|
+
import { backgroundImageUploadComponent, createQuestionBasePage, scoringSectionBaseEditTab, commonComponents, additionalSettingsPanel, additionalSettingsAccessibilitySectionComponent, toolSettingsComponent, questionInstructionsComponent, studentViewSettingsLabelComponent, defaultToolDropdown, essayResponseCommonComponents, equationEditorSectionCommonComponent, equationEditorFlyout, createCustomCategoryFlyout } from "./components"
|
5
6
|
import { drawingResponsePage } from "./drawingResponsePage";
|
6
7
|
import { optionsWrapperComponent } from "../pages/components/optionsWrapperComponent";
|
7
8
|
import { selectQuestionResourceToolPage } from "./selectQuestionResourceToolPage";
|
8
9
|
import { videoResponsePage } from "./videoResponsePage";
|
9
10
|
import { singleSelectionPage } from "./singleSelectionPage";
|
11
|
+
import { essayResponsePage } from "./essayResponsePage";
|
12
|
+
import { equationEditorCategoriesAndSymbols } from "../fixtures/equationEditorCategoriesAndSymbols ";
|
10
13
|
const css = Cypress.env('css');
|
11
14
|
|
12
15
|
const selectors = {
|
16
|
+
...essayResponsePage,
|
13
17
|
...backgroundImageUploadComponent,
|
14
18
|
...questionInstructionsComponent,
|
15
19
|
...commonComponents,
|
@@ -24,6 +28,10 @@ const selectors = {
|
|
24
28
|
...browseItemsPage,
|
25
29
|
...videoResponsePage,
|
26
30
|
...dialogBoxBase,
|
31
|
+
...editCategoryFlyout,
|
32
|
+
...createCustomCategoryFlyout,
|
33
|
+
...createQuestionBasePage,
|
34
|
+
|
27
35
|
editQuestionPencil: () => cy.get('[class*="Widgetstyles__HeaderContainer"] button.icon-pencil'),
|
28
36
|
widgetHeaderQuestionTitle: () => cy.get('[class*="Widgetstyles__HeaderContainer"] [class*="Widgetstyles__QuestionTypeText"]'),
|
29
37
|
imageUploadSection: () => cy.get('[class*="TabsComponentstyles__ImageUploadComponentWrapper"]'),
|
@@ -72,7 +80,7 @@ const selectors = {
|
|
72
80
|
planStrategyListResetToDefault: () => cy.get('[class*="Planstyles__StrategiesWrapper"] [class*="Planstyles__DefaultResetWrapper"]'),
|
73
81
|
planStrategyAddItemButton: () => cy.get('[class*="Planstyles__StrategiesWrapper"] [class*="ListOptionsComponentstyles__AddItemWrapper"] [role="button"]'),
|
74
82
|
planStrategyCheckbox: () => cy.get('[class*="Planstyles__StrategiesWrapper"] .thinksphere-option-text-field-wrapper [data-ngie-testid*="-checkbox"]'),
|
75
|
-
videoLinkComponent: () => utilities.getNthElement(cy.get('[class*="ListOptionsComponentstyles__UploadVideoWrapper"]'),
|
83
|
+
videoLinkComponent: (nthElement = 0) => utilities.getNthElement(cy.get('[class*="ListOptionsComponentstyles__UploadVideoWrapper"]'), nthElement),
|
76
84
|
uploadVideoLinkButton: () => cy.get('[class*="ListOptionsComponentstyles__UploadVideoTextWrapper"]'),
|
77
85
|
planSentenceStarterSection: () => cy.get('[class*="Planstyles__SentenceFramesWrapper"]'),
|
78
86
|
planSentenceStarterListHeader: () => cy.get('[class*="Planstyles__SentenceFramesWrapper"] [class*="Planstyles__HeadingTextWrapper"]'),
|
@@ -90,7 +98,7 @@ const selectors = {
|
|
90
98
|
editVideoButton: () => cy.get('[aria-label*="Change video"]'),
|
91
99
|
deleteVideoButton: () => cy.get('[aria-label*="Delete video"]'),
|
92
100
|
listInputField: () => cy.get('.option-component textarea[placeholder]'),
|
93
|
-
deleteButton: () => cy.get('button[aria-label*="Delete"]'),
|
101
|
+
deleteButton: () => cy.get('button[aria-label*="Delete"].ngie-icon-btn-cls'),
|
94
102
|
optionNumeration: () => cy.get('[class*="MuiInputAdornment-positionStart"]'),
|
95
103
|
iconPencil: () => cy.get('div[class*="icon-pencil"]'),
|
96
104
|
iconXCircle: () => cy.get('div[class*="icon-x-circle"]'),
|
@@ -103,6 +111,7 @@ const selectors = {
|
|
103
111
|
addCheckMathQuestionButton: () => cy.get('.ngie-btn-typography').contains(`Add 'Check your math' question`),
|
104
112
|
firstAvailableItemLink: () => utilities.getNthElement(cy.get('.browse-item-styled-link'), 0),
|
105
113
|
saveButton: () => cy.get('.ngie-btn-typography').contains('save',{matchCase: false}),
|
114
|
+
cancelButton: () => cy.get('.ngie-btn-typography').contains('cancel',{matchCase: false}),
|
106
115
|
AddCheckMathQuestionHeader: () => cy.get('.browse-title-wrapper').contains(`Add 'Check your math' question`),
|
107
116
|
singleOptionTextFieldWrapper: () => cy.get('[class*="SingleOptionstyle__TextFieldWrapper"]'),
|
108
117
|
customizeStampComponent: () => cy.get('[class*="CustomizeStampstyles__CustomizeStampWrapper"]'),
|
@@ -127,7 +136,7 @@ const selectors = {
|
|
127
136
|
imageUploadSectionQuestionImageCrossIcon: () => thinkSpherePage.imageUploadSection().find('div[class*="QuestionImageComponentstyle__CrossIcon"]'),
|
128
137
|
imageRadioButtonParentSvg: () => thinkSpherePage.imageRadioButton().parent().find('svg'),
|
129
138
|
solvePhaseAccordionSvg: () => thinkSpherePage.solvePhaseAccordion().find('svg'),
|
130
|
-
|
139
|
+
customizeToolsAndControlsPath: () => thinkSpherePage.customizeToolsAndControls().find('path'),
|
131
140
|
solvePhaseToolsAndControlsOptionsTilesFeatherCheckIcon: () => thinkSpherePage.solveToolsAndControlsOptionsTiles('Text').find('[data-name="Icon feather-check"]'),
|
132
141
|
solvePhaseToolsAndControlsOptionsTilesRectangle: () => thinkSpherePage.solveToolsAndControlsOptionsTiles('Text').find('[data-name*="Rectangle"]'),
|
133
142
|
solvePhaseToolsAndControlsOptionsTilesDragItemFlexWrapperSvg: () => thinkSpherePage.solveToolsAndControlsOptionsTiles('Text').find('.drag-item-flex-wrapper svg'),
|
@@ -181,9 +190,42 @@ const selectors = {
|
|
181
190
|
gridItemsWrapper: (number) => cy.get('[class*="DragAndDropGridstyles__GridItemsWrapper"]').eq(number),
|
182
191
|
dragButton: (number) => cy.get('[type="button"]').eq(number),
|
183
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"]'),
|
184
225
|
};
|
185
226
|
|
186
227
|
const steps = {
|
228
|
+
...essayResponsePage.steps,
|
187
229
|
...backgroundImageUploadComponent.steps,
|
188
230
|
...questionInstructionsComponent.steps,
|
189
231
|
...scoringSectionBaseEditTab.steps,
|
@@ -200,6 +242,7 @@ const steps = {
|
|
200
242
|
...browseItemsPage.steps,
|
201
243
|
...videoResponsePage.steps,
|
202
244
|
...createQuestionBasePage.steps,
|
245
|
+
...createCustomCategoryFlyout.steps,
|
203
246
|
|
204
247
|
/**
|
205
248
|
* Navigates to the ThinkSphere create question page.
|
@@ -271,12 +314,24 @@ const steps = {
|
|
271
314
|
cy.wait('@setItem');
|
272
315
|
},
|
273
316
|
|
317
|
+
clickOnCancelButton: () => {
|
318
|
+
cy.interceptGraphql('setItem');
|
319
|
+
thinkSpherePage.cancelButton()
|
320
|
+
.click();
|
321
|
+
},
|
322
|
+
|
274
323
|
clickOnSwapButton: () => {
|
275
324
|
thinkSpherePage.ThinkSphereMathQuestionHeaderSwapIcon()
|
276
325
|
.click();
|
277
326
|
cy.wait(2000);
|
278
327
|
},
|
279
328
|
|
329
|
+
clickOnEditButton: () => {
|
330
|
+
thinkSpherePage.ThinkSphereMathQuestionHeaderPencilIcon()
|
331
|
+
.click();
|
332
|
+
cy.wait(2000);
|
333
|
+
},
|
334
|
+
|
280
335
|
clickOnDeleteButton: () => {
|
281
336
|
thinkSpherePage.thinkSphereMathQuestionHeaderDeleteIcon()
|
282
337
|
.click();
|
@@ -543,7 +598,8 @@ const steps = {
|
|
543
598
|
.click();
|
544
599
|
} else {
|
545
600
|
thinkSpherePage.planSentenceStarterAddItemButton()
|
546
|
-
.click()
|
601
|
+
.click()
|
602
|
+
.trigger('mouseout', { force: true });
|
547
603
|
}
|
548
604
|
},
|
549
605
|
|
@@ -574,14 +630,14 @@ const steps = {
|
|
574
630
|
.within(() => {
|
575
631
|
utilities.getNthElement(thinkSpherePage.listInputField(), optionCount)
|
576
632
|
.clear()
|
577
|
-
.type(text);
|
633
|
+
.type(text, { delay: 500 });
|
578
634
|
});
|
579
635
|
} else {
|
580
636
|
thinkSpherePage.planSentenceStarterSection()
|
581
637
|
.within(() => {
|
582
638
|
utilities.getNthElement(thinkSpherePage.listInputField(), optionCount)
|
583
639
|
.clear()
|
584
|
-
.type(text);
|
640
|
+
.type(text, { delay: 500 });
|
585
641
|
});
|
586
642
|
}
|
587
643
|
},
|
@@ -729,10 +785,11 @@ const steps = {
|
|
729
785
|
clickOnEditQuestionIcon: () => {
|
730
786
|
utilities.getNthElement(thinkSpherePage.editQuestionPencil(), 0)
|
731
787
|
.click();
|
788
|
+
cy.wait(1000);
|
732
789
|
},
|
733
790
|
|
734
791
|
clickOnQuestionInstructionExpandImageButton: () => {
|
735
|
-
thinkSpherePage.questionInstructionPreviewImageExpandButton()
|
792
|
+
utilities.getNthElement(thinkSpherePage.questionInstructionPreviewImageExpandButton(), 0)
|
736
793
|
.click();
|
737
794
|
},
|
738
795
|
|
@@ -855,9 +912,450 @@ const steps = {
|
|
855
912
|
verifyCustomizeStampSelectedUnselected: (selected, customizeStampPosition) => {
|
856
913
|
utilities.verifyElementAttribute(thinkSpherePage.customizeStampsButton(customizeStampPosition), 'aria-checked', selected ? 'true' : 'false');
|
857
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
|
+
},
|
858
1355
|
};
|
859
1356
|
|
860
1357
|
const tests = {
|
1358
|
+
...essayResponsePage.tests,
|
861
1359
|
...createQuestionBasePage.tests,
|
862
1360
|
...backgroundImageUploadComponent.tests,
|
863
1361
|
...questionInstructionsComponent.tests,
|
@@ -869,6 +1367,7 @@ const tests = {
|
|
869
1367
|
...studentViewSettingsLabelComponent.tests,
|
870
1368
|
...defaultToolDropdown.tests,
|
871
1369
|
...optionsWrapperComponent.tests,
|
1370
|
+
...equationEditorFlyout.tests,
|
872
1371
|
|
873
1372
|
/**
|
874
1373
|
* Verifies the ThinkSphere cancel button functionality.
|
@@ -1362,9 +1861,12 @@ const tests = {
|
|
1362
1861
|
it('When user clicks on \'Reset to default\' button then the sentence starter list should be reset to default', () => {
|
1363
1862
|
thinkSpherePage.planSentenceStarterListResetToDefault()
|
1364
1863
|
.click();
|
1365
|
-
|
1366
|
-
|
1367
|
-
|
1864
|
+
thinkSpherePage.planSentenceStarterSection()
|
1865
|
+
.within(() => {
|
1866
|
+
optionList.forEach((option, index) => {
|
1867
|
+
thinkSpherePage.steps.verifyOptionsContents(index, option, 'Enter sentence starter name');
|
1868
|
+
});
|
1869
|
+
})
|
1368
1870
|
});
|
1369
1871
|
}
|
1370
1872
|
},
|
@@ -1550,6 +2052,2370 @@ const tests = {
|
|
1550
2052
|
cy.checkAccessibility(thinkSpherePage.singleOptionTextFieldWrapper());
|
1551
2053
|
});
|
1552
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.saveAQuestionAndimport utilities from "../support/helpers/utilities";
|
2141
|
+
import { browseItemsPage } from "../pages/components/browseItemsPage";
|
2142
|
+
import { editCategoryFlyout } from "../pages/components/editCategoryFlyout";
|
2143
|
+
import { dialogBoxBase } from "../pages/dialogBoxBase";
|
2144
|
+
import { backgroundImageUploadComponent, createQuestionBasePage, scoringSectionBaseEditTab, commonComponents, additionalSettingsPanel, additionalSettingsAccessibilitySectionComponent, toolSettingsComponent, questionInstructionsComponent, studentViewSettingsLabelComponent, defaultToolDropdown, essayResponseCommonComponents, equationEditorSectionCommonComponent, equationEditorFlyout, createCustomCategoryFlyout } from "./components"
|
2145
|
+
import { drawingResponsePage } from "./drawingResponsePage";
|
2146
|
+
import { optionsWrapperComponent } from "../pages/components/optionsWrapperComponent";
|
2147
|
+
import { selectQuestionResourceToolPage } from "./selectQuestionResourceToolPage";
|
2148
|
+
import { videoResponsePage } from "./videoResponsePage";
|
2149
|
+
import { singleSelectionPage } from "./singleSelectionPage";
|
2150
|
+
import { essayResponsePage } from "./essayResponsePage";
|
2151
|
+
import { equationEditorCategoriesAndSymbols } from "../fixtures/equationEditorCategoriesAndSymbols ";
|
2152
|
+
const css = Cypress.env('css');
|
2153
|
+
|
2154
|
+
const selectors = {
|
2155
|
+
...essayResponsePage,
|
2156
|
+
...backgroundImageUploadComponent,
|
2157
|
+
...questionInstructionsComponent,
|
2158
|
+
...commonComponents,
|
2159
|
+
...scoringSectionBaseEditTab,
|
2160
|
+
...additionalSettingsPanel,
|
2161
|
+
...drawingResponsePage,
|
2162
|
+
...defaultToolDropdown,
|
2163
|
+
...optionsWrapperComponent,
|
2164
|
+
...essayResponseCommonComponents,
|
2165
|
+
...equationEditorSectionCommonComponent,
|
2166
|
+
...selectQuestionResourceToolPage,
|
2167
|
+
...browseItemsPage,
|
2168
|
+
...videoResponsePage,
|
2169
|
+
...dialogBoxBase,
|
2170
|
+
...editCategoryFlyout,
|
2171
|
+
...createCustomCategoryFlyout,
|
2172
|
+
...createQuestionBasePage,
|
2173
|
+
|
2174
|
+
editQuestionPencil: () => cy.get('[class*="Widgetstyles__HeaderContainer"] button.icon-pencil'),
|
2175
|
+
widgetHeaderQuestionTitle: () => cy.get('[class*="Widgetstyles__HeaderContainer"] [class*="Widgetstyles__QuestionTypeText"]'),
|
2176
|
+
imageUploadSection: () => cy.get('[class*="TabsComponentstyles__ImageUploadComponentWrapper"]'),
|
2177
|
+
addThinkSphereQuestionButton: () => cy.get('.ngie-btn-contained').contains('add ThinkSphere question'),
|
2178
|
+
whiteBoardCanvasAndControls: () => cy.get('[class*="WhiteboardPagesstyles__WhiteboardPagesWrapper"]'),
|
2179
|
+
whiteBoardImageProperties: () => cy.get('[class*="WhiteBoardImagePropertiesstyles__ImagePropertiesWrapper"]'),
|
2180
|
+
whiteBoardImagePropertiesInputTypeFile: () => cy.get('[class*="WhiteBoardImagePropertiesstyles__ImagePropertiesWrapper"] input[type="file"]'),
|
2181
|
+
topLeftButton: () => utilities.getNthElement(cy.get('button[class*="WhiteBoardImagePropertiesstyles__StyledButton"]'), 0),
|
2182
|
+
centerButton: () => utilities.getNthElement(cy.get('button[class*="WhiteBoardImagePropertiesstyles__StyledButton"]'), 1),
|
2183
|
+
topRightButton: () => utilities.getNthElement(cy.get('button[class*="WhiteBoardImagePropertiesstyles__StyledButton"]'), 2),
|
2184
|
+
opacityLabel: () => utilities.getNthElement(cy.get('h2[class*="WhiteBoardImagePropertiesstyles__LayoutLabel"]'), 1),
|
2185
|
+
imageAlternativeTextLabel: () => cy.get('div[class*="InlineTextFieldWithDebouncestyles__PropertyLabel"]'),
|
2186
|
+
imageAlternativeTextInputField: () => cy.get('input.text-field'),
|
2187
|
+
imageRadioButton: () => cy.get('div[data-value="image"]'),
|
2188
|
+
manageWhiteBoardTitle: () => cy.get('[class*="WhiteboardPagesstyles__HeadingLabel"]'),
|
2189
|
+
whiteBoardPreviousButton: () => cy.get('[class*="whiteboard-pagination-prev-button"]'),
|
2190
|
+
whiteBoardPageLabel: () => cy.get('[class*="WhiteboardPagesstyles__PageLabel"]'),
|
2191
|
+
whiteBoardPageCounter: () => cy.get('[class*="WhiteboardPagesstyles__PageCounter"]'),
|
2192
|
+
whiteBoardNextButton: () => cy.get('[class*="whiteboard-pagination-next-button"]'),
|
2193
|
+
whiteBoardDeleteButton: () => cy.get('[class*="whiteboard-delete-page-button"]'),
|
2194
|
+
whiteBoardAddNewPageButton: () => cy.get('[class*="whiteboard-add-new-page-button"]'),
|
2195
|
+
imageRadioInput: () => cy.get('div[data-value="image"] input[type="radio"]'),
|
2196
|
+
pageImageTitle: () => cy.get('div[class*="WhiteBoardImagePropertiesstyles__PageImageTitle"]'),
|
2197
|
+
radioGroupWrapper: () => cy.get('div[class*="ngie-radio-group-wrapper"]'),
|
2198
|
+
blankCanvasRadioInput: () => cy.get('div[data-value="blankCanvas"] input[type="radio"]'),
|
2199
|
+
imageUploadSectionWrapper: () => cy.get('div[class*="UploadImagestyles__BackgroundImageWrapper"]'),
|
2200
|
+
pageImagePropertiesTitle: () => cy.get('div[class*="WhiteBoardImagePropertiesstyles__PageImagePropertiesTitle"]'),
|
2201
|
+
layoutLabel: () => cy.get('h2[class*="WhiteBoardImagePropertiesstyles__LayoutLabel"]'),
|
2202
|
+
alignmentOptions: () => cy.get('ul[class*="WhiteBoardImagePropertiesstyles__AlignmentOptions"]'),
|
2203
|
+
solvePhaseAccordion: () => utilities.getNthElement(cy.get('[class*="Solvestyles__SolvePhaseAccordionWrapper"] .ngie-accordion-summary'), 0),
|
2204
|
+
solvePhaseAccordionLabel: () => utilities.getNthElement(cy.get('.thinksphere-author-phases-accordion [class*="Solvestyles__HeadingLabel"]'), 0),
|
2205
|
+
solvePhaseAccordionExpandIcon: () => utilities.getNthElement(cy.get('.thinksphere-author-phases-accordion [class*="expandIconWrapper"]'), 0),
|
2206
|
+
solveToolsAndControlsOptionsTiles: (formattingOption) => cy.get(`.icon-button-custom-format[aria-label*="${formattingOption}"]`),
|
2207
|
+
solvePhaseAccordionContentWrapper: () => cy.get('.thinksphere-author-phases-accordion [class*="Solvestyles__ContentWrapper"]'),
|
2208
|
+
customizeToolsAndControls: () => cy.get('.thinksphere-author-phases-accordion .customize-tools-and-controls-wrapper .ngie-accordion-summary'),
|
2209
|
+
customizeToolsAndControlsIcon: () => cy.get('.thinksphere-author-phases-accordion .customize-tools-and-controls-wrapper [class*="expandIconWrapper"]'),
|
2210
|
+
customizeToolsAndControlsLabel: () => cy.get('.thinksphere-author-phases-accordion .customize-tools-and-controls-wrapper [class*="Solvestyles__HeadingLabel"]'),
|
2211
|
+
phasesSection: () => cy.get('[class*="Phasesstyles__PhasesWrapper"]'),
|
2212
|
+
phasesSectionTitle: () => cy.get('[class*="Phasesstyles__PhasesTextWrapper"]'),
|
2213
|
+
planPhaseSection: () => cy.get('[class*="Planstyles__PlanAccordianWrapper"]'),
|
2214
|
+
planPhaseAccordian: () => cy.get('[class*="Planstyles__PlanAccordianWrapper"] [class~="MuiAccordionSummary-root"]'),
|
2215
|
+
planPhaseAccordianLabel: () => cy.get('[class*="Planstyles__AccordionLabel"]'),
|
2216
|
+
planPhaseSectionDescription: () => cy.get('[class*="Planstyles__PlanAccordianWrapper"] [class*="Planstyles__PlanDescriptionTextWrapper"]'),
|
2217
|
+
planStrategySection: () => cy.get('[class*="Planstyles__StrategiesWrapper"]'),
|
2218
|
+
planStrategyListHeader: () => cy.get('[class*="Planstyles__StrategiesWrapper"] [class*="Planstyles__HeadingTextWrapper"]'),
|
2219
|
+
planStrategyListResetToDefault: () => cy.get('[class*="Planstyles__StrategiesWrapper"] [class*="Planstyles__DefaultResetWrapper"]'),
|
2220
|
+
planStrategyAddItemButton: () => cy.get('[class*="Planstyles__StrategiesWrapper"] [class*="ListOptionsComponentstyles__AddItemWrapper"] [role="button"]'),
|
2221
|
+
planStrategyCheckbox: () => cy.get('[class*="Planstyles__StrategiesWrapper"] .thinksphere-option-text-field-wrapper [data-ngie-testid*="-checkbox"]'),
|
2222
|
+
videoLinkComponent: (nthElement = 0) => utilities.getNthElement(cy.get('[class*="ListOptionsComponentstyles__UploadVideoWrapper"]'), nthElement),
|
2223
|
+
uploadVideoLinkButton: () => cy.get('[class*="ListOptionsComponentstyles__UploadVideoTextWrapper"]'),
|
2224
|
+
planSentenceStarterSection: () => cy.get('[class*="Planstyles__SentenceFramesWrapper"]'),
|
2225
|
+
planSentenceStarterListHeader: () => cy.get('[class*="Planstyles__SentenceFramesWrapper"] [class*="Planstyles__HeadingTextWrapper"]'),
|
2226
|
+
planSentenceStarterListResetToDefault: () => cy.get('[class*="Planstyles__SentenceFramesWrapper"] [class*="Planstyles__DefaultResetWrapper"]'),
|
2227
|
+
planSentenceStarterAddItemButton: () => cy.get('[class*="Planstyles__SentenceFramesWrapper"] [class*="ListOptionsComponentstyles__AddItemWrapper"] [role="button"]'),
|
2228
|
+
planSentenceStarterCheckbox : () => cy.get('[class*="Planstyles__SentenceFramesWrapper"] .thinksphere-option-text-field-wrapper [data-ngie-testid*="-checkbox"]'),
|
2229
|
+
solvePhaseAccordian: () => cy.get('[class*="Planstyles__SolveAccordianWrapper"] [class~="MuiAccordionSummary-root"] [role="button"]'),
|
2230
|
+
solvePhaseAccordianLabel: () => cy.get('[class*="Solvestyles__AccordionLabel"]'),
|
2231
|
+
inputTypeVideoFile: () => cy.get('[class*="Planstyles__StrategiesWrapper"] input[type="file"]'),
|
2232
|
+
inputTypeFile: () => cy.get('[class*="TabsComponentstyles__ImageUploadComponentWrapper"] input[type="file"]'),
|
2233
|
+
whiteBoardInputTypeFile: () => cy.get('[class*="UploadImagestyles__UploadWrapper"] input[type="file"]'),
|
2234
|
+
warningPopupTitle: () => cy.get('.dialog-title-wrapper'),
|
2235
|
+
warningPopupContentText: () => cy.get('.upload-question-preview-popup-error-msg'),
|
2236
|
+
warningPopupOkButton: () => cy.get('.upload-question-preview-popup-ok-btn'),
|
2237
|
+
editVideoButton: () => cy.get('[aria-label*="Change video"]'),
|
2238
|
+
deleteVideoButton: () => cy.get('[aria-label*="Delete video"]'),
|
2239
|
+
listInputField: () => cy.get('.option-component textarea[placeholder]'),
|
2240
|
+
deleteButton: () => cy.get('button[aria-label*="Delete"].ngie-icon-btn-cls'),
|
2241
|
+
optionNumeration: () => cy.get('[class*="MuiInputAdornment-positionStart"]'),
|
2242
|
+
iconPencil: () => cy.get('div[class*="icon-pencil"]'),
|
2243
|
+
iconXCircle: () => cy.get('div[class*="icon-x-circle"]'),
|
2244
|
+
dragIcon: () => cy.get('[class*="drag-icon-edit"]'),
|
2245
|
+
moreOptionsIcon: () => cy.get('[class*="more-options-icon"]'),
|
2246
|
+
ThinkSphereQuestionHeaderPencilIcon: () => utilities.getNthElement(cy.get('[class*="Widgetstyles__HeaderContainer"] [class*="icon-pencil"]'), 0),
|
2247
|
+
ThinkSphereMathQuestionHeaderSwapIcon: () => cy.get('[class*="Widgetstyles__HeaderContainer"] [class*="icon-swap"]'),
|
2248
|
+
ThinkSphereMathQuestionHeaderPencilIcon: () => utilities.getNthElement(cy.get('[class*="Widgetstyles__HeaderContainer"] [class*="icon-pencil"]'), 1),
|
2249
|
+
thinkSphereMathQuestionHeaderDeleteIcon: () => cy.get('[class*="Widgetstyles__HeaderContainer"] [class*="icon-Delete"]'),
|
2250
|
+
addCheckMathQuestionButton: () => cy.get('.ngie-btn-typography').contains(`Add 'Check your math' question`),
|
2251
|
+
firstAvailableItemLink: () => utilities.getNthElement(cy.get('.browse-item-styled-link'), 0),
|
2252
|
+
saveButton: () => cy.get('.ngie-btn-typography').contains('save',{matchCase: false}),
|
2253
|
+
cancelButton: () => cy.get('.ngie-btn-typography').contains('cancel',{matchCase: false}),
|
2254
|
+
AddCheckMathQuestionHeader: () => cy.get('.browse-title-wrapper').contains(`Add 'Check your math' question`),
|
2255
|
+
singleOptionTextFieldWrapper: () => cy.get('[class*="SingleOptionstyle__TextFieldWrapper"]'),
|
2256
|
+
customizeStampComponent: () => cy.get('[class*="CustomizeStampstyles__CustomizeStampWrapper"]'),
|
2257
|
+
customizeStampHeading: () => cy.get('[class*="CustomizeStampstyles__CustomizeStampHeading"]'),
|
2258
|
+
customizeStampCard: (ariaLabel, checked) => cy.get(`[class*="CustomizeStampstyles__StampCard"]${ariaLabel ? ('[aria-label="' + ariaLabel + '"]') : ''}${checked ? ('[aria-checked="' + checked + '"]') : ''}`),
|
2259
|
+
customizeStampCardImg: (ariaLabel) => cy.get('[class*="CustomizeStampstyles__QuestionImage"]'),
|
2260
|
+
questionImage: () => cy.get('img[class*="QuestionImageComponentstyle__QuestionImage"]'),
|
2261
|
+
stampsToolButton: () => cy.get('#stamps button[aria-label*="Stamps"]'),
|
2262
|
+
imageUploadSectionImageLabel: () => thinkSpherePage.imageUploadSection().find('div[class*="edit-question-image-label"]'),
|
2263
|
+
imageUploadSectionUploadFileContent: () => thinkSpherePage.imageUploadSection().find('div[class*="upload-file-content"]'),
|
2264
|
+
imageUploadSectionUploadCloudIconWrapper: () => thinkSpherePage.imageUploadSection().find('div[class*="upload-question-upload-cloud-icon-wrapper"]'),
|
2265
|
+
imageUploadSectionDragDropFileText: () => thinkSpherePage.imageUploadSection().find('span[class*="drag-and-drop-file-text"]'),
|
2266
|
+
imageUploadSectionFileInputLabel: () => thinkSpherePage.imageUploadSection().find('div[class*="file-input-label"]'),
|
2267
|
+
imageUploadSectionDeviceIcon: () => thinkSpherePage.imageUploadSection().find('span[class*="icon-Device"]'),
|
2268
|
+
imageUploadSectionSupportedFileText: () => thinkSpherePage.imageUploadSection().find('span[class*="supported-file-text"]'),
|
2269
|
+
imageUploadSectionSupportedFileIconWrapper: () => thinkSpherePage.imageUploadSection().find('div[class*="supported-file-icon-wrapper"]'),
|
2270
|
+
imageUploadSectionMaximumFileSize: () => thinkSpherePage.imageUploadSection().find('div[class*="maximum-file-size"]'),
|
2271
|
+
imageUploadSectionFileUploaderWrapper: () => thinkSpherePage.imageUploadSection().find('div[class*="QuestionImageComponentstyle__FileUploaderWrapper"]'),
|
2272
|
+
imageUploadSectionQuestionImage: () => thinkSpherePage.imageUploadSection().find('div[class*="QuestionImageComponentstyle__QuestionImage"]'),
|
2273
|
+
imageUploadSectionQuestionImageContainer: () => thinkSpherePage.imageUploadSection().find('div[class*="QuestionImageComponentstyle__QuestionImageContainer"]'),
|
2274
|
+
imageUploadSectionQuestionImageEditIcon: () => thinkSpherePage.imageUploadSection().find('div[class*="QuestionImageComponentstyle__EditIcon"]'),
|
2275
|
+
imageUploadSectionQuestionImageCrossIcon: () => thinkSpherePage.imageUploadSection().find('div[class*="QuestionImageComponentstyle__CrossIcon"]'),
|
2276
|
+
imageRadioButtonParentSvg: () => thinkSpherePage.imageRadioButton().parent().find('svg'),
|
2277
|
+
solvePhaseAccordionSvg: () => thinkSpherePage.solvePhaseAccordion().find('svg'),
|
2278
|
+
customizeToolsAndControlsPath: () => thinkSpherePage.customizeToolsAndControls().find('path'),
|
2279
|
+
solvePhaseToolsAndControlsOptionsTilesFeatherCheckIcon: () => thinkSpherePage.solveToolsAndControlsOptionsTiles('Text').find('[data-name="Icon feather-check"]'),
|
2280
|
+
solvePhaseToolsAndControlsOptionsTilesRectangle: () => thinkSpherePage.solveToolsAndControlsOptionsTiles('Text').find('[data-name*="Rectangle"]'),
|
2281
|
+
solvePhaseToolsAndControlsOptionsTilesDragItemFlexWrapperSvg: () => thinkSpherePage.solveToolsAndControlsOptionsTiles('Text').find('.drag-item-flex-wrapper svg'),
|
2282
|
+
solvePhaseToolsAndControlsOptionsTilesTextDragIconSvgPath: () => thinkSpherePage.solveToolsAndControlsOptionsTiles('Text').find('.drag-icon-button-custom-format svg path'),
|
2283
|
+
solvePhaseToolsAndControlsOptionsTilesArrayDragIconSvgPath: () => thinkSpherePage.solveToolsAndControlsOptionsTiles('Array').find('.drag-icon-button-custom-format svg path'),
|
2284
|
+
playerTimer: () => cy.get('[class*="VideoPlayerstyles__PlayerTimerWrapper"]'),
|
2285
|
+
strategiesPreviewHeader: () => cy.get('[class*="StrategiesPreviewstyles__HeadingWrapper"]'),
|
2286
|
+
addNewStrategyButton: () => cy.get('[class*="StrategiesPreviewstyles__AddStrategyButton"]'),
|
2287
|
+
strategiesInputBoxEditTab: () => cy.get('.video-upload-support-wrapper .edit-mcq-option-wrapper'),
|
2288
|
+
strategiesBoxPreviewTab: () => cy.get('[class*="StrategiesPreviewstyles__ListWrapper"]'),
|
2289
|
+
popupTitle: () => cy.get('[class*="dialog-title-wrapper"]'),
|
2290
|
+
strategyNameLabel: () => cy.get('[class*="ThinkSpherePreviewstyles__StrategyNameTextWrapper"]'),
|
2291
|
+
strategyNameInputField: () => cy.get('[class*="new-strategy-name-field"]'),
|
2292
|
+
addStrategyPopupCancelButton: () =>
|
2293
|
+
cy.get('.dialog-content').contains('Cancel'),
|
2294
|
+
addStrategyPopupSaveButton: () =>
|
2295
|
+
cy.get('.dialog-content').contains('Save'),
|
2296
|
+
// preview tab plan section selection
|
2297
|
+
questionInstructionPreviewTexWrapper: () => cy.get('.question-instruction.question-text-wrapper'),
|
2298
|
+
questionInstructionPreviewImageWrapper: () => cy.get('[class*="ThinkSpherePreviewstyles__ImageWrapper"]'),
|
2299
|
+
questionInstructionPreviewImageExpandButton: () => cy.get('[class*="ThinkSpherePreviewstyles__ExpandImageIconWrapper"]'),
|
2300
|
+
questionInstructionImagePopup: () => cy.get('[class*="QuestionTextstyle__ImagePopupDiv"]'),
|
2301
|
+
closeExpandImagePopupButton: () => cy.get('.close-popup-btn'),
|
2302
|
+
PlanningPreviewWrapper : () => cy.get('[class*="PlanningPreviewstyles__PlanningPreviewWrapper"]'),
|
2303
|
+
planningPreviewHeading: () => cy.get('[class*="PlanningPreviewstyles__HeadingWrapper"]'),
|
2304
|
+
planningWriteWrapper : () => cy.get('[class*="PlanningPreviewstyles__WriteWrapper"]'),
|
2305
|
+
problemAskingWrapper: () => cy.get('[class*="PlanningPreviewstyles__ProblemAskingWrapper"]'),
|
2306
|
+
contentEditableDiv: () => cy.get('[class*="PlanningPreviewstyles__ContentEditableDiv"]'),
|
2307
|
+
micIconWrapper: () => cy.get('[class*="PlanningPreviewstyles__MicIconWrapper"]'),
|
2308
|
+
strategiesToPlanWrapper: () => cy.get('[class*="PlanningPreviewstyles__StrategiesToPlanWrapper"]'),
|
2309
|
+
subheadingWrapper: () => cy.get('[class*="PlanningPreviewstyles__SubHeadingWrapper"]'),
|
2310
|
+
writePlanWrapper: () => cy.get('[class*="PlanningPreviewstyles__WritePlanWrapper"]'),
|
2311
|
+
strategyChipWrapper: () => cy.get('[class*="PlanningPreviewstyles__StrategyChipWrapper"]'),
|
2312
|
+
strategyChip: () => cy.get('[class*="PlanningPreviewstyles__StrategyChip-"]'),
|
2313
|
+
strategiesPreviewListLI: () => cy.get('[class*="StrategiesPreviewstyles__ListLI"]'),
|
2314
|
+
chooseStarterLabel: () => cy.get('[class*="ThinkSpherePreviewstyles__DropDownLabel"]'),
|
2315
|
+
chooseStarterDropdown: () => cy.get('[class*="drop-down-parent"]'),
|
2316
|
+
chooseStarterTextIconWrapper: () => cy.get('[class*="DropDownstyles__StarterTextIconWrapper"]'),
|
2317
|
+
chooseStartersListOptions: () => cy.get('.ngie-popover-container.dropdown-list-container li[role="option"]'),
|
2318
|
+
chooseStartersListOptionLabels: () => cy.get('.ngie-popover-container.dropdown-list-container li[role="option"] .dropdown-label-text'),
|
2319
|
+
starterTextWrapper: () => cy.get('.starter-text-wrapper'),
|
2320
|
+
starterIocn: () => cy.get('[class*="DropDownstyles__StarterIconWrapper"]'),
|
2321
|
+
addNewStrategyTextWrapper: () => cy.get('[class*="StrategiesPreviewstyles__AddStrategyTextWrapper"]'),
|
2322
|
+
strategyTextWrapper: () => cy.get('[class*="StrategiesPreviewstyles__StrategyTextWrapper"]'),
|
2323
|
+
videoIconWrapper: () => cy.get('[class*="StrategiesPreviewstyles__VideoIconWrapper"]'),
|
2324
|
+
whiteBoardCanvas: () => cy.get('[class*="WhiteboardPagesstyles__Canvas"]'),
|
2325
|
+
whiteBoardImage: () => cy.get('[class*="WhiteboardPagesstyles__BackgroundImage"]'),
|
2326
|
+
videoPopupTitle: () => cy.get('[class*="dialog-title-wrapper"]'),
|
2327
|
+
videoPopupCloseButton: () => cy.get('[class*="dialog-close-button"]'),
|
2328
|
+
videoPreviewPopup: () => cy.get('[class*="video-preview-popup"]'),
|
2329
|
+
gridItemsWrapper: (number) => cy.get('[class*="DragAndDropGridstyles__GridItemsWrapper"]').eq(number),
|
2330
|
+
dragButton: (number) => cy.get('[type="button"]').eq(number),
|
2331
|
+
customizeStampsButton: (customizeStampPosition) => cy.get(`button[aria-label="Stamp ${customizeStampPosition}"]`),
|
2332
|
+
buttonSave: () => cy.get('.action-btn-wrapper button').eq(1),
|
2333
|
+
buttonCancel: () => cy.get('.action-btn-wrapper button').eq(0),
|
2334
|
+
nextGenThinkSphereCreateItemWrapper: () => cy.get('#nextgen-thinkshpere-create-item'),
|
2335
|
+
equationEditorSectionTitle: () => cy.get('.equation-editor-text-title'),
|
2336
|
+
referenceIdWrapper: () => cy.get('.edit-item-reference-id-wrapper'),
|
2337
|
+
editBoxWrapper: () => cy.get('.edit-box-wrapper'),
|
2338
|
+
editBoxText: () => cy.get('.edit-box-text'),
|
2339
|
+
editBoxTextInput: () => thinkSpherePage.editBoxWrapper().find('input'),
|
2340
|
+
editIconPencil: () => cy.get('.icon-pencil'),
|
2341
|
+
thinkSphereQuestionHeader: () => cy.get('.edit-question-header-title'),
|
2342
|
+
filterSectionQuestionTypesAccordion: () => cy.get('.filter-section-expansion-panel-summary-root'),
|
2343
|
+
filterSectionQuestionAccordion: () => cy.get('.expansion-item-expansion-panel-summary-content'),
|
2344
|
+
checkBox: () => cy.get('.MuiCheckbox-root'),
|
2345
|
+
browseItemQuestionItem: () => cy.get('.browse-item-question-item'),
|
2346
|
+
ErrorMessageContainer: () => cy.get('.ErrorMessageContainer'),
|
2347
|
+
categoriesDropDown: () => cy.get('.dropdown-form-control[label="Categories"]'),
|
2348
|
+
categoriesDropDownLabelText: () => cy.get('.dropdown-label-text'),
|
2349
|
+
categoriesDropDownMenuItem: () => cy.get('.dropdown-menu-item .dropdown-label-text'),
|
2350
|
+
categoriesDropDownParent: () => cy.get('.drop-down-parent'),
|
2351
|
+
cardWrapper: () => cy.get('.card-wrapper'),
|
2352
|
+
cardLabel: () => cy.get('.widget-card-label'),
|
2353
|
+
thinkSphereQuestionInstructionCKEditor: () => cy.get('div.cke_editable[contenteditable="true"]'),
|
2354
|
+
reviewTab: () => cy.get('div[aria-label="Review tab"]'),
|
2355
|
+
planTab: () => cy.get('div[aria-label="Plan tab"]'),
|
2356
|
+
checkYourMathHeading: () => utilities.getNthElement(cy.get('div[class*="ReviewTabstyles__CheckYourMathTextWrapper"]'), 0),
|
2357
|
+
problemAskingToMeTextWrapper: () => utilities.getNthElement(cy.get('div[class*="ReviewTabstyles__ProblemAskingToMeTextWrapper"]'), 0),
|
2358
|
+
reviewQuestionWrapper: () => utilities.getNthElement(cy.get('div[class*="ReviewTabstyles__QuestionWrapper"]'), 0),
|
2359
|
+
reviewComponentWrapper: () => utilities.getNthElement(cy.get('div[class*="ReviewTabstyles__ComponentWrapper"]'), 0),
|
2360
|
+
problemStatementWrapper: () => utilities.getNthElement(cy.get('div[class*="ReviewTabstyles__ProblemStatementWrapper"]'), 0),
|
2361
|
+
gradingViewRadioButton: () => cy.get('label[aria-label="Grading View"]'),
|
2362
|
+
studentViewRadioButton: () => cy.get('label[aria-label="Student View"]'),
|
2363
|
+
correctAnswerLabelWrapper: () => cy.get('div[class*="CorrectAnswerLabelWrapper"]'),
|
2364
|
+
submitButton: () => cy.get('button[aria-label="Submit"]'),
|
2365
|
+
goToGradingViewButton: () => cy.contains('button', 'GO TO GRADING VIEW'),
|
2366
|
+
};
|
2367
|
+
|
2368
|
+
const steps = {
|
2369
|
+
...essayResponsePage.steps,
|
2370
|
+
...backgroundImageUploadComponent.steps,
|
2371
|
+
...questionInstructionsComponent.steps,
|
2372
|
+
...scoringSectionBaseEditTab.steps,
|
2373
|
+
...commonComponents.steps,
|
2374
|
+
...additionalSettingsPanel.steps,
|
2375
|
+
...toolSettingsComponent.steps,
|
2376
|
+
...studentViewSettingsLabelComponent.tests,
|
2377
|
+
...defaultToolDropdown.steps,
|
2378
|
+
...optionsWrapperComponent.steps,
|
2379
|
+
...essayResponseCommonComponents.steps,
|
2380
|
+
...equationEditorFlyout.steps,
|
2381
|
+
...equationEditorSectionCommonComponent.steps,
|
2382
|
+
...selectQuestionResourceToolPage.steps,
|
2383
|
+
...browseItemsPage.steps,
|
2384
|
+
...videoResponsePage.steps,
|
2385
|
+
...createQuestionBasePage.steps,
|
2386
|
+
...createCustomCategoryFlyout.steps,
|
2387
|
+
|
2388
|
+
/**
|
2389
|
+
* Navigates to the ThinkSphere create question page.
|
2390
|
+
* @param {string} questionType - The type of question to create.
|
2391
|
+
*/
|
2392
|
+
navigateToThinkSphereCreateQuestion: (questionType) => {
|
2393
|
+
cy.visit('/item-engine/thinksphere/create-item');
|
2394
|
+
thinkSpherePage.steps.addThinkSphereQuestion();
|
2395
|
+
},
|
2396
|
+
|
2397
|
+
addThinkSphereQuestion: () => {
|
2398
|
+
thinkSpherePage.addThinkSphereQuestionButton()
|
2399
|
+
.click();
|
2400
|
+
},
|
2401
|
+
|
2402
|
+
/**
|
2403
|
+
* Verifies if the accordion is collapsed.
|
2404
|
+
* @param {string} accordian - The accordion to verify ('plan' or 'solve').
|
2405
|
+
* @param {boolean} isCollapsed - Whether the accordion should be collapsed.
|
2406
|
+
*/
|
2407
|
+
verifyAccordianCollapsed: (accordian, isCollapsed) => {
|
2408
|
+
if (accordian === 'plan') {
|
2409
|
+
thinkSpherePage.planPhaseAccordian()
|
2410
|
+
.should('have.attr', 'aria-expanded', isCollapsed ? 'false' : 'true');
|
2411
|
+
} else if (accordian === 'solve') {
|
2412
|
+
thinkSpherePage.solvePhaseAccordian()
|
2413
|
+
.should('have.attr', 'aria-expanded', isCollapsed ? 'false' : 'true');
|
2414
|
+
}
|
2415
|
+
},
|
2416
|
+
|
2417
|
+
/**
|
2418
|
+
* Clicks on the specified accordion.
|
2419
|
+
* @param {string} accordian - The accordion to click ('plan' or 'solve').
|
2420
|
+
*/
|
2421
|
+
clickOnAccordian: (accordian) => {
|
2422
|
+
if (accordian === 'plan') {
|
2423
|
+
thinkSpherePage.planPhaseAccordian()
|
2424
|
+
.click();
|
2425
|
+
} else if (accordian === 'solve') {
|
2426
|
+
thinkSpherePage.solvePhaseAccordian()
|
2427
|
+
.click();
|
2428
|
+
}
|
2429
|
+
cy.wait(500);
|
2430
|
+
},
|
2431
|
+
|
2432
|
+
clickOnEditThinkSphereItem: () => {
|
2433
|
+
browseItemsPage.steps.clickOnItemReferenceId('~zzz item name');
|
2434
|
+
utilities.getNthElement(thinkSpherePage.editQuestionPencil(), 0)
|
2435
|
+
.click();
|
2436
|
+
cy.barsPreLoaderWait();
|
2437
|
+
},
|
2438
|
+
|
2439
|
+
clickOnAddCheckMathQuestionButton: () => {
|
2440
|
+
thinkSpherePage.addCheckMathQuestionButton()
|
2441
|
+
.click();
|
2442
|
+
cy.interceptGraphql('getItems');
|
2443
|
+
},
|
2444
|
+
|
2445
|
+
clickOnFirstAvailableItemLink: () => {
|
2446
|
+
thinkSpherePage.firstAvailableItemLink()
|
2447
|
+
.click();
|
2448
|
+
cy.interceptGraphql('getItems');
|
2449
|
+
},
|
2450
|
+
|
2451
|
+
clickOnSaveButton: () => {
|
2452
|
+
cy.interceptGraphql('setItem');
|
2453
|
+
thinkSpherePage.saveButton()
|
2454
|
+
.click();
|
2455
|
+
cy.wait('@setItem');
|
2456
|
+
},
|
2457
|
+
|
2458
|
+
clickOnCancelButton: () => {
|
2459
|
+
cy.interceptGraphql('setItem');
|
2460
|
+
thinkSpherePage.cancelButton()
|
2461
|
+
.click();
|
2462
|
+
},
|
2463
|
+
|
2464
|
+
clickOnSwapButton: () => {
|
2465
|
+
thinkSpherePage.ThinkSphereMathQuestionHeaderSwapIcon()
|
2466
|
+
.click();
|
2467
|
+
cy.wait(2000);
|
2468
|
+
},
|
2469
|
+
|
2470
|
+
clickOnEditButton: () => {
|
2471
|
+
thinkSpherePage.ThinkSphereMathQuestionHeaderPencilIcon()
|
2472
|
+
.click();
|
2473
|
+
cy.wait(2000);
|
2474
|
+
},
|
2475
|
+
|
2476
|
+
clickOnDeleteButton: () => {
|
2477
|
+
thinkSpherePage.thinkSphereMathQuestionHeaderDeleteIcon()
|
2478
|
+
.click();
|
2479
|
+
cy.wait(2000);
|
2480
|
+
},
|
2481
|
+
|
2482
|
+
/**
|
2483
|
+
* Verifies the question title.
|
2484
|
+
* @param {string} questionType - The type of question to verify.
|
2485
|
+
*/
|
2486
|
+
verifyQuestionTitle: (questionType) => {
|
2487
|
+
utilities.verifyInnerText(utilities.getNthElement(thinkSpherePage.widgetHeaderQuestionTitle(), 0), questionType);
|
2488
|
+
},
|
2489
|
+
|
2490
|
+
verifyPlanSectionAccessibility: () => {
|
2491
|
+
thinkSpherePage.planPhaseSection().find('div[class~="MuiAccordionSummary-root"]')
|
2492
|
+
.should('have.attr', 'aria-expanded', 'true')
|
2493
|
+
.should('have.attr', 'role', 'button')
|
2494
|
+
.should('have.attr', 'tabindex', '0');
|
2495
|
+
},
|
2496
|
+
|
2497
|
+
/**
|
2498
|
+
* Uploads a file.
|
2499
|
+
* @param {string} file - The file to upload.
|
2500
|
+
*/
|
2501
|
+
uploadFile: (file) => {
|
2502
|
+
thinkSpherePage.inputTypeFile()
|
2503
|
+
.attachFile(file);
|
2504
|
+
cy.wait(4000);
|
2505
|
+
},
|
2506
|
+
|
2507
|
+
uploadWhiteBoardImage: (file) => {
|
2508
|
+
thinkSpherePage.whiteBoardInputTypeFile()
|
2509
|
+
.attachFile(file);
|
2510
|
+
cy.wait(4000);
|
2511
|
+
},
|
2512
|
+
|
2513
|
+
/**
|
2514
|
+
* Uploads a video file.
|
2515
|
+
* @param {string} file - The file to upload.
|
2516
|
+
*/
|
2517
|
+
uploadVideoFile: (file) => {
|
2518
|
+
const fileName = file.split('/').pop(); // Extracts only 'sample.mp4'
|
2519
|
+
|
2520
|
+
cy.fixture(file, 'binary') // Read the file as binary
|
2521
|
+
.then(Cypress.Blob.binaryStringToBlob)
|
2522
|
+
.then((blob) => {
|
2523
|
+
const fileObj = new File([blob], fileName, { type: 'video/mp4' });
|
2524
|
+
const dataTransfer = new DataTransfer();
|
2525
|
+
dataTransfer.items.add(fileObj);
|
2526
|
+
|
2527
|
+
thinkSpherePage.inputTypeVideoFile().then(($input) => {
|
2528
|
+
$input[0].files = dataTransfer.files;
|
2529
|
+
cy.wrap($input).trigger('change', { force: true });
|
2530
|
+
});
|
2531
|
+
});
|
2532
|
+
|
2533
|
+
cy.wait(4000);
|
2534
|
+
},
|
2535
|
+
|
2536
|
+
/**
|
2537
|
+
* Uploads a file to the whiteboard.
|
2538
|
+
* @param {string} file - The file to upload.
|
2539
|
+
*/
|
2540
|
+
WhiteBoardUploadFile: (file) => {
|
2541
|
+
thinkSpherePage.whiteBoardImagePropertiesInputTypeFile()
|
2542
|
+
.attachFile(file);
|
2543
|
+
cy.wait(4000);
|
2544
|
+
},
|
2545
|
+
|
2546
|
+
navigateToThinkSphereCreateItem: () => {
|
2547
|
+
cy.visit('/item-engine/thinksphere/create-item');
|
2548
|
+
},
|
2549
|
+
|
2550
|
+
navigateToReviewItemBank: () => {
|
2551
|
+
thinkSpherePage.addReviewQuestionButton().click();
|
2552
|
+
},
|
2553
|
+
|
2554
|
+
clickOnAddThinkSphereQuestion: () => {
|
2555
|
+
thinkSpherePage.addThinkSphereQuestionButton()
|
2556
|
+
.click();
|
2557
|
+
},
|
2558
|
+
|
2559
|
+
verifyCenterOptionAlignmentIsSelected: () => {
|
2560
|
+
thinkSpherePage.centerButton()
|
2561
|
+
.should('have.attr', 'aria-pressed', 'true');
|
2562
|
+
},
|
2563
|
+
|
2564
|
+
/**
|
2565
|
+
* Verifies the opacity slider value.
|
2566
|
+
* @param {string} opacityValue - The expected opacity value.
|
2567
|
+
*/
|
2568
|
+
verifyOpacitySliderValue: (opacityValue) => {
|
2569
|
+
thinkSpherePage.opacitySlider()
|
2570
|
+
.find('input')
|
2571
|
+
.should('have.value', opacityValue)
|
2572
|
+
},
|
2573
|
+
|
2574
|
+
/**
|
2575
|
+
* Verifies the opacity input field value.
|
2576
|
+
* @param {string} opacityValue - The expected opacity value.
|
2577
|
+
*/
|
2578
|
+
verifyOpacityInputFieldValue: (opacityValue) => {
|
2579
|
+
thinkSpherePage.opacityInputField()
|
2580
|
+
.should('have.value', opacityValue)
|
2581
|
+
},
|
2582
|
+
|
2583
|
+
clickOnOpacitySlider: () => {
|
2584
|
+
thinkSpherePage.opacitySlider()
|
2585
|
+
.click();
|
2586
|
+
},
|
2587
|
+
|
2588
|
+
/**
|
2589
|
+
* Adds input to the opacity input field.
|
2590
|
+
* @param {string} value - The value to input.
|
2591
|
+
*/
|
2592
|
+
addInputToOpacityInputField: (value) => {
|
2593
|
+
thinkSpherePage.opacityInputField()
|
2594
|
+
.clear()
|
2595
|
+
.type(value, { delay: 0 })
|
2596
|
+
},
|
2597
|
+
|
2598
|
+
/**
|
2599
|
+
* Verifies the image alternative text input field.
|
2600
|
+
* @param {string} imageAlternativeText - The expected alternative text.
|
2601
|
+
*/
|
2602
|
+
verifyImageAlternativeTextInputField: (imageAlternativeText) => {
|
2603
|
+
thinkSpherePage.imageAlternativeTextInputField()
|
2604
|
+
.should('have.value', imageAlternativeText);
|
2605
|
+
},
|
2606
|
+
expandSolvePhaseAccordion: () => {
|
2607
|
+
thinkSpherePage.solvePhaseAccordion()
|
2608
|
+
.click()
|
2609
|
+
.should('have.attr', 'aria-expanded', 'true');
|
2610
|
+
},
|
2611
|
+
expandCustomizeToolsAndControls: () => {
|
2612
|
+
thinkSpherePage.customizeToolsAndControls()
|
2613
|
+
.click()
|
2614
|
+
.should('have.attr', 'aria-expanded', 'true');
|
2615
|
+
},
|
2616
|
+
/**
|
2617
|
+
* Verifies the tools and controls options.
|
2618
|
+
* @param {Array<string>} options - The options to verify.
|
2619
|
+
*/
|
2620
|
+
verifyToolsAndControlsOptions: (options) => {
|
2621
|
+
options.forEach(option => {
|
2622
|
+
utilities.verifyElementVisibilityState(thinkSpherePage.solveToolsAndControlsOptionsTiles(option), 'visible');
|
2623
|
+
});
|
2624
|
+
},
|
2625
|
+
/**
|
2626
|
+
* Selects an option from tools and controls.
|
2627
|
+
* @param {string} option - The option to select.
|
2628
|
+
*/
|
2629
|
+
selectOptionFromToolsAndControls: (option) => {
|
2630
|
+
thinkSpherePage.solveToolsAndControlsOptionsTiles(option)
|
2631
|
+
.click();
|
2632
|
+
thinkSpherePage.solveToolsAndControlsOptionsTiles(option)
|
2633
|
+
.should('have.attr', 'data-aria-pressed', 'true');
|
2634
|
+
},
|
2635
|
+
/**
|
2636
|
+
* Deselects an option from tools and controls.
|
2637
|
+
* @param {string} option - The option to deselect.
|
2638
|
+
*/
|
2639
|
+
deselectOptionFromToolsAndControls: (option) => {
|
2640
|
+
thinkSpherePage.solveToolsAndControlsOptionsTiles(option)
|
2641
|
+
.click();
|
2642
|
+
thinkSpherePage.solveToolsAndControlsOptionsTiles(option)
|
2643
|
+
.should('have.attr', 'data-aria-pressed', 'false');
|
2644
|
+
},
|
2645
|
+
/**
|
2646
|
+
* Verifies if an option is selected.
|
2647
|
+
* @param {string} option - The option to verify.
|
2648
|
+
*/
|
2649
|
+
verifyOptionIsSelected: (option) => {
|
2650
|
+
thinkSpherePage.solveToolsAndControlsOptionsTiles(option)
|
2651
|
+
.should('have.attr', 'data-aria-pressed', 'true');
|
2652
|
+
},
|
2653
|
+
/**
|
2654
|
+
* Verifies if an option is not selected.
|
2655
|
+
* @param {string} option - The option to verify.
|
2656
|
+
*/
|
2657
|
+
verifyOptionIsNotSelected: (option) => {
|
2658
|
+
thinkSpherePage.solveToolsAndControlsOptionsTiles(option)
|
2659
|
+
.should('have.attr', 'data-aria-pressed', 'false');
|
2660
|
+
},
|
2661
|
+
|
2662
|
+
/**
|
2663
|
+
* Verifies the options contents.
|
2664
|
+
* @param {number} index - The index of the option.
|
2665
|
+
* @param {string} text - The text to verify.
|
2666
|
+
* @param {string} placeholder - The placeholder text to verify.
|
2667
|
+
*/
|
2668
|
+
verifyOptionsContents: (index, text, placeholder) => {
|
2669
|
+
utilities.getNthElement(thinkSpherePage.optionWrapper(), index)
|
2670
|
+
.within(() => {
|
2671
|
+
utilities.getNthElement(thinkSpherePage.listInputField(), 0)
|
2672
|
+
.should('have.attr', 'placeholder', placeholder);
|
2673
|
+
utilities.getNthElement(thinkSpherePage.listInputField(), 0)
|
2674
|
+
.should('have.value', text);
|
2675
|
+
thinkSpherePage.dragHandleButton()
|
2676
|
+
.should('exist');
|
2677
|
+
thinkSpherePage.deleteButton()
|
2678
|
+
.should('be.visible');
|
2679
|
+
thinkSpherePage.optionNumeration()
|
2680
|
+
.should('have.text', index + 1);
|
2681
|
+
});
|
2682
|
+
},
|
2683
|
+
|
2684
|
+
/**
|
2685
|
+
* Deletes an option.
|
2686
|
+
* @param {number} index - The index of the option to delete.
|
2687
|
+
*/
|
2688
|
+
deleteOption: (index) => {
|
2689
|
+
utilities.getNthElement(thinkSpherePage.deleteButton(), index)
|
2690
|
+
.click();
|
2691
|
+
},
|
2692
|
+
|
2693
|
+
/**
|
2694
|
+
* Verifies the delete option button disabled state.
|
2695
|
+
* @param {string} list - The list to verify ('strategy' or other).
|
2696
|
+
*/
|
2697
|
+
verifyDeleteOptionButtonDisabledState: (list) => {
|
2698
|
+
if (list === "strategy") {
|
2699
|
+
utilities.getNthElement(thinkSpherePage.optionsSectionWrapper(), 0)
|
2700
|
+
.within(() => {
|
2701
|
+
thinkSpherePage.deleteButton()
|
2702
|
+
.each(($element) => {
|
2703
|
+
utilities.verifyElementDisabled(cy.wrap($element))
|
2704
|
+
});
|
2705
|
+
});
|
2706
|
+
} else {
|
2707
|
+
utilities.getNthElement(thinkSpherePage.optionsSectionWrapper(), 1)
|
2708
|
+
.within(() => {
|
2709
|
+
thinkSpherePage.deleteButton()
|
2710
|
+
.each(($element) => {
|
2711
|
+
utilities.verifyElementDisabled(cy.wrap($element))
|
2712
|
+
});
|
2713
|
+
});
|
2714
|
+
}
|
2715
|
+
},
|
2716
|
+
|
2717
|
+
/**
|
2718
|
+
* Verifies the checkbox button disabled state.
|
2719
|
+
* @param {string} list - The list to verify ('strategy' or other).
|
2720
|
+
* @param {number} optionCount - The number of options to verify.
|
2721
|
+
*/
|
2722
|
+
verifyCheckboxButtonDisabledState: (list, optionCount) => {
|
2723
|
+
if (list === 'strategy') {
|
2724
|
+
utilities.getNthElement(utilities.getNthElement(thinkSpherePage.planStrategyCheckbox().find('span'), 0), optionCount)
|
2725
|
+
.should('have.attr', 'aria-disabled', 'true');
|
2726
|
+
} else {
|
2727
|
+
utilities.getNthElement(utilities.getNthElement(thinkSpherePage.planSentenceStarterCheckbox().find('span'), 0), optionCount)
|
2728
|
+
.should('have.attr', 'aria-disabled', 'true');
|
2729
|
+
}
|
2730
|
+
},
|
2731
|
+
|
2732
|
+
/**
|
2733
|
+
* Add the option in the list.
|
2734
|
+
* @param {string} list - The list to verify ('strategy' or other).
|
2735
|
+
*/
|
2736
|
+
addOption: (list) => {
|
2737
|
+
if (list === 'strategy') {
|
2738
|
+
thinkSpherePage.planStrategyAddItemButton()
|
2739
|
+
.click();
|
2740
|
+
} else {
|
2741
|
+
thinkSpherePage.planSentenceStarterAddItemButton()
|
2742
|
+
.click()
|
2743
|
+
.trigger('mouseout', { force: true });
|
2744
|
+
}
|
2745
|
+
},
|
2746
|
+
|
2747
|
+
/**
|
2748
|
+
* Selects an option.
|
2749
|
+
* @param {string} list - The list to select from ('strategy' or other).
|
2750
|
+
* @param {number} optionCount - The number of options to select.
|
2751
|
+
*/
|
2752
|
+
selectOption: (list, optionCount) => {
|
2753
|
+
if (list === 'strategy') {
|
2754
|
+
utilities.getNthElement(thinkSpherePage.planStrategyCheckbox(), optionCount)
|
2755
|
+
.click();
|
2756
|
+
} else {
|
2757
|
+
utilities.getNthElement(thinkSpherePage.planSentenceStarterCheckbox(), optionCount)
|
2758
|
+
.click();
|
2759
|
+
}
|
2760
|
+
},
|
2761
|
+
|
2762
|
+
/**
|
2763
|
+
* Adds text to an option.
|
2764
|
+
* @param {string} list - The list to add text to ('strategy' or other).
|
2765
|
+
* @param {number} optionCount - The number of options to add text to.
|
2766
|
+
* @param {string} text - The text to add.
|
2767
|
+
*/
|
2768
|
+
addOptionText: (list, optionCount, text) => {
|
2769
|
+
if (list === 'strategy') {
|
2770
|
+
thinkSpherePage.planStrategySection()
|
2771
|
+
.within(() => {
|
2772
|
+
utilities.getNthElement(thinkSpherePage.listInputField(), optionCount)
|
2773
|
+
.clear()
|
2774
|
+
.type(text, { delay: 500 });
|
2775
|
+
});
|
2776
|
+
} else {
|
2777
|
+
thinkSpherePage.planSentenceStarterSection()
|
2778
|
+
.within(() => {
|
2779
|
+
utilities.getNthElement(thinkSpherePage.listInputField(), optionCount)
|
2780
|
+
.clear()
|
2781
|
+
.type(text, { delay: 500 });
|
2782
|
+
});
|
2783
|
+
}
|
2784
|
+
},
|
2785
|
+
|
2786
|
+
/**
|
2787
|
+
* Verifies the warning popup.
|
2788
|
+
* @param {string} heading - The heading of the warning popup.
|
2789
|
+
* @param {string} content - The content of the warning popup.
|
2790
|
+
*/
|
2791
|
+
verifyWarningPopup: (heading, content) => {
|
2792
|
+
utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'visible');
|
2793
|
+
dialogBoxBase.dialogBoxTitle().within(() => {
|
2794
|
+
utilities.verifyInnerText(thinkSpherePage.warningPopupTitle(), heading);
|
2795
|
+
});
|
2796
|
+
dialogBoxBase.dialogBoxContent().within(() => {
|
2797
|
+
utilities.verifyInnerText(thinkSpherePage.warningPopupContentText(), content);
|
2798
|
+
utilities.verifyInnerText(thinkSpherePage.warningPopupOkButton(), 'OK');
|
2799
|
+
});
|
2800
|
+
},
|
2801
|
+
|
2802
|
+
verifyCustomizeStampsComponent: () => {
|
2803
|
+
utilities.verifyElementVisibilityState(thinkSpherePage.customizeStampComponent(), 'visible');
|
2804
|
+
},
|
2805
|
+
|
2806
|
+
/**
|
2807
|
+
* Verifies the default stamps.
|
2808
|
+
* @param {Array<string>} defaultStamps - The default stamps to verify.
|
2809
|
+
*/
|
2810
|
+
verifyDefaultStamps: (defaultStamps = []) => {
|
2811
|
+
thinkSpherePage.customizeStampComponent()
|
2812
|
+
.within(() => {
|
2813
|
+
thinkSpherePage.customizeStampCard()
|
2814
|
+
.should('have.length', defaultStamps.length);
|
2815
|
+
defaultStamps.forEach((ele) => {
|
2816
|
+
utilities.verifyElementVisibilityState(thinkSpherePage.customizeStampCard(ele, 'true'), 'visible');
|
2817
|
+
});
|
2818
|
+
});
|
2819
|
+
},
|
2820
|
+
|
2821
|
+
/**
|
2822
|
+
* Clicks on a customize card.
|
2823
|
+
* @param {number} index - The index of the card to click.
|
2824
|
+
* @param {string} ariaLabel - The aria-label of the card to click.
|
2825
|
+
*/
|
2826
|
+
clickOnCustomizeCard: (index, ariaLabel) => {
|
2827
|
+
if (ariaLabel) {
|
2828
|
+
thinkSpherePage.customizeStampCard(ariaLabel)
|
2829
|
+
.click();
|
2830
|
+
|
2831
|
+
} else {
|
2832
|
+
utilities.getNthElement(thinkSpherePage.customizeStampCard(), index)
|
2833
|
+
.click();
|
2834
|
+
}
|
2835
|
+
},
|
2836
|
+
|
2837
|
+
verifySelectAndUnselectStamps: () => {
|
2838
|
+
thinkSpherePage.customizeStampComponent()
|
2839
|
+
.within(() => {
|
2840
|
+
thinkSpherePage.steps.clickOnCustomizeCard(0);
|
2841
|
+
utilities.verifyElementVisibilityState(thinkSpherePage.customizeStampCard('Stamp 1', 'false'), 'visible');
|
2842
|
+
thinkSpherePage.steps.clickOnCustomizeCard(0);
|
2843
|
+
utilities.verifyElementVisibilityState(thinkSpherePage.customizeStampCard('Stamp 1', 'true'), 'visible');
|
2844
|
+
});
|
2845
|
+
},
|
2846
|
+
|
2847
|
+
clickOnStampsTool: () => {
|
2848
|
+
thinkSpherePage.stampsToolButton()
|
2849
|
+
.click();
|
2850
|
+
},
|
2851
|
+
|
2852
|
+
verifyQuestionImageCustomStamp: () => {
|
2853
|
+
let imgSrc = '';
|
2854
|
+
thinkSpherePage.questionImage()
|
2855
|
+
.invoke('attr', 'src') // Get the value of the 'src' attribute
|
2856
|
+
.then((src) => {
|
2857
|
+
imgSrc = src; // Store the value in the imgSrc variable
|
2858
|
+
cy.log(imgSrc); // Optional: Log the value to the Cypress console
|
2859
|
+
});
|
2860
|
+
utilities.verifyCSS(
|
2861
|
+
utilities.getNthElement(thinkSpherePage.customizeStampCard(), 0),
|
2862
|
+
{
|
2863
|
+
border: `1px solid ${css.color.secondaryBtnDisabled}`,
|
2864
|
+
},
|
2865
|
+
);
|
2866
|
+
utilities.getNthElement(thinkSpherePage.customizeStampCard(), 0)
|
2867
|
+
.within(() => {
|
2868
|
+
thinkSpherePage.customizeStampCardImg()
|
2869
|
+
.invoke('attr', 'src') // Get the value of the 'src' attribute
|
2870
|
+
.then((src) => {
|
2871
|
+
expect(src).to.equal(imgSrc);
|
2872
|
+
});
|
2873
|
+
});
|
2874
|
+
},
|
2875
|
+
createReviewQuestion: () => {
|
2876
|
+
const questionType = 'single selection'
|
2877
|
+
const options = ['Animal', 'Vehicle', 'Birds', 'Insects'];
|
2878
|
+
thinkSpherePage.steps.clickOnCreateItemButton();
|
2879
|
+
thinkSpherePage.steps.selectQuestionType(questionType);
|
2880
|
+
singleSelectionPage.steps.addQuestionInstructions();
|
2881
|
+
singleSelectionPage.steps.addInputToOptionsInputField(options);
|
2882
|
+
singleSelectionPage.steps.allotPoints(20);
|
2883
|
+
singleSelectionPage.steps.checkOptionInSpecifyCorrectAnswerSection(1);
|
2884
|
+
thinkSpherePage.steps.clickOnSaveButton();
|
2885
|
+
},
|
2886
|
+
|
2887
|
+
clickOnVideoLink: () => {
|
2888
|
+
thinkSpherePage.videoLinkComponent()
|
2889
|
+
.click();
|
2890
|
+
},
|
2891
|
+
|
2892
|
+
verifyVideoPlaybackTimer: (elapsedTime, totalTime) => {
|
2893
|
+
thinkSpherePage.playerTimer()
|
2894
|
+
.should('have.text', `${elapsedTime}/${totalTime}`);
|
2895
|
+
},
|
2896
|
+
|
2897
|
+
waitForPlaybackToBegin: () => {
|
2898
|
+
thinkSpherePage.playerTimer()
|
2899
|
+
.should('contain', '0:01/');
|
2900
|
+
},
|
2901
|
+
|
2902
|
+
expandChooseStarterDropdown: () => {
|
2903
|
+
thinkSpherePage.chooseStarterDropdown()
|
2904
|
+
.click();
|
2905
|
+
},
|
2906
|
+
|
2907
|
+
verifyOptionAlignmentIsSelected: (direction) => {
|
2908
|
+
if(direction === 'topLeft') {
|
2909
|
+
thinkSpherePage.whiteBoardCanvas()
|
2910
|
+
.should('not.have.css', 'justify-content', 'start');
|
2911
|
+
} else {
|
2912
|
+
thinkSpherePage.whiteBoardCanvas()
|
2913
|
+
.should('have.css', 'justify-content', (direction === 'center' || direction === 'flex-end') ? 'normal' : direction);
|
2914
|
+
if (direction === 'center') {
|
2915
|
+
thinkSpherePage.whiteBoardCanvas()
|
2916
|
+
.should('have.css', 'align-items', 'normal');
|
2917
|
+
}
|
2918
|
+
}
|
2919
|
+
},
|
2920
|
+
|
2921
|
+
clickOnImageRadioButton: () => {
|
2922
|
+
thinkSpherePage.imageRadioButton()
|
2923
|
+
.click();
|
2924
|
+
},
|
2925
|
+
|
2926
|
+
clickOnEditQuestionIcon: () => {
|
2927
|
+
utilities.getNthElement(thinkSpherePage.editQuestionPencil(), 0)
|
2928
|
+
.click();
|
2929
|
+
cy.wait(1000);
|
2930
|
+
},
|
2931
|
+
|
2932
|
+
clickOnQuestionInstructionExpandImageButton: () => {
|
2933
|
+
utilities.getNthElement(thinkSpherePage.questionInstructionPreviewImageExpandButton(), 0)
|
2934
|
+
.click();
|
2935
|
+
},
|
2936
|
+
|
2937
|
+
clickOnCloseExpandImagePopupButton: () => {
|
2938
|
+
thinkSpherePage.dialogBoxRoot()
|
2939
|
+
.within(() => {
|
2940
|
+
thinkSpherePage.closeExpandImagePopupButton()
|
2941
|
+
.click();
|
2942
|
+
});
|
2943
|
+
},
|
2944
|
+
|
2945
|
+
clickOnStrategiesPreviewListLI: () => {
|
2946
|
+
utilities.getNthElement(thinkSpherePage.strategiesPreviewListLI(), 1)
|
2947
|
+
.click();
|
2948
|
+
},
|
2949
|
+
|
2950
|
+
clickOnVideoIcon: () => {
|
2951
|
+
utilities.getNthElement(thinkSpherePage.videoIconWrapper(), 0)
|
2952
|
+
.click();
|
2953
|
+
},
|
2954
|
+
|
2955
|
+
closeVideoPopup: () => {
|
2956
|
+
thinkSpherePage.dialogBoxRoot()
|
2957
|
+
.within(() => {
|
2958
|
+
thinkSpherePage.buttonClose()
|
2959
|
+
.click();
|
2960
|
+
});
|
2961
|
+
},
|
2962
|
+
|
2963
|
+
hoverOnVolumeControlButton: () => {
|
2964
|
+
thinkSpherePage.volumeControlButton()
|
2965
|
+
.realHover({ position: 'bottom' });
|
2966
|
+
},
|
2967
|
+
|
2968
|
+
verifyPlaybackElapsedTime: (time) => {
|
2969
|
+
const playbackTimeElement = thinkSpherePage.playerTimer();
|
2970
|
+
playbackTimeElement
|
2971
|
+
.invoke('text')
|
2972
|
+
.then((text) => {
|
2973
|
+
let elapsedTime = text.split('/')[0];
|
2974
|
+
let currentElapsedTimerMinutes = Number(elapsedTime.split(':')[0]);
|
2975
|
+
let currentElapsedTimerSeconds = Number(elapsedTime.split(':')[1]);
|
2976
|
+
let currentTotalElapsedTimerSeconds = currentElapsedTimerMinutes * 60 + currentElapsedTimerSeconds;
|
2977
|
+
expect(currentTotalElapsedTimerSeconds).to.eq(time);
|
2978
|
+
});
|
2979
|
+
},
|
2980
|
+
|
2981
|
+
getToolbarOptionCount: (number) => {
|
2982
|
+
return thinkSpherePage.gridItemsWrapper(number).find('button').its('length');
|
2983
|
+
},
|
2984
|
+
|
2985
|
+
selectTools: (array, number) => {
|
2986
|
+
thinkSpherePage.steps.getToolbarOptionCount(number).then((count) => {
|
2987
|
+
thinkSpherePage.gridItemsWrapper(number).within(() => {
|
2988
|
+
for (let i = 0; i < count; i++) {
|
2989
|
+
thinkSpherePage.dragButton(i)
|
2990
|
+
.invoke('attr', 'aria-label')
|
2991
|
+
.then((attr) => {
|
2992
|
+
if (attr.includes('not-selected')) {
|
2993
|
+
const toolName = attr.split(' ').slice(0, -1).join(' ');
|
2994
|
+
if (array.includes(toolName)) {
|
2995
|
+
thinkSpherePage.dragButton(i)
|
2996
|
+
.click();
|
2997
|
+
}
|
2998
|
+
} else {
|
2999
|
+
const toolName = attr.split(' ').slice(0, -1).join(' ');
|
3000
|
+
if (!array.includes(toolName)) {
|
3001
|
+
thinkSpherePage.dragButton(i)
|
3002
|
+
.click();
|
3003
|
+
}
|
3004
|
+
}
|
3005
|
+
})
|
3006
|
+
}
|
3007
|
+
});
|
3008
|
+
});
|
3009
|
+
},
|
3010
|
+
|
3011
|
+
verifySelectTools: (array, number) => {
|
3012
|
+
thinkSpherePage.steps.getToolbarOptionCount(number).then((count) => {
|
3013
|
+
thinkSpherePage.gridItemsWrapper(number).within(() => {
|
3014
|
+
for (let i = 0; i < count; i++) {
|
3015
|
+
thinkSpherePage.dragButton(i)
|
3016
|
+
.invoke('attr', 'aria-label')
|
3017
|
+
.then((attr) => {
|
3018
|
+
const toolName = attr.split(' ').slice(0, -1).join(' ');
|
3019
|
+
if (array.includes(toolName)) {
|
3020
|
+
thinkSpherePage.dragButton(i)
|
3021
|
+
.invoke('attr', 'aria-label')
|
3022
|
+
.should('contain', ' selected');
|
3023
|
+
} else {
|
3024
|
+
thinkSpherePage.dragButton(i)
|
3025
|
+
.invoke('attr', 'aria-label')
|
3026
|
+
.should('contain', ' not-selected');
|
3027
|
+
}
|
3028
|
+
})
|
3029
|
+
}
|
3030
|
+
});
|
3031
|
+
});
|
3032
|
+
},
|
3033
|
+
|
3034
|
+
verifyUploadedImage: () => {
|
3035
|
+
thinkSpherePage.whiteBoardImage()
|
3036
|
+
.should('exist')
|
3037
|
+
.and('have.attr', 'src')
|
3038
|
+
.and('not.be.empty');
|
3039
|
+
},
|
3040
|
+
|
3041
|
+
visitThinksphereBrowseItemsPage: () => {
|
3042
|
+
cy.visit('/item-engine/thinksphere/browse-items');
|
3043
|
+
cy.interceptGraphql('getItems');
|
3044
|
+
cy.wait('@getItems');
|
3045
|
+
},
|
3046
|
+
|
3047
|
+
clickOnCustomizeStamp: (customizeStampPosition) => {
|
3048
|
+
thinkSpherePage.customizeStampsButton(customizeStampPosition)
|
3049
|
+
.click();
|
3050
|
+
cy.wait(1000);
|
3051
|
+
},
|
3052
|
+
|
3053
|
+
verifyCustomizeStampSelectedUnselected: (selected, customizeStampPosition) => {
|
3054
|
+
utilities.verifyElementAttribute(thinkSpherePage.customizeStampsButton(customizeStampPosition), 'aria-checked', selected ? 'true' : 'false');
|
3055
|
+
},
|
3056
|
+
|
3057
|
+
saveCustomCategory: () => {
|
3058
|
+
thinkSpherePage.buttonSave()
|
3059
|
+
.click();
|
3060
|
+
},
|
3061
|
+
|
3062
|
+
cancelCustomCategory: () => {
|
3063
|
+
thinkSpherePage.buttonCancel()
|
3064
|
+
.click();
|
3065
|
+
},
|
3066
|
+
|
3067
|
+
createCustomCategoryWithMultipleCategoryCharacters: () => {
|
3068
|
+
cy.log('Creating a custom category by selecting \'Keypad\' category, partially selecting \'Basic\' and \'Greek\' categories')
|
3069
|
+
createCustomCategoryFlyout.steps.openCreateCustomCategoryFlyout();
|
3070
|
+
createCustomCategoryFlyout.steps.checkCategoryAccordionCheckbox(`${equationEditorCategoriesAndSymbols['primary'].displayName}`);
|
3071
|
+
cy.wait(2000);
|
3072
|
+
createCustomCategoryFlyout.steps.verifyPartiallyCheckedStateOfCategoryAccordionCheckbox(`${equationEditorCategoriesAndSymbols['matrices'].displayName}`);
|
3073
|
+
createCustomCategoryFlyout.steps.expandCategoryAccordion(`Greek Symbols`);
|
3074
|
+
createCustomCategoryFlyout.steps.selectASymbolInCreateCustomCategoryFlyout(`${equationEditorCategoriesAndSymbols['greek'].displayName}`, `${equationEditorCategoriesAndSymbols.greek.symbols.gamma.ariaLabel}`);
|
3075
|
+
createCustomCategoryFlyout.steps.selectASymbolInCreateCustomCategoryFlyout(`${equationEditorCategoriesAndSymbols['greek'].displayName}`, `${equationEditorCategoriesAndSymbols.greek.symbols.delta.ariaLabel}`);
|
3076
|
+
createCustomCategoryFlyout.steps.addInputToCustomCategoryNameInputField('Custom category with name.');
|
3077
|
+
thinkSpherePage.steps.saveCustomCategory();
|
3078
|
+
utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'notExist');
|
3079
|
+
},
|
3080
|
+
|
3081
|
+
createCustomCategoryWithNameAndIcon: () => {
|
3082
|
+
cy.log('Creating a category by selecting \'Arrows\' category')
|
3083
|
+
createCustomCategoryFlyout.steps.openCreateCustomCategoryFlyout();
|
3084
|
+
createCustomCategoryFlyout.steps.checkCategoryAccordionCheckbox(`${equationEditorCategoriesAndSymbols['geo'].displayName}`);
|
3085
|
+
createCustomCategoryFlyout.steps.addInputToCustomCategoryNameInputField('Custom category with name and icon.');
|
3086
|
+
createCustomCategoryFlyout.steps.addInputToCategoryIconInputField('#');
|
3087
|
+
thinkSpherePage.steps.saveCustomCategory();
|
3088
|
+
},
|
3089
|
+
|
3090
|
+
verifyCategoryCharactersAndUnSelectedState: (arrayOfSymbolsAriaLabel) => {
|
3091
|
+
thinkSpherePage.categoryCharacters()
|
3092
|
+
.then(($symbols) => {
|
3093
|
+
for (let index = 10; index < $symbols.length - 1; index++) {
|
3094
|
+
editCategoryFlyout.categoryCharacters()
|
3095
|
+
.eq(index)
|
3096
|
+
.should('not.have.class', 'Mui-selected')
|
3097
|
+
.invoke('attr', 'aria-label')
|
3098
|
+
.then((ariaLabel) => {
|
3099
|
+
const tooltipText = ariaLabel.split(' ').slice(0, -1).join(' ');
|
3100
|
+
editCategoryFlyout.categoryCharacters()
|
3101
|
+
.eq(index)
|
3102
|
+
.verifyTooltip(tooltipText);
|
3103
|
+
});
|
3104
|
+
}
|
3105
|
+
});
|
3106
|
+
},
|
3107
|
+
|
3108
|
+
verifyCategoryCharactersAndSelectedState: (arrayOfSymbolsAriaLabel) => {
|
3109
|
+
editCategoryFlyout.categoryCharacters()
|
3110
|
+
.then(($symbols) => {
|
3111
|
+
for (let index = 0; index < arrayOfSymbolsAriaLabel.length - 1; index++) {
|
3112
|
+
editCategoryFlyout.categoryCharacters()
|
3113
|
+
.eq(index)
|
3114
|
+
.should('have.class', 'Mui-selected')
|
3115
|
+
.invoke('attr', 'aria-label')
|
3116
|
+
.then((ariaLabel) => {
|
3117
|
+
const tooltipText = ariaLabel.split(' ').slice(0, -1).join(' ');
|
3118
|
+
editCategoryFlyout.categoryCharacters()
|
3119
|
+
.eq(index)
|
3120
|
+
.verifyTooltip(tooltipText);
|
3121
|
+
});
|
3122
|
+
}
|
3123
|
+
});
|
3124
|
+
},
|
3125
|
+
|
3126
|
+
expandDropdown: () => {
|
3127
|
+
thinkSpherePage.categoriesDropDownParent()
|
3128
|
+
.click();
|
3129
|
+
},
|
3130
|
+
|
3131
|
+
verifyDropdownOptions: (dropDownListArray) => {
|
3132
|
+
thinkSpherePage.categoriesDropDownMenuItem().should('have.length', dropDownListArray.length).each(($item) => {
|
3133
|
+
cy.wrap($item)
|
3134
|
+
.invoke('text')
|
3135
|
+
.then((text) => {
|
3136
|
+
const trimmedText = text.trim();
|
3137
|
+
expect(dropDownListArray).to.include(trimmedText);
|
3138
|
+
});
|
3139
|
+
});
|
3140
|
+
},
|
3141
|
+
|
3142
|
+
clickOnDropDownCategory: (index) => {
|
3143
|
+
thinkSpherePage.categoriesDropDownMenuItem().eq(index).click();
|
3144
|
+
},
|
3145
|
+
|
3146
|
+
clickOnQuestionTypesAccordion: () => {
|
3147
|
+
thinkSpherePage.filterSectionQuestionTypesAccordion()
|
3148
|
+
.click()
|
3149
|
+
},
|
3150
|
+
|
3151
|
+
typeInSearchBar: (input) => {
|
3152
|
+
thinkSpherePage.searchBar()
|
3153
|
+
.clear()
|
3154
|
+
.type(input)
|
3155
|
+
.should('have.value', input);
|
3156
|
+
},
|
3157
|
+
|
3158
|
+
searchInSearchBar: (input) => {
|
3159
|
+
thinkSpherePage.searchBar()
|
3160
|
+
.clear()
|
3161
|
+
.type(input)
|
3162
|
+
.should('have.value', input)
|
3163
|
+
.type('{enter}');
|
3164
|
+
},
|
3165
|
+
|
3166
|
+
clickOnSolvePhaseAccordionIcon: (element) => {
|
3167
|
+
thinkSpherePage.solvePhaseAccordionExpandIcon()
|
3168
|
+
.click();
|
3169
|
+
},
|
3170
|
+
|
3171
|
+
verifyElementDoesNotHaveExpandedClass: (element) => {
|
3172
|
+
element.should('not.have.class', 'Mui-expanded');
|
3173
|
+
},
|
3174
|
+
|
3175
|
+
verifyElementDoesNotHaveCheckedClass: (element) => {
|
3176
|
+
element.should('not.have.class', 'Mui-checked');
|
3177
|
+
},
|
3178
|
+
|
3179
|
+
verifyThinkSphereSearchBarPlaceholder: () => {
|
3180
|
+
thinkSpherePage.searchBar().should('have.attr', 'placeholder', 'Search by title, tags and content');
|
3181
|
+
},
|
3182
|
+
|
3183
|
+
verifyReviewItemSearchBarPlaceholder: () => {
|
3184
|
+
thinkSpherePage.searchBar().should('have.attr', 'placeholder', 'Search by question type');
|
3185
|
+
},
|
3186
|
+
|
3187
|
+
verifyEquationEditorSectionCategoryNotPressed: () => {
|
3188
|
+
thinkSpherePage.equationEditorSectionCategories().eq(1).should('have.attr', 'data-aria-pressed', 'false');
|
3189
|
+
},
|
3190
|
+
|
3191
|
+
verifyEquationEditorSectionCategoryIsPressed: () => {
|
3192
|
+
thinkSpherePage.equationEditorSectionCategories().eq(10).should('have.attr', 'data-aria-pressed', 'true');
|
3193
|
+
},
|
3194
|
+
|
3195
|
+
verifyTypeCheckBoxStrategy: () => {
|
3196
|
+
utilities.getNthElement(thinkSpherePage.planStrategyCheckbox(), 5)
|
3197
|
+
.find('input').should('have.attr', 'type', 'checkbox');
|
3198
|
+
},
|
3199
|
+
|
3200
|
+
verifyTypeCheckBoxSentenceStarter: () => {
|
3201
|
+
utilities.getNthElement(thinkSpherePage.planSentenceStarterCheckbox(), 5)
|
3202
|
+
.find('input').should('have.attr', 'type', 'checkbox');
|
3203
|
+
},
|
3204
|
+
|
3205
|
+
verifyStrategyCheckBoxNotChecked: () => {
|
3206
|
+
utilities.getNthElement(thinkSpherePage.planStrategyCheckbox(), 5)
|
3207
|
+
.find('input').should('not.have.attr', 'checked');
|
3208
|
+
},
|
3209
|
+
|
3210
|
+
verifySentenceStrategyCheckBoxNotChecked: () => {
|
3211
|
+
utilities.getNthElement(thinkSpherePage.planSentenceStarterCheckbox(), 5)
|
3212
|
+
.find('input').should('not.have.attr', 'checked');
|
3213
|
+
},
|
3214
|
+
|
3215
|
+
verifyTextIsNotEmpty: (element) => {
|
3216
|
+
element.invoke('text')
|
3217
|
+
.should('not.be.empty');
|
3218
|
+
},
|
3219
|
+
|
3220
|
+
verifyLength: (element, length) => {
|
3221
|
+
element.should('have.length', length);
|
3222
|
+
},
|
3223
|
+
|
3224
|
+
verifyFilterSectionExpanded: () => {
|
3225
|
+
thinkSpherePage.filterSectionQuestionTypesAccordion().should('have.class', 'Mui-expanded');
|
3226
|
+
},
|
3227
|
+
|
3228
|
+
verifyFilterSectionCollapsed: () => {
|
3229
|
+
thinkSpherePage.filterSectionQuestionTypesAccordion().should('not.have.class', 'Mui-expanded');
|
3230
|
+
},
|
3231
|
+
|
3232
|
+
verifySolvePhaseAccordionExpanded: () => {
|
3233
|
+
thinkSpherePage.solvePhaseAccordionExpandIcon().should('have.class', 'Mui-expanded');
|
3234
|
+
},
|
3235
|
+
|
3236
|
+
verifySolvePhaseAccordionCollapsed: () => {
|
3237
|
+
thinkSpherePage.solvePhaseAccordionExpandIcon().should('not.have.class', 'Mui-expanded');
|
3238
|
+
},
|
3239
|
+
|
3240
|
+
addQuestionInstructionInnerHTML: (innerHTML) => {
|
3241
|
+
thinkSpherePage.thinkSphereQuestionInstructionCKEditor()
|
3242
|
+
.invoke('html', innerHTML);
|
3243
|
+
},
|
3244
|
+
|
3245
|
+
verifyQuestionInstructionIncreasedHeightAndScrollBar: () => {
|
3246
|
+
thinkSpherePage.thinkSphereQuestionInstructionCKEditor()
|
3247
|
+
.invoke('height') // Get the height of the element
|
3248
|
+
.should('be.gt', 198);
|
3249
|
+
|
3250
|
+
thinkSpherePage.thinkSphereQuestionInstructionCKEditor()
|
3251
|
+
.should(($el) => {
|
3252
|
+
const scrollWidth = $el[0].scrollWidth;
|
3253
|
+
const clientWidth = $el[0].clientWidth;
|
3254
|
+
|
3255
|
+
// Assert that horizontal scroll is present
|
3256
|
+
expect(scrollWidth).to.be.greaterThan(clientWidth);
|
3257
|
+
});
|
3258
|
+
},
|
3259
|
+
|
3260
|
+
verifyQuestionImagePopup: () => {
|
3261
|
+
thinkSpherePage.dialogBoxRoot()
|
3262
|
+
.within(() => {
|
3263
|
+
utilities.verifyElementVisibilityState(thinkSpherePage.questionInstructionImagePopup(), 'visible');
|
3264
|
+
utilities.verifyElementVisibilityState(thinkSpherePage.closeExpandImagePopupButton(), 'visible');
|
3265
|
+
});
|
3266
|
+
},
|
3267
|
+
|
3268
|
+
verifyAddNewStrategyPopupCloseFunctionality: () => {
|
3269
|
+
let countBeforeOpeningPopup, countAfterClosingPopup;
|
3270
|
+
cy.get(thinkSpherePage.strategiesBoxPreviewTab())
|
3271
|
+
.its('length')
|
3272
|
+
.then((count) => {
|
3273
|
+
countBeforeOpeningPopup = count;
|
3274
|
+
cy.log('Count before opening popup:', countBeforeOpeningPopup);
|
3275
|
+
});
|
3276
|
+
thinkSpherePage.addNewStrategyButton().click();
|
3277
|
+
thinkSpherePage.addStrategyPopupCancelButton().click();
|
3278
|
+
cy.get(thinkSpherePage.strategiesBoxPreviewTab())
|
3279
|
+
.its('length')
|
3280
|
+
.then((count) => {
|
3281
|
+
countAfterClosingPopup = count;
|
3282
|
+
cy.log('Count after closing popup:', countAfterClosingPopup);
|
3283
|
+
expect(countAfterClosingPopup).to.equal(countBeforeOpeningPopup);
|
3284
|
+
});
|
3285
|
+
},
|
3286
|
+
|
3287
|
+
verifyAddNewStrategyPopupSaveFunctionality: () => {
|
3288
|
+
let countBeforeOpeningPopup, countAfterClosingPopup;
|
3289
|
+
thinkSpherePage.strategiesBoxPreviewTab()
|
3290
|
+
.its('length')
|
3291
|
+
.then((count) => {
|
3292
|
+
countBeforeOpeningPopup = count;
|
3293
|
+
cy.log('Count before opening popup:', countBeforeOpeningPopup);
|
3294
|
+
});
|
3295
|
+
thinkSpherePage.addNewStrategyButton().click();
|
3296
|
+
thinkSpherePage.strategyNameInputField().type('Test Strategy');
|
3297
|
+
thinkSpherePage.addStrategyPopupSaveButton().click();
|
3298
|
+
thinkSpherePage.strategiesBoxPreviewTab()
|
3299
|
+
.its('length')
|
3300
|
+
.then((count) => {
|
3301
|
+
countAfterClosingPopup = count;
|
3302
|
+
cy.log('Count after closing popup:', countAfterClosingPopup);
|
3303
|
+
expect(countAfterClosingPopup).to.equal(countBeforeOpeningPopup + 1);
|
3304
|
+
});
|
3305
|
+
},
|
3306
|
+
|
3307
|
+
verifyVideoPopupDialogBox: () => {
|
3308
|
+
thinkSpherePage.dialogBoxRoot()
|
3309
|
+
.within(() => {
|
3310
|
+
utilities.verifyElementVisibilityState(thinkSpherePage.dialogBoxTitle(), 'visible');
|
3311
|
+
utilities.verifyInnerText(thinkSpherePage.dialogBoxTitle(), 'Create_a_model');
|
3312
|
+
utilities.verifyElementVisibilityState(thinkSpherePage.buttonClose(), 'visible');
|
3313
|
+
});
|
3314
|
+
},
|
3315
|
+
|
3316
|
+
verifySentenceStartersDropdown: () => {
|
3317
|
+
thinkSpherePage.chooseStarterTextIconWrapper()
|
3318
|
+
.within(() => {
|
3319
|
+
utilities.verifyElementVisibilityState(thinkSpherePage.starterIocn(), 'visible');
|
3320
|
+
utilities.verifyInnerText(thinkSpherePage.starterTextWrapper(), 'Starters');
|
3321
|
+
});
|
3322
|
+
thinkSpherePage.chooseStarterDropdown()
|
3323
|
+
.verifyPseudoClassBeforeProperty('content', '""');
|
3324
|
+
},
|
3325
|
+
|
3326
|
+
verifySentenceStartersDropdownOptions: (sentenceStartersTextDefault) => {
|
3327
|
+
sentenceStartersTextDefault.forEach((label, index) => {
|
3328
|
+
utilities.verifyInnerText(utilities.getNthElement(thinkSpherePage.chooseStartersListOptionLabels(), index), label);
|
3329
|
+
});
|
3330
|
+
},
|
3331
|
+
|
3332
|
+
verifySentenceStartersDropdownFunctionality: () => {
|
3333
|
+
thinkSpherePage.writePlanWrapper()
|
3334
|
+
.within(() => {
|
3335
|
+
thinkSpherePage.contentEditableDiv().clear();
|
3336
|
+
});
|
3337
|
+
thinkSpherePage.steps.expandChooseStarterDropdown();
|
3338
|
+
utilities.getNthElement(thinkSpherePage.chooseStartersListOptions(), 1).click();
|
3339
|
+
thinkSpherePage.writePlanWrapper()
|
3340
|
+
.within(() => {
|
3341
|
+
thinkSpherePage.contentEditableDiv().should('have.value', 'First, I will ');
|
3342
|
+
thinkSpherePage.contentEditableDiv().clear();
|
3343
|
+
});
|
3344
|
+
},
|
3345
|
+
|
3346
|
+
verifyProblemAskingHeading: () => {
|
3347
|
+
thinkSpherePage.problemAskingWrapper()
|
3348
|
+
.within(() => {
|
3349
|
+
utilities.verifyInnerText(thinkSpherePage.subheadingWrapper(), 'The problem is asking me to');
|
3350
|
+
utilities.verifyElementVisibilityState(thinkSpherePage.subheadingWrapper(), 'visible');
|
3351
|
+
});
|
3352
|
+
},
|
3353
|
+
|
3354
|
+
verifyProblemAskingTextArea: () => {
|
3355
|
+
thinkSpherePage.problemAskingWrapper()
|
3356
|
+
.within(() => {
|
3357
|
+
utilities.verifyElementVisibilityState(thinkSpherePage.contentEditableDiv(), 'visible');
|
3358
|
+
utilities.verifyElementAttribute(thinkSpherePage.contentEditableDiv(), 'placeholder', 'Enter your text here');
|
3359
|
+
});
|
3360
|
+
},
|
3361
|
+
|
3362
|
+
verifyProblemAskingMicSection: (isGrading=false) => {
|
3363
|
+
thinkSpherePage.problemAskingWrapper()
|
3364
|
+
.within(() => {
|
3365
|
+
utilities.verifyElementVisibilityState(thinkSpherePage.micIconWrapper(), 'visible');
|
3366
|
+
utilities.verifyElementAttribute(thinkSpherePage.micIconWrapper(), 'role', 'button');
|
3367
|
+
utilities.verifyElementAttribute(thinkSpherePage.micIconWrapper(), 'aria-label', 'Mic button');
|
3368
|
+
if(isGrading) {
|
3369
|
+
utilities.verifyElementAttribute(thinkSpherePage.micIconWrapper(), 'tabindex', -1);
|
3370
|
+
}
|
3371
|
+
});
|
3372
|
+
},
|
3373
|
+
|
3374
|
+
verifyProblemAskingTextAreaFunctionality: (textToEnter) => {
|
3375
|
+
thinkSpherePage.problemAskingWrapper()
|
3376
|
+
.within(() => {
|
3377
|
+
thinkSpherePage.contentEditableDiv().type(textToEnter);
|
3378
|
+
thinkSpherePage.contentEditableDiv().should('have.value', textToEnter);
|
3379
|
+
});
|
3380
|
+
},
|
3381
|
+
|
3382
|
+
verifyStrategiesToPlanHeading: () => {
|
3383
|
+
thinkSpherePage.strategiesToPlanWrapper()
|
3384
|
+
.within(() => {
|
3385
|
+
utilities.verifyInnerText(thinkSpherePage.subheadingWrapper(), 'Add strategies to plan');
|
3386
|
+
utilities.verifyElementVisibilityState(thinkSpherePage.subheadingWrapper(), 'visible');
|
3387
|
+
});
|
3388
|
+
},
|
3389
|
+
|
3390
|
+
verifyWritePlanHeading: () => {
|
3391
|
+
thinkSpherePage.writePlanWrapper()
|
3392
|
+
.within(() => {
|
3393
|
+
utilities.verifyInnerText(thinkSpherePage.subheadingWrapper(), 'Write your plan');
|
3394
|
+
utilities.verifyElementVisibilityState(thinkSpherePage.subheadingWrapper(), 'visible');
|
3395
|
+
});
|
3396
|
+
},
|
3397
|
+
|
3398
|
+
verifyWritePlanTextArea: () => {
|
3399
|
+
thinkSpherePage.writePlanWrapper()
|
3400
|
+
.within(() => {
|
3401
|
+
utilities.verifyElementVisibilityState(thinkSpherePage.contentEditableDiv(), 'visible');
|
3402
|
+
utilities.verifyElementAttribute(thinkSpherePage.contentEditableDiv(), 'placeholder', 'Enter your plan here');
|
3403
|
+
});
|
3404
|
+
},
|
3405
|
+
|
3406
|
+
verifyWritePlanMicSection: (isGrading=false) => {
|
3407
|
+
thinkSpherePage.writePlanWrapper()
|
3408
|
+
.within(() => {
|
3409
|
+
utilities.verifyElementVisibilityState(thinkSpherePage.micIconWrapper(), 'visible');
|
3410
|
+
utilities.verifyElementAttribute(thinkSpherePage.micIconWrapper(), 'role', 'button');
|
3411
|
+
utilities.verifyElementAttribute(thinkSpherePage.micIconWrapper(), 'aria-label', 'Mic button');
|
3412
|
+
if(isGrading) {
|
3413
|
+
utilities.verifyElementAttribute(thinkSpherePage.micIconWrapper(), 'tabindex', -1);
|
3414
|
+
}
|
3415
|
+
});
|
3416
|
+
},
|
3417
|
+
|
3418
|
+
verifyWritePlanTextAreaFunctionality: (planTextToEnter) => {
|
3419
|
+
thinkSpherePage.writePlanWrapper()
|
3420
|
+
.within(() => {
|
3421
|
+
thinkSpherePage.contentEditableDiv().type(planTextToEnter);
|
3422
|
+
thinkSpherePage.contentEditableDiv().should('have.value', planTextToEnter);
|
3423
|
+
thinkSpherePage.contentEditableDiv().clear();
|
3424
|
+
});
|
3425
|
+
},
|
3426
|
+
|
3427
|
+
verifyStrategyChipClickFunctionality: () => {
|
3428
|
+
thinkSpherePage.writePlanWrapper()
|
3429
|
+
.within(() => {
|
3430
|
+
thinkSpherePage.contentEditableDiv().clear();
|
3431
|
+
});
|
3432
|
+
thinkSpherePage.strategyChip().click();
|
3433
|
+
thinkSpherePage.writePlanWrapper()
|
3434
|
+
.within(() => {
|
3435
|
+
thinkSpherePage.contentEditableDiv().should('have.value', 'look for a pattern ');
|
3436
|
+
});
|
3437
|
+
},
|
3438
|
+
clickUploadVideoButton: () => {
|
3439
|
+
thinkSpherePage.uploadVideoLinkButton()
|
3440
|
+
.click();
|
3441
|
+
},
|
3442
|
+
|
3443
|
+
verifyPreAuthoredVideoTitles: (defaultStrategyTexts) => {
|
3444
|
+
defaultStrategyTexts.forEach((text,index) => {
|
3445
|
+
thinkSpherePage.videoLinkComponent(index)
|
3446
|
+
.within(() => {
|
3447
|
+
utilities.verifyInnerText(thinkSpherePage.uploadVideoLinkButton(), text);
|
3448
|
+
})
|
3449
|
+
});
|
3450
|
+
},
|
3451
|
+
|
3452
|
+
verifyPreAuthoredVideos: (preAuthoredVideos) => {
|
3453
|
+
preAuthoredVideos.forEach(({duration}, optionIndex) => {
|
3454
|
+
thinkSpherePage.videoLinkComponent(optionIndex)
|
3455
|
+
.within(thinkSpherePage.steps.clickUploadVideoButton);
|
3456
|
+
thinkSpherePage.steps.startPlayback();
|
3457
|
+
thinkSpherePage.steps.waitForPlaybackToBegin();
|
3458
|
+
thinkSpherePage.playerTimer()
|
3459
|
+
.should('contain', `/${duration}`);
|
3460
|
+
thinkSpherePage.steps.closeVideoPopup();
|
3461
|
+
})
|
3462
|
+
},
|
3463
|
+
|
3464
|
+
clickOnReviewTab: () => {
|
3465
|
+
thinkSpherePage.reviewTab()
|
3466
|
+
.click();
|
3467
|
+
},
|
3468
|
+
|
3469
|
+
clickOnPlanTab: () => {
|
3470
|
+
thinkSpherePage.planTab()
|
3471
|
+
.click();
|
3472
|
+
},
|
3473
|
+
|
3474
|
+
switchToGradingView: () => {
|
3475
|
+
thinkSpherePage.gradingViewRadioButton()
|
3476
|
+
.click();
|
3477
|
+
},
|
3478
|
+
|
3479
|
+
switchToStudentView: () => {
|
3480
|
+
thinkSpherePage.studentViewRadioButton()
|
3481
|
+
.click();
|
3482
|
+
},
|
3483
|
+
|
3484
|
+
verifyCorrectAnswerLabel: () => {
|
3485
|
+
utilities.verifyElementVisibilityState(thinkSpherePage.correctAnswerLabelWrapper(), 'visible');
|
3486
|
+
},
|
3487
|
+
|
3488
|
+
addImageAlternativeTextInputFieldText: (alternateTextForImage) => {
|
3489
|
+
thinkSpherePage.imageAlternativeTextInputField().type(alternateTextForImage);
|
3490
|
+
cy.wait(2000);
|
3491
|
+
},
|
3492
|
+
|
3493
|
+
stepsBeforeGradingView: () => {
|
3494
|
+
thinkSpherePage.steps.expandChooseStarterDropdown();
|
3495
|
+
utilities.getNthElement(thinkSpherePage.chooseStartersListOptions(), 1).click();
|
3496
|
+
thinkSpherePage.problemAskingWrapper().first()
|
3497
|
+
.within(() => {
|
3498
|
+
thinkSpherePage.contentEditableDiv().type('This is a test text for the problem.');
|
3499
|
+
});
|
3500
|
+
thinkSpherePage.strategyChip().click();
|
3501
|
+
thinkSpherePage.submitButton().click();
|
3502
|
+
thinkSpherePage.goToGradingViewButton().click();
|
3503
|
+
},
|
3504
|
+
|
3505
|
+
verifyAddStrategiesButtonDisabled: () => {
|
3506
|
+
thinkSpherePage.addNewStrategyButton().should('have.attr', 'tabindex', '-1');
|
3507
|
+
thinkSpherePage.addNewStrategyButton().click({ force: true });
|
3508
|
+
utilities.verifyElementVisibilityState(thinkSpherePage.popupTitle(), 'notExist');
|
3509
|
+
},
|
3510
|
+
|
3511
|
+
verifyStrategiesListButtonDisabled: () => {
|
3512
|
+
utilities.getNthElement(thinkSpherePage.strategiesPreviewListLI(), 0).should('have.attr', 'tabindex', '-1');
|
3513
|
+
utilities.getNthElement(thinkSpherePage.strategiesPreviewListLI(), 0).should('have.attr', 'aria-disabled', 'true');
|
3514
|
+
},
|
3515
|
+
|
3516
|
+
verifySentenceStarterDropDownDisabled: () => {
|
3517
|
+
thinkSpherePage.chooseStarterDropdown().should('have.attr', 'aria-disabled', 'true');
|
3518
|
+
},
|
3519
|
+
|
3520
|
+
verifyDisabledProblemTextContainer: (textToEnter) => {
|
3521
|
+
thinkSpherePage.problemAskingWrapper()
|
3522
|
+
.within(() => {
|
3523
|
+
thinkSpherePage.contentEditableDiv().should('have.attr', 'readonly');
|
3524
|
+
thinkSpherePage.contentEditableDiv().should('have.value', textToEnter);
|
3525
|
+
});
|
3526
|
+
},
|
3527
|
+
|
3528
|
+
verifyDisabledWriteYourPlanTextContainer: (textToEnter) => {
|
3529
|
+
thinkSpherePage.writePlanWrapper()
|
3530
|
+
.within(() => {
|
3531
|
+
thinkSpherePage.contentEditableDiv().should('have.attr', 'readonly');
|
3532
|
+
thinkSpherePage.contentEditableDiv().should('have.value', textToEnter);
|
3533
|
+
});
|
3534
|
+
},
|
3535
|
+
|
3536
|
+
verifyDisabledStrategyChip: () => {
|
3537
|
+
thinkSpherePage.strategyChip().should('have.attr', 'tabindex', -1);
|
3538
|
+
},
|
3539
|
+
|
3540
|
+
verifyQuestionInstructionPreviewTexWrapperVisibility: (instructionText) => {
|
3541
|
+
utilities.verifyElementVisibilityState(thinkSpherePage.questionInstructionPreviewTexWrapper(), 'visible');
|
3542
|
+
utilities.verifyInnerText(thinkSpherePage.questionInstructionPreviewTexWrapper(), instructionText);
|
3543
|
+
},
|
3544
|
+
|
3545
|
+
verifyQuestionInstructionPreviewImageWrapperVisibility: () => {
|
3546
|
+
utilities.verifyElementVisibilityState(thinkSpherePage.questionInstructionPreviewImageWrapper(), 'visible');
|
3547
|
+
utilities.verifyElementVisibilityState(thinkSpherePage.questionInstructionPreviewImageExpandButton(), 'visible');
|
3548
|
+
},
|
3549
|
+
};
|
3550
|
+
|
3551
|
+
const tests = {
|
3552
|
+
...essayResponsePage.tests,
|
3553
|
+
...createQuestionBasePage.tests,
|
3554
|
+
...backgroundImageUploadComponent.tests,
|
3555
|
+
...questionInstructionsComponent.tests,
|
3556
|
+
...commonComponents.tests,
|
3557
|
+
...scoringSectionBaseEditTab.tests,
|
3558
|
+
...additionalSettingsPanel.tests,
|
3559
|
+
...additionalSettingsAccessibilitySectionComponent.tests,
|
3560
|
+
...toolSettingsComponent.tests,
|
3561
|
+
...studentViewSettingsLabelComponent.tests,
|
3562
|
+
...defaultToolDropdown.tests,
|
3563
|
+
...optionsWrapperComponent.tests,
|
3564
|
+
...equationEditorFlyout.tests,
|
3565
|
+
|
3566
|
+
/**
|
3567
|
+
* Verifies the ThinkSphere cancel button functionality.
|
3568
|
+
* @param {string} questionType - The type of question.
|
3569
|
+
*/
|
3570
|
+
verifyThinkSphereCancelButton: (questionType) => {
|
3571
|
+
it('When user has made no edits and clicks on cancel button, the user should be directed back to the \'Select a Question\' page', () => {
|
3572
|
+
createQuestionBasePage.cancelButton()
|
3573
|
+
.click();
|
3574
|
+
});
|
3575
|
+
|
3576
|
+
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.\'', () => {
|
3577
|
+
thinkSpherePage.steps.navigateToThinkSphereCreateQuestion();
|
3578
|
+
questionInstructionsComponent.steps.addTextInQuestionInstructionsInputField('Edited');
|
3579
|
+
if (questionType !== 'feedback scale' && questionType !== 'highlight image' && questionType !== 'think sphere') {
|
3580
|
+
scoringSectionBaseEditTab.steps.allotPoints(20);
|
3581
|
+
};
|
3582
|
+
createQuestionBasePage.cancelButton()
|
3583
|
+
.click();
|
3584
|
+
utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'visible');
|
3585
|
+
utilities.verifyInnerText(dialogBoxBase.dialogBoxContentText(), 'Are you sure you want to leave this page? Your changes have not been saved.');
|
3586
|
+
utilities.verifyInnerText(dialogBoxBase.buttonAccept(), 'Yes, I want to leave this page');
|
3587
|
+
utilities.verifyInnerText(dialogBoxBase.buttonReject(), 'No, I\'d like to go back');
|
3588
|
+
});
|
3589
|
+
|
3590
|
+
it('CSS of popup', { tags: 'css' }, () => {
|
3591
|
+
utilities.verifyCSS(dialogBoxBase.dialogBox(), {
|
3592
|
+
'background-color': css.color.defaultBackground
|
3593
|
+
})
|
3594
|
+
|
3595
|
+
utilities.verifyCSS(dialogBoxBase.dialogBoxContent(), {
|
3596
|
+
'color': css.color.sectionHeading,
|
3597
|
+
'font-size': css.fontSize.default,
|
3598
|
+
'font-weight': css.fontWeight.regular
|
3599
|
+
});
|
3600
|
+
utilities.verifyCSS(dialogBoxBase.buttonAccept(), {
|
3601
|
+
'color': css.color.primaryBtn,
|
3602
|
+
'font-size': css.fontSize.default,
|
3603
|
+
'font-weight': css.fontWeight.semibold,
|
3604
|
+
'background-color': css.color.primaryBtnBg
|
3605
|
+
});
|
3606
|
+
utilities.verifyCSS(dialogBoxBase.buttonReject(), {
|
3607
|
+
'color': css.color.secondaryBtn,
|
3608
|
+
'font-size': css.fontSize.default,
|
3609
|
+
'font-weight': css.fontWeight.semibold,
|
3610
|
+
'background-color': css.color.transparent
|
3611
|
+
});
|
3612
|
+
});
|
3613
|
+
|
3614
|
+
it('Accessibility of popup', { tags: 'a11y' }, () => {
|
3615
|
+
cy.checkAccessibility(dialogBoxBase.dialogBox());
|
3616
|
+
});
|
3617
|
+
|
3618
|
+
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`, () => {
|
3619
|
+
dialogBoxBase.buttonReject()
|
3620
|
+
.click();
|
3621
|
+
createQuestionBasePage.editTab()
|
3622
|
+
.should('have.attr', 'aria-selected', 'true');
|
3623
|
+
utilities.verifyTextContent(questionInstructionsComponent.questionInstructionsInputField(), 'Edited');
|
3624
|
+
});
|
3625
|
+
|
3626
|
+
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.`, () => {
|
3627
|
+
createQuestionBasePage.cancelButton()
|
3628
|
+
.click();
|
3629
|
+
dialogBoxBase.buttonAccept()
|
3630
|
+
.click();
|
3631
|
+
});
|
3632
|
+
},
|
3633
|
+
|
3634
|
+
/**
|
3635
|
+
* Verifies the disabled delete button tooltip.
|
3636
|
+
* @param {number} NthElement - The index of the delete button.
|
3637
|
+
* @param {string} disableTooltipText - The tooltip text to verify.
|
3638
|
+
*/
|
3639
|
+
verifyDisabledDeleteButtonTooltip: (NthElement, disableTooltipText) => {
|
3640
|
+
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', () => {
|
3641
|
+
utilities.getNthElement(thinkSpherePage.deleteButton(), NthElement)
|
3642
|
+
.trigger('mouseover', { force: true });
|
3643
|
+
utilities.verifyInnerText(thinkSpherePage.tooltipText(), disableTooltipText);
|
3644
|
+
utilities.getNthElement(thinkSpherePage.deleteButton(), NthElement)
|
3645
|
+
.trigger('mouseout', { force: true });
|
3646
|
+
utilities.verifyElementVisibilityState(thinkSpherePage.tooltipText(), 'notExist');
|
3647
|
+
});
|
3648
|
+
|
3649
|
+
it('CSS of disabled delete button tooltip', { tags: 'css' }, () => {
|
3650
|
+
utilities.getNthElement(thinkSpherePage.deleteButton(), NthElement)
|
3651
|
+
.trigger('mouseover', { force: true });
|
3652
|
+
utilities.verifyElementVisibilityState(thinkSpherePage.tooltipText(), 'visible')
|
3653
|
+
utilities.verifyCSS(thinkSpherePage.tooltipText(), {
|
3654
|
+
'color': css.color.whiteText,
|
3655
|
+
'font-size': css.fontSize.small,
|
3656
|
+
'font-weight': css.fontWeight.regular
|
3657
|
+
});
|
3658
|
+
utilities.getNthElement(thinkSpherePage.deleteButton(), NthElement)
|
3659
|
+
.trigger('mouseout', { force: true });
|
3660
|
+
utilities.verifyElementVisibilityState(thinkSpherePage.tooltipText(), 'notExist');
|
3661
|
+
});
|
3662
|
+
},
|
3663
|
+
|
3664
|
+
/**
|
3665
|
+
* Verifies the add option functionality.
|
3666
|
+
* @param {string} list - The list to add the option to ('strategy' or other).
|
3667
|
+
* @param {Array<string>} optionList - The list of options.
|
3668
|
+
*/
|
3669
|
+
verifyAddOptionFunctionality: (list, optionList) => {
|
3670
|
+
it('When user adds an option using \'Add Option\' button then the added option input field should be displayed and option numeration should increment', () => {
|
3671
|
+
let initialOptionCount;
|
3672
|
+
if (list === 'strategy') {
|
3673
|
+
thinkSpherePage.planStrategySection()
|
3674
|
+
.within(() => {
|
3675
|
+
thinkSpherePage.steps.getOptionCount().then((count) => {
|
3676
|
+
initialOptionCount = count;
|
3677
|
+
});
|
3678
|
+
});
|
3679
|
+
|
3680
|
+
thinkSpherePage.steps.addOption(list);
|
3681
|
+
thinkSpherePage.planStrategySection()
|
3682
|
+
.within(() => {
|
3683
|
+
thinkSpherePage.steps.getOptionCount().should('eq', initialOptionCount + 1);
|
3684
|
+
thinkSpherePage.steps.verifyOptionsContents(initialOptionCount, '', 'Enter strategy name');
|
3685
|
+
});
|
3686
|
+
thinkSpherePage.steps.deleteOption(5);
|
3687
|
+
} else {
|
3688
|
+
thinkSpherePage.planSentenceStarterSection()
|
3689
|
+
.within(() => {
|
3690
|
+
thinkSpherePage.steps.getOptionCount().then((count) => {
|
3691
|
+
initialOptionCount = count;
|
3692
|
+
});
|
3693
|
+
});
|
3694
|
+
|
3695
|
+
thinkSpherePage.steps.addOption(list);
|
3696
|
+
thinkSpherePage.planSentenceStarterSection()
|
3697
|
+
.within(() => {
|
3698
|
+
thinkSpherePage.steps.getOptionCount().should('eq', initialOptionCount + 1);
|
3699
|
+
thinkSpherePage.steps.verifyOptionsContents(initialOptionCount, '', 'Enter sentence starter name');
|
3700
|
+
});
|
3701
|
+
thinkSpherePage.steps.deleteOption(10);
|
3702
|
+
}
|
3703
|
+
});
|
3704
|
+
},
|
3705
|
+
|
3706
|
+
/**
|
3707
|
+
* Verifies the contents and styling of the 'Options' section.
|
3708
|
+
* @param {Object} params - The parameters for the function.
|
3709
|
+
* @param {number} params.optionFieldsCount - The expected number of option input fields.
|
3710
|
+
* @param {Array<string>} params.optionList - The list of options.
|
3711
|
+
* @param {string} params.placeholder - The placeholder text.
|
3712
|
+
* @param {string} params.list - The list to verify ('strategy' or other).
|
3713
|
+
*/
|
3714
|
+
verifyListSectionContents: ({
|
3715
|
+
optionFieldsCount,
|
3716
|
+
optionList,
|
3717
|
+
placeholder,
|
3718
|
+
list,
|
3719
|
+
}) => {
|
3720
|
+
it(`By default ${optionFieldsCount} option input fields with placeholder text, drag handle and delete option icon buttons should be displayed`, () => {
|
3721
|
+
for (let index = 0; index < optionFieldsCount; index++) {
|
3722
|
+
if (list === 'strategy') {
|
3723
|
+
thinkSpherePage.planStrategySection()
|
3724
|
+
.within(() => {
|
3725
|
+
cy.log(optionList, optionList[index])
|
3726
|
+
thinkSpherePage.steps.verifyOptionsContents(index, optionList[index], placeholder);
|
3727
|
+
})
|
3728
|
+
} else {
|
3729
|
+
thinkSpherePage.planSentenceStarterSection()
|
3730
|
+
.within(() => {
|
3731
|
+
cy.log(optionList, optionList[index])
|
3732
|
+
thinkSpherePage.steps.verifyOptionsContents(index, optionList[index], placeholder);
|
3733
|
+
})
|
3734
|
+
}
|
3735
|
+
};
|
3736
|
+
});
|
3737
|
+
|
3738
|
+
it('\'Add Option\' button should be present', () => {
|
3739
|
+
if (list === 'strategy') {
|
3740
|
+
utilities.verifyInnerText(thinkSpherePage.planStrategyAddItemButton().find('p'), 'Add strategy');
|
3741
|
+
utilities.verifyElementVisibilityState(thinkSpherePage.planStrategyAddItemButton(), 'visible');
|
3742
|
+
} else {
|
3743
|
+
utilities.verifyInnerText(thinkSpherePage.planSentenceStarterAddItemButton().find('p'), 'Add sentence starter');
|
3744
|
+
utilities.verifyElementVisibilityState(thinkSpherePage.planSentenceStarterAddItemButton(), 'visible');
|
3745
|
+
}
|
3746
|
+
});
|
3747
|
+
|
3748
|
+
it('CSS of Options section', { tags: 'css' }, () => {
|
3749
|
+
const withinComponent = (list === 'strategy') ? thinkSpherePage.planStrategySection() : thinkSpherePage.planSentenceStarterSection();
|
3750
|
+
|
3751
|
+
withinComponent.within(() => {
|
3752
|
+
utilities.verifyCSS(thinkSpherePage.dragHandleButton().find('path'), {
|
3753
|
+
'fill': css.color.secondaryBtnActive
|
3754
|
+
});
|
3755
|
+
thinkSpherePage.deleteButton()
|
3756
|
+
.verifyPseudoClassBeforeProperty('color', css.color.deleteIcon);
|
3757
|
+
utilities.verifyCSS(utilities.getNthElement(thinkSpherePage.listInputField(), 0), {
|
3758
|
+
'color': css.color.text,
|
3759
|
+
'font-size': css.fontSize.default,
|
3760
|
+
'font-weight': css.fontWeight.regular
|
3761
|
+
});
|
3762
|
+
});
|
3763
|
+
|
3764
|
+
if (list === 'strategy') {
|
3765
|
+
utilities.verifyCSS(thinkSpherePage.planStrategyAddItemButton().find('p'), {
|
3766
|
+
'color': css.color.secondaryBtnActive,
|
3767
|
+
'font-size': css.fontSize.default,
|
3768
|
+
'font-weight': css.fontWeight.regular
|
3769
|
+
});
|
3770
|
+
} else {
|
3771
|
+
utilities.verifyCSS(thinkSpherePage.planSentenceStarterAddItemButton().find('p'), {
|
3772
|
+
'color': css.color.secondaryBtnActive,
|
3773
|
+
'font-size': css.fontSize.default,
|
3774
|
+
'font-weight': css.fontWeight.regular
|
3775
|
+
});
|
3776
|
+
}
|
3777
|
+
});
|
3778
|
+
},
|
3779
|
+
|
3780
|
+
/**
|
3781
|
+
* Verifies the drag handle tooltip.
|
3782
|
+
* @param {number} NthElement - The index of the drag handle.
|
3783
|
+
*/
|
3784
|
+
verifyDragHandleTooltip: (NthElement) => {
|
3785
|
+
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', () => {
|
3786
|
+
utilities.triggerMouseover(utilities.getNthElement(thinkSpherePage.dragHandleButton(), NthElement));
|
3787
|
+
utilities.verifyInnerText(thinkSpherePage.tooltipText(), 'Drag to reorder');
|
3788
|
+
utilities.triggerMouseout(utilities.getNthElement(thinkSpherePage.dragHandleButton(), NthElement));
|
3789
|
+
utilities.verifyElementVisibilityState(thinkSpherePage.tooltipText(), 'notExist');
|
3790
|
+
});
|
3791
|
+
|
3792
|
+
it('CSS of drag handle tooltip', { tags: 'css' }, () => {
|
3793
|
+
utilities.getNthElement(thinkSpherePage.optionWrapper(), NthElement)
|
3794
|
+
.within(() => {
|
3795
|
+
utilities.triggerMouseover(thinkSpherePage.dragHandleButton());
|
3796
|
+
});
|
3797
|
+
utilities.verifyCSS(thinkSpherePage.tooltipText(), {
|
3798
|
+
'color': css.color.whiteText,
|
3799
|
+
'font-size': css.fontSize.small,
|
3800
|
+
'font-weight': css.fontWeight.regular
|
3801
|
+
});
|
3802
|
+
utilities.getNthElement(thinkSpherePage.optionWrapper(), NthElement)
|
3803
|
+
.within(() => {
|
3804
|
+
utilities.triggerMouseout(thinkSpherePage.dragHandleButton())
|
3805
|
+
});
|
3806
|
+
utilities.verifyElementVisibilityState(thinkSpherePage.tooltipText(), 'notExist');
|
3807
|
+
});
|
3808
|
+
|
3809
|
+
it('Accessibility of drag handle tooltip', { tags: 'a11y' }, () => {
|
3810
|
+
utilities.getNthElement(thinkSpherePage.optionWrapper(), NthElement)
|
3811
|
+
.within(() => {
|
3812
|
+
utilities.triggerMouseover(thinkSpherePage.dragHandleButton());
|
3813
|
+
});
|
3814
|
+
utilities.verifyElementVisibilityState(thinkSpherePage.tooltipText(), 'visible');
|
3815
|
+
utilities.getNthElement(thinkSpherePage.optionWrapper(), NthElement)
|
3816
|
+
.within(() => {
|
3817
|
+
utilities.triggerMouseout(thinkSpherePage.dragHandleButton())
|
3818
|
+
});
|
3819
|
+
utilities.verifyElementVisibilityState(thinkSpherePage.tooltipText(), 'notExist');
|
3820
|
+
});
|
3821
|
+
},
|
3822
|
+
|
3823
|
+
/**
|
3824
|
+
* Verifies the enabled delete button and tooltip.
|
3825
|
+
* @param {string} list - The list to verify ('strategy' or other).
|
3826
|
+
* @param {number} NthElement - The index of the delete button.
|
3827
|
+
*/
|
3828
|
+
verifyEnabledDeleteButtonAndTooltip: (list, NthElement) => {
|
3829
|
+
it('When the number of options are greater than 1 and both the options are selected then the \'Delete\' icon buttons should get enabled', () => {
|
3830
|
+
thinkSpherePage.steps.selectOption(list, 1);
|
3831
|
+
thinkSpherePage.deleteButton()
|
3832
|
+
.should('be.enabled');
|
3833
|
+
});
|
3834
|
+
|
3835
|
+
it('CSS of enabled \'Delete\' option button', { tags: 'css' }, () => {
|
3836
|
+
utilities.verifyCSS(utilities.getNthElement(thinkSpherePage.deleteButton(), NthElement), {
|
3837
|
+
'opacity': '1'
|
3838
|
+
});
|
3839
|
+
utilities.getNthElement(thinkSpherePage.deleteButton(), NthElement)
|
3840
|
+
.verifyPseudoClassBeforeProperty('color', css.color.deleteIcon)
|
3841
|
+
});
|
3842
|
+
|
3843
|
+
it('Accessibility of enabled \'Delete\' option button', { tags: 'a11y' }, () => {
|
3844
|
+
cy.checkAccessibility(thinkSpherePage.deleteButton());
|
3845
|
+
});
|
3846
|
+
|
3847
|
+
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', () => {
|
3848
|
+
utilities.getNthElement(thinkSpherePage.deleteButton(), NthElement)
|
3849
|
+
.verifyTooltip(list === 'strategy' ? 'Delete strategy' : 'Delete sentence starter');
|
3850
|
+
});
|
3851
|
+
|
3852
|
+
it('CSS of enabled delete button tooltip', { tags: 'css' }, () => {
|
3853
|
+
utilities.triggerMouseover(utilities.getNthElement(thinkSpherePage.deleteButton(), NthElement));
|
3854
|
+
utilities.verifyElementVisibilityState(thinkSpherePage.tooltipText(), 'visible')
|
3855
|
+
utilities.verifyCSS(thinkSpherePage.tooltipText(), {
|
3856
|
+
'color': css.color.whiteText,
|
3857
|
+
'font-size': css.fontSize.small,
|
3858
|
+
'font-weight': css.fontWeight.regular
|
3859
|
+
});
|
3860
|
+
utilities.triggerMouseout(utilities.getNthElement(thinkSpherePage.deleteButton(), NthElement));
|
3861
|
+
utilities.verifyElementVisibilityState(thinkSpherePage.tooltipText(), 'notExist');
|
3862
|
+
});
|
3863
|
+
},
|
3864
|
+
|
3865
|
+
/**
|
3866
|
+
* Verifies the options checkbox component.
|
3867
|
+
* @param {string} list - The list to verify ('strategy' or other).
|
3868
|
+
*/
|
3869
|
+
verifyOptionsCheckboxComponent: (list) => {
|
3870
|
+
it('Option checkbox button should be present', () => {
|
3871
|
+
if (list === 'strategy') {
|
3872
|
+
utilities.getNthElement(thinkSpherePage.planStrategyCheckbox(), 0)
|
3873
|
+
.find('input')
|
3874
|
+
.should('have.attr', 'type', 'checkbox')
|
3875
|
+
.should('have.attr', 'checked');
|
3876
|
+
} else {
|
3877
|
+
utilities.getNthElement(thinkSpherePage.planSentenceStarterCheckbox(), 0)
|
3878
|
+
.find('input')
|
3879
|
+
.should('have.attr', 'type', 'checkbox')
|
3880
|
+
.should('have.attr', 'checked');
|
3881
|
+
}
|
3882
|
+
});
|
3883
|
+
|
3884
|
+
it('CSS of checked checkbox button', { tags: 'css' }, () => {
|
3885
|
+
if (list === 'strategy') {
|
3886
|
+
utilities.verifyCSS(
|
3887
|
+
utilities.getNthElement(thinkSpherePage.planStrategyCheckbox().find('svg g g'), 0), {
|
3888
|
+
'fill': css.color.primaryBtnBg,
|
3889
|
+
});
|
3890
|
+
utilities.verifyCSS(
|
3891
|
+
utilities.getNthElement(thinkSpherePage.planStrategyCheckbox().find('svg'), 0), {
|
3892
|
+
'width': '12px',
|
3893
|
+
'height': '12px',
|
3894
|
+
});
|
3895
|
+
} else {
|
3896
|
+
utilities.verifyCSS(
|
3897
|
+
utilities.getNthElement(thinkSpherePage.planSentenceStarterCheckbox().find('svg g g'), 0), {
|
3898
|
+
'fill': css.color.primaryBtnBg,
|
3899
|
+
});
|
3900
|
+
utilities.verifyCSS(
|
3901
|
+
utilities.getNthElement(thinkSpherePage.planSentenceStarterCheckbox().find('svg'), 0), {
|
3902
|
+
'width': '12px',
|
3903
|
+
'height': '12px',
|
3904
|
+
});
|
3905
|
+
}
|
3906
|
+
});
|
3907
|
+
|
3908
|
+
it('When user clicks on the checkbox button then the checkbox should get unchecked', () => {
|
3909
|
+
if (list === 'strategy') {
|
3910
|
+
thinkSpherePage.steps.selectOption(list, 0);
|
3911
|
+
utilities.getNthElement(thinkSpherePage.planStrategyCheckbox(), 0)
|
3912
|
+
.find('input')
|
3913
|
+
.should('not.be.checked');
|
3914
|
+
thinkSpherePage.steps.selectOption(list, 0);
|
3915
|
+
} else {
|
3916
|
+
thinkSpherePage.steps.selectOption(list, 0);
|
3917
|
+
utilities.getNthElement(thinkSpherePage.planSentenceStarterCheckbox(), 0)
|
3918
|
+
.find('input')
|
3919
|
+
.should('not.be.checked');
|
3920
|
+
thinkSpherePage.steps.selectOption(list, 0);
|
3921
|
+
}
|
3922
|
+
});
|
3923
|
+
|
3924
|
+
it('CSS of unchecked checkbox button', { tags: 'css' }, () => {
|
3925
|
+
if (list === 'strategy') {
|
3926
|
+
thinkSpherePage.steps.selectOption(list, 1);
|
3927
|
+
utilities.verifyCSS(
|
3928
|
+
utilities.getNthElement(thinkSpherePage.planStrategyCheckbox().find('svg'), 1), {
|
3929
|
+
'fill': css.color.uncheckedCheckbox,
|
3930
|
+
'width': '12px',
|
3931
|
+
'height': '12px',
|
3932
|
+
});
|
3933
|
+
} else {
|
3934
|
+
thinkSpherePage.steps.selectOption(list, 1);
|
3935
|
+
utilities.verifyCSS(
|
3936
|
+
utilities.getNthElement(thinkSpherePage.planSentenceStarterCheckbox().find('svg'), 1), {
|
3937
|
+
'fill': css.color.uncheckedCheckbox,
|
3938
|
+
'width': '12px',
|
3939
|
+
'height': '12px',
|
3940
|
+
});
|
3941
|
+
}
|
3942
|
+
});
|
3943
|
+
|
3944
|
+
it('Accessibility of checked \'Checkbox\' button', { tags: 'a11y' }, () => {
|
3945
|
+
if (list === 'strategy') {
|
3946
|
+
cy.checkAccessibility(thinkSpherePage.planStrategyCheckbox());
|
3947
|
+
} else {
|
3948
|
+
cy.checkAccessibility(thinkSpherePage.planSentenceStarterCheckbox());
|
3949
|
+
}
|
3950
|
+
});
|
3951
|
+
},
|
3952
|
+
|
3953
|
+
/**
|
3954
|
+
* Verifies the CSS of the 'Option' input field.
|
3955
|
+
* @param {string} list - The list type ('strategy' or other).
|
3956
|
+
*/
|
3957
|
+
verifyOptionsInput: (list) => {
|
3958
|
+
it('CSS of \'Option\' input field', () => {
|
3959
|
+
if (list === 'strategy') {
|
3960
|
+
utilities.verifyCSS(utilities.getNthElement(thinkSpherePage.listInputField().parent(), 0), {
|
3961
|
+
'border': `1px solid ${css.color.figDefaultComponentBorder}`,
|
3962
|
+
'border-radius': '8px',
|
3963
|
+
'font-size': css.fontSize.default,
|
3964
|
+
'font-weight': css.fontWeight.regular,
|
3965
|
+
});
|
3966
|
+
} else {
|
3967
|
+
utilities.verifyCSS(utilities.getNthElement(thinkSpherePage.listInputField().parent(), 5), {
|
3968
|
+
'border': `1px solid ${css.color.figDefaultComponentBorder}`,
|
3969
|
+
'border-radius': '8px',
|
3970
|
+
'font-size': css.fontSize.default,
|
3971
|
+
'font-weight': css.fontWeight.regular,
|
3972
|
+
});
|
3973
|
+
}
|
3974
|
+
});
|
3975
|
+
},
|
3976
|
+
|
3977
|
+
/**
|
3978
|
+
* Verifies that at least one option is required.
|
3979
|
+
* @param {string} list - The list type ('strategy' or other).
|
3980
|
+
* @param {Array<string>} listOptions - The list of options.
|
3981
|
+
* @param {string} disableTooltipText - The tooltip text to display when the delete button is disabled.
|
3982
|
+
*/
|
3983
|
+
verifyAtleastOneOptionIsRequired: (list, listOptions, disableTooltipText) => {
|
3984
|
+
const optionsToBeDeleted = listOptions.filter((el) => el !== listOptions[0]);
|
3985
|
+
|
3986
|
+
it('When the user deletes the last option, then the \'Delete\' icon button should get disabled', () => {
|
3987
|
+
optionsToBeDeleted.forEach(() => { thinkSpherePage.steps.deleteOption(list === 'strategy' ? 1 : 6) });
|
3988
|
+
thinkSpherePage.steps.verifyDeleteOptionButtonDisabledState(list);
|
3989
|
+
optionsToBeDeleted.forEach(() => { thinkSpherePage.steps.addOption(list) });
|
3990
|
+
listOptions.forEach((inputFieldText, optionIndex) => {
|
3991
|
+
thinkSpherePage.steps.addOptionText(list, optionIndex, inputFieldText);
|
3992
|
+
});
|
3993
|
+
});
|
3994
|
+
|
3995
|
+
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', () => {
|
3996
|
+
utilities.getNthElement(thinkSpherePage.deleteButton(), list === 'strategy' ? 0 : 5)
|
3997
|
+
.trigger('mouseover', { force: true });
|
3998
|
+
utilities.verifyInnerText(thinkSpherePage.tooltipText(), disableTooltipText);
|
3999
|
+
utilities.getNthElement(thinkSpherePage.deleteButton(), list === 'strategy' ? 0 : 5)
|
4000
|
+
.trigger('mouseout', { force: true });
|
4001
|
+
utilities.verifyElementVisibilityState(thinkSpherePage.tooltipText(), 'notExist');
|
4002
|
+
});
|
4003
|
+
|
4004
|
+
it('When the user uncheck the last option, then the \'Checkbox\' icon button should get disabled', () => {
|
4005
|
+
thinkSpherePage.steps.verifyCheckboxButtonDisabledState(list, 0);
|
4006
|
+
});
|
4007
|
+
},
|
4008
|
+
|
4009
|
+
verifyUploadImageSectionContentWithCSSAndA11y: () => {
|
4010
|
+
it('\'Upload\' label and \'Choose file\' button should be displayed', () => {
|
4011
|
+
utilities.verifyInnerText(backgroundImageUploadComponent.uploadLabel(), 'Upload');
|
4012
|
+
utilities.verifyElementVisibilityState(backgroundImageUploadComponent.uploadLabel(), 'visible');
|
4013
|
+
utilities.verifyInnerText(backgroundImageUploadComponent.chooseFileButton(), 'Choose file');
|
4014
|
+
utilities.verifyElementVisibilityState(backgroundImageUploadComponent.chooseFileButton(), 'visible');
|
4015
|
+
});
|
4016
|
+
|
4017
|
+
it('\'File name\' label should be displayed and by default \'No file chosen\' text should be displayed below the \'File name\' label.', () => {
|
4018
|
+
utilities.verifyInnerText(backgroundImageUploadComponent.fileNameLabel(), 'File name');
|
4019
|
+
utilities.verifyElementVisibilityState(backgroundImageUploadComponent.fileNameLabel(), 'visible');
|
4020
|
+
utilities.verifyInnerText(backgroundImageUploadComponent.noFileChosenLabel(), 'No file chosen');
|
4021
|
+
utilities.verifyElementVisibilityState(backgroundImageUploadComponent.noFileChosenLabel(), 'visible');
|
4022
|
+
});
|
4023
|
+
|
4024
|
+
backgroundImageUploadComponent.tests.verifyCSSAndA11yBeforeUpload();
|
4025
|
+
|
4026
|
+
backgroundImageUploadComponent.tests.verifyImageUploadFunctionality('thinkSphere');
|
4027
|
+
},
|
4028
|
+
|
4029
|
+
verifyQuestionInstructionsInputFieldThinkSpherePreviewTab: () => {
|
4030
|
+
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', () => {
|
4031
|
+
createQuestionBasePage.steps.switchToPreviewTab();
|
4032
|
+
//Failing due to https://redmine.zeuslearning.com/issues/553382
|
4033
|
+
utilities.verifyElementVisibilityState(questionInstructionsComponent.questionInstructionsText(), 'notExist')
|
4034
|
+
});
|
4035
|
+
|
4036
|
+
it('When the user specifies question instructions, then the added question instructions should be displayed in the \'Preview\' tab', () => {
|
4037
|
+
createQuestionBasePage.steps.switchToEditTab();
|
4038
|
+
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.');
|
4039
|
+
// UNCOMMENT BELOW CODE WHEN PREVIEW TAB IS AVAILABLE FOR THINKSPHERE
|
4040
|
+
// createQuestionBasePage.steps.switchToPreviewTab();
|
4041
|
+
// 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.');
|
4042
|
+
});
|
4043
|
+
},
|
4044
|
+
|
4045
|
+
verifyResetToDefaultFunctionality: (optionList, listType) => {
|
4046
|
+
if (listType === 'strategy') {
|
4047
|
+
it('When user clicks on \'Reset to default\' button then the strategy list should be reset to default', () => {
|
4048
|
+
thinkSpherePage.planStrategyListResetToDefault()
|
4049
|
+
.click();
|
4050
|
+
optionList.forEach((option, index) => {
|
4051
|
+
thinkSpherePage.steps.verifyOptionsContents(index, option, 'Enter strategy name');
|
4052
|
+
});
|
4053
|
+
});
|
4054
|
+
} else {
|
4055
|
+
it('When user clicks on \'Reset to default\' button then the sentence starter list should be reset to default', () => {
|
4056
|
+
thinkSpherePage.planSentenceStarterListResetToDefault()
|
4057
|
+
.click();
|
4058
|
+
thinkSpherePage.planSentenceStarterSection()
|
4059
|
+
.within(() => {
|
4060
|
+
optionList.forEach((option, index) => {
|
4061
|
+
thinkSpherePage.steps.verifyOptionsContents(index, option, 'Enter sentence starter name');
|
4062
|
+
});
|
4063
|
+
})
|
4064
|
+
});
|
4065
|
+
}
|
4066
|
+
},
|
4067
|
+
|
4068
|
+
verifyVideoLinkComponent: () => {
|
4069
|
+
it('Video link component should be displayed', () => {
|
4070
|
+
utilities.verifyElementVisibilityState(thinkSpherePage.videoLinkComponent(), 'visible');
|
4071
|
+
utilities.verifyInnerText(thinkSpherePage.videoLinkComponent(), 'Upload video');
|
4072
|
+
});
|
4073
|
+
|
4074
|
+
it('CSS of video link component', { tags: 'css' }, () => {
|
4075
|
+
thinkSpherePage.videoLinkComponent()
|
4076
|
+
.within(() => {
|
4077
|
+
utilities.verifyCSS(thinkSpherePage.uploadVideoLinkButton(), {
|
4078
|
+
'color': css.color.linkText,
|
4079
|
+
'font-size': css.fontSize.default,
|
4080
|
+
'font-weight': css.fontWeight.regular,
|
4081
|
+
'font-family': '"Nunito Sans"',
|
4082
|
+
'text-decoration-line': 'underline',
|
4083
|
+
});
|
4084
|
+
|
4085
|
+
cy.log('CSS of video link component on hover state');
|
4086
|
+
utilities.hoverOverElement(thinkSpherePage.uploadVideoLinkButton());
|
4087
|
+
utilities.verifyCSS(thinkSpherePage.uploadVideoLinkButton(), {
|
4088
|
+
'text-decoration-line': 'none',
|
4089
|
+
});
|
4090
|
+
});
|
4091
|
+
});
|
4092
|
+
|
4093
|
+
it('When user upload a file whose extension is not supported then an error message should be displayed', () => {
|
4094
|
+
thinkSpherePage.videoLinkComponent()
|
4095
|
+
.within(() => {
|
4096
|
+
thinkSpherePage.uploadVideoLinkButton()
|
4097
|
+
.click();
|
4098
|
+
});
|
4099
|
+
thinkSpherePage.steps.uploadVideoFile('uploads/sample.wmv');
|
4100
|
+
thinkSpherePage.steps.verifyWarningPopup('File upload error', 'The file type is not supported. Please upload files with the following supported formats: mp4, webm.');
|
4101
|
+
});
|
4102
|
+
|
4103
|
+
it('CSS of warning popup', { tags: 'css' }, () => {
|
4104
|
+
utilities.verifyCSS(dialogBoxBase.dialogBox(), {
|
4105
|
+
'border': `1px solid ${css.color.secondaryBtnBorder}`,
|
4106
|
+
'border-radius': '8px',
|
4107
|
+
'background-color': css.color.primaryBtn,
|
4108
|
+
'box-shadow': `${css.color.dialogBoxBoxShadow} 0px 0px 10px 0px`,
|
4109
|
+
});
|
4110
|
+
|
4111
|
+
dialogBoxBase.dialogBoxTitle().within(() => {
|
4112
|
+
utilities.verifyCSS(thinkSpherePage.warningPopupTitle(), {
|
4113
|
+
'color': css.color.secondaryBtn,
|
4114
|
+
'font-size': css.fontSize.heading,
|
4115
|
+
'font-weight': css.fontWeight.bold
|
4116
|
+
});
|
4117
|
+
});
|
4118
|
+
|
4119
|
+
dialogBoxBase.dialogBoxContent().within(() => {
|
4120
|
+
utilities.verifyCSS(thinkSpherePage.warningPopupContentText(), {
|
4121
|
+
'color': css.color.sectionHeading,
|
4122
|
+
'font-size': css.fontSize.default,
|
4123
|
+
'font-weight': css.fontWeight.regular,
|
4124
|
+
'font-family': 'Inter'
|
4125
|
+
});
|
4126
|
+
|
4127
|
+
utilities.verifyCSS(thinkSpherePage.warningPopupOkButton(), {
|
4128
|
+
'background-color': css.color.primaryBtnBg,
|
4129
|
+
'border': `1px solid ${css.color.primaryBtnBorder}`,
|
4130
|
+
'color': css.color.primaryBtn,
|
4131
|
+
'border-radius': '8px',
|
4132
|
+
'font-size': css.fontSize.default,
|
4133
|
+
'font-weight': css.fontWeight.semibold,
|
4134
|
+
'font-family': '"Nunito Sans"',
|
4135
|
+
'box-shadow': `${css.color.primaryBtnBorder} 0px 5px 0px 0px`
|
4136
|
+
});
|
4137
|
+
});
|
4138
|
+
});
|
4139
|
+
|
4140
|
+
it('When user click on OK button of warning popup then the popup should be closed', () => {
|
4141
|
+
dialogBoxBase.dialogBoxContent().within(() => {
|
4142
|
+
thinkSpherePage.warningPopupOkButton()
|
4143
|
+
.click();
|
4144
|
+
});
|
4145
|
+
utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'notExist');
|
4146
|
+
});
|
4147
|
+
|
4148
|
+
it('When user upload a file whose extension is supported then no error message should be displayed', () => {
|
4149
|
+
thinkSpherePage.videoLinkComponent()
|
4150
|
+
.within(() => {
|
4151
|
+
thinkSpherePage.uploadVideoLinkButton()
|
4152
|
+
.click();
|
4153
|
+
});
|
4154
|
+
thinkSpherePage.steps.uploadVideoFile('uploads/sample.webm');
|
4155
|
+
utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'notExist');
|
4156
|
+
thinkSpherePage.videoLinkComponent()
|
4157
|
+
.within(() => {
|
4158
|
+
thinkSpherePage.deleteVideoButton()
|
4159
|
+
.click();
|
4160
|
+
});
|
4161
|
+
});
|
4162
|
+
|
4163
|
+
it('When user upload a file of size more than 25MB then an error message should be displayed', () => {
|
4164
|
+
thinkSpherePage.videoLinkComponent()
|
4165
|
+
.within(() => {
|
4166
|
+
thinkSpherePage.uploadVideoLinkButton()
|
4167
|
+
.click();
|
4168
|
+
});
|
4169
|
+
thinkSpherePage.steps.uploadVideoFile('uploads/sample30MB.mp4');
|
4170
|
+
thinkSpherePage.steps.verifyWarningPopup('File upload error', 'The file could not be uploaded. The file is 31 MB exceeding the maximum size of 25 MB.');
|
4171
|
+
});
|
4172
|
+
|
4173
|
+
it('When user click on OK button of warning popup then the popup should be closed', () => {
|
4174
|
+
dialogBoxBase.dialogBoxContent().within(() => {
|
4175
|
+
thinkSpherePage.warningPopupOkButton()
|
4176
|
+
.click();
|
4177
|
+
});
|
4178
|
+
utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'notExist');
|
4179
|
+
});
|
4180
|
+
|
4181
|
+
it('When user upload a file of size less than 25MB then no error message should be displayed and video uploaded successfully', () => {
|
4182
|
+
thinkSpherePage.videoLinkComponent()
|
4183
|
+
.within(() => {
|
4184
|
+
thinkSpherePage.uploadVideoLinkButton()
|
4185
|
+
.click();
|
4186
|
+
});
|
4187
|
+
thinkSpherePage.steps.uploadVideoFile('uploads/sample2MB.mp4');
|
4188
|
+
cy.interceptGraphql('getFileScanStatus');
|
4189
|
+
cy.wait(5000);
|
4190
|
+
utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'notExist');
|
4191
|
+
});
|
4192
|
+
|
4193
|
+
it('When user upload correct file then uploaded file name, edit video button along with delete video button should present', () => {
|
4194
|
+
thinkSpherePage.videoLinkComponent().within(() => {
|
4195
|
+
utilities.verifyInnerText(thinkSpherePage.uploadVideoLinkButton(), 'sample2MB.mp4');
|
4196
|
+
utilities.verifyElementVisibilityState(thinkSpherePage.editVideoButton(), 'visible');
|
4197
|
+
utilities.verifyElementVisibilityState(thinkSpherePage.deleteVideoButton(), 'visible');
|
4198
|
+
});
|
4199
|
+
});
|
4200
|
+
|
4201
|
+
it('CSS of edit video button and delete video button', { tags: 'css' }, () => {
|
4202
|
+
thinkSpherePage.videoLinkComponent().within(() => {
|
4203
|
+
utilities.verifyCSS(thinkSpherePage.editVideoButton(), {
|
4204
|
+
'width': '24px',
|
4205
|
+
'height': '24px',
|
4206
|
+
'background-color': css.color.transparent,
|
4207
|
+
});
|
4208
|
+
utilities.verifyCSS(thinkSpherePage.deleteVideoButton(), {
|
4209
|
+
'width': '24px',
|
4210
|
+
'height': '24px',
|
4211
|
+
'background-color': css.color.transparent,
|
4212
|
+
});
|
4213
|
+
});
|
4214
|
+
});
|
4215
|
+
|
4216
|
+
it('When user upload another file size less than 25MB then no error message should be displayed and video uploaded successfully', () => {
|
4217
|
+
thinkSpherePage.videoLinkComponent()
|
4218
|
+
.within(() => {
|
4219
|
+
thinkSpherePage.editVideoButton()
|
4220
|
+
.click();
|
4221
|
+
});
|
4222
|
+
thinkSpherePage.steps.uploadVideoFile('uploads/sample2MB_2.mp4');
|
4223
|
+
cy.interceptGraphql('getFileScanStatus');
|
4224
|
+
cy.wait(5000);
|
4225
|
+
utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'notExist');
|
4226
|
+
});
|
4227
|
+
|
4228
|
+
it('When user upload another correct file then uploaded file name, edit video button along with delete video button should present', () => {
|
4229
|
+
thinkSpherePage.videoLinkComponent().within(() => {
|
4230
|
+
utilities.verifyInnerText(thinkSpherePage.uploadVideoLinkButton(), 'sample2MB_2.mp4');
|
4231
|
+
utilities.verifyElementVisibilityState(thinkSpherePage.editVideoButton(), 'visible');
|
4232
|
+
utilities.verifyElementVisibilityState(thinkSpherePage.deleteVideoButton(), 'visible');
|
4233
|
+
});
|
4234
|
+
});
|
4235
|
+
|
4236
|
+
it('When user click on delete video button then the video should be deleted', () => {
|
4237
|
+
thinkSpherePage.videoLinkComponent()
|
4238
|
+
.within(() => {
|
4239
|
+
thinkSpherePage.deleteVideoButton()
|
4240
|
+
.click();
|
4241
|
+
});
|
4242
|
+
utilities.verifyInnerText(thinkSpherePage.videoLinkComponent(), 'Upload video');
|
4243
|
+
});
|
4244
|
+
|
4245
|
+
it('Accessibility of video link component', { tags: 'a11y' }, () => {
|
4246
|
+
cy.checkAccessibility(thinkSpherePage.singleOptionTextFieldWrapper());
|
4247
|
+
});
|
4248
|
+
},
|
4249
|
+
|
4250
|
+
verifyErrorMessageCSSAndA11y: () => {
|
4251
|
+
it('CSS of error message', { tags: 'css' }, () => {
|
4252
|
+
utilities.verifyCSS(commonComponents.errorMessage(), {
|
4253
|
+
'color': css.color.errorText,
|
4254
|
+
'font-size': css.fontSize.small,
|
4255
|
+
'font-weight': css.fontWeight.regular
|
4256
|
+
});
|
4257
|
+
});
|
4258
|
+
|
4259
|
+
it('Accessibility of error message', { tags: 'a11y' }, () => {
|
4260
|
+
cy.checkAccessibility(thinkSpherePage.nextGenThinkSphereCreateItemWrapper());
|
4261
|
+
});
|
4262
|
+
},
|
4263
|
+
|
4264
|
+
verifyQuestionAccordion: () => {
|
4265
|
+
it('Author should be able to expand and collapse the question accordion by clicking on the expand icon', () => {
|
4266
|
+
thinkSpherePage.filterSectionQuestionAccordion().each(($accordion) => {
|
4267
|
+
cy.wrap($accordion).find('.expansion-item-icon-wrapper').click();
|
4268
|
+
cy.wrap($accordion).should('have.class', 'Mui-expanded');
|
4269
|
+
});
|
4270
|
+
|
4271
|
+
thinkSpherePage.filterSectionQuestionAccordion().each(($accordion) => {
|
4272
|
+
cy.wrap($accordion).find('.expansion-item-icon-wrapper').click();
|
4273
|
+
cy.wrap($accordion).should('not.have.class', 'Mui-expanded');
|
4274
|
+
});
|
4275
|
+
});
|
4276
|
+
},
|
4277
|
+
|
4278
|
+
verifyCreateItemHeaderSection: () => {
|
4279
|
+
it('The page displays a unique Reference ID at the top left corner in the format "Ref ID:"', () => {
|
4280
|
+
utilities.verifyElementVisibilityState(thinkSpherePage.referenceIdWrapper(), 'visible');
|
4281
|
+
utilities.verifyInnerText(thinkSpherePage.referenceIdWrapper().children('div').first(), 'Ref ID:\u00A0');
|
4282
|
+
const initialRefId = thinkSpherePage.referenceIdWrapper().children('div').eq(1).invoke('text');
|
4283
|
+
initialRefId.then((refId) => {
|
4284
|
+
expect(refId).to.be.a('string').and.not.be.empty;
|
4285
|
+
cy.reload();
|
4286
|
+
thinkSpherePage.referenceIdWrapper().children('div').eq(1).invoke('text').should((newRefId) => {
|
4287
|
+
expect(newRefId).to.be.a('string').and.not.be.empty;
|
4288
|
+
expect(newRefId).to.not.equal(refId);
|
4289
|
+
});
|
4290
|
+
});
|
4291
|
+
});
|
4292
|
+
|
4293
|
+
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' , () => {
|
4294
|
+
utilities.verifyElementVisibilityState(thinkSpherePage.editBoxTextInput(), 'visible');
|
4295
|
+
thinkSpherePage.editBoxTextInput().blur();
|
4296
|
+
utilities.verifyElementVisibilityState(thinkSpherePage.editIconPencil(), 'visible');
|
4297
|
+
thinkSpherePage.editIconPencil().click();
|
4298
|
+
thinkSpherePage.editBoxTextInput().should('have.attr', 'placeholder', 'Enter title');
|
4299
|
+
thinkSpherePage.editBoxTextInput().type('Test Title');
|
4300
|
+
thinkSpherePage.editBoxTextInput().blur();
|
4301
|
+
utilities.verifyInnerText(thinkSpherePage.editBoxText(),'Test Title');
|
4302
|
+
});
|
4303
|
+
},
|
4304
|
+
|
4305
|
+
verifyDefaultTab: () => {
|
4306
|
+
it('By default edit tab should be selected', () => {
|
4307
|
+
thinkSpherePage.editTab().should('have.class', 'Mui-selected');
|
4308
|
+
});
|
4309
|
+
},
|
4310
|
+
|
4311
|
+
/**
|
4312
|
+
* Verifies the functionality of editing, selecting, and unselecting strategies and sentence starters.
|
4313
|
+
* Ensures that changes are saved successfully and reflected in the preview section.
|
4314
|
+
*
|
4315
|
+
* @param {Object} sentenceStartersObject - The object containing strategies and sentence starters data.
|
4316
|
+
* @param {Array<string>} sentenceStartersObject.editedStrategies - The list of edited strategies to verify.
|
4317
|
+
* @param {Array<string>} sentenceStartersObject.editedSentenceStarters - The list of edited sentence starters to verify.
|
4318
|
+
* @param {Array<string>} sentenceStartersObject.selectStrategies - The list of strategies to select and verify.
|
4319
|
+
* @param {Array<string>} sentenceStartersObject.selectSentenceStarters - The list of sentence starters to select and verify.
|
4320
|
+
*/
|
4321
|
+
verifyStrategiesAndSentenceStartersSection: (sentenceStartersObject) => {
|
4322
|
+
const {
|
4323
|
+
editedStrategies, editedSentenceStarters, selectStrategies, selectSentenceStarters
|
4324
|
+
} = sentenceStartersObject || {};
|
4325
|
+
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', () => {
|
4326
|
+
thinkSpherePage.steps.switchToEditTab();
|
4327
|
+
thinkSpherePage.steps.clickOnEditQuestionIcon();
|
4328
|
+
editedStrategies.forEach((strategy, index) => {
|
4329
|
+
thinkSpherePage.steps.addOptionText('strategy', index, strategy);
|
4330
|
+
});
|
4331
|
+
editedSentenceStarters.forEach((sentenceStarter, index) => {
|
4332
|
+
thinkSpherePage.steps.addOptionText('sentenceStarter', index, sentenceStarter);
|
4333
|
+
});
|
4334
|
+
thinkSpherePage.steps.saveAQuestionAndVerifySnackbar();
|
4335
|
+
thinkSpherePage.steps.switchToPreviewTab();
|
4336
|
+
editedStrategies.forEach((label, index) => {
|
4337
|
+
utilities.verifyInnerText(utilities.getNthElement(thinkSpherePage.strategyTextWrapper(), index), label);
|
4338
|
+
});
|
4339
|
+
thinkSpherePage.steps.expandChooseStarterDropdown();
|
4340
|
+
editedSentenceStarters.forEach((label, index) => {
|
4341
|
+
utilities.verifyInnerText(utilities.getNthElement(thinkSpherePage.chooseStartersListOptionLabels(), index), label);
|
4342
|
+
});
|
4343
|
+
utilities.clickOnBody();
|
4344
|
+
});
|
4345
|
+
|
4346
|
+
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', () => {
|
4347
|
+
thinkSpherePage.steps.switchToEditTab();
|
4348
|
+
thinkSpherePage.steps.clickOnEditQuestionIcon();
|
4349
|
+
editedStrategies.forEach((strategy, index) => {
|
4350
|
+
if(!selectStrategies.includes(strategy)){
|
4351
|
+
thinkSpherePage.steps.selectOption('strategy', index);
|
4352
|
+
}
|
4353
|
+
});
|
4354
|
+
cy.wait(2000);
|
4355
|
+
editedSentenceStarters.forEach((sentenceStarter, index) => {
|
4356
|
+
if(!selectSentenceStarters.includes(sentenceStarter)){
|
4357
|
+
thinkSpherePage.steps.selectOption('sentenceStarter', index);
|
4358
|
+
}
|
4359
|
+
});
|
4360
|
+
cy.wait(2000);
|
4361
|
+
thinkSpherePage.steps.saveAQuestionAndVerifySnackbar();
|
4362
|
+
thinkSpherePage.steps.switchToPreviewTab();
|
4363
|
+
selectStrategies.forEach((label, index) => {
|
4364
|
+
utilities.verifyInnerText(utilities.getNthElement(thinkSpherePage.strategyTextWrapper(), index), label);
|
4365
|
+
});
|
4366
|
+
thinkSpherePage.steps.expandChooseStarterDropdown();
|
4367
|
+
selectSentenceStarters.forEach((label, index) => {
|
4368
|
+
utilities.verifyInnerText(utilities.getNthElement(thinkSpherePage.chooseStartersListOptionLabels(), index), label);
|
4369
|
+
});
|
4370
|
+
utilities.clickOnBody();
|
4371
|
+
});
|
4372
|
+
},
|
4373
|
+
};
|
4374
|
+
|
4375
|
+
export const thinkSpherePage = {
|
4376
|
+
...selectors,
|
4377
|
+
steps,
|
4378
|
+
tests
|
4379
|
+
};
|
4380
|
+
VerifySnackbar();
|
4381
|
+
thinkSpherePage.steps.switchToPreviewTab();
|
4382
|
+
editedStrategies.forEach((label, index) => {
|
4383
|
+
utilities.verifyInnerText(utilities.getNthElement(thinkSpherePage.strategyTextWrapper(), index), label);
|
4384
|
+
});
|
4385
|
+
thinkSpherePage.steps.expandChooseStarterDropdown();
|
4386
|
+
editedSentenceStarters.forEach((label, index) => {
|
4387
|
+
utilities.verifyInnerText(utilities.getNthElement(thinkSpherePage.chooseStartersListOptionLabels(), index), label);
|
4388
|
+
});
|
4389
|
+
utilities.clickOnBody();
|
4390
|
+
});
|
4391
|
+
|
4392
|
+
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', () => {
|
4393
|
+
thinkSpherePage.steps.switchToEditTab();
|
4394
|
+
thinkSpherePage.steps.clickOnEditQuestionIcon();
|
4395
|
+
editedStrategies.forEach((strategy, index) => {
|
4396
|
+
if(!selectStrategies.includes(strategy)){
|
4397
|
+
thinkSpherePage.steps.selectOption('strategy', index);
|
4398
|
+
}
|
4399
|
+
});
|
4400
|
+
cy.wait(2000);
|
4401
|
+
editedSentenceStarters.forEach((sentenceStarter, index) => {
|
4402
|
+
if(!selectSentenceStarters.includes(sentenceStarter)){
|
4403
|
+
thinkSpherePage.steps.selectOption('sentenceStarter', index);
|
4404
|
+
}
|
4405
|
+
});
|
4406
|
+
cy.wait(2000);
|
4407
|
+
thinkSpherePage.steps.saveAQuestionAndVerifySnackbar();
|
4408
|
+
thinkSpherePage.steps.switchToPreviewTab();
|
4409
|
+
selectStrategies.forEach((label, index) => {
|
4410
|
+
utilities.verifyInnerText(utilities.getNthElement(thinkSpherePage.strategyTextWrapper(), index), label);
|
4411
|
+
});
|
4412
|
+
thinkSpherePage.steps.expandChooseStarterDropdown();
|
4413
|
+
selectSentenceStarters.forEach((label, index) => {
|
4414
|
+
utilities.verifyInnerText(utilities.getNthElement(thinkSpherePage.chooseStartersListOptionLabels(), index), label);
|
4415
|
+
});
|
4416
|
+
utilities.clickOnBody();
|
4417
|
+
});
|
4418
|
+
},
|
1553
4419
|
};
|
1554
4420
|
|
1555
4421
|
export const thinkSpherePage = {
|