itemengine-cypress-automation 1.0.184-e2e-execution-crash-3b9d0d0.0 → 1.0.184
Sign up to get free protection for your applications and to get access to all the features.
- package/cypress/e2e/ILC/AudioPlayerNew/allSupportedFileTypes.js +79 -0
- package/cypress/e2e/ILC/AudioPlayerNew/barAudioPlayerStyle.js +345 -0
- package/cypress/e2e/ILC/AudioPlayerNew/compactAudioPlayerStyle.js +429 -0
- package/cypress/e2e/ILC/AudioPlayerNew/previewContents.smoke.js +162 -0
- package/cypress/e2e/ILC/AudioPlayerNew/standardAudioPlayerStyle.js +489 -0
- package/cypress/e2e/ILC/AudioPlayerNew/uploadAndAddAudioFile.js +313 -0
- package/cypress/e2e/ILC/AudioResponseNew/barRecorderStyle.smoke.js +1 -1
- package/cypress/e2e/ILC/AudioResponseNew/compactRecorderStyle.smoke.js +1 -1
- package/cypress/e2e/ILC/AudioResponseNew/standardRecorderStyle.smoke.js +1 -1
- package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/clickAndDrop.js +1 -1
- package/cypress/e2e/ILC/DrawingResponse/drawingResponseGradingViewAndCorrectAnswerViewContents.smoke.js +5 -8
- package/cypress/e2e/ILC/EditTabSettingPage/itemPreviewSettingsTabFunctionality.js +417 -28
- package/cypress/e2e/ILC/EssayResponse/editCategoryFlyout.js +1 -1
- package/cypress/e2e/ILC/FeedbackScaleNew/headerSection.js +29 -1
- package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/previewContentsForAllViews.smoke.js +2 -2
- package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/studentViewSettings.js +1 -1
- package/cypress/e2e/ILC/FillInTheGapsDropdownNew/studentViewSettings.js +1 -1
- package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/editTabScoring.js +1 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/previewContentsForAllViews.smoke.js +2 -2
- package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/studentViewSettings.js +1 -1
- package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/studentViewSettings.js +1 -1
- package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/Scoring/partialDifferentWeightsWithCorrectPointsEqualToAlternativePoints.js +4 -4
- package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/Scoring/partialEqualWeightsWithAlternativePointsGreaterThanCorrectPoints.js +1 -1
- package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/studentViewSettings.js +1 -1
- package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/partialDifferentWeightsAlternativePointsGreaterThanCorrectPoints.js +5 -5
- package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/partialDifferentWeightsWithCorrectPointsEqualToAlternativePoints.js +3 -4
- package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/partialEqualWeightsWithAlternativePointsGreaterThanCorrectPoints.js +1 -1
- package/cypress/e2e/ILC/FillInTheGapsTextNew/headerSection.js +1 -0
- package/cypress/e2e/ILC/FillInTheGapsTextNew/studentViewSettings.js +1 -1
- package/cypress/e2e/ILC/Graphing/Scoring/allOrNothingWithAlternativePointsGreaterThanCorrectPoints.js +2 -2
- package/cypress/e2e/ILC/Graphing/Scoring/allOrNothingWithCorrectPointsEqualToAlternatePoints.js +2 -2
- package/cypress/e2e/ILC/Graphing/Scoring/allOrNothingWithCorrectPointsGreaterThanAlternativePoints.js +2 -2
- package/cypress/e2e/ILC/Graphing/addBackgroundShapesSection.js +2 -2
- package/cypress/e2e/ILC/Graphing/studentViewSettings.js +1 -1
- package/cypress/e2e/ILC/GridFill/checkAnswerFunctionalityForAllViews.smoke.js +2 -2
- package/cypress/e2e/ILC/GridFill/gridLayoutContents.js +11 -3
- package/cypress/e2e/ILC/GridFill/previewContentsForAllViews.smoke.js +3 -3
- package/cypress/e2e/ILC/GridFill/studentViewSettingsSection.js +1 -1
- package/cypress/e2e/ILC/ListOrderingDropdown/allOrNothingForAllViews.smoke.js +230 -0
- package/cypress/e2e/ILC/ListOrderingDropdown/checkAnswerFunctionalityForAllViews.smoke.js +124 -0
- package/cypress/e2e/ILC/ListOrderingDropdown/previewContentsForAllViews.smoke.js +201 -0
- package/cypress/e2e/ILC/ListOrderingNew/Scoring/allOrNothingAlternativePointsGreaterThanCorrectPoints.js +216 -0
- package/cypress/e2e/ILC/ListOrderingNew/Scoring/allOrNothingCorrectPointsEqualToAlternativePoints.js +214 -0
- package/cypress/e2e/ILC/ListOrderingNew/Scoring/allOrNothingCorrectPointsGreaterThanAlternativePoints.js +251 -0
- package/cypress/e2e/ILC/ListOrderingNew/Scoring/allOrNothingPenaltyScoring.js +52 -0
- package/cypress/e2e/ILC/ListOrderingNew/Scoring/manuallyAndNonScored.js +128 -0
- package/cypress/e2e/ILC/ListOrderingNew/Scoring/partialDifferentWeightsAlternativePointsGreaterThanCorrectPoints.js +279 -0
- package/cypress/e2e/ILC/ListOrderingNew/Scoring/partialDifferentWeightsBasic.js +109 -0
- package/cypress/e2e/ILC/ListOrderingNew/Scoring/partialDifferentWeightsCorrectPointsEqualToAlternativePoints.js +278 -0
- package/cypress/e2e/ILC/ListOrderingNew/Scoring/partialDifferentWeightsCorrectPointsGreaterThanAlternativePoints.js +278 -0
- package/cypress/e2e/ILC/ListOrderingNew/Scoring/partialDifferentWeightsMinimumAndPenaltyScoring.js +335 -0
- package/cypress/e2e/ILC/ListOrderingNew/Scoring/partialEqualWeightsAlternativePointsGreaterThanCorrectPoints.js +250 -0
- package/cypress/e2e/ILC/ListOrderingNew/Scoring/partialEqualWeightsBasic.js +161 -0
- package/cypress/e2e/ILC/ListOrderingNew/Scoring/partialEqualWeightsCorrectPointsEqualToAlternativePoints.js +216 -0
- package/cypress/e2e/ILC/ListOrderingNew/Scoring/partialEqualWeightsCorrectPointsGreaterThanAlternativePoints.js +252 -0
- package/cypress/e2e/ILC/ListOrderingNew/additionalSettings.js +118 -0
- package/cypress/e2e/ILC/ListOrderingNew/allOrNothingForAllViews.smoke.js +243 -0
- package/cypress/e2e/ILC/ListOrderingNew/checkAnswerFunctionalityForAllViews.smoke.js +128 -0
- package/cypress/e2e/ILC/ListOrderingNew/editTabBasicSection.js +155 -0
- package/cypress/e2e/ILC/ListOrderingNew/editTabScoring.js +195 -0
- package/cypress/e2e/ILC/ListOrderingNew/headerSection.js +78 -0
- package/cypress/e2e/ILC/ListOrderingNew/minimumScoringPenaltyPointsAndRoundingDropdown.js +194 -0
- package/cypress/e2e/ILC/ListOrderingNew/previewContentsForAllViews.smoke.js +176 -0
- package/cypress/e2e/ILC/ListOrderingNew/specifyCorrectAnswerSection.js +112 -0
- package/cypress/e2e/ILC/ListOrderingNew/studentViewSettings.js +244 -0
- package/cypress/e2e/ILC/Matching/studentViewSettings.js +1 -1
- package/cypress/e2e/ILC/MultipleSelection/allOrNothingWithAlternativeAnswer.js +1 -0
- package/cypress/e2e/ILC/MultipleSelectionGridNew/studentViewSettings.js +1 -1
- package/cypress/e2e/ILC/NumberLine/LayoutSection.js +181 -0
- package/cypress/e2e/ILC/NumberLine/Scoring/allOrNothingWithCorrectPointsGreaterThanAlternativePoints.js +3 -3
- package/cypress/e2e/ILC/NumberLine/allOrNothingScoringForAllViews.smoke.js +57 -1
- package/cypress/e2e/ILC/NumberLine/lineSettingsSection.js +33 -0
- package/cypress/e2e/ILC/NumberLine/numberLineSection.js +46 -0
- package/cypress/e2e/ILC/NumberLine/previewTabContentsForAllViews.smoke.js +1 -1
- package/cypress/e2e/ILC/NumberLine/studentViewSettings.js +1 -1
- package/cypress/e2e/ILC/NumberLine/toolSettings.js +2 -1
- package/cypress/e2e/ILC/NumberLine/verticalNumberLine/allOrNothingScoringForAllViews.smoke.js +696 -0
- package/cypress/e2e/ILC/NumberLine/verticalNumberLine/gradingViewAndCorrectAnswerView.smoke.js +173 -0
- package/cypress/e2e/ILC/NumberLine/verticalNumberLine/layoutSection.js +183 -0
- package/cypress/e2e/ILC/NumberLine/verticalNumberLine/numberLineSection.js +73 -0
- package/cypress/e2e/ILC/NumberLine/verticalNumberLine/previewTabContentsForAllViews.smoke.js +204 -0
- package/cypress/e2e/ILC/NumberLineLabel/allOrNothingForAllViews.smoke.js +288 -0
- package/cypress/e2e/ILC/NumberLineLabel/checkAnswerFunctionalityForAllViews.smoke.js +153 -0
- package/cypress/e2e/ILC/NumberLineLabel/gradingViewAndCorrectAnswerView.smoke.js +164 -0
- package/cypress/e2e/ILC/NumberLineLabel/previewContentsForAllViews.smoke.js +120 -0
- package/cypress/e2e/ILC/Protractor/protractorPreviewContents.smoke.js +1 -1
- package/cypress/e2e/ILC/ReadingRuler/readingRulerEditTabBasicsSection.js +49 -1
- package/cypress/e2e/ILC/ShortTextResponseNew/studentViewSettings.js +1 -1
- package/cypress/e2e/ILC/SingleSelectionGridNew/studentViewSettings.js +1 -1
- package/cypress/e2e/ILC/TextEntryMath/responseEvaluationMethodsAndCustomSettings.js +2 -2
- package/cypress/e2e/ILC/TextSelection/Scoring/allOrNothingAlternatePointsMoreThanCorrectPoints.js +0 -1
- package/cypress/e2e/ILC/TextSelection/Scoring/allOrNothingCorrectPointsEqualToAlternatePoints.js +0 -1
- package/cypress/e2e/ILC/TextSelection/Scoring/allOrNothingCorrectPointsMoreThanAlternatePoints.js +0 -1
- package/cypress/e2e/ILC/TextSelection/Scoring/basicScoringForAllTextSelectionTypes.smoke.js +0 -1
- package/cypress/e2e/ILC/TextSelection/additionalSettings.js +125 -0
- package/cypress/e2e/ILC/TextSelection/allOrNothingScoringForAllViews.smoke.js +0 -1
- package/cypress/e2e/ILC/TextSelection/checkAnswerFunctionalityForAllViews.smoke.js +1 -2
- package/cypress/e2e/ILC/TextSelection/editTabScoringSection.js +5 -4
- package/cypress/e2e/ILC/TextSelection/headerSection.js +73 -0
- package/cypress/e2e/ILC/TextSelection/previewContentsForAllViews.smoke.js +6 -7
- package/cypress/e2e/ILC/TextSelection/questionInstructionsAndQuestion.js +179 -0
- package/cypress/e2e/ILC/TextSelection/specifyCorrectAnswerSection.js +89 -0
- package/cypress/e2e/ILC/TextSelection/studentViewSettings.js +436 -0
- package/cypress/e2e/ILC/TextSelection/styleAndLayoutCustomizationAccordion.js +277 -0
- package/cypress/e2e/ILC/TextSelection/textSelectionModesInPreviewTab.js +222 -0
- package/cypress/e2e/ILC/TextSelection/textSelectionModesInSpecifyCorrectAnswerSection.js +260 -0
- package/cypress/e2e/ILC/TextSelection/textSelectionModesInSpecifyPossibleOptionsSection.js +380 -0
- package/cypress/e2e/ILC/ToolSettings/toolSettingsContent.js +5 -5
- package/cypress/e2e/ILC/ToolSettings/toolSettingsPreviewContents.smoke.js +3 -3
- package/cypress/fixtures/constants.js +1 -1
- package/cypress/fixtures/equationEditorCategoriesAndSymbols .js +20 -20
- package/cypress/fixtures/theme/ilc.json +20 -18
- package/cypress/pages/audioPlayerPage.js +274 -504
- package/cypress/pages/brainingCampManipulativePage.js +1 -1
- package/cypress/pages/components/autoScoredSpecifyCorrectAnswerSection.js +3 -3
- package/cypress/pages/components/autoScoredStudentViewSettings.js +5 -5
- package/cypress/pages/components/commonComponents.js +1 -0
- package/cypress/pages/components/draggableOptionContainer.js +1 -0
- package/cypress/pages/components/equationEditorFlyout.js +3 -2
- package/cypress/pages/components/essayResponseCommonComponents.js +8 -2
- package/cypress/pages/components/fillInTheGapsDropdownCommonComponent.js +1 -0
- package/cypress/pages/components/imageCanvasComponent.js +2 -1
- package/cypress/pages/components/index.js +3 -0
- package/cypress/pages/components/layoutSectionComponent.js +1191 -0
- package/cypress/pages/components/numberLineCommonComponent.js +36 -0
- package/cypress/pages/components/optionsWrapperComponent.js +13 -2
- package/cypress/pages/components/playbackControlsBaseComponent.js +20 -13
- package/cypress/pages/components/styleAndLayoutCustomizationAccordionComponent.js +46 -0
- package/cypress/pages/components/toolSettingsComponent.js +6 -0
- package/cypress/pages/contentBlocksPage.js +18 -2
- package/cypress/pages/createItemPage.js +75 -8
- package/cypress/pages/dialogBoxBase.js +2 -2
- package/cypress/pages/drawingResponsePage.js +24 -4
- package/cypress/pages/feedbackScalePage.js +3 -0
- package/cypress/pages/graphingPage.js +19 -1
- package/cypress/pages/gridFillPage.js +25 -8
- package/cypress/pages/index.js +2 -1
- package/cypress/pages/itemPreviewSettingsPage.js +4 -0
- package/cypress/pages/listOrderingPage.js +435 -557
- package/cypress/pages/matchingPage.js +1 -1
- package/cypress/pages/multipleSelectionPage.js +23 -1
- package/cypress/pages/numberLineLabelPage.js +333 -0
- package/cypress/pages/numberLinePage.js +1370 -132
- package/cypress/pages/rulerPage.js +6 -2
- package/cypress/pages/textSelectionPage.js +461 -23
- package/package.json +1 -1
@@ -1,405 +1,297 @@
|
|
1
1
|
import constants from "../fixtures/constants";
|
2
2
|
import utilities from "../support/helpers/utilities";
|
3
|
-
import {
|
4
|
-
|
5
|
-
import { listSortingAndOrderingBase } from "./components/listSortingAndOrderingBase";
|
6
|
-
import { setPointsPopupBase } from "./components/setPointsPopupBase";
|
7
|
-
import { studentResponseAndLayoutComponent } from "./components/studentResponseAreaAndLayoutComponent";
|
3
|
+
import { autoScoredScoringPreviewTab, autoScoredScoringSectionMultiResponseType, autoScoredSpecifyCorrectAnswerSection, autoScoredStudentViewSettings, commonComponents, correctIncorrectAnswerLabelComponent, createQuestionBasePage, optionsWrapperComponent, questionInstructionsComponent, randomizeOptionsComponent, scoringSectionBaseEditTab, studentViewSettingsLabelComponent, additionalSettingsPanel, additionalSettingsAccessibilitySectionComponent } from "./components"
|
4
|
+
const options = ['sprout', 'plant', 'flower', 'seed'];
|
8
5
|
const css = Cypress.env('css');
|
9
6
|
|
10
7
|
const selectors = {
|
11
|
-
...commonComponents,
|
12
8
|
...optionsWrapperComponent,
|
13
|
-
...scoringSectionBase,
|
14
|
-
...autoScoredScoringSectionMultipleResponsesType,
|
15
|
-
...autoScoredSetCorrectAnswerSection,
|
16
|
-
...autoScoredAdditionalSettings,
|
17
|
-
...previewScoringAndShowCorrectAnswerComponent,
|
18
|
-
...autoScoredPreviewBase,
|
19
|
-
...additionalSettingsPanel,
|
20
9
|
...questionInstructionsComponent,
|
21
|
-
...
|
22
|
-
...
|
23
|
-
...
|
24
|
-
|
25
|
-
|
26
|
-
|
10
|
+
...commonComponents,
|
11
|
+
...autoScoredScoringSectionMultiResponseType,
|
12
|
+
...randomizeOptionsComponent,
|
13
|
+
...autoScoredScoringPreviewTab,
|
14
|
+
...additionalSettingsPanel,
|
15
|
+
...correctIncorrectAnswerLabelComponent,
|
16
|
+
//Specify correct answer section
|
17
|
+
optionSpecifyCorrectAnswerSection: () => cy.get('.list-ordering-set-correct-answer .draggable-item-wrapper[role="button"]'),
|
18
|
+
optionWrapperSpecifyCorrectAnswerSection: () => cy.get('[class*="ListOrderingResponsestyles__DroppableWrapper"]'),
|
19
|
+
partialDifferentWeightsPointsLabel: () => cy.get('.partial-points-per-response-label'),
|
20
|
+
pointsPerResponseValue: () => cy.get('.alternate-points-points-per-value-span'),
|
21
|
+
//Student view settings
|
22
|
+
enableOuterBorderForQuestionLabel: () => cy.get('[data-ngie-testid*="enable-outer-border-for-question-checkbox"] .MuiFormControlLabel-label'),
|
23
|
+
enableOuterBorderForQuestionCheckbox: () => cy.get('[data-ngie-testid*="enable-outer-border-for-question-checkbox"] input'),
|
27
24
|
//Preview Tab
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
25
|
+
optionPreviewTab: () => cy.get('[class*="question-preview-wrapper"] .draggable-item-wrapper[role="button"]'),
|
26
|
+
optionWrapperPreviewTab: () => cy.get('[class*="question-preview-wrapper"] .orderlist-option-wrapper'),
|
27
|
+
correctAnswersLabel: () => cy.get('.check-answer-and-status-wrapper [class*="CorrectAnswerLabel"]'),
|
28
|
+
correctAnswerSectionAnswerWrapper: () => cy.get('[class*="CorrectAnswers"] [class*="__OptionsWrapper"]'),
|
29
|
+
correctAnswerSectionWrapper: () => cy.get('[class*="ListOrderingResponsestyles__CorrectAnswers"]'),
|
30
|
+
correctAnswerSectionAnswerText: () => cy.get('.question-text-wrapper'),
|
31
|
+
questionBorderPreviewTab: () => cy.get('[class*="ListOrderingResponsestyles__DroppableDiv"]'),
|
32
|
+
//grading view and correct answer view
|
33
|
+
optionGradingView: () => cy.get('[class*="DraggableItemsWrapper"] [class*="OptionTextWrapper"]'),
|
34
|
+
optionWrapperGradingView: () => cy.get('[class*="DraggableItemsWrapper"] [class*="OptionsWrapper"]'),
|
35
|
+
//Orientation and layout
|
36
|
+
orderingLayoutLabel: () => cy.get('.list-ordering-order-layout .options-label'),
|
37
|
+
reorderInTheSameListButton: () => cy.get('[data-ngie-testid="reorder-in-the-same-list-toggle-button"]'),
|
38
|
+
reorderAsSeparateListButton: () => cy.get('[data-ngie-testid="reorder-as-a-separate-list-toggle-button"]'),
|
39
|
+
dropdownMenuButton: () => cy.get('[data-ngie-testid="dropdown-menu-toggle-button"]'),
|
40
|
+
optionOrientationLabel: () => cy.get('.option-orientation-toggle-button-wrapper .options-label'),
|
41
|
+
verticalButton: () => cy.get('button[aria-label*="Vertical"]'),
|
42
|
+
horizontalButton: () => cy.get('button[aria-label*="Horizontal"]'),
|
43
|
+
|
44
|
+
//Dropdown menu selectors
|
45
|
+
dropdownMenuOptionsDropdown: () => cy.get('#Dropdown-menu-options-select'),
|
46
|
+
dropdownMenuListOptions: (ariaLabel = null) => {
|
47
|
+
if (ariaLabel) {
|
48
|
+
return cy.get(`[aria-labelledby*="Dropdown-menu-options-dropdown-label"] [role="option"][aria-label*="${ariaLabel}"]`)
|
49
|
+
} else {
|
50
|
+
return cy.get('[aria-labelledby*="Dropdown-menu-options-dropdown-label"] [role="option"]')
|
51
|
+
}
|
52
|
+
},
|
53
|
+
positionDropdownSpecifyCorrectAnswerSection: () => cy.get('.response-dropdown-wrapper [role="combobox"]'),
|
54
|
+
positionDropdownListOption: (ariaLabel = null) => {
|
55
|
+
if (ariaLabel) {
|
56
|
+
return cy.get(`[aria-labelledby*="-dropdown-label"] [role="option"][aria-label*="${ariaLabel}"]`)
|
57
|
+
} else {
|
58
|
+
return cy.get('[aria-labelledby*="-dropdown-label"] [role="option"]')
|
59
|
+
}
|
60
|
+
},
|
61
|
+
dropdownSelectedOptionLabel: () => cy.get('.dropdown-label-text'),
|
62
|
+
dropdownOptionWrapperGradingView: () => cy.get('[class*="DropdownLayoutstyles__OptionsWrapper"]'),
|
63
|
+
dropdownWrapperPreviewTab: () => cy.get('[class*="ListOrderingResponsestyles__DroppableDiv"] [class*="DropdownLayoutstyles__ResponseWrapper"]'),
|
64
|
+
dropdownOptionWrapperPreviewTab: () => cy.get('[class*="DropdownLayoutstyles__OptionsWrapper"]'),
|
65
|
+
positionDropdownPreviewTab: () => cy.get('[class*="question-preview-wrapper"] .response-dropdown-wrapper [role="combobox"]'),
|
66
|
+
positionDropdownCorrectAnswerSection: () => cy.get('[class*="ListOrderingResponsestyles__CorrectAnswers"] .response-dropdown-wrapper [role="combobox"]'),
|
67
|
+
dropdownWrapperCorrectAnswerSection: () => cy.get('[class*="ListOrderingResponsestyles__CorrectAnswers"] [class*="DropdownLayoutstyles__ResponseWrapper"]'),
|
68
|
+
alertMessage: () => cy.get('[class*="ListOrderingResponsestyles__DisabledWrapper"]')
|
47
69
|
}
|
48
70
|
|
49
71
|
const steps = {
|
50
72
|
...createQuestionBasePage.steps,
|
51
73
|
...questionInstructionsComponent.steps,
|
52
|
-
...
|
53
|
-
...autoScoredSetCorrectAnswerSection.steps,
|
54
|
-
...commonComponents.steps,
|
74
|
+
...scoringSectionBaseEditTab.steps,
|
55
75
|
...optionsWrapperComponent.steps,
|
56
|
-
...
|
57
|
-
...
|
58
|
-
...
|
76
|
+
...autoScoredScoringPreviewTab.steps,
|
77
|
+
...correctIncorrectAnswerLabelComponent.steps,
|
78
|
+
...autoScoredStudentViewSettings.steps,
|
79
|
+
...autoScoredScoringSectionMultiResponseType.steps,
|
80
|
+
...autoScoredSpecifyCorrectAnswerSection.steps,
|
81
|
+
...randomizeOptionsComponent.steps,
|
82
|
+
...commonComponents.steps,
|
59
83
|
...additionalSettingsPanel.steps,
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
...answerNumerationComponent.steps,
|
65
|
-
...setPointsPopupBase.steps,
|
66
|
-
...listSortingAndOrderingBase.steps,
|
67
|
-
/**
|
68
|
-
* @param {number} index set correct answer option index
|
69
|
-
* @description this function verfies contents of options
|
84
|
+
/**
|
85
|
+
* @param {string} optionsText text content of the option
|
86
|
+
* @param {number} targetIndex the position at which the options is being dropped
|
87
|
+
* @description click and drop a option into a position in the specify correct answer section
|
70
88
|
*/
|
71
|
-
|
72
|
-
listOrderingPage.
|
73
|
-
.
|
74
|
-
.
|
75
|
-
|
76
|
-
|
77
|
-
|
89
|
+
clickAndReorderOptionInSpecifyCorrectAnswerSection: (optionsText, targetIndex) => {
|
90
|
+
listOrderingPage.optionSpecifyCorrectAnswerSection()
|
91
|
+
.contains(optionsText)
|
92
|
+
.click();
|
93
|
+
listOrderingPage.optionSpecifyCorrectAnswerSection()
|
94
|
+
.eq(targetIndex)
|
95
|
+
.click();
|
78
96
|
},
|
79
97
|
|
80
98
|
/**
|
81
|
-
* @param {string
|
82
|
-
* @
|
99
|
+
* @param {string} optionsText text content of the option
|
100
|
+
* @param {number} targetIndex the position at which the options is being dropped
|
101
|
+
* @description click and drop a option into a position in the preview tab
|
83
102
|
*/
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
103
|
+
clickAndReorderOptionInPreviewTab: (optionsText, targetIndex) => {
|
104
|
+
listOrderingPage.optionPreviewTab()
|
105
|
+
.contains(optionsText)
|
106
|
+
.click();
|
107
|
+
listOrderingPage.optionPreviewTab()
|
108
|
+
.eq(targetIndex)
|
109
|
+
.click();
|
90
110
|
},
|
91
111
|
|
92
112
|
/**
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
listOrderingPage.
|
98
|
-
.eq(
|
113
|
+
* @description Verifies that the image in the Preview tab has the correct source and alt text.
|
114
|
+
* @param {number} optionIndex - The index of the option in the Preview tab.
|
115
|
+
*/
|
116
|
+
verifyOptionWithImageInPreviewTab: (optionIndex) => {
|
117
|
+
listOrderingPage.optionWrapperPreviewTab()
|
118
|
+
.eq(optionIndex)
|
99
119
|
.find('img')
|
100
120
|
.should('have.attr', 'src', constants.foxImageLink)
|
101
121
|
.and('have.attr', 'alt', constants.foxImageAltText);
|
102
122
|
},
|
103
123
|
|
104
124
|
/**
|
105
|
-
* @
|
106
|
-
* @
|
125
|
+
* @description Verifies that the bold text in the Preview tab is correct.
|
126
|
+
* @param {number} optionIndex - The index of the option in the Preview tab.
|
107
127
|
*/
|
108
|
-
|
109
|
-
listOrderingPage.
|
110
|
-
.eq(
|
111
|
-
.
|
112
|
-
|
113
|
-
.find('[role="math"]')
|
114
|
-
.should('have.attr', 'aria-label', constants.CKEditorInputFieldEnteredEquationAriaLabel)
|
128
|
+
verifyOptionWithBoldTextInPreviewTab: (optionIndex) => {
|
129
|
+
listOrderingPage.optionWrapperPreviewTab()
|
130
|
+
.eq(optionIndex)
|
131
|
+
.find('strong')
|
132
|
+
.should('have.text', 'This is a bold option');
|
115
133
|
},
|
116
134
|
|
117
135
|
/**
|
118
|
-
* @
|
119
|
-
* @
|
136
|
+
* @description Verifies that the equation text in the Preview tab is correct.
|
137
|
+
* @param {number} optionIndex - The index of the option in the Preview tab.
|
120
138
|
*/
|
121
|
-
|
122
|
-
listOrderingPage.
|
123
|
-
.eq(
|
124
|
-
.
|
125
|
-
.
|
126
|
-
.
|
139
|
+
verifyOptionWithEquationTextInPreviewTab: (optionIndex) => {
|
140
|
+
listOrderingPage.optionWrapperPreviewTab()
|
141
|
+
.eq(optionIndex)
|
142
|
+
.find('[role="math"]')
|
143
|
+
.should('have.attr', 'aria-label', constants.CKEditorInputFieldEnteredEquationAriaLabel)
|
144
|
+
.contains(constants.CKEditorInputFieldEnteredEquationText);
|
127
145
|
},
|
128
146
|
|
129
147
|
/**
|
130
|
-
* @param {
|
131
|
-
* @description this function
|
148
|
+
* @param {string[]} optionsTextArray options array for preview tab options
|
149
|
+
* @description this function verifies options text content
|
132
150
|
*/
|
133
|
-
|
134
|
-
listOrderingPage.
|
135
|
-
.eq(index)
|
136
|
-
.find('strong')
|
137
|
-
.eq(0)
|
138
|
-
.should('have.text', 'This is a bold option');
|
139
|
-
},
|
140
|
-
|
141
|
-
verifyDefaultAndActiveStateOfOptionInSetCorrectAnswerSection: () => {
|
142
|
-
listOrderingPage.setCorrectAnswerSectionOption()
|
143
|
-
.eq(0)
|
144
|
-
.realHover()
|
145
|
-
.should('have.css', 'border', `2px solid ${css.color.activeButtons}`)
|
146
|
-
.find('.question-text-wrapper')
|
147
|
-
.and('have.css', 'color', css.color.activeButtons);
|
148
|
-
listOrderingPage.setCorrectAnswerSectionOption()
|
149
|
-
.eq(0)
|
150
|
-
.realHover({ position: 'topLeft' })
|
151
|
-
.should('have.css', 'border', `1px solid ${css.color.figDefaultComponentBorder}`)
|
152
|
-
.find('.question-text-wrapper')
|
153
|
-
.and('have.css', 'color', css.color.text)
|
151
|
+
verifyTextContentOfOptionInPreviewTab: (optionsText, index) => {
|
152
|
+
utilities.verifyTextContent(utilities.getNthElement(listOrderingPage.optionPreviewTab(), index), optionsText);
|
154
153
|
},
|
155
154
|
|
156
155
|
/**
|
157
|
-
*
|
158
|
-
* @
|
159
|
-
* @param {number} index the position at which the options is being dropped
|
160
|
-
* @description click and drop a option into a position in the set correct answer section
|
156
|
+
* @param {string[]} optionsTextArray options array for set correct answer options
|
157
|
+
* @description this function verifies options text content
|
161
158
|
*/
|
162
|
-
|
163
|
-
listOrderingPage.
|
164
|
-
.contains(optionsText)
|
165
|
-
.click();
|
166
|
-
listOrderingPage.setCorrectAnswerSectionOption()
|
167
|
-
.eq(index)
|
168
|
-
.click();
|
159
|
+
verifyTextContentOfOptionInSpecifyCorrectAnswerSection: (optionsText, index) => {
|
160
|
+
utilities.verifyTextContent(utilities.getNthElement(listOrderingPage.optionSpecifyCorrectAnswerSection(), index), optionsText);
|
169
161
|
},
|
170
162
|
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
163
|
+
/**
|
164
|
+
* @param {string} optionsText option to be checked for the correct icon
|
165
|
+
* @description This function verifies the correct icon in the preview tab
|
166
|
+
*/
|
167
|
+
verifyCorrectOptionIcon: (optionsText) => {
|
168
|
+
listOrderingPage.optionWrapperPreviewTab()
|
169
|
+
.contains(optionsText)
|
170
|
+
.parents('.orderlist-option-wrapper')
|
171
|
+
.within(() => {
|
172
|
+
utilities.verifyElementVisibilityState(autoScoredScoringPreviewTab.correctIcon(), 'exist');
|
173
|
+
});
|
175
174
|
},
|
176
175
|
|
177
|
-
//Preview tab
|
178
176
|
/**
|
179
|
-
* @param {
|
180
|
-
* @description
|
177
|
+
* @param {string} optionsText option to be checked for the correct icon
|
178
|
+
* @description This function verifies the correct icon in the preview tab
|
181
179
|
*/
|
182
|
-
|
183
|
-
listOrderingPage.
|
184
|
-
.
|
180
|
+
verifyIncorrectOptionIcon: (optionsText) => {
|
181
|
+
listOrderingPage.optionWrapperPreviewTab()
|
182
|
+
.contains(optionsText)
|
183
|
+
.parents('.orderlist-option-wrapper')
|
185
184
|
.within(() => {
|
186
|
-
|
187
|
-
.should('exist');
|
185
|
+
utilities.verifyElementVisibilityState(autoScoredScoringPreviewTab.incorrectIcon(), 'exist');
|
188
186
|
});
|
189
187
|
},
|
190
188
|
|
189
|
+
verifyCorrectAnswerSectionNotExists: () => {
|
190
|
+
utilities.verifyElementVisibilityState(listOrderingPage.correctAnswersLabel(), 'notExist');
|
191
|
+
utilities.verifyElementVisibilityState(listOrderingPage.correctAnswerSectionAnswerWrapper(), 'notExist');
|
192
|
+
},
|
193
|
+
|
191
194
|
/**
|
192
|
-
* @param {string[]} optionsTextArray options
|
193
|
-
* @description this function verifies options
|
195
|
+
* @param {string[]} optionsTextArray array of options in the correct answer section
|
196
|
+
* @description this function verifies the correct order of options in correct answer section
|
194
197
|
*/
|
195
|
-
|
198
|
+
verifyOptionsInCorrectAnswerSection: (optionsTextArray) => {
|
196
199
|
optionsTextArray.forEach((optionsText, index) => {
|
197
|
-
listOrderingPage.
|
198
|
-
.
|
199
|
-
|
200
|
+
utilities.getNthElement(listOrderingPage.correctAnswerSectionAnswerWrapper(), index)
|
201
|
+
.within(() => {
|
202
|
+
utilities.verifyTextContent(listOrderingPage.correctAnswerSectionAnswerText(), optionsText);
|
203
|
+
});
|
200
204
|
});
|
201
205
|
},
|
202
206
|
|
203
207
|
/**
|
204
|
-
* @
|
205
|
-
* @
|
208
|
+
* @description Verifies that the image in the Preview tab has the correct source and alt text.
|
209
|
+
* @param {number} optionIndex - The index of the option in the Preview tab.
|
206
210
|
*/
|
207
|
-
|
208
|
-
listOrderingPage.
|
209
|
-
.eq(
|
211
|
+
verifyOptionWithImageInGradingView: (optionIndex) => {
|
212
|
+
listOrderingPage.optionGradingView()
|
213
|
+
.eq(optionIndex)
|
210
214
|
.find('img')
|
211
215
|
.should('have.attr', 'src', constants.foxImageLink)
|
212
216
|
.and('have.attr', 'alt', constants.foxImageAltText);
|
213
217
|
},
|
214
218
|
|
215
219
|
/**
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
listOrderingPage.
|
221
|
-
.eq(
|
222
|
-
.contains(constants.CKEditorInputFieldEnteredEquationText)
|
223
|
-
listOrderingPage.previewTabOption()
|
224
|
-
.find('[role="math"]')
|
225
|
-
.should('have.attr', 'aria-label', constants.CKEditorInputFieldEnteredEquationAriaLabel)
|
226
|
-
},
|
227
|
-
|
228
|
-
/**
|
229
|
-
* @param {number} index of option
|
230
|
-
* @description this function verifies link in preview tab options
|
231
|
-
*/
|
232
|
-
verifyLinkAddedToOptionInPreviewTab: (index) => {
|
233
|
-
listOrderingPage.previewTabOption()
|
234
|
-
.eq(index)
|
235
|
-
.should('have.text', 'lorem')
|
236
|
-
.find('a')
|
237
|
-
.should('have.attr', 'href', `${Cypress.config().baseUrl}`)
|
238
|
-
},
|
239
|
-
|
240
|
-
/**
|
241
|
-
* @param {number} index of option
|
242
|
-
* @description this function verifies bold text in preview tab options
|
243
|
-
*/
|
244
|
-
verifyBoldTextAddedToOptionInPreviewTab: (index) => {
|
245
|
-
listOrderingPage.previewTabOption()
|
246
|
-
.eq(index)
|
220
|
+
* @description Verifies that the bold text in the Preview tab is correct.
|
221
|
+
* @param {number} optionIndex - The index of the option in the Preview tab.
|
222
|
+
*/
|
223
|
+
verifyOptionWithBoldTextInGradingView: (optionIndex) => {
|
224
|
+
listOrderingPage.optionGradingView()
|
225
|
+
.eq(optionIndex)
|
247
226
|
.find('strong')
|
248
|
-
.should('
|
249
|
-
.should('have.text', 'This is a bold option')
|
250
|
-
},
|
251
|
-
|
252
|
-
verifyDefaultAndActiveStateOfOptionInPreviewTab: () => {
|
253
|
-
listOrderingPage.previewTabOption()
|
254
|
-
.eq(0)
|
255
|
-
.realHover()
|
256
|
-
.should('have.css', 'border', `2px solid ${css.color.activeButtons}`)
|
257
|
-
.find('.question-text-wrapper')
|
258
|
-
.and('have.css', 'color', css.color.activeButtons);
|
259
|
-
listOrderingPage.previewTabOption()
|
260
|
-
.eq(0)
|
261
|
-
.realHover({ position: 'topLeft' })
|
262
|
-
.should('have.css', 'border', `1px solid ${css.color.figDefaultComponentBorder}`)
|
263
|
-
.find('.question-text-wrapper')
|
264
|
-
.and('have.css', 'color', css.color.text)
|
265
|
-
},
|
266
|
-
|
267
|
-
//Scoring
|
268
|
-
/**
|
269
|
-
* @param {number} points the points to be displayed in the partial equal weights points field
|
270
|
-
* @description this function checks the points per response in partial equal weights
|
271
|
-
*/
|
272
|
-
verifyPartialEqualWeightsPointsPerResponseScore: (points) => {
|
273
|
-
listOrderingPage.partialEqualWeightsPointsPerResponseScore()
|
274
|
-
.each(($element) => {
|
275
|
-
cy.wrap($element)
|
276
|
-
.verifyInnerText(points);
|
277
|
-
});
|
227
|
+
.should('have.text', 'This is a bold option');
|
278
228
|
},
|
279
229
|
|
280
230
|
/**
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
});
|
231
|
+
* @description Verifies that the equation text in the Preview tab is correct.
|
232
|
+
* @param {number} optionIndex - The index of the option in the Preview tab.
|
233
|
+
*/
|
234
|
+
verifyOptionWithEquationTextInGradingView: (optionIndex) => {
|
235
|
+
listOrderingPage.optionGradingView()
|
236
|
+
.eq(optionIndex)
|
237
|
+
.find('[role="math"]')
|
238
|
+
.should('have.attr', 'aria-label', constants.CKEditorInputFieldEnteredEquationAriaLabel)
|
239
|
+
.contains(constants.CKEditorInputFieldEnteredEquationText);
|
291
240
|
},
|
292
241
|
|
293
242
|
/**
|
294
|
-
* @param {
|
295
|
-
* @description this function
|
243
|
+
* @param {string[]} optionsTextArray options array for set correct answer option
|
244
|
+
* @description this function verifies options text content
|
296
245
|
*/
|
297
|
-
|
298
|
-
|
299
|
-
listOrderingPage.partialDifferentWeightsPointsInputField()
|
300
|
-
.eq(columnIndex)
|
301
|
-
.clear()
|
302
|
-
.type(points, { delay: 0 })
|
303
|
-
.should('have.value', points);
|
304
|
-
});
|
305
|
-
},
|
306
|
-
|
307
|
-
verifyPartialDifferentWeightsPointsPerResponseLabel: () => {
|
308
|
-
listOrderingPage.partialDifferentWeightsPointsPerResponseLabel()
|
309
|
-
.verifyInnerText('Points per response')
|
310
|
-
.should('be.visible');
|
311
|
-
},
|
312
|
-
|
313
|
-
verifyPointsPerResponseLabel: () => {
|
314
|
-
listOrderingPage.pointsPerResponseLabel()
|
315
|
-
.verifyInnerText('Points per response')
|
316
|
-
.should('be.visible');
|
246
|
+
verifyTextContentOfOptionInGradingView: (optionsText, index) => {
|
247
|
+
utilities.verifyTextContent(utilities.getNthElement(listOrderingPage.optionGradingView(), index), optionsText);
|
317
248
|
},
|
318
249
|
|
319
250
|
/**
|
320
|
-
*
|
321
251
|
* @param {string} optionsText text content of the option
|
322
252
|
* @param {number} index the position at which the options is being dropped
|
323
253
|
* @description click and drop a option into a position in the set correct answer section
|
324
254
|
*/
|
325
|
-
|
326
|
-
listOrderingPage.
|
255
|
+
clickAndReorderOptionInGradingView: (optionsText, index) => {
|
256
|
+
listOrderingPage.optionGradingView()
|
327
257
|
.contains(optionsText)
|
328
258
|
.click();
|
329
|
-
listOrderingPage.
|
259
|
+
listOrderingPage.optionGradingView()
|
330
260
|
.eq(index)
|
331
261
|
.click();
|
332
262
|
},
|
333
263
|
|
334
264
|
/**
|
335
|
-
*
|
336
|
-
* @param {string[]}
|
337
|
-
* @description this function resets the question preview
|
265
|
+
* Verifies the order of options in the "Specify Correct Answer" section.
|
266
|
+
* @param {string[]} optionsTextArray - An array containing the text of options in the expected order.
|
338
267
|
*/
|
339
|
-
|
340
|
-
|
341
|
-
|
342
|
-
listOrderingPage.steps.verifyTextContentOfOptionsInPreviewTab(optionsArray);
|
343
|
-
},
|
344
|
-
|
345
|
-
/**
|
346
|
-
* @param {string[]} numerationArray array of numeration numbers, lowercase, uppercase
|
347
|
-
* @description this function verifies the numeration of options
|
348
|
-
*/
|
349
|
-
verifyOptionsNumeration: (numerationArray) => {
|
350
|
-
numerationArray.forEach((optionNumeration, index) => {
|
351
|
-
listOrderingPage.previewTabOption()
|
352
|
-
.eq(index)
|
353
|
-
.within(() => {
|
354
|
-
listOrderingPage.optionNumeration()
|
355
|
-
.should('have.text', optionNumeration);
|
356
|
-
});
|
268
|
+
verifyOptionsOrderInSpecifyCorrectAnswerSection: (optionsTextArray) => {
|
269
|
+
optionsTextArray.forEach((option, index) => {
|
270
|
+
utilities.verifyTextContent(utilities.getNthElement(listOrderingPage.optionSpecifyCorrectAnswerSection(), index), option);
|
357
271
|
});
|
358
272
|
},
|
359
273
|
|
360
274
|
/**
|
361
|
-
|
362
|
-
|
363
|
-
|
364
|
-
|
365
|
-
|
366
|
-
.
|
367
|
-
|
368
|
-
.within(() => {
|
369
|
-
autoScoredPreviewBase.correctIcon()
|
370
|
-
.and('be.visible');
|
371
|
-
});
|
275
|
+
* Verifies the order of options in the preview tab
|
276
|
+
* @param {string[]} optionsTextArray - An array containing the text of options in the expected order.
|
277
|
+
*/
|
278
|
+
verifyOptionsOrderInPreviewTab: (optionsTextArray) => {
|
279
|
+
optionsTextArray.forEach((option, index) => {
|
280
|
+
utilities.verifyTextContent(utilities.getNthElement(listOrderingPage.optionPreviewTab(), index), option);
|
281
|
+
});
|
372
282
|
},
|
373
283
|
|
374
284
|
/**
|
375
|
-
|
376
|
-
|
377
|
-
|
378
|
-
|
379
|
-
listOrderingPage.
|
380
|
-
.contains(optionsText)
|
381
|
-
.parents('.orderlist-option-wrapper')
|
382
|
-
.within(() => {
|
383
|
-
autoScoredPreviewBase.incorrectIcon()
|
384
|
-
.and('be.visible');
|
385
|
-
});
|
386
|
-
},
|
387
|
-
|
388
|
-
verifyQuestionPreviewStateWhenShowCorrectAnswerIsUnchecked: () => {
|
389
|
-
cy.log('After deselecting Show correct answer checkbox, the question preview should return to the previous state');
|
390
|
-
previewScoringAndShowCorrectAnswerComponent.steps.uncheckShowCorrectAnswerCheckbox();
|
391
|
-
autoScoredPreviewBase.correctIcon()
|
392
|
-
.should('not.exist');
|
393
|
-
autoScoredPreviewBase.incorrectIcon()
|
394
|
-
.should('not.exist');
|
395
|
-
autoScoredPreviewBase.correctIncorrectAnswerLabel()
|
396
|
-
.should('not.exist');
|
397
|
-
autoScoredPreviewBase.steps.verifyCorrectIncorrectBorderNotVisible()
|
285
|
+
* Verifies the points per response score against a given value.
|
286
|
+
* @param {number} value - The expected points per response score.
|
287
|
+
*/
|
288
|
+
verifyPointsPerResponseScore: (value) => {
|
289
|
+
utilities.verifyTextContent(listOrderingPage.pointsPerResponseValue(), value)
|
398
290
|
},
|
399
291
|
|
400
292
|
getOptionsArray: () => {
|
401
293
|
const optionsArray = []
|
402
|
-
listOrderingPage.
|
294
|
+
listOrderingPage.optionPreviewTab()
|
403
295
|
.each(($el) => {
|
404
296
|
cy.wrap($el)
|
405
297
|
.invoke('text')
|
@@ -417,341 +309,327 @@ const steps = {
|
|
417
309
|
verifyRandomizeOptionOrder: (optionsArray) => {
|
418
310
|
let currentOptionsArray = [...optionsArray]
|
419
311
|
for (let index = 0; index < currentOptionsArray.length; index++) {
|
420
|
-
listOrderingPage.
|
312
|
+
listOrderingPage.optionPreviewTab()
|
421
313
|
.eq(index)
|
422
314
|
.then(($element) => {
|
423
315
|
expect($element.text()).to.be.oneOf(currentOptionsArray);
|
424
316
|
currentOptionsArray = currentOptionsArray.filter((value) => value !== $element.text())
|
425
317
|
});
|
426
318
|
};
|
427
|
-
listOrderingPage.steps.
|
319
|
+
listOrderingPage.steps.verifyOptionsAreReRandomized(optionsArray)
|
428
320
|
},
|
429
321
|
|
430
322
|
/**
|
431
323
|
* @param {string[]} previousOrderOfOptionsArray array of previous order of options
|
432
324
|
* @description this function verifies that the order of the options is different from the previous order
|
433
325
|
*/
|
434
|
-
|
435
|
-
listOrderingPage.
|
326
|
+
verifyOptionsAreReRandomized: (previousOrderOfOptionsArray) => {
|
327
|
+
listOrderingPage.optionPreviewTab()
|
436
328
|
.should('not.have.text', '')
|
437
329
|
.and('not.have.text', previousOrderOfOptionsArray.join(''));
|
438
330
|
},
|
439
331
|
|
440
|
-
|
441
|
-
|
442
|
-
|
443
|
-
|
444
|
-
verifyDragHandleButtonDoesNotExistInSetCorrectAnswerSection: (index) => {
|
445
|
-
listOrderingPage.setCorrectAnswerSectionOption()
|
446
|
-
.eq(index)
|
447
|
-
.within(() => {
|
448
|
-
listOrderingPage.dragHandleButton()
|
449
|
-
.should('not.exist');
|
450
|
-
});
|
451
|
-
},
|
452
|
-
|
453
|
-
/**
|
454
|
-
* @param {number} index set correct answer option index
|
455
|
-
* @description this function verfies drag handle of options does not exist
|
456
|
-
*/
|
457
|
-
verifyDragHandleButtonDoesNotExistInPreviewTab: (index) => {
|
458
|
-
listOrderingPage.previewTabOption()
|
459
|
-
.eq(index)
|
460
|
-
.within(() => {
|
461
|
-
listOrderingPage.dragHandleButton()
|
462
|
-
.should('not.exist');
|
463
|
-
});
|
332
|
+
verifyOuterBorderOfQuestionPreview: () => {
|
333
|
+
utilities.verifyCSS(listOrderingPage.questionBorderPreviewTab(), {
|
334
|
+
'border': `1px solid ${css.color.draggableOptionsContainerBorder}`
|
335
|
+
});
|
464
336
|
},
|
465
337
|
|
466
|
-
|
467
|
-
|
468
|
-
verifyNoBorderForSetCorrectAnswerOption: () => {
|
469
|
-
listOrderingPage.setCorrectAnswerSectionOption()
|
470
|
-
.eq(0)
|
338
|
+
verifyOuterBorderOfQuestionPreviewNotExists: () => {
|
339
|
+
listOrderingPage.questionBorderPreviewTab()
|
471
340
|
.should('have.css', 'border')
|
472
341
|
.and('match', /0px none/);
|
473
342
|
},
|
474
343
|
|
475
|
-
|
476
|
-
listOrderingPage.
|
477
|
-
.
|
478
|
-
.should('have.css', 'border')
|
479
|
-
.and('match', /0px none/);
|
344
|
+
verifyEnableOuterBorderForQuestionCheckboxCheckedState: () => {
|
345
|
+
listOrderingPage.enableOuterBorderForQuestionCheckbox()
|
346
|
+
.should('be.checked');
|
480
347
|
},
|
481
348
|
|
482
|
-
|
483
|
-
listOrderingPage.
|
484
|
-
.
|
349
|
+
verifyEnableOuterBorderForQuestionCheckboxUncheckedState: () => {
|
350
|
+
listOrderingPage.enableOuterBorderForQuestionCheckbox()
|
351
|
+
.should('not.be.checked');
|
352
|
+
},
|
353
|
+
|
354
|
+
checkEnableOuterBorderForQuestionCheckbox: () => {
|
355
|
+
listOrderingPage.enableOuterBorderForQuestionCheckbox()
|
356
|
+
.click()
|
357
|
+
.should('be.checked');
|
485
358
|
},
|
486
359
|
|
487
|
-
|
488
|
-
|
489
|
-
|
360
|
+
uncheckEnableOuterBorderForQuestionCheckbox: () => {
|
361
|
+
listOrderingPage.enableOuterBorderForQuestionCheckbox()
|
362
|
+
.click()
|
363
|
+
.should('not.be.checked');
|
490
364
|
},
|
491
365
|
|
492
366
|
/**
|
493
|
-
|
494
|
-
|
495
|
-
|
496
|
-
|
497
|
-
|
498
|
-
.eq(index)
|
367
|
+
* @description Verifies that the image in the Specify Correct Answer section has the correct source and alt text.
|
368
|
+
* @param {number} index - The index of the option in the Specify Correct Answer section.
|
369
|
+
*/
|
370
|
+
verifyImageInSpecifyCorrectAnswerSection: (index) => {
|
371
|
+
utilities.getNthElement(listOrderingPage.optionSpecifyCorrectAnswerSection(), index)
|
499
372
|
.find('img')
|
500
373
|
.should('have.attr', 'src', constants.foxImageLink)
|
501
374
|
.and('have.attr', 'alt', constants.foxImageAltText);
|
502
375
|
},
|
503
376
|
|
504
377
|
/**
|
505
|
-
|
506
|
-
|
507
|
-
|
508
|
-
|
509
|
-
|
510
|
-
.
|
511
|
-
.
|
512
|
-
|
378
|
+
* @description Verifies that the bold text in the Specify Correct Answer section is correct.
|
379
|
+
* @param {number} index - The index of the option in the Specify Correct Answer section.
|
380
|
+
*/
|
381
|
+
verifyBoldTextInSpecifyCorrectAnswerSection: (index) => {
|
382
|
+
utilities.getNthElement(listOrderingPage.optionSpecifyCorrectAnswerSection(), index)
|
383
|
+
.find('strong')
|
384
|
+
.should('have.text', 'This is a bold option');
|
385
|
+
},
|
386
|
+
|
387
|
+
/**
|
388
|
+
* @description Verifies that the equation text in the Specify Correct Answer section is correct.
|
389
|
+
* @param {number} index - The index of the option in the Specify Correct Answer section.
|
390
|
+
*/
|
391
|
+
verifyEquationTextInSpecifyCorrectAnswerSection: (index) => {
|
392
|
+
utilities.getNthElement(listOrderingPage.optionSpecifyCorrectAnswerSection(), index)
|
513
393
|
.find('[role="math"]')
|
514
394
|
.should('have.attr', 'aria-label', constants.CKEditorInputFieldEnteredEquationAriaLabel)
|
395
|
+
.contains(constants.CKEditorInputFieldEnteredEquationText);
|
396
|
+
},
|
397
|
+
|
398
|
+
selectOrderingLayoutOption: (layoutOption) => {
|
399
|
+
switch (layoutOption) {
|
400
|
+
case 'Reorder in the same list':
|
401
|
+
listOrderingPage.reorderInTheSameListButton()
|
402
|
+
.click()
|
403
|
+
.should('have.class', 'ngie-toggle-button-selected');
|
404
|
+
break;
|
405
|
+
case 'Reorder as a separate list':
|
406
|
+
listOrderingPage.reorderAsSeparateListButton()
|
407
|
+
.click()
|
408
|
+
.should('have.class', 'ngie-toggle-button-selected');
|
409
|
+
break;
|
410
|
+
case 'Dropdown menu':
|
411
|
+
listOrderingPage.dropdownMenuButton()
|
412
|
+
.click()
|
413
|
+
.should('have.class', 'ngie-toggle-button-selected');
|
414
|
+
break;
|
415
|
+
default:
|
416
|
+
throw new Error('Invalid layout option');
|
417
|
+
}
|
418
|
+
},
|
419
|
+
|
420
|
+
///Dropdown menu steps
|
421
|
+
expandDropdownMenuOptionsDropdown: () => {
|
422
|
+
listOrderingPage.dropdownMenuOptionsDropdown()
|
423
|
+
.click();
|
515
424
|
},
|
516
425
|
|
517
426
|
/**
|
518
|
-
*
|
519
|
-
* @
|
427
|
+
* Expands the position dropdown in the specify correct answer section and selects the specified dropdown index.
|
428
|
+
* @param {number} dropdownIndex - The index of the dropdown to expand and select.
|
520
429
|
*/
|
521
|
-
|
522
|
-
|
523
|
-
.
|
524
|
-
.should('have.text', 'lorem')
|
525
|
-
.find('a')
|
526
|
-
.should('have.attr', 'href', `${Cypress.config().baseUrl}`)
|
430
|
+
expandPositionDropdownSpecifyCorrectAnswerSection: (dropdownIndex) => {
|
431
|
+
utilities.getNthElement(listOrderingPage.positionDropdownSpecifyCorrectAnswerSection(), dropdownIndex)
|
432
|
+
.click();
|
527
433
|
},
|
528
434
|
|
529
435
|
/**
|
530
|
-
|
531
|
-
|
532
|
-
|
533
|
-
|
534
|
-
|
535
|
-
|
536
|
-
|
537
|
-
.
|
538
|
-
.should('have.text', 'This is a bold option');
|
436
|
+
* Selects the specified option from the position dropdown in the specify correct answer section.
|
437
|
+
* @param {number} optionIndex - The index of the option in the dropdown.
|
438
|
+
* @param {string} position - The position to select.
|
439
|
+
*/
|
440
|
+
selectOptionPositionSpecifyCorrectAnswerSection: (optionIndex, position) => {
|
441
|
+
steps.expandPositionDropdownSpecifyCorrectAnswerSection(optionIndex);
|
442
|
+
listOrderingPage.positionDropdownListOption(position)
|
443
|
+
.click();
|
539
444
|
},
|
540
445
|
|
541
446
|
/**
|
542
|
-
*
|
543
|
-
* @
|
447
|
+
* Selects positions for all options in the specify correct answer section according to the provided position object.
|
448
|
+
* @param {Object[]} positionObject - An array of objects where each object contains optionIndex and position properties.
|
449
|
+
* @param {number} positionObject[].optionIndex - The index of the option.
|
450
|
+
* @param {string} positionObject[].position - The position to select.
|
544
451
|
*/
|
545
|
-
|
546
|
-
|
547
|
-
|
548
|
-
.within(() => {
|
549
|
-
listOrderingPage.optionNumeration()
|
550
|
-
.eq(index)
|
551
|
-
.should('have.text', optionNumeration);
|
552
|
-
});
|
452
|
+
selectPositionForAllOptionsSpecifyCorrectAnswerSection: (positionObject) => {
|
453
|
+
positionObject.forEach(({ optionIndex, position }) => {
|
454
|
+
steps.selectOptionPositionSpecifyCorrectAnswerSection(optionIndex, position)
|
553
455
|
});
|
554
456
|
},
|
555
457
|
|
556
|
-
|
557
|
-
|
558
|
-
|
559
|
-
|
560
|
-
|
561
|
-
|
562
|
-
.
|
563
|
-
|
564
|
-
}
|
565
|
-
}
|
458
|
+
/**
|
459
|
+
* Expands the position dropdown in the specify correct answer section and selects the specified dropdown index.
|
460
|
+
* @param {number} dropdownIndex - The index of the dropdown to expand and select.
|
461
|
+
*/
|
462
|
+
expandPositionDropdownPreviewTab: (dropdownIndex) => {
|
463
|
+
utilities.getNthElement(listOrderingPage.positionDropdownPreviewTab(), dropdownIndex)
|
464
|
+
.click();
|
465
|
+
},
|
566
466
|
|
567
|
-
|
568
|
-
|
569
|
-
|
570
|
-
|
571
|
-
|
572
|
-
|
573
|
-
|
574
|
-
|
575
|
-
|
576
|
-
...autoScoredAdditionalSettings.tests,
|
577
|
-
...answerNumerationComponent.tests,
|
578
|
-
...studentResponseAndLayoutComponent.tests,
|
579
|
-
...listSortingAndOrderingBase.tests,
|
580
|
-
verifyAllContentsOfSetCorrectAnswerSectionForScoringType: (scoringType, optionsArray) => {
|
581
|
-
it(`When user has selected ${scoringType} scoring type then added options should be displayed in the set correct answer section`, () => {
|
582
|
-
listOrderingPage.steps.verifyOptionsTextContentInSetCorrectAnswerSection(optionsArray);
|
583
|
-
for (let index = 0; index < 4; index++) {
|
584
|
-
listOrderingPage.steps.verifyDragHandleButtonOfOptionInSetCorrectAnswerSection(index);
|
585
|
-
}
|
586
|
-
});
|
467
|
+
/**
|
468
|
+
* Selects the specified option from the position dropdown in the specify correct answer section.
|
469
|
+
* @param {number} optionIndex - The index of the option in the dropdown.
|
470
|
+
* @param {string} position - The position to select.
|
471
|
+
*/
|
472
|
+
selectOptionPositionPreviewTab: (optionIndex, position) => {
|
473
|
+
steps.expandPositionDropdownPreviewTab(optionIndex);
|
474
|
+
listOrderingPage.positionDropdownListOption(position)
|
475
|
+
.click();
|
587
476
|
},
|
588
477
|
|
589
478
|
/**
|
590
|
-
*
|
591
|
-
* @
|
479
|
+
* Selects positions for all options in the specify correct answer section according to the provided position object.
|
480
|
+
* @param {Object[]} positionObject - An array of objects where each object contains optionIndex and position properties.
|
481
|
+
* @param {number} positionObject[].optionIndex - The index of the option.
|
482
|
+
* @param {string} positionObject[].position - The position to select.
|
592
483
|
*/
|
593
|
-
|
594
|
-
|
595
|
-
|
596
|
-
createQuestionBasePage.steps.switchToEditTab();
|
597
|
-
scoringSectionBase.steps.expandMinimumScoringDropdown();
|
598
|
-
scoringSectionBase.steps.selectMinimumScoringTypeListOption('Award minimum score only if attempted');
|
599
|
-
scoringSectionBase.steps.allotMinimumScoreAwardedIfAttempted('1')
|
600
|
-
createQuestionBasePage.steps.switchToPreviewTab()
|
601
|
-
listOrderingPage.steps.clickAndReorderOptionInPrevewTab('plant', 0);
|
602
|
-
listOrderingPage.steps.clickAndReorderOptionInPrevewTab('seed', 1);
|
603
|
-
listOrderingPage.steps.clickAndReorderOptionInPrevewTab('flower', 2);
|
604
|
-
listOrderingPage.steps.verifyTextContentOfOptionsInPreviewTab(['plant', 'seed', 'flower', 'sprout']);
|
605
|
-
listOrderingPage.previewScoreText()
|
606
|
-
.verifyInnerText(`1/${totalPoints}`);
|
484
|
+
selectPositionForAllOptionsPreviewTab: (positionObject) => {
|
485
|
+
positionObject.forEach(({ optionIndex, position }) => {
|
486
|
+
steps.selectOptionPositionPreviewTab(optionIndex, position)
|
607
487
|
});
|
488
|
+
},
|
608
489
|
|
609
|
-
|
610
|
-
|
611
|
-
|
612
|
-
|
613
|
-
|
614
|
-
|
615
|
-
|
616
|
-
|
617
|
-
|
618
|
-
|
619
|
-
|
620
|
-
|
490
|
+
/**
|
491
|
+
* @param {number} optionIndex option to be checked for the correct icon
|
492
|
+
* @description This function verifies the correct icon in the preview tab for the dropdown order layout
|
493
|
+
*/
|
494
|
+
verifyCorrectOptionIconDropdownLayout: (optionIndex) => {
|
495
|
+
utilities.getNthElement(listOrderingPage.dropdownWrapperPreviewTab(), optionIndex)
|
496
|
+
.within(() => {
|
497
|
+
utilities.verifyElementVisibilityState(autoScoredScoringPreviewTab.correctIcon(), 'visible');
|
498
|
+
});
|
499
|
+
},
|
500
|
+
|
501
|
+
/**
|
502
|
+
* @param {number} optionIndex option to be checked for the correct icon
|
503
|
+
* @description This function verifies the correct icon in the preview tab for the dropdown order layout
|
504
|
+
*/
|
505
|
+
verifyIncorrectOptionIconDropdownLayout: (optionIndex) => {
|
506
|
+
utilities.getNthElement(listOrderingPage.dropdownWrapperPreviewTab(), optionIndex)
|
507
|
+
.within(() => {
|
508
|
+
utilities.verifyElementVisibilityState(autoScoredScoringPreviewTab.incorrectIcon(), 'visible');
|
509
|
+
});
|
621
510
|
},
|
622
511
|
|
623
512
|
/**
|
624
|
-
|
625
|
-
|
626
|
-
|
627
|
-
|
513
|
+
* @param {number} optionIndex option to be checked for the correct/incorrect icon to not exist
|
514
|
+
* @description This function verifies the correct/incorrect icon to not exist in the preview tab for the dropdown order layout
|
515
|
+
*/
|
516
|
+
verifyCorrectIncorrectOptionIconDropdownLayoutNotExists: (optionIndex) => {
|
517
|
+
utilities.getNthElement(listOrderingPage.dropdownWrapperPreviewTab(), optionIndex)
|
518
|
+
.within(() => {
|
519
|
+
utilities.verifyElementVisibilityState(autoScoredScoringPreviewTab.incorrectIcon(), 'notExist');
|
520
|
+
utilities.verifyElementVisibilityState(autoScoredScoringPreviewTab.correctIcon(), 'notExist');
|
521
|
+
});
|
522
|
+
},
|
523
|
+
|
524
|
+
/**
|
525
|
+
* @description Verifies that the image in the Preview tab has the correct source and alt text.
|
526
|
+
* @param {number} optionIndex - The index of the option in the Preview tab.
|
527
|
+
*/
|
528
|
+
verifyOptionWithImageDropdownLayoutInGradingView: (optionIndex) => {
|
529
|
+
listOrderingPage.dropdownOptionWrapperGradingView()
|
530
|
+
.eq(optionIndex)
|
531
|
+
.find('img')
|
532
|
+
.should('have.attr', 'src', constants.foxImageLink)
|
533
|
+
.and('have.attr', 'alt', constants.foxImageAltText);
|
534
|
+
},
|
535
|
+
|
536
|
+
/**
|
537
|
+
* @description Verifies that the bold text in the Preview tab is correct.
|
538
|
+
* @param {number} optionIndex - The index of the option in the Preview tab.
|
628
539
|
*/
|
629
|
-
|
630
|
-
|
631
|
-
|
632
|
-
|
633
|
-
|
634
|
-
|
635
|
-
cy.log('After switching to preview tab, when user adds an incorrect answer input, then 0 points should be awarded(no negative points)');
|
636
|
-
createQuestionBasePage.steps.switchToPreviewTab();
|
637
|
-
listOrderingPage.steps.clickAndReorderOptionInPrevewTab('plant', 1);
|
638
|
-
listOrderingPage.steps.verifyTextContentOfOptionsInPreviewTab(['sprout', 'plant', 'flower', 'seed']);
|
639
|
-
listOrderingPage.previewScoreText()
|
640
|
-
.verifyInnerText(`0/${totalPoints}`);
|
641
|
-
|
642
|
-
cy.log('When user adds a partially correct answer input, the points should be updated accordingly with deducted penalty points');
|
643
|
-
listOrderingPage.steps.resetQuestionPreview(['sprout', 'plant', 'flower', 'seed'])
|
644
|
-
listOrderingPage.steps.clickAndReorderOptionInPrevewTab('seed', 0);
|
645
|
-
listOrderingPage.steps.clickAndReorderOptionInPrevewTab('plant', 1);
|
646
|
-
listOrderingPage.steps.verifyTextContentOfOptionsInPreviewTab(['seed', 'plant', 'sprout', 'flower']);
|
647
|
-
listOrderingPage.previewScoreText()
|
648
|
-
.verifyInnerText(`${scoredPoints}/${totalPoints}`);
|
649
|
-
|
650
|
-
cy.log('Post step: Clearing the Penalty points field')
|
651
|
-
createQuestionBasePage.steps.switchToEditTab();
|
652
|
-
autoScoredScoringSectionMultipleResponsesType.penaltyPointsInputField()
|
653
|
-
.clear();
|
654
|
-
});
|
540
|
+
verifyOptionWithBoldTextDropdownLayoutInGradingView: (optionIndex) => {
|
541
|
+
listOrderingPage.dropdownOptionWrapperGradingView()
|
542
|
+
.eq(optionIndex)
|
543
|
+
.find('strong')
|
544
|
+
.should('have.text', 'This is a bold option');
|
655
545
|
},
|
656
546
|
|
657
547
|
/**
|
658
|
-
|
659
|
-
|
660
|
-
|
661
|
-
|
662
|
-
|
663
|
-
|
664
|
-
|
665
|
-
|
666
|
-
|
667
|
-
listOrderingPage.steps.clickAndReorderOptionInPrevewTab('plant', 3);
|
668
|
-
listOrderingPage.steps.clickAndReorderOptionInPrevewTab('flower', 1);
|
669
|
-
listOrderingPage.steps.verifyTextContentOfOptionsInPreviewTab(['seed', 'flower', 'sprout', 'plant']);
|
670
|
-
listOrderingPage.steps.verifyPreviewTabScoreText(`${totalPointsScored}`, `${totalPointsScored}`);
|
671
|
-
cy.log('Post step: Clearing the Penalty points field')
|
672
|
-
createQuestionBasePage.steps.switchToEditTab();
|
673
|
-
autoScoredScoringSectionMultipleResponsesType.penaltyPointsInputField()
|
674
|
-
.clear();
|
675
|
-
});
|
548
|
+
* @description Verifies that the equation text in the Preview tab is correct.
|
549
|
+
* @param {number} optionIndex - The index of the option in the Preview tab.
|
550
|
+
*/
|
551
|
+
verifyOptionWithEquationTextDropdownLayoutInGradingView: (optionIndex) => {
|
552
|
+
listOrderingPage.dropdownOptionWrapperGradingView()
|
553
|
+
.eq(optionIndex)
|
554
|
+
.find('[role="math"]')
|
555
|
+
.should('have.attr', 'aria-label', constants.CKEditorInputFieldEnteredEquationAriaLabel)
|
556
|
+
.contains(constants.CKEditorInputFieldEnteredEquationText);
|
676
557
|
},
|
677
558
|
|
678
559
|
/**
|
679
|
-
* @param {
|
680
|
-
*
|
681
|
-
* - The second element represents points scored for partially correct answers.
|
682
|
-
* - The third element represents points scored when minimum score awarded (if attempted) points is greater than the points achieved by attempting the question partially correct
|
683
|
-
* @param {number} minimumPointsForPartialCorrectAnswers minimum score awarded (if attempted) points on attempting the question partially correct
|
684
|
-
* @param {number} totalPoints the maximum points that can be achieved by the user
|
685
|
-
* @description this function verifies the functionality of Minimum score if attempted points when penalty points are set and user attempts incorrect answer
|
686
|
-
* - For all incorrect responses
|
687
|
-
* - For partially correct responses, when points scored > minimum score awarded(if attempted) points
|
688
|
-
* - For partially correct responses, when minimum score awarded(if attempted) points > points scored
|
560
|
+
* @param {string[]} optionsTextArray options array for set correct answer option
|
561
|
+
* @description this function verifies options text content
|
689
562
|
*/
|
690
|
-
|
691
|
-
|
692
|
-
cy.log('Pre-step: Switch to edit tab and set minimum score awarded (if attempted) points and Penalty points');
|
693
|
-
createQuestionBasePage.steps.switchToEditTab();
|
694
|
-
scoringSectionBase.steps.allotMinimumScoreAwardedIfAttempted(1);
|
695
|
-
autoScoredScoringSectionMultipleResponsesType.steps.allotPenaltyPoints(3);
|
696
|
-
|
697
|
-
cy.log('Switch to preview tab and give incorrect answer input to check that minimum points are displayed');
|
698
|
-
createQuestionBasePage.steps.switchToPreviewTab();
|
699
|
-
listOrderingPage.steps.clickAndReorderOptionInPrevewTab('flower', 0);
|
700
|
-
listOrderingPage.steps.clickAndReorderOptionInPrevewTab('sprout', 3);
|
701
|
-
listOrderingPage.steps.verifyTextContentOfOptionsInPreviewTab(['flower', 'plant', 'seed', 'sprout']);
|
702
|
-
listOrderingPage.previewScoreText()
|
703
|
-
.verifyInnerText(`${scoredPointsArray[0]}/${totalPoints}`);
|
704
|
-
|
705
|
-
cy.log('When user adds a partially correct answer such that the points of the attempt(with penalty points deducted) is more than the minimum score awarded(if attempted) points');
|
706
|
-
listOrderingPage.steps.resetQuestionPreview(['sprout', 'plant', 'flower', 'seed']);
|
707
|
-
listOrderingPage.steps.clickAndReorderOptionInPrevewTab('seed', 0);
|
708
|
-
listOrderingPage.steps.clickAndReorderOptionInPrevewTab('plant', 1);
|
709
|
-
listOrderingPage.steps.verifyTextContentOfOptionsInPreviewTab(['seed', 'plant', 'sprout', 'flower']);
|
710
|
-
listOrderingPage.previewScoreText()
|
711
|
-
.verifyInnerText(`${scoredPointsArray[1]}/${totalPoints}`);
|
712
|
-
|
713
|
-
cy.log('When user switches to edit tab and increases the minimum score awarded (if attempted) points to check the case for an attempt in which points of the attempt is less than minimum score awarded (if attempted) points, then the minimum score awarded (if attempted) points should be displayed to the user');
|
714
|
-
createQuestionBasePage.steps.switchToEditTab();
|
715
|
-
scoringSectionBase.steps.clearMinimumScoreIfAttemptedPointsField()
|
716
|
-
scoringSectionBase.steps.allotMinimumScoreAwardedIfAttempted(minimumPointsForPartialCorrectAnswers)
|
717
|
-
cy.log('Switching to preview tab');
|
718
|
-
createQuestionBasePage.steps.switchToPreviewTab();
|
719
|
-
listOrderingPage.steps.clickAndReorderOptionInPrevewTab('seed', 0);
|
720
|
-
listOrderingPage.steps.clickAndReorderOptionInPrevewTab('plant', 1);
|
721
|
-
listOrderingPage.steps.clickAndReorderOptionInPrevewTab('flower', 2);
|
722
|
-
listOrderingPage.steps.verifyTextContentOfOptionsInPreviewTab(['seed', 'plant', 'flower', 'sprout']);
|
723
|
-
listOrderingPage.previewScoreText()
|
724
|
-
.verifyInnerText(`${scoredPointsArray[2]}/${totalPoints}`);
|
725
|
-
});
|
563
|
+
verifyTextContentOfOptionDropdownLayoutInGradingView: (optionsText, index) => {
|
564
|
+
utilities.verifyTextContent(utilities.getNthElement(listOrderingPage.dropdownOptionWrapperGradingView(), index), optionsText);
|
726
565
|
},
|
727
566
|
|
728
|
-
//Additional settings
|
729
567
|
/**
|
730
|
-
* @param {string[]}
|
731
|
-
* @description this function
|
568
|
+
* @param {string[]} optionsTextArray array of options in the correct answer section
|
569
|
+
* @description this function verifies the correct order of options in correct answer section
|
732
570
|
*/
|
733
|
-
|
734
|
-
|
735
|
-
listOrderingPage.
|
736
|
-
|
737
|
-
|
738
|
-
|
739
|
-
|
571
|
+
verifyOptionsPositionInCorrectAnswerSection: (optionsTextArray, positionArray) => {
|
572
|
+
optionsTextArray.forEach((optionsText, index) => {
|
573
|
+
utilities.getNthElement(listOrderingPage.correctAnswerSectionAnswerWrapper(), index)
|
574
|
+
.within(() => {
|
575
|
+
utilities.verifyTextContent(listOrderingPage.correctAnswerSectionAnswerText(), optionsText);
|
576
|
+
});
|
577
|
+
});
|
578
|
+
positionArray.forEach((position, dropdownIndex) => {
|
579
|
+
utilities.verifyTextContent(utilities.getNthElement(listOrderingPage.positionDropdownCorrectAnswerSection(), dropdownIndex), position);
|
740
580
|
});
|
741
581
|
},
|
742
582
|
|
743
583
|
/**
|
744
|
-
|
745
|
-
|
746
|
-
|
747
|
-
|
748
|
-
|
749
|
-
|
750
|
-
|
751
|
-
|
584
|
+
* Verifies the selected option position in the dropdown for the specified dropdown index.
|
585
|
+
* @param {number} dropdownIndex - The index of the dropdown to verify.
|
586
|
+
* @param {string} position - The expected position of the selected option.
|
587
|
+
*/
|
588
|
+
verifySelectedOptionPositionDropdown: (dropdownIndex, position) => {
|
589
|
+
utilities.getNthElement(listOrderingPage.positionDropdownPreviewTab(), dropdownIndex)
|
590
|
+
.within(() => {
|
591
|
+
if (position === '') {
|
592
|
+
utilities.verifyElementVisibilityState(listOrderingPage.dropdownSelectedOptionLabel(), 'notExist');
|
593
|
+
} else {
|
594
|
+
utilities.verifyInnerText(listOrderingPage.dropdownSelectedOptionLabel(), position);
|
595
|
+
}
|
596
|
+
});
|
597
|
+
},
|
598
|
+
|
599
|
+
verifyAssignValueToAllDropdownAlertMessage: () => {
|
600
|
+
utilities.verifyInnerText(listOrderingPage.alertMessage(), 'All options need to have a value assigned to them from the dropdown.');
|
601
|
+
utilities.verifyElementVisibilityState(listOrderingPage.alertMessage(), 'visible');
|
602
|
+
},
|
603
|
+
|
604
|
+
verifyAlertMessageNotExists: () => {
|
605
|
+
utilities.verifyElementVisibilityState(listOrderingPage.alertMessage(), 'notExist');
|
752
606
|
}
|
753
607
|
}
|
754
608
|
|
609
|
+
const tests = {
|
610
|
+
...autoScoredScoringPreviewTab.tests,
|
611
|
+
...scoringSectionBaseEditTab.tests,
|
612
|
+
...autoScoredScoringSectionMultiResponseType.tests,
|
613
|
+
...autoScoredSpecifyCorrectAnswerSection.tests,
|
614
|
+
...commonComponents.tests,
|
615
|
+
...studentViewSettingsLabelComponent.tests,
|
616
|
+
...randomizeOptionsComponent.tests,
|
617
|
+
...autoScoredStudentViewSettings.tests,
|
618
|
+
...questionInstructionsComponent.tests,
|
619
|
+
...optionsWrapperComponent.tests,
|
620
|
+
...additionalSettingsPanel.tests,
|
621
|
+
...additionalSettingsAccessibilitySectionComponent.tests,
|
622
|
+
...createQuestionBasePage.tests,
|
623
|
+
verifyContentsOfSpecifyCorrectAnswerSection: () => {
|
624
|
+
it('When user selects a scoring type then in the \'Correct\' accordion, all the contents should be displayed', () => {
|
625
|
+
utilities.verifyElementCount(listOrderingPage.optionSpecifyCorrectAnswerSection(), 4);
|
626
|
+
options.forEach((optionText, index) => {
|
627
|
+
listOrderingPage.steps.verifyTextContentOfOptionInSpecifyCorrectAnswerSection(optionText, index);
|
628
|
+
});
|
629
|
+
});
|
630
|
+
},
|
631
|
+
}
|
632
|
+
|
755
633
|
export const listOrderingPage = {
|
756
634
|
...selectors,
|
757
635
|
steps,
|