itemengine-cypress-automation 1.0.105 → 1.0.106
Sign up to get free protection for your applications and to get access to all the features.
- package/cypress/e2e/ILC/AudioResponseNew/gradingViewAndCorrectAnswerViewContents.smoke.js +129 -0
- package/cypress/e2e/ILC/AudioResponseNew/minimalRecorderStyle.js +482 -0
- package/cypress/e2e/ILC/AudioResponseNew/previewContentsForAllViews.smoke.js +123 -0
- package/cypress/e2e/ILC/AudioResponseNew/standardRecorderStyle.js +554 -0
- package/cypress/e2e/ILC/DrawingResponse/drawingResponseCustomizeAdditionalOptions.js +1 -41
- package/cypress/e2e/ILC/EditTabSettingPage/ItemPreviewSettingsTabContent.js +5 -3
- package/cypress/e2e/ILC/EssayResponse/editCategoryFlyout.js +284 -0
- package/cypress/e2e/ILC/EssayResponse/equationEditor.smoke.js +412 -0
- package/cypress/e2e/ILC/EssayResponse/equationEditorCategories1.js +203 -0
- package/cypress/e2e/ILC/EssayResponse/equationEditorCategories2.js +340 -0
- package/cypress/e2e/ILC/EssayResponse/essayResponseAdditionalSettings.js +432 -0
- package/cypress/e2e/ILC/EssayResponse/essayResponseAdditionalSettingsBasic.js +134 -0
- package/cypress/e2e/ILC/EssayResponse/essayResponseCustomizeFormattingOptions1.smoke.js +336 -0
- package/cypress/e2e/ILC/EssayResponse/essayResponseCustomizeFormattingOptions2.js +332 -0
- package/cypress/e2e/ILC/EssayResponse/essayResponseCustomizeFormattingOptions3.js +522 -0
- package/cypress/e2e/ILC/EssayResponse/essayResponseSpecialCharacters.js +253 -0
- package/cypress/e2e/ILC/EssayResponse/previewHyperlink.js +266 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/backgroundImageAndCanvasProperties.js +57 -640
- package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/previewContentsForAllViews.smoke.js +1 -2
- package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/Scoring/allOrNothingAlternativePointsGreaterThanCorrectPoints.js +209 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/Scoring/allOrNothingCorrectPointsEqualToAlternativePoints.js +209 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/Scoring/allOrNothingCorrectPointsGreaterThanAlternativePoints.js +303 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/Scoring/allOrNothingPenaltyScoring.js +68 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/Scoring/partialEqualWeightsBasic.js +149 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/Scoring/partialEqualWeightsWithAlternativePointsGreaterThanCorrectPoints.js +218 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/Scoring/partialEqualWeightsWithCorrectPointsEqualToAlternativePoints.js +191 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/Scoring/partialEqualWeightsWithCorrectPointsGreaterThanAlternativePoints.js +219 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/allOrNothingForAllView.smoke.js +240 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/checkAnswerFunctionalityForAllViews.smoke.js +124 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/previewContentsForAllViews.smoke.js +107 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/Scoring/manuallyAndNonScored.js +1 -1
- package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/Scoring/partialEqualWeightsBasic.js +0 -2
- package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/backgroundImageAndCanvasProperties.js +408 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/editTabScoringSection.js +2 -2
- package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/previewContentsForAllViews.smoke.js +1 -1
- package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/responseAnswersAndAcceptedStudentInput.js +2 -2
- package/cypress/e2e/ILC/MultipleSelection/headerSection.js +1 -0
- package/cypress/e2e/ILC/MultipleSelection/studentViewSettings.js +0 -6
- package/cypress/e2e/ILC/Passage/multipageContentEditTab.js +242 -0
- package/cypress/e2e/ILC/Passage/passageAdditionalSettings.js +99 -0
- package/cypress/e2e/ILC/Passage/passageEditTab.js +241 -0
- package/cypress/e2e/ILC/Passage/passageHeaderSection.js +73 -0
- package/cypress/e2e/ILC/Passage/passagePreviewTab.js +246 -0
- package/cypress/e2e/ILC/ReadingRuler/readingRulerEditTabBasicsSection.js +138 -33
- package/cypress/e2e/ILC/ReadingRuler/readingRulerHeaderSection.js +30 -6
- package/cypress/e2e/ILC/ReadingRuler/readingRulerPreviewTab.js +167 -101
- package/cypress/e2e/ILC/ReadingRuler/readingrulerPreviewContents.smoke.js +1 -1
- package/cypress/e2e/ILC/SingleSelection/headerSection.js +20 -5
- package/cypress/e2e/ILC/SingleSelection/manuallyAndNonScoredScoring.js +1 -0
- package/cypress/e2e/ILC/TextEntryMath/editTabBasicSection.js +12 -7
- package/cypress/e2e/ILC/TextEntryMath/evaluationMethodEquivalentStructures.js +1336 -0
- package/cypress/e2e/ILC/TextEntryMath/evaluationMethodMatchExact.js +419 -0
- package/cypress/e2e/ILC/TextEntryMath/evaluationMethodMatchValue.js +443 -0
- package/cypress/e2e/ILC/TextEntryMath/evaluationMethodSymbolsAreEquivalent.js +411 -0
- package/cypress/e2e/ILC/TextEntryMath/evaluationMethodValueIsEquivalent.js +411 -0
- package/cypress/e2e/ILC/TextEntryMath/previewContentsForAllViews.smoke.js +45 -0
- package/cypress/e2e/ILC/TextEntryMath/responseEvaluationMethodsAndCustomSettings.js +3 -3
- package/cypress/fixtures/specialAndMathCharacters.js +2 -0
- package/cypress/fixtures/theme/ilc.json +4 -2
- package/cypress/pages/audioResponsePage.js +326 -165
- package/cypress/pages/components/additionalSettingsPanel.js +1 -1
- package/cypress/pages/components/autoScoredSpecifyCorrectAnswerSection.js +1 -1
- package/cypress/pages/components/backgroundImageUploadComponent.js +162 -2
- package/cypress/pages/components/colorPopupComponent.js +115 -26
- package/cypress/pages/components/customizeMathCharacterComponent.js +133 -0
- package/cypress/pages/components/customizeSpecialCharacterComponent.js +74 -4
- package/cypress/pages/components/editCategoryFlyout.js +164 -2
- package/cypress/pages/components/equationEditorFlyout.js +36 -1
- package/cypress/pages/components/essayResponseCommonComponents.js +0 -2
- package/cypress/pages/components/figOverImageCanvasComponent.js +587 -134
- package/cypress/pages/components/index.js +2 -1
- package/cypress/pages/components/playbackControlsBaseComponent.js +137 -2
- package/cypress/pages/correctAnswerViewPage.js +12 -1
- package/cypress/pages/drawingResponsePage.js +26 -151
- package/cypress/pages/essayResponseMathPage.js +28 -16
- package/cypress/pages/essayResponsePage.js +187 -7
- package/cypress/pages/fillInTheGapsOverImageDragAndDropPage.js +78 -14
- package/cypress/pages/fillInTheGapsOverImageDropdownPage.js +178 -221
- package/cypress/pages/fillInTheGapsOverImageTextPage.js +79 -0
- package/cypress/pages/multipleSelectionPage.js +1 -1
- package/cypress/pages/readingRulerPage.js +219 -104
- package/cypress/pages/singleSelectionPage.js +1 -0
- package/cypress/pages/textEntryMathPage.js +17 -6
- package/cypress/pages/videoResponsePage.js +0 -8
- package/package.json +1 -1
- package/scripts/sorry-cypress.mjs +1 -1
@@ -1,299 +1,256 @@
|
|
1
1
|
import utilities from "../support/helpers/utilities";
|
2
|
-
import {
|
2
|
+
import { figOverImageCanvasComponent, autoScoredScoringPreviewTab, optionsWrapperComponent, commonComponents, createQuestionBasePage, backgroundImageUploadComponent, scoringSectionBaseEditTab, questionInstructionsComponent, correctIncorrectAnswerLabelComponent, autoScoredStudentViewSettings, autoScoredSpecifyCorrectAnswerSection, autoScoredScoringSectionMultiResponseType } from "./components";
|
3
|
+
const css = Cypress.env('css');
|
3
4
|
|
4
5
|
const selectors = {
|
5
|
-
...figOverImageCommonComponent,
|
6
|
-
...fillInTheGapsDropdownCommonComponent,
|
7
6
|
...questionInstructionsComponent,
|
8
|
-
...
|
9
|
-
...
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
7
|
+
...figOverImageCanvasComponent,
|
8
|
+
...autoScoredScoringPreviewTab,
|
9
|
+
...correctIncorrectAnswerLabelComponent,
|
10
|
+
//Dropdown options section
|
11
|
+
dropdownOptionsTab: () => cy.get('.ngie-tablist-tab-button[data-ngie-testid*="dropdown"]'),
|
12
|
+
dropdownOptionsInputField: () => cy.get('.input-editable input[type*="text"]'),
|
13
|
+
|
14
|
+
//Specify correct answer dropdown
|
15
|
+
dropdownSpecifyCorrectAnswerSection: () => cy.get('.response-dropdown [role="combobox"]'),
|
16
|
+
|
17
|
+
//Dropdown list
|
18
|
+
dropdownListOptions: (ariaLabel = null) => {
|
19
|
+
if (ariaLabel) {
|
20
|
+
return cy.get(`[role="listbox"] .dropdown-menu-item[aria-label*="${ariaLabel}"]`)
|
21
|
+
} else {
|
22
|
+
return cy.get('[role="listbox"] .dropdown-menu-item')
|
23
|
+
}
|
24
|
+
},
|
25
|
+
|
26
|
+
//Preview tab
|
27
|
+
dropdownPreviewTab: () => cy.get('[class*="question-preview-wrapper"] [aria-haspopup="listbox"]'),
|
28
|
+
dropdownWrapperPreviewTab: () => cy.get('[class*="question-preview-wrapper"] [class*="Canvasstyle__DropzoneWrapper"]'),
|
29
|
+
dropdownNumerationPreviewTab: () => cy.get('.answer-numeration-number-box'),
|
30
|
+
correctAnswerSectionWrapper: () => cy.get('.dnd-correct-answer-wrapper'),
|
31
|
+
correctAnswersLabel: () => cy.get('.correct-answers-label'),
|
32
|
+
correctAnswerResponseNumeration: () => cy.get('.answer-numeration-number-box'),
|
33
|
+
correctAnswerResponseWrapper: () => cy.get('[class*="LabelImageWithDropdownPreviewstyles__AnswerCell"]'),
|
34
|
+
correctAnswerResponse: () => cy.get('[class*="LabelImageWithDropdownPreviewstyles__AnswerWrapper"]'),
|
35
|
+
tickIconWrapper: () => cy.get('.tick-icon-wrapper [data-name*="Rectangle"]'),
|
18
36
|
}
|
19
37
|
|
20
38
|
const steps = {
|
39
|
+
...figOverImageCanvasComponent.steps,
|
40
|
+
...autoScoredScoringPreviewTab.steps,
|
41
|
+
...correctIncorrectAnswerLabelComponent.steps,
|
21
42
|
...createQuestionBasePage.steps,
|
22
|
-
...
|
23
|
-
...
|
24
|
-
...commonComponents.steps,
|
25
|
-
...uploadImageSectionComponent.steps,
|
26
|
-
...autoScoredScoringSectionMultipleResponsesType.steps,
|
27
|
-
...optionsWrapperComponent.steps,
|
28
|
-
...ckEditorToolbar.steps,
|
29
|
-
...equationEditorFlyout.steps,
|
30
|
-
...previewScoringAndShowCorrectAnswerComponent.steps,
|
31
|
-
...autoScoredSetCorrectAnswerSection.steps,
|
32
|
-
...additionalSettingsPanel.steps,
|
33
|
-
...autoScoredAdditionalSettings.steps,
|
34
|
-
...autoScoredPreviewBase.steps,
|
35
|
-
...autoScoredScoringSection.steps,
|
43
|
+
...backgroundImageUploadComponent.steps,
|
44
|
+
...scoringSectionBaseEditTab.steps,
|
36
45
|
...questionInstructionsComponent.steps,
|
37
|
-
...
|
46
|
+
...autoScoredStudentViewSettings.steps,
|
47
|
+
...autoScoredSpecifyCorrectAnswerSection.steps,
|
48
|
+
...autoScoredScoringSectionMultiResponseType.steps,
|
38
49
|
/**
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
fillInTheGapsOverImageDropdownPage.
|
45
|
-
.
|
46
|
-
|
47
|
-
|
48
|
-
.
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
.split(',');
|
53
|
-
let horizontalCoordinate = position[0].trim();
|
54
|
-
let verticalCoordinate = position[1].trim();
|
55
|
-
expect(horizontalCoordinate).to.be.eq(responseContainerPositionCoordinates[0]);
|
56
|
-
expect(verticalCoordinate).to.be.eq(responseContainerPositionCoordinates[1]);
|
50
|
+
* @param {number} dropdownOptionsTabIndex Index of the dropdown options tab
|
51
|
+
* @param {string[]} responseTextArray Array of text to be given as input in options input field
|
52
|
+
* @description Add input to dropdown options input fields
|
53
|
+
*/
|
54
|
+
addInputToDropdownOptionFields: (dropdownOptionsTabIndex, responseTextArray) => {
|
55
|
+
utilities.getNthElement(fillInTheGapsOverImageDropdownPage.dropdownOptionsTab(), dropdownOptionsTabIndex)
|
56
|
+
.click();
|
57
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyDropdownOptionsTabIsSelected(dropdownOptionsTabIndex);
|
58
|
+
optionsWrapperComponent.optionsSectionWrapper()
|
59
|
+
.within(() => {
|
60
|
+
responseTextArray.forEach((responseFieldText, optionIndex) => {
|
61
|
+
fillInTheGapsOverImageDropdownPage.steps.addInputToDropdownOptionInputField(optionIndex, responseFieldText);
|
62
|
+
});
|
57
63
|
});
|
58
64
|
},
|
59
65
|
|
60
66
|
/**
|
61
|
-
* @param {number}
|
62
|
-
* @
|
67
|
+
* @param {number} optionIndex index of the option input field
|
68
|
+
* @param {string} responseText text to be given as input in option input field
|
69
|
+
* @description Add input to options input fields
|
63
70
|
*/
|
64
|
-
|
65
|
-
utilities.
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
fillInTheGapsOverImageDropdownPage.responseDropdownPreviewTab()
|
70
|
-
.should('have.class', 'Mui-disabled');
|
71
|
-
fillInTheGapsOverImageDropdownPage.responseDropdownPreviewTab()
|
72
|
-
.click();
|
73
|
-
fillInTheGapsOverImageDropdownPage.dropdownList()
|
74
|
-
.should('not.exist');
|
71
|
+
addInputToDropdownOptionInputField: (optionIndex, responseFieldText) => {
|
72
|
+
utilities.getNthElement(fillInTheGapsOverImageDropdownPage.dropdownOptionsInputField(), optionIndex)
|
73
|
+
.clear()
|
74
|
+
.type(responseFieldText, { delay: 0 })
|
75
|
+
.should('have.value', responseFieldText);
|
75
76
|
},
|
76
77
|
|
77
78
|
/**
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
fillInTheGapsOverImageDropdownPage.
|
83
|
-
.
|
84
|
-
.click();
|
85
|
-
fillInTheGapsOverImageDropdownPage.responseDropdownPreviewTab()
|
86
|
-
.eq(responseDropdownIndex)
|
87
|
-
.should('have.attr', 'aria-expanded', 'true');
|
79
|
+
* @param {number} dropdownOptionsTabIndex Index of the dropdown options tab
|
80
|
+
* @description Verify dropdown options tab is selected
|
81
|
+
*/
|
82
|
+
verifyDropdownOptionsTabIsSelected: (dropdownOptionsTabIndex) => {
|
83
|
+
utilities.getNthElement(fillInTheGapsOverImageDropdownPage.dropdownOptionsTab(), dropdownOptionsTabIndex)
|
84
|
+
.should('have.class', 'Mui-selected');
|
88
85
|
},
|
89
86
|
|
90
87
|
/**
|
91
88
|
* @param {number} dropdownIndex Index of the dropdown
|
92
89
|
* @param {string} dropdownOption Option to be selected in the dropdown
|
93
|
-
* @description Select option from dropdown in
|
90
|
+
* @description Select option from dropdown in set correct answer section
|
94
91
|
*/
|
95
|
-
|
96
|
-
fillInTheGapsOverImageDropdownPage.steps.
|
97
|
-
|
98
|
-
|
92
|
+
selectResponseFromDropdownSpecifyCorrectAnswerSection: (dropdownIndex, dropdownOption) => {
|
93
|
+
fillInTheGapsOverImageDropdownPage.steps.expandResponseDropdownInSpecifyCorrectAnswerSection(dropdownIndex)
|
94
|
+
fillInTheGapsOverImageDropdownPage.steps.selectOptionFromDropdownList(dropdownOption);
|
95
|
+
utilities.verifyInnerText(utilities.getNthElement(fillInTheGapsOverImageDropdownPage.dropdownSpecifyCorrectAnswerSection(), dropdownIndex), dropdownOption);
|
99
96
|
},
|
100
97
|
|
101
|
-
|
102
|
-
|
98
|
+
/**
|
99
|
+
* @param {string} dropdownOption Option to be selected from dropdown
|
100
|
+
* @description Select option from dropdown
|
101
|
+
*/
|
102
|
+
selectOptionFromDropdownList: (dropdownOption) => {
|
103
|
+
fillInTheGapsOverImageDropdownPage.dropdownListOptions(dropdownOption)
|
104
|
+
.click();
|
105
|
+
utilities.verifyElementVisibilityState(commonComponents.dropdownList(), 'notExist');
|
103
106
|
},
|
104
107
|
|
105
108
|
/**
|
106
|
-
* @param {
|
107
|
-
* @
|
108
|
-
* @description verify the correct answer responses in the correct answer container
|
109
|
+
* @param {number} responseDropdownIndex Index of response dropdown in set correct answer section
|
110
|
+
* @description Expand response dropdown in set correct answer section
|
109
111
|
*/
|
110
|
-
|
111
|
-
fillInTheGapsOverImageDropdownPage.
|
112
|
-
.
|
113
|
-
|
114
|
-
|
115
|
-
utilities.verifyInnerText(fillInTheGapsOverImageDropdownPage.previewTabCorrectAnswerResponseWrapper().eq(count), responseFieldText);
|
116
|
-
});
|
117
|
-
optionNumerationArray.forEach((optionNumeration, count) => {
|
118
|
-
utilities.verifyInnerText(fillInTheGapsOverImageDropdownPage.correctAnswerContainerResponseNumeration().eq(count), optionNumeration);
|
119
|
-
});
|
120
|
-
});
|
121
|
-
fillInTheGapsOverImageDropdownPage.previewTabCorrectAnswerResponseWrapper()
|
122
|
-
.should('have.length', optionNumerationArray.length);
|
112
|
+
expandResponseDropdownInSpecifyCorrectAnswerSection: (responseDropdownIndex) => {
|
113
|
+
utilities.getNthElement(fillInTheGapsOverImageDropdownPage.dropdownSpecifyCorrectAnswerSection(), responseDropdownIndex)
|
114
|
+
.click({ position: "right" });
|
115
|
+
utilities.getNthElement(fillInTheGapsOverImageDropdownPage.dropdownSpecifyCorrectAnswerSection(), responseDropdownIndex)
|
116
|
+
.should('have.attr', 'aria-expanded', 'true');
|
123
117
|
},
|
124
118
|
|
125
|
-
|
126
|
-
|
119
|
+
/**
|
120
|
+
* @param {Object[]} CorrectAnswerArray - An array of objects containing the dropdownIndex and dropdownOption to be selected.
|
121
|
+
* @param {number} CorrectAnswerArray[].dropdownIndex - The index of dropdown in preview tab
|
122
|
+
* @param {string} CorrectAnswerArray[].dropdownOption - The dropdown option to be selected from dropdown list
|
123
|
+
* @description Select option from dropdown in preview tab
|
124
|
+
*/
|
125
|
+
selectResponseFromDropdownInPreviewTab: (CorrectAnswerArray) => {
|
126
|
+
CorrectAnswerArray.forEach(({ dropdownIndex, dropdownOption }) => {
|
127
|
+
fillInTheGapsOverImageDropdownPage.steps.expandDropdownInPreviewTab(dropdownIndex);
|
128
|
+
fillInTheGapsOverImageDropdownPage.steps.selectOptionFromDropdownList(dropdownOption);
|
129
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyTextDisplayedInDropdownPreviewTab(dropdownIndex, dropdownOption);
|
130
|
+
});
|
127
131
|
},
|
128
132
|
|
129
133
|
/**
|
130
|
-
* @param {number}
|
131
|
-
* @description
|
134
|
+
* @param {number} dropdownIndex Index of dropdown in preview tab
|
135
|
+
* @description Expand dropdown in preview tab
|
132
136
|
*/
|
133
|
-
|
134
|
-
fillInTheGapsOverImageDropdownPage.
|
135
|
-
.
|
136
|
-
|
137
|
-
.should('have.
|
138
|
-
.and('be.visible');
|
137
|
+
expandDropdownInPreviewTab: (dropdownIndex) => {
|
138
|
+
utilities.getNthElement(fillInTheGapsOverImageDropdownPage.dropdownPreviewTab(), dropdownIndex)
|
139
|
+
.click();
|
140
|
+
utilities.getNthElement(fillInTheGapsOverImageDropdownPage.dropdownPreviewTab(), dropdownIndex)
|
141
|
+
.should('have.attr', 'aria-expanded', 'true');
|
139
142
|
},
|
140
143
|
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
fillInTheGapsOverImageDropdownPage.
|
147
|
-
.
|
148
|
-
|
149
|
-
|
150
|
-
|
144
|
+
verifyTextDisplayedInDropdownPreviewTab: (dropdownIndex, dropdownText) => {
|
145
|
+
utilities.verifyInnerText(utilities.getNthElement(fillInTheGapsOverImageDropdownPage.dropdownPreviewTab(), dropdownIndex), dropdownText);
|
146
|
+
},
|
147
|
+
|
148
|
+
verifyDropdownNumerationPreviewTab: () => {
|
149
|
+
fillInTheGapsOverImageDropdownPage.dropdownWrapperPreviewTab()
|
150
|
+
.each(($element, index) => {
|
151
|
+
cy.wrap($element)
|
152
|
+
.within(() => {
|
153
|
+
utilities.verifyTextContent(fillInTheGapsOverImageDropdownPage.dropdownNumerationPreviewTab(), `${index + 1}`);
|
154
|
+
});
|
155
|
+
});
|
151
156
|
},
|
152
157
|
|
153
158
|
/**
|
154
|
-
*
|
155
|
-
* @
|
159
|
+
* Verify correct answer responses in the correct answer section and count.
|
160
|
+
* @param {string[]} correctAnswerArray - An array containing the expected correct answer responses.
|
161
|
+
* @example verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(['Flower', 'Petals', 'Stem']);
|
156
162
|
*/
|
157
|
-
|
158
|
-
utilities.
|
163
|
+
verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount: (correctAnswerArray) => {
|
164
|
+
utilities.verifyElementCount(fillInTheGapsOverImageDropdownPage.correctAnswerResponseWrapper(), correctAnswerArray.length);
|
165
|
+
correctAnswerArray.forEach((correctAnswer, index) => {
|
166
|
+
fillInTheGapsOverImageDropdownPage.correctAnswerResponseWrapper()
|
167
|
+
.eq(index)
|
168
|
+
.within(() => {
|
169
|
+
utilities.verifyInnerText(fillInTheGapsOverImageDropdownPage.correctAnswerResponseNumeration(), `${index + 1}`);
|
170
|
+
fillInTheGapsOverImageDropdownPage.correctAnswerResponse()
|
171
|
+
.should('have.text', correctAnswer);
|
172
|
+
});
|
173
|
+
});
|
159
174
|
},
|
160
175
|
|
161
176
|
/**
|
162
|
-
*
|
163
|
-
* @param {
|
164
|
-
* @description Verify aria-label of response dropdown in preview tab
|
177
|
+
* Verify that the incorrect option icon is displayed for a specific dropdown.
|
178
|
+
* @param {number} dropdownIndex - The index of the dropdown.
|
165
179
|
*/
|
166
|
-
|
167
|
-
fillInTheGapsOverImageDropdownPage.
|
168
|
-
.
|
169
|
-
|
180
|
+
verifyIncorrectOptionIcon: (dropdownIndex) => {
|
181
|
+
utilities.getNthElement(fillInTheGapsOverImageDropdownPage.dropdownWrapperPreviewTab(), dropdownIndex)
|
182
|
+
.within(() => {
|
183
|
+
utilities.verifyCSS(fillInTheGapsOverImageDropdownPage.tickIconWrapper(), {
|
184
|
+
'fill': css.color.incorrectAnswer
|
185
|
+
});
|
186
|
+
});
|
170
187
|
},
|
171
188
|
|
172
189
|
/**
|
173
|
-
*
|
174
|
-
* @param {number}
|
175
|
-
* @description Verify the vertical position of the response container as per the row
|
190
|
+
* Verify that the correct option icon is is displayed for a specific dropdown.
|
191
|
+
* @param {number} dropdownIndex - The index of the dropdown.
|
176
192
|
*/
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
case 2:
|
184
|
-
verticalCoordinate = '59px';
|
185
|
-
break;
|
186
|
-
default:
|
187
|
-
throw new Error('Invalid row index');
|
188
|
-
}
|
189
|
-
figOverImageCommonComponent.responseContainer()
|
190
|
-
.eq(responseContainerIndex)
|
191
|
-
.invoke('attr', 'style')
|
192
|
-
.then(($styleAttribute) => {
|
193
|
-
let transformValue = $styleAttribute;
|
194
|
-
let coordinatesArray = transformValue.split('(')[1]
|
195
|
-
.split(')')[0]
|
196
|
-
.split(',');
|
197
|
-
let responseVerticalCoordinate = coordinatesArray[1].trim();
|
198
|
-
expect(responseVerticalCoordinate).to.be.eq(verticalCoordinate);
|
193
|
+
verifyCorrectOptionIcon: (dropdownIndex) => {
|
194
|
+
utilities.getNthElement(fillInTheGapsOverImageDropdownPage.dropdownWrapperPreviewTab(), dropdownIndex)
|
195
|
+
.within(() => {
|
196
|
+
utilities.verifyCSS(fillInTheGapsOverImageDropdownPage.tickIconWrapper(), {
|
197
|
+
'fill': css.color.correctAnswer
|
198
|
+
});
|
199
199
|
});
|
200
200
|
},
|
201
201
|
|
202
202
|
/**
|
203
|
-
*
|
204
|
-
* @
|
203
|
+
* Verify that both correct and incorrect option icons do not exist for a specific dropdown.
|
204
|
+
* @param {number} dropdownIndex - The index of the dropdown.
|
205
205
|
*/
|
206
|
-
|
207
|
-
fillInTheGapsOverImageDropdownPage.
|
208
|
-
.eq(responseDropdownIndex)
|
206
|
+
verifyCorrectIncorrectIconNotExist: (dropdownIndex) => {
|
207
|
+
utilities.getNthElement(fillInTheGapsOverImageDropdownPage.dropdownWrapperPreviewTab(), dropdownIndex)
|
209
208
|
.within(() => {
|
210
|
-
utilities.verifyElementVisibilityState(
|
209
|
+
utilities.verifyElementVisibilityState(fillInTheGapsOverImageDropdownPage.tickIconWrapper(), 'notExist');
|
211
210
|
});
|
212
211
|
},
|
213
212
|
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
213
|
+
verifyCorrectAnswerSectionNotExists: () => {
|
214
|
+
utilities.verifyElementVisibilityState(fillInTheGapsOverImageDropdownPage.correctAnswerSectionWrapper(), 'notExist');
|
215
|
+
},
|
216
|
+
|
217
|
+
verifyCorrectIncorrectIconsNotExist: () => {
|
218
|
+
fillInTheGapsOverImageDropdownPage.dropdownWrapperPreviewTab()
|
219
|
+
.each(($element) => {
|
220
|
+
cy.wrap($element)
|
221
|
+
.within(() => {
|
222
|
+
utilities.verifyElementVisibilityState(fillInTheGapsOverImageDropdownPage.tickIconWrapper(), 'notExist');
|
223
|
+
});
|
224
224
|
});
|
225
225
|
},
|
226
226
|
|
227
227
|
/**
|
228
|
-
*
|
229
|
-
* @param {
|
230
|
-
* @
|
228
|
+
* Verify text displayed in the dropdowns of the preview tab.
|
229
|
+
* @param {Object[]} dropdownTextArray - An array of objects containing the dropdownIndex and dropdownText.
|
230
|
+
* @param {number} dropdownTextArray[].dropdownIndex - The index of the dropdown.
|
231
|
+
* @param {string} dropdownTextArray[].dropdownText - The text to be verified in the respective dropdown.
|
231
232
|
*/
|
232
|
-
|
233
|
-
|
234
|
-
.
|
235
|
-
|
233
|
+
verifyTextInDropdownsInPreviewTab: (dropdownTextArray) => {
|
234
|
+
dropdownTextArray.forEach(({ dropdownIndex, dropdownText }) => {
|
235
|
+
fillInTheGapsOverImageDropdownPage.steps.verifyTextDisplayedInDropdownPreviewTab(dropdownIndex, dropdownText);
|
236
|
+
});
|
236
237
|
},
|
237
238
|
|
238
239
|
/**
|
239
|
-
*
|
240
|
-
* @param {number}
|
241
|
-
* @description Verify width of response dropdown in preview tab
|
240
|
+
* Verify that a specific dropdown is disabled in the preview tab.
|
241
|
+
* @param {number} dropdownIndex - The index of the disabled dropdown.
|
242
242
|
*/
|
243
|
-
|
244
|
-
fillInTheGapsOverImageDropdownPage.
|
245
|
-
.eq(responseDropdownIndex)
|
246
|
-
.should('have.attr', 'width', `${width}px`);
|
243
|
+
verifyDropdownIsDisabled: (dropdownIndex) => {
|
244
|
+
utilities.verifyElementDisabledClass(utilities.getNthElement(fillInTheGapsOverImageDropdownPage.dropdownPreviewTab(), dropdownIndex));
|
247
245
|
},
|
248
|
-
|
249
|
-
/**
|
250
|
-
* Verify the numeration of response fields in the Preview Tab.
|
251
|
-
* @param {string[]} optionNumerationArray - An array of expected numeration strings to verify.
|
252
|
-
*/
|
253
|
-
verifyResponseDropdownNumeration: (optionNumerationArray) => {
|
254
|
-
fillInTheGapsOverImageDropdownPage.responseDropdownContainerWrapperPreviewTab()
|
255
|
-
optionNumerationArray.forEach((optionNumeration, count) => {
|
256
|
-
fillInTheGapsOverImageDropdownPage.responseNumeration()
|
257
|
-
.eq(count)
|
258
|
-
.should('have.text', `${optionNumeration}`);
|
259
|
-
});
|
260
|
-
}
|
261
|
-
|
262
246
|
}
|
263
247
|
|
264
248
|
const tests = {
|
265
|
-
...
|
266
|
-
...autoScoredSetCorrectAnswerSection.tests,
|
267
|
-
...fillInTheGapsDropdownCommonComponent.tests,
|
268
|
-
...scoringSectionBase.tests,
|
269
|
-
...autoScoredScoringSectionMultipleResponsesType.tests,
|
270
|
-
...autoScoredScoringSection.tests,
|
271
|
-
...commonComponents.tests,
|
272
|
-
...previewScoringAndShowCorrectAnswerComponent.tests,
|
273
|
-
...answerNumerationComponent.tests,
|
274
|
-
...additionalSettingsPanel.tests,
|
275
|
-
...autoScoredAdditionalSettings.tests,
|
276
|
-
...questionInstructionsComponent.tests,
|
277
|
-
...createQuestionBasePage.tests,
|
278
|
-
/**
|
279
|
-
* @param {number} minimumScoreIfAttemptedPoints - The minimum score awarded if attempted.
|
280
|
-
* @param {number} allocatedPoints - The expected allocated points for the question.
|
281
|
-
* @description Verify minimum score awarded if attempted functionality when an incorrect answer is attempted.
|
282
|
-
*/
|
283
|
-
verifyMinimumScoreAwardedIfAttemptedFunctionalityForIncorrectAnswer: (minimumScoreIfAttemptedPoints, allocatedPoints) => {
|
284
|
-
it('When user has provided minimum score awarded (if attempted) points, then in preview tab on selecting incorrect answer, minimum score should be provided for the question', () => {
|
285
|
-
cy.log('Switch to edit tab and set minimum score if attempted points')
|
286
|
-
fillInTheGapsOverImageDropdownPage.steps.switchToEditTab();
|
287
|
-
fillInTheGapsOverImageDropdownPage.steps.allotMinimumScoreAwardedIfAttempted(minimumScoreIfAttemptedPoints);
|
288
|
-
fillInTheGapsOverImageDropdownPage.steps.switchToPreviewTab();
|
289
|
-
fillInTheGapsOverImageDropdownPage.steps.selectResponseFromDropdownInPreviewTab(0, 'Branch');
|
290
|
-
fillInTheGapsOverImageDropdownPage.steps.verifyPreviewTabScoreText(minimumScoreIfAttemptedPoints, allocatedPoints);
|
291
|
-
});
|
292
|
-
}
|
249
|
+
...autoScoredScoringPreviewTab.tests,
|
293
250
|
}
|
294
251
|
|
295
252
|
export const fillInTheGapsOverImageDropdownPage = {
|
296
253
|
...selectors,
|
297
254
|
steps,
|
298
|
-
tests
|
255
|
+
tests
|
299
256
|
}
|
@@ -13,6 +13,7 @@ const selectors = {
|
|
13
13
|
...autoScoredSpecifyCorrectAnswerSection,
|
14
14
|
...autoScoredStudentViewSettings,
|
15
15
|
...autoScoredScoringPreviewTab,
|
16
|
+
...backgroundImageUploadComponent,
|
16
17
|
|
17
18
|
//TODO: Update below selectors after https://redmine.zeuslearning.com/issues/557945 is resolved
|
18
19
|
//response accordion
|
@@ -32,6 +33,8 @@ const selectors = {
|
|
32
33
|
|
33
34
|
answerInputFieldSpecifyCorrectAnswerSection: () => cy.get('.label-image-text-inline-text-field input'),
|
34
35
|
answerInputFieldPreviewTab: () => cy.get('[class*="question-preview-wrapper"] .response-input-field input'),
|
36
|
+
responseContainerInPreviewTab: () => cy.get('[class*="AddTextResponseOnImagestyles__DraggableInput"]'),
|
37
|
+
canvasInPreviewTab: () => cy.get('[class*="PreviewTabstyles__ContentWrapper"] .image-container'),
|
35
38
|
correctAnswerSectionWrapper: () => cy.get('.cloze-with-text-correct-answer-wrapper'),
|
36
39
|
correctAnswersLabel: () => cy.get('.correct-answers-label'),
|
37
40
|
responseStatusWrapper: () => cy.get('.cloze-with-text-answer-status-response-preview-wrapper:visible'),
|
@@ -683,6 +686,79 @@ const steps = {
|
|
683
686
|
.click();
|
684
687
|
},
|
685
688
|
|
689
|
+
/**
|
690
|
+
*
|
691
|
+
* @param {string} style pointer style
|
692
|
+
* @param {number} responseContainerIndex text container index
|
693
|
+
*/
|
694
|
+
verifyTextContainerPointerStyleInPreviewTab: (style, responseContainerIndex) => {
|
695
|
+
const getPosition = (option) => {
|
696
|
+
switch (option) {
|
697
|
+
case 'bottom':
|
698
|
+
return { bottom: '56px', left: '-60px' };
|
699
|
+
case 'bottom right':
|
700
|
+
return { top: '-48px', right: '45px' };
|
701
|
+
case 'right':
|
702
|
+
return { top: '-19px', left: '53px' };
|
703
|
+
case 'top right':
|
704
|
+
return { top: '13px', right: '45px' };
|
705
|
+
case 'top':
|
706
|
+
return { top: '28px', left: '-60px' };
|
707
|
+
case 'top left':
|
708
|
+
return { top: '12px', left: '23px' };
|
709
|
+
case 'left':
|
710
|
+
return { top: '-19px', left: '28px' };
|
711
|
+
case 'bottom left':
|
712
|
+
return { top: '-44px', left: '18px' };
|
713
|
+
}
|
714
|
+
}
|
715
|
+
const expectedPosition = getPosition(style);
|
716
|
+
if (style == 'top right' || style == 'bottom right') {
|
717
|
+
fillInTheGapsOverImageTextPage.responseContainerInPreviewTab()
|
718
|
+
.eq( responseContainerIndex)
|
719
|
+
.should('have.css', 'top', expectedPosition.top)
|
720
|
+
.and('have.css', 'right', expectedPosition.right);
|
721
|
+
}
|
722
|
+
else if (style == 'none') {
|
723
|
+
fillInTheGapsOverImageTextPage.responseContainerInPreviewTab()
|
724
|
+
.should('not.exist')
|
725
|
+
}
|
726
|
+
else if(style == 'bottom'){
|
727
|
+
fillInTheGapsOverImageTextPage.responseContainerInPreviewTab()
|
728
|
+
.eq(responseContainerIndex)
|
729
|
+
.should('have.css', 'bottom', expectedPosition.bottom)
|
730
|
+
.and('have.css', 'left', expectedPosition.left);
|
731
|
+
}
|
732
|
+
else {
|
733
|
+
fillInTheGapsOverImageTextPage.responseContainerInPreviewTab()
|
734
|
+
.eq(responseContainerIndex)
|
735
|
+
.should('have.css', 'top', expectedPosition.top)
|
736
|
+
.and('have.css', 'left', expectedPosition.left);
|
737
|
+
}
|
738
|
+
},
|
739
|
+
|
740
|
+
verifyTextContainerNotExistInPreviewTab: () => {
|
741
|
+
utilities.verifyElementVisibilityState( fillInTheGapsOverImageTextPage.responseContainerInPreviewTab(), 'notExist');
|
742
|
+
},
|
743
|
+
|
744
|
+
/**
|
745
|
+
* @param {*} width width of canvas
|
746
|
+
* @description this function verifies width of canvas
|
747
|
+
*/
|
748
|
+
verifyCanvasWidthInPreviewTab: (width) => {
|
749
|
+
fillInTheGapsOverImageTextPage.canvasInPreviewTab()
|
750
|
+
.should('have.attr', 'width', width);
|
751
|
+
},
|
752
|
+
|
753
|
+
/**
|
754
|
+
* @param {*} height height of canvas
|
755
|
+
* @description this function verifies height of canvas
|
756
|
+
*/
|
757
|
+
verifyCanvasHeightInPreviewTab: (height) => {
|
758
|
+
fillInTheGapsOverImageTextPage.canvasInPreviewTab()
|
759
|
+
.should('have.css', 'height', `${height}px`);
|
760
|
+
},
|
761
|
+
|
686
762
|
verifyDefaultUncheckedStateOfConditionalCheckboxes: () => {
|
687
763
|
fillInTheGapsOverImageTextPage.caseSensitiveCheckbox()
|
688
764
|
.should('not.be.checked');
|
@@ -790,6 +866,9 @@ const tests = {
|
|
790
866
|
...createQuestionBasePage.tests,
|
791
867
|
...commonComponents.tests,
|
792
868
|
...autoScoredStudentViewSettings.tests,
|
869
|
+
...backgroundImageUploadComponent.tests,
|
870
|
+
...figOverImageCanvasComponent.tests,
|
871
|
+
...questionInstructionsComponent.tests,
|
793
872
|
|
794
873
|
/**
|
795
874
|
* Verifies the contents and functionality of the 'Specify correct answer' accordion for multiple selection questions.
|
@@ -51,7 +51,7 @@ const selectors = {
|
|
51
51
|
return cy.get('[aria-labelledby*="Maximum-number-of-answers-dropdown-label"] [role="option"]')
|
52
52
|
}
|
53
53
|
},
|
54
|
-
minMaxWarningMessage: () => cy.get('.
|
54
|
+
minMaxWarningMessage: () => cy.get('.disabled-wrapper-cls')
|
55
55
|
}
|
56
56
|
|
57
57
|
const steps = {
|