itemengine-cypress-automation 1.0.119 → 1.0.121
Sign up to get free protection for your applications and to get access to all the features.
- package/cypress/e2e/ILC/AudioResponseNew/editTabBasicSection.js +13 -1
- package/cypress/e2e/ILC/AudioResponseNew/gradingViewAndCorrectAnswerViewContents.smoke.js +2 -0
- package/cypress/e2e/ILC/AudioResponseNew/previewContentsForAllViews.smoke.js +1 -0
- package/cypress/e2e/ILC/AudioResponseNew/standardRecorderStyle.smoke.js +2 -0
- package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/Scoring/allOrNothingCorrectPointsGreaterThanAlternativePoints.js +1 -1
- package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/clickAndDrop.js +2 -2
- package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/studentViewSettings.js +1 -4
- package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/Scoring/allOrNothingForAllViews.smoke.js +273 -0
- package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/checkAnswerFunctionalityForAllViews.smoke.js +116 -0
- package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/previewContentsForAllViews.smoke.js +136 -0
- package/cypress/e2e/ILC/FillInTheGapsDropdownNew/allOrNothingForAllView.smoke.js +224 -0
- package/cypress/e2e/ILC/FillInTheGapsDropdownNew/checkAnswerFunctionalityForAllViews.smoke.js +120 -0
- package/cypress/e2e/ILC/FillInTheGapsDropdownNew/previewContentsForAllViews.smoke.js +158 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/backgroundImageAndCanvasProperties.js +1 -1
- package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/studentViewSettings.js +1 -4
- package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/dropdownAndDropdownMenuSection.js +246 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/dropdownOptionsSection.js +332 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/editTabBasicSection.js +409 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/headerSection.js +80 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/studentViewSettings.js +213 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/HeaderSection.js +1 -1
- package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/Scoring/partialDifferentWeightsBasic.js +2 -2
- package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/Scoring/partialEqualWeightsBasic.js +1 -1
- package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/allOrNothingForAllViews.smoke.js +2 -2
- package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/backgroundImageAndCanvasProperties.js +68 -68
- package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/editTabScoringSection.js +6 -6
- package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/previewContentsForAllViews.smoke.js +1 -1
- package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/setLimitSection.js +3 -289
- package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/specialCharactersSection.js +1 -1
- package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/specifyCorrectAnswerSection.js +2 -2
- package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/studentViewSettings.js +2 -23
- package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/allOrNothingAlternativePointsGreaterThanCorrectPoints.js +191 -0
- package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/allOrNothingCorrectPointsEqualToAlternativePoints.js +190 -0
- package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/allOrNothingCorrectPointsGreaterThanAlternativePoints.js +284 -0
- package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/allOrNothingPenaltyScoring.js +52 -0
- package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/manuallyAndNonScored.js +113 -0
- package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/partialDifferentWeightsAlternativePointsGreaterThanCorrectPoints.js +217 -0
- package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/partialDifferentWeightsBasic.js +234 -0
- package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/partialDifferentWeightsWithCorrectPointsEqualToAlternativePoints.js +217 -0
- package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/partialDifferentWeightsWithCorrectPointsGreaterThanAlternativePoints.js +217 -0
- package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/partialEqualWeightsBasic.js +136 -0
- package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/partialEqualWeightsWithAlternativePointsGreaterThanCorrectPoints.js +197 -0
- package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/partialEqualWeightsWithCorrectPointsEqualToAlternativePoints.js +169 -0
- package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/partialEqualWeightsWithCorrectPointsGreaterThanAlternativePoints.js +197 -0
- package/cypress/e2e/ILC/FillInTheGapsTextNew/allOrNothingForAllViews.smoke.js +219 -0
- package/cypress/e2e/ILC/FillInTheGapsTextNew/checkAnswerFunctionalityForAllViews.smoke.js +115 -0
- package/cypress/e2e/ILC/FillInTheGapsTextNew/editTabBasicSection.js +142 -0
- package/cypress/e2e/ILC/FillInTheGapsTextNew/previewContentsForAllViews.smoke.js +152 -0
- package/cypress/e2e/ILC/FillInTheGapsTextNew/setLimitSection.js +39 -0
- package/cypress/e2e/ILC/MultipleSelection/studentViewSettings.js +2 -12
- package/cypress/e2e/ILC/ShortTextResponseNew/conditionalCheckboxes.js +497 -0
- package/cypress/e2e/ILC/ShortTextResponseNew/editTabBasicSections.js +503 -0
- package/cypress/e2e/ILC/ShortTextResponseNew/responseAnswersAndAcceptedStudentInput.js +233 -0
- package/cypress/e2e/ILC/ShortTextResponseNew/specialCharactersSection.js +291 -0
- package/cypress/e2e/ILC/ShortTextResponseNew/studentViewSettings.js +332 -0
- package/cypress/e2e/ILC/SingleSelection/studentViewSettings.js +2 -12
- package/cypress/e2e/ILC/TextEntryMath/editTabBasicSection.js +9 -8
- package/cypress/e2e/ILC/TextEntryMath/editTabScoringSection.js +4 -4
- package/cypress/e2e/ILC/TextEntryMath/minimumScoringPenaltyPointsAndRoundingDropdown.js +8 -2
- package/cypress/e2e/ILC/TextEntryMath/specifyCorrectAnswerSection.js +5 -2
- package/cypress/e2e/ILC/TextEntryMathWithImage/allOrNothingScoringForAllViews.smoke.js +334 -0
- package/cypress/e2e/ILC/TextEntryMathWithImage/backgroundImageAndCanvasProperties.js +419 -0
- package/cypress/e2e/ILC/TextEntryMathWithImage/checkAnswerFunctionalityForAllViews.smoke.js +166 -0
- package/cypress/e2e/ILC/TextEntryMathWithImage/previewTabContentsForAllViews.smoke.js +166 -0
- package/cypress/e2e/ILC/UploadResponse/editTabScoringSection.js +51 -0
- package/cypress/e2e/ILC/UploadResponse/gradingViewAndCorrectAnswerViewContents.smoke.js +99 -0
- package/cypress/e2e/ILC/UploadResponse/manuallyAndNonScoredScoring.js +71 -0
- package/cypress/e2e/ILC/UploadResponse/previewContentsForAllViews.smoke.js +155 -0
- package/cypress/e2e/ILC/UploadResponse/uploadResponseHeaderSection.js +66 -0
- package/cypress/e2e/migration/migration.js +6 -5
- package/cypress/e2e/migration/migration2.js +4 -3
- package/cypress/e2e/migration/migration3.js +4 -3
- package/cypress/e2e/migration/migration4.js +4 -3
- package/cypress/e2e/migration/migration5.js +4 -3
- package/cypress/fixtures/theme/ilc.json +3 -1
- package/cypress/pages/audioResponsePage.js +2 -1
- package/cypress/pages/components/additionalSettingsPanel.js +27 -0
- package/cypress/pages/components/autoScoredPreviewBase.js +1 -1
- package/cypress/pages/components/autoScoredScoringSection.js +1 -1
- package/cypress/pages/components/autoScoredScoringSectionMultipleResponsesType.js +1 -1
- package/cypress/pages/components/autoScoredSetCorrectAnswerSection.js +1 -1
- package/cypress/pages/components/autoScoredSpecifyCorrectAnswerSection.js +2 -2
- package/cypress/pages/components/autoScoredStudentViewSettings.js +8 -1
- package/cypress/pages/components/backgroundImageUploadComponent.js +5 -5
- package/cypress/pages/components/createQuestionBasePage.js +8 -2
- package/cypress/pages/components/essayResponseCommonComponents.js +6 -0
- package/cypress/pages/components/fillInTheGapsCommonComponents.js +13 -0
- package/cypress/pages/components/fillInTheGapsDragAndDropCommonComponents.js +40 -0
- package/cypress/pages/components/fillInTheGapsDropdownCommonComponent.js +422 -314
- package/cypress/pages/components/fillInTheGapsTextCommonComponent.js +438 -710
- package/cypress/pages/components/{figOverImageCanvasComponent.js → imageCanvasComponent.js} +274 -272
- package/cypress/pages/components/index.js +3 -3
- package/cypress/pages/components/maximumRecorderLengthComponent.js +55 -11
- package/cypress/pages/components/previewScoringAndShowCorrectAnswerComponent.js +1 -1
- package/cypress/pages/components/questionInputFieldComponent.js +49 -23
- package/cypress/pages/components/scoringSectionBase.js +1 -1
- package/cypress/pages/createItemPage.js +67 -2
- package/cypress/pages/fillInTheGapsDragAndDropPage.js +172 -711
- package/cypress/pages/fillInTheGapsDropdownPage.js +75 -72
- package/cypress/pages/fillInTheGapsOverImageDragAndDropPage.js +4 -4
- package/cypress/pages/fillInTheGapsOverImageDropdownPage.js +109 -273
- package/cypress/pages/fillInTheGapsOverImageTextPage.js +49 -291
- package/cypress/pages/fillInTheGapsTextPage.js +52 -199
- package/cypress/pages/index.js +5 -5
- package/cypress/pages/multipleSelectionPage.js +1 -0
- package/cypress/pages/shortTextResponsePage.js +575 -33
- package/cypress/pages/singleSelectionGridPage.js +1 -2
- package/cypress/pages/singleSelectionPage.js +5 -6
- package/cypress/pages/textEntryMathPage.js +46 -22
- package/cypress/pages/textEntryMathWithImagePage.js +212 -0
- package/cypress/pages/uploadResponsePage.js +74 -21
- package/cypress/support/migrationHelpers/extractLrnQuestionData.js +73 -2
- package/cypress/support/migrationHelpers/lrnQestionTypesENUM.js +1 -0
- package/cypress/support/migrationHelpers/verifyIeQuestionData.js +49 -2
- package/package.json +1 -1
- package/cypress/e2e/ILC/AudioResponseNew/minimalRecorderStyle.js +0 -482
- package/cypress/e2e/ILC/EssayResponse/essayResponseEquationEditor.smoke.js +0 -412
- package/cypress/pages/components/figOverImageCommonComponent.js +0 -1113
- package/cypress/pages/dragAndDropIntoCategoriesAllOrNothingScoring.js +0 -1155
- package/cypress/pages/dragAndDropIntoCategoriesCellsScoring.js +0 -1561
- package/cypress/pages/dragAndDropIntoCategoriesResponseScoring.js +0 -1396
- package/cypress/pages/fillInTheGapsScoring.js +0 -5872
- package/cypress/pages/fillInTheGapsSetCorrectAnswerSection.js +0 -260
@@ -1,65 +1,66 @@
|
|
1
|
-
import utilities from "../../support/helpers/utilities"
|
2
|
-
import {
|
3
|
-
import {
|
4
|
-
import {
|
5
|
-
import {
|
6
|
-
import {
|
7
|
-
import { additionalSettingsPanel } from "./additionalSettingsPanel"
|
8
|
-
import { autoScoredAdditionalSettings } from "./autoScoredAdditionalSettings"
|
1
|
+
import utilities from "../../support/helpers/utilities";
|
2
|
+
import { autoScoredScoringSectionMultiResponseType } from "./autoScoredScoringSectionMultiResponseType";
|
3
|
+
import { autoScoredSpecifyCorrectAnswerSection } from "./autoScoredSpecifyCorrectAnswerSection";
|
4
|
+
import { commonComponents } from "./commonComponents";
|
5
|
+
import { optionsWrapperComponent } from "./optionsWrapperComponent";
|
6
|
+
import { createQuestionBasePage } from "./createQuestionBasePage";
|
9
7
|
const css = Cypress.env('css');
|
10
8
|
|
11
|
-
let optionsForResponse = ['changing', 'progressively', 'healthy', 'new'];
|
12
|
-
|
13
9
|
const selectors = {
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
10
|
+
//Dropdown options section
|
11
|
+
dropdownOptionsLabel: () => cy.get('.dropdown-options-label'),
|
12
|
+
dropdownOptionsTab: () => cy.get('.ngie-tablist-tab-button[data-ngie-testid*="dropdown"]'),
|
13
|
+
dropdownOptionsInputField: () => cy.get('.input-editable input[type*="text"]'),
|
14
|
+
dropdownOptionsInputFieldNumeration: () => cy.get('[class*="MuiInputAdornment"]'),
|
15
|
+
|
16
|
+
//Specify correct answer dropdown
|
17
|
+
dropdownWrapperSpecifyCorrectAnswerSection: () => cy.get('.response-dropdown-wrapper'),
|
18
|
+
dropdownSpecifyCorrectAnswerSection: () => cy.get('.response-dropdown [role="combobox"]'),
|
19
|
+
dropdownLabelSpecifyCorrectAnswerSection: () => cy.get('.response-label'),
|
20
|
+
|
21
|
+
//Dropdown list
|
22
|
+
dropdownList: () => cy.get('.dropdown-list-ul'),
|
23
|
+
dropdownListOptions: (ariaLabel = null) => {
|
20
24
|
if (ariaLabel) {
|
21
25
|
return cy.get(`[role="listbox"] .dropdown-menu-item[aria-label*="${ariaLabel}"]`)
|
22
26
|
} else {
|
23
27
|
return cy.get('[role="listbox"] .dropdown-menu-item')
|
24
28
|
}
|
25
29
|
},
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
30
|
+
|
31
|
+
//Dropdown and Dropdown menu section
|
32
|
+
dropdownLabel: () => cy.get('.single-select-toggle-group-title'),
|
33
|
+
userSpecifiedWidthToggleButton: () => cy.get('[class*="SingleSelectToggleGroupstyles__ButtonContainer"] button').eq(0),
|
34
|
+
AutoScaleToggleButton: () => cy.get('[class*="SingleSelectToggleGroupstyles__ButtonContainer"] button').eq(1),
|
35
|
+
displayMultilineTextCheckbox: () => cy.get('[data-ngie-testid="display-multiline-text-in-dropdown-checkbox"] input'),
|
36
|
+
displayMultilineTextCheckboxLabel: () => cy.get('[data-ngie-testid="display-multiline-text-in-dropdown-checkbox"] [class*="label"]'),
|
37
|
+
dropdownMenuLabel: () => cy.get('[class*="StudentOptionstyles__SubLabel"]'),
|
38
|
+
wordWrapCheckbox: () => cy.get('[data-ngie-testid="word-wrap-for-dropdown-menu-checkbox"] input'),
|
39
|
+
wordWrapCheckboxLabel: () => cy.get('[data-ngie-testid="word-wrap-for-dropdown-menu-checkbox"] [class*="label"]'),
|
40
|
+
|
41
|
+
//Preview tab
|
42
|
+
dropdownWrapperPreviewTab: () => cy.get('[class*="question-preview-wrapper"] .response-dropdown-wrapper'),
|
43
|
+
dropdownPreviewTab: () => cy.get('[class*="question-preview-wrapper"] [aria-haspopup="listbox"]'),
|
44
|
+
dropdownNumerationPreviewTab: () => cy.get('.answer-numeration-number-box'),
|
45
|
+
correctAnswersLabel: () => cy.get('[class*="question-preview-wrapper"] [class*="correct-answer-label"]'),
|
46
|
+
correctAnswerResponseNumeration: () => cy.get('.answer-numeration-number-box'),
|
47
|
+
tickIconWrapper: () => cy.get('.tick-icon-wrapper [data-name*="Rectangle"]'),
|
39
48
|
}
|
40
49
|
|
41
50
|
const steps = {
|
42
|
-
...scoringSectionBase.steps,
|
43
|
-
/**
|
44
|
-
* @param {number} responseIndex index of the response token/container
|
45
|
-
* @description Verify that options for response label and its section is displayed for the response token
|
46
|
-
*/
|
47
|
-
verifyOptionsForResponseLabelAndSectionIsDisplayed: (responseIndex) => {
|
48
|
-
utilities.verifyElementVisibilityState(fillInTheGapsDropdownCommonComponent.optionsForResponseContainer().eq(responseIndex), 'visible');
|
49
|
-
utilities.verifyInnerText(fillInTheGapsDropdownCommonComponent.optionsForResponseLabel().eq(responseIndex), `Options for response ${responseIndex + 1}`);
|
50
|
-
},
|
51
|
-
|
52
51
|
/**
|
53
|
-
* @param {number}
|
52
|
+
* @param {number} dropdownOptionsTabIndex Index of the dropdown options tab
|
54
53
|
* @param {string[]} responseTextArray Array of text to be given as input in options input field
|
55
|
-
* @description Add input to options input fields
|
54
|
+
* @description Add input to dropdown options input fields
|
56
55
|
*/
|
57
|
-
|
58
|
-
fillInTheGapsDropdownCommonComponent.
|
59
|
-
.
|
56
|
+
addInputToDropdownOptionFields: (dropdownOptionsTabIndex, responseTextArray) => {
|
57
|
+
utilities.getNthElement(fillInTheGapsDropdownCommonComponent.dropdownOptionsTab(), dropdownOptionsTabIndex)
|
58
|
+
.click();
|
59
|
+
fillInTheGapsDropdownCommonComponent.steps.verifyDropdownOptionsTabIsSelected(dropdownOptionsTabIndex);
|
60
|
+
optionsWrapperComponent.optionsSectionWrapper()
|
60
61
|
.within(() => {
|
61
62
|
responseTextArray.forEach((responseFieldText, optionIndex) => {
|
62
|
-
fillInTheGapsDropdownCommonComponent.steps.
|
63
|
+
fillInTheGapsDropdownCommonComponent.steps.addInputToDropdownOptionInputField(optionIndex, responseFieldText);
|
63
64
|
});
|
64
65
|
});
|
65
66
|
},
|
@@ -69,77 +70,199 @@ const steps = {
|
|
69
70
|
* @param {string} responseText text to be given as input in option input field
|
70
71
|
* @description Add input to options input fields
|
71
72
|
*/
|
72
|
-
|
73
|
-
fillInTheGapsDropdownCommonComponent.
|
74
|
-
.eq(optionIndex)
|
73
|
+
addInputToDropdownOptionInputField: (optionIndex, responseFieldText) => {
|
74
|
+
utilities.getNthElement(fillInTheGapsDropdownCommonComponent.dropdownOptionsInputField(), optionIndex)
|
75
75
|
.clear()
|
76
76
|
.type(responseFieldText, { delay: 0 })
|
77
77
|
.should('have.value', responseFieldText);
|
78
78
|
},
|
79
79
|
|
80
|
+
/**
|
81
|
+
* @param {number} dropdownOptionsTabIndex Index of the dropdown options tab
|
82
|
+
* @description Navigate to dropdown options tab
|
83
|
+
*/
|
84
|
+
navigateToDropdownOptionsTab: (dropdownOptionsTabIndex) => {
|
85
|
+
utilities.getNthElement(fillInTheGapsDropdownCommonComponent.dropdownOptionsTab(), dropdownOptionsTabIndex)
|
86
|
+
.click();
|
87
|
+
},
|
88
|
+
|
89
|
+
/**
|
90
|
+
* @param {number} dropdownOptionsTabIndex Index of the dropdown options tab
|
91
|
+
* @description Verify dropdown options tab is selected
|
92
|
+
*/
|
93
|
+
verifyDropdownOptionsTabIsSelected: (dropdownOptionsTabIndex) => {
|
94
|
+
utilities.getNthElement(fillInTheGapsDropdownCommonComponent.dropdownOptionsTab(), dropdownOptionsTabIndex)
|
95
|
+
.should('have.class', 'Mui-selected');
|
96
|
+
},
|
97
|
+
|
98
|
+
/**
|
99
|
+
* @param {number} dropdownOptionsTabIndex Index of the dropdown options tab
|
100
|
+
* @description Verify dropdown options tab is not selected
|
101
|
+
*/
|
102
|
+
verifyDropdownOptionsTabIsNotSelected: (dropdownOptionsTabIndex) => {
|
103
|
+
utilities.getNthElement(fillInTheGapsDropdownCommonComponent.dropdownOptionsTab(), dropdownOptionsTabIndex)
|
104
|
+
.should('not.have.class', 'Mui-selected');
|
105
|
+
},
|
106
|
+
|
107
|
+
/**
|
108
|
+
* @param {number} dropdownIndex Index of the dropdown
|
109
|
+
* @param {string} dropdownOption Option to be selected in the dropdown
|
110
|
+
* @description Select option from dropdown in specify correct answer section
|
111
|
+
*/
|
112
|
+
selectResponseFromDropdownSpecifyCorrectAnswerSection: (dropdownIndex, dropdownOption) => {
|
113
|
+
fillInTheGapsDropdownCommonComponent.steps.expandDropdownInSpecifyCorrectAnswerSection(dropdownIndex)
|
114
|
+
fillInTheGapsDropdownCommonComponent.steps.selectOptionFromDropdownList(dropdownOption);
|
115
|
+
utilities.verifyInnerText(utilities.getNthElement(fillInTheGapsDropdownCommonComponent.dropdownSpecifyCorrectAnswerSection(), dropdownIndex), dropdownOption);
|
116
|
+
},
|
117
|
+
|
80
118
|
/**
|
81
119
|
* @param {string} dropdownOption Option to be selected from dropdown
|
82
120
|
* @description Select option from dropdown
|
83
121
|
*/
|
84
|
-
|
85
|
-
fillInTheGapsDropdownCommonComponent.
|
122
|
+
selectOptionFromDropdownList: (dropdownOption) => {
|
123
|
+
fillInTheGapsDropdownCommonComponent.dropdownListOptions(dropdownOption)
|
86
124
|
.click();
|
87
|
-
|
88
|
-
|
125
|
+
utilities.verifyElementVisibilityState(commonComponents.dropdownList(), 'notExist');
|
126
|
+
},
|
127
|
+
|
128
|
+
/**
|
129
|
+
* @param {number} dropdownIndex Index of dropdown in specify correct answer section
|
130
|
+
* @description Expand dropdown in specify correct answer section
|
131
|
+
*/
|
132
|
+
expandDropdownInSpecifyCorrectAnswerSection: (dropdownIndex) => {
|
133
|
+
utilities.getNthElement(fillInTheGapsDropdownCommonComponent.dropdownSpecifyCorrectAnswerSection(), dropdownIndex)
|
134
|
+
.click({ position: "right" });
|
135
|
+
utilities.getNthElement(fillInTheGapsDropdownCommonComponent.dropdownSpecifyCorrectAnswerSection(), dropdownIndex)
|
136
|
+
.should('have.attr', 'aria-expanded', 'true');
|
89
137
|
},
|
90
138
|
|
91
139
|
/**
|
92
|
-
|
93
|
-
|
94
|
-
|
140
|
+
* @param {Object[]} CorrectAnswerArray - An array of objects containing the dropdownIndex and dropdownOption to be selected.
|
141
|
+
* @param {number} CorrectAnswerArray[].dropdownIndex - The index of dropdown in preview tab
|
142
|
+
* @param {string} CorrectAnswerArray[].dropdownOption - The dropdown option to be selected from dropdown list
|
143
|
+
* @description Select option from dropdown in preview tab
|
144
|
+
*/
|
145
|
+
selectResponseFromDropdownInPreviewTab: (CorrectAnswerArray) => {
|
146
|
+
CorrectAnswerArray.forEach(({ dropdownIndex, dropdownOption }) => {
|
147
|
+
fillInTheGapsDropdownCommonComponent.steps.expandDropdownInPreviewTab(dropdownIndex);
|
148
|
+
fillInTheGapsDropdownCommonComponent.steps.selectOptionFromDropdownList(dropdownOption);
|
149
|
+
fillInTheGapsDropdownCommonComponent.steps.verifyTextDisplayedInDropdownPreviewTab(dropdownIndex, dropdownOption);
|
150
|
+
});
|
151
|
+
},
|
152
|
+
|
153
|
+
/**
|
154
|
+
* @param {number} dropdownIndex Index of dropdown in preview tab
|
155
|
+
* @description Expand dropdown in preview tab
|
95
156
|
*/
|
96
|
-
|
97
|
-
fillInTheGapsDropdownCommonComponent.
|
98
|
-
|
99
|
-
fillInTheGapsDropdownCommonComponent.
|
100
|
-
.
|
101
|
-
|
157
|
+
expandDropdownInPreviewTab: (dropdownIndex) => {
|
158
|
+
utilities.getNthElement(fillInTheGapsDropdownCommonComponent.dropdownPreviewTab(), dropdownIndex)
|
159
|
+
.click();
|
160
|
+
utilities.getNthElement(fillInTheGapsDropdownCommonComponent.dropdownPreviewTab(), dropdownIndex)
|
161
|
+
.should('have.attr', 'aria-expanded', 'true');
|
162
|
+
},
|
163
|
+
|
164
|
+
/**
|
165
|
+
* Verifies if the specified text is displayed in the dropdown preview tab.
|
166
|
+
* @param {number} dropdownIndex - The index of the dropdown.
|
167
|
+
* @param {string} dropdownText - The text expected to be displayed in the dropdown preview tab.
|
168
|
+
*/
|
169
|
+
verifyTextDisplayedInDropdownPreviewTab: (dropdownIndex, dropdownText) => {
|
170
|
+
utilities.verifyInnerText(utilities.getNthElement(fillInTheGapsDropdownCommonComponent.dropdownPreviewTab(), dropdownIndex), dropdownText);
|
171
|
+
},
|
172
|
+
|
173
|
+
/**
|
174
|
+
* Verify text displayed in the dropdowns of the preview tab.
|
175
|
+
* @param {Object[]} dropdownTextArray - An array of objects containing the dropdownIndex and dropdownText.
|
176
|
+
* @param {number} dropdownTextArray[].dropdownIndex - The index of the dropdown.
|
177
|
+
* @param {string} dropdownTextArray[].dropdownText - The text to be verified in the respective dropdown.
|
178
|
+
*/
|
179
|
+
verifyTextInDropdownsInPreviewTab: (dropdownTextArray) => {
|
180
|
+
dropdownTextArray.forEach(({ dropdownIndex, dropdownText }) => {
|
181
|
+
fillInTheGapsDropdownCommonComponent.steps.verifyTextDisplayedInDropdownPreviewTab(dropdownIndex, dropdownText);
|
182
|
+
});
|
183
|
+
},
|
184
|
+
|
185
|
+
/**
|
186
|
+
* Verify that a specific dropdown is disabled in the preview tab.
|
187
|
+
* @param {number} dropdownIndex - The index of the disabled dropdown.
|
188
|
+
*/
|
189
|
+
verifyDropdownIsDisabled: (dropdownIndex) => {
|
190
|
+
utilities.verifyElementDisabledClass(utilities.getNthElement(fillInTheGapsDropdownCommonComponent.dropdownPreviewTab(), dropdownIndex));
|
191
|
+
},
|
192
|
+
|
193
|
+
verifyPointsPerResponseLabel: () => {
|
194
|
+
utilities.verifyInnerText(autoScoredScoringSectionMultiResponseType.pointsPerResponseLabel(), 'Points per response: -');
|
195
|
+
utilities.verifyElementVisibilityState(autoScoredScoringSectionMultiResponseType.pointsPerResponseLabel(), 'visible');
|
196
|
+
},
|
197
|
+
|
198
|
+
/**
|
199
|
+
* @description Verify points per response score displayed for partial equal weights
|
200
|
+
* @param {number} pointsPerResponse points per response score
|
201
|
+
*/
|
202
|
+
verifyPartialEqualWeightsPointsPerResponseScore: (pointsPerResponse) => {
|
203
|
+
utilities.verifyInnerText(autoScoredScoringSectionMultiResponseType.pointsPerResponseLabel(), `Points per response: ${pointsPerResponse}`);
|
204
|
+
},
|
205
|
+
|
206
|
+
/**
|
207
|
+
* @param {number} index of the option input field
|
208
|
+
* @description verify the enter option input field, drag handle, delete button and option numeration
|
209
|
+
*/
|
210
|
+
verifyOptionsContents: (index) => {
|
211
|
+
optionsWrapperComponent.optionWrapper()
|
212
|
+
.eq(index)
|
213
|
+
.within(() => {
|
214
|
+
fillInTheGapsDropdownCommonComponent.dropdownOptionsInputField()
|
215
|
+
.should('have.attr', 'placeholder', 'Enter option');
|
216
|
+
utilities.verifyElementVisibilityState(commonComponents.dragHandleButton(), 'exist');
|
217
|
+
utilities.verifyElementVisibilityState(commonComponents.deleteButton(), 'visible');
|
218
|
+
utilities.verifyTextContent(fillInTheGapsDropdownCommonComponent.dropdownOptionsInputFieldNumeration(), `${index + 1}`);
|
219
|
+
});
|
220
|
+
},
|
221
|
+
|
222
|
+
/**
|
223
|
+
* Verify dropdown is disabled in the specify correct answer section.
|
224
|
+
* @param {number} dropdownIndex - The index of the disabled dropdown.
|
225
|
+
*/
|
226
|
+
verifyDisabledDropdownInSpecifyCorrectAnswerSection: (dropdownIndex) => {
|
227
|
+
utilities.verifyElementDisabledClass(utilities.getNthElement(fillInTheGapsDropdownCommonComponent.dropdownSpecifyCorrectAnswerSection(), dropdownIndex));
|
228
|
+
},
|
229
|
+
|
230
|
+
/**
|
231
|
+
* Verify dropdown is disabled in the preview tab.
|
232
|
+
* @param {number} dropdownIndex - The index of the disabled dropdown.
|
233
|
+
*/
|
234
|
+
verifyDisabledDropdownInPreviewTab: (dropdownIndex) => {
|
235
|
+
utilities.verifyElementDisabledClass(utilities.getNthElement(fillInTheGapsDropdownCommonComponent.dropdownPreviewTab(), dropdownIndex));
|
102
236
|
},
|
103
237
|
|
104
238
|
/**
|
105
239
|
* @param {string[]} dropdownOptionsArray Array of dropdown options
|
106
240
|
* @description Verify the options displayed in dropdown
|
107
241
|
*/
|
108
|
-
|
242
|
+
verifyDropdownOptionsSpecifyCorrectAnswer: (dropdownOptionsArray) => {
|
109
243
|
dropdownOptionsArray.forEach((dropdownOption, optionIndex) => {
|
110
|
-
fillInTheGapsDropdownCommonComponent.
|
244
|
+
fillInTheGapsDropdownCommonComponent.dropdownListOptions()
|
111
245
|
.eq(optionIndex)
|
112
246
|
.should('have.attr', 'data-value', dropdownOption)
|
113
|
-
fillInTheGapsDropdownCommonComponent.responseDropdownOptions()
|
114
|
-
.eq(dropdownOptionsArray.length)
|
115
|
-
.should('not.exist');
|
116
247
|
});
|
248
|
+
fillInTheGapsDropdownCommonComponent.dropdownListOptions()
|
249
|
+
.eq(dropdownOptionsArray.length)
|
250
|
+
.should('not.exist');
|
117
251
|
},
|
118
252
|
|
119
253
|
/**
|
120
|
-
* @param {
|
121
|
-
* @description Verify the
|
254
|
+
* @param {string[]} dropdownOptionsArray Array of dropdown options
|
255
|
+
* @description Verify the options displayed in dropdown
|
122
256
|
*/
|
123
|
-
|
124
|
-
|
125
|
-
.
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
fillInTheGapsDropdownCommonComponent.optionsForResponseInputField()
|
133
|
-
.should('have.attr', 'placeholder', 'Enter option');
|
134
|
-
commonComponents.dragHandleButton()
|
135
|
-
.should('exist');
|
136
|
-
commonComponents.deleteButton()
|
137
|
-
.should('be.visible');
|
138
|
-
fillInTheGapsDropdownCommonComponent.optionNumeration()
|
139
|
-
.should('have.text', index + 1)
|
140
|
-
});
|
141
|
-
});
|
142
|
-
});
|
257
|
+
verifyDropdownOptionsPreviewTab: (dropdownOptionsArray) => {
|
258
|
+
dropdownOptionsArray.forEach((dropdownOption, optionIndex) => {
|
259
|
+
fillInTheGapsDropdownCommonComponent.dropdownListOptions()
|
260
|
+
.eq(optionIndex)
|
261
|
+
.should('have.attr', 'data-value', dropdownOption)
|
262
|
+
});
|
263
|
+
fillInTheGapsDropdownCommonComponent.dropdownListOptions()
|
264
|
+
.eq(dropdownOptionsArray.length)
|
265
|
+
.should('not.exist');
|
143
266
|
},
|
144
267
|
|
145
268
|
/**
|
@@ -151,7 +274,7 @@ const steps = {
|
|
151
274
|
commonComponents.dropdownList()
|
152
275
|
.within(() => {
|
153
276
|
for (let index = 0; index < currentOptions.length; index++) {
|
154
|
-
fillInTheGapsDropdownCommonComponent.
|
277
|
+
fillInTheGapsDropdownCommonComponent.dropdownListOptions()
|
155
278
|
.eq(index)
|
156
279
|
.then(($element) => {
|
157
280
|
expect($element.text()).to.be.oneOf(currentOptions);
|
@@ -163,9 +286,9 @@ const steps = {
|
|
163
286
|
},
|
164
287
|
|
165
288
|
/**
|
166
|
-
|
167
|
-
|
168
|
-
|
289
|
+
* @param {string[]} previousOrderOfOptions Array of dropdown options displayed in preview tab
|
290
|
+
* @description Verify that dropdown options are re-randomized in preview tab
|
291
|
+
*/
|
169
292
|
verifyRerandomizedOptionsOrder: (previousOrderOfOptions) => {
|
170
293
|
commonComponents.dropdownList()
|
171
294
|
.should('not.have.text', '')
|
@@ -174,7 +297,7 @@ const steps = {
|
|
174
297
|
|
175
298
|
getDropdownOptionsArray: () => {
|
176
299
|
const dropdownOptionsArray = []
|
177
|
-
fillInTheGapsDropdownCommonComponent.
|
300
|
+
fillInTheGapsDropdownCommonComponent.dropdownListOptions()
|
178
301
|
.each(($el) => {
|
179
302
|
cy.wrap($el)
|
180
303
|
.invoke('text')
|
@@ -186,310 +309,295 @@ const steps = {
|
|
186
309
|
},
|
187
310
|
|
188
311
|
/**
|
189
|
-
* @param {number}
|
190
|
-
* @description Verify
|
312
|
+
* @param {number} dropdownIndex Index of dropdown in specify correct answer section
|
313
|
+
* @description Verify dropdown is collapsed in specify correct answer section
|
191
314
|
*/
|
192
|
-
|
193
|
-
utilities.
|
315
|
+
verifyDropdownIsCollapsedInSpecifyCorrectAnswerSection: (dropdownIndex) => {
|
316
|
+
utilities.getNthElement(fillInTheGapsDropdownCommonComponent.dropdownSpecifyCorrectAnswerSection(), dropdownIndex)
|
317
|
+
.should('have.attr', 'aria-expanded', 'false');
|
318
|
+
utilities.verifyElementVisibilityState(commonComponents.dropdownList(), 'notExist');
|
194
319
|
},
|
195
320
|
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
321
|
+
/**
|
322
|
+
* @param {number} dropdownIndex Index of dropdown in specify correct answer section
|
323
|
+
* @description Expand and collapse dropdown in specify correct answer section
|
324
|
+
*/
|
325
|
+
expandAndCollapseDropdownInSpecifyCorrectAnswerSection: (dropdownIndex) => {
|
326
|
+
utilities.getNthElement(fillInTheGapsDropdownCommonComponent.dropdownSpecifyCorrectAnswerSection(), dropdownIndex)
|
327
|
+
.click({ position: "right" });
|
328
|
+
cy.get('body')
|
200
329
|
.click();
|
201
|
-
fillInTheGapsDropdownCommonComponent.dropdownList()
|
202
|
-
.should('not.exist');
|
203
330
|
},
|
204
331
|
|
205
332
|
/**
|
206
|
-
* @param {number}
|
207
|
-
* @description
|
333
|
+
* @param {number} optionIndex index of the option input field
|
334
|
+
* @description Focus in and focus out of options input field
|
208
335
|
*/
|
209
|
-
|
210
|
-
fillInTheGapsDropdownCommonComponent.
|
211
|
-
.
|
212
|
-
.
|
213
|
-
fillInTheGapsDropdownCommonComponent.responseDropdownSetCorrectAnswerSection()
|
214
|
-
.eq(responseDropdownIndex)
|
215
|
-
.should('have.attr', 'aria-expanded', 'true');
|
336
|
+
focusInAndFocusOutOfDropdownOptionInputField: (optionIndex) => {
|
337
|
+
utilities.getNthElement(fillInTheGapsDropdownCommonComponent.dropdownOptionsInputField(), optionIndex)
|
338
|
+
.click()
|
339
|
+
.blur();
|
216
340
|
},
|
217
341
|
|
218
|
-
|
219
|
-
fillInTheGapsDropdownCommonComponent.
|
220
|
-
.
|
221
|
-
.verifyTooltip('Delete option');
|
342
|
+
verifyUserSpecifiedToggleButtonIsSelected: () => {
|
343
|
+
fillInTheGapsDropdownCommonComponent.userSpecifiedWidthToggleButton()
|
344
|
+
.should('have.class', 'Mui-selected');
|
222
345
|
},
|
223
346
|
|
224
|
-
|
225
|
-
fillInTheGapsDropdownCommonComponent.
|
226
|
-
.
|
227
|
-
.trigger('mouseover', { force: true })
|
228
|
-
fillInTheGapsDropdownCommonComponent.tooltipText()
|
229
|
-
.should('have.text', 'Minimum two options are required');
|
230
|
-
fillInTheGapsDropdownCommonComponent.deleteButton()
|
231
|
-
.eq(1)
|
232
|
-
.trigger('mouseout', { force: true });
|
233
|
-
fillInTheGapsDropdownCommonComponent.tooltipText()
|
234
|
-
.should('not.exist');
|
347
|
+
verifyAutoScaleToggleButtonNotSelected: () => {
|
348
|
+
fillInTheGapsDropdownCommonComponent.AutoScaleToggleButton()
|
349
|
+
.should('not.have.class', 'Mui-selected');
|
235
350
|
},
|
236
351
|
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
*/
|
241
|
-
focusInAndFocusOutOfOptionsForResponseInputField: (index) => {
|
242
|
-
fillInTheGapsDropdownCommonComponent.optionsForResponseInputField()
|
243
|
-
.eq(index)
|
244
|
-
.focus();
|
245
|
-
fillInTheGapsDropdownCommonComponent.optionsForResponseInputField()
|
246
|
-
.eq(index)
|
247
|
-
.blur();
|
352
|
+
verifyAutoScaleToggleButtonIsSelected: () => {
|
353
|
+
fillInTheGapsDropdownCommonComponent.AutoScaleToggleButton()
|
354
|
+
.should('have.class', 'Mui-selected');
|
248
355
|
},
|
249
356
|
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
*/
|
254
|
-
verifyOptionsForResponseInputFieldErrorMessage: (index) => {
|
255
|
-
fillInTheGapsDropdownCommonComponent.optionWrapper()
|
256
|
-
.eq(index)
|
257
|
-
.within(() => {
|
258
|
-
fillInTheGapsDropdownCommonComponent.optionIsRequiredErrorMessage()
|
259
|
-
.should('have.text', 'Error: Option is required.');
|
260
|
-
});
|
357
|
+
verifyDisplayMultilineCheckboxIsNotChecked: () => {
|
358
|
+
fillInTheGapsDropdownCommonComponent.displayMultilineTextCheckbox()
|
359
|
+
.should('not.be.checked');
|
261
360
|
},
|
262
361
|
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
verifyOptionsForResponseInputFieldErrorMessageDoesNotExist: (index) => {
|
268
|
-
fillInTheGapsDropdownCommonComponent.optionWrapper()
|
269
|
-
.eq(index)
|
270
|
-
.within(() => {
|
271
|
-
fillInTheGapsDropdownCommonComponent.optionIsRequiredErrorMessage()
|
272
|
-
.should('not.exist');
|
273
|
-
});
|
274
|
-
},
|
275
|
-
verifyMatchFromAllResponsesLabelAndCheckboxEnabledState: () => {
|
276
|
-
fillInTheGapsDropdownCommonComponent.matchFromAllResponsesLabel()
|
277
|
-
.should('not.have.class', 'Mui-disabled');
|
278
|
-
fillInTheGapsDropdownCommonComponent.matchFromAllResponsesCheckbox()
|
279
|
-
.and('not.be.disabled');
|
362
|
+
checkDisplayMultilineCheckbox: () => {
|
363
|
+
fillInTheGapsDropdownCommonComponent.displayMultilineTextCheckbox()
|
364
|
+
.click()
|
365
|
+
.should('be.checked');
|
280
366
|
},
|
281
367
|
|
282
|
-
|
283
|
-
fillInTheGapsDropdownCommonComponent.
|
284
|
-
.click()
|
368
|
+
verifyWordWrapForDropdownMenuCheckboxIsChecked: () => {
|
369
|
+
fillInTheGapsDropdownCommonComponent.wordWrapCheckbox()
|
285
370
|
.should('be.checked');
|
286
371
|
},
|
287
372
|
|
288
|
-
|
289
|
-
fillInTheGapsDropdownCommonComponent.
|
373
|
+
uncheckWordWrapForDropdownMenuCheckbox: () => {
|
374
|
+
fillInTheGapsDropdownCommonComponent.wordWrapCheckbox()
|
290
375
|
.click()
|
291
376
|
.should('not.be.checked');
|
292
377
|
},
|
293
378
|
|
294
|
-
|
295
|
-
fillInTheGapsDropdownCommonComponent.
|
296
|
-
.click()
|
297
|
-
.should('be.checked');
|
379
|
+
selectUserSpecifiedWidthToggleButton: () => {
|
380
|
+
fillInTheGapsDropdownCommonComponent.userSpecifiedWidthToggleButton()
|
381
|
+
.click();
|
298
382
|
},
|
299
383
|
|
300
|
-
|
301
|
-
fillInTheGapsDropdownCommonComponent.
|
302
|
-
.click()
|
303
|
-
.should('not.be.checked');
|
384
|
+
selectAutoScaleToggleButton: () => {
|
385
|
+
fillInTheGapsDropdownCommonComponent.AutoScaleToggleButton()
|
386
|
+
.click();
|
304
387
|
},
|
305
388
|
|
306
|
-
|
307
|
-
|
308
|
-
|
389
|
+
compareDropdownMenuAndDropdownWidthForUserSpecifiedWidth: () => {
|
390
|
+
let dropdownWidth
|
391
|
+
utilities.getNthElement(fillInTheGapsDropdownCommonComponent.dropdownSpecifyCorrectAnswerSection(), 0)
|
392
|
+
.then(($originalDropdownWidth) => {
|
393
|
+
dropdownWidth = $originalDropdownWidth.css('width'); //Storing original dropdown width
|
394
|
+
});
|
395
|
+
fillInTheGapsDropdownCommonComponent.steps.expandDropdownInSpecifyCorrectAnswerSection(0);
|
396
|
+
fillInTheGapsDropdownCommonComponent.dropdownList()
|
397
|
+
.then(($dropdownMenuWidth) => {
|
398
|
+
let dropdownMenuWidth = $dropdownMenuWidth.css('max-width');
|
399
|
+
expect(dropdownMenuWidth).to.be.eq(dropdownWidth); //Comparing dropdown menu and dropdown width
|
400
|
+
});
|
309
401
|
},
|
310
402
|
|
311
|
-
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
|
403
|
+
compareDropdownMenuAndDropdownWidthForAutoScaled: () => {
|
404
|
+
let originalDropdownWidth
|
405
|
+
utilities.getNthElement(fillInTheGapsDropdownCommonComponent.dropdownSpecifyCorrectAnswerSection(), 0)
|
406
|
+
.then(($originalDropdownWidth) => {
|
407
|
+
originalDropdownWidth = $originalDropdownWidth.width(); //Storing original dropdown width
|
408
|
+
});
|
409
|
+
fillInTheGapsDropdownCommonComponent.steps.selectAutoScaleToggleButton();
|
410
|
+
fillInTheGapsDropdownCommonComponent.steps.verifyAutoScaleToggleButtonIsSelected();
|
411
|
+
utilities.getNthElement(fillInTheGapsDropdownCommonComponent.dropdownSpecifyCorrectAnswerSection(), 0)
|
412
|
+
.then(($modifiedDropdownWidth) => {
|
413
|
+
let modifiedDropdownWidth = $modifiedDropdownWidth.width(); //Storing auto scaled dropdown width
|
414
|
+
expect(modifiedDropdownWidth).to.be.gt(originalDropdownWidth);
|
415
|
+
});
|
416
|
+
fillInTheGapsDropdownCommonComponent.steps.expandDropdownInSpecifyCorrectAnswerSection(0);
|
417
|
+
fillInTheGapsDropdownCommonComponent.dropdownList()
|
418
|
+
.then(($dropdownMenuWidth) => {
|
419
|
+
let dropdownMenuWidth = $dropdownMenuWidth.width();
|
420
|
+
expect(dropdownMenuWidth).to.be.gt(originalDropdownWidth); //Comparing auto scaled dropdown menu width and original dropdown width
|
421
|
+
});
|
316
422
|
},
|
317
423
|
|
318
|
-
|
319
|
-
|
320
|
-
|
321
|
-
|
322
|
-
|
323
|
-
|
324
|
-
|
325
|
-
|
326
|
-
|
424
|
+
verifyDropdownDefaultWidthInSpecifyCorrectAnswer: () => {
|
425
|
+
utilities.verifyCSS(utilities.getNthElement(fillInTheGapsDropdownCommonComponent.dropdownSpecifyCorrectAnswerSection(), 0), {
|
426
|
+
'width': '120px'
|
427
|
+
});
|
428
|
+
fillInTheGapsDropdownCommonComponent.steps.expandDropdownInSpecifyCorrectAnswerSection(0);
|
429
|
+
utilities.verifyCSS(fillInTheGapsDropdownCommonComponent.dropdownList(), {
|
430
|
+
'max-width': '120px'
|
431
|
+
});
|
432
|
+
},
|
433
|
+
|
434
|
+
compareDropdownMenuAndDropdownWidthForUserSpecifiedWidthInPreviewTab: () => {
|
435
|
+
let dropdownWidth
|
436
|
+
utilities.getNthElement(fillInTheGapsDropdownCommonComponent.dropdownPreviewTab(), 0)
|
437
|
+
.then(($originalDropdownWidth) => {
|
438
|
+
dropdownWidth = $originalDropdownWidth.css('width'); //Storing original dropdown width
|
439
|
+
});
|
440
|
+
fillInTheGapsDropdownCommonComponent.steps.expandDropdownInPreviewTab(0);
|
441
|
+
fillInTheGapsDropdownCommonComponent.dropdownList()
|
442
|
+
.parent()
|
443
|
+
.then(($dropdownMenuWidth) => {
|
444
|
+
let dropdownMenuWidth = $dropdownMenuWidth.css('max-width');
|
445
|
+
expect(dropdownMenuWidth).to.be.eq(dropdownWidth); //Comparing dropdown menu and dropdown width
|
446
|
+
});
|
447
|
+
},
|
448
|
+
|
449
|
+
compareDropdownMenuAndDropdownWidthForAutoScaledInPreviewTab: () => {
|
450
|
+
let originalDropdownWidth
|
451
|
+
utilities.getNthElement(fillInTheGapsDropdownCommonComponent.dropdownPreviewTab(), 0)
|
452
|
+
.then(($originalDropdownWidth) => {
|
453
|
+
originalDropdownWidth = $originalDropdownWidth.width(); //Storing original dropdown width
|
454
|
+
});
|
455
|
+
createQuestionBasePage.steps.switchToEditTab();
|
456
|
+
fillInTheGapsDropdownCommonComponent.steps.selectAutoScaleToggleButton();
|
457
|
+
fillInTheGapsDropdownCommonComponent.steps.verifyAutoScaleToggleButtonIsSelected();
|
458
|
+
createQuestionBasePage.steps.switchToPreviewTab();
|
459
|
+
utilities.getNthElement(fillInTheGapsDropdownCommonComponent.dropdownPreviewTab(), 0)
|
460
|
+
.then(($modifiedDropdownWidth) => {
|
461
|
+
let modifiedDropdownWidth = $modifiedDropdownWidth.width(); //Storing auto scaled dropdown width
|
462
|
+
expect(modifiedDropdownWidth).to.be.gt(originalDropdownWidth);
|
463
|
+
});
|
464
|
+
fillInTheGapsDropdownCommonComponent.steps.expandDropdownInPreviewTab(0);
|
465
|
+
fillInTheGapsDropdownCommonComponent.dropdownList()
|
466
|
+
.then(($dropdownMenuWidth) => {
|
467
|
+
let dropdownMenuWidth = $dropdownMenuWidth.width();
|
468
|
+
expect(dropdownMenuWidth).to.be.gt(originalDropdownWidth); //Comparing auto scaled dropdown menu width and original dropdown width
|
469
|
+
});
|
470
|
+
},
|
471
|
+
|
472
|
+
verifyDropdownDefaultWidthInPreviewTab: () => {
|
473
|
+
utilities.verifyCSS(utilities.getNthElement(fillInTheGapsDropdownCommonComponent.dropdownPreviewTab(), 0), {
|
474
|
+
'width': '120px'
|
475
|
+
});
|
476
|
+
fillInTheGapsDropdownCommonComponent.steps.expandDropdownInPreviewTab(0);
|
477
|
+
utilities.verifyCSS(fillInTheGapsDropdownCommonComponent.dropdownList(), {
|
478
|
+
'max-width': '120px'
|
479
|
+
});
|
327
480
|
},
|
328
481
|
|
329
482
|
/**
|
330
|
-
* @param {number}
|
331
|
-
* @description Verify
|
483
|
+
* @param {number} dropdownIndex Index of dropdown in specify correct answer section
|
484
|
+
* @description Verify multi-line text is not displayed in dropdown in specify correct answer section
|
332
485
|
*/
|
333
|
-
|
334
|
-
fillInTheGapsDropdownCommonComponent.
|
335
|
-
.
|
336
|
-
.within(() => {
|
337
|
-
utilities.verifyElementVisibilityState(fillInTheGapsDropdownCommonComponent.responseDropdownPlaceholderText(), 'notExist');
|
338
|
-
});
|
486
|
+
verifyMultilineTextNotDisplayedInDropdownSpecifyCorrectAnswerSection: (dropdownIndex) => {
|
487
|
+
utilities.getNthElement(fillInTheGapsDropdownCommonComponent.dropdownWrapperSpecifyCorrectAnswerSection(), dropdownIndex)
|
488
|
+
.should('not.have.class', 'multiline-dropdown-text');
|
339
489
|
},
|
340
490
|
|
341
491
|
/**
|
342
|
-
* @param {number}
|
343
|
-
* @
|
344
|
-
* @description Verify placeholder text displayed for response dropdown in set correct answer section
|
492
|
+
* @param {number} dropdownIndex Index of dropdown in specify correct answer section
|
493
|
+
* @description Verify multi-line text is displayed in dropdown in specify correct answer section
|
345
494
|
*/
|
346
|
-
|
347
|
-
fillInTheGapsDropdownCommonComponent.
|
348
|
-
.
|
349
|
-
.within(() => {
|
350
|
-
utilities.verifyTextContent(fillInTheGapsDropdownCommonComponent.responseDropdownPlaceholderText(), placeholderText);
|
351
|
-
});
|
495
|
+
verifyMultilineTextIsDisplayedInDropdownSpecifyCorrectAnswerSection: (dropdownIndex) => {
|
496
|
+
utilities.getNthElement(fillInTheGapsDropdownCommonComponent.dropdownWrapperSpecifyCorrectAnswerSection(), dropdownIndex)
|
497
|
+
.should('have.class', 'multiline-dropdown-text');
|
352
498
|
},
|
353
499
|
|
354
500
|
/**
|
355
|
-
* @param {number}
|
356
|
-
* @
|
357
|
-
* @description Verify height of response dropdown in set correct answer section
|
501
|
+
* @param {number} dropdownIndex Index of dropdown in specify correct answer section
|
502
|
+
* @description Verify multi-line text is not displayed in dropdown in specify correct answer section
|
358
503
|
*/
|
359
|
-
|
360
|
-
fillInTheGapsDropdownCommonComponent.
|
361
|
-
.
|
362
|
-
.should('have.attr', 'height', `${height}px`);
|
504
|
+
verifyMultilineTextNotDisplayedInDropdownPreviewTab: (dropdownIndex) => {
|
505
|
+
utilities.getNthElement(fillInTheGapsDropdownCommonComponent.dropdownWrapperPreviewTab(), dropdownIndex)
|
506
|
+
.should('not.have.class', 'multiline-dropdown-text');
|
363
507
|
},
|
364
508
|
|
365
509
|
/**
|
366
|
-
* @param {number}
|
367
|
-
* @
|
368
|
-
* @description Verify width of response dropdown in set correct answer section
|
510
|
+
* @param {number} dropdownIndex Index of dropdown in specify correct answer section
|
511
|
+
* @description Verify multi-line text is displayed in dropdown in specify correct answer section
|
369
512
|
*/
|
370
|
-
|
371
|
-
fillInTheGapsDropdownCommonComponent.
|
372
|
-
.
|
373
|
-
.should('have.attr', 'width', `${width}px`);
|
513
|
+
verifyMultilineTextIsDisplayedInDropdownPreviewTab: (dropdownIndex) => {
|
514
|
+
utilities.getNthElement(fillInTheGapsDropdownCommonComponent.dropdownWrapperPreviewTab(), dropdownIndex)
|
515
|
+
.should('have.class', 'multiline-dropdown-text');
|
374
516
|
},
|
375
|
-
}
|
376
517
|
|
377
|
-
|
378
|
-
|
379
|
-
|
380
|
-
|
381
|
-
utilities.verifyElementVisibilityState(fillInTheGapsDropdownCommonComponent.randomizeOptionsLabel(), 'visible');
|
382
|
-
fillInTheGapsDropdownCommonComponent.steps.verifyRandomizeOptionsCheckboxNotChecked();
|
383
|
-
});
|
518
|
+
verifyDropdownMenuOptionsWordWrappedSpecifyCorrectAnswerSection: () => {
|
519
|
+
fillInTheGapsDropdownCommonComponent.dropdownList()
|
520
|
+
.should('have.class', 'wordwrap-dropdown-menu');
|
521
|
+
},
|
384
522
|
|
385
|
-
|
386
|
-
|
387
|
-
|
388
|
-
|
389
|
-
});
|
523
|
+
verifyDropdownMenuOptionsNotWordWrappedSpecifyCorrectAnswerSection: () => {
|
524
|
+
fillInTheGapsDropdownCommonComponent.dropdownList()
|
525
|
+
.should('not.have.class', 'wordwrap-dropdown-menu');
|
526
|
+
},
|
390
527
|
|
391
|
-
|
392
|
-
|
393
|
-
|
394
|
-
|
528
|
+
verifyDropdownMenuOptionsWordWrappedPreviewTab: () => {
|
529
|
+
fillInTheGapsDropdownCommonComponent.dropdownList()
|
530
|
+
.should('have.class', 'wordwrap-dropdown-menu');
|
531
|
+
},
|
395
532
|
|
396
|
-
|
397
|
-
|
398
|
-
|
399
|
-
|
400
|
-
|
401
|
-
'color': css.color.labelText,
|
402
|
-
'font-size': css.fontSize.normal,
|
403
|
-
'font-weight': css.fontWeight.regular
|
404
|
-
});
|
405
|
-
});
|
406
|
-
uncheckedCheckboxes.forEach((uncheckedCheckbox) => {
|
407
|
-
utilities.verifyCSS(uncheckedCheckbox().parent().find('svg'), {
|
408
|
-
'fill': css.color.uncheckedCheckbox
|
409
|
-
});
|
410
|
-
});
|
411
|
-
});
|
533
|
+
verifyDropdownMenuOptionsNotWordWrappedPreviewTab: () => {
|
534
|
+
fillInTheGapsDropdownCommonComponent.dropdownList()
|
535
|
+
.should('not.have.class', 'wordwrap-dropdown-menu');
|
536
|
+
}
|
537
|
+
}
|
412
538
|
|
413
|
-
|
414
|
-
|
539
|
+
const tests = {
|
540
|
+
/**
|
541
|
+
* Verifies the contents and functionality of the 'Specify correct answer' accordion for fill in the gaps over image dropdown question.
|
542
|
+
* @param {{'Correct' | 'Alternative'}} accordionName - The name of the accordion to be used in the validation.
|
543
|
+
* @example - verifySpecifyCorrectAnswerAccordionContentsAndFunctionality('Correct');
|
544
|
+
*/
|
545
|
+
verifySpecifyCorrectAnswerAccordionContentsAndFunctionality: (accordionName) => {
|
546
|
+
it(`When user has added a response token in image, then its corresponding dropdown \'Dropdown 1\' should be displayed in the ${accordionName} accordion in collapsed state`, () => {
|
547
|
+
utilities.verifyElementCount(fillInTheGapsDropdownCommonComponent.dropdownSpecifyCorrectAnswerSection(), 1);
|
548
|
+
fillInTheGapsDropdownCommonComponent.steps.verifyDropdownIsCollapsedInSpecifyCorrectAnswerSection(0);
|
549
|
+
utilities.verifyInnerText(utilities.getNthElement(fillInTheGapsDropdownCommonComponent.dropdownLabelSpecifyCorrectAnswerSection(), 0), 'Dropdown 1');
|
415
550
|
});
|
416
|
-
},
|
417
551
|
|
418
|
-
|
419
|
-
|
420
|
-
|
421
|
-
|
422
|
-
verifySetCorrectAnswerTabContentsAndFunctionality: (tabName) => {
|
423
|
-
it('An empty points input field and two dropdowns with labels \'Response 1\' and \'Response 2\' should be present', () => {
|
424
|
-
fillInTheGapsDropdownCommonComponent.steps.verifyPointsFieldValue('');
|
425
|
-
for (let index = 0; index < 2; index++) {
|
426
|
-
utilities.verifyInnerText(fillInTheGapsDropdownCommonComponent.responseFieldLabelSetCorrectAnswerSection().eq(index), `Response ${index + 1}`)
|
427
|
-
utilities.verifyElementVisibilityState(fillInTheGapsDropdownCommonComponent.responseDropdownSetCorrectAnswerSection().eq(index), 'visible');
|
428
|
-
};
|
552
|
+
it('When user expands and collapses the dropdown without selecting any option, \'Error: Please set a correct answer.\' error message should be displayed', () => {
|
553
|
+
fillInTheGapsDropdownCommonComponent.steps.expandAndCollapseDropdownInSpecifyCorrectAnswerSection(0);
|
554
|
+
utilities.verifyElementVisibilityState(commonComponents.errorMessage(), 'visible');
|
555
|
+
utilities.verifyInnerText(commonComponents.errorMessage(), 'Error: Please set a correct answer.');
|
429
556
|
});
|
430
557
|
|
431
|
-
it('When the user selects any option from the dropdown,
|
432
|
-
fillInTheGapsDropdownCommonComponent.steps.
|
433
|
-
|
558
|
+
it('When the user selects any option from the dropdown, then error message should disappear and that option should be displayed on the dropdown', () => {
|
559
|
+
fillInTheGapsDropdownCommonComponent.steps.selectResponseFromDropdownSpecifyCorrectAnswerSection(0, optionsForDropdown[0]);
|
560
|
+
commonComponents.steps.verifyErrorMessageIsNotDisplayed();
|
434
561
|
});
|
435
562
|
|
436
|
-
|
563
|
+
autoScoredSpecifyCorrectAnswerSection.tests.verifyAutoScoredPointsErrorMessageWhenPointsFieldIsEmpty(accordionName);
|
437
564
|
|
438
|
-
it(`CSS of ${
|
439
|
-
utilities.verifyCSS(fillInTheGapsDropdownCommonComponent.
|
565
|
+
it(`CSS of ${accordionName} accordion contents`, { tags: 'css' }, () => {
|
566
|
+
utilities.verifyCSS(fillInTheGapsDropdownCommonComponent.dropdownLabelSpecifyCorrectAnswerSection(), {
|
440
567
|
'color': css.color.labels,
|
441
568
|
'font-size': css.fontSize.default,
|
442
569
|
'font-weight': css.fontWeight.regular
|
443
570
|
});
|
444
|
-
utilities.verifyCSS(fillInTheGapsDropdownCommonComponent.
|
445
|
-
'
|
446
|
-
'border': `1px solid ${css.color.
|
571
|
+
utilities.verifyCSS(fillInTheGapsDropdownCommonComponent.dropdownSpecifyCorrectAnswerSection(), {
|
572
|
+
'background-color': css.color.figActiveComponentBg,
|
573
|
+
'border': `1px solid ${css.color.activeComponentBorder}`
|
447
574
|
});
|
448
575
|
//CSS of selected dropdown option which appears on dropdown
|
449
|
-
utilities.verifyCSS(fillInTheGapsDropdownCommonComponent.
|
576
|
+
utilities.verifyCSS(fillInTheGapsDropdownCommonComponent.dropdownSpecifyCorrectAnswerSection(), {
|
450
577
|
'color': css.color.liText,
|
451
578
|
'font-size': css.fontSize.default,
|
452
579
|
'font-weight': css.fontWeight.regular
|
453
580
|
});
|
454
581
|
});
|
455
582
|
|
456
|
-
it(`Accessibility of ${
|
457
|
-
cy.checkAccessibility(fillInTheGapsDropdownCommonComponent.
|
458
|
-
});
|
459
|
-
},
|
460
|
-
|
461
|
-
verifyResponseContentsOfSetCorrectAnswerSection: () => {
|
462
|
-
it('Response dropdown contents should be displayed in the set correct answer section', () => {
|
463
|
-
for (let index = 0; index < 2; index++) {
|
464
|
-
utilities.verifyInnerText(fillInTheGapsDropdownCommonComponent.responseFieldLabelSetCorrectAnswerSection().eq(index), `Response ${index + 1}`)
|
465
|
-
utilities.verifyElementVisibilityState(fillInTheGapsDropdownCommonComponent.responseDropdownSetCorrectAnswerSection().eq(index), 'visible');
|
466
|
-
};
|
583
|
+
it(`Accessibility of ${accordionName} accordion contents`, { tags: 'a11y' }, () => {
|
584
|
+
cy.checkAccessibility(utilities.getNthElement(fillInTheGapsDropdownCommonComponent.dropdownSpecifyCorrectAnswerSection(), 0).parents('[aria-label="Specify correct answer section"]'));
|
467
585
|
});
|
468
586
|
},
|
469
587
|
|
470
|
-
|
471
|
-
it('When
|
472
|
-
|
473
|
-
|
474
|
-
|
475
|
-
|
476
|
-
|
477
|
-
|
478
|
-
utilities.verifyElementVisibilityState(autoScoredScoringSectionMultipleResponsesType.rounddownScoreCheckbox(), 'notExist');
|
479
|
-
utilities.verifyElementVisibilityState(autoScoredScoringSectionMultipleResponsesType.rounddownScoreCheckboxLabel(), 'notExist');
|
480
|
-
utilities.verifyElementVisibilityState(fillInTheGapsDropdownCommonComponent.randomizeOptionsCheckbox(), 'notExist');
|
481
|
-
utilities.verifyElementVisibilityState(fillInTheGapsDropdownCommonComponent.matchFromAllResponsesCheckbox(), 'notExist');
|
482
|
-
scoringSectionBase.steps.verifyDefaultMinimumScoreIfAttemptedLabelAndPointsField();
|
483
|
-
additionalSettingsPanel.steps.expandAdditonalSettings();
|
484
|
-
utilities.verifyElementVisibilityState(autoScoredAdditionalSettings.checkAnswerLabel(), 'notExist');
|
485
|
-
utilities.verifyElementVisibilityState(autoScoredAdditionalSettings.allowStudentsToCheckAnswerLabel(), 'notExist');
|
486
|
-
utilities.verifyElementVisibilityState(autoScoredAdditionalSettings.allowStudentsToCheckAnswerCheckbox(), 'notExist');
|
588
|
+
verifyContentsOfSpecifyCorrectAnswerSection: () => {
|
589
|
+
it('When user selects a scoring type then in the \'Correct\' accordion, all the contents should be displayed', () => {
|
590
|
+
fillInTheGapsDropdownCommonComponent.dropdownSpecifyCorrectAnswerSection()
|
591
|
+
.each(($element, index) => {
|
592
|
+
utilities.verifyElementVisibilityState(cy.wrap($element), 'visible');
|
593
|
+
utilities.verifyInnerText(utilities.getNthElement(fillInTheGapsDropdownCommonComponent.dropdownLabelSpecifyCorrectAnswerSection(), index), `Dropdown ${index + 1}`);
|
594
|
+
utilities.verifyElementVisibilityState(utilities.getNthElement(fillInTheGapsDropdownCommonComponent.dropdownLabelSpecifyCorrectAnswerSection(), index), 'visible');
|
595
|
+
})
|
487
596
|
});
|
488
597
|
}
|
489
598
|
}
|
490
599
|
|
491
600
|
export const fillInTheGapsDropdownCommonComponent = {
|
492
601
|
...selectors,
|
493
|
-
steps
|
494
|
-
tests
|
602
|
+
steps
|
495
603
|
}
|