itemengine-cypress-automation 1.0.239 → 1.0.240
Sign up to get free protection for your applications and to get access to all the features.
- package/cypress/e2e/ILC/BrainingCampManipulative/editTabBasicSection.js +2 -2
- package/cypress/e2e/ILC/ChartsBar/headerSection.js +22 -5
- package/cypress/e2e/ILC/ChartsLine/headerSection.js +23 -5
- package/cypress/e2e/ILC/ContentBlocks/editTabBasics.js +3 -4
- package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/clickAndDrop.js +2 -4
- package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/draggableOptions.js +3 -4
- package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/headerSection.js +4 -6
- package/cypress/e2e/ILC/EssayResponse/equationEditor.smoke.js +1 -3
- package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/Scoring/allOrNothingWithCorrectPointsEqualToAlternativePoints.js +1 -1
- package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/clickAndDrop.js +2 -4
- package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/draggableOptions.js +3 -4
- package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/editTabBasicSection.js +2 -2
- package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/headerSection.js +4 -5
- package/cypress/e2e/ILC/FillInTheGapsDropdownNew/dropdownOptionsSection.js +2 -2
- package/cypress/e2e/ILC/FillInTheGapsDropdownNew/editTabBasicSection.js +2 -2
- package/cypress/e2e/ILC/FillInTheGapsDropdownNew/headerSection.js +3 -5
- package/cypress/e2e/ILC/FillInTheGapsDropdownNew/specifyCorrectAnswerSection.js +1 -1
- package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/additionalSettings.js +172 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/clickAndDrop.js +3 -5
- package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/draggableOptions.js +0 -1
- package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/headerSection.js +3 -8
- package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/Scoring/manuallyAndNonScored.js +6 -6
- package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/additionalSettingsBasic.js +2 -2
- package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/dropdownOptionsSection.js +2 -2
- package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/editTabBasicSection.js +3 -1
- package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/headerSection.js +2 -8
- package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/supportedFileTypes.js +2 -3
- package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/HeaderSection.js +3 -5
- package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/backgroundImageAndCanvasProperties.js +2 -2
- package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/specifyCorrectAnswerSection.js +3 -3
- package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/styleAndLayoutCustomization.js +16 -16
- package/cypress/e2e/ILC/FillInTheGapsTextNew/editTabBasicSection.js +3 -2
- package/cypress/e2e/ILC/FillInTheGapsTextNew/headerSection.js +3 -3
- package/cypress/e2e/ILC/FillInTheGapsTextNew/specifyCorrectAnswerSection.js +3 -3
- package/cypress/e2e/ILC/Graphing/headerSection.js +2 -3
- package/cypress/e2e/ILC/GridFill/headerSection.js +2 -4
- package/cypress/e2e/ILC/GridFill/specifyCorrectAnswerSection.js +6 -3
- package/cypress/e2e/ILC/ImageHighlight/headerSection.js +2 -4
- package/cypress/e2e/ILC/ListOrderingDropdown/Scoring/partialDifferentWeightsMinimumAndPenaltyScoring.js +2 -2
- package/cypress/e2e/ILC/ListOrderingDropdown/minimumScoringPenaltyPointsAndRoundingDropdown.js +1 -1
- package/cypress/e2e/ILC/ListOrderingDropdown/specifyCorrectAnswerSection.js +6 -8
- package/cypress/e2e/ILC/ListOrderingNew/headerSection.js +2 -8
- package/cypress/e2e/ILC/ListOrderingNew/optionsOrientationSection.js +150 -0
- package/cypress/e2e/ILC/ListOrderingReorderAsASeperateList/HorizontalOrientation/horizontalOrientationAllOrNothingForAllViews.smoke.js +218 -0
- package/cypress/e2e/ILC/ListOrderingReorderAsASeperateList/HorizontalOrientation/previewContentsForAllViews.smoke.js +176 -0
- package/cypress/e2e/ILC/ListOrderingReorderAsASeperateList/Scoring/allOrNothingAlternativePointsGreaterThanCorrectPoints.js +170 -0
- package/cypress/e2e/ILC/ListOrderingReorderAsASeperateList/Scoring/allOrNothingCorrectPointsEqualToAlternativePoints.js +170 -0
- package/cypress/e2e/ILC/ListOrderingReorderAsASeperateList/Scoring/allOrNothingCorrectPointsGreaterThanAlternativePoints.js +230 -0
- package/cypress/e2e/ILC/ListOrderingReorderAsASeperateList/Scoring/allOrNothingPenaltyScoring.js +64 -0
- package/cypress/e2e/ILC/ListOrderingReorderAsASeperateList/Scoring/manuallyAndNonScored.js +110 -0
- package/cypress/e2e/ILC/ListOrderingReorderAsASeperateList/allOrNothingForAllViews.smoke.js +249 -0
- package/cypress/e2e/ILC/ListOrderingReorderAsASeperateList/previewContentsForAllViews.smoke.js +172 -0
- package/cypress/e2e/ILC/Matching/clickAndDrop.js +6 -10
- package/cypress/e2e/ILC/Matching/headerSection.js +2 -10
- package/cypress/e2e/ILC/Matching/matchingConnector.js +128 -0
- package/cypress/e2e/ILC/Matching/minimumScoringPenaltyPointsAndRoundingDropdown.js +2 -2
- package/cypress/e2e/ILC/Matching/questionInstructionsAndPromptSection.js +2 -15
- package/cypress/e2e/ILC/MatchingDropdown/editTabBasicSection.js +154 -0
- package/cypress/e2e/ILC/MultipleSelection/headerSection.js +4 -6
- package/cypress/e2e/ILC/MultipleSelectionGridNew/Scoring/allOrNothingCorrectPointsGreaterThanAlternativePoints.js +4 -4
- package/cypress/e2e/ILC/MultipleSelectionGridNew/Scoring/partialDifferentWeightsMinimumAndPenaltyScoring.js +1 -1
- package/cypress/e2e/ILC/MultipleSelectionGridNew/headerSection.js +3 -9
- package/cypress/e2e/ILC/NumberLine/headerSection.js +2 -3
- package/cypress/e2e/ILC/NumberLineLabel/headerSection.js +4 -4
- package/cypress/e2e/ILC/ShortTextResponseNew/headerSection.js +2 -4
- package/cypress/e2e/ILC/SingleSelection/headerSection.js +2 -5
- package/cypress/e2e/ILC/SingleSelectionGridNew/Scoring/allOrNothingAlternativePointsGreaterThanCorrectPoints.js +2 -2
- package/cypress/e2e/ILC/SingleSelectionGridNew/Scoring/allOrNothingCorrectPointsGreaterThanAlternativePoints.js +2 -2
- package/cypress/e2e/ILC/SingleSelectionGridNew/headerSection.js +2 -9
- package/cypress/e2e/ILC/TextEntryMath/Scoring/allOrNothingAlternatePointsGreaterThanCorrectPoints.js +210 -0
- package/cypress/e2e/ILC/TextEntryMath/Scoring/allOrNothingCorrectPointsEqualToAlternatePoints.js +210 -0
- package/cypress/e2e/ILC/TextEntryMath/Scoring/allOrNothingCorrectPointsGreaterThanAlternatePoints.js +258 -0
- package/cypress/e2e/ILC/TextEntryMath/Scoring/partialDifferentWeightsAlternativePointsGreaterThanCorrectPoints.js +246 -0
- package/cypress/e2e/ILC/TextEntryMath/Scoring/partialDifferentWeightsCorrectPointsEqualToAlternativePoints.js +203 -0
- package/cypress/e2e/ILC/TextEntryMath/Scoring/partialDifferentWeightsCorrectPointsGreaterThanAlternativePoints.js +245 -0
- package/cypress/e2e/ILC/TextEntryMath/Scoring/partialDifferentWeightsScoringBasic.js +541 -0
- package/cypress/e2e/ILC/TextEntryMath/Scoring/partialEqualWeightsAlternativePointsGreaterThanCorrectPoints.js +243 -0
- package/cypress/e2e/ILC/TextEntryMath/Scoring/partialEqualWeightsCorrectPointsEqualToAlternativePoints.js +203 -0
- package/cypress/e2e/ILC/TextEntryMath/Scoring/partialEqualWeightsCorrectPointsGreaterThanAlternativePoints.js +242 -0
- package/cypress/e2e/ILC/TextEntryMath/Scoring/partialEqualWeightsScoringBasic.js +195 -0
- package/cypress/e2e/ILC/TextEntryMath/allOrNothingBasicForAllViews.smoke.js +6 -0
- package/cypress/e2e/ILC/TextEntryMath/editTabBasicSection.js +8 -1
- package/cypress/e2e/ILC/TextEntryMath/editTabScoringSection.js +12 -0
- package/cypress/e2e/ILC/TextEntryMath/evaluationMethodEquivalentStructures.js +10 -0
- package/cypress/e2e/ILC/TextEntryMath/evaluationMethodMatchExact.js +2 -0
- package/cypress/e2e/ILC/TextEntryMath/evaluationMethodMatchValue.js +2 -0
- package/cypress/e2e/ILC/TextEntryMath/evaluationMethodSymbolsAreEquivalent.js +2 -0
- package/cypress/e2e/ILC/TextEntryMath/evaluationMethodValueIsEquivalent.js +2 -0
- package/cypress/e2e/ILC/TextEntryMath/evaluationMethodsWithoutSetResponse.js +4 -0
- package/cypress/e2e/ILC/TextEntryMath/minimumScoringPenaltyPointsAndRoundingDropdown.js +6 -0
- package/cypress/e2e/ILC/TextEntryMath/previewContentsForAllViews.smoke.js +2 -0
- package/cypress/e2e/ILC/TextEntryMathWithImage/allOrNothingScoringForAllViews.smoke.js +6 -0
- package/cypress/e2e/ILC/TextEntryMathWithImage/backgroundImageAndCanvasProperties.js +2 -0
- package/cypress/e2e/ILC/TextEntryMathWithImage/previewTabContentsForAllViews.smoke.js +2 -0
- package/cypress/e2e/ILC/TextSelection/Scoring/singleSelectionPreviewScoring.js +247 -0
- package/cypress/e2e/ILC/TextSelection/headerSection.js +4 -5
- package/cypress/e2e/ILC/TextSelection/questionInstructionsAndQuestion.js +1 -2
- package/cypress/e2e/ILC/TextSelection/singleMultipleSelection.js +100 -0
- package/cypress/e2e/ILC/TextSelection/styleAndLayoutCustomizationAccordionOutline.js +248 -0
- package/cypress/e2e/ILC/TextSelection/styleAndLayoutCustomizationAccordionStrikethrough.js +247 -0
- package/cypress/e2e/ILC/TextSelection/styleAndLayoutCustomizationAccordionUnderline.js +239 -0
- package/cypress/e2e/ILC/TextSelection/textSelectionStyle.js +150 -0
- package/cypress/e2e/ILC/ToolAudioPlayerNew/headerSection.js +3 -2
- package/cypress/e2e/ILC/UploadResponse/editTabBasicSection.js +2 -3
- package/cypress/e2e/ILC/chartsDotsPlot/allOrNothingForAllViews.smoke.js +1 -1
- package/cypress/e2e/ILC/chartsDotsPlot/headerSection.js +21 -5
- package/cypress/pages/components/autoScoredScoringPreviewTab.js +1 -0
- package/cypress/pages/components/autoScoredSetCorrectAnswerSection.js +0 -11
- package/cypress/pages/components/autoScoredSpecifyCorrectAnswerSection.js +11 -29
- package/cypress/pages/components/draggableOptionsStyleAndLayoutComponent.js +1 -1
- package/cypress/pages/components/figCommonStyleAndLayoutComponent.js +1 -1
- package/cypress/pages/components/fillInTheGapsDropdownCommonComponent.js +2 -3
- package/cypress/pages/components/fillInTheGapsTextCommonComponent.js +2 -2
- package/cypress/pages/components/optionsWrapperComponent.js +2 -2
- package/cypress/pages/components/playbackControlsBaseComponent.js +2 -2
- package/cypress/pages/components/questionInputFieldComponent.js +1 -0
- package/cypress/pages/components/scoringSectionBaseEditTab.js +3 -2
- package/cypress/pages/components/singleMultipleSelectionModeComponent.js +1 -1
- package/cypress/pages/createItemPage.js +1 -1
- package/cypress/pages/dialogBoxBase.js +21 -9
- package/cypress/pages/dragAndDropIntoCategoriesPage.js +4 -5
- package/cypress/pages/fillInTheGapsOverImageDragAndDropPage.js +83 -5
- package/cypress/pages/graphingPage.js +4 -7
- package/cypress/pages/gridFillPage.js +15 -16
- package/cypress/pages/listOrderingPage.js +373 -2
- package/cypress/pages/matchingPage.js +89 -33
- package/cypress/pages/multipleSelectionGridPage.js +11 -13
- package/cypress/pages/multipleSelectionPage.js +4 -5
- package/cypress/pages/numberLinePage.js +2 -13
- package/cypress/pages/shortTextResponsePage.js +2 -3
- package/cypress/pages/textEntryMathPage.js +28 -0
- package/cypress/pages/textSelectionPage.js +242 -3
- package/cypress/pages/videoResponsePage.js +0 -2
- package/package.json +1 -1
- /package/cypress/e2e/ILC/TextSelection/{styleAndLayoutCustomizationAccordion.js → styleAndLayoutCustomizationAccordionFilledIn.js} +0 -0
@@ -79,7 +79,22 @@ const selectors = {
|
|
79
79
|
//set points popup
|
80
80
|
setPointsButton: () => cy.get('.list-ordering-set-correct-answer button'),
|
81
81
|
optionWrapperSetPointsPopup: () => cy.get('[class*="OptionContainerstyle__OptionsWrapper"]'),
|
82
|
-
pointsLabelSetPointsPopup: () => cy.get('.dialog-content [class*="PointsLabel-"]')
|
82
|
+
pointsLabelSetPointsPopup: () => cy.get('.dialog-content [class*="PointsLabel-"]'),
|
83
|
+
|
84
|
+
optionHorizontalSpecifyCorrectAnswerSection: () => cy.get('.list-ordering-set-correct-answer .horizontal-drag-item-wrapper'),
|
85
|
+
optionHorizontalPreviewTab: () => cy.get('[class*="question-preview-wrapper"] .horizontal-drag-item-wrapper'),
|
86
|
+
optionOrientationSectionLabel: () => cy.get('.single-select-toggle-group-title'),
|
87
|
+
singleSelectToggleButton: () => cy.get('.single-select-toggle-group'),
|
88
|
+
enableWrappingLabel: () => cy.get('.enable-wrapper'),
|
89
|
+
enableWrappingCheckbox: () => cy.get('.enable-wrapper .label-selected'),
|
90
|
+
horizontalOptionWrapperSpecifyCorrectAnswerSection: () => cy.get('[class*="ReorderSameListstyles__GridItemsWrapper"]'),
|
91
|
+
|
92
|
+
|
93
|
+
//Reorder as seperate List
|
94
|
+
dropzoneSeperateList: () => cy.get('[class*="MultipleDroppableHotspotstyle__DroppableHotspotWrapper"]'),
|
95
|
+
optionsSeperateList: () => cy.get('[class*="DraggableItemstyle__ItemWrapper"]'),
|
96
|
+
droppedOptionSeperateList: () => cy.get('[class*="MultipleDroppedItemstyles__FlexWrapper"]'),
|
97
|
+
correctAnswersWrapper: () => cy.get('.correct-answers-wrapper'),
|
83
98
|
}
|
84
99
|
|
85
100
|
const steps = {
|
@@ -891,6 +906,17 @@ const steps = {
|
|
891
906
|
expect($element[0].className.includes('icon-incorrect')).to.be.true;
|
892
907
|
});
|
893
908
|
},
|
909
|
+
/**
|
910
|
+
* @param {string} optionsText option to be checked for the correct icon
|
911
|
+
* @description This function verifies the correct icon in the preview tab for an option in horizontal option orientation for seperate list.
|
912
|
+
*/
|
913
|
+
verifyIncorrectOptionIconHorizontalOrientationSeperateList: (optionsText) => {
|
914
|
+
listOrderingPage.droppedOptionSeperateList()
|
915
|
+
.contains(optionsText)
|
916
|
+
.parents('[class*="MultipleDroppedItemstyles__FlexWrapper"]')
|
917
|
+
.find('.tick-icon-wrapper')
|
918
|
+
.should('have.class', 'icon-incorrect');
|
919
|
+
},
|
894
920
|
|
895
921
|
verifyCorrectOptionIconsCorrectAnswerSection: () => {
|
896
922
|
listOrderingPage.correctAnswerSectionIconWrapper()
|
@@ -991,7 +1017,352 @@ const steps = {
|
|
991
1017
|
*/
|
992
1018
|
verifyTextContentOfHorizontalOptionInPreviewTab: (optionsText, index) => {
|
993
1019
|
utilities.verifyTextContent(utilities.getNthElement(listOrderingPage.horizontalOptionPreviewTab(), index), optionsText);
|
994
|
-
}
|
1020
|
+
},
|
1021
|
+
|
1022
|
+
/** Verifies the orientation option on the list ordering page.
|
1023
|
+
* @param {'Vertical' | 'Horizontal'} orientationOption - The orientation option to verify.
|
1024
|
+
*/
|
1025
|
+
verifySelectedStateOfOptionOrientationToggle: (orientationOption) => {
|
1026
|
+
switch (orientationOption) {
|
1027
|
+
case 'Vertical':
|
1028
|
+
listOrderingPage.verticalButton()
|
1029
|
+
.should('have.class', 'single-select-toggle-button-selected');
|
1030
|
+
break;
|
1031
|
+
case 'Horizontal':
|
1032
|
+
listOrderingPage.horizontalButton()
|
1033
|
+
.should('have.class', 'single-select-toggle-button-selected');
|
1034
|
+
break;
|
1035
|
+
}
|
1036
|
+
},
|
1037
|
+
|
1038
|
+
verifyEnableWrappingCheckboxChecked: () => {
|
1039
|
+
listOrderingPage.enableWrappingCheckbox()
|
1040
|
+
.find('.icon-checkbox-selected')
|
1041
|
+
.should('exist');
|
1042
|
+
},
|
1043
|
+
|
1044
|
+
|
1045
|
+
verifyEnableWrappingCheckboxUnchecked: () => {
|
1046
|
+
listOrderingPage.enableWrappingCheckbox()
|
1047
|
+
.should('not.exist');
|
1048
|
+
},
|
1049
|
+
|
1050
|
+
/** Verifies the orientation option on the list ordering page in specify correct answer.
|
1051
|
+
* @param {'Vertical' | 'Horizontal'} orientationOption - The orientation option to verify.
|
1052
|
+
*/
|
1053
|
+
verifyOptionOrientation: (orientationOption) => {
|
1054
|
+
switch (orientationOption) {
|
1055
|
+
case 'Vertical':
|
1056
|
+
listOrderingPage.optionWrapperSpecifyCorrectAnswerSection()
|
1057
|
+
.should('have.css', 'flex-flow', 'column wrap');
|
1058
|
+
break;
|
1059
|
+
case 'Horizontal':
|
1060
|
+
listOrderingPage.horizontalOptionWrapperSpecifyCorrectAnswerSection()
|
1061
|
+
.should('have.css', 'display', 'flex');
|
1062
|
+
break;
|
1063
|
+
}
|
1064
|
+
},
|
1065
|
+
|
1066
|
+
/** Verifies the orientation option on the list ordering page in specify correct answer.
|
1067
|
+
* @param {'enabled' | 'disabled'} wrappingState - The orientation option to verify.
|
1068
|
+
*/
|
1069
|
+
verifyHorizontalWrapping: (wrappingState) => {
|
1070
|
+
switch (wrappingState) {
|
1071
|
+
case 'enabled':
|
1072
|
+
listOrderingPage.horizontalOptionWrapperSpecifyCorrectAnswerSection()
|
1073
|
+
.should('have.css', 'flex-wrap', 'wrap');
|
1074
|
+
break;
|
1075
|
+
case 'disabled':
|
1076
|
+
listOrderingPage.horizontalOptionWrapperSpecifyCorrectAnswerSection()
|
1077
|
+
.should('not.have.css', 'flex-wrap', 'wrap');
|
1078
|
+
break;
|
1079
|
+
}
|
1080
|
+
},
|
1081
|
+
|
1082
|
+
/** Verifies the orientation option on the list ordering page in preview tab.
|
1083
|
+
* @param {'Vertical' | 'Horizontal'} orientationOption - The orientation option to verify.
|
1084
|
+
*/
|
1085
|
+
verifyOptionOrientationInPreviewTab: (orientationOption) => {
|
1086
|
+
switch (orientationOption) {
|
1087
|
+
case 'Vertical':
|
1088
|
+
listOrderingPage.optionWrapperSpecifyCorrectAnswerSection()
|
1089
|
+
.should('have.css', 'flex-flow', 'column wrap');
|
1090
|
+
break;
|
1091
|
+
case 'Horizontal':
|
1092
|
+
listOrderingPage.horizontalOptionWrapperSpecifyCorrectAnswerSection()
|
1093
|
+
.should('have.css', 'display', 'flex');
|
1094
|
+
break;
|
1095
|
+
}
|
1096
|
+
},
|
1097
|
+
|
1098
|
+
/**
|
1099
|
+
* @param {string} optionsText text content of the option
|
1100
|
+
* @param {number} targetIndex the position at which the options is being dropped
|
1101
|
+
* @description click and drop a option into a position in the specify correct answer section
|
1102
|
+
*/
|
1103
|
+
clickAndReorderOptionInHorizontalSpecifyCorrectAnswerSection: (optionsText, targetIndex) => {
|
1104
|
+
listOrderingPage.optionHorizontalSpecifyCorrectAnswerSection()
|
1105
|
+
.contains(optionsText)
|
1106
|
+
.click();
|
1107
|
+
listOrderingPage.optionHorizontalSpecifyCorrectAnswerSection()
|
1108
|
+
.eq(targetIndex)
|
1109
|
+
.click();
|
1110
|
+
},
|
1111
|
+
|
1112
|
+
/**
|
1113
|
+
* @param {string} optionsText text content of the option
|
1114
|
+
* @param {number} targetIndex the position at which the options is being dropped
|
1115
|
+
* @description click and drop a option into a position in the specify correct answer section
|
1116
|
+
*/
|
1117
|
+
clickAndReorderOptionInHorizontalPreviewTab: (optionsText, targetIndex) => {
|
1118
|
+
listOrderingPage.optionHorizontalPreviewTab()
|
1119
|
+
.contains(optionsText)
|
1120
|
+
.click();
|
1121
|
+
listOrderingPage.optionHorizontalPreviewTab()
|
1122
|
+
.eq(targetIndex)
|
1123
|
+
.click();
|
1124
|
+
},
|
1125
|
+
|
1126
|
+
checkEnableWrappingCheckbox: () => {
|
1127
|
+
listOrderingPage.enableWrappingCheckbox()
|
1128
|
+
.click()
|
1129
|
+
.should('be.checked');
|
1130
|
+
},
|
1131
|
+
|
1132
|
+
uncheckEnableWrappingCheckbox: () => {
|
1133
|
+
listOrderingPage.enableWrappingCheckbox()
|
1134
|
+
.click()
|
1135
|
+
.should('not.be.checked');
|
1136
|
+
},
|
1137
|
+
|
1138
|
+
/**
|
1139
|
+
* @param {string} optionsText option to be checked for the correct icon
|
1140
|
+
* @description This function verifies the correct icon in the preview tab
|
1141
|
+
*/
|
1142
|
+
verifyIncorrectOptionIconSeperateList: (optionsText) => {
|
1143
|
+
listOrderingPage.dropzoneSeperateList()
|
1144
|
+
.contains(optionsText)
|
1145
|
+
.parents('[class*="MultipleDroppedItemstyles__FlexWrapper"]')
|
1146
|
+
.within(() => {
|
1147
|
+
utilities.verifyElementVisibilityState(autoScoredScoringPreviewTab.incorrectIcon(), 'exist');
|
1148
|
+
});
|
1149
|
+
},
|
1150
|
+
|
1151
|
+
/**
|
1152
|
+
* Verifies the order of options in the dropzone of order as seperate list.
|
1153
|
+
* @param {string[]} optionsTextArray - An array containing the text of options in the expected order.
|
1154
|
+
*/
|
1155
|
+
verifyOptionsInDropzoneOrderAsSeperateList: (optionsTextArray) => {
|
1156
|
+
optionsTextArray.forEach((option, index) => {
|
1157
|
+
utilities.verifyInnerText(utilities.getNthElement(listOrderingPage.dropzoneSeperateList().find('[class*="MultipleDroppedItemstyles__FlexWrapper"]'), index), option);
|
1158
|
+
});
|
1159
|
+
},
|
1160
|
+
|
1161
|
+
/**
|
1162
|
+
* @param {string} optionsText option to be checked for the correct icon
|
1163
|
+
* @description This function verifies the correct icon in the preview tab
|
1164
|
+
*/
|
1165
|
+
verifyCorrectOptionIconSeperateList: (optionsText) => {
|
1166
|
+
listOrderingPage.dropzoneSeperateList()
|
1167
|
+
.contains(optionsText)
|
1168
|
+
.parents('[class*="MultipleDroppedItemstyles__FlexWrapper"]')
|
1169
|
+
.within(() => {
|
1170
|
+
utilities.verifyElementVisibilityState(autoScoredScoringPreviewTab.correctIcon(), 'exist');
|
1171
|
+
});
|
1172
|
+
},
|
1173
|
+
|
1174
|
+
/**
|
1175
|
+
* @param {string[]} optionsTextArray options array for preview tab options
|
1176
|
+
* @description this function verifies options text content
|
1177
|
+
*/
|
1178
|
+
verifyTextContentOfOptionSeperateList: (optionsText, index) => {
|
1179
|
+
utilities.verifyInnerText(utilities.getNthElement(listOrderingPage.optionsSeperateList(), index), optionsText);
|
1180
|
+
},
|
1181
|
+
|
1182
|
+
/**
|
1183
|
+
* @param {string} optionsText text content of the option
|
1184
|
+
* @description click and drop a option into the dropzone in the specify correct answer section
|
1185
|
+
*/
|
1186
|
+
clickAndDropOptionSeperateList: (optionsText) => {
|
1187
|
+
listOrderingPage.optionsSeperateList()
|
1188
|
+
.contains(optionsText)
|
1189
|
+
.click();
|
1190
|
+
listOrderingPage.dropzoneSeperateList()
|
1191
|
+
.click();
|
1192
|
+
},
|
1193
|
+
|
1194
|
+
/**
|
1195
|
+
* Verifies the order of Horizontal options in the "Specify Correct Answer" section.
|
1196
|
+
* @param {string[]} optionsTextArray - An array containing the text of options in the expected order.
|
1197
|
+
*/
|
1198
|
+
verifyHorizontalOptionsOrderInSpecifyCorrectAnswerSection: (optionsTextArray) => {
|
1199
|
+
optionsTextArray.forEach((option, index) => {
|
1200
|
+
utilities.verifyInnerText(utilities.getNthElement(listOrderingPage.optionHorizontalSpecifyCorrectAnswerSection().find('[class*="DragItemstyles__DragItemWrapper"]'), index), option);
|
1201
|
+
});
|
1202
|
+
},
|
1203
|
+
|
1204
|
+
/**
|
1205
|
+
* Verifies the order of horizontal options in the preview tab
|
1206
|
+
* @param {string[]} optionsTextArray - An array containing the text of options in the expected order.
|
1207
|
+
*/
|
1208
|
+
verifyHorizontalOptionsOrderInPreviewTab: (optionsTextArray) => {
|
1209
|
+
optionsTextArray.forEach((option, index) => {
|
1210
|
+
utilities.verifyInnerText(utilities.getNthElement(listOrderingPage.optionHorizontalPreviewTab(), index), option);
|
1211
|
+
});
|
1212
|
+
},
|
1213
|
+
|
1214
|
+
/**
|
1215
|
+
* @description Verifies that the equation text in the Preview tab is correct.
|
1216
|
+
* @param {number} optionIndex - The index of the option in the Preview tab.
|
1217
|
+
*/
|
1218
|
+
verifyOptionWithEquationTextInDropzonePreviewTabSeperateList: (optionIndex) => {
|
1219
|
+
listOrderingPage.droppedOptionSeperateList()
|
1220
|
+
.eq(optionIndex)
|
1221
|
+
.find('[role="math"]')
|
1222
|
+
.should('have.attr', 'aria-label', constants.CKEditorInputFieldEnteredEquationAriaLabel)
|
1223
|
+
.contains(constants.CKEditorInputFieldEnteredEquationText);
|
1224
|
+
},
|
1225
|
+
|
1226
|
+
/**
|
1227
|
+
* @description Verifies that the equation text in the correct answer section is correct.
|
1228
|
+
* @param {number} optionIndex - The index of the option in the Preview tab.
|
1229
|
+
*/
|
1230
|
+
verifyOptionWithEquationTextInDropzoneCorrectAnswerSectionSeperateList: (optionIndex) => {
|
1231
|
+
listOrderingPage.correctAnswerSectionIconWrapper()
|
1232
|
+
.eq(optionIndex)
|
1233
|
+
.find('[role="math"]')
|
1234
|
+
.should('have.attr', 'aria-label', constants.CKEditorInputFieldEnteredEquationAriaLabel)
|
1235
|
+
.contains(constants.CKEditorInputFieldEnteredEquationText);
|
1236
|
+
},
|
1237
|
+
|
1238
|
+
/**
|
1239
|
+
* @description Verifies that the equation text in the Preview tab is correct.
|
1240
|
+
* @param {number} optionIndex - The index of the option in the Preview tab.
|
1241
|
+
*/
|
1242
|
+
verifyOptionWithEquationTextInOptionsContainerPreviewTabSeperateList: (optionIndex) => {
|
1243
|
+
listOrderingPage.optionsSeperateList()
|
1244
|
+
.eq(optionIndex)
|
1245
|
+
.find('[role="math"]')
|
1246
|
+
.should('have.attr', 'aria-label', constants.CKEditorInputFieldEnteredEquationAriaLabel)
|
1247
|
+
.contains(constants.CKEditorInputFieldEnteredEquationText);
|
1248
|
+
},
|
1249
|
+
|
1250
|
+
/**
|
1251
|
+
* @param {string[]} optionsTextArray options array for preview tab options
|
1252
|
+
* @description this function verifies options text content
|
1253
|
+
*/
|
1254
|
+
verifyTextContentOfOptionInDropzonePreviewTabSeperateList: (optionsText, index) => {
|
1255
|
+
utilities.verifyTextContent(utilities.getNthElement(listOrderingPage.droppedOptionSeperateList(), index), optionsText);
|
1256
|
+
},
|
1257
|
+
/**
|
1258
|
+
* @param {string[]} optionsTextArray options array for preview tab options
|
1259
|
+
* @description this function verifies options text content
|
1260
|
+
*/
|
1261
|
+
verifyTextContentOfOptionInPreviewTabSeperateList: (optionsText, index) => {
|
1262
|
+
utilities.verifyTextContent(utilities.getNthElement(listOrderingPage.optionsSeperateList(), index), optionsText);
|
1263
|
+
},
|
1264
|
+
|
1265
|
+
/**
|
1266
|
+
* @param {string[]} optionsTextArray options array for correct answer section options
|
1267
|
+
* @description this function verifies options text content
|
1268
|
+
*/
|
1269
|
+
verifyTextContentOfOptionInDropzoneCorrectAnswerSectionSeperateList: (optionsText, index) => {
|
1270
|
+
utilities.verifyTextContent(utilities.getNthElement(listOrderingPage.correctAnswerSectionIconWrapper(), index), optionsText);
|
1271
|
+
},
|
1272
|
+
|
1273
|
+
/**
|
1274
|
+
* @description Verifies that the bold text in the Preview tab is correct for seperate list.
|
1275
|
+
* @param {number} optionIndex - The index of the option in the Preview tab.
|
1276
|
+
*/
|
1277
|
+
verifyOptionWithBoldTextInDropzonePreviewTabSeperateList: (optionIndex) => {
|
1278
|
+
listOrderingPage.droppedOptionSeperateList()
|
1279
|
+
.eq(optionIndex)
|
1280
|
+
.find('strong')
|
1281
|
+
.should('have.text', 'This is a bold option');
|
1282
|
+
},
|
1283
|
+
|
1284
|
+
/**
|
1285
|
+
* @description Verifies that the bold text in the correct answer section is correct for seperate list.
|
1286
|
+
* @param {number} optionIndex - The index of the option in the Preview tab.
|
1287
|
+
*/
|
1288
|
+
verifyOptionWithBoldTextInDropzoneCorrectAnswerSectionSeperateList: (optionIndex) => {
|
1289
|
+
listOrderingPage.correctAnswerSectionIconWrapper()
|
1290
|
+
.eq(optionIndex)
|
1291
|
+
.find('strong')
|
1292
|
+
.should('have.text', 'This is a bold option');
|
1293
|
+
},
|
1294
|
+
|
1295
|
+
/**
|
1296
|
+
* @description Verifies that the bold text in the Preview tab is correct for seperate list.
|
1297
|
+
* @param {number} optionIndex - The index of the option in the Preview tab.
|
1298
|
+
*/
|
1299
|
+
verifyOptionWithBoldTextInOptionsContainerPreviewTabSeperateList: (optionIndex) => {
|
1300
|
+
listOrderingPage.optionsSeperateList()
|
1301
|
+
.eq(optionIndex)
|
1302
|
+
.find('strong')
|
1303
|
+
.should('have.text', 'This is a bold option');
|
1304
|
+
},
|
1305
|
+
|
1306
|
+
/**
|
1307
|
+
* @description Verifies that the image in the Preview tab has the correct source and alt text.
|
1308
|
+
* @param {number} optionIndex - The index of the option in the Preview tab.
|
1309
|
+
*/
|
1310
|
+
verifyOptionWithImageInDropzonePreviewTabSeperateList: (optionIndex) => {
|
1311
|
+
listOrderingPage.droppedOptionSeperateList()
|
1312
|
+
.eq(optionIndex)
|
1313
|
+
.find('img')
|
1314
|
+
.should('have.attr', 'src', constants.foxImageLink)
|
1315
|
+
.and('have.attr', 'alt', constants.foxImageAltText);
|
1316
|
+
},
|
1317
|
+
|
1318
|
+
/**
|
1319
|
+
* @description Verifies that the image in the correct answer section has the correct source and alt text.
|
1320
|
+
* @param {number} optionIndex - The index of the option in the Preview tab.
|
1321
|
+
*/
|
1322
|
+
verifyOptionWithImageInDropzoneCorrectAnswerSectionTabSeperateList: (optionIndex) => {
|
1323
|
+
listOrderingPage.correctAnswerSectionIconWrapper()
|
1324
|
+
.eq(optionIndex)
|
1325
|
+
.find('img')
|
1326
|
+
.should('have.attr', 'src', constants.foxImageLink)
|
1327
|
+
.and('have.attr', 'alt', constants.foxImageAltText);
|
1328
|
+
},
|
1329
|
+
|
1330
|
+
/**
|
1331
|
+
* @description Verifies that the image in the Preview tab has the correct source and alt text.
|
1332
|
+
* @param {number} optionIndex - The index of the option in the Preview tab.
|
1333
|
+
*/
|
1334
|
+
verifyOptionWithImageInOptionsContainerPreviewTabSeperateList: (optionIndex) => {
|
1335
|
+
listOrderingPage.optionsSeperateList()
|
1336
|
+
.eq(optionIndex)
|
1337
|
+
.find('img')
|
1338
|
+
.should('have.attr', 'src', constants.foxImageLink)
|
1339
|
+
.and('have.attr', 'alt', constants.foxImageAltText);
|
1340
|
+
},
|
1341
|
+
|
1342
|
+
/**
|
1343
|
+
* @param {string} optionsText option to be checked for the correct icon
|
1344
|
+
* @description This function verifies the correct icon in the preview tab for an option in horizontal option orientation
|
1345
|
+
*/
|
1346
|
+
verifyCorrectOptionIconOrientationSeperateList: (optionsText) => {
|
1347
|
+
listOrderingPage.droppedOptionSeperateList()
|
1348
|
+
.contains(optionsText)
|
1349
|
+
.parents('[class*="MultipleDroppedItemstyles__FlexWrapper"]')
|
1350
|
+
.find('.tick-icon-wrapper')
|
1351
|
+
.should('have.class', 'icon-correct');
|
1352
|
+
},
|
1353
|
+
|
1354
|
+
/**
|
1355
|
+
* @param {string} optionsText text content of the option
|
1356
|
+
* @param {number} targetIndex the position at which the options is being dropped
|
1357
|
+
* @description verifies option cant be selected in grading view
|
1358
|
+
*/
|
1359
|
+
verifyOptionNotEditableInGradingViewSeperateList: (optionsTextArray) => {
|
1360
|
+
optionsTextArray.forEach(optionsText => {
|
1361
|
+
listOrderingPage.droppedOptionSeperateList()
|
1362
|
+
.contains(optionsText)
|
1363
|
+
.should('have.css', 'pointer-events', 'none');
|
1364
|
+
});
|
1365
|
+
},
|
995
1366
|
}
|
996
1367
|
|
997
1368
|
const tests = {
|
@@ -27,8 +27,9 @@ const selectors = {
|
|
27
27
|
//Edit tab
|
28
28
|
promptInputField: () => cy.get('.edit-mcq-stems-wrapper [role="textbox"]'),
|
29
29
|
promptInputFieldWrapper: () => cy.get('.edit-mcq-stems-wrapper .edit-mcq-option-wrapper'),
|
30
|
-
optionInputField: () => cy.get('.edit-mcq-options-wrapper [data-rbd-draggable-id*="option-draggable"] [role="textbox"]'),
|
30
|
+
optionInputField: () => cy.get('.edit-mcq-options-wrapper [data-rbd-draggable-id*="option-draggable"] [role="textbox"], .edit-mcq-options-wrapper [data-rbd-draggable-id*="option-draggable"] [type="text"]'),
|
31
31
|
optionsLabel: () => cy.get('.cloze-with-drag-and-drop-options-label'),
|
32
|
+
matchingLayoutLabel: () => cy.get('.match-layout-container .options-label'),
|
32
33
|
optionWrapper: () => cy.get('.response-options-wrapper [data-rbd-draggable-id*="option-draggable"]'),
|
33
34
|
promptNumeration: () => cy.get('[class*="SingleOptionstyle__AdornmentDiv"]'),
|
34
35
|
promptLabel: () => cy.get('.match-list-stem-label'),
|
@@ -49,18 +50,26 @@ const selectors = {
|
|
49
50
|
}
|
50
51
|
},
|
51
52
|
optionInputFieldDropdown: () => cy.get('.edit-mcq-options-wrapper [data-rbd-draggable-id*="option-draggable"] [type="text"]'),
|
53
|
+
connectorButton: () => cy.get('button[aria-label*="Matching layout Connectors"]'),
|
54
|
+
noConnectorButton: () => cy.get('button[aria-label*="Matching layout No connectors"]'),
|
55
|
+
connectorLabel: () => cy.get('button[aria-label*="Matching layout Connectors"] .ngie-toggle-button-label'),
|
56
|
+
noConnectorLabel: () => cy.get('button[aria-label*="Matching layout No connectors"] .ngie-toggle-button-label'),
|
57
|
+
optionInnnerFieldInputFieldDropdown: () => cy.get(' .edit-mcq-options-wrapper [data-rbd-draggable-id*="option-draggable"] .MuiOutlinedInput-inputAdornedStart'),
|
52
58
|
//Specify correct answer section
|
59
|
+
connectorIcon: () => cy.get('.correct-answer-accordion [class*="ClozeWithDragAndDropstyles__ShowIconWrapper"]'),
|
53
60
|
dropzoneSpecifyCorrectAnswerSection: () => cy.get('.correct-answer-wrapper .authoring-droppable-hotspot-wrapper'),
|
54
61
|
dropzoneWrapperSpecifyCorrectAnswerSection: () => cy.get('.match-list-form-control-wrapper-preview .authoring-droppable-hotspot-wrapper'),
|
55
62
|
optionContainerOptionsSpecifyCorrectAnswerSection: () => cy.get('.draggable-selected-item'),
|
56
63
|
addPromptButton: () => cy.get('.add-option-wrapper-cls button').contains('Add prompt'),
|
57
64
|
deletePromptButton: () => cy.get('[aria-label*="Delete prompt "]'),
|
58
|
-
optionNumeration: () => cy.get('.response-options-wrapper [class*="SingleOptionstyle__AdornmentDiv"]'),
|
65
|
+
optionNumeration: () => cy.get('.response-options-wrapper [class*="SingleOptionstyle__AdornmentDiv"],[class*="OptionSelectionComponentstyle__OptionsWrapper"] [class*="MuiInputAdornment-positionStart"]'),
|
59
66
|
promptSpecifyCorrectAnswerSection: () => cy.get('.correct-answer-wrapper .stem-container [data-testid="question-instruction-element"]'),
|
60
67
|
draggableOptionInDropzoneInSpecifyCorrectAnswer: () => cy.get('.item-content-wrapper'),
|
61
68
|
droppedDraggableOptionInDropzoneSpecifyCorrectAnswerSection: () => cy.get('[class*="MultipleDroppedItemstyles__ItemWrapper"]'),
|
62
69
|
optionsContainerSpecifyCorrectAnswerSection: () => cy.get('.draggable-wrapper'),
|
63
70
|
dropdownSpecifyCorrectAnswerSection: () => cy.get('.correct-answer-wrapper [aria-haspopup="listbox"]'),
|
71
|
+
dropdownSpecifyCorrectAnswerSectionOption: () => cy.get('.correct-answer-wrapper .dropdown-form-control'),
|
72
|
+
dropdownPreviewTabOption: () => cy.get('[class*="ResponseDropdownComponentstyles__ResponseDropdownWrapper"] .dropdown-form-control'),
|
64
73
|
dropdownPreviewTab: () => cy.get('[class*="ResponseDropdownComponentstyles__ResponseDropdownWrapper"] [aria-haspopup="listbox"]'),
|
65
74
|
dropdownGradingView: () => cy.get('.dropdown-form-control'),
|
66
75
|
dropdownList: () => cy.get('.dropdown-list-ul'),
|
@@ -104,7 +113,8 @@ const selectors = {
|
|
104
113
|
droppedDraggableOptionInDropzonePreviewTab: () => cy.get('[class*="MultipleDroppedItemstyles__ItemWrapper"]'),
|
105
114
|
warningMessage: () => cy.get('[class*="DropzoneLimitErrorMessagestyles__ErrorWrapper"] [class*="DropzoneLimitErrorMessagestyles__ErrorMessage"]'),
|
106
115
|
warningMessageContainer: () => cy.get('[class*="DropzoneLimitErrorMessagestyles__ErrorWrapper"]'),
|
107
|
-
dropzoneColumnAndPromptHeaderWrapperPreviewTab: () => cy.get('.edit-question-preview-wrapper [class*="ClozeWithDragAndDropstyles__ResponseHeaderWrapper"]')
|
116
|
+
dropzoneColumnAndPromptHeaderWrapperPreviewTab: () => cy.get('.edit-question-preview-wrapper [class*="ClozeWithDragAndDropstyles__ResponseHeaderWrapper"]'),
|
117
|
+
connectorIconPreviewTab: () => cy.get('.edit-question-preview-wrapper [class*="ClozeWithDragAndDropstyles__ShowIconWrapper"]'),
|
108
118
|
}
|
109
119
|
|
110
120
|
const steps = {
|
@@ -276,7 +286,11 @@ const steps = {
|
|
276
286
|
matchingPage.optionInputField()
|
277
287
|
.eq(index)
|
278
288
|
.clear()
|
289
|
+
matchingPage.optionInputField()
|
290
|
+
.eq(index)
|
279
291
|
.type(options, { delay: 50 })
|
292
|
+
matchingPage.optionInputField()
|
293
|
+
.eq(index)
|
280
294
|
.blur();
|
281
295
|
});
|
282
296
|
},
|
@@ -351,21 +365,6 @@ const steps = {
|
|
351
365
|
.should('have.text', 'This is a bold option');
|
352
366
|
},
|
353
367
|
|
354
|
-
/**
|
355
|
-
* @param {number} index of the option
|
356
|
-
* @description verify the enter option input field, drag handle, delete button and option numeration
|
357
|
-
*/
|
358
|
-
verifyOptionsContents: (index) => {
|
359
|
-
matchingPage.optionInputField()
|
360
|
-
.eq(index)
|
361
|
-
.should('have.attr', 'data-cke-editorplaceholder', 'Enter option');
|
362
|
-
utilities.verifyElementVisibilityState(commonComponents.dragHandleButton(), 'exist');
|
363
|
-
utilities.verifyElementVisibilityState(commonComponents.deleteButton(), 'visible');
|
364
|
-
matchingPage.optionNumeration()
|
365
|
-
.eq(index)
|
366
|
-
.should('have.text', index + 1);
|
367
|
-
},
|
368
|
-
|
369
368
|
verifyDeleteOptionButtonDisabledState: () => {
|
370
369
|
matchingPage.optionWrapper()
|
371
370
|
.eq(0)
|
@@ -431,15 +430,22 @@ const steps = {
|
|
431
430
|
* @param {number} index of the option
|
432
431
|
* @description verify the enter option input field, drag handle, delete button and option numeration
|
433
432
|
*/
|
434
|
-
verifyOptionsContents: (index) => {
|
435
|
-
|
436
|
-
.
|
437
|
-
|
433
|
+
verifyOptionsContents: (index, questionType = null) => {
|
434
|
+
if (questionType === 'dropdown') {
|
435
|
+
matchingPage.optionInputField()
|
436
|
+
.eq(index)
|
437
|
+
.should('have.attr', 'placeholder', 'Enter option');
|
438
|
+
} else {
|
439
|
+
matchingPage.optionInputField()
|
440
|
+
.eq(index)
|
441
|
+
.should('have.attr', 'data-cke-editorplaceholder', 'Enter option');
|
442
|
+
}
|
443
|
+
|
438
444
|
utilities.verifyElementVisibilityState(commonComponents.dragHandleButton(), 'exist');
|
439
445
|
utilities.verifyElementVisibilityState(commonComponents.deleteButton(), 'visible');
|
440
446
|
matchingPage.optionNumeration()
|
441
447
|
.eq(index)
|
442
|
-
.should('have.text', index + 1);
|
448
|
+
.should('have.text', `${index + 1}`);
|
443
449
|
},
|
444
450
|
|
445
451
|
verifyDeleteOptionButtonDisabledState: () => {
|
@@ -1446,6 +1452,27 @@ const steps = {
|
|
1446
1452
|
});
|
1447
1453
|
},
|
1448
1454
|
|
1455
|
+
/**
|
1456
|
+
* Selects the matching layout on the matching page.
|
1457
|
+
* @param {'Connectors' | 'noConnectors'} matchingLayoutButton - The matching layout button to select.
|
1458
|
+
*/
|
1459
|
+
selectMatchingLayout: (matchingLayoutButton) => {
|
1460
|
+
switch (matchingLayoutButton) {
|
1461
|
+
case 'Connectors':
|
1462
|
+
matchingPage.connectorButton()
|
1463
|
+
.click()
|
1464
|
+
.should('have.attr', 'aria-pressed', 'true');
|
1465
|
+
break;
|
1466
|
+
case 'noConnectors':
|
1467
|
+
matchingPage.noConnectorButton()
|
1468
|
+
.click()
|
1469
|
+
.should('have.attr', 'aria-pressed', 'true');
|
1470
|
+
break;
|
1471
|
+
default:
|
1472
|
+
throw new Error('Invalid option');
|
1473
|
+
}
|
1474
|
+
},
|
1475
|
+
|
1449
1476
|
/**
|
1450
1477
|
* @description Verifies if the specified text is displayed in the dropdown specify correct answer section.
|
1451
1478
|
* @param {number} dropdownIndex - The index of the dropdown.
|
@@ -1552,6 +1579,18 @@ const steps = {
|
|
1552
1579
|
});
|
1553
1580
|
},
|
1554
1581
|
|
1582
|
+
/**
|
1583
|
+
* Verify that a specific dropdown is disabled in the specify correct answer setion.
|
1584
|
+
* @param {number} index - The index of the disabled dropdown.
|
1585
|
+
*/
|
1586
|
+
enterNewTextInOptionInputFieldDropdown: (index, options) => {
|
1587
|
+
matchingPage.optionInputFieldDropdown()
|
1588
|
+
.eq(index)
|
1589
|
+
.clear()
|
1590
|
+
.type(options, { delay: 50 })
|
1591
|
+
.blur();
|
1592
|
+
},
|
1593
|
+
|
1555
1594
|
verifyWarningIconOnRequiredFields: (requiredFieldsArray) => {
|
1556
1595
|
requiredFieldsArray.forEach((field) => {
|
1557
1596
|
if (field === 'Please set points') {
|
@@ -1571,6 +1610,25 @@ const steps = {
|
|
1571
1610
|
});
|
1572
1611
|
}
|
1573
1612
|
})
|
1613
|
+
},
|
1614
|
+
|
1615
|
+
/**
|
1616
|
+
* Verifies the matching layout option on the matching page..
|
1617
|
+
* @param {'Connectors' | 'noConnectors'} selectedOption - The matching layout Option to verify.
|
1618
|
+
*/
|
1619
|
+
verifyMatchingLayoutSelected: (selectedOption) => {
|
1620
|
+
switch (selectedOption) {
|
1621
|
+
case 'Connectors':
|
1622
|
+
matchingPage.connectorButton()
|
1623
|
+
.should('have.attr', 'aria-pressed', 'true');
|
1624
|
+
break;
|
1625
|
+
case 'NoConnectors':
|
1626
|
+
matchingPage.noConnectorButton()
|
1627
|
+
.should('have.attr', 'aria-pressed', 'true');
|
1628
|
+
break;
|
1629
|
+
default:
|
1630
|
+
throw new Error('Invalid option');
|
1631
|
+
}
|
1574
1632
|
}
|
1575
1633
|
}
|
1576
1634
|
|
@@ -1617,14 +1675,14 @@ const tests = {
|
|
1617
1675
|
* Verifies the contents and styling of the 'Options' section.
|
1618
1676
|
* @param {number} optionFieldsCount - The expected number of option input fields.
|
1619
1677
|
*/
|
1620
|
-
verifyOptionsSectionContents: ({ optionFieldsCount, optionLabel }) => {
|
1678
|
+
verifyOptionsSectionContents: ({ optionFieldsCount, optionLabel, questionType = null }) => {
|
1621
1679
|
it(`\'${optionLabel}\' label should be displayed`, () => {
|
1622
1680
|
utilities.verifyInnerText(matchingPage.optionsLabel(), optionLabel);
|
1623
1681
|
});
|
1624
1682
|
|
1625
1683
|
it(`By default ${optionFieldsCount} option input fields with placeholder text, drag handle and delete option icon buttons should be displayed`, () => {
|
1626
1684
|
for (let index = 0; index < optionFieldsCount; index++) {
|
1627
|
-
steps.verifyOptionsContents(index);
|
1685
|
+
steps.verifyOptionsContents(index, questionType);
|
1628
1686
|
};
|
1629
1687
|
});
|
1630
1688
|
|
@@ -1658,14 +1716,14 @@ const tests = {
|
|
1658
1716
|
},
|
1659
1717
|
|
1660
1718
|
//Need to remove when https://redmine.zeuslearning.com/issues/566720 is resolved
|
1661
|
-
verifyAddOptionFunctionality: () => {
|
1719
|
+
verifyAddOptionFunctionality: (questionType = null) => {
|
1662
1720
|
it('When user adds an option using \'Add Option\' button then the added option input field should be displayed and option numeration should increment', () => {
|
1663
1721
|
let initialOptionCount;
|
1664
1722
|
matchingPage.steps.getOptionCount().then((count) => {
|
1665
1723
|
initialOptionCount = count;
|
1666
1724
|
optionsWrapperComponent.steps.addOption();
|
1667
1725
|
matchingPage.steps.getOptionCount().should('eq', initialOptionCount + 1);
|
1668
|
-
matchingPage.steps.verifyOptionsContents(initialOptionCount);
|
1726
|
+
matchingPage.steps.verifyOptionsContents(initialOptionCount, questionType);
|
1669
1727
|
});
|
1670
1728
|
});
|
1671
1729
|
},
|
@@ -1983,24 +2041,22 @@ const tests = {
|
|
1983
2041
|
matchingPage.steps.clickAndDropOptionInDropzoneSpecifyCorrectAnswerSection([{ optionText: 'Petals', dropzoneIndex: 0 }]);
|
1984
2042
|
});
|
1985
2043
|
|
1986
|
-
it(`When the user has removed all the options from the dropzone in the ${accordionName} accordion,
|
2044
|
+
it(`When the user has removed all the options from the dropzone in the ${accordionName} accordion, should not be thrown any error in \'${accordionName}\' accordion`, () => {
|
1987
2045
|
matchingPage.steps.clickAndDropOptionInOptionsContainerInSpecifyCorrectAnswerSection('Petals');
|
1988
|
-
|
1989
|
-
utilities.verifyInnerText(commonComponents.errorMessage(), 'Error: Please set a correct answer.');
|
2046
|
+
commonComponents.steps.verifyErrorMessageIsNotDisplayed();
|
1990
2047
|
if (accordionName == 'Correct') {
|
1991
2048
|
autoScoredSpecifyCorrectAnswerSection.correctAnswerAccordion()
|
1992
2049
|
.within(() => {
|
1993
|
-
utilities.verifyElementVisibilityState(autoScoredSpecifyCorrectAnswerSection.specifyCorrectAnswerErrorIcon(), '
|
2050
|
+
utilities.verifyElementVisibilityState(autoScoredSpecifyCorrectAnswerSection.specifyCorrectAnswerErrorIcon(), 'notExist');
|
1994
2051
|
});
|
1995
2052
|
} else {
|
1996
2053
|
autoScoredSpecifyCorrectAnswerSection.alternativeAnswerAccordion()
|
1997
2054
|
.within(() => {
|
1998
|
-
utilities.verifyElementVisibilityState(autoScoredSpecifyCorrectAnswerSection.specifyCorrectAnswerErrorIcon(), '
|
2055
|
+
utilities.verifyElementVisibilityState(autoScoredSpecifyCorrectAnswerSection.specifyCorrectAnswerErrorIcon(), 'notExist');
|
1999
2056
|
});
|
2000
2057
|
};
|
2001
2058
|
});
|
2002
2059
|
|
2003
|
-
autoScoredSpecifyCorrectAnswerSection.tests.verifyAutoScoredCorrectAnswerErrorMessageCSSAndA11y();
|
2004
2060
|
|
2005
2061
|
it('CSS of the dropzone border', { tags: 'css' }, () => {
|
2006
2062
|
utilities.verifyCSS(matchingPage.dropzoneSpecifyCorrectAnswerSection().eq(0), {
|