itemengine-cypress-automation 1.0.128 → 1.0.130
Sign up to get free protection for your applications and to get access to all the features.
- package/cypress/e2e/ILC/ContentBlocks/editTabBasics.js +210 -0
- package/cypress/e2e/ILC/ContentBlocks/previewContents.smoke.js +91 -0
- package/cypress/e2e/ILC/ContentBlocks/styleAndLayoutCustomizationSection.js +392 -0
- package/cypress/e2e/ILC/DrawingResponse/drawingResponseAdditionalSettings.js +1 -1
- package/cypress/e2e/ILC/DrawingResponse/drawingResponseBackground.js +1 -1
- package/cypress/e2e/ILC/DrawingResponse/drawingResponseCustomizeAdditionalOptions.js +2 -1
- package/cypress/e2e/ILC/DrawingResponse/drawingResponseGradingViewAndCorrectAnswerViewContents.smoke.js +2 -1
- package/cypress/e2e/ILC/EssayResponse/essayResponseSpecialCharacters.js +1 -0
- package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/Scoring/allOrNothingGroupedScoring.js +152 -0
- package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/Scoring/allOrNothingWithAlternativePointsGreaterThanCorrectPoints.js +196 -0
- package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/Scoring/allOrNothingWithCorrectPointsEqualToAlternativePoints.js +195 -0
- package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/Scoring/allOrNothingWithCorrectPointsGreaterThanAlternativePoints.js +288 -0
- package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/Scoring/manuallyAndNonScored.js +141 -0
- package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/Scoring/partialDifferentWeightsAlternativePointsGreaterThanCorrectPoints.js +245 -0
- package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/Scoring/partialDifferentWeightsBasic.js +413 -0
- package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/Scoring/partialDifferentWeightsWithCorrectPointsEqualToAlternativePoints.js +218 -0
- package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/Scoring/partialDifferentWeightsWithCorrectPointsGreaterThanAlternativePoints.js +245 -0
- package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/Scoring/partialEqualWeightsBasic.js +163 -0
- package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/Scoring/partialEqualWeightsWithAlternativePointsGreaterThanCorrectPoints.js +224 -0
- package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/Scoring/partialEqualWeightsWithCorrectPointsEqualToAlternativePoints.js +196 -0
- package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/Scoring/partialEqualWeightsWithCorrectPointsGreaterThanAlternativePoints.js +224 -0
- package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/Scoring/responseLevelAlternateAnswerBasicScoring.js +83 -0
- package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/clickAndDrop.js +653 -0
- package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/draggableOptions.js +180 -0
- package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/editTabScoringSection.js +229 -0
- package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/specifyCorrectAnswerSection.js +90 -0
- package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/switchingCasesBetweenOptionsLayout.js +50 -0
- package/cypress/e2e/ILC/FillInTheGapsDropdownNew/Scoring/allOrNothingAlternativePointsGreaterThanCorrectPoints.js +204 -0
- package/cypress/e2e/ILC/FillInTheGapsDropdownNew/Scoring/allOrNothingCorrectPointsEqualToAlternativePoints.js +204 -0
- package/cypress/e2e/ILC/FillInTheGapsDropdownNew/Scoring/allOrNothingCorrectPointsGreaterThanAlternativePoints.js +298 -0
- package/cypress/e2e/ILC/FillInTheGapsDropdownNew/Scoring/allOrNothingPenaltyScoring.js +63 -0
- package/cypress/e2e/ILC/FillInTheGapsDropdownNew/Scoring/manuallyAndNonScored.js +111 -0
- package/cypress/e2e/ILC/FillInTheGapsDropdownNew/Scoring/partialDifferentWeightsAlternativePointsGreaterThanCorrectPoints.js +231 -0
- package/cypress/e2e/ILC/FillInTheGapsDropdownNew/Scoring/partialDifferentWeightsBasic.js +90 -0
- package/cypress/e2e/ILC/FillInTheGapsDropdownNew/Scoring/partialDifferentWeightsMinimumAndPenaltyScoring.js +300 -0
- package/cypress/e2e/ILC/FillInTheGapsDropdownNew/Scoring/partialDifferentWeightsWithCorrectPointsEqualToAlternativePoints.js +232 -0
- package/cypress/e2e/ILC/FillInTheGapsDropdownNew/Scoring/partialDifferentWeightsWithCorrectPointsGreaterThanAlternativePoints.js +231 -0
- package/cypress/e2e/ILC/FillInTheGapsDropdownNew/Scoring/partialEqualWeightsBasic.js +138 -0
- package/cypress/e2e/ILC/FillInTheGapsDropdownNew/Scoring/partialEqualWeightsWithAlternativePointsGreaterThanCorrectPoints.js +213 -0
- package/cypress/e2e/ILC/FillInTheGapsDropdownNew/Scoring/partialEqualWeightsWithCorrectPointsEqualToAlternativePoints.js +186 -0
- package/cypress/e2e/ILC/FillInTheGapsDropdownNew/Scoring/partialEqualWeightsWithCorrectPointsGreaterThanAlternativePoints.js +214 -0
- package/cypress/e2e/ILC/FillInTheGapsDropdownNew/dropdownAndDropdownMenuSection.js +161 -0
- package/cypress/e2e/ILC/FillInTheGapsDropdownNew/dropdownOptionsSection.js +328 -0
- package/cypress/e2e/ILC/FillInTheGapsDropdownNew/editTabBasicSection.js +144 -0
- package/cypress/e2e/ILC/FillInTheGapsDropdownNew/editTabScoringSection.js +250 -0
- package/cypress/e2e/ILC/FillInTheGapsDropdownNew/headerSection.js +75 -0
- package/cypress/e2e/ILC/FillInTheGapsDropdownNew/minimumScoringPenaltyPointsAndRoundingDropdown.js +194 -0
- package/cypress/e2e/ILC/FillInTheGapsDropdownNew/specifyCorrectAnswerSection.js +74 -0
- package/cypress/e2e/ILC/FillInTheGapsDropdownNew/studentViewSettings.js +188 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/clickAndDrop.js +8 -8
- package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/editTabScoring.js +0 -1
- package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/specifyCorrectAnswerSection.js +4 -2
- package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/editTabScoringSection.js +1 -52
- package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/responseAnswersAndAcceptedStudentInput.js +3 -211
- package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/setLimitSection.js +39 -3
- package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/specialCharactersSection.js +1 -8
- package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/specifyCorrectAnswerSection.js +3 -1
- package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/studentViewSettings.js +2 -50
- package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/conditionalCheckboxScoring.js +325 -0
- package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/partialDifferentWeightsBasic.js +1 -146
- package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/partialDifferentWeightsMinimumAndPenaltyScoring.js +300 -0
- package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/responseLevelAlternateAnswersBasicScoring.js +78 -0
- package/cypress/e2e/ILC/FillInTheGapsTextNew/editTabScoringSection.js +265 -0
- package/cypress/e2e/ILC/FillInTheGapsTextNew/headerSection.js +75 -0
- package/cypress/e2e/ILC/FillInTheGapsTextNew/minimumScoringPenaltyPointsAndRoundingDropdown.js +194 -0
- package/cypress/e2e/ILC/FillInTheGapsTextNew/responseAnswersAndAcceptedStudentInput.js +56 -0
- package/cypress/e2e/ILC/FillInTheGapsTextNew/setLimitSection.js +40 -2
- package/cypress/e2e/ILC/FillInTheGapsTextNew/specialCharactersSection.js +249 -0
- package/cypress/e2e/ILC/FillInTheGapsTextNew/specifyCorrectAnswerSection.js +64 -0
- package/cypress/e2e/ILC/FillInTheGapsTextNew/studentViewSettings.js +128 -0
- package/cypress/e2e/ILC/Graphing/allOrNothingForAllViews.smoke.js +889 -0
- package/cypress/e2e/ILC/Graphing/checkAnswerFunctionalityForAllViews.smoke.js +168 -0
- package/cypress/e2e/ILC/Graphing/gradingViewAndCorrectAnswerView.smoke.js +203 -0
- package/cypress/e2e/ILC/Graphing/previewContentsForAllViews.smoke.js +222 -0
- package/cypress/e2e/ILC/SimpleCalculator/calculatorFunctionality.js +349 -0
- package/cypress/e2e/ILC/SimpleCalculator/previewContents.smoke.js +132 -0
- package/cypress/e2e/ILC/UploadResponse/previewContentsForAllViews.smoke.js +35 -7
- package/cypress/e2e/ILC/UploadResponse/studentViewSettingsSection.js +213 -0
- package/cypress/e2e/ILC/UploadResponse/uploadResponseAdditionalSettings.js +41 -0
- package/cypress/e2e/ILC/UploadResponse/uploadResponseEditTabBasicSections.js +377 -0
- package/cypress/e2e/ILC/UploadResponse/uploadResponsePreview.js +161 -0
- package/cypress/e2e/ILC/UploadResponse/uplodResponsePreviewUploadedFileProperties.js +250 -0
- package/cypress/e2e/migration/migration.js +4 -41
- package/cypress/e2e/migration/migration10.js +6 -43
- package/cypress/e2e/migration/migration2.js +6 -43
- package/cypress/e2e/migration/migration3.js +6 -43
- package/cypress/e2e/migration/migration4.js +6 -43
- package/cypress/e2e/migration/migration5.js +6 -43
- package/cypress/e2e/migration/migration6.js +6 -43
- package/cypress/e2e/migration/migration7.js +6 -43
- package/cypress/e2e/migration/migration8.js +6 -43
- package/cypress/e2e/migration/migration9.js +6 -43
- package/cypress/fixtures/drawingToolbarOptionsAdditionalOptionsAndSpecialAndMathCharacters.js +2 -2
- package/cypress/fixtures/theme/ilc.json +6 -1
- package/cypress/fixtures/uploadResponseFileType.js +5 -0
- package/cypress/pages/components/autoScoredSpecifyCorrectAnswerSection.js +13 -13
- package/cypress/pages/components/customizeSpecialCharacterComponent.js +24 -6
- package/cypress/pages/components/draggableOptionContainer.js +1 -0
- package/cypress/pages/components/fillInTheGapsDragAndDropCommonComponents.js +42 -4
- package/cypress/pages/components/fillInTheGapsDropdownCommonComponent.js +149 -5
- package/cypress/pages/components/fillInTheGapsTextCommonComponent.js +954 -77
- package/cypress/pages/components/questionInputFieldComponent.js +1 -1
- package/cypress/pages/components/questionInstructionsComponent.js +2 -1
- package/cypress/pages/contentBlocksPage.js +515 -0
- package/cypress/pages/drawingResponsePage.js +2 -2
- package/cypress/pages/fillInTheGapsDragAndDropPage.js +359 -3
- package/cypress/pages/fillInTheGapsDropdownPage.js +21 -1
- package/cypress/pages/fillInTheGapsOverImageDragAndDropPage.js +5 -57
- package/cypress/pages/fillInTheGapsOverImageDropdownPage.js +3 -24
- package/cypress/pages/fillInTheGapsOverImageTextPage.js +1 -435
- package/cypress/pages/fillInTheGapsTextPage.js +9 -2
- package/cypress/pages/graphingPage.js +484 -0
- package/cypress/pages/index.js +4 -1
- package/cypress/pages/simpleCalculatorPage.js +310 -0
- package/cypress/pages/uploadResponsePage.js +260 -92
- package/cypress/support/commands.js +33 -1
- package/package.json +1 -1
- package/cypress/e2e/ILC/Passage/multipageContentEditTab.js +0 -242
- package/cypress/e2e/ILC/Passage/passageAdditionalSettings.js +0 -99
- package/cypress/e2e/ILC/Passage/passageEditTab.js +0 -241
- package/cypress/e2e/ILC/Passage/passageHeaderSection.js +0 -73
- package/cypress/e2e/ILC/Passage/passagePreviewTab.js +0 -246
@@ -1,17 +1,32 @@
|
|
1
1
|
import constants from "../fixtures/constants";
|
2
2
|
import utilities from "../support/helpers/utilities";
|
3
3
|
const css = Cypress.env('css');
|
4
|
-
import { createQuestionBasePage, optionsWrapperComponent, autoScoredScoringPreviewTab, scoringSectionBaseEditTab, questionInputFieldComponent, fillInTheGapsDragAndDropCommonComponents, correctIncorrectAnswerLabelComponent, questionInstructionsComponent, autoScoredStudentViewSettings, ckEditorToolbar, equationEditorFlyout, draggableOptionContainer } from "./components"
|
4
|
+
import { createQuestionBasePage, optionsWrapperComponent, autoScoredScoringPreviewTab, scoringSectionBaseEditTab, questionInputFieldComponent, fillInTheGapsDragAndDropCommonComponents, correctIncorrectAnswerLabelComponent, questionInstructionsComponent, autoScoredStudentViewSettings, ckEditorToolbar, equationEditorFlyout, draggableOptionContainer, autoScoredScoringSectionMultiResponseType, autoScoredSpecifyCorrectAnswerSection, commonComponents, draggableOptionsSectionComponent } from "./components"
|
5
5
|
|
6
|
+
//TODO update option container selectors when https://redmine.zeuslearning.com/issues/563159 is resolved
|
6
7
|
const selectors = {
|
7
8
|
...fillInTheGapsDragAndDropCommonComponents,
|
8
9
|
...questionInstructionsComponent,
|
9
10
|
...questionInputFieldComponent,
|
11
|
+
...autoScoredScoringSectionMultiResponseType,
|
12
|
+
...optionsWrapperComponent,
|
13
|
+
...draggableOptionsSectionComponent,
|
14
|
+
...draggableOptionContainer,
|
15
|
+
...scoringSectionBaseEditTab,
|
16
|
+
...commonComponents,
|
17
|
+
...autoScoredScoringPreviewTab,
|
18
|
+
...correctIncorrectAnswerLabelComponent,
|
19
|
+
|
10
20
|
//Specify correct answer section
|
11
21
|
dropzoneSpecifyCorrectAnswerSection: () => cy.get('[class="droppable-area"] [role="button"]'),
|
12
22
|
optionContainerOptionsSpecifyCorrectAnswerSection: () => cy.get('.draggable-selected-item'),
|
23
|
+
optionsContainerSpecifyCorrectAnswerSection: () => cy.get('.draggable-wrapper'), addAlternateButtonSpecifyCorrectAnswer: () => cy.get('.alternate-option-btn-wrapper button'),
|
24
|
+
alternateAnswerPopup: () => cy.get('.alternate-option-popup-wrapper'),
|
25
|
+
alternateAnswerPopupOptionContainer: () => cy.get('.option-container'),
|
26
|
+
alternateAnswerPopupSaveButton: () => cy.get('[class*="AlternateOptionstyle__ButtonWrapper"] .ngie-button').eq(1),
|
13
27
|
|
14
28
|
//Preview tab
|
29
|
+
optionPreviewTab: () => cy.get('.draggable-selected-item'),
|
15
30
|
questionContainerPreviewTab: () => cy.get('.question-item-container'),
|
16
31
|
dropzonePreviewTab: () => cy.get('[class*="DroppableHotspotstyle__DroppableHotspotWrapper"]'),
|
17
32
|
dropzoneContainerPreviewTab: () => cy.get('.answer-status-response-preview-wrapper'),
|
@@ -25,12 +40,19 @@ const steps = {
|
|
25
40
|
...optionsWrapperComponent.steps,
|
26
41
|
...scoringSectionBaseEditTab.steps,
|
27
42
|
...autoScoredScoringPreviewTab.steps,
|
28
|
-
...fillInTheGapsDragAndDropCommonComponents.steps,
|
29
43
|
...correctIncorrectAnswerLabelComponent.steps,
|
30
44
|
...questionInstructionsComponent.steps,
|
31
45
|
...autoScoredStudentViewSettings.steps,
|
32
46
|
...ckEditorToolbar.steps,
|
33
47
|
...equationEditorFlyout.steps,
|
48
|
+
...questionInputFieldComponent.steps,
|
49
|
+
...autoScoredScoringSectionMultiResponseType.steps,
|
50
|
+
...fillInTheGapsDragAndDropCommonComponents.steps,
|
51
|
+
...autoScoredSpecifyCorrectAnswerSection.steps,
|
52
|
+
...draggableOptionsSectionComponent.steps,
|
53
|
+
...draggableOptionContainer.steps,
|
54
|
+
...commonComponents.steps,
|
55
|
+
|
34
56
|
/**
|
35
57
|
* Sets options in dropzone in the Preview Tab based on the provided optionsObject.
|
36
58
|
* @param {Object} optionsObject - An object where keys are option texts and values are dropzone indices.
|
@@ -195,9 +217,343 @@ const steps = {
|
|
195
217
|
.eq(count)
|
196
218
|
.contains(text);
|
197
219
|
},
|
220
|
+
|
221
|
+
/**
|
222
|
+
* @description Verify text of options in option container of specify correct answer section
|
223
|
+
* @param {number} index index of option
|
224
|
+
* @param {string} optionText
|
225
|
+
*/
|
226
|
+
verifyOptionContainerOptionSpecifyCorrectAnswerSection: (index, optionText) => {
|
227
|
+
utilities.verifyInnerText(utilities.getNthElement(fillInTheGapsDragAndDropPage.optionContainerOptionsSpecifyCorrectAnswerSection(), index), optionText);
|
228
|
+
},
|
229
|
+
|
230
|
+
/**
|
231
|
+
* @description Click and drop option from dropzone to option container specify correct answer section
|
232
|
+
* @param {string} optionText Text of the option
|
233
|
+
*/
|
234
|
+
clickAndDropOptionInOptionsContainerInSpecifyCorrectAnswerSection: (optionText) => {
|
235
|
+
fillInTheGapsDragAndDropPage.dropzoneSpecifyCorrectAnswerSection()
|
236
|
+
.contains(optionText)
|
237
|
+
.click({ force: true });
|
238
|
+
fillInTheGapsDragAndDropPage.optionsContainerSpecifyCorrectAnswerSection()
|
239
|
+
.click();
|
240
|
+
},
|
241
|
+
|
242
|
+
setGroupedOptions: () => {
|
243
|
+
let flowers = [['Flower', 'Petals', 'Seed', 'Pollen'],
|
244
|
+
['Leaflet', 'Leaves', 'Leaf', 'Green'],
|
245
|
+
['Stem', 'Branch', 'Trunk', 'Tree'],
|
246
|
+
['Rose', 'Lily', 'Orchid', 'Petals']
|
247
|
+
];
|
248
|
+
let groupTitles = ['Group A', 'Group B', 'Group C', 'Group D'];
|
249
|
+
draggableOptionsSectionComponent.steps.expandDraggableOptionsLayoutDropdown()
|
250
|
+
draggableOptionsSectionComponent.steps.selectOptionFromDraggableOptionsLayoutDropdown('Grouped')
|
251
|
+
draggableOptionsSectionComponent.steps.addGroupTitle(groupTitles[0]);
|
252
|
+
optionsWrapperComponent.steps.addMultipleOptionFields(2);
|
253
|
+
optionsWrapperComponent.steps.addInputToOptionsInputField(flowers[0]);
|
254
|
+
draggableOptionsSectionComponent.steps.addGroupWithTitleAndOptionsInDraggableOptionsSection(groupTitles[1], flowers[1]);
|
255
|
+
draggableOptionsSectionComponent.steps.addGroupWithTitleAndOptionsInDraggableOptionsSection(groupTitles[2], flowers[2]);
|
256
|
+
draggableOptionsSectionComponent.steps.addGroupWithTitleAndOptionsInDraggableOptionsSection(groupTitles[3], flowers[3]);
|
257
|
+
},
|
258
|
+
|
259
|
+
/**
|
260
|
+
* Sets options in dropzone in the Preview Tab based on the provided optionsObject.
|
261
|
+
* @param {Object[]} responses - An array of objects containing the responseIndex, responseText and dropzone index
|
262
|
+
* @param {number} responses[].groupIndex - The index of the group
|
263
|
+
* @param {string} responses[].responseText - The text of the option
|
264
|
+
* @param {string} responses[].dropzoneIndex - The index of the dropzone
|
265
|
+
*/
|
266
|
+
clickAndDropOptionFromNthGroupInDropzonePreviewTab: (responses) => {
|
267
|
+
responses.forEach(({ responseText, groupIndex, dropzoneIndex }) => {
|
268
|
+
draggableOptionContainer.groupedOptionsContainerPreviewTab()
|
269
|
+
.eq(groupIndex)
|
270
|
+
.within(() => {
|
271
|
+
fillInTheGapsDragAndDropPage.optionPreviewTab()
|
272
|
+
.contains(responseText)
|
273
|
+
.click();
|
274
|
+
});
|
275
|
+
fillInTheGapsDragAndDropPage.dropzonePreviewTab()
|
276
|
+
.eq(dropzoneIndex)
|
277
|
+
.click({ force: true });
|
278
|
+
});
|
279
|
+
},
|
280
|
+
|
281
|
+
/**
|
282
|
+
* @description click on add alternate button for a dropzone in specify correct answer section
|
283
|
+
* @param {number} dropzoneIndex Index of dropzone
|
284
|
+
*/
|
285
|
+
clickOnAddAlternateButton: (dropzoneIndex) => {
|
286
|
+
utilities.getNthElement(fillInTheGapsDragAndDropPage.addAlternateButtonSpecifyCorrectAnswer(), dropzoneIndex)
|
287
|
+
.click();
|
288
|
+
},
|
289
|
+
|
290
|
+
/**
|
291
|
+
* @description Verifies the text content of a specific preview tab dropzone element.
|
292
|
+
* @param {number} count - The index of the preview tab dropzone element to verify (zero-based).
|
293
|
+
* @param {string} text - The expected text content to match against the inner text of the specified dropzone element.
|
294
|
+
*/
|
295
|
+
verifyDropzoneTextSpecifyCorrectAnswerSection: (count, text) => {
|
296
|
+
utilities.verifyInnerText(utilities.getNthElement(fillInTheGapsDragAndDropPage.dropzoneSpecifyCorrectAnswerSection(), count), text);
|
297
|
+
},
|
298
|
+
|
299
|
+
verifyInactiveStateOfAllDropzoneInSpecifyCorrectAnswerSection: () => {
|
300
|
+
fillInTheGapsDragAndDropPage.dropzoneSpecifyCorrectAnswerSection()
|
301
|
+
.should('not.have.class', 'isActiveForDrop');
|
302
|
+
},
|
303
|
+
|
304
|
+
/**
|
305
|
+
* @param {number} dropzoneIndex index of the dropzone in specify correct answer section
|
306
|
+
* @param {string[]} responseArray array of options set as correct responses in a category cell
|
307
|
+
*/
|
308
|
+
verifyDraggableOptionInDropzoneSpecifyCorrectAnswerSection: (dropzoneIndex, responseArray) => {
|
309
|
+
fillInTheGapsDragAndDropPage.dropzoneSpecifyCorrectAnswerSection()
|
310
|
+
.eq(dropzoneIndex)
|
311
|
+
.within(() => {
|
312
|
+
responseArray.forEach((response, count) => {
|
313
|
+
draggableOptionContainer.draggableOption()
|
314
|
+
.eq(count)
|
315
|
+
.verifyInnerText(response);
|
316
|
+
});
|
317
|
+
});
|
318
|
+
},
|
319
|
+
|
320
|
+
/**
|
321
|
+
* @param {number} responseAreaIndex Index of the stem response area in set correct answer section
|
322
|
+
* @description Verify drag handle is not visible in filled category cell in preview tab
|
323
|
+
*/
|
324
|
+
verifyDragHandleNotVisibleInFilledDropzoneOfSpecifyCorrectAnswerSection: (responseAreaIndex) => {
|
325
|
+
fillInTheGapsDragAndDropPage.dropzoneSpecifyCorrectAnswerSection()
|
326
|
+
.eq(responseAreaIndex)
|
327
|
+
.within(() => {
|
328
|
+
utilities.verifyElementVisibilityState(draggableOptionContainer.draggableOptionDragIcon(), 'hidden')
|
329
|
+
});
|
330
|
+
},
|
331
|
+
|
332
|
+
/**
|
333
|
+
* @param {string} optionName denotes the text content of the draggable option
|
334
|
+
* @param {number} dropzoneIndex - The index of the dropzone.
|
335
|
+
* @description click on a draggable option present in the category cell of specify correct answer section
|
336
|
+
*/
|
337
|
+
clickOnDraggableOptionInDropzoneOfSpecifyCorrectAnswerSection: (optionName, dropzoneIndex) => {
|
338
|
+
fillInTheGapsDragAndDropPage.dropzoneSpecifyCorrectAnswerSection()
|
339
|
+
.eq(dropzoneIndex)
|
340
|
+
.within(() => {
|
341
|
+
draggableOptionContainer.draggableOption()
|
342
|
+
.contains(optionName)
|
343
|
+
.click();
|
344
|
+
});
|
345
|
+
},
|
346
|
+
|
347
|
+
/**
|
348
|
+
* @description Click on dropzone in specify correct answer section
|
349
|
+
* @param {number} dropzoneIndex
|
350
|
+
*/
|
351
|
+
clickOnDropzoneOfSpecifyCorrectAnswerSection: (dropzoneIndex) => {
|
352
|
+
fillInTheGapsDragAndDropPage.dropzoneSpecifyCorrectAnswerSection()
|
353
|
+
.eq(dropzoneIndex)
|
354
|
+
.click({ force: true });
|
355
|
+
},
|
356
|
+
|
357
|
+
verifyInactiveStateOfAllDropzoneInPreviewTab: () => {
|
358
|
+
fillInTheGapsDragAndDropPage.dropzonePreviewTab()
|
359
|
+
.should('not.have.class', 'isActiveForDrop');
|
360
|
+
},
|
361
|
+
|
362
|
+
/**
|
363
|
+
* @param {number} dropzoneIndex index of the dropzone in preview tab
|
364
|
+
* @param {string[]} responseArray array of options set as correct responses in a category cell
|
365
|
+
*/
|
366
|
+
verifyDraggableOptionInDropzoneOfPreviewTab: (dropzoneIndex, responseArray) => {
|
367
|
+
fillInTheGapsDragAndDropPage.dropzonePreviewTab()
|
368
|
+
.eq(dropzoneIndex)
|
369
|
+
.within(() => {
|
370
|
+
responseArray.forEach((response, count) => {
|
371
|
+
utilities.verifyInnerText(utilities.getNthElement(draggableOptionContainer.draggableOption(), count), response);
|
372
|
+
});
|
373
|
+
});
|
374
|
+
},
|
375
|
+
|
376
|
+
/**
|
377
|
+
* @param {number} responseAreaIndex Index of the stem response area in set correct answer section
|
378
|
+
* @description Verify drag handle is not visible in filled category cell in preview tab
|
379
|
+
*/
|
380
|
+
verifyDragHandleNotVisibleInFilledDropzoneOfPreviewTab: (responseAreaIndex) => {
|
381
|
+
fillInTheGapsDragAndDropPage.dropzonePreviewTab()
|
382
|
+
.eq(responseAreaIndex)
|
383
|
+
.within(() => {
|
384
|
+
utilities.verifyElementVisibilityState(draggableOptionContainer.draggableOptionDragIcon(), 'hidden')
|
385
|
+
});
|
386
|
+
},
|
387
|
+
|
388
|
+
/**
|
389
|
+
* @param {string} optionName denotes the text content of the draggable option
|
390
|
+
* @param {number} dropzoneIndex - The index of the dropzone.
|
391
|
+
* @description click on a draggable option present in the category cell of preview tab
|
392
|
+
*/
|
393
|
+
clickOnDraggableOptionInDropzoneOfPreviewTab: (optionName, dropzoneIndex) => {
|
394
|
+
fillInTheGapsDragAndDropPage.dropzonePreviewTab()
|
395
|
+
.eq(dropzoneIndex)
|
396
|
+
.within(() => {
|
397
|
+
draggableOptionContainer.draggableOption()
|
398
|
+
.contains(optionName)
|
399
|
+
.click();
|
400
|
+
});
|
401
|
+
},
|
402
|
+
|
403
|
+
/**
|
404
|
+
* @description Click on dropzone in preview tab
|
405
|
+
* @param {number} dropzoneIndex
|
406
|
+
*/
|
407
|
+
clickOnDropzoneOfPreviewTab: (dropzoneIndex) => {
|
408
|
+
fillInTheGapsDragAndDropPage.dropzonePreviewTab()
|
409
|
+
.eq(dropzoneIndex)
|
410
|
+
.click({ force: true });
|
411
|
+
},
|
412
|
+
|
413
|
+
//TODO remove after https://redmine.zeuslearning.com/issues/563159 is resolved
|
414
|
+
/**
|
415
|
+
* Verifies draggable options in the Specify Correct Answer section of the options container.
|
416
|
+
* @param {Array<string>} draggableOptionsArray - An array of expected text content for draggable options.
|
417
|
+
*/
|
418
|
+
verifyDraggableOptionInOptionsContainerSpecifyCorrectAnswerSection: (draggableOptionsArray) => {
|
419
|
+
fillInTheGapsDragAndDropPage.optionsContainerSpecifyCorrectAnswerSection()
|
420
|
+
.within(() => {
|
421
|
+
draggableOptionsArray.forEach((optionText, optionIndex) => {
|
422
|
+
utilities.verifyElementCount(draggableOptionContainer.draggableOption(), draggableOptionsArray.length);
|
423
|
+
utilities.verifyElementVisibilityState(utilities.getNthElement(draggableOptionContainer.draggableOptionDragIcon(), optionIndex), 'exist');
|
424
|
+
utilities.verifyTextContent(utilities.getNthElement(draggableOptionContainer.draggableOption(), optionIndex), optionText);
|
425
|
+
});
|
426
|
+
});
|
427
|
+
},
|
428
|
+
}
|
429
|
+
|
430
|
+
const tests = {
|
431
|
+
...scoringSectionBaseEditTab.tests,
|
432
|
+
...autoScoredScoringSectionMultiResponseType.tests,
|
433
|
+
...autoScoredSpecifyCorrectAnswerSection.tests,
|
434
|
+
...draggableOptionsSectionComponent.tests,
|
435
|
+
...optionsWrapperComponent.tests,
|
436
|
+
...draggableOptionContainer.tests,
|
437
|
+
...commonComponents.tests,
|
438
|
+
...autoScoredScoringPreviewTab.tests,
|
439
|
+
|
440
|
+
verifyContentsOfSpecifyCorrectAnswerSection: () => {
|
441
|
+
it('When user selects a scoring type then in the \'Correct\' accordion, all the contents should be displayed', () => {
|
442
|
+
utilities.verifyElementCount(fillInTheGapsDragAndDropPage.dropzoneSpecifyCorrectAnswerSection(), 3);
|
443
|
+
for (let index = 0; index < 3; index++) {
|
444
|
+
utilities.verifyInnerText(utilities.getNthElement(fillInTheGapsDragAndDropCommonComponents.dropzoneLabelSpecifyCorrectAnswerSection(), index), `Dropzone ${index + 1}`);
|
445
|
+
}
|
446
|
+
});
|
447
|
+
},
|
448
|
+
|
449
|
+
/**
|
450
|
+
* Verifies the contents and functionality of the 'Specify correct answer' accordion for multiple selection questions.
|
451
|
+
* @param {{'Correct' | 'Alternative'}} accordionName - The name of the accordion to be used in the validation.
|
452
|
+
* @example - verifySpecifyCorrectAnswerAccordionContentsAndFunctionality('Correct');
|
453
|
+
*/
|
454
|
+
verifySpecifyCorrectAnswerAccordionContentsAndFunctionality: (accordionName) => {
|
455
|
+
it(`The user should be able to drop option in the dropzone in the ${accordionName} accordion`, () => {
|
456
|
+
fillInTheGapsDragAndDropPage.steps.clickAndDropOptionInDropzoneSpecifyCorrectAnswerSection({ 'Petals': 0 });
|
457
|
+
});
|
458
|
+
|
459
|
+
it(`When the user has removed all the options from the dropzone in the ${accordionName} accordion, \'Error: Please set a correct answer.\' error message should be thrown along with an error icon on the \'${accordionName}\' accordion`, () => {
|
460
|
+
fillInTheGapsDragAndDropPage.steps.clickAndDropOptionInOptionsContainerInSpecifyCorrectAnswerSection('Petals');
|
461
|
+
utilities.verifyElementVisibilityState(commonComponents.errorMessage(), 'visible')
|
462
|
+
utilities.verifyInnerText(commonComponents.errorMessage(), 'Error: Please set a correct answer.');
|
463
|
+
if (accordionName == 'Correct') {
|
464
|
+
autoScoredSpecifyCorrectAnswerSection.correctAnswerAccordion()
|
465
|
+
.within(() => {
|
466
|
+
utilities.verifyElementVisibilityState(autoScoredSpecifyCorrectAnswerSection.specifyCorrectAnswerErrorIcon(), 'visible');
|
467
|
+
});
|
468
|
+
} else {
|
469
|
+
autoScoredSpecifyCorrectAnswerSection.alternativeAnswerAccordion()
|
470
|
+
.eq(1)
|
471
|
+
.within(() => {
|
472
|
+
utilities.verifyElementVisibilityState(autoScoredSpecifyCorrectAnswerSection.specifyCorrectAnswerErrorIcon(), 'visible');
|
473
|
+
});
|
474
|
+
};
|
475
|
+
});
|
476
|
+
|
477
|
+
autoScoredSpecifyCorrectAnswerSection.tests.verifyAutoScoredCorrectAnswerErrorMessageCSSAndA11y();
|
478
|
+
|
479
|
+
it('CSS of the dropzone border', { tags: 'css' }, () => {
|
480
|
+
utilities.verifyCSS(fillInTheGapsDragAndDropPage.dropzoneSpecifyCorrectAnswerSection().eq(0), {
|
481
|
+
'border': `2px dashed ${css.color.errorFieldBorder}`,
|
482
|
+
'background-color': css.color.optionsBg
|
483
|
+
});
|
484
|
+
});
|
485
|
+
|
486
|
+
it('When the user drops an option in the dropzone, the error message should disappear', () => {
|
487
|
+
fillInTheGapsDragAndDropPage.steps.clickAndDropOptionInDropzoneSpecifyCorrectAnswerSection({ 'Leaves': 0, 'Petals': 1, 'Roots': 2 });
|
488
|
+
});
|
489
|
+
|
490
|
+
autoScoredSpecifyCorrectAnswerSection.tests.verifyAutoScoredPointsErrorMessageWhenPointsFieldIsEmpty(accordionName);
|
491
|
+
|
492
|
+
it('CSS of \'Correct\' accordion contents', { tags: 'css' }, () => {
|
493
|
+
utilities.verifyCSS(fillInTheGapsDragAndDropPage.dropzoneLabelSpecifyCorrectAnswerSection(), {
|
494
|
+
'color': css.color.sectionHeading,
|
495
|
+
'font-size': css.fontSize.default,
|
496
|
+
'font-weight': css.fontWeight.regular
|
497
|
+
});
|
498
|
+
utilities.verifyCSS(fillInTheGapsDragAndDropPage.dropzoneSpecifyCorrectAnswerSection().eq(0), {
|
499
|
+
'border': `2px dashed ${css.color.secondaryBtnActive}`,
|
500
|
+
'background-color': css.color.optionsBg
|
501
|
+
});
|
502
|
+
utilities.verifyCSS(fillInTheGapsDragAndDropPage.optionContainerOptionsSpecifyCorrectAnswerSection(), {
|
503
|
+
'background-color': css.color.secondaryBtnBg,
|
504
|
+
'border': `1px solid ${css.color.draggableOptionBorder}`
|
505
|
+
});
|
506
|
+
utilities.verifyCSS(fillInTheGapsDragAndDropPage.optionContainerOptionsSpecifyCorrectAnswerSection().find('.question-text-wrapper'), {
|
507
|
+
'color': css.color.text,
|
508
|
+
'font-size': css.fontSize.default,
|
509
|
+
'font-weight': css.fontWeight.regular
|
510
|
+
});
|
511
|
+
utilities.verifyCSS(fillInTheGapsDragAndDropPage.optionContainerOptionsSpecifyCorrectAnswerSection().find('svg g [data-name*="Path"]').eq(1), {
|
512
|
+
'color': css.color.secondaryBtn
|
513
|
+
});
|
514
|
+
});
|
515
|
+
|
516
|
+
it('Accessibility of \'Correct\' accordion contents', { tags: 'a11y' }, () => {
|
517
|
+
cy.checkAccessibility(fillInTheGapsDragAndDropPage.dropzoneLabelSpecifyCorrectAnswerSection().parents('.preview-content-wrapper'))
|
518
|
+
});
|
519
|
+
},
|
520
|
+
|
521
|
+
/**
|
522
|
+
* @description select alternate answers for a dropzone in its alternate answer popup
|
523
|
+
* @param {string[]} alternateAnswerArray Array of options to be selected as alternate answer
|
524
|
+
*/
|
525
|
+
selectAlternateAnswerInAlternateAnswerPopup: (alternateAnswerArray) => {
|
526
|
+
alternateAnswerArray.forEach((alternateAnswer) => {
|
527
|
+
fillInTheGapsDragAndDropPage.alternateAnswerPopupOptionContainer()
|
528
|
+
.contains(alternateAnswer)
|
529
|
+
.click();
|
530
|
+
fillInTheGapsDragAndDropPage.alternateAnswerPopupOptionContainer()
|
531
|
+
.contains(alternateAnswer)
|
532
|
+
.parent()
|
533
|
+
.should('have.class', 'selected');
|
534
|
+
});
|
535
|
+
},
|
536
|
+
|
537
|
+
saveSelectedAlternateAnswers: () => {
|
538
|
+
fillInTheGapsDragAndDropPage.alternateAnswerPopupSaveButton()
|
539
|
+
.click();
|
540
|
+
},
|
541
|
+
|
542
|
+
/**
|
543
|
+
* @description Set alternate answers for a dropzone
|
544
|
+
* @param {number} dropzoneIndex Index of dropzone
|
545
|
+
* @param {string[]} alternateAnswerArray Array of options to be selected as alternate answer
|
546
|
+
*/
|
547
|
+
setResponseLevelAlternateAnswer: (dropzoneIndex, alternateAnswerArray) => {
|
548
|
+
fillInTheGapsDragAndDropPage.steps.clickOnAddAlternateButton(dropzoneIndex);
|
549
|
+
fillInTheGapsDragAndDropPage.steps.selectAlternateAnswerInAlternateAnswerPopup(alternateAnswerArray);
|
550
|
+
fillInTheGapsDragAndDropPage.steps.saveSelectedAlternateAnswers();
|
551
|
+
utilities.verifyElementVisibilityState(fillInTheGapsDragAndDropPage.alternateAnswerPopup(), 'notExist');
|
552
|
+
}
|
198
553
|
}
|
199
554
|
|
200
555
|
export const fillInTheGapsDragAndDropPage = {
|
201
556
|
...selectors,
|
202
|
-
steps
|
557
|
+
steps,
|
558
|
+
tests
|
203
559
|
}
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import utilities from "../support/helpers/utilities";
|
2
|
-
import { autoScoredScoringPreviewTab, createQuestionBasePage, scoringSectionBaseEditTab, questionInstructionsComponent, correctIncorrectAnswerLabelComponent, autoScoredStudentViewSettings, autoScoredSpecifyCorrectAnswerSection, autoScoredScoringSectionMultiResponseType, fillInTheGapsDropdownCommonComponent, questionInputFieldComponent, commonComponents, additionalSettingsPanel } from "./components";
|
2
|
+
import { autoScoredScoringPreviewTab, createQuestionBasePage, scoringSectionBaseEditTab, questionInstructionsComponent, correctIncorrectAnswerLabelComponent, autoScoredStudentViewSettings, autoScoredSpecifyCorrectAnswerSection, autoScoredScoringSectionMultiResponseType, fillInTheGapsDropdownCommonComponent, questionInputFieldComponent, commonComponents, additionalSettingsPanel, optionsWrapperComponent, randomizeOptionsComponent, studentViewSettingsLabelComponent } from "./components";
|
3
3
|
const css = Cypress.env('css');
|
4
4
|
|
5
5
|
const selectors = {
|
@@ -9,6 +9,11 @@ const selectors = {
|
|
9
9
|
...fillInTheGapsDropdownCommonComponent,
|
10
10
|
...questionInputFieldComponent,
|
11
11
|
...commonComponents,
|
12
|
+
...optionsWrapperComponent,
|
13
|
+
...autoScoredScoringSectionMultiResponseType,
|
14
|
+
...autoScoredSpecifyCorrectAnswerSection,
|
15
|
+
...randomizeOptionsComponent,
|
16
|
+
...studentViewSettingsLabelComponent,
|
12
17
|
dropdownWrapperPreviewTab: () => cy.get('.cloze-with-text-answer-status-response-preview-wrapper'),
|
13
18
|
correctAnswerSectionWrapper: () => cy.get('.cloze-with-text-correct-answer-wrapper'),
|
14
19
|
correctAnswerResponseWrapper: () => cy.get('.answer-block'),
|
@@ -28,6 +33,8 @@ const steps = {
|
|
28
33
|
...questionInputFieldComponent.steps,
|
29
34
|
...commonComponents.steps,
|
30
35
|
...additionalSettingsPanel.steps,
|
36
|
+
...optionsWrapperComponent.steps,
|
37
|
+
...randomizeOptionsComponent.steps,
|
31
38
|
/**
|
32
39
|
* Verify that the correct option icon is is displayed for a specific dropdown.
|
33
40
|
* @param {number} dropdownIndex - The index of the dropdown.
|
@@ -96,6 +103,19 @@ const steps = {
|
|
96
103
|
|
97
104
|
const tests = {
|
98
105
|
...autoScoredScoringPreviewTab.tests,
|
106
|
+
...questionInstructionsComponent.tests,
|
107
|
+
...commonComponents.tests,
|
108
|
+
...questionInputFieldComponent.tests,
|
109
|
+
...optionsWrapperComponent.tests,
|
110
|
+
...fillInTheGapsDropdownCommonComponent.tests,
|
111
|
+
...autoScoredSpecifyCorrectAnswerSection.tests,
|
112
|
+
...scoringSectionBaseEditTab.tests,
|
113
|
+
...autoScoredScoringSectionMultiResponseType.tests,
|
114
|
+
...autoScoredScoringPreviewTab.tests,
|
115
|
+
...autoScoredStudentViewSettings.tests,
|
116
|
+
...randomizeOptionsComponent.tests,
|
117
|
+
...studentViewSettingsLabelComponent.tests,
|
118
|
+
...createQuestionBasePage.tests
|
99
119
|
}
|
100
120
|
|
101
121
|
export const fillInTheGapsDropdownPage = {
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import constants from "../fixtures/constants";
|
2
2
|
import utilities from "../support/helpers/utilities";
|
3
|
-
import { createQuestionBasePage, questionInstructionsComponent, uploadImageSectionComponent, scoringSectionBaseEditTab, optionsWrapperComponent, equationEditorFlyout, ckEditorToolbar, commonComponents, autoScoredScoringPreviewTab, autoScoredStudentViewSettings, maximumCapacityPerDropzoneComponent, autoScoredSpecifyCorrectAnswerSection, autoScoredScoringSectionMultiResponseType, imageCanvasComponent, backgroundImageUploadComponent, correctIncorrectAnswerLabelComponent, draggableOptionsSectionComponent, draggableOptionContainer, studentViewSettingsLabelComponent, randomizeOptionsComponent, enableOuterBorderComponent, allowMultipleInstancesOfSameDraggableOptionComponent, additionalSettingsPanel, opacityComponent, imageActionsComponent, colorPopupComponent } from "./components";
|
3
|
+
import { createQuestionBasePage, questionInstructionsComponent, uploadImageSectionComponent, scoringSectionBaseEditTab, optionsWrapperComponent, equationEditorFlyout, ckEditorToolbar, commonComponents, autoScoredScoringPreviewTab, autoScoredStudentViewSettings, maximumCapacityPerDropzoneComponent, autoScoredSpecifyCorrectAnswerSection, autoScoredScoringSectionMultiResponseType, imageCanvasComponent, backgroundImageUploadComponent, correctIncorrectAnswerLabelComponent, draggableOptionsSectionComponent, draggableOptionContainer, studentViewSettingsLabelComponent, randomizeOptionsComponent, enableOuterBorderComponent, allowMultipleInstancesOfSameDraggableOptionComponent, additionalSettingsPanel, opacityComponent, imageActionsComponent, colorPopupComponent, fillInTheGapsDragAndDropCommonComponents } from "./components";
|
4
4
|
import { dialogBoxBase } from "./dialogBoxBase";
|
5
5
|
const css = Cypress.env('css');
|
6
6
|
|
@@ -29,6 +29,7 @@ const selectors = {
|
|
29
29
|
...uploadImageSectionComponent,
|
30
30
|
...imageActionsComponent,
|
31
31
|
...colorPopupComponent,
|
32
|
+
...fillInTheGapsDragAndDropCommonComponents,
|
32
33
|
dropzonePreviewTab: () => cy.get('.drag-and-drop-canvas [class*="__DraggableWrapper"]'),
|
33
34
|
dropzoneContainerPreviewTab: () => cy.get('[class*="Canvasstyle__DropzoneWrapper"]'),
|
34
35
|
optionContainerOptionsPreviewTab: () => cy.get('.item-list .draggable-options-item:visible'),
|
@@ -40,21 +41,11 @@ const selectors = {
|
|
40
41
|
correctIncorrectAnswerBlock: () => cy.get('[class*="-answer-block"]'),
|
41
42
|
correctIncorrectStatusMessageText: () => cy.get('[class*="AnswerStatusText"]'),
|
42
43
|
dropzoneNumeration: () => cy.get('.drag-and-drop-canvas .answer-numeration-number-box'),
|
43
|
-
correctAnswersNumeration: () => cy.get('[class*="__AnswerCell"] .answer-numeration-number-box'),
|
44
|
-
correctAnswersOptions: () => cy.get('[class*="__AnswerWrapper"] .question-text-wrapper'),
|
45
|
-
correctAnswersLabel: () => cy.get('.correct-answers-label'),
|
46
|
-
tickIconWrapper: () => cy.get('.tick-icon-wrapper svg g g [id*=Rectangle]'),
|
47
|
-
correctAnswerContainer: () => cy.get('.dnd-correct-answer-wrapper'),
|
48
|
-
correctIncorrectAnswerLabel: () => cy.get('[class*="CorrectIncorrectLabel"]'),
|
49
44
|
imageInPreviewTab: () => cy.get('.drag-and-drop-layout-wrapper img'),
|
50
|
-
dropzoneLabelSpecifyCorrectAnswerSection: () => cy.get('.dropzone-and-label-wrapper .title-casing'),
|
51
45
|
questionBorderPreviewTab: () => cy.get('.label-image-with-dnd-canvas-wrapper [class*="DragDropContextLayoutWrapper"]'),
|
52
46
|
maxLimitInEachDropzoneHelpText: () => cy.get('[class*="Canvasstyle__LimitWrapper"]'),
|
53
|
-
penaltyPointsForEachIncorrectDropzoneInputField: () => cy.get('input[aria-label="Penalty points for each incorrect dropzone"]'),
|
54
|
-
specifyPointsForEachIncorrectDropzoneRadioButton: () => cy.get('input[aria-label*="Specify points for each incorrect"]'),
|
55
47
|
textAreaImageCanvas: () => cy.get('.drag-and-drop-canvas textarea'),
|
56
48
|
textAreaPreviewTab: () => cy.get('.drag-and-drop-layout-wrapper textarea'),
|
57
|
-
penaltyPointsForEachIncorrectDropzoneInputField: () => cy.get('input[aria-label="Penalty points for each incorrect dropzone"]'),
|
58
49
|
dropzonePointerInPreviewTab: () => cy.get('.preview-content-wrapper [class*="PointerWrapper"]'),
|
59
50
|
canvasInPreviewTab: () => cy.get('[class*="PreviewTabstyles__ContentWrapper"] [class*="Canvasstyle__DragAndDropCanvas"]'),
|
60
51
|
}
|
@@ -87,6 +78,7 @@ const steps = {
|
|
87
78
|
...opacityComponent.steps,
|
88
79
|
...imageActionsComponent.steps,
|
89
80
|
...colorPopupComponent.steps,
|
81
|
+
...fillInTheGapsDragAndDropCommonComponents.steps,
|
90
82
|
|
91
83
|
/**
|
92
84
|
* @description Verifies the text content of a specific preview tab dropzone element.
|
@@ -252,10 +244,6 @@ const steps = {
|
|
252
244
|
.should('exist');
|
253
245
|
},
|
254
246
|
|
255
|
-
verifyCorrectAnswerSectionNotExists: () => {
|
256
|
-
utilities.verifyElementVisibilityState(fillInTheGapsOverImageDragAndDropPage.correctAnswerContainer(), 'notExist');
|
257
|
-
},
|
258
|
-
|
259
247
|
/**
|
260
248
|
* Verifies the correct option icon for a specified dropzone in the Preview Tab.
|
261
249
|
* @param {number} optionIndex - The index of the option to verify.
|
@@ -304,20 +292,6 @@ const steps = {
|
|
304
292
|
});
|
305
293
|
},
|
306
294
|
|
307
|
-
/**
|
308
|
-
*@description Verifies the correctness of answer responses in the correct answer section, including the count.
|
309
|
-
* @param {string[][]} correctAnswerArray An array of arrays, each containing the expected answer options for a specific correct answer section.
|
310
|
-
*/
|
311
|
-
verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount: (correctAnswerArray) => {
|
312
|
-
utilities.verifyElementCount(fillInTheGapsOverImageDragAndDropPage.correctAnswersOptions(), correctAnswerArray.length);
|
313
|
-
correctAnswerArray.forEach((correctAnswer, index) => {
|
314
|
-
utilities.verifyTextContent(utilities.getNthElement(fillInTheGapsOverImageDragAndDropPage.correctAnswersNumeration(), index), index + 1);
|
315
|
-
correctAnswer.forEach((answerOption) => {
|
316
|
-
utilities.verifyTextContent(utilities.getNthElement(fillInTheGapsOverImageDragAndDropPage.correctAnswersOptions(), index), answerOption);
|
317
|
-
});
|
318
|
-
});
|
319
|
-
},
|
320
|
-
|
321
295
|
verifyPointsPerResponseLabel: () => {
|
322
296
|
utilities.verifyInnerText(autoScoredScoringSectionMultiResponseType.pointsPerResponseLabel(), 'Points per response:\n-');
|
323
297
|
utilities.verifyElementVisibilityState(autoScoredScoringSectionMultiResponseType.pointsPerResponseLabel(), 'visible');
|
@@ -371,32 +345,6 @@ const steps = {
|
|
371
345
|
utilities.verifyInnerText(autoScoredScoringSectionMultiResponseType.penaltyPointsDetailsSectionAllottedPointsLabel(), `Penalty points for each incorrect dropzone: ${penaltyPoints}`);
|
372
346
|
},
|
373
347
|
|
374
|
-
/**
|
375
|
-
* @description Verifies the penalty points value for each incorrect dropzone
|
376
|
-
* @param {number} points - The expected penalty points value for each incorrect dropzone.
|
377
|
-
*/
|
378
|
-
verifyPenaltyPointsForEachIncorrectDropzoneValue: (points) => {
|
379
|
-
fillInTheGapsOverImageDragAndDropPage.penaltyPointsForEachIncorrectDropzoneInputField()
|
380
|
-
.should('have.value', points);
|
381
|
-
},
|
382
|
-
|
383
|
-
/**
|
384
|
-
* @description Allots penalty points for each incorrect dropzone
|
385
|
-
* @param {number} points - The penalty points to be allotted for each dropzone.
|
386
|
-
*/
|
387
|
-
allotPenaltyPointsForEachIncorrectDropzone: (points) => {
|
388
|
-
fillInTheGapsOverImageDragAndDropPage.penaltyPointsForEachIncorrectDropzoneInputField()
|
389
|
-
.clear()
|
390
|
-
.type(`${points}`)
|
391
|
-
.should('have.value', points)
|
392
|
-
.blur();
|
393
|
-
},
|
394
|
-
|
395
|
-
selectPenaltyPointsForEachIncorrectDropzone: () => {
|
396
|
-
fillInTheGapsOverImageDragAndDropPage.specifyPointsForEachIncorrectDropzoneRadioButton()
|
397
|
-
.click();
|
398
|
-
},
|
399
|
-
|
400
348
|
verifyInactiveStateOfAllDropzoneInSpecifyCorrectAnswerSection: () => {
|
401
349
|
fillInTheGapsOverImageDragAndDropPage.dropzoneWrapperSpecifyCorrectAnswerSection()
|
402
350
|
.should('not.have.class', 'dragging-over');
|
@@ -636,8 +584,8 @@ const tests = {
|
|
636
584
|
verifyContentsOfSpecifyCorrectAnswerSection: () => {
|
637
585
|
it('When user selects a scoring type then in the \'Correct\' accordion, all the contents should be displayed', () => {
|
638
586
|
utilities.verifyElementCount(fillInTheGapsOverImageDragAndDropPage.dropzoneSpecifyCorrectAnswerSection(), 3);
|
639
|
-
for (let index = 0; index <
|
640
|
-
utilities.verifyInnerText(utilities.getNthElement(fillInTheGapsOverImageDragAndDropPage.dropzoneLabelSpecifyCorrectAnswerSection(), index), `Dropzone ${index}`);
|
587
|
+
for (let index = 0; index < 3; index++) {
|
588
|
+
utilities.verifyInnerText(utilities.getNthElement(fillInTheGapsOverImageDragAndDropPage.dropzoneLabelSpecifyCorrectAnswerSection(), index), `Dropzone ${index+1}`);
|
641
589
|
}
|
642
590
|
});
|
643
591
|
},
|
@@ -13,8 +13,8 @@ const selectors = {
|
|
13
13
|
...optionsWrapperComponent,
|
14
14
|
...randomizeOptionsComponent,
|
15
15
|
...backgroundImageUploadComponent,
|
16
|
-
|
17
|
-
|
16
|
+
...autoScoredScoringSectionMultiResponseType,
|
17
|
+
dropdownWrapperPreviewTab: () => cy.get('[class*="question-preview-wrapper"] [class="Canvasstyle__DropzoneWrapper"]'),
|
18
18
|
correctAnswerResponseWrapper: () => cy.get('[class*="LabelImageWithDropdownPreviewstyles__AnswerCell"]'),
|
19
19
|
correctAnswerResponse: () => cy.get('[class*="LabelImageWithDropdownPreviewstyles__AnswerWrapper"]'),
|
20
20
|
}
|
@@ -91,28 +91,6 @@ const steps = {
|
|
91
91
|
});
|
92
92
|
},
|
93
93
|
|
94
|
-
/**
|
95
|
-
* Verify correct answer responses in the correct answer section and count.
|
96
|
-
* @param {string[]} correctAnswerArray - An array containing the expected correct answer responses.
|
97
|
-
* @example verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(['Flower', 'Petals', 'Stem']);
|
98
|
-
*/
|
99
|
-
verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount: (correctAnswerArray) => {
|
100
|
-
utilities.verifyElementCount(fillInTheGapsOverImageDropdownPage.correctAnswerResponse(), correctAnswerArray.length);
|
101
|
-
correctAnswerArray.forEach((correctAnswer, index) => {
|
102
|
-
fillInTheGapsOverImageDropdownPage.correctAnswerResponseWrapper()
|
103
|
-
.eq(index)
|
104
|
-
.within(() => {
|
105
|
-
utilities.verifyInnerText(fillInTheGapsDropdownCommonComponent.correctAnswerResponseNumeration(), `${index + 1}`);
|
106
|
-
fillInTheGapsOverImageDropdownPage.correctAnswerResponse()
|
107
|
-
.should('have.text', correctAnswer);
|
108
|
-
});
|
109
|
-
});
|
110
|
-
},
|
111
|
-
|
112
|
-
verifyCorrectAnswerSectionNotExists: () => {
|
113
|
-
utilities.verifyElementVisibilityState(fillInTheGapsOverImageDropdownPage.correctAnswerSectionWrapper(), 'notExist');
|
114
|
-
},
|
115
|
-
|
116
94
|
/**
|
117
95
|
* @description Verify dropdown pointer style in preview tab
|
118
96
|
* @param {string} style dropdown pointer style
|
@@ -192,6 +170,7 @@ const tests = {
|
|
192
170
|
...imageCanvasComponent.tests,
|
193
171
|
...studentViewSettingsLabelComponent.tests,
|
194
172
|
...createQuestionBasePage.tests,
|
173
|
+
...fillInTheGapsDropdownCommonComponent.tests
|
195
174
|
}
|
196
175
|
|
197
176
|
export const fillInTheGapsOverImageDropdownPage = {
|