itemengine-cypress-automation 1.0.247-06SeptUpdates-b1623d7.0 → 1.0.248-23rdSeptUpdates-8103a8f.0
Sign up to get free protection for your applications and to get access to all the features.
- package/cypress/e2e/ILC/ChartsBar/Scoring/partialEqualWeightsAlternativePointsGreaterThanCorrectPoints.js +1 -1
- package/cypress/e2e/ILC/ChartsBar/Scoring/partialEqualWeightsCorrectPointsGreaterThanAlternativePoints.js +1 -1
- package/cypress/e2e/ILC/ChartsLine/Scoring/allOrNothingAlternatePointsGreaterThanCorrectPoints.js +349 -0
- package/cypress/e2e/ILC/ChartsLine/Scoring/allOrNothingCorrectPointsEqualToAlternatePoints.js +348 -0
- package/cypress/e2e/ILC/ChartsLine/Scoring/allOrNothingCorrectPointsGreaterThanAlternatePoints.js +415 -0
- package/cypress/e2e/ILC/ChartsLine/Scoring/allOrNothingPenaltyScoring.js +54 -0
- package/cypress/e2e/ILC/ChartsLine/Scoring/partialDifferentWeightBasic.js +254 -0
- package/cypress/e2e/ILC/ChartsLine/Scoring/partialEqualWeightBasic.js +255 -0
- package/cypress/e2e/ILC/DrawingResponse/drawingResponsePreviewTabContents.smoke.js +4 -0
- package/cypress/e2e/ILC/EssayResponse/createCustomCategory.smoke.js +2 -0
- package/cypress/e2e/ILC/EssayResponse/editCategoryFlyout.js +3 -0
- package/cypress/e2e/ILC/EssayResponse/equationEditor.smoke.js +4 -0
- package/cypress/e2e/ILC/EssayResponse/essayResponseCustomizeFormattingOptions1.smoke.js +2 -0
- package/cypress/e2e/ILC/EssayResponse/essayResponseSpecialCharacters.js +2 -0
- package/cypress/e2e/ILC/EssayResponseBasic/essayResponseBasicCustomizeFormattingOptions.js +2 -0
- package/cypress/e2e/ILC/ImageHighlight/toolsFunctionalityEditTab.js +2 -2
- package/cypress/e2e/ILC/ListOrderingNew/styleAndLayoutCustomizationSameList.js +270 -0
- package/cypress/e2e/ILC/ListOrderingReorderAsASeperateList/HorizontalOrientation/partialDifferentWeightsBasic.js +95 -0
- package/cypress/e2e/ILC/ListOrderingReorderAsASeperateList/HorizontalOrientation/partialDifferentWeightsCorrectPointsGreaterThanAlternativePoints.js +236 -0
- package/cypress/e2e/ILC/ListOrderingReorderAsASeperateList/HorizontalOrientation/partialEqualWeightsBasic.js +150 -0
- package/cypress/e2e/ILC/ListOrderingReorderAsASeperateList/HorizontalOrientation/setPointsPopup.js +88 -0
- package/cypress/e2e/ILC/ListOrderingReorderAsASeperateList/HorizontalOrientation/specifyCorrectAnswerSection.js +97 -0
- package/cypress/e2e/ILC/ListOrderingReorderAsASeperateList/HorizontalOrientation/studentViewSettings.js +134 -0
- package/cypress/e2e/ILC/ListOrderingReorderAsASeperateList/additionalSettings.js +131 -0
- package/cypress/e2e/ILC/ListOrderingReorderAsASeperateList/editTabBasicSection.js +167 -0
- package/cypress/e2e/ILC/ListOrderingReorderAsASeperateList/editTabScoring.js +202 -0
- package/cypress/e2e/ILC/ListOrderingReorderAsASeperateList/headerSection.js +76 -0
- package/cypress/e2e/ILC/ListOrderingReorderAsASeperateList/manuallyAndNonScoredEditTab.js +72 -0
- package/cypress/e2e/ILC/ListOrderingReorderAsASeperateList/minimumScoringPenaltyPointsAndRoundingDropdown.js +197 -0
- package/cypress/e2e/ILC/ListOrderingReorderAsASeperateList/optionsOrientationSection.js +180 -0
- package/cypress/e2e/ILC/ListOrderingReorderAsASeperateList/specifyCorrectAnswerSection.js +95 -0
- package/cypress/e2e/ILC/ListOrderingReorderAsASeperateList/studentViewSettings.js +130 -0
- package/cypress/e2e/ILC/Matching/styleAndLayoutCustomizationDraggableOptionProperties.js +223 -0
- package/cypress/e2e/ILC/Matching/styleAndLayoutCustomizationDraggableOptionsPanel.js +121 -0
- package/cypress/e2e/ILC/Matching/styleAndLayoutCustomizationDropzoneConnectorStyle.js +68 -0
- package/cypress/e2e/ILC/Matching/styleAndLayoutCustomizationOptionAlignment.js +71 -0
- package/cypress/e2e/ILC/Matching/styleAndLayoutCustomizationOptionPlacement.js +64 -0
- package/cypress/e2e/ILC/MatchingDropdown/styleAndLayoutCustomization.js +270 -0
- package/cypress/e2e/ILC/TextEntryMath/Scoring/allOrNothingAlternatePointsGreaterThanCorrectPoints.js +7 -7
- package/cypress/e2e/ILC/TextEntryMath/Scoring/allOrNothingCorrectPointsEqualToAlternatePoints.js +7 -7
- package/cypress/e2e/ILC/TextEntryMath/Scoring/allOrNothingCorrectPointsGreaterThanAlternatePoints.js +7 -7
- package/cypress/e2e/ILC/TextEntryMath/Scoring/partialDifferentWeightsAlternativePointsGreaterThanCorrectPoints.js +7 -7
- package/cypress/e2e/ILC/TextEntryMath/Scoring/partialDifferentWeightsCorrectPointsEqualToAlternativePoints.js +7 -7
- package/cypress/e2e/ILC/TextEntryMath/Scoring/partialDifferentWeightsCorrectPointsGreaterThanAlternativePoints.js +8 -8
- package/cypress/e2e/ILC/TextEntryMath/Scoring/partialDifferentWeightsScoringBasic.js +4 -4
- package/cypress/e2e/ILC/TextEntryMath/Scoring/partialEqualWeightsAlternativePointsGreaterThanCorrectPoints.js +7 -7
- package/cypress/e2e/ILC/TextEntryMath/Scoring/partialEqualWeightsCorrectPointsEqualToAlternativePoints.js +7 -7
- package/cypress/e2e/ILC/TextEntryMath/Scoring/partialEqualWeightsCorrectPointsGreaterThanAlternativePoints.js +8 -8
- package/cypress/e2e/ILC/TextEntryMath/Scoring/partialEqualWeightsScoringBasic.js +4 -4
- package/cypress/e2e/ILC/TextEntryMath/allOrNothingBasicForAllViews.smoke.js +4 -4
- package/cypress/e2e/ILC/TextEntryMath/allOrNothingBasicForAllViewsFormulaTemplate.smoke.js +272 -0
- package/cypress/e2e/ILC/TextEntryMath/evaluationMethodsWithoutSetResponse.js +6 -6
- package/cypress/fixtures/drawingToolbarOptionsAdditionalOptionsAndSpecialAndMathCharacters.js +2 -2
- package/cypress/pages/audioPlayerPage.js +4 -4
- package/cypress/pages/audioResponsePage.js +9 -1
- package/cypress/pages/chartsBarPage.js +3 -3
- package/cypress/pages/components/connectorStyleStyleAndLayoutCustomizationComponent.js +51 -0
- package/cypress/pages/components/gridQuestionCommonComponent.js +1 -1
- package/cypress/pages/components/index.js +1 -10
- package/cypress/pages/components/listOrderingCommonStyleAndLayoutComponent.js +604 -0
- package/cypress/pages/components/optionsWrapperComponent.js +1 -1
- package/cypress/pages/components/setPointsPopupBase.js +6 -6
- package/cypress/pages/dragAndDropIntoCategoriesPage.js +1 -1
- package/cypress/pages/essayResponseBasicPage.js +4 -4
- package/cypress/pages/essayResponseMathPage.js +4 -4
- package/cypress/pages/fillInTheGapsDragAndDropPage.js +2 -2
- package/cypress/pages/fillInTheGapsOverImageDragAndDropPage.js +2 -2
- package/cypress/pages/index.js +0 -1
- package/cypress/pages/itemPreviewPage.js +1 -2
- package/cypress/pages/itemPreviewSettingsPage.js +3 -3
- package/cypress/pages/listOrderingPage.js +384 -10
- package/cypress/pages/matchingPage.js +512 -13
- package/cypress/pages/multipleSelectionPage.js +2 -2
- package/cypress/pages/numberLineLabelPage.js +3 -3
- package/cypress/pages/shortTextResponsePage.js +0 -37
- package/cypress/pages/singleSelectionPage.js +2 -2
- package/cypress/pages/textEntryMathPage.js +41 -9
- package/cypress/pages/textSelectionPage.js +2 -2
- package/cypress/pages/uploadResponsePage.js +2 -3
- package/cypress/pages/videoResponsePage.js +9 -2
- package/package.json +1 -1
- package/cypress/fixtures/specialAndMathCharacters.js +0 -120
- package/cypress/pages/components/autoScoredAdditionalSettings.js +0 -183
- package/cypress/pages/components/autoScoredPreviewBase.js +0 -92
- package/cypress/pages/components/autoScoredScoringSection.js +0 -199
- package/cypress/pages/components/autoScoredScoringSectionMultipleResponsesType.js +0 -377
- package/cypress/pages/components/autoScoredSetCorrectAnswerSection.js +0 -297
- package/cypress/pages/components/autoScoredStudentViewSettingsForPredefinedOptions.js +0 -84
- package/cypress/pages/components/listSortingAndOrderingBase.js +0 -401
- package/cypress/pages/components/previewScoringAndShowCorrectAnswerComponent.js +0 -91
- package/cypress/pages/components/scoringSectionBase.js +0 -354
- package/cypress/pages/components/specialAndCustomSpecialCharactersComponent.js +0 -80
- package/cypress/pages/components/specialCharactersFlyoutComponent.js +0 -59
- package/cypress/pages/listSortingPage.js +0 -1198
@@ -1,1198 +0,0 @@
|
|
1
|
-
import constants from "../fixtures/constants";
|
2
|
-
import utilities from "../support/helpers/utilities";
|
3
|
-
import { additionalSettingsPanel, answerNumerationComponent, autoScoredAdditionalSettings, autoScoredPreviewBase, autoScoredScoringSection, autoScoredScoringSectionMultipleResponsesType, autoScoredSetCorrectAnswerSection, ckEditorToolbar, commonComponents, createQuestionBasePage, equationEditorFlyout, optionsWrapperComponent, previewScoringAndShowCorrectAnswerComponent, questionInstructionsComponent, scoringSectionBase, studentResponseAndLayoutComponent } from "./components"
|
4
|
-
import { listSortingAndOrderingBase } from "./components/listSortingAndOrderingBase";
|
5
|
-
const css = Cypress.env('css');
|
6
|
-
|
7
|
-
const selectors = {
|
8
|
-
...optionsWrapperComponent,
|
9
|
-
...commonComponents,
|
10
|
-
...scoringSectionBase,
|
11
|
-
...autoScoredScoringSectionMultipleResponsesType,
|
12
|
-
...autoScoredSetCorrectAnswerSection,
|
13
|
-
...listSortingAndOrderingBase,
|
14
|
-
...autoScoredAdditionalSettings,
|
15
|
-
...listSortingAndOrderingBase,
|
16
|
-
...answerNumerationComponent,
|
17
|
-
...additionalSettingsPanel,
|
18
|
-
...autoScoredPreviewBase,
|
19
|
-
setCorrectAnswerSectionOption: () => cy.get('.draggable-item-wrapper'),
|
20
|
-
//Update once https://redmine.zeuslearning.com/issues/518498 is resolved
|
21
|
-
setCorrectAnswerSectionSourceOptionWrapper: () => cy.get('[class*="SourceColumnHeader"]').parents('[class*="ContextWrapper"]').find('[class*="ListSortingResponsestyles__DroppableDiv"]'),
|
22
|
-
setCorrectAnswerSectionTargetOptionWrapper: () => cy.get('[class*="TargetColumnHeader"]').parents('[class*="ContextWrapper"]').find('[class*="ListSortingResponsestyles__DroppableDiv"]'),
|
23
|
-
previewTabOption: () => cy.get('.edit-question-preview-wrapper .draggable-item-wrapper'),
|
24
|
-
previewTabSourceOptionWrapper: () => cy.get('.edit-question-preview-wrapper [class*="SourceColumnHeader"]').parents('[class*="ContextWrapper"]').find('[class*="ListSortingResponsestyles__DroppableDiv"]'),
|
25
|
-
previewTabTargetOptionWrapper: () => cy.get('.edit-question-preview-wrapper [class*="TargetColumnHeader"]').parents('[class*="ContextWrapper"]').find('[class*="ListSortingResponsestyles__DroppableDiv"]'),
|
26
|
-
dragHandleButton: () => cy.get('[class*="DragIcon"]'),
|
27
|
-
pointsPerResponseLabel: () => cy.get('[class*="ListSortingResponsestyles__PointsPerResponseLabel"]'),
|
28
|
-
partialEqualWeightsPointsPerResponseScore: () => cy.get('[class*="ListSortingResponsestyles__EqualPoints"]'),
|
29
|
-
//Set Correct answer section
|
30
|
-
labelsLabel: () => cy.get('.label-header'),
|
31
|
-
unsortedColumnLabel: () => cy.get('.text-label').eq(0),
|
32
|
-
sortedColumnLabel: () => cy.get('.text-label').eq(1),
|
33
|
-
unsortedColumnInputField: () => cy.get('.short-text-response-input-field input').eq(0),
|
34
|
-
sortedColumnInputField: () => cy.get('.short-text-response-input-field input').eq(1),
|
35
|
-
setCorrectAnswerSectionUnsortedColumnHeader: () => cy.get('[class*="SourceColumnHeader"]'),
|
36
|
-
setCorrectAnswerSectionSortedColumnHeader: () => cy.get('[class*="TargetColumnHeader"]'),
|
37
|
-
previewTabUnsortedColumnHeader: () => cy.get('.edit-question-preview-wrapper [class*="SourceColumnHeader"]'),
|
38
|
-
previewTabSortedColumnHeader: () => cy.get('.edit-question-preview-wrapper [class*="TargetColumnHeader"]'),
|
39
|
-
setCorrectAnswerSectionButtonLeftArrow: () => cy.get('.icon-arrow-button-left'),
|
40
|
-
setCorrectAnswerSectionButtonRightArrow: () => cy.get('.icon-arrow-button-right'),
|
41
|
-
previewTabButtonLeftArrow: () => cy.get('.edit-question-preview-wrapper .icon-arrow-button-left'),
|
42
|
-
previewTabButtonRightArrow: () => cy.get('.edit-question-preview-wrapper .icon-arrow-button-right'),
|
43
|
-
//Additional Settings
|
44
|
-
setCorrectAnswerSectionTopLabel: () => cy.get('[class*="__TopLabel-"]'),
|
45
|
-
setCorrectAnswerSectionBottomLabel: () => cy.get('[class*="__BottomLabel-"]'),
|
46
|
-
previewTabTopLabel: () => cy.get('.edit-question-preview-wrapper [class*="__TopLabel-"]'),
|
47
|
-
previewTabBottomLabel: () => cy.get('.edit-question-preview-wrapper [class*="__BottomLabel-"]'),
|
48
|
-
optionStyleNumeration: () => cy.get('[class*="OptionIndexWrapper"]')
|
49
|
-
}
|
50
|
-
|
51
|
-
const steps = {
|
52
|
-
...createQuestionBasePage.steps,
|
53
|
-
...questionInstructionsComponent.steps,
|
54
|
-
...optionsWrapperComponent.steps,
|
55
|
-
...scoringSectionBase.steps,
|
56
|
-
...autoScoredSetCorrectAnswerSection.steps,
|
57
|
-
...commonComponents.steps,
|
58
|
-
...ckEditorToolbar.steps,
|
59
|
-
...equationEditorFlyout.steps,
|
60
|
-
...listSortingAndOrderingBase.steps,
|
61
|
-
...previewScoringAndShowCorrectAnswerComponent.steps,
|
62
|
-
...autoScoredScoringSection.steps,
|
63
|
-
...additionalSettingsPanel.steps,
|
64
|
-
...autoScoredAdditionalSettings.steps,
|
65
|
-
...autoScoredPreviewBase.steps,
|
66
|
-
...autoScoredScoringSectionMultipleResponsesType.steps,
|
67
|
-
...answerNumerationComponent.steps,
|
68
|
-
/**
|
69
|
-
* @param {number} index set correct answer option index
|
70
|
-
* @description this function verfies contents of options
|
71
|
-
*/
|
72
|
-
verifyDragHandleButtonOfOptionInSetCorrectAnswerSection: (index) => {
|
73
|
-
listSortingPage.setCorrectAnswerSectionOption()
|
74
|
-
.eq(index)
|
75
|
-
.within(() => {
|
76
|
-
listSortingPage.dragHandleButton()
|
77
|
-
.should('exist');
|
78
|
-
});
|
79
|
-
},
|
80
|
-
|
81
|
-
/**
|
82
|
-
* @param {string[]} optionsTextArray options array for set correct answer option
|
83
|
-
* @description this function verifies options text content
|
84
|
-
*/
|
85
|
-
verifySourceOptionsTextContentInSetCorrectAnswerSection: (optionsTextArray) => {
|
86
|
-
optionsTextArray.forEach((optionsText, index) => {
|
87
|
-
listSortingPage.setCorrectAnswerSectionSourceOptionWrapper()
|
88
|
-
.eq(index)
|
89
|
-
.verifyInnerText(optionsText);
|
90
|
-
});
|
91
|
-
},
|
92
|
-
|
93
|
-
/**
|
94
|
-
* @param {string[]} optionsTextArray options array for set correct answer option
|
95
|
-
* @description this function verifies options text content
|
96
|
-
*/
|
97
|
-
verifyTargetOptionsTextContentInSetCorrectAnswerSection: (optionsTextArray) => {
|
98
|
-
optionsTextArray.forEach((optionsText, index) => {
|
99
|
-
listSortingPage.setCorrectAnswerSectionTargetOptionWrapper()
|
100
|
-
.eq(index)
|
101
|
-
.verifyInnerText(optionsText);
|
102
|
-
});
|
103
|
-
},
|
104
|
-
|
105
|
-
/**
|
106
|
-
* @param {string} optionsText text content of the option
|
107
|
-
* @param {number} targetIndex the position at which the options is being dropped in the target section
|
108
|
-
* @description click and drop a option into a position in the set correct answer section
|
109
|
-
*/
|
110
|
-
clickAndDropOptionFromSourceToTargetInSetCorrectAnswerSection: (optionsText, targetIndex) => {
|
111
|
-
listSortingPage.setCorrectAnswerSectionSourceOptionWrapper()
|
112
|
-
.contains(optionsText)
|
113
|
-
.click();
|
114
|
-
listSortingPage.setCorrectAnswerSectionTargetOptionWrapper()
|
115
|
-
.eq(targetIndex)
|
116
|
-
.click();
|
117
|
-
},
|
118
|
-
|
119
|
-
/**
|
120
|
-
* @param {string} optionsText text content of the option
|
121
|
-
* @param {number} sourceIndex the position at which the options is being dropped in the source section
|
122
|
-
* @description click and drop a option into a position in the set correct answer section
|
123
|
-
*/
|
124
|
-
clickAndDropOptionFromTargetToSourceInSetCorrectAnswerSection: (optionsText, sourceIndex) => {
|
125
|
-
listSortingPage.setCorrectAnswerSectionTargetOptionWrapper()
|
126
|
-
.contains(optionsText)
|
127
|
-
.click();
|
128
|
-
listSortingPage.setCorrectAnswerSectionSourceOptionWrapper()
|
129
|
-
.eq(sourceIndex)
|
130
|
-
.click();
|
131
|
-
},
|
132
|
-
|
133
|
-
/**
|
134
|
-
* @param {number} sourceIndex index of the source option wrapper
|
135
|
-
* @param {number} targetIndex index of the target option wrapper
|
136
|
-
* @description click and drop a option into a position in the set correct answer section
|
137
|
-
*/
|
138
|
-
clickAndDropOptionFromSourceIndexToTargetIndexInSetCorrectAnswerSection: (sourceIndex, targetIndex) => {
|
139
|
-
listSortingPage.setCorrectAnswerSectionSourceOptionWrapper()
|
140
|
-
.eq(sourceIndex)
|
141
|
-
.click();
|
142
|
-
listSortingPage.setCorrectAnswerSectionTargetOptionWrapper()
|
143
|
-
.eq(targetIndex)
|
144
|
-
.click();
|
145
|
-
},
|
146
|
-
|
147
|
-
/**
|
148
|
-
* @param {number} index of option
|
149
|
-
* @description this function verifies image in set correct answer option input field
|
150
|
-
*/
|
151
|
-
verifyImageOptionInSetCorrectAnswerSection: (index) => {
|
152
|
-
listSortingPage.setCorrectAnswerSectionOption()
|
153
|
-
.eq(index)
|
154
|
-
.find('img')
|
155
|
-
.should('have.attr', 'src', constants.foxImageLink)
|
156
|
-
.and('have.attr', 'alt', constants.foxImageAltText);
|
157
|
-
},
|
158
|
-
|
159
|
-
/**
|
160
|
-
* @param {number} index of option
|
161
|
-
* @description this function verifies equation in set correct answer option input field
|
162
|
-
*/
|
163
|
-
verifyEquationOptionInSetCorrectAnswerSection: (index) => {
|
164
|
-
listSortingPage.setCorrectAnswerSectionOption()
|
165
|
-
.eq(index)
|
166
|
-
.contains(constants.CKEditorInputFieldEnteredEquationText)
|
167
|
-
listSortingPage.setCorrectAnswerSectionOption()
|
168
|
-
.find('[role="math"]')
|
169
|
-
.should('have.attr', 'aria-label', constants.CKEditorInputFieldEnteredEquationAriaLabel)
|
170
|
-
},
|
171
|
-
|
172
|
-
/**
|
173
|
-
* @param {number} index of option
|
174
|
-
* @description this function link in set correct answer option input field
|
175
|
-
*/
|
176
|
-
verifyLinkOptionInSetCorrectAnswerSection: (index) => {
|
177
|
-
listSortingPage.setCorrectAnswerSectionOption()
|
178
|
-
.eq(index)
|
179
|
-
.should('have.text', 'lorem')
|
180
|
-
.find('a')
|
181
|
-
.should('have.attr', 'href', `${Cypress.config().baseUrl}`)
|
182
|
-
},
|
183
|
-
|
184
|
-
/**
|
185
|
-
* @param {number} index of option
|
186
|
-
* @description this function bold text in set correct answer option input field
|
187
|
-
*/
|
188
|
-
verifyBoldTextOptionInSetCorrectAnswerSection: (index) => {
|
189
|
-
listSortingPage.setCorrectAnswerSectionOption()
|
190
|
-
.eq(index)
|
191
|
-
.find('strong')
|
192
|
-
.eq(0)
|
193
|
-
.should('have.text', 'This is a bold option');
|
194
|
-
},
|
195
|
-
|
196
|
-
verifyImageEquationLinkBoldTextInSetCorrectAnswerSectionSourceOption: () => {
|
197
|
-
listSortingPage.setCorrectAnswerSectionSourceOptionWrapper()
|
198
|
-
.eq(0)
|
199
|
-
.parents('[class*="ListSortingResponsestyles__ContextWrapper"]')
|
200
|
-
.within(() => {
|
201
|
-
steps.verifyImageOptionInSetCorrectAnswerSection(0)
|
202
|
-
steps.verifyEquationOptionInSetCorrectAnswerSection(1)
|
203
|
-
steps.verifyLinkOptionInSetCorrectAnswerSection(2)
|
204
|
-
steps.verifyBoldTextOptionInSetCorrectAnswerSection(3)
|
205
|
-
});
|
206
|
-
},
|
207
|
-
|
208
|
-
verifyImageEquationLinkBoldTextInSetCorrectAnswerSectionTargetOption: () => {
|
209
|
-
listSortingPage.setCorrectAnswerSectionTargetOptionWrapper()
|
210
|
-
.eq(0)
|
211
|
-
.parents('[class*="ListSortingResponsestyles__ContextWrapper"]')
|
212
|
-
.within(() => {
|
213
|
-
steps.verifyImageOptionInSetCorrectAnswerSection(0)
|
214
|
-
steps.verifyEquationOptionInSetCorrectAnswerSection(1)
|
215
|
-
steps.verifyLinkOptionInSetCorrectAnswerSection(2)
|
216
|
-
steps.verifyBoldTextOptionInSetCorrectAnswerSection(3)
|
217
|
-
});
|
218
|
-
},
|
219
|
-
|
220
|
-
verifyDefaultAndActiveStateOfOptionInSetCorrectAnswerSection: () => {
|
221
|
-
listSortingPage.setCorrectAnswerSectionOption()
|
222
|
-
.eq(0)
|
223
|
-
.realHover()
|
224
|
-
.should('have.css', 'border', `2px solid ${css.color.activeButtons}`)
|
225
|
-
.find('.question-text-wrapper')
|
226
|
-
.and('have.css', 'color', css.color.activeButtons);
|
227
|
-
listSortingPage.setCorrectAnswerSectionOption()
|
228
|
-
.eq(0)
|
229
|
-
.realHover({ position: 'topLeft' })
|
230
|
-
.should('have.css', 'border', `1px solid ${css.color.figDefaultComponentBorder}`);
|
231
|
-
},
|
232
|
-
|
233
|
-
//Preview tab
|
234
|
-
/**
|
235
|
-
* @param {number} index set correct answer option index
|
236
|
-
* @description this function verfies contents of options
|
237
|
-
*/
|
238
|
-
verifyDragHandleButtonOfOptionInPreviewTab: (index) => {
|
239
|
-
listSortingPage.previewTabOption()
|
240
|
-
.eq(index)
|
241
|
-
.within(() => {
|
242
|
-
listSortingPage.dragHandleButton()
|
243
|
-
.should('exist');
|
244
|
-
});
|
245
|
-
},
|
246
|
-
|
247
|
-
|
248
|
-
/**
|
249
|
-
* @param {string[]} optionsTextArray options array for set correct answer option
|
250
|
-
* @description this function verifies options text content
|
251
|
-
*/
|
252
|
-
verifySourceOptionsTextContentInPreviewTab: (optionsTextArray) => {
|
253
|
-
optionsTextArray.forEach((optionsText, index) => {
|
254
|
-
listSortingPage.previewTabSourceOptionWrapper()
|
255
|
-
.eq(index)
|
256
|
-
.verifyInnerText(optionsText);
|
257
|
-
});
|
258
|
-
},
|
259
|
-
|
260
|
-
/**
|
261
|
-
* @param {string[]} optionsTextArray options array for set correct answer option
|
262
|
-
* @description this function verifies options text content
|
263
|
-
*/
|
264
|
-
verifyTargetOptionsTextContentInPreviewTab: (optionsTextArray) => {
|
265
|
-
optionsTextArray.forEach((optionsText, index) => {
|
266
|
-
listSortingPage.previewTabTargetOptionWrapper()
|
267
|
-
.eq(index)
|
268
|
-
.verifyInnerText(optionsText);
|
269
|
-
});
|
270
|
-
},
|
271
|
-
|
272
|
-
/**
|
273
|
-
* @param {string} optionsText text content of the option
|
274
|
-
* @param {number} targetIndex the position at which the options is being dropped in the target section
|
275
|
-
* @description click and drop a option into a position in the previewTab
|
276
|
-
*/
|
277
|
-
clickAndDropOptionFromSourceToTargetInPreviewTab: (optionsText, targetIndex) => {
|
278
|
-
listSortingPage.previewTabSourceOptionWrapper()
|
279
|
-
.contains(optionsText)
|
280
|
-
.click();
|
281
|
-
listSortingPage.previewTabTargetOptionWrapper()
|
282
|
-
.eq(targetIndex)
|
283
|
-
.click();
|
284
|
-
},
|
285
|
-
|
286
|
-
/**
|
287
|
-
* @param {string} optionsText text content of the option
|
288
|
-
* @param {number} sourceIndex the position at which the options is being dropped in the source section
|
289
|
-
* @description click and drop a option into a position in the set correct answer section
|
290
|
-
*/
|
291
|
-
clickAndDropOptionFromTargetToSourceInPreviewTab: (optionsText, sourceIndex) => {
|
292
|
-
listSortingPage.previewTabTargetOptionWrapper()
|
293
|
-
.contains(optionsText)
|
294
|
-
.click();
|
295
|
-
listSortingPage.previewTabSourceOptionWrapper()
|
296
|
-
.eq(sourceIndex)
|
297
|
-
.click();
|
298
|
-
},
|
299
|
-
|
300
|
-
/**
|
301
|
-
* @param {number} sourceIndex index of the source option wrapper
|
302
|
-
* @param {number} targetIndex index of the target option wrapper
|
303
|
-
* @description click and drop a option into a position in the previewTab
|
304
|
-
*/
|
305
|
-
clickAndDropOptionFromSourceIndexToTargetIndexInPreviewTab: (sourceIndex, targetIndex) => {
|
306
|
-
listSortingPage.previewTabSourceOptionWrapper()
|
307
|
-
.eq(sourceIndex)
|
308
|
-
.click();
|
309
|
-
listSortingPage.previewTabTargetOptionWrapper()
|
310
|
-
.eq(targetIndex)
|
311
|
-
.click();
|
312
|
-
},
|
313
|
-
|
314
|
-
verifyImageEquationLinkBoldTextInPreviewTabSourceOption: () => {
|
315
|
-
listSortingPage.previewTabSourceOptionWrapper()
|
316
|
-
.eq(0)
|
317
|
-
.parents('[class*="ListSortingResponsestyles__ContextWrapper"]')
|
318
|
-
.within(() => {
|
319
|
-
steps.verifyImageOptionInSetCorrectAnswerSection(0)
|
320
|
-
steps.verifyEquationOptionInSetCorrectAnswerSection(1)
|
321
|
-
steps.verifyLinkOptionInSetCorrectAnswerSection(2)
|
322
|
-
steps.verifyBoldTextOptionInSetCorrectAnswerSection(3)
|
323
|
-
});
|
324
|
-
},
|
325
|
-
|
326
|
-
verifyImageEquationLinkBoldTextInPreviewTabTargetOption: () => {
|
327
|
-
listSortingPage.previewTabTargetOptionWrapper()
|
328
|
-
.eq(0)
|
329
|
-
.parents('[class*="ListSortingResponsestyles__ContextWrapper"]')
|
330
|
-
.within(() => {
|
331
|
-
steps.verifyImageOptionInSetCorrectAnswerSection(0)
|
332
|
-
steps.verifyEquationOptionInSetCorrectAnswerSection(1)
|
333
|
-
steps.verifyLinkOptionInSetCorrectAnswerSection(2)
|
334
|
-
steps.verifyBoldTextOptionInSetCorrectAnswerSection(3)
|
335
|
-
});
|
336
|
-
},
|
337
|
-
|
338
|
-
verifyDefaultAndActiveStateOfOptionInPreviewTab: () => {
|
339
|
-
listSortingPage.previewTabOption()
|
340
|
-
.eq(0)
|
341
|
-
.realHover()
|
342
|
-
.should('have.css', 'border', `2px solid ${css.color.activeButtons}`)
|
343
|
-
.find('.question-text-wrapper')
|
344
|
-
.and('have.css', 'color', css.color.activeButtons);
|
345
|
-
listSortingPage.previewTabOption()
|
346
|
-
.eq(0)
|
347
|
-
.realHover({ position: 'topLeft' })
|
348
|
-
.should('have.css', 'border', `1px solid ${css.color.figDefaultComponentBorder}`);
|
349
|
-
},
|
350
|
-
|
351
|
-
/**
|
352
|
-
* @param {string} optionsText option to be checked for the correct icon
|
353
|
-
* @description This function verifies the correct icon in the preview tab
|
354
|
-
*/
|
355
|
-
verifyCorrectOptionsCheckmarkIcon: (optionsText) => {
|
356
|
-
listSortingPage.previewTabTargetOptionWrapper()
|
357
|
-
.contains(optionsText)
|
358
|
-
.parents('[class*="ListSortingResponsestyles__TargetWrapper"]')
|
359
|
-
.within(() => {
|
360
|
-
autoScoredPreviewBase.correctIcon()
|
361
|
-
.and('be.visible');
|
362
|
-
});
|
363
|
-
},
|
364
|
-
|
365
|
-
/**
|
366
|
-
* @param {string} optionsText option to be checked for the correct icon
|
367
|
-
* @description This function verifies the correct icon in the preview tab
|
368
|
-
*/
|
369
|
-
verifyIncorrectOptionsCrossmarkIcon: (optionsText) => {
|
370
|
-
listSortingPage.previewTabTargetOptionWrapper()
|
371
|
-
.contains(optionsText)
|
372
|
-
.parents('[class*="ListSortingResponsestyles__TargetWrapper"]')
|
373
|
-
.within(() => {
|
374
|
-
autoScoredPreviewBase.incorrectIcon()
|
375
|
-
.and('be.visible');
|
376
|
-
});
|
377
|
-
},
|
378
|
-
|
379
|
-
/**
|
380
|
-
* @param {number[]} pointsArray the array of points to be alloted to each option
|
381
|
-
* @description this function allots points to all the options
|
382
|
-
*/
|
383
|
-
allotPartialDifferentWeightsToAllPointsFields: (pointsArray) => {
|
384
|
-
pointsArray.forEach((points, optionIndex) => {
|
385
|
-
scoringSectionBase.pointsInputField()
|
386
|
-
.eq(optionIndex)
|
387
|
-
.clear()
|
388
|
-
.type(points, { delay: 0 })
|
389
|
-
.should('have.value', points);
|
390
|
-
});
|
391
|
-
},
|
392
|
-
|
393
|
-
verifyPartialDifferentWeightsPointsInputFieldIsEmptyAndEnabled: () => {
|
394
|
-
scoringSectionBase.pointsInputField()
|
395
|
-
.each(($element) => {
|
396
|
-
cy.wrap($element)
|
397
|
-
.should('have.value', '')
|
398
|
-
.and('be.visible')
|
399
|
-
.and('be.enabled');
|
400
|
-
});
|
401
|
-
},
|
402
|
-
|
403
|
-
/**
|
404
|
-
* @param {number} points points displayed in partial equal weights points per response
|
405
|
-
* @description Verify points displayed in partial equal weights points per response
|
406
|
-
*/
|
407
|
-
verifyPartialEqualWeightsPointsPerResponseScore: (points) => {
|
408
|
-
listSortingPage.partialEqualWeightsPointsPerResponseScore()
|
409
|
-
.each(($element) => {
|
410
|
-
cy.wrap($element)
|
411
|
-
.verifyInnerText(`${points}`);
|
412
|
-
});
|
413
|
-
},
|
414
|
-
|
415
|
-
verifyPointsInputFieldErrorMessage: () => {
|
416
|
-
commonComponents.errorMessage()
|
417
|
-
.eq(0)
|
418
|
-
.should('have.text', 'Error: Please enter points.');
|
419
|
-
},
|
420
|
-
|
421
|
-
verifySetCorrectAnswerErrorMessage: () => {
|
422
|
-
commonComponents.errorMessage()
|
423
|
-
.eq(1)
|
424
|
-
.should('have.text', 'Error: Please set a correct answer.');
|
425
|
-
},
|
426
|
-
|
427
|
-
clearUnsortedColumnInputField: () => {
|
428
|
-
listSortingPage.unsortedColumnInputField()
|
429
|
-
.clear();
|
430
|
-
},
|
431
|
-
|
432
|
-
clearSortedColumnInputField: () => {
|
433
|
-
listSortingPage.sortedColumnInputField()
|
434
|
-
.clear();
|
435
|
-
},
|
436
|
-
|
437
|
-
verifyUnsortedColumnInputFieldErrorMessage: () => {
|
438
|
-
listSortingPage.unsortedColumnInputField()
|
439
|
-
.parents('[class*="ListSortingstyle__InputFieldWrapper"]')
|
440
|
-
.within(() => {
|
441
|
-
commonComponents.errorMessage()
|
442
|
-
.verifyInnerText('Error: Please enter label.')
|
443
|
-
});
|
444
|
-
},
|
445
|
-
|
446
|
-
verifySortedColumnInputFieldErrorMessage: () => {
|
447
|
-
listSortingPage.sortedColumnInputField()
|
448
|
-
.parents('[class*="ListSortingstyle__InputFieldWrapper"]')
|
449
|
-
.within(() => {
|
450
|
-
commonComponents.errorMessage()
|
451
|
-
.verifyInnerText('Error: Please enter label.')
|
452
|
-
});
|
453
|
-
},
|
454
|
-
|
455
|
-
addInputToUnsortedColumnInputField: (inputText) => {
|
456
|
-
listSortingPage.unsortedColumnInputField()
|
457
|
-
.type(inputText)
|
458
|
-
.should('have.value', inputText);
|
459
|
-
},
|
460
|
-
|
461
|
-
addInputToSortedColumnInputField: (inputText) => {
|
462
|
-
listSortingPage.sortedColumnInputField()
|
463
|
-
.type(inputText)
|
464
|
-
.should('have.value', inputText);
|
465
|
-
},
|
466
|
-
|
467
|
-
verifyUnsortedColumnInputField: (inputText) => {
|
468
|
-
listSortingPage.unsortedColumnInputField()
|
469
|
-
.should('have.value', inputText);
|
470
|
-
},
|
471
|
-
|
472
|
-
verifySortedColumnInputField: (inputText) => {
|
473
|
-
listSortingPage.sortedColumnInputField()
|
474
|
-
.should('have.value', inputText);
|
475
|
-
},
|
476
|
-
|
477
|
-
getOptionsArray: () => {
|
478
|
-
const optionsArray = []
|
479
|
-
listSortingPage.previewTabOption()
|
480
|
-
.each(($el) => {
|
481
|
-
cy.wrap($el)
|
482
|
-
.invoke('text')
|
483
|
-
.then((text) => {
|
484
|
-
optionsArray.push(text);
|
485
|
-
});
|
486
|
-
});
|
487
|
-
return optionsArray;
|
488
|
-
},
|
489
|
-
|
490
|
-
/**
|
491
|
-
* @param {string[]} optionsArray array of options set in the options section
|
492
|
-
* @description this function verifies if the options are Randomized in the preview tab
|
493
|
-
*/
|
494
|
-
verifyRandomizeOptionOrder: (optionsArray) => {
|
495
|
-
let currentOptionsArray = [...optionsArray]
|
496
|
-
for (let index = 0; index < currentOptionsArray.length; index++) {
|
497
|
-
listSortingPage.previewTabOption()
|
498
|
-
.eq(index)
|
499
|
-
.then(($element) => {
|
500
|
-
expect($element.text()).to.be.oneOf(currentOptionsArray);
|
501
|
-
currentOptionsArray = currentOptionsArray.filter((value) => value !== $element.text())
|
502
|
-
});
|
503
|
-
};
|
504
|
-
listSortingPage.steps.verifyOptionsAreRerandomized(optionsArray)
|
505
|
-
},
|
506
|
-
|
507
|
-
/**
|
508
|
-
* @param {string[]} previousOrderOfOptionsArray array of previous order of options
|
509
|
-
* @description this function verifies that the order of the options is different from the previous order
|
510
|
-
*/
|
511
|
-
verifyOptionsAreRerandomized: (previousOrderOfOptionsArray) => {
|
512
|
-
listSortingPage.previewTabOption()
|
513
|
-
.should('not.have.text', '')
|
514
|
-
.and('not.have.text', previousOrderOfOptionsArray.join(''));
|
515
|
-
},
|
516
|
-
|
517
|
-
/**
|
518
|
-
* @param {number} index set correct answer option index
|
519
|
-
* @description this function verfies drag handle of options does not exist
|
520
|
-
*/
|
521
|
-
verifyDragHandleButtonDoesNotExistInSetCorrectAnswerSection: (index) => {
|
522
|
-
listSortingPage.setCorrectAnswerSectionOption()
|
523
|
-
.eq(index)
|
524
|
-
.within(() => {
|
525
|
-
commonComponents.dragHandleButton()
|
526
|
-
.should('not.exist');
|
527
|
-
});
|
528
|
-
},
|
529
|
-
|
530
|
-
/**
|
531
|
-
* @param {number} index set correct answer option index
|
532
|
-
* @description this function verfies drag handle of options does not exist
|
533
|
-
*/
|
534
|
-
verifyDragHandleButtonDoesNotExistInPreviewTab: (index) => {
|
535
|
-
listSortingPage.previewTabOption()
|
536
|
-
.eq(index)
|
537
|
-
.within(() => {
|
538
|
-
commonComponents.dragHandleButton()
|
539
|
-
.should('not.exist');
|
540
|
-
});
|
541
|
-
},
|
542
|
-
|
543
|
-
//Click and drop
|
544
|
-
//Need to update functions once - https://redmine.zeuslearning.com/issues/541167 is resolved
|
545
|
-
/**
|
546
|
-
* @param {number} index of the source option
|
547
|
-
* @description this function verifies if the option is active or inactive
|
548
|
-
*/
|
549
|
-
verifyActiveStateOfSourceOptionWrapperSetCorrectAnswerSection: (index) => {
|
550
|
-
listSortingPage.setCorrectAnswerSectionSourceOptionWrapper()
|
551
|
-
.eq(index)
|
552
|
-
.should('have.class', 'isActive')
|
553
|
-
.find('[class*="DroppableWrapper"]')
|
554
|
-
.should('have.attr', 'tabindex', '0')
|
555
|
-
},
|
556
|
-
|
557
|
-
/**
|
558
|
-
* @param {number} index of the source option
|
559
|
-
* @description this function verifies if the option is active or inactive
|
560
|
-
*/
|
561
|
-
verifyActiveStateOfTargetOptionWrapperSetCorrectAnswerSection: (index) => {
|
562
|
-
listSortingPage.setCorrectAnswerSectionTargetOptionWrapper()
|
563
|
-
.eq(index)
|
564
|
-
.should('have.class', 'isActive')
|
565
|
-
.find('[class*="DroppableWrapper"]')
|
566
|
-
.should('have.attr', 'tabindex', '0')
|
567
|
-
},
|
568
|
-
|
569
|
-
/**
|
570
|
-
* @param {number} index of the source option
|
571
|
-
* @description this function verifies if the option is active or inactive
|
572
|
-
*/
|
573
|
-
verifyInactiveStateOfSourceOptionWrapperSetCorrectAnswerSection: (index) => {
|
574
|
-
listSortingPage.setCorrectAnswerSectionSourceOptionWrapper()
|
575
|
-
.eq(index)
|
576
|
-
.find('[class*="DroppableWrapper"]')
|
577
|
-
.should('have.attr', 'tabindex', '-1')
|
578
|
-
},
|
579
|
-
|
580
|
-
/**
|
581
|
-
* @param {number} index of the source option
|
582
|
-
* @description this function verifies if the option is active or inactive
|
583
|
-
*/
|
584
|
-
verifyInactiveStateOfTargetOptionWrapperSetCorrectAnswerSection: (index) => {
|
585
|
-
listSortingPage.setCorrectAnswerSectionTargetOptionWrapper()
|
586
|
-
.eq(index)
|
587
|
-
.find('[class*="DroppableWrapper"]')
|
588
|
-
.should('have.attr', 'tabindex', '-1')
|
589
|
-
},
|
590
|
-
|
591
|
-
/**
|
592
|
-
* @param {number} index of the source option
|
593
|
-
* @description verify inactive state of source option
|
594
|
-
*/
|
595
|
-
verifyInactiveStateOfSourceOptionWrapperPreviewTab: (index) => {
|
596
|
-
listSortingPage.previewTabSourceOptionWrapper()
|
597
|
-
.eq(index)
|
598
|
-
.find('[class*="DroppableWrapper"]')
|
599
|
-
.should('have.attr', 'tabindex', '-1');
|
600
|
-
},
|
601
|
-
|
602
|
-
/**
|
603
|
-
* @param {number} index of the source option
|
604
|
-
* @description verify inactive state of target option
|
605
|
-
*/
|
606
|
-
verifyInactiveStateOfTargetOptionWrapperPreviewTab: (index) => {
|
607
|
-
listSortingPage.previewTabTargetOptionWrapper()
|
608
|
-
.eq(index)
|
609
|
-
.find('[class*="DroppableWrapper"]')
|
610
|
-
.should('have.attr', 'tabindex', '-1');
|
611
|
-
},
|
612
|
-
|
613
|
-
/**
|
614
|
-
* @param {number} index of the source option
|
615
|
-
* @description verify active state of source option
|
616
|
-
*/
|
617
|
-
verifyActiveStateOfSourceOptionWrapperPreviewTab: (index) => {
|
618
|
-
listSortingPage.previewTabSourceOptionWrapper()
|
619
|
-
.eq(index)
|
620
|
-
.should('have.class', 'isActive')
|
621
|
-
.find('[class*="DroppableWrapper"]')
|
622
|
-
.should('have.attr', 'tabindex', '0');
|
623
|
-
},
|
624
|
-
|
625
|
-
/**
|
626
|
-
* @param {number} index of the source option
|
627
|
-
* @description verify active state of target option
|
628
|
-
*/
|
629
|
-
verifyActiveStateOfTargetOptionWrapperPreviewTab: (index) => {
|
630
|
-
listSortingPage.previewTabTargetOptionWrapper()
|
631
|
-
.eq(index)
|
632
|
-
.should('have.class', 'isActive')
|
633
|
-
.find('[class*="DroppableWrapper"]')
|
634
|
-
.should('have.attr', 'tabindex', '0');
|
635
|
-
},
|
636
|
-
|
637
|
-
/**
|
638
|
-
* @param index of set correct answer section option
|
639
|
-
* @description This function selects an option from set correct answer section
|
640
|
-
*/
|
641
|
-
selectSourceOptionSetCorrectAnswerSection: (index) => {
|
642
|
-
listSortingPage.setCorrectAnswerSectionSourceOptionWrapper()
|
643
|
-
.eq(index)
|
644
|
-
.click();
|
645
|
-
},
|
646
|
-
|
647
|
-
/**
|
648
|
-
* @param index of set correct answer section option
|
649
|
-
* @description This function selects an option from set correct answer section
|
650
|
-
*/
|
651
|
-
selectTargetOptionSetCorrectAnswerSection: (index) => {
|
652
|
-
listSortingPage.setCorrectAnswerSectionTargetOptionWrapper()
|
653
|
-
.eq(index)
|
654
|
-
.click();
|
655
|
-
},
|
656
|
-
|
657
|
-
/**
|
658
|
-
* @param {number} index of set correct answer section option
|
659
|
-
* @description this function verifies active state of source option wrapper
|
660
|
-
*/
|
661
|
-
verifyActiveStateOfSourceOptionSetCorrectAnswerSection: (index) => {
|
662
|
-
listSortingPage.setCorrectAnswerSectionSourceOptionWrapper()
|
663
|
-
.eq(index)
|
664
|
-
.within(() => {
|
665
|
-
listSortingPage.setCorrectAnswerSectionOption()
|
666
|
-
.should('have.class', 'isSelected')
|
667
|
-
.should('have.css', 'border')
|
668
|
-
.and('match', /2px solid/)
|
669
|
-
});
|
670
|
-
listSortingPage.setCorrectAnswerSectionSourceOptionWrapper()
|
671
|
-
.eq(index)
|
672
|
-
.within(() => {
|
673
|
-
listSortingPage.setCorrectAnswerSectionOption()
|
674
|
-
.within(() => {
|
675
|
-
listSortingPage.dragHandleButton()
|
676
|
-
.find('svg')
|
677
|
-
.should('have.css', 'border')
|
678
|
-
.and('match', /2px solid/)
|
679
|
-
});
|
680
|
-
});
|
681
|
-
},
|
682
|
-
|
683
|
-
/**
|
684
|
-
* @param {number} index of set correct answer section option
|
685
|
-
* @description this function verifies active state of target option wrapper
|
686
|
-
*/
|
687
|
-
verifyActiveStateOfTargetOptionSetCorrectAnswerSection: (index) => {
|
688
|
-
listSortingPage.setCorrectAnswerSectionTargetOptionWrapper()
|
689
|
-
.eq(index)
|
690
|
-
.within(() => {
|
691
|
-
listSortingPage.setCorrectAnswerSectionOption()
|
692
|
-
.eq(index)
|
693
|
-
.should('have.class', 'isSelected')
|
694
|
-
.should('have.css', 'border')
|
695
|
-
.and('match', /2px solid/)
|
696
|
-
});
|
697
|
-
listSortingPage.setCorrectAnswerSectionTargetOptionWrapper()
|
698
|
-
.eq(index)
|
699
|
-
.within(() => {
|
700
|
-
listSortingPage.setCorrectAnswerSectionOption()
|
701
|
-
.within(() => {
|
702
|
-
listSortingPage.dragHandleButton()
|
703
|
-
.find('svg')
|
704
|
-
.should('have.css', 'border')
|
705
|
-
.and('match', /2px solid/)
|
706
|
-
});
|
707
|
-
});
|
708
|
-
},
|
709
|
-
|
710
|
-
/**
|
711
|
-
* @param {number} index of set correct answer section option
|
712
|
-
* @description this function verifies inactive state of source option wrapper
|
713
|
-
*/
|
714
|
-
verifyInactiveStateOfSourceOptionSetCorrectAnswerSection: (index) => {
|
715
|
-
listSortingPage.setCorrectAnswerSectionSourceOptionWrapper()
|
716
|
-
.eq(index)
|
717
|
-
.within(() => {
|
718
|
-
listSortingPage.setCorrectAnswerSectionOption()
|
719
|
-
.should('not.have.class', 'isSelected')
|
720
|
-
.should('have.css', 'border', `1px solid ${css.color.figDefaultComponentBorder}`)
|
721
|
-
.within(() => {
|
722
|
-
listSortingPage.dragHandleButton()
|
723
|
-
.find('svg')
|
724
|
-
.should('have.css', 'border')
|
725
|
-
.and('match', /0px none/);
|
726
|
-
});
|
727
|
-
});
|
728
|
-
},
|
729
|
-
|
730
|
-
/**
|
731
|
-
* @param index of preview tab option
|
732
|
-
* @description this function clicks on preview source wrapper
|
733
|
-
*/
|
734
|
-
selectSourceOptionPreviewTab: (index) => {
|
735
|
-
listSortingPage.previewTabSourceOptionWrapper()
|
736
|
-
.eq(index)
|
737
|
-
.click();
|
738
|
-
},
|
739
|
-
|
740
|
-
/**
|
741
|
-
* @param index of preview tab option
|
742
|
-
* @description this function clicks on preview target wrapper
|
743
|
-
*/
|
744
|
-
selectTargetOptionPreviewTab: (index) => {
|
745
|
-
listSortingPage.previewTabTargetOptionWrapper()
|
746
|
-
.eq(index)
|
747
|
-
.click();
|
748
|
-
},
|
749
|
-
|
750
|
-
/**
|
751
|
-
* @param {number} index of preview tab option
|
752
|
-
* @description this function verifies active state of source wrapper
|
753
|
-
*/
|
754
|
-
verifyActiveStateOfSourceOptionPreviewTab: (index) => {
|
755
|
-
listSortingPage.previewTabSourceOptionWrapper()
|
756
|
-
.eq(index)
|
757
|
-
.within(() => {
|
758
|
-
listSortingPage.setCorrectAnswerSectionOption()
|
759
|
-
.should('have.class', 'isSelected')
|
760
|
-
.should('have.css', 'border')
|
761
|
-
.and('match', /2px solid/)
|
762
|
-
});
|
763
|
-
listSortingPage.previewTabSourceOptionWrapper()
|
764
|
-
.eq(index)
|
765
|
-
.within(() => {
|
766
|
-
listSortingPage.setCorrectAnswerSectionOption()
|
767
|
-
.within(() => {
|
768
|
-
listSortingPage.dragHandleButton()
|
769
|
-
.find('svg')
|
770
|
-
.should('have.css', 'border')
|
771
|
-
.and('match', /2px solid/);
|
772
|
-
});
|
773
|
-
});
|
774
|
-
},
|
775
|
-
|
776
|
-
/**
|
777
|
-
* @param {number} index of preview tab option
|
778
|
-
* @description this function verifies active state of target wrapper
|
779
|
-
*/
|
780
|
-
verifyActiveStateOfTargetOptionPreviewTab: (index) => {
|
781
|
-
listSortingPage.previewTabTargetOptionWrapper()
|
782
|
-
.eq(index)
|
783
|
-
.within(() => {
|
784
|
-
listSortingPage.setCorrectAnswerSectionOption()
|
785
|
-
.should('have.class', 'isSelected')
|
786
|
-
.should('have.css', 'border')
|
787
|
-
.and('match', /2px solid/)
|
788
|
-
});
|
789
|
-
listSortingPage.previewTabTargetOptionWrapper()
|
790
|
-
.eq(index)
|
791
|
-
.within(() => {
|
792
|
-
listSortingPage.dragHandleButton()
|
793
|
-
.find('svg')
|
794
|
-
.should('have.css', 'border')
|
795
|
-
.and('match', /2px solid/)
|
796
|
-
});
|
797
|
-
},
|
798
|
-
|
799
|
-
/**
|
800
|
-
* @param {number} index of preview tab option
|
801
|
-
* @description this function verifies inactive state of source wrapper
|
802
|
-
*/
|
803
|
-
verifyInactiveStateOfSourceOptionPreviewTab: (index) => {
|
804
|
-
listSortingPage.previewTabSourceOptionWrapper()
|
805
|
-
.eq(index)
|
806
|
-
.within(() => {
|
807
|
-
listSortingPage.setCorrectAnswerSectionOption()
|
808
|
-
.should('not.have.class', 'isSelected')
|
809
|
-
.should('have.css', 'border', `1px solid ${css.color.figDefaultComponentBorder}`)
|
810
|
-
.within(() => {
|
811
|
-
listSortingPage.dragHandleButton()
|
812
|
-
.find('svg')
|
813
|
-
.should('have.css', 'border')
|
814
|
-
.and('match', /0px none/);
|
815
|
-
});
|
816
|
-
});
|
817
|
-
},
|
818
|
-
|
819
|
-
clickOnRightArrowKeySetCorrectAnswerSection: () => {
|
820
|
-
listSortingPage.setCorrectAnswerSectionButtonRightArrow()
|
821
|
-
.click();
|
822
|
-
},
|
823
|
-
|
824
|
-
clickOnLeftArrowKeySetCorrectAnswerSection: () => {
|
825
|
-
listSortingPage.setCorrectAnswerSectionButtonLeftArrow()
|
826
|
-
.click();
|
827
|
-
},
|
828
|
-
|
829
|
-
clickOnRightArrowKeyPreviewTab: () => {
|
830
|
-
listSortingPage.previewTabButtonRightArrow()
|
831
|
-
.click();
|
832
|
-
},
|
833
|
-
|
834
|
-
clickOnLeftArrowKeyPreviewTab: () => {
|
835
|
-
listSortingPage.previewTabButtonLeftArrow()
|
836
|
-
.click();
|
837
|
-
},
|
838
|
-
|
839
|
-
verifyRightArrowEnabledSetCorrectAnswerSection: () => {
|
840
|
-
listSortingPage.setCorrectAnswerSectionButtonRightArrow()
|
841
|
-
.should('have.class', 'isActive');
|
842
|
-
},
|
843
|
-
|
844
|
-
verifyRightArrowDisabledSetCorrectAnswerSection: () => {
|
845
|
-
listSortingPage.setCorrectAnswerSectionButtonRightArrow()
|
846
|
-
.should('not.have.class', 'isActive');
|
847
|
-
},
|
848
|
-
|
849
|
-
verifyLeftArrowEnabledSetCorrectAnswerSection: () => {
|
850
|
-
listSortingPage.setCorrectAnswerSectionButtonLeftArrow()
|
851
|
-
.should('have.class', 'isActive');
|
852
|
-
},
|
853
|
-
|
854
|
-
verifyLeftArrowDisabledSetCorrectAnswerSection: () => {
|
855
|
-
listSortingPage.setCorrectAnswerSectionButtonLeftArrow()
|
856
|
-
.should('not.have.class', 'isActive');
|
857
|
-
},
|
858
|
-
|
859
|
-
verifyRightArrowEnabledPreviewTab: () => {
|
860
|
-
listSortingPage.previewTabButtonRightArrow()
|
861
|
-
.should('have.class', 'isActive');
|
862
|
-
},
|
863
|
-
|
864
|
-
verifyRightArrowDisabledPreviewTab: () => {
|
865
|
-
listSortingPage.previewTabButtonRightArrow()
|
866
|
-
.should('not.have.class', 'isActive');
|
867
|
-
},
|
868
|
-
|
869
|
-
verifyLeftArrowEnabledPreviewTab: () => {
|
870
|
-
listSortingPage.previewTabButtonLeftArrow()
|
871
|
-
.should('have.class', 'isActive');
|
872
|
-
},
|
873
|
-
|
874
|
-
verifyLeftArrowDisabledPreviewTab: () => {
|
875
|
-
listSortingPage.previewTabButtonLeftArrow()
|
876
|
-
.should('not.have.class', 'isActive');
|
877
|
-
},
|
878
|
-
|
879
|
-
/**
|
880
|
-
* @param {string[]} numerationArray array of numeration numbers, lowercase, uppercase
|
881
|
-
* @description this function verifies the numeration of options
|
882
|
-
*/
|
883
|
-
verifyOptionsNumerationSetCorrectAnswerSection: (numerationArray) => {
|
884
|
-
numerationArray.forEach((optionNumeration, index) => {
|
885
|
-
listSortingPage.setCorrectAnswerSectionTargetOptionWrapper()
|
886
|
-
.eq(index)
|
887
|
-
.within(() => {
|
888
|
-
listSortingPage.optionStyleNumeration()
|
889
|
-
.should('have.text', optionNumeration);
|
890
|
-
});
|
891
|
-
});
|
892
|
-
},
|
893
|
-
|
894
|
-
/**
|
895
|
-
* @param {string[]} numerationArray array of numeration numbers, lowercase, uppercase
|
896
|
-
* @description this function verifies the numeration of options
|
897
|
-
*/
|
898
|
-
verifyOptionsNumerationPreviewTab: (numerationArray) => {
|
899
|
-
numerationArray.forEach((optionNumeration, index) => {
|
900
|
-
listSortingPage.previewTabTargetOptionWrapper()
|
901
|
-
.eq(index)
|
902
|
-
.within(() => {
|
903
|
-
listSortingPage.optionStyleNumeration()
|
904
|
-
.should('have.text', optionNumeration);
|
905
|
-
});
|
906
|
-
});
|
907
|
-
},
|
908
|
-
|
909
|
-
//TODO: Need to remove once -https://redmine.zeuslearning.com/issues/518498 is resolved
|
910
|
-
/**
|
911
|
-
* @param {string} labelText Correct|Incorrect
|
912
|
-
* @description this function verifies the border label and icon
|
913
|
-
*/
|
914
|
-
verifyCorrectIncorrectAnswerLabel: (labelText) => {
|
915
|
-
autoScoredPreviewBase.correctIncorrectAnswerLabel()
|
916
|
-
.should('be.visible')
|
917
|
-
.verifyInnerText(`${labelText} answer`)
|
918
|
-
.parents('[class*="__AnswerStatusWrapper"]')
|
919
|
-
.find('[class*="__AnswerStatusIcon"]')
|
920
|
-
.should('be.visible')
|
921
|
-
.should('have.text', `${labelText}-Icon`)
|
922
|
-
}
|
923
|
-
}
|
924
|
-
|
925
|
-
const tests = {
|
926
|
-
...createQuestionBasePage.tests,
|
927
|
-
...commonComponents.tests,
|
928
|
-
...questionInstructionsComponent.tests,
|
929
|
-
...listSortingAndOrderingBase.tests,
|
930
|
-
...autoScoredScoringSection.tests,
|
931
|
-
...previewScoringAndShowCorrectAnswerComponent.tests,
|
932
|
-
...scoringSectionBase.tests,
|
933
|
-
...autoScoredSetCorrectAnswerSection.tests,
|
934
|
-
...additionalSettingsPanel.tests,
|
935
|
-
...studentResponseAndLayoutComponent.tests,
|
936
|
-
...answerNumerationComponent.tests,
|
937
|
-
...autoScoredAdditionalSettings.tests,
|
938
|
-
verifyAllContentsOfSetCorrectAnswerSectionForScoringType: (scoringType, optionsArray) => {
|
939
|
-
it(`When user has selected ${scoringType} scoring type then added options should be displayed in the set correct answer section`, () => {
|
940
|
-
listSortingPage.steps.verifySourceOptionsTextContentInSetCorrectAnswerSection(optionsArray);
|
941
|
-
for (let index = 0; index < 4; index++) {
|
942
|
-
listSortingPage.steps.verifyDragHandleButtonOfOptionInSetCorrectAnswerSection(index);
|
943
|
-
}
|
944
|
-
});
|
945
|
-
},
|
946
|
-
|
947
|
-
verifyImageEquationLinkBoldTextInSetCorrectAnswerSection: () => {
|
948
|
-
it('When user adds an image, equation, text and link to the options input they should be displayed in the \'Set correct answer\' section along with drag handles', () => {
|
949
|
-
for (let index = 0; index < 4; index++) {
|
950
|
-
listSortingPage.steps.verifyDragHandleButtonOfOptionInSetCorrectAnswerSection(index)
|
951
|
-
}
|
952
|
-
listSortingPage.steps.verifyImageEquationLinkBoldTextInSetCorrectAnswerSectionSourceOption();
|
953
|
-
});
|
954
|
-
|
955
|
-
it('When user hovers on the option it should be displayed in active state and on removing the focus the option should return to the default state', () => {
|
956
|
-
listSortingPage.steps.verifyDefaultAndActiveStateOfOptionInSetCorrectAnswerSection()
|
957
|
-
});
|
958
|
-
|
959
|
-
//Failing due to https://redmine.zeuslearning.com/issues/537907
|
960
|
-
it('CSS of \'Set correct answer\' section when image, equation, text and link are added', { tags: 'css' }, () => {
|
961
|
-
utilities.verifyCSS(listSortingPage.setCorrectAnswerSectionOption().eq(0).find('img'), {
|
962
|
-
'color': css.color.text,
|
963
|
-
'font-size': css.fontSize.default,
|
964
|
-
'font-weight': css.fontWeight.regular
|
965
|
-
});
|
966
|
-
utilities.verifyCSS(listSortingPage.setCorrectAnswerSectionOption().eq(1).find('.question-text-wrapper'), {
|
967
|
-
'color': css.color.text,
|
968
|
-
'font-size': css.fontSize.default,
|
969
|
-
'font-weight': css.fontWeight.regular
|
970
|
-
});
|
971
|
-
utilities.verifyCSS(listSortingPage.setCorrectAnswerSectionOption().eq(2).find('a'), {
|
972
|
-
'color': css.color.linkText,
|
973
|
-
'font-size': css.fontSize.default,
|
974
|
-
'font-weight': css.fontWeight.regular
|
975
|
-
});
|
976
|
-
utilities.verifyCSS(listSortingPage.setCorrectAnswerSectionOption().eq(3).find('.question-text-wrapper'), {
|
977
|
-
'color': css.color.text,
|
978
|
-
'font-size': css.fontSize.default,
|
979
|
-
'font-weight': css.fontWeight.regular
|
980
|
-
});
|
981
|
-
});
|
982
|
-
|
983
|
-
it('Accessibility of \'Set correct answer\' section when image, equation, text and link are added', { tags: 'a11y' }, () => {
|
984
|
-
cy.checkAccessibility(listSortingPage.setCorrectAnswerSectionOption().eq(0).parents('.list-sorting-response-container'))
|
985
|
-
});
|
986
|
-
|
987
|
-
it('When user sets the order in target section then the options should be displayed in the target section of the Set correct answer section', () => {
|
988
|
-
listSortingPage.steps.clickAndDropOptionFromSourceIndexToTargetIndexInSetCorrectAnswerSection(0, 0);
|
989
|
-
listSortingPage.steps.clickAndDropOptionFromSourceIndexToTargetIndexInSetCorrectAnswerSection(1, 1);
|
990
|
-
listSortingPage.steps.clickAndDropOptionFromSourceIndexToTargetIndexInSetCorrectAnswerSection(2, 2);
|
991
|
-
listSortingPage.steps.clickAndDropOptionFromSourceIndexToTargetIndexInSetCorrectAnswerSection(3, 3);
|
992
|
-
listSortingPage.steps.verifyImageEquationLinkBoldTextInSetCorrectAnswerSectionTargetOption();
|
993
|
-
});
|
994
|
-
},
|
995
|
-
|
996
|
-
/**
|
997
|
-
* @param {number} totalPoints the maximum points that can be scored by the user
|
998
|
-
* @description this function verifies the functionality of minimum points when penalty points are not set and user attempts incorrect answer
|
999
|
-
*/
|
1000
|
-
verifyMinimumScoreAwardedIfAttemptedFunctionalityForIncorrectAnswer: (totalPoints) => {
|
1001
|
-
it('When user has provided minimum score awarded (if attempted) points, then in Preview tab on entering incorrect answer, minimum score should be provided for the question', () => {
|
1002
|
-
cy.log('Switch to edit tab and set minimum score if attempted points')
|
1003
|
-
createQuestionBasePage.steps.switchToEditTab();
|
1004
|
-
scoringSectionBase.steps.expandMinimumScoringDropdown();
|
1005
|
-
scoringSectionBase.steps.selectMinimumScoringTypeListOption('Award minimum score only if attempted')
|
1006
|
-
scoringSectionBase.steps.allotMinimumScoreAwardedIfAttempted('1')
|
1007
|
-
createQuestionBasePage.steps.switchToPreviewTab()
|
1008
|
-
listSortingPage.steps.clickAndDropOptionFromSourceToTargetInPreviewTab('sprout', 0);
|
1009
|
-
listSortingPage.steps.clickAndDropOptionFromSourceToTargetInPreviewTab('plant', 1);
|
1010
|
-
listSortingPage.steps.clickAndDropOptionFromSourceToTargetInPreviewTab('flower', 2);
|
1011
|
-
listSortingPage.steps.clickAndDropOptionFromSourceToTargetInPreviewTab('seed', 3);
|
1012
|
-
listSortingPage.steps.verifyTargetOptionsTextContentInPreviewTab(['sprout', 'plant', 'flower', 'seed']);
|
1013
|
-
listSortingPage.steps.verifyPreviewTabScoreText(1, `${totalPoints}`)
|
1014
|
-
});
|
1015
|
-
|
1016
|
-
it('When user removes minimum score awarded (if attempted) points, then in Preview tab on selecting any options other than correct answers, points should not be provided', () => {
|
1017
|
-
cy.log('Switch to edit tab and remove minimum score if attempted points')
|
1018
|
-
createQuestionBasePage.steps.switchToEditTab();
|
1019
|
-
scoringSectionBase.steps.clearMinimumScoreIfAttemptedPointsField();
|
1020
|
-
createQuestionBasePage.steps.switchToPreviewTab()
|
1021
|
-
listSortingPage.steps.clickAndDropOptionFromSourceToTargetInPreviewTab('sprout', 0);
|
1022
|
-
listSortingPage.steps.clickAndDropOptionFromSourceToTargetInPreviewTab('plant', 1);
|
1023
|
-
listSortingPage.steps.clickAndDropOptionFromSourceToTargetInPreviewTab('flower', 2);
|
1024
|
-
listSortingPage.steps.clickAndDropOptionFromSourceToTargetInPreviewTab('seed', 3);
|
1025
|
-
listSortingPage.steps.verifyTargetOptionsTextContentInPreviewTab(['sprout', 'plant', 'flower', 'seed']);
|
1026
|
-
listSortingPage.steps.verifyPreviewTabScoreText(0, `${totalPoints}`)
|
1027
|
-
});
|
1028
|
-
},
|
1029
|
-
|
1030
|
-
/**
|
1031
|
-
*
|
1032
|
-
* @param {number} scoredPoints the points scored by the user when penalty points are reduced
|
1033
|
-
* @param {number} totalPoints the maximum points that can be scored by the user
|
1034
|
-
* @description this function verifies the functionality of Penalty points when minimum points are not set and user attempts incorrect answer
|
1035
|
-
*/
|
1036
|
-
verifyPenaltyPointsFunctionalityForIncorrectAnswer: (scoredPoints, totalPoints) => {
|
1037
|
-
it('When user has defined penalty points', () => {
|
1038
|
-
cy.log('Pre-step: Switch to edit tab and set penalty points');
|
1039
|
-
createQuestionBasePage.steps.switchToEditTab();
|
1040
|
-
autoScoredScoringSectionMultipleResponsesType.steps.allotPenaltyPoints(3)
|
1041
|
-
|
1042
|
-
cy.log('After switching to preview tab, when user adds an incorrect answer input, then 0 points should be awarded(no negative points)');
|
1043
|
-
createQuestionBasePage.steps.switchToPreviewTab();
|
1044
|
-
listSortingPage.steps.clickAndDropOptionFromSourceToTargetInPreviewTab('sprout', 0);
|
1045
|
-
listSortingPage.steps.clickAndDropOptionFromSourceToTargetInPreviewTab('plant', 1);
|
1046
|
-
listSortingPage.steps.clickAndDropOptionFromSourceToTargetInPreviewTab('flower', 2);
|
1047
|
-
listSortingPage.steps.clickAndDropOptionFromSourceToTargetInPreviewTab('seed', 3);
|
1048
|
-
listSortingPage.steps.verifyTargetOptionsTextContentInPreviewTab(['sprout', 'plant', 'flower', 'seed']);
|
1049
|
-
listSortingPage.steps.verifyPreviewTabScoreText(0, `${totalPoints}`)
|
1050
|
-
|
1051
|
-
cy.log('When user adds a partially correct answer input, the points should be updated accordingly with deducted penalty points');
|
1052
|
-
listSortingPage.steps.resetQuestionPreview()
|
1053
|
-
listSortingPage.steps.clickAndDropOptionFromSourceToTargetInPreviewTab('seed', 0);
|
1054
|
-
listSortingPage.steps.clickAndDropOptionFromSourceToTargetInPreviewTab('plant', 1);
|
1055
|
-
listSortingPage.steps.clickAndDropOptionFromSourceToTargetInPreviewTab('sprout', 2);
|
1056
|
-
listSortingPage.steps.clickAndDropOptionFromSourceToTargetInPreviewTab('flower', 3);
|
1057
|
-
listSortingPage.steps.verifyTargetOptionsTextContentInPreviewTab(['seed', 'plant', 'sprout', 'flower']);
|
1058
|
-
listSortingPage.steps.verifyPreviewTabScoreText(`${scoredPoints}`, `${totalPoints}`);
|
1059
|
-
|
1060
|
-
cy.log('Post step: Clearing the Penalty points field')
|
1061
|
-
createQuestionBasePage.steps.switchToEditTab();
|
1062
|
-
autoScoredScoringSectionMultipleResponsesType.penaltyPointsInputField()
|
1063
|
-
.clear();
|
1064
|
-
});
|
1065
|
-
},
|
1066
|
-
|
1067
|
-
/**
|
1068
|
-
* @param {*} totalPointsScored the maximum points that can be achieved by the user
|
1069
|
-
* @description this function verifies the functionality of penalty points when penalty points are set and user attempts alternate tab answers
|
1070
|
-
*/
|
1071
|
-
verifyPenaltyPointsFunctionalityForAlternateTabAnswers: (totalPointsScored) => {
|
1072
|
-
it('When the user has alloted penalty points and attempts the question according to the alternate tab then user should be awarded with full points of the alternate tab and penalty points should not be deducted', () => {
|
1073
|
-
listSortingPage.steps.switchToEditTab()
|
1074
|
-
listSortingPage.steps.allotPenaltyPoints(3);
|
1075
|
-
listSortingPage.steps.switchToPreviewTab();
|
1076
|
-
listSortingPage.steps.clickAndDropOptionFromSourceToTargetInPreviewTab('seed', 0);
|
1077
|
-
listSortingPage.steps.clickAndDropOptionFromSourceToTargetInPreviewTab('flower', 1);
|
1078
|
-
listSortingPage.steps.clickAndDropOptionFromSourceToTargetInPreviewTab('sprout', 2);
|
1079
|
-
listSortingPage.steps.clickAndDropOptionFromSourceToTargetInPreviewTab('plant', 3);
|
1080
|
-
listSortingPage.steps.verifyTargetOptionsTextContentInPreviewTab(['seed', 'flower', 'sprout', 'plant']);
|
1081
|
-
listSortingPage.steps.verifyPreviewTabScoreText(`${totalPointsScored}`, `${totalPointsScored}`);
|
1082
|
-
cy.log('Post step: Clearing the Penalty points field')
|
1083
|
-
createQuestionBasePage.steps.switchToEditTab();
|
1084
|
-
autoScoredScoringSectionMultipleResponsesType.penaltyPointsInputField()
|
1085
|
-
.clear();
|
1086
|
-
});
|
1087
|
-
},
|
1088
|
-
|
1089
|
-
/**
|
1090
|
-
* @param {number[]} scoredPointsArray An array of numbers representing points scored in different cases.
|
1091
|
-
* - The first element represents points scored for incorrect answers.
|
1092
|
-
* - The second element represents points scored for partially correct answers.
|
1093
|
-
* - 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
|
1094
|
-
* @param {number} minimumPointsForPartialCorrectAnswers minimum score awarded (if attempted) points on attempting the question partially correct
|
1095
|
-
* @param {number} totalPoints the maximum points that can be achieved by the user
|
1096
|
-
* @description this function verifies the functionality of Minimum score if attempted points when penalty points are set and user attempts incorrect answer
|
1097
|
-
* - For all incorrect responses
|
1098
|
-
* - For partially correct responses, when points scored > minimum score awarded(if attempted) points
|
1099
|
-
* - For partially correct responses, when minimum score awarded(if attempted) points > points scored
|
1100
|
-
*/
|
1101
|
-
verifyMinimumScoreIfAttemptedAndPenaltyPointsFunctionalityForIncorrectAnswer: (scoredPointsArray, minimumPointsForPartialCorrectAnswers, totalPoints) => {
|
1102
|
-
it('When user has defined both penalty points and minimum score awarded (if attempted) points', () => {
|
1103
|
-
cy.log('Pre-step: Switch to edit tab and set minimum score awarded (if attempted) points and Penalty points');
|
1104
|
-
createQuestionBasePage.steps.switchToEditTab();
|
1105
|
-
scoringSectionBase.steps.allotMinimumScoreAwardedIfAttempted(1);
|
1106
|
-
autoScoredScoringSectionMultipleResponsesType.steps.allotPenaltyPoints(3);
|
1107
|
-
|
1108
|
-
cy.log('Switch to preview tab and give incorrect answer input to check that minimum points are displayed');
|
1109
|
-
createQuestionBasePage.steps.switchToPreviewTab();
|
1110
|
-
listSortingPage.steps.clickAndDropOptionFromSourceToTargetInPreviewTab('sprout', 0);
|
1111
|
-
listSortingPage.steps.clickAndDropOptionFromSourceToTargetInPreviewTab('plant', 1);
|
1112
|
-
listSortingPage.steps.clickAndDropOptionFromSourceToTargetInPreviewTab('flower', 2);
|
1113
|
-
listSortingPage.steps.clickAndDropOptionFromSourceToTargetInPreviewTab('seed', 3);
|
1114
|
-
listSortingPage.steps.verifyTargetOptionsTextContentInPreviewTab(['sprout', 'plant', 'flower', 'seed']);
|
1115
|
-
listSortingPage.steps.verifyPreviewTabScoreText(`${scoredPointsArray[0]}`, `${totalPoints}`);
|
1116
|
-
|
1117
|
-
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');
|
1118
|
-
listSortingPage.steps.resetQuestionPreview();
|
1119
|
-
listSortingPage.steps.clickAndDropOptionFromSourceToTargetInPreviewTab('seed', 0);
|
1120
|
-
listSortingPage.steps.clickAndDropOptionFromSourceToTargetInPreviewTab('plant', 1);
|
1121
|
-
listSortingPage.steps.clickAndDropOptionFromSourceToTargetInPreviewTab('sprout', 2);
|
1122
|
-
listSortingPage.steps.clickAndDropOptionFromSourceToTargetInPreviewTab('flower', 3);
|
1123
|
-
listSortingPage.steps.verifyTargetOptionsTextContentInPreviewTab(['seed', 'plant', 'sprout', 'flower']);
|
1124
|
-
listSortingPage.steps.verifyPreviewTabScoreText(`${scoredPointsArray[1]}`, `${totalPoints}`);
|
1125
|
-
|
1126
|
-
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');
|
1127
|
-
createQuestionBasePage.steps.switchToEditTab();
|
1128
|
-
scoringSectionBase.steps.clearMinimumScoreIfAttemptedPointsField()
|
1129
|
-
scoringSectionBase.steps.allotMinimumScoreAwardedIfAttempted(minimumPointsForPartialCorrectAnswers)
|
1130
|
-
cy.log('Switching to preview tab');
|
1131
|
-
createQuestionBasePage.steps.switchToPreviewTab();
|
1132
|
-
listSortingPage.steps.clickAndDropOptionFromSourceToTargetInPreviewTab('plant', 0);
|
1133
|
-
listSortingPage.steps.clickAndDropOptionFromSourceToTargetInPreviewTab('seed', 1);
|
1134
|
-
listSortingPage.steps.clickAndDropOptionFromSourceToTargetInPreviewTab('sprout', 2);
|
1135
|
-
listSortingPage.steps.clickAndDropOptionFromSourceToTargetInPreviewTab('flower', 3);
|
1136
|
-
listSortingPage.steps.verifyTargetOptionsTextContentInPreviewTab(['plant', 'seed', 'sprout', 'flower']);
|
1137
|
-
listSortingPage.steps.verifyPreviewTabScoreText(`${scoredPointsArray[2]}`, `${totalPoints}`);
|
1138
|
-
});
|
1139
|
-
},
|
1140
|
-
|
1141
|
-
//Additional settings
|
1142
|
-
/**
|
1143
|
-
* @param {string[]} numerationArray array of the numeration displayed with options numbers| lowercase| uppercase
|
1144
|
-
* @description this function checks the numeration displayed for the options and correct answer container options when check answer is selected
|
1145
|
-
*/
|
1146
|
-
verifyOptionStyleNumerationWhenCheckAnswerIsSelected: (optionNumerationArray) => {
|
1147
|
-
it('When user clicks on \'Check answer\' button then the default \'Answer numeration\' should be displayed in the \'Correct answers:\' section', () => {
|
1148
|
-
listSortingPage.steps.checkAnswer()
|
1149
|
-
listSortingPage.steps.clickAndDropOptionFromSourceToTargetInPreviewTab('plant', 0)
|
1150
|
-
listSortingPage.steps.clickAndDropOptionFromSourceToTargetInPreviewTab('flower', 1)
|
1151
|
-
listSortingPage.steps.clickAndDropOptionFromSourceToTargetInPreviewTab('seed', 2)
|
1152
|
-
listSortingPage.steps.clickAndDropOptionFromSourceToTargetInPreviewTab('sprout', 3)
|
1153
|
-
steps.verifyOptionsNumerationPreviewTab(optionNumerationArray)
|
1154
|
-
});
|
1155
|
-
},
|
1156
|
-
|
1157
|
-
verifyCSSAndA11yOfIncorrectAnswerLabel: () => {
|
1158
|
-
it('CSS of incorrect answer state', { tags: 'css' }, () => {
|
1159
|
-
cy.log('Pre requisite: The user has attempted the question incorrectly')
|
1160
|
-
cy.log('Pre step: Select show answer checkbox')
|
1161
|
-
previewScoringAndShowCorrectAnswerComponent.steps.checkShowCorrectAnswerCheckbox();
|
1162
|
-
cy.log('Verifying CSS of incorrect crossmark icon')
|
1163
|
-
autoScoredPreviewBase.incorrectIcon()
|
1164
|
-
.eq(0)
|
1165
|
-
.verifyPseudoClassBeforeProperty('color', css.color.incorrectAnswer);
|
1166
|
-
autoScoredPreviewBase.correctIncorrectAnswerLabel()
|
1167
|
-
.verifyCSS(css.color.incorrectAnswer, css.fontSize.normal, css.fontWeight.bold)
|
1168
|
-
autoScoredPreviewBase.steps.verifyIncorrectAttemptBorder();
|
1169
|
-
});
|
1170
|
-
|
1171
|
-
it('Accessibility of incorrect answer state', { tags: 'a11y' }, () => {
|
1172
|
-
cy.checkAccessibility(commonComponents.previewTabQuestionWrapper());
|
1173
|
-
cy.log('Post step: Deselect show answer checkbox')
|
1174
|
-
previewScoringAndShowCorrectAnswerComponent.steps.uncheckShowCorrectAnswerCheckbox();
|
1175
|
-
});
|
1176
|
-
},
|
1177
|
-
|
1178
|
-
verifyCSSAndA11yOfFullScoreTextAndCorrectAnswerLabel: () => {
|
1179
|
-
it('CSS of check score text full score state and Correct Answer label', { tags: 'css' }, () => {
|
1180
|
-
previewScoringAndShowCorrectAnswerComponent.previewScoreText()
|
1181
|
-
.should('have.css', 'color', css.color.primaryBtn)
|
1182
|
-
.and('have.css', 'background-color', css.color.correctAnswer)
|
1183
|
-
autoScoredPreviewBase.correctIncorrectAnswerLabel()
|
1184
|
-
.verifyCSS(css.color.correctAnswer, css.fontSize.normal, css.fontWeight.bold);
|
1185
|
-
autoScoredPreviewBase.steps.verifyCorrectAttemptBorder();
|
1186
|
-
});
|
1187
|
-
|
1188
|
-
it('Accessibility of check score text full score state and Correct Answer label', { tags: 'a11y' }, () => {
|
1189
|
-
cy.checkAccessibility(commonComponents.previewTabQuestionWrapper());
|
1190
|
-
});
|
1191
|
-
},
|
1192
|
-
}
|
1193
|
-
|
1194
|
-
export const listSortingPage = {
|
1195
|
-
...selectors,
|
1196
|
-
steps,
|
1197
|
-
tests
|
1198
|
-
}
|