itemengine-cypress-automation 1.0.11 → 1.0.13
Sign up to get free protection for your applications and to get access to all the features.
- package/cypress/e2e/ILC/ShortTextResponse/shortTextResponseEditTabBasicSections.js +2 -2
- package/cypress/e2e/ILC/ShortTextResponse/shortTextResponseManuallyScoredNonScoredScoringSection.js +1 -0
- package/cypress/pages/audioPlayerPage.js +2 -2
- package/cypress/pages/audioResponsePage.js +3 -3
- package/cypress/pages/components/additionalSettingsPanel.js +1 -1
- package/cypress/pages/components/autoScoredPreviewBase.js +1 -1
- package/cypress/pages/components/autoScoredSetCorrectAnswerSection.js +7 -1
- package/cypress/pages/components/browseItemsPage.js +53 -0
- package/cypress/pages/components/createQuestionBasePage.js +32 -2
- package/cypress/pages/components/customizeHighlightPropertiesComponent.js +1 -1
- package/cypress/pages/components/dragAndDropResponseOptions.js +3 -2
- package/cypress/pages/components/draggableOptionsContainer.js +1 -0
- package/cypress/pages/components/figOverImageCommonComponent.js +198 -10
- package/cypress/pages/components/fillInTheGapsCommonComponents.js +4 -4
- package/cypress/pages/components/fillInTheGapsDropdownCommonComponent.js +54 -1
- package/cypress/pages/components/fillInTheGapsTextCommonComponent.js +3 -3
- package/cypress/pages/components/gridCommonComponents.js +3 -2
- package/cypress/pages/components/index.js +2 -1
- package/cypress/pages/components/listSortingAndOrderingBase.js +1 -1
- package/cypress/pages/components/questionInstructionsComponent.js +7 -3
- package/cypress/pages/components/uploadImageSectionComponent.js +2 -0
- package/cypress/pages/createItemPage.js +35 -2
- package/cypress/pages/dialogBoxBase.js +2 -2
- package/cypress/pages/dragAndDropIntoCategoriesAllOrNothingScoring.js +4 -4
- package/cypress/pages/dragAndDropIntoCategoriesCellsScoring.js +2 -0
- package/cypress/pages/dragAndDropIntoCategoriesPage.js +7 -10
- package/cypress/pages/essayResponseBasicPage.js +2 -2
- package/cypress/pages/essayResponseMathPage.js +3 -2
- package/cypress/pages/essayResponsePage.js +1 -1
- package/cypress/pages/fillInTheGapsOverImageDropdownPage.js +74 -7
- package/cypress/pages/fillInTheGapsTextPage.js +1 -1
- package/cypress/pages/highlightImagePage.js +12 -10
- package/cypress/pages/highlightPage.js +29 -5
- package/cypress/pages/listMatchingPage.js +205 -17
- package/cypress/pages/listMatchingScoring.js +0 -1
- package/cypress/pages/passagePage.js +3 -3
- package/cypress/pages/readingRulerPage.js +1 -1
- package/cypress/pages/shortTextResponsePage.js +1 -1
- package/cypress/pages/videoResponsePage.js +7 -7
- package/cypress/support/commands.js +4 -4
- package/cypress/support/e2e.js +0 -1
- package/cypress/support/helpers/accessibility.js +2 -2
- package/cypress.config.js +0 -2
- package/package.json +2 -3
- package/scripts/sorry-cypress.mjs +2 -1
@@ -50,12 +50,13 @@ const selectors = {
|
|
50
50
|
setCorrectAnswerSpans: () => cy.get('[class*="Highlightstyles__Wrapper"] span'),
|
51
51
|
setCorrectAnswerOption: () => cy.get('[class*="Highlightstyles__Wrapper"] .highlighted'),
|
52
52
|
setPointsButton: () => cy.get('[class*="Highlightstyles__SetPointsPopupWrapper"] button'),
|
53
|
-
setPointsPopupSaveButton: () => cy.get('.
|
54
|
-
setPointsPopupCancelButton: () => cy.get('.
|
53
|
+
setPointsPopupSaveButton: () => cy.get('.popup-button-wrapper button').eq(1),
|
54
|
+
setPointsPopupCancelButton: () => cy.get('.popup-button-wrapper button').eq(0),
|
55
55
|
setPointsPopupOptions: () => cy.get('[class*="SetPointsPopupstyle__MappedAnswer"]'),
|
56
56
|
setPointsPopupPointsLabel: () => cy.get('[class*="SetPointsPopupstyle__PointLabel"]'),
|
57
57
|
//Check this after https://redmine.zeuslearning.com/issues/542344 is fixed
|
58
|
-
|
58
|
+
pointsPerResponseLabel: () => cy.get('[class*="Highlightstyles__PartialPointsPerResponseLabel"]'),
|
59
|
+
pointsPerResponseScore: () => cy.get('[class*="Highlightstyles__PartialPointsPerResponseValue"]'),
|
59
60
|
//preview tab
|
60
61
|
previewTabQuestionContainer: () => cy.get('.highlight-preview-wrapper'),
|
61
62
|
previewTabParagraphs: () => cy.get('.highlight-preview-wrapper p'),
|
@@ -64,6 +65,7 @@ const selectors = {
|
|
64
65
|
//additional settings
|
65
66
|
maximumNumberOfAnswersLabel: () => cy.get('.maximum-answers'),
|
66
67
|
maximumAnswersInputField: () => cy.get('[class*="StudentResponseComponentstyle__OptionWrapper"] input'),
|
68
|
+
setCorrectAnswerErrorMessage: () => cy.get('[class*="ErrorMessageContainer"]')
|
67
69
|
}
|
68
70
|
|
69
71
|
const steps = {
|
@@ -232,6 +234,12 @@ const steps = {
|
|
232
234
|
.click();
|
233
235
|
},
|
234
236
|
|
237
|
+
verifySetCorrectAnswerSectionErrorMessage: () => {
|
238
|
+
highlightPage.setCorrectAnswerErrorMessage()
|
239
|
+
.eq(1)
|
240
|
+
.verifyInnerText('Error: Please set a correct answer.');
|
241
|
+
},
|
242
|
+
|
235
243
|
verifyResetPopupForClearingOptionSelection: () => {
|
236
244
|
utilities.verifyElementVisibilityState(highlightPage.dialogBox(), 'visible');
|
237
245
|
utilities.verifyInnerText(highlightPage.dialogBoxTitle(), 'Reset');
|
@@ -622,7 +630,7 @@ const steps = {
|
|
622
630
|
* @description Verify the points per response score
|
623
631
|
*/
|
624
632
|
verifyPartialEqualWeightsPointsPerResponseScore: (points) => {
|
625
|
-
utilities.verifyInnerText(highlightPage.
|
633
|
+
utilities.verifyInnerText(highlightPage.pointsPerResponseScore(), `${points}`);
|
626
634
|
},
|
627
635
|
|
628
636
|
clickOnClearHighlightButtonInHighlightOptionsSection: () => {
|
@@ -630,7 +638,7 @@ const steps = {
|
|
630
638
|
.click();
|
631
639
|
},
|
632
640
|
|
633
|
-
verifyDefaultSetPointsButtonLabelAndDisabledState: () => {
|
641
|
+
verifyDefaultSetPointsButtonLabelAndDisabledState: () => {
|
634
642
|
utilities.verifyInnerText(highlightPage.setPointsButton(), 'Set points');
|
635
643
|
utilities.verifyElementVisibilityState(highlightPage.setPointsButton(), 'visible');
|
636
644
|
utilities.verifyElementVisibilityState(highlightPage.setPointsButton().find('svg'), 'exist');
|
@@ -810,6 +818,21 @@ const steps = {
|
|
810
818
|
.should('exist')
|
811
819
|
.should('have.text', 'This is Bold text input.lorem');
|
812
820
|
},
|
821
|
+
|
822
|
+
verifyHighlightOptionsFieldErrorMessage: () => {
|
823
|
+
highlightPage.highlightOptionsTextFieldWrapper()
|
824
|
+
.next()
|
825
|
+
.should('have.text', 'Error: Minimum one highlight option is required.');
|
826
|
+
},
|
827
|
+
|
828
|
+
//TODO- Update after https://redmine.zeuslearning.com/issues/548968 is resolved
|
829
|
+
verifySetCorrectAnswerErrorMessage: () => {
|
830
|
+
highlightPage.setCorrectAnswerLabel()
|
831
|
+
.parents('.highlight-set-correct-wrapper')
|
832
|
+
.within(() => {
|
833
|
+
utilities.verifyTextContent(highlightPage.errorMessage().eq(1), 'Error: Please set a correct answer.')
|
834
|
+
});
|
835
|
+
}
|
813
836
|
}
|
814
837
|
|
815
838
|
const tests = {
|
@@ -823,6 +846,7 @@ const tests = {
|
|
823
846
|
...additionalSettingsPanel.tests,
|
824
847
|
...studentResponseAndLayoutComponent.tests,
|
825
848
|
...autoScoredAdditionalSettings.tests,
|
849
|
+
...createQuestionBasePage.tests,
|
826
850
|
|
827
851
|
/**
|
828
852
|
* @param {number} totalPoints Maximum total points set for the question
|
@@ -1,4 +1,5 @@
|
|
1
|
-
import
|
1
|
+
import utilities from "../support/helpers/utilities";
|
2
|
+
import { additionalSettingsPanel, autoScoredAdditionalSettings, autoScoredPreviewBase, autoScoredScoringSection, autoScoredScoringSectionMultipleResponsesType, autoScoredSetCorrectAnswerSection, commonComponents, createQuestionBasePage, dragAndDropResponseOptions, dragAndDropSetCorrectAnswerCheckboxComponents, draggableOptionsContainer, mcqOptionsComponent, optionsWrapperComponent, previewScoringAndShowCorrectAnswerComponent, questionInstructionsComponent, scoringSectionBase, studentResponseAndLayoutComponent, answerNumerationComponent } from "./components"
|
2
3
|
import { dialogBoxBase } from "./dialogBoxBase";
|
3
4
|
const css = Cypress.env('css');
|
4
5
|
|
@@ -20,6 +21,8 @@ const selectors = {
|
|
20
21
|
...optionsWrapperComponent,
|
21
22
|
...dragAndDropSetCorrectAnswerCheckboxComponents,
|
22
23
|
...draggableOptionsContainer,
|
24
|
+
...studentResponseAndLayoutComponent,
|
25
|
+
...answerNumerationComponent,
|
23
26
|
|
24
27
|
//Options section
|
25
28
|
addOptionButton: () => cy.get('.add-option-wrapper-cls .ngie-button').eq(1),
|
@@ -40,11 +43,14 @@ const selectors = {
|
|
40
43
|
setCorrectAnswerStemLabel: () => cy.get('.input-field-label .question-text-wrapper'),
|
41
44
|
setCorrectAnswerStemResponseArea: () => cy.get('[class="droppable-area"] [role="button"]'),
|
42
45
|
setCorrectAnswerStemResponseAreaWrapper: () => cy.get('[class*="DroppableHotspotstyle__DroppableHotspotWrapper"]'),
|
46
|
+
stemColumnHeader: () => cy.get('[class*="ClozeWithDragAndDropstyles__HeaderContainer"]').eq(0),
|
47
|
+
responseColumnHeader: () => cy.get('[class*="ClozeWithDragAndDropstyles__HeaderContainer"]').eq(1),
|
43
48
|
//preview tab
|
44
49
|
previewTabStemRow: () => cy.get('.match-list-response-container'),
|
45
50
|
previewTabStemLabel: () => cy.get('.no-split-pane-wrapper .input-field-label .question-text-wrapper'),
|
46
51
|
previewTabStemField: () => listMatchingPage.previewTabStemLabel().parent(),
|
47
52
|
//Below same as FIG DnD
|
53
|
+
responseAreaNumeration: () => cy.get('[class*="DroppedItemstyle__NumerationWrapper"]'),
|
48
54
|
previewTabStemResponseArea: () => cy.get('.no-split-pane-wrapper [class="droppable-area"] [role="button"]'),
|
49
55
|
previewTabStemResponseAreaWrapper: () => cy.get('.no-split-pane-wrapper [class*="DroppableHotspotstyle__DroppableHotspotWrapper"]'),
|
50
56
|
previewTabQuestionField: () => cy.get('.no-split-pane-wrapper div[class*="ClozeWithDragAndDropstyles__QuestionItemContainer"]'),
|
@@ -55,6 +61,22 @@ const selectors = {
|
|
55
61
|
previewTabCorrectAnswerResponseWrapper: () => listMatchingPage.previewTabCorrectAnswerResponseNumerationWrapper().parents('[class*="ClozeWithDragAndDropstyles__ItemWrapper"]'),
|
56
62
|
previewTabCorrectAnswerResponseText: () => cy.get('[class*="ClozeWithDragAndDropstyles__ItemWrapper"] .question-text-wrapper'),
|
57
63
|
draggableOption: () => cy.get('.draggable-selected-item'),
|
64
|
+
//Additional settings
|
65
|
+
stemColumnHeaderLabel: () => cy.get('[class*="StudentResponseComponentstyle__InputWrapper"] .text-label').eq(0),
|
66
|
+
ResponseColumnHeaderLabel: () => cy.get('[class*="StudentResponseComponentstyle__InputWrapper"] .text-label').eq(1),
|
67
|
+
stemColumnHeaderInputField: () => cy.get('[class*="StudentResponseComponentstyle__InputWrapper"] input').eq(0),
|
68
|
+
ResponseColumnHeaderInputField: () => cy.get('[class*="StudentResponseComponentstyle__InputWrapper"] input').eq(1),
|
69
|
+
//Same as DnD into categories
|
70
|
+
responseOptionPlacementLabel: () => cy.get('#Response-option-placement-dropdown-label'),
|
71
|
+
responseOptionPlacementDropdown: () => cy.get('#Response-option-placement-select'),
|
72
|
+
responseOptionPlacementDropdownListOption: (ariaLabel = null) => {
|
73
|
+
if (ariaLabel) {
|
74
|
+
return cy.get(`[aria-labelledby*="Response-option-placement-dropdown-label"] [role="option"][aria-label*="${ariaLabel}"]`);
|
75
|
+
} else {
|
76
|
+
return cy.get('[aria-labelledby*="Response-option-placement-dropdown-label"] [role="option"]');
|
77
|
+
}
|
78
|
+
},
|
79
|
+
questionPreviewWrapper: () => cy.get('.preview-container')
|
58
80
|
}
|
59
81
|
|
60
82
|
const steps = {
|
@@ -77,6 +99,7 @@ const steps = {
|
|
77
99
|
...draggableOptionsContainer.steps,
|
78
100
|
...dialogBoxBase.steps,
|
79
101
|
...optionsWrapperComponent.steps,
|
102
|
+
...answerNumerationComponent.steps,
|
80
103
|
|
81
104
|
/**
|
82
105
|
* @param {number} index of the stem
|
@@ -143,7 +166,8 @@ const steps = {
|
|
143
166
|
listMatchingPage.stemWrapper()
|
144
167
|
.eq(index)
|
145
168
|
.within(() => {
|
146
|
-
|
169
|
+
listMatchingPage.buttonDeleteStem()
|
170
|
+
.should('be.disabled');
|
147
171
|
});
|
148
172
|
},
|
149
173
|
|
@@ -953,6 +977,166 @@ const steps = {
|
|
953
977
|
dragAndDropResponseOptions.steps.verifyOptionsForDragAndDropSectionOptionFieldContents();
|
954
978
|
});
|
955
979
|
},
|
980
|
+
|
981
|
+
/**
|
982
|
+
* Verifies the numeration of response area in the question preview.
|
983
|
+
* @param {Array<string>} numerationArray - An array of expected numeration values for response areas.
|
984
|
+
* @returns {void}
|
985
|
+
*/
|
986
|
+
verifyNumerationOfResponseAreasInQuestionPreview: (numerationArray) => {
|
987
|
+
numerationArray.forEach((option, count) => {
|
988
|
+
utilities.verifyTextContent(listMatchingPage.responseAreaNumeration().eq(count), option);
|
989
|
+
utilities.verifyElementVisibilityState(listMatchingPage.responseAreaNumeration().eq(count), 'visible');
|
990
|
+
});
|
991
|
+
},
|
992
|
+
|
993
|
+
/**
|
994
|
+
* Verifies the numeration of correct answer container.
|
995
|
+
* @param {Array<string>} numerationArray - An array of expected numeration values for response areas.
|
996
|
+
* @returns {void}
|
997
|
+
*/
|
998
|
+
verifyCorrectAnswerContainerNumeration: (numerationArray) => {
|
999
|
+
numerationArray.forEach((option, count) => {
|
1000
|
+
utilities.verifyTextContent(listMatchingPage.previewTabCorrectAnswerResponseNumerationWrapper().eq(count), option);
|
1001
|
+
utilities.verifyElementVisibilityState(listMatchingPage.previewTabCorrectAnswerResponseNumerationWrapper().eq(count), 'visible');
|
1002
|
+
});
|
1003
|
+
},
|
1004
|
+
|
1005
|
+
clickOnResponseOptionPlacementDropdown: () => {
|
1006
|
+
listMatchingPage.responseOptionPlacementDropdown()
|
1007
|
+
.click();
|
1008
|
+
},
|
1009
|
+
|
1010
|
+
/**
|
1011
|
+
* @param {string[]} optionsArray
|
1012
|
+
* @description Verify response options placement dropdown list
|
1013
|
+
*/
|
1014
|
+
verifyResponseOptionPlacementDropdownOptions: (optionsArray) => {
|
1015
|
+
listMatchingPage.responseOptionPlacementDropdownListOption()
|
1016
|
+
.each(($el, index) => {
|
1017
|
+
cy.wrap($el)
|
1018
|
+
.should('have.text', optionsArray[index]);
|
1019
|
+
});
|
1020
|
+
},
|
1021
|
+
|
1022
|
+
/**
|
1023
|
+
* Selects an option from the response option placement dropdown list.
|
1024
|
+
* @param {string} dropdownOption - The option to select from the dropdown list ('Bottom', 'Top', 'Left', or 'Right')
|
1025
|
+
* @returns {void}
|
1026
|
+
*/
|
1027
|
+
selectResponseOptionPlacementDropdownOption: (dropdownOption) => {
|
1028
|
+
listMatchingPage.responseOptionPlacementDropdownListOption(dropdownOption)
|
1029
|
+
.click();
|
1030
|
+
},
|
1031
|
+
|
1032
|
+
/**
|
1033
|
+
* Verifies the placement option of a response option in the preview tab.
|
1034
|
+
* @param {string} placementOption - The placement option to verify ('Bottom', 'Top', 'Left', or 'Right').
|
1035
|
+
* @throws {Error} Throws an error if an invalid placement option is provided.
|
1036
|
+
*/
|
1037
|
+
verifyResponseOptionPlacementPreviewTab: (placementOption) => {
|
1038
|
+
switch (placementOption) {
|
1039
|
+
case 'Bottom':
|
1040
|
+
listMatchingPage.questionPreviewWrapper()
|
1041
|
+
.should('have.class', 'placement-bottom');
|
1042
|
+
break;
|
1043
|
+
case 'Top':
|
1044
|
+
listMatchingPage.questionPreviewWrapper()
|
1045
|
+
.should('have.class', 'placement-top');
|
1046
|
+
break;
|
1047
|
+
case 'Left':
|
1048
|
+
listMatchingPage.questionPreviewWrapper()
|
1049
|
+
.should('have.class', 'placement-left');
|
1050
|
+
break;
|
1051
|
+
case 'Right':
|
1052
|
+
listMatchingPage.questionPreviewWrapper()
|
1053
|
+
.should('have.class', 'placement-right');
|
1054
|
+
break;
|
1055
|
+
default:
|
1056
|
+
throw new Error('Invalid placement option');
|
1057
|
+
}
|
1058
|
+
},
|
1059
|
+
|
1060
|
+
/**
|
1061
|
+
* Verifies the value of the stem column header input field.
|
1062
|
+
* @param {string} stemHeader - The expected input field value to compare against.
|
1063
|
+
* @returns {void}
|
1064
|
+
*/
|
1065
|
+
verifyStemColumnHeaderInputFieldValue: (stemHeader) => {
|
1066
|
+
listMatchingPage.stemColumnHeaderInputField()
|
1067
|
+
.should('have.attr', 'value', stemHeader)
|
1068
|
+
},
|
1069
|
+
|
1070
|
+
/**
|
1071
|
+
* Enters text into the stem column header input field.
|
1072
|
+
* @param {string} text - The text to be entered into the stem column header input field.
|
1073
|
+
* @returns {void}
|
1074
|
+
*/
|
1075
|
+
enterTextInStemColumnHeaderInputField: (text) => {
|
1076
|
+
listMatchingPage.stemColumnHeaderInputField()
|
1077
|
+
.type(text, { delay: 0 })
|
1078
|
+
.blur();
|
1079
|
+
},
|
1080
|
+
|
1081
|
+
clearTextInStemColumnHeaderInputField: () => {
|
1082
|
+
listMatchingPage.stemColumnHeaderInputField()
|
1083
|
+
.clear();
|
1084
|
+
},
|
1085
|
+
|
1086
|
+
/**
|
1087
|
+
* Verifies the value of the response column header input field.
|
1088
|
+
* @param {string} responseHeader - The expected input field value to compare against.
|
1089
|
+
* @returns {void}
|
1090
|
+
*/
|
1091
|
+
verifyResponseColumnHeaderInputFieldValue: (responseHeader) => {
|
1092
|
+
listMatchingPage.ResponseColumnHeaderInputField()
|
1093
|
+
.should('have.attr', 'value', responseHeader)
|
1094
|
+
},
|
1095
|
+
|
1096
|
+
/**
|
1097
|
+
* Enters text into the stem column header input field.
|
1098
|
+
* @param {string} text - The text to be entered into the stem column header input field.
|
1099
|
+
* @returns {void}
|
1100
|
+
*/
|
1101
|
+
enterTextInResponseColumnHeaderInputField: (text) => {
|
1102
|
+
listMatchingPage.ResponseColumnHeaderInputField()
|
1103
|
+
.type(text, { delay: 0 })
|
1104
|
+
.blur();
|
1105
|
+
},
|
1106
|
+
|
1107
|
+
clearTextInResponseColumnHeaderInputField: () => {
|
1108
|
+
listMatchingPage.ResponseColumnHeaderInputField()
|
1109
|
+
.clear();
|
1110
|
+
},
|
1111
|
+
|
1112
|
+
verifyStemFieldErrorMessage: () => {
|
1113
|
+
listMatchingPage.stemWrapper()
|
1114
|
+
.each(($element) => {
|
1115
|
+
cy.wrap($element)
|
1116
|
+
.within(() => {
|
1117
|
+
utilities.verifyTextContent(listMatchingPage.errorMessage(), 'Error: Stem is required.');
|
1118
|
+
});
|
1119
|
+
});
|
1120
|
+
},
|
1121
|
+
|
1122
|
+
verifyOptionFieldErrorMessage: () => {
|
1123
|
+
listMatchingPage.optionWrapper()
|
1124
|
+
.each(($element) => {
|
1125
|
+
cy.wrap($element)
|
1126
|
+
.within(() => {
|
1127
|
+
utilities.verifyTextContent(listMatchingPage.errorMessage(), 'Error: Option is required.');
|
1128
|
+
});
|
1129
|
+
});
|
1130
|
+
},
|
1131
|
+
|
1132
|
+
verifySetCorrectAnswerErrorMessage: () => {
|
1133
|
+
listMatchingPage.setCorrectAnswerStemRow()
|
1134
|
+
.eq(0)
|
1135
|
+
.parents('.cloze-with-text-response-form-controls-wrapper')
|
1136
|
+
.within(() => {
|
1137
|
+
utilities.verifyTextContent(listMatchingPage.errorMessage(), 'Error: Please set a correct answer.');
|
1138
|
+
});
|
1139
|
+
}
|
956
1140
|
}
|
957
1141
|
|
958
1142
|
const tests = {
|
@@ -967,6 +1151,10 @@ const tests = {
|
|
967
1151
|
...dragAndDropSetCorrectAnswerCheckboxComponents.tests,
|
968
1152
|
...draggableOptionsContainer.tests,
|
969
1153
|
...commonComponents.tests,
|
1154
|
+
...additionalSettingsPanel.tests,
|
1155
|
+
...studentResponseAndLayoutComponent.tests,
|
1156
|
+
...answerNumerationComponent.tests,
|
1157
|
+
...autoScoredAdditionalSettings.tests,
|
970
1158
|
|
971
1159
|
verifyDefaultStemFieldsAndResponseAreasInSetCorrectAnswerSection: () => {
|
972
1160
|
it('Three stem fields and three empty response areas should be displayed in the set correct answer section', () => {
|
@@ -1191,8 +1379,8 @@ const tests = {
|
|
1191
1379
|
|
1192
1380
|
verifyAutoScoredPartialEqualWeightsScoringEditTabFunctionality: () => {
|
1193
1381
|
it('When user gives a score input to \'Points\' input field, then the score should be equally divided and displayed besides each response under the \'Points per response\' label', () => {
|
1194
|
-
listMatchingPage.steps.allotPoints(
|
1195
|
-
listMatchingPage.steps.verifyPartialEqualWeightsPointsPerResponseScore(
|
1382
|
+
listMatchingPage.steps.allotPoints(6)
|
1383
|
+
listMatchingPage.steps.verifyPartialEqualWeightsPointsPerResponseScore(2);
|
1196
1384
|
});
|
1197
1385
|
|
1198
1386
|
it('When user adds a stem, one more stem and its response area should be displayed in the set correct answer section and points per response score should be updated accordingly', () => {
|
@@ -1200,17 +1388,17 @@ const tests = {
|
|
1200
1388
|
steps.addStem()
|
1201
1389
|
listMatchingPage.setCorrectAnswerStemRow()
|
1202
1390
|
.should('have.length', '4');
|
1203
|
-
listMatchingPage.steps.verifyPartialEqualWeightsPointsPerResponseScore(
|
1391
|
+
listMatchingPage.steps.verifyPartialEqualWeightsPointsPerResponseScore(1.5)
|
1204
1392
|
});
|
1205
1393
|
|
1206
1394
|
it('When user removes a stem, then the points per response score should be updated accordingly', () => {
|
1207
1395
|
listMatchingPage.steps.deleteStem(0);
|
1208
|
-
listMatchingPage.steps.verifyPartialEqualWeightsPointsPerResponseScore(
|
1396
|
+
listMatchingPage.steps.verifyPartialEqualWeightsPointsPerResponseScore(2)
|
1209
1397
|
});
|
1210
1398
|
|
1211
1399
|
it('User should be able to enter points in \'Penalty Points\' and \'Minimum score awarded (if attempted)\' input fields', () => {
|
1212
|
-
listMatchingPage.steps.allotPenaltyPoints(
|
1213
|
-
listMatchingPage.steps.allotMinimumScoreAwardedIfAttempted(
|
1400
|
+
listMatchingPage.steps.allotPenaltyPoints(1);
|
1401
|
+
listMatchingPage.steps.allotMinimumScoreAwardedIfAttempted(1);
|
1214
1402
|
});
|
1215
1403
|
|
1216
1404
|
it('CSS of \'Points per response\' label and its displayed score, \'Penalty Points\' and \'Minimum score awarded (if attempted)\' and \'Round down score\' checkbox', { tags: 'css' }, () => {
|
@@ -1238,13 +1426,13 @@ const tests = {
|
|
1238
1426
|
.should('not.exist');
|
1239
1427
|
listMatchingPage.partialEqualWeightsPointsPerResponseScore()
|
1240
1428
|
.should('not.exist');
|
1241
|
-
listMatchingPage.steps.verifyPointsFieldValue(
|
1429
|
+
listMatchingPage.steps.verifyPointsFieldValue(6);
|
1242
1430
|
});
|
1243
1431
|
|
1244
1432
|
it('When user has entered points in \'All or nothing\' scoring type and switches to \'Partial equal weights\' scoring type, then the score should be equally divided and displayed besides each response under the \'Points per response\' label', () => {
|
1245
|
-
listMatchingPage.steps.allotPoints(
|
1433
|
+
listMatchingPage.steps.allotPoints(9)
|
1246
1434
|
listMatchingPage.steps.selectPartialEqualWeightsCheckbox();
|
1247
|
-
listMatchingPage.steps.verifyPartialEqualWeightsPointsPerResponseScore(
|
1435
|
+
listMatchingPage.steps.verifyPartialEqualWeightsPointsPerResponseScore(3);
|
1248
1436
|
});
|
1249
1437
|
},
|
1250
1438
|
|
@@ -1279,8 +1467,8 @@ const tests = {
|
|
1279
1467
|
});
|
1280
1468
|
|
1281
1469
|
it('User should be able to enter points in \'Penalty Points\' and \'Minimum score awarded (if attempted)\' input fields', () => {
|
1282
|
-
listMatchingPage.steps.allotPenaltyPoints(
|
1283
|
-
listMatchingPage.steps.allotMinimumScoreAwardedIfAttempted(
|
1470
|
+
listMatchingPage.steps.allotPenaltyPoints(1);
|
1471
|
+
listMatchingPage.steps.allotMinimumScoreAwardedIfAttempted(1);
|
1284
1472
|
});
|
1285
1473
|
|
1286
1474
|
it('CSS of \'Points per response\' label, \'Penalty Points\' and \'Minimum score awarded (if attempted)\' and \'Round down score\' checkbox', { tags: 'css' }, () => {
|
@@ -1302,17 +1490,17 @@ const tests = {
|
|
1302
1490
|
|
1303
1491
|
it('When the user switches to \'All or nothing\' scoring, the points added for individual responses in Partial - different weights scoring should get summed up in the All or nothing scoring Points input field and \'Minimum score awarded(If attempted)\' and \'Penalty points\' input fields should not be displayed', () => {
|
1304
1492
|
listMatchingPage.steps.selectAllOrNothingCheckbox();
|
1305
|
-
listMatchingPage.steps.verifyPointsFieldValue(
|
1493
|
+
listMatchingPage.steps.verifyPointsFieldValue(10.2);
|
1306
1494
|
listMatchingPage.pointsPerResponseLabel()
|
1307
1495
|
.should('not.exist');
|
1308
1496
|
listMatchingPage.partialEqualWeightsPointsPerResponseScore()
|
1309
1497
|
.should('not.exist');
|
1310
1498
|
});
|
1311
1499
|
|
1312
|
-
it('When user has entered points in \'All or nothing\' scoring type and switches to \'Partial different weights\' scoring type, then the points
|
1313
|
-
listMatchingPage.steps.allotPoints(
|
1500
|
+
it('When user has entered points in \'All or nothing\' scoring type and switches to \'Partial different weights\' scoring type, then the points allocated should get equally divided between each correct response', () => {
|
1501
|
+
listMatchingPage.steps.allotPoints(9);
|
1314
1502
|
listMatchingPage.steps.selectPartialDifferentWeightsCheckbox();
|
1315
|
-
listMatchingPage.steps.
|
1503
|
+
listMatchingPage.steps.verifyPartialDifferentWeightsPointsInputFieldValue([3, 3, 3]);
|
1316
1504
|
});
|
1317
1505
|
},
|
1318
1506
|
|
@@ -1883,7 +1883,6 @@ const tests = {
|
|
1883
1883
|
|
1884
1884
|
cy.log('(Overachiever case) Pre-step: Switching to Edit tab and allotting points to correct and alternate tab such that the difference between the points is substantial and the points per response are in decimal');
|
1885
1885
|
listMatchingPage.steps.switchToEditTab();
|
1886
|
-
listMatchingPage.steps.uncheckRoundDownScoreCheckbox()
|
1887
1886
|
switch (optionLayout) {
|
1888
1887
|
case 'standard':
|
1889
1888
|
listMatchingPage.steps.addOption();
|
@@ -18,8 +18,8 @@ const selectors = {
|
|
18
18
|
enableMultipageContentLabelCheckbox: () => cy.get('[data-ngie-testid="enable-multi-page-content-checkbox"] input'),
|
19
19
|
bodyLabel: () => cy.get('.additional-settings-label').eq(0),
|
20
20
|
bodyInputField: () => cy.get('[title="Enter body"]'),
|
21
|
-
addPageButton: () => cy.get('.
|
22
|
-
deletePageButton: () => cy.get('.icon-
|
21
|
+
addPageButton: () => cy.get('.ngie-icon-with-label-btn'),
|
22
|
+
deletePageButton: () => cy.get('.ngie-icon-btn-cls'),
|
23
23
|
bodyWrapper: () => cy.get('.edit-mcq-option-wrapper'),
|
24
24
|
bodyNumeration: () => cy.get('[class*="SingleOptionstyle__AdornmentDiv"]'),
|
25
25
|
//Preview
|
@@ -389,7 +389,7 @@ const tests = {
|
|
389
389
|
});
|
390
390
|
|
391
391
|
it('When user has made some edits/changes and clicks on Cancel button, a popup should be displayed', () => {
|
392
|
-
selectQuestionResourceToolPage.steps.selectResourceType('
|
392
|
+
selectQuestionResourceToolPage.steps.selectResourceType('passage');
|
393
393
|
utilities.verifyElementVisibilityState(passagePage.headingInputField(), 'visible');
|
394
394
|
passagePage.steps.addHeadingText();
|
395
395
|
createQuestionBasePage.cancelButton()
|
@@ -266,7 +266,7 @@ const tests = {
|
|
266
266
|
});
|
267
267
|
|
268
268
|
it('When user has made some edits/changes and clicks on Cancel button, a popup should be displayed', () => {
|
269
|
-
selectQuestionResourceToolPage.steps.selectResourceType('
|
269
|
+
selectQuestionResourceToolPage.steps.selectResourceType('reading ruler');
|
270
270
|
utilities.verifyElementVisibilityState(readingRulerPage.opacityInputField(), 'visible');
|
271
271
|
readingRulerPage.steps.addInputToOpacityInputField('30');
|
272
272
|
createQuestionBasePage.cancelButton()
|
@@ -19,7 +19,7 @@ const selectors = {
|
|
19
19
|
exactRadioOptionLabel: () => cy.get('.ngie-radio-label').eq(0),
|
20
20
|
containsTextRadioOptionLabel: () => cy.get('.ngie-radio-label').eq(1),
|
21
21
|
caseSensitiveCheckboxLabel: () => cy.get('[data-ngie-testid="case-sensitive-checkbox"] .MuiFormControlLabel-label'),
|
22
|
-
ignoreSpacesBeforeAndAfterCheckboxLabel: () => cy.get('[data-ngie-testid="ignore-spaces-before-and-after-checkbox"] .MuiFormControlLabel-label')
|
22
|
+
ignoreSpacesBeforeAndAfterCheckboxLabel: () => cy.get('[data-ngie-testid="ignore-spaces-before-and-after-checkbox"] .MuiFormControlLabel-label'),
|
23
23
|
exactRadioButton: () => cy.get('input[aria-label="Exact"]'),
|
24
24
|
containsTextRadioButton: () => cy.get('input[aria-label="Contains text"]'),
|
25
25
|
caseSensitiveCheckbox: () => cy.get('[data-ngie-testid="case-sensitive-checkbox"] input'),
|
@@ -27,7 +27,7 @@ const selectors = {
|
|
27
27
|
recordAgainButton: () => cy.get('button[aria-label="Record again"]'),
|
28
28
|
playerTimer: () => cy.get('[class*="VideoRecorderstyle__PlayerTimerWrapper"]'),
|
29
29
|
playbackSpeedButton: () => cy.get('button[aria-label="Playback speed"]'),
|
30
|
-
fullScreenButton: () => cy.get('button[aria-label="Full
|
30
|
+
fullScreenButton: () => cy.get('button[aria-label="Full Screen"]'),
|
31
31
|
savedResponseText: () => cy.get('[class*="VideoRecorderstyle__ResponseTextWrapper"]'),
|
32
32
|
maxRecorderLengthInputField: () => cy.get('input[aria-label="Maximum recorder length"]'),
|
33
33
|
playbackSpeedOptionsList: () => cy.get('[class*="VideoRecorderstyle__PlaybackSpeedOptions"]'),
|
@@ -295,7 +295,7 @@ const steps = {
|
|
295
295
|
|
296
296
|
verifyPlaybackSpeedAdvancedPlaybackOptionSelectedState: () => {
|
297
297
|
videoResponsePage.playbackSpeedAdvancedPlaybackOptionButton()
|
298
|
-
.should('have.class', '
|
298
|
+
.should('have.class', 'ngie-toggle-button-selected')
|
299
299
|
.within(() => {
|
300
300
|
utilities.verifyElementVisibilityState(videoResponsePage.advancedPlaybackOptionButtonSelectedIcon(), 'visible');
|
301
301
|
});
|
@@ -303,7 +303,7 @@ const steps = {
|
|
303
303
|
|
304
304
|
verifyPlaybackSpeedAdvancedPlaybackOptionDeselectedState: () => {
|
305
305
|
videoResponsePage.playbackSpeedAdvancedPlaybackOptionButton()
|
306
|
-
.should('not.have.class', '
|
306
|
+
.should('not.have.class', 'ngie-toggle-button-selected')
|
307
307
|
.within(() => {
|
308
308
|
utilities.verifyElementVisibilityState(videoResponsePage.advancedPlaybackOptionButtonSelectedIcon(), 'notExist');
|
309
309
|
});
|
@@ -311,7 +311,7 @@ const steps = {
|
|
311
311
|
|
312
312
|
verifyFullScreenAdvancedPlaybackOptionSelectedState: () => {
|
313
313
|
videoResponsePage.fullScreenAdvancedPlaybackOptionButton()
|
314
|
-
.should('have.class', '
|
314
|
+
.should('have.class', 'ngie-toggle-button-selected')
|
315
315
|
.within(() => {
|
316
316
|
utilities.verifyElementVisibilityState(videoResponsePage.advancedPlaybackOptionButtonSelectedIcon(), 'visible');
|
317
317
|
});
|
@@ -319,7 +319,7 @@ const steps = {
|
|
319
319
|
|
320
320
|
verifyFullScreenAdvancedPlaybackOptionDeselectedState: () => {
|
321
321
|
videoResponsePage.fullScreenAdvancedPlaybackOptionButton()
|
322
|
-
.should('not.have.class', '
|
322
|
+
.should('not.have.class', 'ngie-toggle-button-selected')
|
323
323
|
.within(() => {
|
324
324
|
utilities.verifyElementVisibilityState(videoResponsePage.advancedPlaybackOptionButtonSelectedIcon(), 'notExist');
|
325
325
|
});
|
@@ -327,7 +327,7 @@ const steps = {
|
|
327
327
|
|
328
328
|
verifyRecordAgainAdvancedPlaybackOptionSelectedState: () => {
|
329
329
|
videoResponsePage.recordAgainAdvancedPlaybackOptionButton()
|
330
|
-
.should('have.class', '
|
330
|
+
.should('have.class', 'ngie-toggle-button-selected')
|
331
331
|
.within(() => {
|
332
332
|
utilities.verifyElementVisibilityState(videoResponsePage.advancedPlaybackOptionButtonSelectedIcon(), 'visible');
|
333
333
|
});
|
@@ -335,7 +335,7 @@ const steps = {
|
|
335
335
|
|
336
336
|
verifyRecordAgainAdvancedPlaybackOptionDeselectedState: () => {
|
337
337
|
videoResponsePage.recordAgainAdvancedPlaybackOptionButton()
|
338
|
-
.should('not.have.class', '
|
338
|
+
.should('not.have.class', 'ngie-toggle-button-selected')
|
339
339
|
.within(() => {
|
340
340
|
utilities.verifyElementVisibilityState(videoResponsePage.advancedPlaybackOptionButtonSelectedIcon(), 'notExist');
|
341
341
|
});
|
@@ -3,7 +3,7 @@ import { v4 as uuidv4 } from 'uuid';
|
|
3
3
|
import "cypress-real-events/support";
|
4
4
|
import 'cypress-file-upload';
|
5
5
|
require('cy-verify-downloads').addCustomCommand();
|
6
|
-
import addContext from "mochawesome/addContext";
|
6
|
+
//import addContext from "mochawesome/addContext";
|
7
7
|
|
8
8
|
const randomUser = (j, username, i) => ({
|
9
9
|
id: uuidv4(),
|
@@ -129,9 +129,9 @@ Cypress.Commands.add('fill', { prevSubject: 'element' }, ($subj, text) => {
|
|
129
129
|
return cy.wrap($subj).type('{enter}');
|
130
130
|
});
|
131
131
|
|
132
|
-
Cypress.Commands.add('addContext', (context) => {
|
133
|
-
|
134
|
-
});
|
132
|
+
// Cypress.Commands.add('addContext', (context) => {
|
133
|
+
// cy.once('test:after:run', (test) => addContext({ test }, context));
|
134
|
+
// });
|
135
135
|
|
136
136
|
Cypress.Commands.add('barsPreLoaderWait', () => {
|
137
137
|
cy.get('[id="question-item-instruction-loader"]')
|
package/cypress/support/e2e.js
CHANGED
@@ -20,10 +20,10 @@ function checkAccessibility(cySelector = null) {
|
|
20
20
|
cy.injectAxe()
|
21
21
|
.then(() => {
|
22
22
|
if (cySelector === null) {
|
23
|
-
return cy.checkA11y(null, config
|
23
|
+
return cy.checkA11y(null, config);
|
24
24
|
} else {
|
25
25
|
cySelector.then(($element) => {
|
26
|
-
return cy.checkA11y($element.selector, config
|
26
|
+
return cy.checkA11y($element.selector, config);
|
27
27
|
});
|
28
28
|
};
|
29
29
|
});
|
package/cypress.config.js
CHANGED
@@ -19,7 +19,6 @@ async function getConfigurationByFile(file, theme) {
|
|
19
19
|
}
|
20
20
|
|
21
21
|
module.exports = defineConfig({
|
22
|
-
reporter: 'cypress-mochawesome-reporter',
|
23
22
|
reporterOptions: {
|
24
23
|
reportDir: 'cypress/reports',
|
25
24
|
charts: true,
|
@@ -63,7 +62,6 @@ module.exports = defineConfig({
|
|
63
62
|
},
|
64
63
|
isFileExist
|
65
64
|
});
|
66
|
-
require('cypress-mochawesome-reporter/plugin')(on);
|
67
65
|
require('@cypress/grep/src/plugin')()
|
68
66
|
return cloudPlugin(on, config), getConfigurationByFile(file, theme);
|
69
67
|
},
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "itemengine-cypress-automation",
|
3
|
-
"version": "1.0.
|
3
|
+
"version": "1.0.13",
|
4
4
|
"description": "",
|
5
5
|
"main": "index.js",
|
6
6
|
"scripts": {
|
@@ -8,7 +8,7 @@
|
|
8
8
|
"test": "echo 'success'",
|
9
9
|
"spinnaker": "node scripts/spinnaker.mjs --env theme=ilc",
|
10
10
|
"spinnaker:untagged": "node scripts/spinnaker.mjs --env theme=ilc,grepUntagged=true",
|
11
|
-
"local": "node scripts/local.mjs",
|
11
|
+
"local": "node scripts/local.mjs --env fileConfig=ilqa",
|
12
12
|
"cy:ildev": "cypress open --env fileConfig=ildev",
|
13
13
|
"cy:ilprod": "cypress open --env fileConfig=ilprod",
|
14
14
|
"cy:ilqa": "cypress open --env fileConfig=ilqa",
|
@@ -26,7 +26,6 @@
|
|
26
26
|
"cypress-axe": "^1.5.0",
|
27
27
|
"cypress-cloud": "^1.9.6",
|
28
28
|
"cypress-file-upload": "^5.0.8",
|
29
|
-
"cypress-mochawesome-reporter": "^3.3.0",
|
30
29
|
"cypress-real-events": "^1.7.6",
|
31
30
|
"react-uuid": "^2.0.0"
|
32
31
|
}
|
@@ -86,7 +86,8 @@ export function runSorryCypressSpinnaker() {
|
|
86
86
|
export function runSorryCypressLocal() {
|
87
87
|
process.env.CYPRESS_API_URL = "https://cypress-director.imaginelearning.engineering/";
|
88
88
|
const user = OS.userInfo().username;
|
89
|
-
startTime = Math.round(Date.now() /
|
89
|
+
startTime = Math.round(Date.now() / 1000000);
|
90
90
|
ciBuildId = setCiBuildId(user, startTime);
|
91
|
+
const envArgs = setCommandLineEnvArgs()
|
91
92
|
runSorryCypress(ciBuildId, envArgs);
|
92
93
|
}
|