itemengine-cypress-automation 1.0.158-migrationScripts-2432c9a.0 → 1.0.159-2AprilFixes-b9fea4f.0
Sign up to get free protection for your applications and to get access to all the features.
- package/cypress/e2e/ILC/AudioResponseNew/customizePlaybackControls.js +1 -1
- package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/Scoring/allOrNothingBasicForGroupedOptionsLayout.js +49 -1
- package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/Scoring/allOrNothingCorrectPointsEqualToAlternativePoints.js +1 -1
- package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/Scoring/manuallyAndNonScoredScoring.js +1 -8
- package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/editTabBasicSection.js +7 -7
- package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/minimumScoringPenaltyPointsAndRoundingDropdown.js +4 -4
- package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/studentViewSettingsForGroupedLayout.js +1 -1
- package/cypress/e2e/ILC/DrawingResponse/drawingResponsePreviewTabContents.smoke.js +11 -8
- package/cypress/e2e/ILC/EssayResponse/createCustomCategory.smoke.js +5 -5
- package/cypress/e2e/ILC/EssayResponse/previewHyperlink.js +2 -1
- package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/specifyCorrectAnswerSection.js +1 -1
- package/cypress/e2e/ILC/FillInTheGapsDropdownNew/dropdownOptionsSection.js +0 -5
- package/cypress/e2e/ILC/FillInTheGapsDropdownNew/specifyCorrectAnswerSection.js +1 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/clickAndDrop.js +10 -10
- package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/specifyCorrectAnswerSection.js +1 -1
- package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/dropdownOptionsSection.js +0 -5
- package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/specifyCorrectAnswerSection.js +1 -0
- package/cypress/e2e/ILC/Graphing/allOrNothingForAllViews.smoke.js +3 -3
- package/cypress/e2e/ILC/Graphing/layoutAndGridOptions.js +4 -4
- package/cypress/e2e/ILC/GridFill/editTabScoringSection.js +4 -4
- package/cypress/e2e/ILC/GridFill/gridLayoutContents.js +1 -0
- package/cypress/e2e/ILC/GridFill/studentViewSettingsSection.js +2 -2
- package/cypress/e2e/ILC/Matching/Scoring/partialEqualWeightsWithAlternativePointsGreaterThanCorrectPoints.js +1 -1
- package/cypress/e2e/ILC/Matching/draggableOptions.js +53 -0
- package/cypress/e2e/ILC/Matching/questionInstructionsAndPromptSection.js +302 -0
- package/cypress/e2e/ILC/MultipleSelectionGridNew/additionalSettingsBasic.js +146 -0
- package/cypress/e2e/ILC/MultipleSelectionGridNew/headerSection.js +83 -0
- package/cypress/e2e/ILC/Ruler/rulerEditTabBasicsSection.js +18 -22
- package/cypress/e2e/ILC/Ruler/rulerEditTabFunctionality.js +1 -2
- package/cypress/e2e/ILC/SingleSelectionGridNew/additionalSettingsBasic.js +146 -0
- package/cypress/e2e/ILC/SingleSelectionGridNew/headerSection.js +83 -0
- package/cypress/e2e/ILC/TextEntryMath/responseEvaluationMethodsAndCustomSettings.js +2 -1
- package/cypress/e2e/ILC/ToolSettings/toolSettingsPreviewContents.smoke.js +1 -1
- package/cypress/fixtures/drawingToolbarOptionsAdditionalOptionsAndSpecialAndMathCharacters.js +1 -1
- package/cypress/fixtures/equationEditorCategoriesAndSymbols .js +6 -0
- package/cypress/fixtures/evaluationMethodsAndCustomSettings.js +1 -1
- package/cypress/pages/components/autoScoredScoringPreviewTab.js +6 -0
- package/cypress/pages/components/commonComponents.js +2 -1
- package/cypress/pages/components/createCustomCategoryFlyout.js +0 -1
- package/cypress/pages/components/fillInTheGapsDropdownCommonComponent.js +4 -4
- package/cypress/pages/components/gridQuestionCommonComponent.js +29 -1
- package/cypress/pages/components/imageCanvasComponent.js +3 -3
- package/cypress/pages/components/questionInputFieldComponent.js +1 -1
- package/cypress/pages/dragAndDropIntoCategoriesPage.js +3 -4
- package/cypress/pages/fillInTheGapsOverImageDragAndDropPage.js +10 -0
- package/cypress/pages/graphingPage.js +4 -4
- package/cypress/pages/index.js +0 -3
- package/cypress/pages/matchingPage.js +166 -10
- package/cypress/pages/multipleSelectionGridPage.js +10 -2
- package/cypress/pages/rulerPage.js +12 -12
- package/cypress/pages/singleSelectionGridPage.js +10 -2
- package/cypress/pages/textEntryMathPage.js +2 -1
- package/package.json +1 -1
- package/cypress/pages/listMatchingPage.js +0 -1514
- package/cypress/pages/listMatchingScoring.js +0 -2547
- package/cypress/pages/passagePage.js +0 -436
@@ -1,1514 +0,0 @@
|
|
1
|
-
import utilities from "../support/helpers/utilities";
|
2
|
-
import { additionalSettingsPanel, autoScoredAdditionalSettings, autoScoredPreviewBase, autoScoredScoringSection, autoScoredScoringSectionMultipleResponsesType, autoScoredSetCorrectAnswerSection, commonComponents, createQuestionBasePage, optionsWrapperComponent, previewScoringAndShowCorrectAnswerComponent, questionInstructionsComponent, scoringSectionBase, studentResponseAndLayoutComponent, answerNumerationComponent, draggableOptionContainer, draggableOptionsSectionComponent } from "./components"
|
3
|
-
import { dialogBoxBase } from "./dialogBoxBase";
|
4
|
-
const css = Cypress.env('css');
|
5
|
-
|
6
|
-
let optionsForThreeResponses = ['Correct answer for stem 1', 'Correct answer for stem 2', 'Correct answer for stem 3'];
|
7
|
-
|
8
|
-
const selectors = {
|
9
|
-
...questionInstructionsComponent,
|
10
|
-
...commonComponents,
|
11
|
-
...scoringSectionBase,
|
12
|
-
...autoScoredSetCorrectAnswerSection,
|
13
|
-
...scoringSectionBase,
|
14
|
-
...previewScoringAndShowCorrectAnswerComponent,
|
15
|
-
...autoScoredScoringSection,
|
16
|
-
...autoScoredAdditionalSettings,
|
17
|
-
...autoScoredPreviewBase,
|
18
|
-
...autoScoredScoringSectionMultipleResponsesType,
|
19
|
-
...optionsWrapperComponent,
|
20
|
-
...studentResponseAndLayoutComponent,
|
21
|
-
...draggableOptionContainer,
|
22
|
-
...answerNumerationComponent,
|
23
|
-
...additionalSettingsPanel,
|
24
|
-
...draggableOptionsSectionComponent,
|
25
|
-
|
26
|
-
//Options section
|
27
|
-
addOptionButton: () => cy.get('.add-option-wrapper-cls .ngie-button').eq(1),
|
28
|
-
groupedOptionsAddOptionButton: () => cy.get('.add-option-wrapper-cls .ngie-button'),
|
29
|
-
optionsForDragAndDropInputField: () => cy.get('[title="Enter option"]'),
|
30
|
-
responseOptionsSectionWrapper: () => cy.get('.cloze-drag-and-drop-response-option-wrapper').eq(1),
|
31
|
-
optionWrapper: () => cy.get('[data-rbd-draggable-id*="option-draggable-choice"]'),
|
32
|
-
//Stems section
|
33
|
-
stemsLabel: () => cy.get('.match-list-stem-label'),
|
34
|
-
stemWrapper: () => cy.get('[data-rbd-draggable-id*="option-draggable-stemOption"]'),
|
35
|
-
buttonDeleteStem: () => cy.get('[aria-label*="Delete stem"]'),
|
36
|
-
optionNumeration: () => cy.get('div[class*="AdornmentDiv"]'),
|
37
|
-
stemInputField: () => cy.get('[title="Enter stem"]'),
|
38
|
-
addStemButton: () => cy.get('.add-option-wrapper-cls .ngie-button').eq(0),
|
39
|
-
//Set correct answer section
|
40
|
-
setCorrectAnswerStemRow: () => cy.get('.grid-container'),
|
41
|
-
setCorrectAnswerStemField: () => listMatchingPage.setCorrectAnswerStemLabel().parent(),
|
42
|
-
setCorrectAnswerStemLabel: () => cy.get('.input-field-label .question-text-wrapper'),
|
43
|
-
setCorrectAnswerStemResponseArea: () => cy.get('[class="droppable-area"] [role="button"]'),
|
44
|
-
setCorrectAnswerStemResponseAreaWrapper: () => cy.get('[class*="DroppableHotspotstyle__DroppableHotspotWrapper"]'),
|
45
|
-
stemColumnHeader: () => cy.get('[class*="ClozeWithDragAndDropstyles__HeaderContainer"]').eq(0),
|
46
|
-
responseColumnHeader: () => cy.get('[class*="ClozeWithDragAndDropstyles__HeaderContainer"]').eq(1),
|
47
|
-
//preview tab
|
48
|
-
previewTabStemRow: () => cy.get('.match-list-response-container'),
|
49
|
-
previewTabStemLabel: () => cy.get('.no-split-pane-wrapper .input-field-label .question-text-wrapper'),
|
50
|
-
previewTabStemField: () => listMatchingPage.previewTabStemLabel().parent(),
|
51
|
-
//Below same as FIG DnD
|
52
|
-
responseAreaNumeration: () => cy.get('[class*="DroppedItemstyle__NumerationWrapper"]'),
|
53
|
-
previewTabStemResponseArea: () => cy.get('.no-split-pane-wrapper [class="droppable-area"] [role="button"]'),
|
54
|
-
previewTabStemResponseAreaWrapper: () => cy.get('.no-split-pane-wrapper [class*="DroppableHotspotstyle__DroppableHotspotWrapper"]'),
|
55
|
-
previewTabQuestionField: () => cy.get('.no-split-pane-wrapper div[class*="ClozeWithDragAndDropstyles__QuestionItemContainer"]'),
|
56
|
-
previewDraggableOptionContainer: () => cy.get('.no-split-pane-wrapper .draggable-wrapper'),
|
57
|
-
previewTabCorrectAnswerContainer: () => cy.get('[class*="ClozeWithDragAndDropstyles__CorrectAnswerTextWrapper"]'),
|
58
|
-
previewTabCorrectAnswerLabel: () => listMatchingPage.previewTabCorrectAnswerContainer().find('[class*="ClozeWithDragAndDropstyles__CorrectAnswerLabel"]'),
|
59
|
-
previewTabCorrectAnswerResponseNumerationWrapper: () => cy.get('[class*="ClozeWithDragAndDropstyles__NumerationWrapper"]'),
|
60
|
-
previewTabCorrectAnswerResponseWrapper: () => listMatchingPage.previewTabCorrectAnswerResponseNumerationWrapper().parents('[class*="ClozeWithDragAndDropstyles__ItemWrapper"]'),
|
61
|
-
previewTabCorrectAnswerResponseText: () => cy.get('[class*="ClozeWithDragAndDropstyles__ItemWrapper"] .question-text-wrapper'),
|
62
|
-
draggableOption: () => cy.get('.draggable-selected-item'),
|
63
|
-
//Additional settings
|
64
|
-
stemColumnHeaderLabel: () => cy.get('[class*="StudentResponseComponentstyle__InputWrapper"] .text-label').eq(0),
|
65
|
-
ResponseColumnHeaderLabel: () => cy.get('[class*="StudentResponseComponentstyle__InputWrapper"] .text-label').eq(1),
|
66
|
-
stemColumnHeaderInputField: () => cy.get('[class*="StudentResponseComponentstyle__InputWrapper"] input').eq(0),
|
67
|
-
ResponseColumnHeaderInputField: () => cy.get('[class*="StudentResponseComponentstyle__InputWrapper"] input').eq(1),
|
68
|
-
//Same as DnD into categories
|
69
|
-
responseOptionPlacementLabel: () => cy.get('#Response-option-placement-dropdown-label'),
|
70
|
-
responseOptionPlacementDropdown: () => cy.get('#Response-option-placement-select'),
|
71
|
-
responseOptionPlacementDropdownListOption: (ariaLabel = null) => {
|
72
|
-
if (ariaLabel) {
|
73
|
-
return cy.get(`[aria-labelledby*="Response-option-placement-dropdown-label"] [role="option"][aria-label*="${ariaLabel}"]`);
|
74
|
-
} else {
|
75
|
-
return cy.get('[aria-labelledby*="Response-option-placement-dropdown-label"] [role="option"]');
|
76
|
-
}
|
77
|
-
},
|
78
|
-
questionPreviewWrapper: () => cy.get('.preview-container')
|
79
|
-
}
|
80
|
-
|
81
|
-
const steps = {
|
82
|
-
...createQuestionBasePage.steps,
|
83
|
-
...questionInstructionsComponent.steps,
|
84
|
-
...scoringSectionBase.steps,
|
85
|
-
...commonComponents.steps,
|
86
|
-
...autoScoredSetCorrectAnswerSection.steps,
|
87
|
-
...createQuestionBasePage.steps,
|
88
|
-
...commonComponents.steps,
|
89
|
-
...scoringSectionBase.steps,
|
90
|
-
...autoScoredScoringSection.steps,
|
91
|
-
...autoScoredPreviewBase.steps,
|
92
|
-
...additionalSettingsPanel.steps,
|
93
|
-
...previewScoringAndShowCorrectAnswerComponent.steps,
|
94
|
-
...autoScoredAdditionalSettings.steps,
|
95
|
-
...autoScoredScoringSectionMultipleResponsesType.steps,
|
96
|
-
...dialogBoxBase.steps,
|
97
|
-
...draggableOptionContainer.steps,
|
98
|
-
...optionsWrapperComponent.steps,
|
99
|
-
...answerNumerationComponent.steps,
|
100
|
-
...draggableOptionsSectionComponent.steps,
|
101
|
-
|
102
|
-
/**
|
103
|
-
* @param {number} index of the stem
|
104
|
-
* @description verify the enter stem input field, drag handle, delete button and stem numeration
|
105
|
-
*/
|
106
|
-
verifyStemContents: (index) => {
|
107
|
-
listMatchingPage.stemWrapper()
|
108
|
-
.eq(index)
|
109
|
-
.within(() => {
|
110
|
-
optionsWrapperComponent.optionsInputField()
|
111
|
-
.should('have.attr', 'data-cke-editorplaceholder', 'Enter stem');
|
112
|
-
commonComponents.dragHandleButton()
|
113
|
-
.should('exist');
|
114
|
-
listMatchingPage.buttonDeleteStem()
|
115
|
-
.should('be.visible');
|
116
|
-
listMatchingPage.optionNumeration()
|
117
|
-
.should('have.text', index + 1);
|
118
|
-
})
|
119
|
-
},
|
120
|
-
|
121
|
-
verifyDragHandleTooltipForStem: () => {
|
122
|
-
listMatchingPage.stemWrapper()
|
123
|
-
.eq(0)
|
124
|
-
.within(() => {
|
125
|
-
commonComponents.dragHandleButton()
|
126
|
-
.trigger('mouseover');
|
127
|
-
});
|
128
|
-
commonComponents.tooltipText()
|
129
|
-
.should('have.text', 'Drag to reorder');
|
130
|
-
listMatchingPage.stemWrapper()
|
131
|
-
.eq(0)
|
132
|
-
.within(() => {
|
133
|
-
commonComponents.dragHandleButton()
|
134
|
-
.trigger('mouseout');
|
135
|
-
});
|
136
|
-
commonComponents.tooltipText()
|
137
|
-
.should('not.exist');
|
138
|
-
},
|
139
|
-
|
140
|
-
verifyDeleteButtonTooltipForStem: () => {
|
141
|
-
listMatchingPage.buttonDeleteStem()
|
142
|
-
.eq(0)
|
143
|
-
.trigger('mouseover');
|
144
|
-
commonComponents.tooltipText()
|
145
|
-
.should('have.text', 'Delete stem');
|
146
|
-
listMatchingPage.buttonDeleteStem()
|
147
|
-
.eq(0)
|
148
|
-
.trigger('mouseout');
|
149
|
-
commonComponents.tooltipText()
|
150
|
-
.should('not.exist');
|
151
|
-
},
|
152
|
-
|
153
|
-
deleteStem: (index) => {
|
154
|
-
listMatchingPage.buttonDeleteStem()
|
155
|
-
.eq(index)
|
156
|
-
.click();
|
157
|
-
},
|
158
|
-
|
159
|
-
/**
|
160
|
-
* @param {number} index of the delete button
|
161
|
-
* @description verify the disabled delete button
|
162
|
-
*/
|
163
|
-
verifyDisabledDeleteStemButton: (index) => {
|
164
|
-
listMatchingPage.stemWrapper()
|
165
|
-
.eq(index)
|
166
|
-
.within(() => {
|
167
|
-
listMatchingPage.buttonDeleteStem()
|
168
|
-
.should('be.disabled');
|
169
|
-
});
|
170
|
-
},
|
171
|
-
|
172
|
-
verifyDisabledDeleteStemButtonTooltip: () => {
|
173
|
-
listMatchingPage.buttonDeleteStem()
|
174
|
-
.trigger('mouseover', { force: true });
|
175
|
-
commonComponents.tooltipText()
|
176
|
-
.should('have.text', 'Minimum one stem is required');
|
177
|
-
listMatchingPage.buttonDeleteStem()
|
178
|
-
.trigger('mouseout', { force: true });
|
179
|
-
commonComponents.tooltipText()
|
180
|
-
.should('not.exist');
|
181
|
-
},
|
182
|
-
|
183
|
-
addOption: () => {
|
184
|
-
listMatchingPage.addOptionButton()
|
185
|
-
.click();
|
186
|
-
},
|
187
|
-
|
188
|
-
addOptionInGroupedResponseLayout: (groupIndex) => {
|
189
|
-
listMatchingPage.groupResponseContainer()
|
190
|
-
.eq(groupIndex)
|
191
|
-
.within(() => {
|
192
|
-
listMatchingPage.groupedOptionsAddOptionButton()
|
193
|
-
.click();
|
194
|
-
});
|
195
|
-
},
|
196
|
-
|
197
|
-
addStem: () => {
|
198
|
-
listMatchingPage.addStemButton()
|
199
|
-
.click();
|
200
|
-
},
|
201
|
-
|
202
|
-
/**
|
203
|
-
* @param {number} index of the stem input field
|
204
|
-
* @description focus in and focus out of the stem input field
|
205
|
-
*/
|
206
|
-
focusInAndFocusOutOfStemInputField: (index) => {
|
207
|
-
listMatchingPage.stemWrapper()
|
208
|
-
.eq(index)
|
209
|
-
.within(() => {
|
210
|
-
listMatchingPage.stemInputField()
|
211
|
-
.click()
|
212
|
-
.blur();
|
213
|
-
});
|
214
|
-
},
|
215
|
-
|
216
|
-
/**
|
217
|
-
* @param {number} index of the option input field
|
218
|
-
* @description focus in and focus out of the option input field
|
219
|
-
*/
|
220
|
-
focusInAndFocusOutOfOptionInputField: (index) => {
|
221
|
-
listMatchingPage.optionWrapper()
|
222
|
-
.eq(index)
|
223
|
-
.within(() => {
|
224
|
-
listMatchingPage.optionsForDragAndDropInputField()
|
225
|
-
.click()
|
226
|
-
.blur();
|
227
|
-
});
|
228
|
-
},
|
229
|
-
|
230
|
-
/**
|
231
|
-
* @param {number} index of the stem input field
|
232
|
-
* @description verify the empty stem input field error message
|
233
|
-
*/
|
234
|
-
verifyStemErrorMessageIsDisplayed: (index) => {
|
235
|
-
listMatchingPage.stemWrapper()
|
236
|
-
.eq(index)
|
237
|
-
.within(() => {
|
238
|
-
commonComponents.errorMessage()
|
239
|
-
.should('have.text', 'Error: Stem is required.');
|
240
|
-
});
|
241
|
-
},
|
242
|
-
|
243
|
-
/**
|
244
|
-
* @param {number} stemInputFieldIndex Index of stem input field
|
245
|
-
* @param {string} responseFieldText Text to be given as input in stem input field
|
246
|
-
* @description Add input to the stem input field
|
247
|
-
*/
|
248
|
-
addInputToStemField: (stemInputFieldIndex, responseFieldText) => {
|
249
|
-
listMatchingPage.stemInputField()
|
250
|
-
.eq(stemInputFieldIndex)
|
251
|
-
.clear()
|
252
|
-
.type(responseFieldText)
|
253
|
-
.should('have.text', responseFieldText);
|
254
|
-
},
|
255
|
-
|
256
|
-
/**
|
257
|
-
* @param {string[]} stemTextArray Array of text to be given as input for all stem input fields
|
258
|
-
* @description Add input to all the stem input fields
|
259
|
-
*/
|
260
|
-
addInputToAllStemFields: (stemTextArray) => {
|
261
|
-
stemTextArray.forEach((stemText, count) => {
|
262
|
-
steps.addInputToStemField(count, stemText);
|
263
|
-
});
|
264
|
-
},
|
265
|
-
|
266
|
-
/**
|
267
|
-
* @param {number} index Index of stem input field
|
268
|
-
* @description Verify that stem input field error message is not displayed
|
269
|
-
*/
|
270
|
-
verifyStemErrorMessageIsNotDisplayed: (index) => {
|
271
|
-
listMatchingPage.stemWrapper()
|
272
|
-
.eq(index)
|
273
|
-
.within(() => {
|
274
|
-
commonComponents.errorMessage()
|
275
|
-
.should('not.exist');
|
276
|
-
});
|
277
|
-
},
|
278
|
-
|
279
|
-
/**
|
280
|
-
* @param {string[]} stemTextArray Array of text in set correct answer stem fields
|
281
|
-
* @description Verify the text displayed in set correct answer stem fields
|
282
|
-
*/
|
283
|
-
verifyAllStemTextInSetCorrectAnswerSection: (stemTextArray) => {
|
284
|
-
stemTextArray.forEach((stemText, stemIndex) => {
|
285
|
-
listMatchingPage.setCorrectAnswerStemLabel()
|
286
|
-
.eq(stemIndex)
|
287
|
-
.verifyInnerText(stemText);
|
288
|
-
});
|
289
|
-
},
|
290
|
-
|
291
|
-
/**
|
292
|
-
* @param {string[]} stemTextArray Array of text in preview tab stem fields
|
293
|
-
* @description Verify the text displayed in preview tab stem fields
|
294
|
-
*/
|
295
|
-
verifyAllStemTextInPreviewTab: (stemTextArray) => {
|
296
|
-
stemTextArray.forEach((stemText, stemIndex) => {
|
297
|
-
listMatchingPage.previewTabStemLabel()
|
298
|
-
.eq(stemIndex)
|
299
|
-
.verifyInnerText(stemText);
|
300
|
-
});
|
301
|
-
},
|
302
|
-
|
303
|
-
/**
|
304
|
-
* @param {string} textInput Text to be given as input for option input field
|
305
|
-
* @param {number} optionIndex Index of the option input field
|
306
|
-
* @description Add text input to all options input field
|
307
|
-
*/
|
308
|
-
addInputToOptionForDragAndDropInputField: (textInput, optionIndex) => {
|
309
|
-
listMatchingPage.optionsForDragAndDropInputField()
|
310
|
-
.eq(optionIndex)
|
311
|
-
.type(textInput, { delay: 0 })
|
312
|
-
.blur()
|
313
|
-
.focus()
|
314
|
-
.should('have.text', textInput);
|
315
|
-
},
|
316
|
-
|
317
|
-
/**
|
318
|
-
* @param {string[]} responseTextArray Array of text to be given as input for options input fields
|
319
|
-
* @description Add text input to all options input field
|
320
|
-
*/
|
321
|
-
addInputToOptionsForDragAndDropFields: (responseTextArray) => {
|
322
|
-
responseTextArray.forEach((responseFieldText, optionIndex) => {
|
323
|
-
steps.addInputToOptionForDragAndDropInputField(responseFieldText, optionIndex);
|
324
|
-
});
|
325
|
-
},
|
326
|
-
|
327
|
-
/**
|
328
|
-
* @param {string[]} optionName Array of option names
|
329
|
-
* @param {number[]} responseAreaIndex Array of index of response area
|
330
|
-
* @description Click and drop draggable option in response area in set correct answer section
|
331
|
-
*/
|
332
|
-
clickAndDropOptionInStemResponseAreaInSetCorrectAnswerSection: (optionName, responseAreaIndex) => {
|
333
|
-
listMatchingPage.draggableOption()
|
334
|
-
.contains(optionName)
|
335
|
-
.click();
|
336
|
-
listMatchingPage.setCorrectAnswerStemResponseArea()
|
337
|
-
.eq(responseAreaIndex)
|
338
|
-
.click();
|
339
|
-
},
|
340
|
-
|
341
|
-
/**
|
342
|
-
* @param {number[]} responseAreaIndex Array of index of response area
|
343
|
-
* @description Click the draggable option in the response area and drop it in draggable option container in set correct answer section
|
344
|
-
*/
|
345
|
-
clickAndDropOptionFromResponseAreaToDraggableOptionsContainerInSetCorrectAnswerSection: (responseAreaIndex) => {
|
346
|
-
listMatchingPage.setCorrectAnswerStemResponseArea()
|
347
|
-
.eq(responseAreaIndex)
|
348
|
-
.click();
|
349
|
-
listMatchingPage.setCorrectAnswerDraggableOptionsWrapper('List matching')
|
350
|
-
.click('right');
|
351
|
-
},
|
352
|
-
|
353
|
-
/**
|
354
|
-
* @param {string[]} optionName Array of option names
|
355
|
-
* @param {number[]} responseAreaIndex Array of index of response area
|
356
|
-
* @description Click and drop draggable option in response area in preview tab
|
357
|
-
*/
|
358
|
-
clickAndDropOptionInStemResponseAreaInPreviewTab: (optionName, responseAreaIndex) => {
|
359
|
-
listMatchingPage.previewTabDraggableOptionsWrapper()
|
360
|
-
.within(() => {
|
361
|
-
listMatchingPage.draggableOption()
|
362
|
-
.contains(optionName)
|
363
|
-
.click();
|
364
|
-
});
|
365
|
-
listMatchingPage.previewTabStemResponseArea()
|
366
|
-
.eq(responseAreaIndex)
|
367
|
-
.click();
|
368
|
-
},
|
369
|
-
|
370
|
-
/**
|
371
|
-
* @param {number[]} responseAreaIndex Array of index of response area
|
372
|
-
* @description Click the draggable option in the response area and drop it in draggable option container in preview tab
|
373
|
-
*/
|
374
|
-
clickAndDropOptionFromResponseAreaToDraggableOptionsContainerInPreviewTab: (responseAreaIndex) => {
|
375
|
-
listMatchingPage.previewTabStemResponseArea()
|
376
|
-
.eq(responseAreaIndex)
|
377
|
-
.click();
|
378
|
-
listMatchingPage.previewDraggableOptionContainer()
|
379
|
-
.click('right');
|
380
|
-
},
|
381
|
-
|
382
|
-
verifyStemFieldsInSetCorrectAnswerSection: (stemsArray) => {
|
383
|
-
stemsArray.forEach((stemText, stemIndex) => {
|
384
|
-
listMatchingPage.setCorrectAnswerStemField()
|
385
|
-
.eq(stemIndex)
|
386
|
-
.should('have.text', stemText);
|
387
|
-
});
|
388
|
-
},
|
389
|
-
|
390
|
-
verifyStemFieldsInPreviewTab: (stemsArray) => {
|
391
|
-
stemsArray.forEach((stemText, stemIndex) => {
|
392
|
-
listMatchingPage.previewTabStemLabel()
|
393
|
-
.eq(stemIndex)
|
394
|
-
.should('have.text', stemText);
|
395
|
-
});
|
396
|
-
},
|
397
|
-
|
398
|
-
/**
|
399
|
-
* @param {string[]} draggableOptionsArray Array of draggable options text
|
400
|
-
* @description Verify the draggable options displayed in set correct answer section
|
401
|
-
*/
|
402
|
-
verifyOptionsInSetCorrectAnswerSection: (draggableOptionsArray) => {
|
403
|
-
draggableOptionsArray.forEach((draggableOption, optionIndex) => {
|
404
|
-
listMatchingPage.draggableOption()
|
405
|
-
.eq(optionIndex)
|
406
|
-
.should('have.text', draggableOption);
|
407
|
-
});
|
408
|
-
listMatchingPage.draggableOption()
|
409
|
-
.should('have.length', draggableOptionsArray.length);
|
410
|
-
},
|
411
|
-
|
412
|
-
/**
|
413
|
-
* @param {string[]} draggableOptionsArray Array of draggable options text
|
414
|
-
* @description Verify the draggable options displayed in preview tab
|
415
|
-
*/
|
416
|
-
verifyOptionsInPreviewTab: (draggableOptionsArray) => {
|
417
|
-
listMatchingPage.previewTabDraggableOptionsWrapper()
|
418
|
-
.within(() => {
|
419
|
-
draggableOptionsArray.forEach((draggableOption, optionIndex) => {
|
420
|
-
listMatchingPage.draggableOption()
|
421
|
-
.eq(optionIndex)
|
422
|
-
.should('have.text', draggableOption);
|
423
|
-
});
|
424
|
-
listMatchingPage.draggableOption()
|
425
|
-
.should('have.length', draggableOptionsArray.length);
|
426
|
-
});
|
427
|
-
},
|
428
|
-
|
429
|
-
/**
|
430
|
-
* @param {string} optionText Text of option given as input in response area
|
431
|
-
* @param {number} responseAreaIndex Index of response area
|
432
|
-
* @description Verify the filled response areas in set correct answer section
|
433
|
-
*/
|
434
|
-
verifyFilledResponseAreaInSetCorrectAnswerSection: (responseAreaIndex, optionText) => {
|
435
|
-
listMatchingPage.setCorrectAnswerStemResponseAreaWrapper()
|
436
|
-
.eq(responseAreaIndex)
|
437
|
-
.should('have.class', 'isNotEmpty');
|
438
|
-
listMatchingPage.setCorrectAnswerStemResponseArea()
|
439
|
-
.eq(responseAreaIndex)
|
440
|
-
.should('have.text', optionText)
|
441
|
-
.and('be.visible');
|
442
|
-
},
|
443
|
-
|
444
|
-
/**
|
445
|
-
* @param {number[]} responseAreaIndex Index of response area
|
446
|
-
* @description Verify response area in set correct answer is empty
|
447
|
-
*/
|
448
|
-
verifyEmptyResponseAreaInSetCorrectAnswerSection: (responseAreaIndex) => {
|
449
|
-
listMatchingPage.setCorrectAnswerStemResponseAreaWrapper()
|
450
|
-
.eq(responseAreaIndex)
|
451
|
-
.should('have.class', 'isEmpty');
|
452
|
-
},
|
453
|
-
|
454
|
-
/**
|
455
|
-
* @param {string} responseAreaText Text of the response area
|
456
|
-
* @param {number} responseAreaIndex Index of response area
|
457
|
-
* @description Verify the text displayed in response area in preview tab
|
458
|
-
*/
|
459
|
-
verifyResponseAreaTextInPreviewTab: (responseAreaIndex, responseAreaText) => {
|
460
|
-
listMatchingPage.previewTabStemResponseArea()
|
461
|
-
.eq(responseAreaIndex)
|
462
|
-
.and('have.text', responseAreaText)
|
463
|
-
.and('be.visible');
|
464
|
-
},
|
465
|
-
|
466
|
-
/**
|
467
|
-
* @param {string} optionText Text of option given as input in response area
|
468
|
-
* @param {number} responseAreaIndex Index of response area
|
469
|
-
* @description Verify the filled response area in preview tab
|
470
|
-
*/
|
471
|
-
verifyFilledOptionResponseAreaInPreviewTab: (responseAreaIndex, optionText) => {
|
472
|
-
listMatchingPage.previewTabStemResponseAreaWrapper()
|
473
|
-
.eq(responseAreaIndex)
|
474
|
-
.should('have.class', 'isNotEmpty');
|
475
|
-
steps.verifyResponseAreaTextInPreviewTab(responseAreaIndex, optionText);
|
476
|
-
},
|
477
|
-
|
478
|
-
/**
|
479
|
-
* @param {number} index Index of stem input field
|
480
|
-
* @description Clear input given to stem input field
|
481
|
-
*/
|
482
|
-
clearStemInputField: (index) => {
|
483
|
-
listMatchingPage.stemInputField()
|
484
|
-
.eq(index)
|
485
|
-
.clear();
|
486
|
-
},
|
487
|
-
|
488
|
-
/**
|
489
|
-
* @param {string[]} stemArray Array of stems displayed in preview tab
|
490
|
-
* @description Verify that stems displayed in preview tab are randomized
|
491
|
-
*/
|
492
|
-
verifyRandomizedStemsOrder: (stemArray) => {
|
493
|
-
let currentStems = [...stemArray]
|
494
|
-
for (let index = 0; index < currentStems.length; index++) {
|
495
|
-
listMatchingPage.previewTabStemLabel()
|
496
|
-
.eq(index)
|
497
|
-
.then(($element) => {
|
498
|
-
expect($element.text()).to.be.oneOf(currentStems);
|
499
|
-
currentStems = currentStems.filter((value) => value !== $element.text())
|
500
|
-
});
|
501
|
-
};
|
502
|
-
listMatchingPage.steps.verifyRerandomizedStemsOrder(stemArray);
|
503
|
-
},
|
504
|
-
|
505
|
-
/**
|
506
|
-
* @param {string[]} PreviousOrderOfStems Array of randomized stems displayed in preview tab
|
507
|
-
* @description Verify that stems displayed in preview tab are randomized
|
508
|
-
*/
|
509
|
-
verifyRerandomizedStemsOrder: (PreviousOrderOfStems) => {
|
510
|
-
listMatchingPage.previewTabStemLabel()
|
511
|
-
.should('not.have.text', '')
|
512
|
-
.and('not.have.text', PreviousOrderOfStems.join(''));
|
513
|
-
},
|
514
|
-
|
515
|
-
getStemsArray: () => {
|
516
|
-
const stemsArray = []
|
517
|
-
listMatchingPage.previewTabStemLabel()
|
518
|
-
.each(($el) => {
|
519
|
-
cy.wrap($el)
|
520
|
-
.invoke('text')
|
521
|
-
.then((text) => {
|
522
|
-
stemsArray.push(text);
|
523
|
-
});
|
524
|
-
});
|
525
|
-
return stemsArray;
|
526
|
-
},
|
527
|
-
|
528
|
-
/**
|
529
|
-
* @param {string[]} correctAnswerArray Array of text of options displayed in correct answer container
|
530
|
-
* @param {number[]} optionNumerationArray Array of numeration of options displayed in correct answer container
|
531
|
-
* @description Verify the options and their numeration displayed in correct answer container
|
532
|
-
*/
|
533
|
-
verifyCorrectAnswerStemOptionsInCorrectAnswerContainerAndCount: (correctAnswerArray, optionNumerationArray) => {
|
534
|
-
listMatchingPage.previewTabCorrectAnswerContainer()
|
535
|
-
.should('be.visible');
|
536
|
-
listMatchingPage.previewTabCorrectAnswerLabel()
|
537
|
-
.verifyInnerText('Correct answers:');
|
538
|
-
correctAnswerArray.forEach((responseFieldText, count) => {
|
539
|
-
listMatchingPage.previewTabCorrectAnswerResponseNumerationWrapper()
|
540
|
-
.eq(count)
|
541
|
-
.should('have.text', optionNumerationArray[count]);
|
542
|
-
listMatchingPage.previewTabCorrectAnswerResponseText()
|
543
|
-
.eq(count)
|
544
|
-
.verifyInnerText(responseFieldText);
|
545
|
-
});
|
546
|
-
listMatchingPage.previewTabCorrectAnswerResponseWrapper()
|
547
|
-
.should('have.length', correctAnswerArray.length);
|
548
|
-
},
|
549
|
-
|
550
|
-
/**
|
551
|
-
* @param {number} index Index of option in preview tab
|
552
|
-
* @description Verify cross-mark icon displayed beside option input field
|
553
|
-
*/
|
554
|
-
verifyIncorrectOptionCrossmarkIcon: (index) => {
|
555
|
-
listMatchingPage.previewTabStemResponseArea()
|
556
|
-
.eq(index)
|
557
|
-
.parents('[class="droppable-area"]')
|
558
|
-
.next('.tick-icon-wrapper')
|
559
|
-
.should('have.class', 'icon-incorrect')
|
560
|
-
.and('be.visible');
|
561
|
-
},
|
562
|
-
|
563
|
-
/**
|
564
|
-
* @param {number} index Index of option in preview tab
|
565
|
-
* @description Verify check-mark icon displayed beside option input field
|
566
|
-
*/
|
567
|
-
verifyCorrectOptionCheckmarkIcon: (index) => {
|
568
|
-
listMatchingPage.previewTabStemResponseArea()
|
569
|
-
.eq(index)
|
570
|
-
.parents('[class="droppable-area"]')
|
571
|
-
.next('.tick-icon-wrapper')
|
572
|
-
.should('have.class', 'icon-correct')
|
573
|
-
.and('be.visible');
|
574
|
-
},
|
575
|
-
|
576
|
-
/**
|
577
|
-
* @param {number} index Index of option in preview tab
|
578
|
-
* @description Verify check-mark or cross-mark icon is not displayed beside option input field
|
579
|
-
*/
|
580
|
-
verifyCorrectIncorrectIconNotVisible: (index) => {
|
581
|
-
listMatchingPage.previewTabStemResponseArea()
|
582
|
-
.eq(index)
|
583
|
-
.parents('[class="droppable-area"]')
|
584
|
-
.next('.tick-icon-wrapper')
|
585
|
-
.should('not.exist');
|
586
|
-
},
|
587
|
-
|
588
|
-
/**
|
589
|
-
* @param {number} numberOfStemResponsesArea Total number of stem response areas
|
590
|
-
* @description Verify check-mark icon is displayed beside all the stem response areas
|
591
|
-
*/
|
592
|
-
verifyCorrectOptionsCheckMarkIconsForAllStemResponseAreas: (numberOfStemResponsesArea) => {
|
593
|
-
for (let index = 0; index < numberOfStemResponsesArea; index++) {
|
594
|
-
listMatchingPage.steps.verifyCorrectOptionCheckmarkIcon(index)
|
595
|
-
}
|
596
|
-
},
|
597
|
-
|
598
|
-
/**
|
599
|
-
* @param {number} numberOfStemResponsesArea Total number of stem response areas
|
600
|
-
* @description Verify cross-mark icon is displayed beside all the stem response areas
|
601
|
-
*/
|
602
|
-
verifyIncorrectOptionsCrossMarkIconsForAllStemResponseAreas: (numberOfStemResponsesArea) => {
|
603
|
-
for (let index = 0; index < numberOfStemResponsesArea; index++) {
|
604
|
-
listMatchingPage.steps.verifyIncorrectOptionCrossmarkIcon(index)
|
605
|
-
}
|
606
|
-
},
|
607
|
-
|
608
|
-
/**
|
609
|
-
* @param {number} inputFieldIndex Index of option input field in response options section
|
610
|
-
* @description Delete response option input field in response options section
|
611
|
-
*/
|
612
|
-
deleteResponseOptionInputField: (inputFieldIndex) => {
|
613
|
-
listMatchingPage.responseOptionsSectionWrapper()
|
614
|
-
.within(() => {
|
615
|
-
listMatchingPage.deleteOptionButton()
|
616
|
-
.eq(inputFieldIndex)
|
617
|
-
.click();
|
618
|
-
});
|
619
|
-
},
|
620
|
-
|
621
|
-
verifyCorrectIncorrectIconLabelAndBorderNotExist: () => {
|
622
|
-
listMatchingPage.steps.verifyCorrectIncorrectBorderNotExists();
|
623
|
-
listMatchingPage.steps.verifyCorrectIncorrectAnswerLabelNotExists()
|
624
|
-
listMatchingPage.correctIcon()
|
625
|
-
.should('not.exist');
|
626
|
-
listMatchingPage.incorrectIcon()
|
627
|
-
.should('not.exist');
|
628
|
-
},
|
629
|
-
|
630
|
-
verifyPreviewTabCorrectAnswerContainerNotExist: () => {
|
631
|
-
listMatchingPage.previewTabCorrectAnswerContainer()
|
632
|
-
.should('not.exist');
|
633
|
-
},
|
634
|
-
|
635
|
-
setQuestionStemsAndOptionsForScoringWithAlternateTab: () => {
|
636
|
-
listMatchingPage.steps.addStem();
|
637
|
-
listMatchingPage.steps.addInputToAllStemFields(['Stem 1', 'Stem 2', 'Stem 3', 'Stem 4']);
|
638
|
-
listMatchingPage.steps.addOption();
|
639
|
-
listMatchingPage.steps.addOption();
|
640
|
-
listMatchingPage.steps.addOption();
|
641
|
-
listMatchingPage.steps.addOption();
|
642
|
-
listMatchingPage.steps.addOption();
|
643
|
-
listMatchingPage.steps.addInputToOptionsForDragAndDropFields(['Common answer for stem 1', 'Common answer for stem 4', 'Correct answer for stem 2', 'Alternate answer for stem 2', 'Correct answer for stem 3', 'Alternate answer for stem 3', 'Incorrect answer 1', 'Incorrect answer 2']);
|
644
|
-
},
|
645
|
-
|
646
|
-
setQuestionStemsAndOptionsForScoringWithoutAlternateTab: () => {
|
647
|
-
listMatchingPage.steps.deleteStem(2);
|
648
|
-
listMatchingPage.steps.addInputToAllStemFields(['Stem 1', 'Stem 2']);
|
649
|
-
listMatchingPage.steps.addOption();
|
650
|
-
listMatchingPage.steps.addInputToOptionsForDragAndDropFields(['Correct answer for stem 1', 'Correct answer for stem 2', 'Incorrect answer 1', 'Incorrect answer 2']);
|
651
|
-
},
|
652
|
-
|
653
|
-
setCorrectAnswersForScoringWithoutAlternateTab: () => {
|
654
|
-
listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInSetCorrectAnswerSection('Correct answer for stem 1', 0);
|
655
|
-
listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInSetCorrectAnswerSection('Correct answer for stem 2', 1);
|
656
|
-
},
|
657
|
-
|
658
|
-
setCorrectAnswersForCorrectTab: () => {
|
659
|
-
listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInSetCorrectAnswerSection('Common answer for stem 1', 0);
|
660
|
-
listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInSetCorrectAnswerSection('Correct answer for stem 2', 1);
|
661
|
-
listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInSetCorrectAnswerSection('Correct answer for stem 3', 2);
|
662
|
-
listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInSetCorrectAnswerSection('Common answer for stem 4', 3);
|
663
|
-
},
|
664
|
-
|
665
|
-
setCorrectAnswersForAlternateTab: () => {
|
666
|
-
listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInSetCorrectAnswerSection('Common answer for stem 1', 0);
|
667
|
-
listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInSetCorrectAnswerSection('Alternate answer for stem 2', 1);
|
668
|
-
listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInSetCorrectAnswerSection('Alternate answer for stem 3', 2);
|
669
|
-
listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInSetCorrectAnswerSection('Common answer for stem 4', 3);
|
670
|
-
},
|
671
|
-
|
672
|
-
setQuestionStemsAndGroupedOptionsForScoringWithoutAlternateTab: () => {
|
673
|
-
listMatchingPage.steps.deleteStem(2);
|
674
|
-
listMatchingPage.steps.addInputToAllStemFields(['Stem 1', 'Stem 2']);
|
675
|
-
listMatchingPage.steps.selectResponseOptionsLayout('Grouped');
|
676
|
-
listMatchingPage.steps.addGroupTitle(0, 'Group 1');
|
677
|
-
listMatchingPage.steps.deleteResponseOptionInputField(2);
|
678
|
-
listMatchingPage.steps.addInputToOptionsForGroupedResponseLayout(0, ['Correct answer for stem 1', 'Incorrect answer 1']);
|
679
|
-
listMatchingPage.steps.addGroup();
|
680
|
-
listMatchingPage.steps.addGroupTitle(1, 'Group 2');
|
681
|
-
listMatchingPage.steps.addInputToOptionsForGroupedResponseLayout(1, ['Correct answer for stem 2', 'Incorrect answer 2']);
|
682
|
-
},
|
683
|
-
|
684
|
-
setQuestionStemsAndGroupedOptionsForScoringWithAlternateTab: () => {
|
685
|
-
listMatchingPage.steps.addInputToAllStemFields(['Stem 1', 'Stem 2', 'Stem 3']);
|
686
|
-
listMatchingPage.steps.addStem();
|
687
|
-
listMatchingPage.steps.addInputToStemField(3, 'Stem 4');
|
688
|
-
listMatchingPage.steps.selectResponseOptionsLayout('Grouped');
|
689
|
-
listMatchingPage.steps.addGroupTitle(0, 'Group 1');
|
690
|
-
listMatchingPage.steps.addOptionInGroupedResponseLayout(0);
|
691
|
-
listMatchingPage.steps.addInputToOptionsForGroupedResponseLayout(0, ['Common answer for stem 1', 'Correct answer for stem 2', 'Alternate answer for stem 2', 'Incorrect answer 1']);
|
692
|
-
listMatchingPage.steps.addGroup();
|
693
|
-
listMatchingPage.steps.addGroupTitle(1, 'Group 2');
|
694
|
-
listMatchingPage.steps.addOptionInGroupedResponseLayout(1);
|
695
|
-
listMatchingPage.steps.addOptionInGroupedResponseLayout(1);
|
696
|
-
listMatchingPage.steps.addInputToOptionsForGroupedResponseLayout(1, ['Common answer for stem 4', 'Correct answer for stem 3', 'Alternate answer for stem 3', 'Incorrect answer 2']);
|
697
|
-
},
|
698
|
-
|
699
|
-
verifyInactiveStateOfAllStemResponseAreasInSetCorrectAnswerSection: () => {
|
700
|
-
listMatchingPage.setCorrectAnswerStemResponseArea()
|
701
|
-
.each($element => {
|
702
|
-
cy.wrap($element)
|
703
|
-
.should('not.have.class', 'isActiveForDrop');
|
704
|
-
});
|
705
|
-
},
|
706
|
-
|
707
|
-
verifyInactiveStateOfAllStemResponseAreasInPreviewTab: () => {
|
708
|
-
listMatchingPage.previewTabStemResponseArea()
|
709
|
-
.each($element => {
|
710
|
-
cy.wrap($element)
|
711
|
-
.should('not.have.class', 'isActiveForDrop');
|
712
|
-
});
|
713
|
-
},
|
714
|
-
|
715
|
-
/**
|
716
|
-
* @param {number} responseAreaIndex Index of the stem response area in set correct answer section
|
717
|
-
* @description Verify inactive state of stem response area in set correct answer section
|
718
|
-
*/
|
719
|
-
verifyInactiveStateOfStemResponseAreaInSetCorrectAnswerSection: (responseAreaIndex) => {
|
720
|
-
listMatchingPage.setCorrectAnswerStemResponseArea()
|
721
|
-
.eq(responseAreaIndex)
|
722
|
-
.should('not.have.class', 'isActiveForDrop');
|
723
|
-
},
|
724
|
-
|
725
|
-
/**
|
726
|
-
* @param {number} responseAreaIndex Index of the stem response area in preview tab
|
727
|
-
* @description Verify inactive state of stem response area in preview tab
|
728
|
-
*/
|
729
|
-
verifyInactiveStateOfStemResponseAreaInPreviewTab: (responseAreaIndex) => {
|
730
|
-
listMatchingPage.previewTabStemResponseArea()
|
731
|
-
.eq(responseAreaIndex)
|
732
|
-
.should('not.have.class', 'isActiveForDrop');
|
733
|
-
},
|
734
|
-
|
735
|
-
verifyActiveStateOfAllStemResponseAreasInSetCorrectAnswerSection: () => {
|
736
|
-
listMatchingPage.setCorrectAnswerStemResponseArea()
|
737
|
-
.each($element => {
|
738
|
-
cy.wrap($element)
|
739
|
-
.should('have.class', 'isActiveForDrop');
|
740
|
-
});
|
741
|
-
},
|
742
|
-
|
743
|
-
verifyActiveStateOfAllStemResponseAreasInPreviewTab: () => {
|
744
|
-
listMatchingPage.previewTabStemResponseArea()
|
745
|
-
.each($element => {
|
746
|
-
cy.wrap($element)
|
747
|
-
.should('have.class', 'isActiveForDrop');
|
748
|
-
});
|
749
|
-
},
|
750
|
-
|
751
|
-
/**
|
752
|
-
* @param {number} responseAreaIndex Index of the stem response area in set correct answer section
|
753
|
-
* @description Verify active state of stem response area in set correct answer section
|
754
|
-
*/
|
755
|
-
verifyActiveStateOfStemResponseAreaInSetCorrectAnswerSection: (responseAreaIndex) => {
|
756
|
-
listMatchingPage.setCorrectAnswerStemResponseArea()
|
757
|
-
.eq(responseAreaIndex)
|
758
|
-
.should('have.class', 'isActiveForDrop');
|
759
|
-
},
|
760
|
-
|
761
|
-
/**
|
762
|
-
* @param {number} responseAreaIndex Index of the stem response area in preview tab
|
763
|
-
* @description Verify active state of stem response area in preview tab
|
764
|
-
*/
|
765
|
-
verifyActiveStateOfStemResponseAreaInPreviewTab: (responseAreaIndex) => {
|
766
|
-
listMatchingPage.previewTabStemResponseArea()
|
767
|
-
.eq(responseAreaIndex)
|
768
|
-
.should('have.class', 'isActiveForDrop');
|
769
|
-
},
|
770
|
-
|
771
|
-
/**
|
772
|
-
* @param {number} responseAreaIndex Index of the stem response area in set correct answer section
|
773
|
-
* @description Verify inactive state of filled stem response area in set correct answer section
|
774
|
-
*/
|
775
|
-
verifyInactiveStateOfFilledStemResponseAreaInSetCorrectAnswerSection: (responseAreaIndex) => {
|
776
|
-
listMatchingPage.setCorrectAnswerStemResponseArea()
|
777
|
-
.eq(responseAreaIndex)
|
778
|
-
.should('not.have.class', 'isActiveForDrop');
|
779
|
-
},
|
780
|
-
|
781
|
-
/**
|
782
|
-
* @param {number} responseAreaIndex Index of the stem response area in preview tab
|
783
|
-
* @description Verify inactive state of filled stem response area in preview tab
|
784
|
-
*/
|
785
|
-
verifyInactiveStateOfFilledStemResponseAreaInPreviewTab: (responseAreaIndex) => {
|
786
|
-
listMatchingPage.previewTabStemResponseArea()
|
787
|
-
.eq(responseAreaIndex)
|
788
|
-
.should('not.have.class', 'isActiveForDrop');
|
789
|
-
},
|
790
|
-
|
791
|
-
/**
|
792
|
-
* @param {number} responseAreaIndex Index of the stem response area in set correct answer section
|
793
|
-
* @description Verify drag handle is not visible in filled stem response area in set correct answer section
|
794
|
-
*/
|
795
|
-
verifyDragHandleNotVisibleInFilledResponseAreaInSetCorrectAnswerSection: (responseAreaIndex) => {
|
796
|
-
listMatchingPage.setCorrectAnswerStemResponseArea()
|
797
|
-
.eq(responseAreaIndex)
|
798
|
-
.within(() => {
|
799
|
-
listMatchingPage.draggableOptionDragIcon()
|
800
|
-
.should('not.exist');
|
801
|
-
})
|
802
|
-
},
|
803
|
-
|
804
|
-
/**
|
805
|
-
* @param {number} groupIndex Index of group of options in set correct answer section
|
806
|
-
* @param {string} groupTitle Title of group of options in set correct answer section
|
807
|
-
* @param {string[]} OptionsArray Array of options displayed in the group of options in set correct answer section
|
808
|
-
* @description Verify group of options displayed in set correct answer section
|
809
|
-
*/
|
810
|
-
verifyGroupedResponseOptionsInSetCorrectAnswerSection: (groupIndex, groupTitle, OptionsArray) => {
|
811
|
-
listMatchingPage.setCorrectAnswerSectionGroupedResponseTitle()
|
812
|
-
.eq(groupIndex)
|
813
|
-
.verifyInnerText(groupTitle)
|
814
|
-
listMatchingPage.setCorrectAnswerSectionGroupedResponseContainer()
|
815
|
-
.eq(groupIndex)
|
816
|
-
.within(() => {
|
817
|
-
OptionsArray.forEach((optionText, optionIndex) => {
|
818
|
-
listMatchingPage.draggableOption()
|
819
|
-
.eq(optionIndex)
|
820
|
-
.should('have.text', optionText)
|
821
|
-
.and('be.visible');
|
822
|
-
});
|
823
|
-
});
|
824
|
-
},
|
825
|
-
|
826
|
-
/**
|
827
|
-
* @param {number} groupIndex Index of group of options in preview tab
|
828
|
-
* @param {string} groupTitle Title of group of options in preview tab
|
829
|
-
* @param {string[]} OptionsArray Array of options displayed in the group of options in preview tab
|
830
|
-
* @description Verify group of options displayed preview tab
|
831
|
-
*/
|
832
|
-
verifyGroupedResponseOptionsInPreviewTab: (groupIndex, groupTitle, OptionsArray) => {
|
833
|
-
listMatchingPage.previewTabGroupedResponseTitle()
|
834
|
-
.eq(groupIndex)
|
835
|
-
.verifyInnerText(groupTitle)
|
836
|
-
listMatchingPage.previewTabGroupedResponseContainer()
|
837
|
-
.eq(groupIndex)
|
838
|
-
.within(() => {
|
839
|
-
OptionsArray.forEach((optionText, optionIndex) => {
|
840
|
-
listMatchingPage.draggableOption()
|
841
|
-
.eq(optionIndex)
|
842
|
-
.should('have.text', optionText)
|
843
|
-
.and('be.visible');
|
844
|
-
});
|
845
|
-
});
|
846
|
-
},
|
847
|
-
|
848
|
-
/**
|
849
|
-
* @param {number} index Index of points input field
|
850
|
-
* @description Verify points input is enabled
|
851
|
-
*/
|
852
|
-
verifyPointsInputFieldIsEnabled: (index) => {
|
853
|
-
listMatchingPage.pointsInputField()
|
854
|
-
.eq(index)
|
855
|
-
.should('be.enabled');
|
856
|
-
},
|
857
|
-
|
858
|
-
/**
|
859
|
-
* @param {number} responseAreaIndex Index of the stem response area in preview tab
|
860
|
-
* @description Verify drag handle is not visible in filled stem response area in preview tab
|
861
|
-
*/
|
862
|
-
verifyDragHandleNotVisibleInFilledResponseAreaInPreviewTab: (responseAreaIndex) => {
|
863
|
-
listMatchingPage.previewTabStemResponseArea()
|
864
|
-
.eq(responseAreaIndex)
|
865
|
-
.within(() => {
|
866
|
-
listMatchingPage.draggableOptionDragIcon()
|
867
|
-
.should('not.exist');
|
868
|
-
});
|
869
|
-
},
|
870
|
-
|
871
|
-
/**
|
872
|
-
* @param {number} responseAreaIndex Index of the stem response area in set correct answer section
|
873
|
-
* @description Select response area by clicking on it
|
874
|
-
*/
|
875
|
-
clickOnResponseAreaInSetCorrectAnswerSection: (responseAreaIndex) => {
|
876
|
-
listMatchingPage.setCorrectAnswerStemResponseArea()
|
877
|
-
.eq(responseAreaIndex)
|
878
|
-
.click();
|
879
|
-
},
|
880
|
-
|
881
|
-
/**
|
882
|
-
* @param {number} responseAreaIndex Index of the stem response area in preview tab
|
883
|
-
* @description Select response area by clicking on it
|
884
|
-
*/
|
885
|
-
clickOnResponseAreaInPreviewTab: (responseAreaIndex) => {
|
886
|
-
listMatchingPage.previewTabStemResponseArea()
|
887
|
-
.eq(responseAreaIndex)
|
888
|
-
.click();
|
889
|
-
},
|
890
|
-
|
891
|
-
/**
|
892
|
-
* @param {number} responseAreaIndex Index of the stem response area in set correct answer section
|
893
|
-
* @description Verify errored state of empty stem response area in set correct answer section
|
894
|
-
*/
|
895
|
-
verifyErroredStateOfEmptyResponseFieldInSetCorrectAnswerSection: (responseAreaIndex) => {
|
896
|
-
listMatchingPage.setCorrectAnswerStemResponseArea()
|
897
|
-
.eq(responseAreaIndex)
|
898
|
-
.should('have.class', 'isEmpty')
|
899
|
-
.and('have.class', 'error');
|
900
|
-
},
|
901
|
-
|
902
|
-
/**
|
903
|
-
* @param {number} responseAreaIndex Index of the stem response area in preview tab
|
904
|
-
* @description Verify errored state of empty stem response area in preview tab
|
905
|
-
*/
|
906
|
-
verifyErroredStateOfEmptyResponseFieldInPreviewTab: (responseAreaIndex) => {
|
907
|
-
listMatchingPage.previewTabStemResponseArea()
|
908
|
-
.eq(responseAreaIndex)
|
909
|
-
.should('have.class', 'isEmpty')
|
910
|
-
.and('have.class', 'error');
|
911
|
-
},
|
912
|
-
|
913
|
-
/**
|
914
|
-
* @param {number} responseAreaIndex Index of the stem response area in set correct answer section
|
915
|
-
* @description Verify non-errored state of filled stem response area in set correct answer section
|
916
|
-
*/
|
917
|
-
verifyNonErroredStateOfFilledResponseFieldInSetCorrectAnswerSection: (responseAreaIndex) => {
|
918
|
-
listMatchingPage.setCorrectAnswerStemResponseArea()
|
919
|
-
.eq(responseAreaIndex)
|
920
|
-
.should('not.have.class', 'isEmpty')
|
921
|
-
.and('not.have.class', 'error');
|
922
|
-
},
|
923
|
-
|
924
|
-
/**
|
925
|
-
* @param {number} responseAreaIndex Index of the stem response area in preview tab
|
926
|
-
* @description Verify non-errored state of filled stem response area in preview tab
|
927
|
-
*/
|
928
|
-
verifyNonErroredStateOfFilledResponseFieldInPreviewTab: (responseAreaIndex) => {
|
929
|
-
listMatchingPage.previewTabStemResponseArea()
|
930
|
-
.eq(responseAreaIndex)
|
931
|
-
.should('not.have.class', 'isEmpty')
|
932
|
-
.and('not.have.class', 'error');
|
933
|
-
},
|
934
|
-
|
935
|
-
verifyPleaseSetACorrectAnswerErrorMessage: () => {
|
936
|
-
commonComponents.errorMessage()
|
937
|
-
.verifyInnerText('Error: Please set a correct answer.')
|
938
|
-
.should('be.visible');
|
939
|
-
},
|
940
|
-
|
941
|
-
/**
|
942
|
-
* @param {string[]} responseTextArray Array of text in option input field
|
943
|
-
* @description Verify text present in options input fields
|
944
|
-
*/
|
945
|
-
verifyOptionInputFieldContentsInOptionsSection: (responseTextArray) => {
|
946
|
-
listMatchingPage.responseOptionsSectionWrapper()
|
947
|
-
.within(() => {
|
948
|
-
responseTextArray.forEach((responseFieldText, optionIndex) => {
|
949
|
-
optionsWrapperComponent.optionsInputField()
|
950
|
-
.eq(optionIndex)
|
951
|
-
.should('have.text', responseFieldText);
|
952
|
-
optionsWrapperComponent.optionNumeration()
|
953
|
-
.eq(optionIndex)
|
954
|
-
.should('have.text', optionIndex + 1);
|
955
|
-
});
|
956
|
-
optionsWrapperComponent.optionsInputField()
|
957
|
-
.should('have.length', responseTextArray.length);
|
958
|
-
});
|
959
|
-
},
|
960
|
-
|
961
|
-
verifyDisabledStateOfOptionDeleteButton: () => { //Added this function separately as common function does not work for list matching due to similar DOM structure for stem and option fields
|
962
|
-
listMatchingPage.responseOptionsSectionWrapper()
|
963
|
-
.within(() => {
|
964
|
-
optionsWrapperComponent.deleteOptionButton()
|
965
|
-
.each(($element) => {
|
966
|
-
cy.wrap($element)
|
967
|
-
.should('be.disabled');
|
968
|
-
});
|
969
|
-
});
|
970
|
-
},
|
971
|
-
|
972
|
-
verifyOptionsForDragAndDropContentsInSetCorrectAnswerSection: () => { //Added this as function in line no. 766 does not work for list matching due to similar DOM structure for stem and option fields
|
973
|
-
listMatchingPage.responseOptionsSectionWrapper()
|
974
|
-
.within(() => {
|
975
|
-
draggableOptionContainer.steps.verifyDraggableOptionInOptionsContainerSpecifyCorrectAnswerSection();
|
976
|
-
});
|
977
|
-
},
|
978
|
-
|
979
|
-
/**
|
980
|
-
* Verifies the numeration of response area in the question preview.
|
981
|
-
* @param {Array<string>} numerationArray - An array of expected numeration values for response areas.
|
982
|
-
* @returns {void}
|
983
|
-
*/
|
984
|
-
verifyNumerationOfResponseAreasInQuestionPreview: (numerationArray) => {
|
985
|
-
numerationArray.forEach((option, count) => {
|
986
|
-
utilities.verifyTextContent(listMatchingPage.responseAreaNumeration().eq(count), option);
|
987
|
-
utilities.verifyElementVisibilityState(listMatchingPage.responseAreaNumeration().eq(count), 'visible');
|
988
|
-
});
|
989
|
-
},
|
990
|
-
|
991
|
-
/**
|
992
|
-
* Verifies the numeration of correct answer container.
|
993
|
-
* @param {Array<string>} numerationArray - An array of expected numeration values for response areas.
|
994
|
-
* @returns {void}
|
995
|
-
*/
|
996
|
-
verifyCorrectAnswerContainerNumeration: (numerationArray) => {
|
997
|
-
numerationArray.forEach((option, count) => {
|
998
|
-
utilities.verifyTextContent(listMatchingPage.previewTabCorrectAnswerResponseNumerationWrapper().eq(count), option);
|
999
|
-
utilities.verifyElementVisibilityState(listMatchingPage.previewTabCorrectAnswerResponseNumerationWrapper().eq(count), 'visible');
|
1000
|
-
});
|
1001
|
-
},
|
1002
|
-
|
1003
|
-
clickOnResponseOptionPlacementDropdown: () => {
|
1004
|
-
listMatchingPage.responseOptionPlacementDropdown()
|
1005
|
-
.click();
|
1006
|
-
},
|
1007
|
-
|
1008
|
-
/**
|
1009
|
-
* @param {string[]} optionsArray
|
1010
|
-
* @description Verify response options placement dropdown list
|
1011
|
-
*/
|
1012
|
-
verifyResponseOptionPlacementDropdownOptions: (optionsArray) => {
|
1013
|
-
listMatchingPage.responseOptionPlacementDropdownListOption()
|
1014
|
-
.each(($el, index) => {
|
1015
|
-
cy.wrap($el)
|
1016
|
-
.should('have.text', optionsArray[index]);
|
1017
|
-
});
|
1018
|
-
},
|
1019
|
-
|
1020
|
-
/**
|
1021
|
-
* Selects an option from the response option placement dropdown list.
|
1022
|
-
* @param {string} dropdownOption - The option to select from the dropdown list ('Bottom', 'Top', 'Left', or 'Right')
|
1023
|
-
* @returns {void}
|
1024
|
-
*/
|
1025
|
-
selectResponseOptionPlacementDropdownOption: (dropdownOption) => {
|
1026
|
-
listMatchingPage.responseOptionPlacementDropdownListOption(dropdownOption)
|
1027
|
-
.click();
|
1028
|
-
},
|
1029
|
-
|
1030
|
-
/**
|
1031
|
-
* Verifies the placement option of a response option in the preview tab.
|
1032
|
-
* @param {string} placementOption - The placement option to verify ('Bottom', 'Top', 'Left', or 'Right').
|
1033
|
-
* @throws {Error} Throws an error if an invalid placement option is provided.
|
1034
|
-
*/
|
1035
|
-
verifyResponseOptionPlacementPreviewTab: (placementOption) => {
|
1036
|
-
switch (placementOption) {
|
1037
|
-
case 'Bottom':
|
1038
|
-
listMatchingPage.questionPreviewWrapper()
|
1039
|
-
.should('have.class', 'placement-bottom');
|
1040
|
-
break;
|
1041
|
-
case 'Top':
|
1042
|
-
listMatchingPage.questionPreviewWrapper()
|
1043
|
-
.should('have.class', 'placement-top');
|
1044
|
-
break;
|
1045
|
-
case 'Left':
|
1046
|
-
listMatchingPage.questionPreviewWrapper()
|
1047
|
-
.should('have.class', 'placement-left');
|
1048
|
-
break;
|
1049
|
-
case 'Right':
|
1050
|
-
listMatchingPage.questionPreviewWrapper()
|
1051
|
-
.should('have.class', 'placement-right');
|
1052
|
-
break;
|
1053
|
-
default:
|
1054
|
-
throw new Error('Invalid placement option');
|
1055
|
-
}
|
1056
|
-
},
|
1057
|
-
|
1058
|
-
/**
|
1059
|
-
* Verifies the value of the stem column header input field.
|
1060
|
-
* @param {string} stemHeader - The expected input field value to compare against.
|
1061
|
-
* @returns {void}
|
1062
|
-
*/
|
1063
|
-
verifyStemColumnHeaderInputFieldValue: (stemHeader) => {
|
1064
|
-
listMatchingPage.stemColumnHeaderInputField()
|
1065
|
-
.should('have.attr', 'value', stemHeader)
|
1066
|
-
},
|
1067
|
-
|
1068
|
-
/**
|
1069
|
-
* Enters text into the stem column header input field.
|
1070
|
-
* @param {string} text - The text to be entered into the stem column header input field.
|
1071
|
-
* @returns {void}
|
1072
|
-
*/
|
1073
|
-
enterTextInStemColumnHeaderInputField: (text) => {
|
1074
|
-
listMatchingPage.stemColumnHeaderInputField()
|
1075
|
-
.type(text, { delay: 0 })
|
1076
|
-
.blur();
|
1077
|
-
},
|
1078
|
-
|
1079
|
-
clearTextInStemColumnHeaderInputField: () => {
|
1080
|
-
listMatchingPage.stemColumnHeaderInputField()
|
1081
|
-
.clear();
|
1082
|
-
},
|
1083
|
-
|
1084
|
-
/**
|
1085
|
-
* Verifies the value of the response column header input field.
|
1086
|
-
* @param {string} responseHeader - The expected input field value to compare against.
|
1087
|
-
* @returns {void}
|
1088
|
-
*/
|
1089
|
-
verifyResponseColumnHeaderInputFieldValue: (responseHeader) => {
|
1090
|
-
listMatchingPage.ResponseColumnHeaderInputField()
|
1091
|
-
.should('have.attr', 'value', responseHeader)
|
1092
|
-
},
|
1093
|
-
|
1094
|
-
/**
|
1095
|
-
* Enters text into the stem column header input field.
|
1096
|
-
* @param {string} text - The text to be entered into the stem column header input field.
|
1097
|
-
* @returns {void}
|
1098
|
-
*/
|
1099
|
-
enterTextInResponseColumnHeaderInputField: (text) => {
|
1100
|
-
listMatchingPage.ResponseColumnHeaderInputField()
|
1101
|
-
.type(text, { delay: 0 })
|
1102
|
-
.blur();
|
1103
|
-
},
|
1104
|
-
|
1105
|
-
clearTextInResponseColumnHeaderInputField: () => {
|
1106
|
-
listMatchingPage.ResponseColumnHeaderInputField()
|
1107
|
-
.clear();
|
1108
|
-
},
|
1109
|
-
|
1110
|
-
verifyStemFieldErrorMessage: () => {
|
1111
|
-
listMatchingPage.stemWrapper()
|
1112
|
-
.each(($element) => {
|
1113
|
-
cy.wrap($element)
|
1114
|
-
.within(() => {
|
1115
|
-
utilities.verifyTextContent(listMatchingPage.errorMessage(), 'Error: Stem is required.');
|
1116
|
-
});
|
1117
|
-
});
|
1118
|
-
},
|
1119
|
-
|
1120
|
-
verifyOptionFieldErrorMessage: () => {
|
1121
|
-
listMatchingPage.optionWrapper()
|
1122
|
-
.each(($element) => {
|
1123
|
-
cy.wrap($element)
|
1124
|
-
.within(() => {
|
1125
|
-
utilities.verifyTextContent(listMatchingPage.errorMessage(), 'Error: Option is required.');
|
1126
|
-
});
|
1127
|
-
});
|
1128
|
-
},
|
1129
|
-
|
1130
|
-
verifySetCorrectAnswerErrorMessage: () => {
|
1131
|
-
listMatchingPage.setCorrectAnswerStemRow()
|
1132
|
-
.eq(0)
|
1133
|
-
.parents('.cloze-with-text-response-form-controls-wrapper')
|
1134
|
-
.within(() => {
|
1135
|
-
utilities.verifyTextContent(listMatchingPage.errorMessage(), 'Error: Please set a correct answer.');
|
1136
|
-
});
|
1137
|
-
}
|
1138
|
-
}
|
1139
|
-
|
1140
|
-
const tests = {
|
1141
|
-
...createQuestionBasePage.tests,
|
1142
|
-
...questionInstructionsComponent.tests,
|
1143
|
-
...autoScoredScoringSection.tests,
|
1144
|
-
...autoScoredScoringSectionMultipleResponsesType.tests,
|
1145
|
-
...autoScoredSetCorrectAnswerSection.tests,
|
1146
|
-
...scoringSectionBase.tests,
|
1147
|
-
...previewScoringAndShowCorrectAnswerComponent.tests,
|
1148
|
-
...draggableOptionContainer.tests,
|
1149
|
-
...commonComponents.tests,
|
1150
|
-
...additionalSettingsPanel.tests,
|
1151
|
-
...studentResponseAndLayoutComponent.tests,
|
1152
|
-
...answerNumerationComponent.tests,
|
1153
|
-
...autoScoredAdditionalSettings.tests,
|
1154
|
-
|
1155
|
-
verifyDefaultStemFieldsAndResponseAreasInSetCorrectAnswerSection: () => {
|
1156
|
-
it('Three stem fields and three empty response areas should be displayed in the set correct answer section', () => {
|
1157
|
-
listMatchingPage.setCorrectAnswerStemRow()
|
1158
|
-
.should('have.length', '3')
|
1159
|
-
.each(($element) => {
|
1160
|
-
cy.wrap($element)
|
1161
|
-
.within(() => {
|
1162
|
-
listMatchingPage.setCorrectAnswerStemField()
|
1163
|
-
.should('be.visible')
|
1164
|
-
.verifyInnerText('');
|
1165
|
-
listMatchingPage.setCorrectAnswerStemResponseArea()
|
1166
|
-
.should('be.visible')
|
1167
|
-
.verifyInnerText('');
|
1168
|
-
});
|
1169
|
-
});
|
1170
|
-
});
|
1171
|
-
},
|
1172
|
-
|
1173
|
-
verifyDragToReorderTooltipInOptionsSection: () => {
|
1174
|
-
it('When the user hovers over the drag handle of the options then \'Drag to reorder\' message should be displayed on a tooltip and the tooltip should disappear if focus is removed from the drag handle', () => {
|
1175
|
-
listMatchingPage.optionWrapper()
|
1176
|
-
.eq(0)
|
1177
|
-
.within(() => {
|
1178
|
-
commonComponents.dragHandleButton()
|
1179
|
-
.trigger('mouseover');
|
1180
|
-
});
|
1181
|
-
commonComponents.tooltipText()
|
1182
|
-
.should('be.visible')
|
1183
|
-
.verifyInnerText('Drag to reorder');
|
1184
|
-
listMatchingPage.optionWrapper()
|
1185
|
-
.eq(0)
|
1186
|
-
.within(() => {
|
1187
|
-
commonComponents.dragHandleButton()
|
1188
|
-
.trigger('mouseout');
|
1189
|
-
});
|
1190
|
-
commonComponents.tooltipText()
|
1191
|
-
.should('not.exist');
|
1192
|
-
});
|
1193
|
-
|
1194
|
-
it('CSS of drag handle tooltip', { tags: 'css' }, () => {
|
1195
|
-
listMatchingPage.optionWrapper()
|
1196
|
-
.eq(0)
|
1197
|
-
.within(() => {
|
1198
|
-
listMatchingPage.dragHandleButton()
|
1199
|
-
.trigger('mouseover');
|
1200
|
-
});
|
1201
|
-
listMatchingPage.tooltipText()
|
1202
|
-
.should('be.visible')
|
1203
|
-
.verifyCSS(css.color.whiteText, css.fontSize.small, css.fontWeight.regular);
|
1204
|
-
listMatchingPage.optionWrapper()
|
1205
|
-
.eq(0)
|
1206
|
-
.within(() => {
|
1207
|
-
listMatchingPage.dragHandleButton()
|
1208
|
-
.trigger('mouseout');
|
1209
|
-
});
|
1210
|
-
listMatchingPage.tooltipText()
|
1211
|
-
.should('not.exist');
|
1212
|
-
});
|
1213
|
-
|
1214
|
-
it('Accessibility of drag handle tooltip', { tags: 'a11y' }, () => {
|
1215
|
-
listMatchingPage.optionWrapper()
|
1216
|
-
.eq(0)
|
1217
|
-
.within(() => {
|
1218
|
-
listMatchingPage.dragHandleButton()
|
1219
|
-
.trigger('mouseover');
|
1220
|
-
});
|
1221
|
-
listMatchingPage.tooltipText()
|
1222
|
-
.should('be.visible');
|
1223
|
-
cy.checkAccessibility(listMatchingPage.tooltipText());
|
1224
|
-
listMatchingPage.optionWrapper()
|
1225
|
-
.eq(0)
|
1226
|
-
.within(() => {
|
1227
|
-
listMatchingPage.dragHandleButton()
|
1228
|
-
.trigger('mouseout');
|
1229
|
-
});
|
1230
|
-
listMatchingPage.tooltipText()
|
1231
|
-
.should('not.exist');
|
1232
|
-
});
|
1233
|
-
},
|
1234
|
-
|
1235
|
-
verifyToolTipForDisabledDeleteOptionButton: () => {
|
1236
|
-
it('When the user hovers over the disabled delete buttons of the options then \'Minimum two options are required\' message should be displayed on a tooltip and the tooltip should disappear if focus is removed from the delete button', () => {
|
1237
|
-
listMatchingPage.optionWrapper()
|
1238
|
-
.eq(0)
|
1239
|
-
.within(() => {
|
1240
|
-
listMatchingPage.deleteOptionButton()
|
1241
|
-
.trigger('mouseover', { force: true });
|
1242
|
-
});
|
1243
|
-
commonComponents.tooltipText()
|
1244
|
-
.verifyInnerText('Minimum two options are required');
|
1245
|
-
listMatchingPage.optionWrapper()
|
1246
|
-
.eq(0)
|
1247
|
-
.within(() => {
|
1248
|
-
listMatchingPage.deleteOptionButton()
|
1249
|
-
.trigger('mouseout', { force: true });
|
1250
|
-
});
|
1251
|
-
commonComponents.tooltipText()
|
1252
|
-
.should('not.exist');
|
1253
|
-
});
|
1254
|
-
|
1255
|
-
it('CSS of disabled delete button tooltip', { tags: 'css' }, () => {
|
1256
|
-
listMatchingPage.optionWrapper()
|
1257
|
-
.eq(0)
|
1258
|
-
.within(() => {
|
1259
|
-
listMatchingPage.deleteOptionButton()
|
1260
|
-
.trigger('mouseover', { force: true });
|
1261
|
-
});
|
1262
|
-
commonComponents.tooltipText()
|
1263
|
-
.should('be.visible')
|
1264
|
-
.verifyCSS(css.color.whiteText, css.fontSize.small, css.fontWeight.regular);
|
1265
|
-
listMatchingPage.optionWrapper()
|
1266
|
-
.eq(0)
|
1267
|
-
.within(() => {
|
1268
|
-
listMatchingPage.deleteOptionButton()
|
1269
|
-
.trigger('mouseout', { force: true });
|
1270
|
-
});
|
1271
|
-
commonComponents.tooltipText()
|
1272
|
-
.should('not.exist');
|
1273
|
-
});
|
1274
|
-
|
1275
|
-
it('Accessibility of disabled delete button tooltip', { tags: 'a11y' }, () => {
|
1276
|
-
listMatchingPage.optionWrapper()
|
1277
|
-
.eq(0)
|
1278
|
-
.within(() => {
|
1279
|
-
listMatchingPage.deleteOptionButton()
|
1280
|
-
.trigger('mouseover', { force: true });
|
1281
|
-
});
|
1282
|
-
commonComponents.tooltipText()
|
1283
|
-
.should('be.visible');
|
1284
|
-
cy.checkAccessibility(commonComponents.tooltipText());
|
1285
|
-
listMatchingPage.optionWrapper()
|
1286
|
-
.eq(0)
|
1287
|
-
.within(() => {
|
1288
|
-
listMatchingPage.deleteOptionButton()
|
1289
|
-
.trigger('mouseout', { force: true });
|
1290
|
-
});
|
1291
|
-
commonComponents.tooltipText()
|
1292
|
-
.should('not.exist');
|
1293
|
-
});
|
1294
|
-
},
|
1295
|
-
|
1296
|
-
verifyToolTipForEnabledDeleteOptionButton: () => {
|
1297
|
-
it('when the user hovers over the enabled \'Delete\' icon buttons, then \'Delete option\' message should be displayed on a tooltip and the tooltip should disappear if focus is removed from the \'Delete\' icon button', () => {
|
1298
|
-
listMatchingPage.optionWrapper()
|
1299
|
-
.eq(0)
|
1300
|
-
.within(() => {
|
1301
|
-
cy.log('Pre step: Focusing out of the newly added option input field')
|
1302
|
-
optionsWrapperComponent.optionsInputField()
|
1303
|
-
.eq(2)
|
1304
|
-
.blur();
|
1305
|
-
listMatchingPage.deleteOptionButton()
|
1306
|
-
.trigger('mouseover', { force: true });
|
1307
|
-
});
|
1308
|
-
commonComponents.tooltipText()
|
1309
|
-
.verifyInnerText('Delete option');
|
1310
|
-
listMatchingPage.optionWrapper()
|
1311
|
-
.eq(0)
|
1312
|
-
.within(() => {
|
1313
|
-
listMatchingPage.deleteOptionButton()
|
1314
|
-
.trigger('mouseout', { force: true });
|
1315
|
-
});
|
1316
|
-
commonComponents.tooltipText()
|
1317
|
-
.should('not.exist');
|
1318
|
-
});
|
1319
|
-
|
1320
|
-
it('CSS of enabled delete button tooltip', { tags: 'css' }, () => {
|
1321
|
-
listMatchingPage.optionWrapper()
|
1322
|
-
.eq(0)
|
1323
|
-
.within(() => {
|
1324
|
-
listMatchingPage.deleteOptionButton()
|
1325
|
-
.trigger('mouseover', { force: true });
|
1326
|
-
});
|
1327
|
-
commonComponents.tooltipText()
|
1328
|
-
.should('be.visible')
|
1329
|
-
.verifyCSS(css.color.whiteText, css.fontSize.small, css.fontWeight.regular);
|
1330
|
-
listMatchingPage.optionWrapper()
|
1331
|
-
.eq(0)
|
1332
|
-
.within(() => {
|
1333
|
-
listMatchingPage.deleteOptionButton()
|
1334
|
-
.trigger('mouseout', { force: true });
|
1335
|
-
});
|
1336
|
-
commonComponents.tooltipText()
|
1337
|
-
.should('not.exist');
|
1338
|
-
});
|
1339
|
-
|
1340
|
-
it('Accessibility of enabled delete button tooltip', { tags: 'a11y' }, () => {
|
1341
|
-
listMatchingPage.optionWrapper()
|
1342
|
-
.eq(0)
|
1343
|
-
.within(() => {
|
1344
|
-
listMatchingPage.deleteOptionButton()
|
1345
|
-
.trigger('mouseover', { force: true });
|
1346
|
-
});
|
1347
|
-
commonComponents.tooltipText()
|
1348
|
-
.should('be.visible');
|
1349
|
-
cy.checkAccessibility(commonComponents.tooltipText());
|
1350
|
-
listMatchingPage.optionWrapper()
|
1351
|
-
.eq(0)
|
1352
|
-
.within(() => {
|
1353
|
-
listMatchingPage.deleteOptionButton()
|
1354
|
-
.trigger('mouseout', { force: true });
|
1355
|
-
});
|
1356
|
-
commonComponents.tooltipText()
|
1357
|
-
.should('not.exist');
|
1358
|
-
});
|
1359
|
-
},
|
1360
|
-
|
1361
|
-
verifyAutoScoredPartialEqualWeightsScoringEditTabContents: () => {
|
1362
|
-
it('User should be able to select \'Partial - equal weights\' scoring type', () => {
|
1363
|
-
listMatchingPage.steps.selectPartialEqualWeightsCheckbox();
|
1364
|
-
});
|
1365
|
-
|
1366
|
-
it('When the Points input field is empty and the user has switched to \'Partial - equal weights\' scoring, then \'Points per response\' label should be displayed and a \'-\' should be displayed besides each response, \'Penalty Points\' and \'Minimum score awarded (if attempted)\' labels and input fields should be displayed and \'Round down score\' label and checkbox should be displayed and by default it should be checked', () => {
|
1367
|
-
listMatchingPage.steps.verifyDefaultPointsLabelAndInputField();
|
1368
|
-
listMatchingPage.steps.verifyPointsPerResponseLabel();
|
1369
|
-
listMatchingPage.steps.verifyPartialEqualWeightsPointsPerResponseScore('-');
|
1370
|
-
listMatchingPage.steps.verifyDefaultPenaltyPointsInputFieldAndLabel();
|
1371
|
-
listMatchingPage.steps.verifyDefaultMinimumScoreIfAttemptedLabelAndPointsField();
|
1372
|
-
listMatchingPage.steps.verifyDefaultRoundDownScoreCheckboxCheckedAndLabel();
|
1373
|
-
});
|
1374
|
-
},
|
1375
|
-
|
1376
|
-
verifyAutoScoredPartialEqualWeightsScoringEditTabFunctionality: () => {
|
1377
|
-
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', () => {
|
1378
|
-
listMatchingPage.steps.allotPoints(6)
|
1379
|
-
listMatchingPage.steps.verifyPartialEqualWeightsPointsPerResponseScore(2);
|
1380
|
-
});
|
1381
|
-
|
1382
|
-
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', () => {
|
1383
|
-
cy.log('Pre-step: Adding a response token to question field')
|
1384
|
-
steps.addStem()
|
1385
|
-
listMatchingPage.setCorrectAnswerStemRow()
|
1386
|
-
.should('have.length', '4');
|
1387
|
-
listMatchingPage.steps.verifyPartialEqualWeightsPointsPerResponseScore(1.5)
|
1388
|
-
});
|
1389
|
-
|
1390
|
-
it('When user removes a stem, then the points per response score should be updated accordingly', () => {
|
1391
|
-
listMatchingPage.steps.deleteStem(0);
|
1392
|
-
listMatchingPage.steps.verifyPartialEqualWeightsPointsPerResponseScore(2)
|
1393
|
-
});
|
1394
|
-
|
1395
|
-
it('User should be able to enter points in \'Penalty Points\' and \'Minimum score awarded (if attempted)\' input fields', () => {
|
1396
|
-
listMatchingPage.steps.allotPenaltyPoints(1);
|
1397
|
-
listMatchingPage.steps.allotMinimumScoreAwardedIfAttempted(1);
|
1398
|
-
});
|
1399
|
-
|
1400
|
-
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' }, () => {
|
1401
|
-
listMatchingPage.pointsPerResponseLabel()
|
1402
|
-
.verifyCSS(css.color.labels, css.fontSize.normal, css.fontWeight.semibold);
|
1403
|
-
listMatchingPage.partialEqualWeightsPointsPerResponseScore()
|
1404
|
-
.verifyCSS(css.color.text, css.fontSize.default, css.fontWeight.regular);
|
1405
|
-
listMatchingPage.penaltyPointsLabel()
|
1406
|
-
.verifyCSS(css.color.labels, css.fontSize.normal, css.fontWeight.semibold);
|
1407
|
-
listMatchingPage.minimumScoreIfAttemptedLabel()
|
1408
|
-
.verifyCSS(css.color.labels, css.fontSize.normal, css.fontWeight.semibold);
|
1409
|
-
listMatchingPage.rounddownScoreCheckboxLabel()
|
1410
|
-
.verifyCSS(css.color.labels, css.fontSize.normal, css.fontWeight.semibold);
|
1411
|
-
});
|
1412
|
-
|
1413
|
-
it('Accessibility of \'Penalty Points\' and \'Minimum score awarded (if attempted)\' input field and \'Round down score\' checkbox', { tags: 'a11y' }, () => {
|
1414
|
-
cy.checkAccessibility(listMatchingPage.penaltyPointsInputField());
|
1415
|
-
cy.checkAccessibility(listMatchingPage.minimumScoreIfAttemptedInputField());
|
1416
|
-
cy.checkAccessibility(listMatchingPage.rounddownScoreCheckbox());
|
1417
|
-
});
|
1418
|
-
|
1419
|
-
it('When the user switches to \'All or nothing\' scoring, the \'Points per response\' label and the points displayed for individual responses should not be displayed, \'Minimum score awarded(If attempted)\' and \'Penalty points\' input fields should not be displayed and the points displayed in \'Points\' input field should remain unchanged', () => {
|
1420
|
-
listMatchingPage.steps.selectAllOrNothingCheckbox();
|
1421
|
-
listMatchingPage.pointsPerResponseLabel()
|
1422
|
-
.should('not.exist');
|
1423
|
-
listMatchingPage.partialEqualWeightsPointsPerResponseScore()
|
1424
|
-
.should('not.exist');
|
1425
|
-
listMatchingPage.steps.verifyPointsFieldValue(6);
|
1426
|
-
});
|
1427
|
-
|
1428
|
-
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', () => {
|
1429
|
-
listMatchingPage.steps.allotPoints(9)
|
1430
|
-
listMatchingPage.steps.selectPartialEqualWeightsCheckbox();
|
1431
|
-
listMatchingPage.steps.verifyPartialEqualWeightsPointsPerResponseScore(3);
|
1432
|
-
});
|
1433
|
-
},
|
1434
|
-
|
1435
|
-
verifyAutoScoredPartialDifferentWeightsScoringEditTabContents: () => {
|
1436
|
-
it('User should be able to select \'Partial - different weights\' scoring', () => {
|
1437
|
-
listMatchingPage.steps.selectPartialDifferentWeightsCheckbox();
|
1438
|
-
});
|
1439
|
-
|
1440
|
-
it('When the user has switched to \'Partial - different weights\' scoring, then \'Points per response\' label should be displayed and a points input field should be displayed besides each response option, \'Penalty Points\' and \'Minimum score awarded (if attempted)\' labels and input fields should be displayed and \'Round down score\' checkbox should be displayed and by default it should be checked', () => {
|
1441
|
-
listMatchingPage.steps.verifyPointsPerResponseLabel();
|
1442
|
-
listMatchingPage.steps.verifyPartialDifferentWeightsPointsInputFieldIsEmpty();
|
1443
|
-
listMatchingPage.steps.verifyDefaultPenaltyPointsInputFieldAndLabel();
|
1444
|
-
listMatchingPage.steps.verifyDefaultMinimumScoreIfAttemptedLabelAndPointsField();
|
1445
|
-
listMatchingPage.steps.verifyDefaultRoundDownScoreCheckboxCheckedAndLabel();
|
1446
|
-
});
|
1447
|
-
|
1448
|
-
it('When the user has not set any answer in the response, then the \'Points per response\' input field should be disabled', () => {
|
1449
|
-
listMatchingPage.steps.verifyPartialDifferentWeightsPointsInputFieldIsDisabled();
|
1450
|
-
});
|
1451
|
-
},
|
1452
|
-
|
1453
|
-
verifyAutoScoredPartialDifferentWeightsScoringEditTabFunctionality: () => {
|
1454
|
-
it('When user adds an answer in the stem response area then the \'Points per response\' input field should be enabled', () => {
|
1455
|
-
for (let i = 0; i < optionsForThreeResponses.length; i++) {
|
1456
|
-
listMatchingPage.steps.clickAndDropOptionInStemResponseAreaInSetCorrectAnswerSection(optionsForThreeResponses[i], i);
|
1457
|
-
listMatchingPage.steps.verifyPointsInputFieldIsEnabled(i);
|
1458
|
-
}
|
1459
|
-
});
|
1460
|
-
|
1461
|
-
it('User should be able to give a score input to \'Points per response\' input fields', () => {
|
1462
|
-
listMatchingPage.steps.addPartialDifferentWeightsPoints([2.3, 3.4, 4.5]);
|
1463
|
-
});
|
1464
|
-
|
1465
|
-
it('User should be able to enter points in \'Penalty Points\' and \'Minimum score awarded (if attempted)\' input fields', () => {
|
1466
|
-
listMatchingPage.steps.allotPenaltyPoints(1);
|
1467
|
-
listMatchingPage.steps.allotMinimumScoreAwardedIfAttempted(1);
|
1468
|
-
});
|
1469
|
-
|
1470
|
-
it('CSS of \'Points per response\' label, \'Penalty Points\' and \'Minimum score awarded (if attempted)\' and \'Round down score\' checkbox', { tags: 'css' }, () => {
|
1471
|
-
listMatchingPage.pointsPerResponseLabel()
|
1472
|
-
.verifyCSS(css.color.labels, css.fontSize.normal, css.fontWeight.semibold);
|
1473
|
-
listMatchingPage.penaltyPointsLabel()
|
1474
|
-
.verifyCSS(css.color.labels, css.fontSize.normal, css.fontWeight.semibold);
|
1475
|
-
listMatchingPage.minimumScoreIfAttemptedLabel()
|
1476
|
-
.verifyCSS(css.color.labels, css.fontSize.normal, css.fontWeight.semibold);
|
1477
|
-
listMatchingPage.rounddownScoreCheckboxLabel()
|
1478
|
-
.verifyCSS(css.color.labels, css.fontSize.normal, css.fontWeight.semiboldF);
|
1479
|
-
});
|
1480
|
-
|
1481
|
-
it('Accessibility of \'Points per response\', \'Penalty Points\' and \'Minimum score awarded (if attempted)\' input fields and \'Round down score\' checkbox', { tags: 'a11y' }, () => {
|
1482
|
-
cy.checkAccessibility(listMatchingPage.pointsInputField());
|
1483
|
-
cy.checkAccessibility(listMatchingPage.minimumScoreIfAttemptedInputField());
|
1484
|
-
cy.checkAccessibility(listMatchingPage.rounddownScoreCheckbox());
|
1485
|
-
});
|
1486
|
-
|
1487
|
-
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', () => {
|
1488
|
-
listMatchingPage.steps.selectAllOrNothingCheckbox();
|
1489
|
-
listMatchingPage.steps.verifyPointsFieldValue(10.2);
|
1490
|
-
listMatchingPage.pointsPerResponseLabel()
|
1491
|
-
.should('not.exist');
|
1492
|
-
listMatchingPage.partialEqualWeightsPointsPerResponseScore()
|
1493
|
-
.should('not.exist');
|
1494
|
-
});
|
1495
|
-
|
1496
|
-
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', () => {
|
1497
|
-
listMatchingPage.steps.allotPoints(9);
|
1498
|
-
listMatchingPage.steps.selectPartialDifferentWeightsCheckbox();
|
1499
|
-
listMatchingPage.steps.verifyPartialDifferentWeightsPointsInputFieldValue([3, 3, 3]);
|
1500
|
-
});
|
1501
|
-
},
|
1502
|
-
|
1503
|
-
verifyOptionsInAlternateTab: () => {
|
1504
|
-
it('The draggable options set by the user should also be displayed in the option container of the alternate tab in the \'Set correct answer\' section', () => {
|
1505
|
-
listMatchingPage.steps.verifyOptionsInSetCorrectAnswerSection(optionsForThreeResponses);
|
1506
|
-
});
|
1507
|
-
}
|
1508
|
-
}
|
1509
|
-
|
1510
|
-
export const listMatchingPage = {
|
1511
|
-
...selectors,
|
1512
|
-
steps,
|
1513
|
-
tests
|
1514
|
-
}
|