itemengine-cypress-automation 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
- package/.build_wna +4 -0
- package/README.md +3 -0
- package/currents.config.js +6 -0
- package/cypress/API/createItem/toggleItemMode.js +15 -0
- package/cypress/config-files/ildev.json +15 -0
- package/cypress/config-files/ilprod.json +15 -0
- package/cypress/config-files/ilqa.json +15 -0
- package/cypress/config-files/ilstage.json +15 -0
- package/cypress/e2e/ILC/sorry-cypress-test/spec1.js +18 -0
- package/cypress/e2e/ILC/sorry-cypress-test/spec2.js +18 -0
- package/cypress/e2e/ILC/sorry-cypress-test/spec3.js +18 -0
- package/cypress/fixtures/accessibilityConfig.json +6 -0
- package/cypress/fixtures/constants.js +18 -0
- package/cypress/fixtures/equationEditorCategoriesAndSymbols .js +2271 -0
- package/cypress/fixtures/specialAndMathCharacters.js +118 -0
- package/cypress/fixtures/theme/ilc.json +150 -0
- package/cypress/fixtures/theme/ngie.json +26 -0
- package/cypress/fixtures/uploads/20mbFile.png +0 -0
- package/cypress/fixtures/uploads/80mbFile.pdf +0 -0
- package/cypress/fixtures/uploads/highlightImage.jpg +0 -0
- package/cypress/fixtures/uploads/image.png +0 -0
- package/cypress/fixtures/uploads/sample.aac +0 -0
- package/cypress/fixtures/uploads/sample.accdb +0 -0
- package/cypress/fixtures/uploads/sample.csv +100 -0
- package/cypress/fixtures/uploads/sample.doc +0 -0
- package/cypress/fixtures/uploads/sample.gif +0 -0
- package/cypress/fixtures/uploads/sample.heic +0 -0
- package/cypress/fixtures/uploads/sample.heif +0 -0
- package/cypress/fixtures/uploads/sample.hevc +0 -0
- package/cypress/fixtures/uploads/sample.jpeg +0 -0
- package/cypress/fixtures/uploads/sample.jpg +0 -0
- package/cypress/fixtures/uploads/sample.mp3 +0 -0
- package/cypress/fixtures/uploads/sample.mp4 +0 -0
- package/cypress/fixtures/uploads/sample.pdf +0 -0
- package/cypress/fixtures/uploads/sample.ppt +0 -0
- package/cypress/fixtures/uploads/sample.pub +0 -0
- package/cypress/fixtures/uploads/sample.rtf +7902 -0
- package/cypress/fixtures/uploads/sample.svg +10 -0
- package/cypress/fixtures/uploads/sample.txt +1 -0
- package/cypress/fixtures/uploads/sample.wav +0 -0
- package/cypress/fixtures/uploads/sample.xlsx +0 -0
- package/cypress/fixtures/uploads/sample.xps +0 -0
- package/cypress/fixtures/uploads/sample.zip +0 -0
- package/cypress/fixtures/uploads/sample1.jpg +0 -0
- package/cypress/fixtures/uploads/sample1.mp3 +0 -0
- package/cypress/fixtures/uploads/sample1.zip +0 -0
- package/cypress/fixtures/uploads/sample10Sec.mp3 +0 -0
- package/cypress/fixtures/uploads/sample2.jpg +0 -0
- package/cypress/fixtures/uploads/sample2.mp3 +0 -0
- package/cypress/fixtures/uploads/sampleVirus.zip +0 -0
- package/cypress/pages/audioPlayerPage.js +628 -0
- package/cypress/pages/audioResponsePage.js +264 -0
- package/cypress/pages/components/additionalSettingsPanel.js +174 -0
- package/cypress/pages/components/answerNumerationComponent.js +109 -0
- package/cypress/pages/components/autoScoredAdditionalSettings.js +183 -0
- package/cypress/pages/components/autoScoredPreviewBase.js +94 -0
- package/cypress/pages/components/autoScoredScoringSection.js +195 -0
- package/cypress/pages/components/autoScoredScoringSectionMultipleResponsesType.js +268 -0
- package/cypress/pages/components/autoScoredSetCorrectAnswerSection.js +291 -0
- package/cypress/pages/components/ckEditorToolbar.js +64 -0
- package/cypress/pages/components/colorPopupComponent.js +293 -0
- package/cypress/pages/components/commonComponents.js +93 -0
- package/cypress/pages/components/componentsFlowChart/figFlowChart.png +0 -0
- package/cypress/pages/components/createCustomCategoryFlyout.js +138 -0
- package/cypress/pages/components/createQuestionBasePage.js +225 -0
- package/cypress/pages/components/customizeHighlightPropertiesComponent.js +318 -0
- package/cypress/pages/components/dragAndDropResponseOptions.js +738 -0
- package/cypress/pages/components/dragAndDropSetCorrectAnswerCheckboxComponents.js +124 -0
- package/cypress/pages/components/draggableOptionsContainer.js +857 -0
- package/cypress/pages/components/editCategoryFlyout.js +40 -0
- package/cypress/pages/components/equationEditorFlyout.js +158 -0
- package/cypress/pages/components/essayResponseCommonComponents.js +86 -0
- package/cypress/pages/components/figOverImageCommonComponent.js +924 -0
- package/cypress/pages/components/fillInTheGapsCommonComponents.js +687 -0
- package/cypress/pages/components/fillInTheGapsDropdownCommonComponent.js +442 -0
- package/cypress/pages/components/fillInTheGapsTextCommonComponent.js +884 -0
- package/cypress/pages/components/gridCommonComponents.js +951 -0
- package/cypress/pages/components/index.js +38 -0
- package/cypress/pages/components/listSortingAndOrderingBase.js +401 -0
- package/cypress/pages/components/maximumRecorderLengthComponent.js +116 -0
- package/cypress/pages/components/mcqAdditionalSettingsBase.js +390 -0
- package/cypress/pages/components/mcqOptionsComponent.js +263 -0
- package/cypress/pages/components/mcqPreviewComponents.js +78 -0
- package/cypress/pages/components/mcqQuestionCommonComponents.js +265 -0
- package/cypress/pages/components/mcqScoringComponent.js +120 -0
- package/cypress/pages/components/mcqSetCorrectAnswerSection.js +143 -0
- package/cypress/pages/components/optionsWrapperComponent.js +221 -0
- package/cypress/pages/components/playbackControlsBaseComponent.js +163 -0
- package/cypress/pages/components/previewScoringAndShowCorrectAnswerComponent.js +90 -0
- package/cypress/pages/components/questionInstructionsComponent.js +112 -0
- package/cypress/pages/components/scoringSectionBase.js +308 -0
- package/cypress/pages/components/setPointsPopupBase.js +79 -0
- package/cypress/pages/components/specialAndCustomSpecialCharactersComponent.js +79 -0
- package/cypress/pages/components/specialCharactersFlyoutComponent.js +58 -0
- package/cypress/pages/components/studentResponseAreaAndLayoutComponent.js +28 -0
- package/cypress/pages/components/uploadImageSectionComponent.js +594 -0
- package/cypress/pages/createItemPage.js +28 -0
- package/cypress/pages/dialogBoxBase.js +111 -0
- package/cypress/pages/dragAndDropIntoCategoriesAllOrNothingScoring.js +1161 -0
- package/cypress/pages/dragAndDropIntoCategoriesCellsScoring.js +1559 -0
- package/cypress/pages/dragAndDropIntoCategoriesPage.js +1556 -0
- package/cypress/pages/dragAndDropIntoCategoriesResponseScoring.js +1396 -0
- package/cypress/pages/essayResponseBasicPage.js +57 -0
- package/cypress/pages/essayResponseMathPage.js +47 -0
- package/cypress/pages/essayResponsePage.js +385 -0
- package/cypress/pages/feedbackScalePage.js +698 -0
- package/cypress/pages/fillInTheGapsDragAndDropPage.js +742 -0
- package/cypress/pages/fillInTheGapsDropdownPage.js +99 -0
- package/cypress/pages/fillInTheGapsOverImageDropdownPage.js +232 -0
- package/cypress/pages/fillInTheGapsOverImageTextPage.js +135 -0
- package/cypress/pages/fillInTheGapsScoring.js +5974 -0
- package/cypress/pages/fillInTheGapsSetCorrectAnswerSection.js +260 -0
- package/cypress/pages/fillInTheGapsTextPage.js +225 -0
- package/cypress/pages/highlightImagePage.js +1316 -0
- package/cypress/pages/highlightPage.js +870 -0
- package/cypress/pages/index.js +30 -0
- package/cypress/pages/listMatchingPage.js +1330 -0
- package/cypress/pages/listMatchingScoring.js +2635 -0
- package/cypress/pages/listOrderingPage.js +751 -0
- package/cypress/pages/listSortingPage.js +1201 -0
- package/cypress/pages/multipleSelectionGridPage.js +359 -0
- package/cypress/pages/multipleSelectionPage.js +88 -0
- package/cypress/pages/passagePage.js +426 -0
- package/cypress/pages/readingRulerPage.js +302 -0
- package/cypress/pages/selectQuestionResourceToolPage.js +64 -0
- package/cypress/pages/shortTextResponsePage.js +197 -0
- package/cypress/pages/singleSelectionGridPage.js +370 -0
- package/cypress/pages/singleSelectionPage.js +65 -0
- package/cypress/pages/uploadResponsePage.js +110 -0
- package/cypress/pages/videoResponsePage.js +375 -0
- package/cypress/support/commands.js +140 -0
- package/cypress/support/e2e.js +14 -0
- package/cypress/support/helpers/abortEarly.js +19 -0
- package/cypress/support/helpers/accessibility.js +34 -0
- package/cypress/support/helpers/cypressUtilities.js +64 -0
- package/cypress/support/helpers/localStorage.js +13 -0
- package/cypress/support/helpers/selectText.js +77 -0
- package/cypress/support/helpers/utilities.js +126 -0
- package/cypress.config.js +76 -0
- package/il.yaml +14 -0
- package/language +1 -0
- package/package.json +26 -0
@@ -0,0 +1,225 @@
|
|
1
|
+
import { createItemPage } from "../createItemPage";
|
2
|
+
import { dialogBoxBase } from "../dialogBoxBase";
|
3
|
+
import { selectQuestionResourceToolPage } from "../selectQuestionResourceToolPage";
|
4
|
+
import { commonComponents } from "./commonComponents";
|
5
|
+
import { questionInstructionsComponent } from "./questionInstructionsComponent";
|
6
|
+
import { scoringSectionBase } from "./scoringSectionBase";
|
7
|
+
const css = Cypress.env('css');
|
8
|
+
|
9
|
+
const selectors = {
|
10
|
+
previewTab: () => cy.get('[data-ngie-testid="preview-tab"]'),
|
11
|
+
editTab: () => cy.get('[data-ngie-testid="edit-tab"]'),
|
12
|
+
headerTitle: () => cy.get('div[class*="HeaderComponentstyles__BlockLabel"]'),
|
13
|
+
cancelButton: () => cy.get('[class*="header-wrapper"] .ngie-button').eq(0),
|
14
|
+
saveQuestionButton: () => cy.get('[class*="header-wrapper"] .ngie-button').eq(1),
|
15
|
+
editTabWrapper: () => cy.get('[class*="EditTabWrapper"]')
|
16
|
+
}
|
17
|
+
|
18
|
+
const steps = {
|
19
|
+
navigateToCreateQuestion: (questionType) => {
|
20
|
+
cy.visit('/item-engine/demo/create-item');
|
21
|
+
createItemPage.steps.clickOnAddQuestion();
|
22
|
+
selectQuestionResourceToolPage.steps.selectQuestionType(questionType);
|
23
|
+
},
|
24
|
+
|
25
|
+
navigateToCreateResource: (resourceType) => {
|
26
|
+
cy.visit('/item-engine/demo/create-item');
|
27
|
+
createItemPage.steps.clickOnAddResource();
|
28
|
+
selectQuestionResourceToolPage.steps.selectResourceType(resourceType);
|
29
|
+
},
|
30
|
+
|
31
|
+
switchToEditTab: () => {
|
32
|
+
createQuestionBasePage.editTab()
|
33
|
+
.click()
|
34
|
+
.should('have.attr', 'aria-selected', 'true');
|
35
|
+
},
|
36
|
+
|
37
|
+
switchToPreviewTab: () => {
|
38
|
+
createQuestionBasePage.previewTab()
|
39
|
+
.click()
|
40
|
+
.should('have.attr', 'aria-selected', 'true');
|
41
|
+
},
|
42
|
+
|
43
|
+
saveAQuestionAndVerifySnackbar: () => {
|
44
|
+
createQuestionBasePage.saveQuestionButton()
|
45
|
+
.click();
|
46
|
+
commonComponents.snackbar()
|
47
|
+
.should('have.text', 'Saved successfully!')
|
48
|
+
.should('be.visible');
|
49
|
+
},
|
50
|
+
|
51
|
+
//V3 - This function should be updated in all files
|
52
|
+
resetQuestionPreview: () => {
|
53
|
+
cy.log('Switching to edit tab and back to preview tab to reset the question preview')
|
54
|
+
createQuestionBasePage.steps.switchToEditTab();
|
55
|
+
createQuestionBasePage.steps.switchToPreviewTab();
|
56
|
+
}
|
57
|
+
}
|
58
|
+
|
59
|
+
const tests = {
|
60
|
+
verifyCreateQuestionPageQuestionTypeHeader: (questionType) => {
|
61
|
+
it('CSS of Header section', { tags: 'css' }, () => {
|
62
|
+
createItemPage.createQuestionPageQuestionTypeHeader()
|
63
|
+
.verifyCSS(css.color.questionHeading, css.fontSize.heading, css.fontWeight.bold);
|
64
|
+
createQuestionBasePage.cancelButton()
|
65
|
+
.verifyCSS(css.color.secondaryBtn, css.fontSize.default, css.fontWeight.semibold)
|
66
|
+
.should('have.css', 'background-color', css.color.transparent);
|
67
|
+
createQuestionBasePage.saveQuestionButton()
|
68
|
+
.verifyCSS(css.color.successBtn, css.fontSize.default, css.fontWeight.semibold)
|
69
|
+
.should('have.css', 'background-color', css.color.successBtnBg);
|
70
|
+
});
|
71
|
+
|
72
|
+
it(`Accessibility of ${questionType} Header section`, { tags: 'a11y' }, () => {
|
73
|
+
cy.checkAccessibility(createItemPage.createQuestionPageQuestionTypeHeader().parents('[class*="header-wrapper"]'));
|
74
|
+
});
|
75
|
+
|
76
|
+
it(`${questionType} label should be displayed`, () => {
|
77
|
+
createItemPage.createQuestionPageQuestionTypeHeader()
|
78
|
+
.verifyInnerText(questionType);
|
79
|
+
});
|
80
|
+
|
81
|
+
it('\'Cancel\' button should be displayed', () => {
|
82
|
+
createQuestionBasePage.cancelButton()
|
83
|
+
.verifyInnerText('Cancel');
|
84
|
+
});
|
85
|
+
|
86
|
+
it('\'Save\' button should be displayed', () => {
|
87
|
+
if (questionType === 'Passage' || questionType === 'Reading ruler' || questionType === 'Audio Player') {
|
88
|
+
createQuestionBasePage.saveQuestionButton()
|
89
|
+
.verifyInnerText('Save');
|
90
|
+
}
|
91
|
+
else {
|
92
|
+
createQuestionBasePage.saveQuestionButton()
|
93
|
+
.verifyInnerText('Save question');
|
94
|
+
}
|
95
|
+
});
|
96
|
+
},
|
97
|
+
|
98
|
+
verifyCancelButton: (questionType) => {
|
99
|
+
it('When user has made no edits and clicks on cancel button, the user should be directed back to the \'Select a Question\' page', () => {
|
100
|
+
createQuestionBasePage.cancelButton()
|
101
|
+
.click();
|
102
|
+
selectQuestionResourceToolPage.selectAQuestionHeaderText()
|
103
|
+
.should('be.visible');
|
104
|
+
selectQuestionResourceToolPage.questionTypeOptionTitle()
|
105
|
+
.should('be.visible');
|
106
|
+
});
|
107
|
+
|
108
|
+
it('When user has made some edits/changes and clicks on cancel button, a popup should be displayed with message \'Are you sure you want to leave this page? Your changes have not been saved.\'', () => {
|
109
|
+
selectQuestionResourceToolPage.steps.selectQuestionType(questionType);
|
110
|
+
questionInstructionsComponent.questionInstructionsInputField()
|
111
|
+
.should('be.visible')
|
112
|
+
.type('Edited')
|
113
|
+
.should('have.text', 'Edited');
|
114
|
+
if (questionType !== 'feedback scale') {
|
115
|
+
scoringSectionBase.steps.allotPoints(20);
|
116
|
+
};
|
117
|
+
createQuestionBasePage.cancelButton()
|
118
|
+
.click();
|
119
|
+
dialogBoxBase.dialogBox()
|
120
|
+
.should('be.visible');
|
121
|
+
dialogBoxBase.dialogBoxContent()
|
122
|
+
.verifyInnerText('Are you sure you want to leave this page? Your changes have not been saved.');
|
123
|
+
dialogBoxBase.buttonAccept()
|
124
|
+
.verifyInnerText('Yes, I want to leave this page');
|
125
|
+
dialogBoxBase.buttonReject()
|
126
|
+
.verifyInnerText('No, I\'d like to go back');
|
127
|
+
});
|
128
|
+
|
129
|
+
it('CSS of popup', { tags: 'css' }, () => {
|
130
|
+
dialogBoxBase.dialogBox()
|
131
|
+
.should('have.css', 'background-color', css.color.defaultBackground);
|
132
|
+
dialogBoxBase.dialogBoxContent()
|
133
|
+
.verifyCSS(css.color.sectionHeading, css.fontSize.default, css.fontWeight.regular);
|
134
|
+
dialogBoxBase.buttonAccept()
|
135
|
+
.verifyCSS(css.color.primaryBtn, css.fontSize.default, css.fontWeight.semibold)
|
136
|
+
.should('have.css', 'background-color', css.color.primaryBtnBg);
|
137
|
+
dialogBoxBase.buttonReject()
|
138
|
+
.verifyCSS(css.color.secondaryBtn, css.fontSize.default, css.fontWeight.semibold)
|
139
|
+
.should('have.css', 'background-color', css.color.transparent);
|
140
|
+
});
|
141
|
+
|
142
|
+
it('Accessibility of popup', { tags: 'a11y' }, () => {
|
143
|
+
cy.checkAccessibility(dialogBoxBase.dialogBox());
|
144
|
+
});
|
145
|
+
|
146
|
+
it(`Clicking on \'No, I'd like to go back\' button should close the popup and user should remain on the edit interface of the question`, () => {
|
147
|
+
dialogBoxBase.buttonReject()
|
148
|
+
.click();
|
149
|
+
createQuestionBasePage.editTab()
|
150
|
+
.should('have.attr', 'aria-selected')
|
151
|
+
.and('eq', 'true');
|
152
|
+
questionInstructionsComponent.questionInstructionsInputField()
|
153
|
+
.verifyInnerText('Edited');
|
154
|
+
});
|
155
|
+
|
156
|
+
it(`Clicking on \'Yes, I want to leave this page\' button should should discard all changes and direct the user to the \'Select a question\' page.`, () => {
|
157
|
+
createQuestionBasePage.cancelButton()
|
158
|
+
.click();
|
159
|
+
dialogBoxBase.buttonAccept()
|
160
|
+
.click();
|
161
|
+
selectQuestionResourceToolPage.selectAQuestionHeaderText()
|
162
|
+
.should('be.visible');
|
163
|
+
selectQuestionResourceToolPage.questionTypeOptionTitle()
|
164
|
+
.should('be.visible');
|
165
|
+
});
|
166
|
+
},
|
167
|
+
|
168
|
+
verifySavedSuccessfullySnackbarCSSanda11y: () => {
|
169
|
+
it('CSS of Saved successfully snackbar', { tags: 'css' }, () => {
|
170
|
+
commonComponents.snackbar()
|
171
|
+
.verifyCSS(css.color.whiteText, css.fontSize.normal, css.fontWeight.regular);
|
172
|
+
});
|
173
|
+
|
174
|
+
it('Accessibility of Saved successfully snackbar', { tags: 'a11y' }, () => {
|
175
|
+
cy.checkAccessibility(commonComponents.snackbar());
|
176
|
+
});
|
177
|
+
},
|
178
|
+
|
179
|
+
verifyTabsSection: () => {
|
180
|
+
it('CSS of Tabs section', { tags: 'css' }, () => {
|
181
|
+
//CSS of active Edit tab
|
182
|
+
createQuestionBasePage.editTab()
|
183
|
+
.verifyCSS(css.color.activeButtons, css.fontSize.default, css.fontWeight.bold);
|
184
|
+
//CSS of inactive Preview tab
|
185
|
+
createQuestionBasePage.previewTab()
|
186
|
+
.verifyCSS(css.color.sectionHeading, css.fontSize.default, css.fontWeight.bold);
|
187
|
+
});
|
188
|
+
|
189
|
+
//Note: a11y covered in Header section
|
190
|
+
|
191
|
+
it('\'Edit\' and \'Preview\' tabs should be present', () => {
|
192
|
+
createQuestionBasePage.editTab()
|
193
|
+
.verifyInnerText('Edit');
|
194
|
+
createQuestionBasePage.previewTab()
|
195
|
+
.verifyInnerText('Preview');
|
196
|
+
});
|
197
|
+
|
198
|
+
it('\'Edit\' tab should be selected by default', () => {
|
199
|
+
createQuestionBasePage.editTab()
|
200
|
+
.should('have.attr', 'aria-selected', 'true');
|
201
|
+
});
|
202
|
+
|
203
|
+
it('User should be able to switch to the \'Preview\' tab', () => {
|
204
|
+
createQuestionBasePage.steps.switchToPreviewTab();
|
205
|
+
createQuestionBasePage.editTab()
|
206
|
+
.should('not.have.class', 'active');
|
207
|
+
createQuestionBasePage.editTabWrapper()
|
208
|
+
.should('not.be.visible');
|
209
|
+
});
|
210
|
+
|
211
|
+
it('User should be able to switch back to the \'Edit\' tab', () => {
|
212
|
+
createQuestionBasePage.steps.switchToEditTab();
|
213
|
+
createQuestionBasePage.editTab()
|
214
|
+
.should('have.attr', 'aria-selected', 'true');
|
215
|
+
createQuestionBasePage.editTabWrapper()
|
216
|
+
.should('be.visible');
|
217
|
+
});
|
218
|
+
}
|
219
|
+
}
|
220
|
+
|
221
|
+
export const createQuestionBasePage = {
|
222
|
+
...selectors,
|
223
|
+
steps,
|
224
|
+
tests
|
225
|
+
}
|
@@ -0,0 +1,318 @@
|
|
1
|
+
import utilities from "../../support/helpers/utilities";
|
2
|
+
const css = Cypress.env('css');
|
3
|
+
|
4
|
+
const selectors = {
|
5
|
+
//Default
|
6
|
+
defaultLabel: () => cy.get('[class*=ColorStateComponentstyles__ColorStateLabel]').eq(0),
|
7
|
+
defaultHighlightWrapper: () => cy.get('[class*=ColorStateWrapper]').eq(0),
|
8
|
+
defaultFillColorLabel: () => customizeHighlightPropertiesComponent.defaultHighlightWrapper().find('[class*="ColorTypeWrapper"]').eq(0),
|
9
|
+
defaultBorderColorLabel: () => customizeHighlightPropertiesComponent.defaultHighlightWrapper().find('[class*="ColorTypeWrapper"]').eq(1),
|
10
|
+
defaultFillColorOpacityLabel: () => customizeHighlightPropertiesComponent.defaultHighlightWrapper().find('[class*=ColorStateComponentstyles__OpacityLabel]').eq(0),
|
11
|
+
defaultBorderColorOpacityLabel: () => customizeHighlightPropertiesComponent.defaultHighlightWrapper().find('[class*=ColorStateComponentstyles__OpacityLabel]').eq(1),
|
12
|
+
defaultFillColorHexCodeLabel: () => customizeHighlightPropertiesComponent.defaultHighlightWrapper().find('[class*=ColorStateComponentstyles__HexColorLabel]').eq(0),
|
13
|
+
defaultBorderColorHexCodeLabel: () => customizeHighlightPropertiesComponent.defaultHighlightWrapper().find('[class*=ColorStateComponentstyles__HexColorLabel]').eq(1),
|
14
|
+
defaultFillColorBlock: () => customizeHighlightPropertiesComponent.defaultHighlightWrapper().find('.color-picker-block').eq(0),
|
15
|
+
defaultBorderColorBlock: () => customizeHighlightPropertiesComponent.defaultHighlightWrapper().find('.color-picker-block').eq(1),
|
16
|
+
//Hover
|
17
|
+
hoverLabel: () => cy.get('[class*=ColorStateComponentstyles__ColorStateLabel]').eq(1),
|
18
|
+
hoverHighlightWrapper: () => cy.get('[class*=ColorStateWrapper]').eq(1),
|
19
|
+
hoverFillColorLabel: () => customizeHighlightPropertiesComponent.hoverHighlightWrapper().find('[class*="ColorTypeWrapper"]').eq(0),
|
20
|
+
hoverBorderColorLabel: () => customizeHighlightPropertiesComponent.hoverHighlightWrapper().find('[class*="ColorTypeWrapper"]').eq(1),
|
21
|
+
hoverFillColorOpacityLabel: () => customizeHighlightPropertiesComponent.hoverHighlightWrapper().find('[class*=ColorStateComponentstyles__OpacityLabel]').eq(0),
|
22
|
+
hoverBorderColorOpacityLabel: () => customizeHighlightPropertiesComponent.hoverHighlightWrapper().find('[class*=ColorStateComponentstyles__OpacityLabel]').eq(1),
|
23
|
+
hoverFillColorHexCodeLabel: () => customizeHighlightPropertiesComponent.hoverHighlightWrapper().find('[class*=ColorStateComponentstyles__HexColorLabel]').eq(0),
|
24
|
+
hoverBorderColorHexCodeLabel: () => customizeHighlightPropertiesComponent.hoverHighlightWrapper().find('[class*=ColorStateComponentstyles__HexColorLabel]').eq(1),
|
25
|
+
hoverFillColorBlock: () => customizeHighlightPropertiesComponent.hoverHighlightWrapper().find('.color-picker-block').eq(0),
|
26
|
+
hoverBorderColorBlock: () => customizeHighlightPropertiesComponent.hoverHighlightWrapper().find('.color-picker-block').eq(1),
|
27
|
+
//Active
|
28
|
+
activeLabel: () => cy.get('[class*=ColorStateComponentstyles__ColorStateLabel]').eq(2),
|
29
|
+
activeHighlightWrapper: () => cy.get('[class*=ColorStateWrapper]').eq(2),
|
30
|
+
activeFillColorLabel: () => customizeHighlightPropertiesComponent.activeHighlightWrapper().find('[class*="ColorTypeWrapper"]').eq(0),
|
31
|
+
activeBorderColorLabel: () => customizeHighlightPropertiesComponent.activeHighlightWrapper().find('[class*="ColorTypeWrapper"]').eq(1),
|
32
|
+
activeFillColorOpacityLabel: () => customizeHighlightPropertiesComponent.activeHighlightWrapper().find('[class*=ColorStateComponentstyles__OpacityLabel]').eq(0),
|
33
|
+
activeBorderColorOpacityLabel: () => customizeHighlightPropertiesComponent.activeHighlightWrapper().find('[class*=ColorStateComponentstyles__OpacityLabel]').eq(1),
|
34
|
+
activeFillColorHexCodeLabel: () => customizeHighlightPropertiesComponent.activeHighlightWrapper().find('[class*=ColorStateComponentstyles__HexColorLabel]').eq(0),
|
35
|
+
activeBorderColorHexCodeLabel: () => customizeHighlightPropertiesComponent.activeHighlightWrapper().find('[class*=ColorStateComponentstyles__HexColorLabel]').eq(1),
|
36
|
+
activeFillColorBlock: () => customizeHighlightPropertiesComponent.activeHighlightWrapper().find('.color-picker-block').eq(0),
|
37
|
+
activeBorderColorBlock: () => customizeHighlightPropertiesComponent.activeHighlightWrapper().find('.color-picker-block').eq(1),
|
38
|
+
applyPatternOnActiveStateLabel: () => cy.get('[class*=CustomizeHighlightPropertiesstyles] .check-btn-label'),
|
39
|
+
applyPatternOnActiveStateCheckbox: () => cy.get('[class*=CustomizeHighlightPropertiesstyles] input')
|
40
|
+
}
|
41
|
+
|
42
|
+
const steps = {
|
43
|
+
verifyApplyPatternOnActiveStateCheckboxIsChecked: () => {
|
44
|
+
customizeHighlightPropertiesComponent.applyPatternOnActiveStateCheckbox()
|
45
|
+
.should('be.checked');
|
46
|
+
},
|
47
|
+
|
48
|
+
verifyApplyPatternOnActiveStateCheckboxIsUnchecked: () => {
|
49
|
+
customizeHighlightPropertiesComponent.applyPatternOnActiveStateCheckbox()
|
50
|
+
.should('not.be.checked');
|
51
|
+
},
|
52
|
+
|
53
|
+
verifyCSSOfApplyPatternOnActiveState: () => {
|
54
|
+
utilities.verifyCSS(customizeHighlightPropertiesComponent.applyPatternOnActiveStateLabel(), {
|
55
|
+
'color': css.color.labelText,
|
56
|
+
'font-size': css.fontSize.normal,
|
57
|
+
'font-weight': css.fontWeight.regular
|
58
|
+
});
|
59
|
+
utilities.verifyCSS(customizeHighlightPropertiesComponent.applyPatternOnActiveStateCheckbox().parents('.MuiIconButton-label').find('svg'), {
|
60
|
+
'fill': css.color.activeButtons
|
61
|
+
});
|
62
|
+
},
|
63
|
+
|
64
|
+
/**
|
65
|
+
* @param {string} color background color of color block
|
66
|
+
* @description this function verfies the background color of default fill color block
|
67
|
+
*/
|
68
|
+
verifyDefaultFillColorBlockColor: (color) => {
|
69
|
+
customizeHighlightPropertiesComponent.defaultFillColorBlock()
|
70
|
+
.should('have.css', 'background-color', color);
|
71
|
+
},
|
72
|
+
|
73
|
+
/**
|
74
|
+
* @param {string} color background color of color block
|
75
|
+
* @description this function verfies the background color of default border color block
|
76
|
+
*/
|
77
|
+
verifyDefaultBorderColorBlockColor: (color) => {
|
78
|
+
customizeHighlightPropertiesComponent.defaultBorderColorBlock()
|
79
|
+
.should('have.css', 'background-color', color);
|
80
|
+
},
|
81
|
+
|
82
|
+
/**
|
83
|
+
* @param {string} color background color of color block
|
84
|
+
* @description this function verfies the background color of active fill color block
|
85
|
+
*/
|
86
|
+
verifyActiveFillColorBlockColor: (color) => {
|
87
|
+
customizeHighlightPropertiesComponent.activeFillColorBlock()
|
88
|
+
.should('have.css', 'background-color', color);
|
89
|
+
},
|
90
|
+
|
91
|
+
/**
|
92
|
+
* @param {string} color background color of color block
|
93
|
+
* @description this function verfies the background color of active border color block
|
94
|
+
*/
|
95
|
+
verifyActiveBorderColorBlockColor: (color) => {
|
96
|
+
customizeHighlightPropertiesComponent.activeBorderColorBlock()
|
97
|
+
.should('have.css', 'background-color', color);
|
98
|
+
},
|
99
|
+
|
100
|
+
/**
|
101
|
+
* @param {string} color background color of color block
|
102
|
+
* @description this function verfies the background color of hover fill color block
|
103
|
+
*/
|
104
|
+
verifyHoverFillColorBlockColor: (color) => {
|
105
|
+
customizeHighlightPropertiesComponent.hoverFillColorBlock()
|
106
|
+
.should('have.css', 'background-color', color);
|
107
|
+
},
|
108
|
+
|
109
|
+
/**
|
110
|
+
* @param {string} color background color of color block
|
111
|
+
* @description this function verfies the background color of hover border color block
|
112
|
+
*/
|
113
|
+
verifyHoverBorderColorBlockColor: (color) => {
|
114
|
+
customizeHighlightPropertiesComponent.hoverFillColorBlock()
|
115
|
+
.should('have.css', 'background-color', color);
|
116
|
+
},
|
117
|
+
|
118
|
+
/**
|
119
|
+
* @param {string} hexCode hexcode label of color block
|
120
|
+
* @description this function verfies the hexcode label of default fill color block
|
121
|
+
*/
|
122
|
+
verifyDefaultFillColorHexCodeLabel: (hexCode) => {
|
123
|
+
utilities.verifyInnerText(customizeHighlightPropertiesComponent.defaultFillColorHexCodeLabel(), hexCode)
|
124
|
+
},
|
125
|
+
|
126
|
+
/**
|
127
|
+
* @param {string} hexCode hexcode label of color block
|
128
|
+
* @description this function verfies the hexcode label of default border color block
|
129
|
+
*/
|
130
|
+
verifyDefaultBorderColorHexCodeLabel: (hexCode) => {
|
131
|
+
utilities.verifyInnerText(customizeHighlightPropertiesComponent.defaultBorderColorHexCodeLabel(), hexCode)
|
132
|
+
},
|
133
|
+
|
134
|
+
/**
|
135
|
+
* @param {string} hexCode hexcode label of color block
|
136
|
+
* @description this function verfies the hexcode label of hover fill color block
|
137
|
+
*/
|
138
|
+
verifyHoverFillColorHexCodeLabel: (hexCode) => {
|
139
|
+
utilities.verifyInnerText(customizeHighlightPropertiesComponent.hoverFillColorHexCodeLabel(), hexCode)
|
140
|
+
},
|
141
|
+
|
142
|
+
/**
|
143
|
+
* @param {string} hexCode hexcode label of color block
|
144
|
+
* @description this function verfies the hexcode label of hover border color block
|
145
|
+
*/
|
146
|
+
verifyHoverBorderColorHexCodeLabel: (hexCode) => {
|
147
|
+
utilities.verifyInnerText(customizeHighlightPropertiesComponent.hoverBorderColorHexCodeLabel(), hexCode)
|
148
|
+
},
|
149
|
+
|
150
|
+
/**
|
151
|
+
* @param {string} hexCode hexcode label of color block
|
152
|
+
* @description this function verfies the hexcode label of active fill color block
|
153
|
+
*/
|
154
|
+
verifyActiveFillColorHexCodeLabel: (hexCode) => {
|
155
|
+
utilities.verifyInnerText(customizeHighlightPropertiesComponent.activeFillColorHexCodeLabel(), hexCode)
|
156
|
+
},
|
157
|
+
|
158
|
+
/**
|
159
|
+
* @param {string} hexCode hexcode label of color block
|
160
|
+
* @description this function verfies the hexcode label of active fill color block
|
161
|
+
*/
|
162
|
+
verifyActiveBorderColorHexCodeLabel: (hexCode) => {
|
163
|
+
utilities.verifyInnerText(customizeHighlightPropertiesComponent.activeBorderColorHexCodeLabel(), hexCode)
|
164
|
+
},
|
165
|
+
|
166
|
+
/**
|
167
|
+
* @param {string} opacityLabel opacity label of color block
|
168
|
+
* @description this function verfies the opacity label of default fill color block
|
169
|
+
*/
|
170
|
+
verifyDefaultFillColorOpacityLabel: (opacityLabel) => {
|
171
|
+
utilities.verifyInnerText(customizeHighlightPropertiesComponent.defaultFillColorOpacityLabel(), opacityLabel)
|
172
|
+
},
|
173
|
+
|
174
|
+
/**
|
175
|
+
* @param {string} opacityLabel opacity label of color block
|
176
|
+
* @description this function verfies the opacity label of default border color block
|
177
|
+
*/
|
178
|
+
verifyDefaultBorderColorOpacityLabel: (opacityLabel) => {
|
179
|
+
utilities.verifyInnerText(customizeHighlightPropertiesComponent.defaultBorderColorOpacityLabel(), opacityLabel)
|
180
|
+
},
|
181
|
+
|
182
|
+
/**
|
183
|
+
* @param {string} opacityLabel opacity label of color block
|
184
|
+
* @description this function verfies the opacity label of hover fill color block
|
185
|
+
*/
|
186
|
+
verifyHoverFillColorOpacityLabel: (opacityLabel) => {
|
187
|
+
utilities.verifyInnerText(customizeHighlightPropertiesComponent.hoverFillColorOpacityLabel(), opacityLabel)
|
188
|
+
},
|
189
|
+
|
190
|
+
/**
|
191
|
+
* @param {string} opacityLabel opacity label of color block
|
192
|
+
* @description this function verfies the opacity label of hover border color block
|
193
|
+
*/
|
194
|
+
verifyHoverBorderColorOpacityLabel: (opacityLabel) => {
|
195
|
+
utilities.verifyInnerText(customizeHighlightPropertiesComponent.hoverBorderColorOpacityLabel(), opacityLabel)
|
196
|
+
},
|
197
|
+
|
198
|
+
/**
|
199
|
+
* @param {string} opacityLabel opacity label of color block
|
200
|
+
* @description this function verfies the opacity label of active fill color block
|
201
|
+
*/
|
202
|
+
verifyActiveFillColorOpacityLabel: (opacityLabel) => {
|
203
|
+
utilities.verifyInnerText(customizeHighlightPropertiesComponent.activeFillColorOpacityLabel(), opacityLabel)
|
204
|
+
},
|
205
|
+
|
206
|
+
/**
|
207
|
+
* @param {string} opacityLabel opacity label of color block
|
208
|
+
* @description this function verfies the opacity label of active border color block
|
209
|
+
*/
|
210
|
+
verifyActiveBorderColorOpacityLabel: (opacityLabel) => {
|
211
|
+
utilities.verifyInnerText(customizeHighlightPropertiesComponent.activeBorderColorOpacityLabel(), opacityLabel)
|
212
|
+
},
|
213
|
+
|
214
|
+
verifyPatternAppliedOnActiveState: () => {
|
215
|
+
utilities.verifyElementVisibilityState(customizeHighlightPropertiesComponent.activeFillColorBlock().find('svg'), 'visible');
|
216
|
+
},
|
217
|
+
|
218
|
+
verifyHighlightColorDefaultContentCSS: () => {
|
219
|
+
utilities.verifyCSS(customizeHighlightPropertiesComponent.defaultLabel(), {
|
220
|
+
'color': css.color.labels,
|
221
|
+
'font-size': css.fontSize.normal,
|
222
|
+
'font-weight': css.fontWeight.semibold
|
223
|
+
});
|
224
|
+
const colorLabels = [customizeHighlightPropertiesComponent.defaultFillColorLabel, customizeHighlightPropertiesComponent.defaultBorderColorLabel]
|
225
|
+
for (let index = 0; index < colorLabels.length; index++) {
|
226
|
+
utilities.verifyCSS(colorLabels[index](), {
|
227
|
+
'color': css.color.labels,
|
228
|
+
'font-size': css.fontSize.normal,
|
229
|
+
'font-weight': css.fontWeight.regular
|
230
|
+
});
|
231
|
+
};
|
232
|
+
const hexCodeLabels = [customizeHighlightPropertiesComponent.defaultFillColorHexCodeLabel, customizeHighlightPropertiesComponent.defaultBorderColorHexCodeLabel]
|
233
|
+
for (let index = 0; index < hexCodeLabels.length; index++) {
|
234
|
+
utilities.verifyCSS(hexCodeLabels[index](), {
|
235
|
+
'color': css.color.placeholderText,
|
236
|
+
'font-size': css.fontSize.small,
|
237
|
+
'font-weight': css.fontWeight.semibold
|
238
|
+
});
|
239
|
+
};
|
240
|
+
const opacityLabels = [customizeHighlightPropertiesComponent.defaultFillColorOpacityLabel, customizeHighlightPropertiesComponent.defaultBorderColorOpacityLabel]
|
241
|
+
for (let index = 0; index < opacityLabels.length; index++) {
|
242
|
+
utilities.verifyCSS(opacityLabels[index](), {
|
243
|
+
'color': css.color.placeholderText,
|
244
|
+
'font-size': css.fontSize.small,
|
245
|
+
'font-weight': css.fontWeight.regular
|
246
|
+
});
|
247
|
+
};
|
248
|
+
},
|
249
|
+
|
250
|
+
verifyHighlightColorHoverContentCSS: () => {
|
251
|
+
utilities.verifyCSS(customizeHighlightPropertiesComponent.hoverLabel(), {
|
252
|
+
'color': css.color.labels,
|
253
|
+
'font-size': css.fontSize.normal,
|
254
|
+
'font-weight': css.fontWeight.semibold
|
255
|
+
});
|
256
|
+
const colorLabels = [customizeHighlightPropertiesComponent.hoverFillColorLabel, customizeHighlightPropertiesComponent.hoverBorderColorLabel]
|
257
|
+
for (let index = 0; index < colorLabels.length; index++) {
|
258
|
+
utilities.verifyCSS(colorLabels[index](), {
|
259
|
+
'color': css.color.labels,
|
260
|
+
'font-size': css.fontSize.normal,
|
261
|
+
'font-weight': css.fontWeight.regular
|
262
|
+
});
|
263
|
+
};
|
264
|
+
const hexCodeLabels = [customizeHighlightPropertiesComponent.hoverFillColorHexCodeLabel, customizeHighlightPropertiesComponent.hoverBorderColorHexCodeLabel]
|
265
|
+
for (let index = 0; index < hexCodeLabels.length; index++) {
|
266
|
+
utilities.verifyCSS(hexCodeLabels[index](), {
|
267
|
+
'color': css.color.placeholderText,
|
268
|
+
'font-size': css.fontSize.small,
|
269
|
+
'font-weight': css.fontWeight.semibold
|
270
|
+
});
|
271
|
+
};
|
272
|
+
const opacityLabels = [customizeHighlightPropertiesComponent.hoverFillColorOpacityLabel, customizeHighlightPropertiesComponent.hoverBorderColorOpacityLabel]
|
273
|
+
for (let index = 0; index < opacityLabels.length; index++) {
|
274
|
+
utilities.verifyCSS(opacityLabels[index](), {
|
275
|
+
'color': css.color.placeholderText,
|
276
|
+
'font-size': css.fontSize.small,
|
277
|
+
'font-weight': css.fontWeight.regular
|
278
|
+
});
|
279
|
+
};
|
280
|
+
},
|
281
|
+
|
282
|
+
verifyHighlightColorActiveContentCSS: () => {
|
283
|
+
utilities.verifyCSS(customizeHighlightPropertiesComponent.activeLabel(), {
|
284
|
+
'color': css.color.labels,
|
285
|
+
'font-size': css.fontSize.normal,
|
286
|
+
'font-weight': css.fontWeight.semibold
|
287
|
+
});
|
288
|
+
const colorLabels = [customizeHighlightPropertiesComponent.activeFillColorLabel, customizeHighlightPropertiesComponent.activeBorderColorLabel]
|
289
|
+
for (let index = 0; index < colorLabels.length; index++) {
|
290
|
+
utilities.verifyCSS(colorLabels[index](), {
|
291
|
+
'color': css.color.labels,
|
292
|
+
'font-size': css.fontSize.normal,
|
293
|
+
'font-weight': css.fontWeight.regular
|
294
|
+
});
|
295
|
+
};
|
296
|
+
const hexCodeLabels = [customizeHighlightPropertiesComponent.activeFillColorHexCodeLabel, customizeHighlightPropertiesComponent.activeBorderColorHexCodeLabel]
|
297
|
+
for (let index = 0; index < hexCodeLabels.length; index++) {
|
298
|
+
utilities.verifyCSS(hexCodeLabels[index](), {
|
299
|
+
'color': css.color.placeholderText,
|
300
|
+
'font-size': css.fontSize.small,
|
301
|
+
'font-weight': css.fontWeight.semibold
|
302
|
+
});
|
303
|
+
};
|
304
|
+
const opacityLabels = [customizeHighlightPropertiesComponent.activeFillColorOpacityLabel, customizeHighlightPropertiesComponent.activeBorderColorOpacityLabel]
|
305
|
+
for (let index = 0; index < opacityLabels.length; index++) {
|
306
|
+
utilities.verifyCSS(opacityLabels[index](), {
|
307
|
+
'color': css.color.placeholderText,
|
308
|
+
'font-size': css.fontSize.small,
|
309
|
+
'font-weight': css.fontWeight.regular
|
310
|
+
});
|
311
|
+
};
|
312
|
+
}
|
313
|
+
}
|
314
|
+
|
315
|
+
export const customizeHighlightPropertiesComponent = {
|
316
|
+
...selectors,
|
317
|
+
steps
|
318
|
+
}
|