itemengine-cypress-automation 1.0.120 → 1.0.122-updateILCRepo28Feb-2c3e0e3.0
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/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/package.json +2 -2
- 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,47 +1,26 @@
|
|
1
1
|
import utilities from "../support/helpers/utilities";
|
2
|
-
import {
|
2
|
+
import { imageCanvasComponent, autoScoredScoringPreviewTab, createQuestionBasePage, backgroundImageUploadComponent, scoringSectionBaseEditTab, questionInstructionsComponent, correctIncorrectAnswerLabelComponent, autoScoredStudentViewSettings, autoScoredSpecifyCorrectAnswerSection, autoScoredScoringSectionMultiResponseType, fillInTheGapsDropdownCommonComponent, randomizeOptionsComponent, optionsWrapperComponent, studentViewSettingsLabelComponent, additionalSettingsPanel } from "./components";
|
3
3
|
const css = Cypress.env('css');
|
4
4
|
|
5
5
|
const optionsForDropdown = ['Flower', 'Petal', 'Stem', 'Branch'];
|
6
6
|
|
7
7
|
const selectors = {
|
8
8
|
...questionInstructionsComponent,
|
9
|
-
...
|
9
|
+
...imageCanvasComponent,
|
10
10
|
...autoScoredScoringPreviewTab,
|
11
11
|
...correctIncorrectAnswerLabelComponent,
|
12
|
-
...
|
13
|
-
...
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
//Specify correct answer dropdown
|
19
|
-
dropdownSpecifyCorrectAnswerSection: () => cy.get('.response-dropdown [role="combobox"]'),
|
20
|
-
dropdownLabelSpecifyCorrectAnswerSection: () => cy.get('.response-label'),
|
21
|
-
|
22
|
-
//Dropdown list
|
23
|
-
dropdownListOptions: (ariaLabel = null) => {
|
24
|
-
if (ariaLabel) {
|
25
|
-
return cy.get(`[role="listbox"] .dropdown-menu-item[aria-label*="${ariaLabel}"]`)
|
26
|
-
} else {
|
27
|
-
return cy.get('[role="listbox"] .dropdown-menu-item')
|
28
|
-
}
|
29
|
-
},
|
30
|
-
|
31
|
-
//Preview tab
|
32
|
-
dropdownPreviewTab: () => cy.get('[class*="question-preview-wrapper"] [aria-haspopup="listbox"]'),
|
33
|
-
dropdownWrapperPreviewTab: () => cy.get('[class*="question-preview-wrapper"] [class*="Canvasstyle__DropzoneWrapper"]'),
|
34
|
-
dropdownNumerationPreviewTab: () => cy.get('.answer-numeration-number-box'),
|
12
|
+
...fillInTheGapsDropdownCommonComponent,
|
13
|
+
...optionsWrapperComponent,
|
14
|
+
...randomizeOptionsComponent,
|
15
|
+
...backgroundImageUploadComponent,
|
16
|
+
dropdownWrapperPreviewTab: () => cy.get('[class*="question-preview-wrapper"] [class="Canvasstyle__DropzoneWrapper"]'),
|
35
17
|
correctAnswerSectionWrapper: () => cy.get('.dnd-correct-answer-wrapper'),
|
36
|
-
correctAnswersLabel: () => cy.get('.correct-answers-label'),
|
37
|
-
correctAnswerResponseNumeration: () => cy.get('.answer-numeration-number-box'),
|
38
18
|
correctAnswerResponseWrapper: () => cy.get('[class*="LabelImageWithDropdownPreviewstyles__AnswerCell"]'),
|
39
19
|
correctAnswerResponse: () => cy.get('[class*="LabelImageWithDropdownPreviewstyles__AnswerWrapper"]'),
|
40
|
-
tickIconWrapper: () => cy.get('.tick-icon-wrapper [data-name*="Rectangle"]'),
|
41
20
|
}
|
42
21
|
|
43
22
|
const steps = {
|
44
|
-
...
|
23
|
+
...imageCanvasComponent.steps,
|
45
24
|
...autoScoredScoringPreviewTab.steps,
|
46
25
|
...correctIncorrectAnswerLabelComponent.steps,
|
47
26
|
...createQuestionBasePage.steps,
|
@@ -51,133 +30,55 @@ const steps = {
|
|
51
30
|
...autoScoredStudentViewSettings.steps,
|
52
31
|
...autoScoredSpecifyCorrectAnswerSection.steps,
|
53
32
|
...autoScoredScoringSectionMultiResponseType.steps,
|
33
|
+
...fillInTheGapsDropdownCommonComponent.steps,
|
34
|
+
...additionalSettingsPanel.steps,
|
35
|
+
...optionsWrapperComponent.steps,
|
36
|
+
...randomizeOptionsComponent.steps,
|
54
37
|
/**
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
utilities.getNthElement(fillInTheGapsOverImageDropdownPage.dropdownOptionsTab(), dropdownOptionsTabIndex)
|
61
|
-
.click();
|
62
|
-
fillInTheGapsOverImageDropdownPage.steps.verifyDropdownOptionsTabIsSelected(dropdownOptionsTabIndex);
|
63
|
-
optionsWrapperComponent.optionsSectionWrapper()
|
38
|
+
* Verify that the correct option icon is is displayed for a specific dropdown.
|
39
|
+
* @param {number} dropdownIndex - The index of the dropdown.
|
40
|
+
*/
|
41
|
+
verifyCorrectOptionIcon: (dropdownIndex) => {
|
42
|
+
utilities.getNthElement(fillInTheGapsOverImageDropdownPage.dropdownWrapperPreviewTab(), dropdownIndex)
|
64
43
|
.within(() => {
|
65
|
-
|
66
|
-
|
44
|
+
utilities.verifyCSS(fillInTheGapsDropdownCommonComponent.tickIconWrapper(), {
|
45
|
+
'fill': css.color.correctAnswer
|
67
46
|
});
|
68
47
|
});
|
69
48
|
},
|
70
49
|
|
71
50
|
/**
|
72
|
-
*
|
73
|
-
* @param {
|
74
|
-
* @description Add input to options input fields
|
75
|
-
*/
|
76
|
-
addInputToDropdownOptionInputField: (optionIndex, responseFieldText) => {
|
77
|
-
utilities.getNthElement(fillInTheGapsOverImageDropdownPage.dropdownOptionsInputField(), optionIndex)
|
78
|
-
.clear()
|
79
|
-
.type(responseFieldText, { delay: 0 })
|
80
|
-
.should('have.value', responseFieldText);
|
81
|
-
},
|
82
|
-
|
83
|
-
/**
|
84
|
-
* @param {number} dropdownOptionsTabIndex Index of the dropdown options tab
|
85
|
-
* @description Verify dropdown options tab is selected
|
86
|
-
*/
|
87
|
-
verifyDropdownOptionsTabIsSelected: (dropdownOptionsTabIndex) => {
|
88
|
-
utilities.getNthElement(fillInTheGapsOverImageDropdownPage.dropdownOptionsTab(), dropdownOptionsTabIndex)
|
89
|
-
.should('have.class', 'Mui-selected');
|
90
|
-
},
|
91
|
-
|
92
|
-
/**
|
93
|
-
* @param {number} dropdownIndex Index of the dropdown
|
94
|
-
* @param {string} dropdownOption Option to be selected in the dropdown
|
95
|
-
* @description Select option from dropdown in specify correct answer section
|
96
|
-
*/
|
97
|
-
selectResponseFromDropdownSpecifyCorrectAnswerSection: (dropdownIndex, dropdownOption) => {
|
98
|
-
fillInTheGapsOverImageDropdownPage.steps.expandResponseDropdownInSpecifyCorrectAnswerSection(dropdownIndex)
|
99
|
-
fillInTheGapsOverImageDropdownPage.steps.selectOptionFromDropdownList(dropdownOption);
|
100
|
-
utilities.verifyInnerText(utilities.getNthElement(fillInTheGapsOverImageDropdownPage.dropdownSpecifyCorrectAnswerSection(), dropdownIndex), dropdownOption);
|
101
|
-
},
|
102
|
-
|
103
|
-
/**
|
104
|
-
* @param {string} dropdownOption Option to be selected from dropdown
|
105
|
-
* @description Select option from dropdown
|
51
|
+
* Verify that both correct and incorrect option icons do not exist for a specific dropdown.
|
52
|
+
* @param {number} dropdownIndex - The index of the dropdown.
|
106
53
|
*/
|
107
|
-
|
108
|
-
fillInTheGapsOverImageDropdownPage.
|
109
|
-
.
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
/**
|
114
|
-
* @param {number} responseDropdownIndex Index of response dropdown in specify correct answer section
|
115
|
-
* @description Expand response dropdown in specify correct answer section
|
116
|
-
*/
|
117
|
-
expandResponseDropdownInSpecifyCorrectAnswerSection: (responseDropdownIndex) => {
|
118
|
-
utilities.getNthElement(fillInTheGapsOverImageDropdownPage.dropdownSpecifyCorrectAnswerSection(), responseDropdownIndex)
|
119
|
-
.click({ position: "right" });
|
120
|
-
utilities.getNthElement(fillInTheGapsOverImageDropdownPage.dropdownSpecifyCorrectAnswerSection(), responseDropdownIndex)
|
121
|
-
.should('have.attr', 'aria-expanded', 'true');
|
122
|
-
},
|
123
|
-
|
124
|
-
/**
|
125
|
-
* @param {number} responseDropdownIndex Index of response dropdown in specify correct answer section
|
126
|
-
* @description Verify dropdown is expanded in specify correct answer section
|
127
|
-
*/
|
128
|
-
verifyDropdownIsExpandedInSpecifyCorrectAnswerSection: (responseDropdownIndex) => {
|
129
|
-
utilities.getNthElement(fillInTheGapsOverImageDropdownPage.dropdownSpecifyCorrectAnswerSection(), responseDropdownIndex)
|
130
|
-
.should('have.attr', 'aria-expanded', 'true');
|
131
|
-
},
|
132
|
-
|
133
|
-
/**
|
134
|
-
* @param {number} responseDropdownIndex Index of response dropdown in specify correct answer section
|
135
|
-
* @description Verify dropdown is collapsed in specify correct answer section
|
136
|
-
*/
|
137
|
-
verifyDropdownIsCollapsedInSpecifyCorrectAnswerSection: (responseDropdownIndex) => {
|
138
|
-
utilities.getNthElement(fillInTheGapsOverImageDropdownPage.dropdownSpecifyCorrectAnswerSection(), responseDropdownIndex)
|
139
|
-
.should('have.attr', 'aria-expanded', 'false');
|
140
|
-
utilities.verifyElementVisibilityState(commonComponents.dropdownList(), 'notExist');
|
141
|
-
},
|
142
|
-
|
143
|
-
/**
|
144
|
-
* @param {number} responseDropdownIndex Index of response dropdown in specify correct answer section
|
145
|
-
* @description Expand and collapse dropdown in specify correct answer section
|
146
|
-
*/
|
147
|
-
expandAndCollapseDropdownInSpecifyCorrectAnswerSection: (responseDropdownIndex) => {
|
148
|
-
utilities.getNthElement(fillInTheGapsOverImageDropdownPage.dropdownSpecifyCorrectAnswerSection(), responseDropdownIndex)
|
149
|
-
.click({ position: "right" });
|
150
|
-
cy.get('body')
|
151
|
-
.click();
|
54
|
+
verifyCorrectIncorrectIconNotExist: (dropdownIndex) => {
|
55
|
+
utilities.getNthElement(fillInTheGapsOverImageDropdownPage.dropdownWrapperPreviewTab(), dropdownIndex)
|
56
|
+
.within(() => {
|
57
|
+
utilities.verifyElementVisibilityState(fillInTheGapsDropdownCommonComponent.tickIconWrapper(), 'notExist');
|
58
|
+
});
|
152
59
|
},
|
153
60
|
|
154
61
|
/**
|
155
|
-
*
|
156
|
-
* @param {number}
|
157
|
-
* @param {string} CorrectAnswerArray[].dropdownOption - The dropdown option to be selected from dropdown list
|
158
|
-
* @description Select option from dropdown in preview tab
|
62
|
+
* Verify that the incorrect option icon is displayed for a specific dropdown.
|
63
|
+
* @param {number} dropdownIndex - The index of the dropdown.
|
159
64
|
*/
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
/**
|
169
|
-
* @param {number} dropdownIndex Index of dropdown in preview tab
|
170
|
-
* @description Expand dropdown in preview tab
|
171
|
-
*/
|
172
|
-
expandDropdownInPreviewTab: (dropdownIndex) => {
|
173
|
-
utilities.getNthElement(fillInTheGapsOverImageDropdownPage.dropdownPreviewTab(), dropdownIndex)
|
174
|
-
.click();
|
175
|
-
utilities.getNthElement(fillInTheGapsOverImageDropdownPage.dropdownPreviewTab(), dropdownIndex)
|
176
|
-
.should('have.attr', 'aria-expanded', 'true');
|
65
|
+
verifyIncorrectOptionIcon: (dropdownIndex) => {
|
66
|
+
utilities.getNthElement(fillInTheGapsOverImageDropdownPage.dropdownWrapperPreviewTab(), dropdownIndex)
|
67
|
+
.within(() => {
|
68
|
+
utilities.verifyCSS(fillInTheGapsDropdownCommonComponent.tickIconWrapper(), {
|
69
|
+
'fill': css.color.incorrectAnswer
|
70
|
+
});
|
71
|
+
});
|
177
72
|
},
|
178
73
|
|
179
|
-
|
180
|
-
|
74
|
+
verifyCorrectIncorrectIconsNotExist: () => {
|
75
|
+
fillInTheGapsOverImageDropdownPage.dropdownWrapperPreviewTab()
|
76
|
+
.each(($element) => {
|
77
|
+
cy.wrap($element)
|
78
|
+
.within(() => {
|
79
|
+
utilities.verifyElementVisibilityState(fillInTheGapsOverImageDropdownPage.tickIconWrapper(), 'notExist');
|
80
|
+
});
|
81
|
+
});
|
181
82
|
},
|
182
83
|
|
183
84
|
verifyDropdownNumerationPreviewTab: () => {
|
@@ -185,7 +86,7 @@ const steps = {
|
|
185
86
|
.each(($element, index) => {
|
186
87
|
cy.wrap($element)
|
187
88
|
.within(() => {
|
188
|
-
utilities.verifyTextContent(
|
89
|
+
utilities.verifyTextContent(fillInTheGapsDropdownCommonComponent.dropdownNumerationPreviewTab(), `${index + 1}`);
|
189
90
|
});
|
190
91
|
});
|
191
92
|
},
|
@@ -196,101 +97,86 @@ const steps = {
|
|
196
97
|
* @example verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(['Flower', 'Petals', 'Stem']);
|
197
98
|
*/
|
198
99
|
verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount: (correctAnswerArray) => {
|
199
|
-
utilities.verifyElementCount(fillInTheGapsOverImageDropdownPage.
|
100
|
+
utilities.verifyElementCount(fillInTheGapsOverImageDropdownPage.correctAnswerResponse(), correctAnswerArray.length);
|
200
101
|
correctAnswerArray.forEach((correctAnswer, index) => {
|
201
102
|
fillInTheGapsOverImageDropdownPage.correctAnswerResponseWrapper()
|
202
103
|
.eq(index)
|
203
104
|
.within(() => {
|
204
|
-
utilities.verifyInnerText(
|
105
|
+
utilities.verifyInnerText(fillInTheGapsDropdownCommonComponent.correctAnswerResponseNumeration(), `${index + 1}`);
|
205
106
|
fillInTheGapsOverImageDropdownPage.correctAnswerResponse()
|
206
107
|
.should('have.text', correctAnswer);
|
207
108
|
});
|
208
109
|
});
|
209
110
|
},
|
210
111
|
|
211
|
-
/**
|
212
|
-
* Verify that the incorrect option icon is displayed for a specific dropdown.
|
213
|
-
* @param {number} dropdownIndex - The index of the dropdown.
|
214
|
-
*/
|
215
|
-
verifyIncorrectOptionIcon: (dropdownIndex) => {
|
216
|
-
utilities.getNthElement(fillInTheGapsOverImageDropdownPage.dropdownWrapperPreviewTab(), dropdownIndex)
|
217
|
-
.within(() => {
|
218
|
-
utilities.verifyCSS(fillInTheGapsOverImageDropdownPage.tickIconWrapper(), {
|
219
|
-
'fill': css.color.incorrectAnswer
|
220
|
-
});
|
221
|
-
});
|
222
|
-
},
|
223
|
-
|
224
|
-
/**
|
225
|
-
* Verify that the correct option icon is is displayed for a specific dropdown.
|
226
|
-
* @param {number} dropdownIndex - The index of the dropdown.
|
227
|
-
*/
|
228
|
-
verifyCorrectOptionIcon: (dropdownIndex) => {
|
229
|
-
utilities.getNthElement(fillInTheGapsOverImageDropdownPage.dropdownWrapperPreviewTab(), dropdownIndex)
|
230
|
-
.within(() => {
|
231
|
-
utilities.verifyCSS(fillInTheGapsOverImageDropdownPage.tickIconWrapper(), {
|
232
|
-
'fill': css.color.correctAnswer
|
233
|
-
});
|
234
|
-
});
|
235
|
-
},
|
236
|
-
|
237
|
-
/**
|
238
|
-
* Verify that both correct and incorrect option icons do not exist for a specific dropdown.
|
239
|
-
* @param {number} dropdownIndex - The index of the dropdown.
|
240
|
-
*/
|
241
|
-
verifyCorrectIncorrectIconNotExist: (dropdownIndex) => {
|
242
|
-
utilities.getNthElement(fillInTheGapsOverImageDropdownPage.dropdownWrapperPreviewTab(), dropdownIndex)
|
243
|
-
.within(() => {
|
244
|
-
utilities.verifyElementVisibilityState(fillInTheGapsOverImageDropdownPage.tickIconWrapper(), 'notExist');
|
245
|
-
});
|
246
|
-
},
|
247
|
-
|
248
112
|
verifyCorrectAnswerSectionNotExists: () => {
|
249
113
|
utilities.verifyElementVisibilityState(fillInTheGapsOverImageDropdownPage.correctAnswerSectionWrapper(), 'notExist');
|
250
114
|
},
|
251
115
|
|
252
|
-
verifyCorrectIncorrectIconsNotExist: () => {
|
253
|
-
fillInTheGapsOverImageDropdownPage.dropdownWrapperPreviewTab()
|
254
|
-
.each(($element) => {
|
255
|
-
cy.wrap($element)
|
256
|
-
.within(() => {
|
257
|
-
utilities.verifyElementVisibilityState(fillInTheGapsOverImageDropdownPage.tickIconWrapper(), 'notExist');
|
258
|
-
});
|
259
|
-
});
|
260
|
-
},
|
261
|
-
|
262
116
|
/**
|
263
|
-
* Verify
|
264
|
-
* @param {
|
265
|
-
* @param {number}
|
266
|
-
* @param {string} dropdownTextArray[].dropdownText - The text to be verified in the respective dropdown.
|
117
|
+
* @description Verify dropdown pointer style in preview tab
|
118
|
+
* @param {string} style dropdown pointer style
|
119
|
+
* @param {number} dropzoneIndex index of dropdown
|
267
120
|
*/
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
121
|
+
verifyDropdownPointerStyleInPreviewTab: (style, dropzoneIndex) => {
|
122
|
+
const getPosition = (option) => {
|
123
|
+
switch (option) {
|
124
|
+
case 'bottom':
|
125
|
+
return { top: '-31.5px', left: '-37.5px' };
|
126
|
+
case 'bottom right':
|
127
|
+
return { top: '-25px', left: '-40px' };
|
128
|
+
case 'right':
|
129
|
+
return { top: '-21px', left: '-36.5px' };
|
130
|
+
case 'top right':
|
131
|
+
return { top: '-19px', left: '-31px' };
|
132
|
+
case 'top':
|
133
|
+
return { top: '-22.5px', left: '-25.5px' };
|
134
|
+
case 'top left':
|
135
|
+
return { top: '-27px', left: '-24px' };
|
136
|
+
case 'left':
|
137
|
+
return { bottom: '-20px', left: '-27px' };
|
138
|
+
case 'bottom left':
|
139
|
+
return { bottom: '-18px', left: '-32px' };
|
140
|
+
}
|
141
|
+
}
|
142
|
+
const expectedPosition = getPosition(style);
|
143
|
+
if (style == 'left' || style == 'bottom left') {
|
144
|
+
fillInTheGapsOverImageDropdownPage.dropdownPreviewTab()
|
145
|
+
.eq(dropzoneIndex)
|
146
|
+
.should('have.css', 'bottom', expectedPosition.bottom)
|
147
|
+
.and('have.css', 'left', expectedPosition.left);
|
148
|
+
}
|
149
|
+
else if (style == 'none') {
|
150
|
+
fillInTheGapsOverImageDropdownPage.dropdownPreviewTab()
|
151
|
+
.eq(dropzoneIndex)
|
152
|
+
.should('not.have.css', 'bottom')
|
153
|
+
.and('not.have.css', 'left');
|
154
|
+
}
|
155
|
+
else {
|
156
|
+
fillInTheGapsOverImageDropdownPage.dropdownPreviewTab()
|
157
|
+
.eq(dropzoneIndex)
|
158
|
+
.should('have.css', 'top', expectedPosition.top)
|
159
|
+
.and('have.css', 'left', expectedPosition.left);
|
160
|
+
}
|
272
161
|
},
|
273
162
|
|
274
163
|
/**
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
verifyPointsPerResponseLabel: () => {
|
283
|
-
utilities.verifyInnerText(autoScoredScoringSectionMultiResponseType.pointsPerResponseLabel(), 'Points per response: -');
|
284
|
-
utilities.verifyElementVisibilityState(autoScoredScoringSectionMultiResponseType.pointsPerResponseLabel(), 'visible');
|
164
|
+
* @param {*} width width of canvas
|
165
|
+
* @description this function verifies width of canvas
|
166
|
+
*/
|
167
|
+
verifyCanvasWidthInPreviewTab: (width) => {
|
168
|
+
fillInTheGapsOverImageDropdownPage.canvasInPreviewTab()
|
169
|
+
.should('have.attr', 'width', width);
|
285
170
|
},
|
286
171
|
|
287
172
|
/**
|
288
|
-
* @
|
289
|
-
* @
|
173
|
+
* @param {*} height height of canvas
|
174
|
+
* @description this function verifies height of canvas
|
290
175
|
*/
|
291
|
-
|
292
|
-
|
293
|
-
|
176
|
+
verifyCanvasHeightInPreviewTab: (height) => {
|
177
|
+
fillInTheGapsOverImageDropdownPage.canvasImageInPreviewTab()
|
178
|
+
.should('have.css', 'height', `${height}px`);
|
179
|
+
}
|
294
180
|
}
|
295
181
|
|
296
182
|
const tests = {
|
@@ -298,64 +184,14 @@ const tests = {
|
|
298
184
|
...autoScoredSpecifyCorrectAnswerSection.tests,
|
299
185
|
...scoringSectionBaseEditTab.tests,
|
300
186
|
...autoScoredScoringSectionMultiResponseType.tests,
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
|
308
|
-
|
309
|
-
fillInTheGapsOverImageDropdownPage.steps.verifyDropdownIsCollapsedInSpecifyCorrectAnswerSection(0);
|
310
|
-
utilities.verifyInnerText(utilities.getNthElement(fillInTheGapsOverImageDropdownPage.dropdownLabelSpecifyCorrectAnswerSection(), 0), 'Dropdown 1');
|
311
|
-
});
|
312
|
-
|
313
|
-
it('When user expands and collapses the dropdown without selecting any option, \'Error: Please set a correct answer.\' error message should be displayed', () => {
|
314
|
-
fillInTheGapsOverImageDropdownPage.steps.expandAndCollapseDropdownInSpecifyCorrectAnswerSection(0);
|
315
|
-
utilities.verifyElementVisibilityState(commonComponents.errorMessage(), 'visible');
|
316
|
-
utilities.verifyInnerText(commonComponents.errorMessage(), 'Error: Please set a correct answer.');
|
317
|
-
});
|
318
|
-
|
319
|
-
it('When the user selects any option from the dropdown, then error message should disappear and that option should be displayed on the dropdown', () => {
|
320
|
-
fillInTheGapsOverImageDropdownPage.steps.selectResponseFromDropdownSpecifyCorrectAnswerSection(0, optionsForDropdown[0]);
|
321
|
-
commonComponents.steps.verifyErrorMessageIsNotDisplayed();
|
322
|
-
});
|
323
|
-
|
324
|
-
autoScoredSpecifyCorrectAnswerSection.tests.verifyAutoScoredPointsErrorMessageWhenPointsFieldIsEmpty(accordionName);
|
325
|
-
|
326
|
-
it(`CSS of ${accordionName} accordion contents`, { tags: 'css' }, () => {
|
327
|
-
utilities.verifyCSS(fillInTheGapsOverImageDropdownPage.dropdownLabelSpecifyCorrectAnswerSection(), {
|
328
|
-
'color': css.color.labels,
|
329
|
-
'font-size': css.fontSize.default,
|
330
|
-
'font-weight': css.fontWeight.regular
|
331
|
-
});
|
332
|
-
utilities.verifyCSS(fillInTheGapsOverImageDropdownPage.dropdownSpecifyCorrectAnswerSection(), {
|
333
|
-
'background-color': css.color.figActiveComponentBg,
|
334
|
-
'border': `1px solid ${css.color.activeComponentBorder}`
|
335
|
-
});
|
336
|
-
//CSS of selected dropdown option which appears on dropdown
|
337
|
-
utilities.verifyCSS(fillInTheGapsOverImageDropdownPage.dropdownSpecifyCorrectAnswerSection(), {
|
338
|
-
'color': css.color.liText,
|
339
|
-
'font-size': css.fontSize.default,
|
340
|
-
'font-weight': css.fontWeight.regular
|
341
|
-
});
|
342
|
-
});
|
343
|
-
|
344
|
-
it(`Accessibility of ${accordionName} accordion contents`, { tags: 'a11y' }, () => {
|
345
|
-
cy.checkAccessibility(utilities.getNthElement(fillInTheGapsOverImageDropdownPage.dropdownSpecifyCorrectAnswerSection(), 0).parents('[aria-label="Specify correct answer section"]'));
|
346
|
-
});
|
347
|
-
},
|
348
|
-
|
349
|
-
verifyContentsOfSpecifyCorrectAnswerSection: () => {
|
350
|
-
it('When user selects a scoring type then in the \'Correct\' accordion, all the contents should be displayed', () => {
|
351
|
-
fillInTheGapsOverImageDropdownPage.dropdownSpecifyCorrectAnswerSection()
|
352
|
-
.each(($element, index) => {
|
353
|
-
utilities.verifyElementVisibilityState(cy.wrap($element), 'visible');
|
354
|
-
utilities.verifyInnerText(utilities.getNthElement(fillInTheGapsOverImageDropdownPage.dropdownLabelSpecifyCorrectAnswerSection(), index), `Dropdown ${index + 1}`);
|
355
|
-
utilities.verifyElementVisibilityState(utilities.getNthElement(fillInTheGapsOverImageDropdownPage.dropdownLabelSpecifyCorrectAnswerSection(), index), 'visible');
|
356
|
-
})
|
357
|
-
});
|
358
|
-
},
|
187
|
+
...optionsWrapperComponent.tests,
|
188
|
+
...randomizeOptionsComponent.tests,
|
189
|
+
...autoScoredStudentViewSettings.tests,
|
190
|
+
...questionInstructionsComponent.tests,
|
191
|
+
...backgroundImageUploadComponent.tests,
|
192
|
+
...imageCanvasComponent.tests,
|
193
|
+
...studentViewSettingsLabelComponent.tests,
|
194
|
+
...createQuestionBasePage.tests,
|
359
195
|
}
|
360
196
|
|
361
197
|
export const fillInTheGapsOverImageDropdownPage = {
|