itemengine-cypress-automation 1.0.349-TEMRegression4-f1b48a1.0 → 1.0.350-feature-thinkSphere-880f75f.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cypress/e2e/ILC/BrowseItems/browseReviewItems.js +360 -0
- package/cypress/e2e/ILC/BrowseItems/browseReviewItemsMobileView.js +329 -0
- package/cypress/e2e/ILC/BrowseItems/browseThinkSphereItems.js +259 -0
- package/cypress/e2e/ILC/BrowseItems/browseThinkSphereItemsMobileView.js +367 -0
- package/cypress/e2e/ILC/ThinkSphere/additionalSettings.js +52 -0
- package/cypress/e2e/ILC/ThinkSphere/createReviewItem.js +58 -0
- package/cypress/e2e/ILC/ThinkSphere/editTabBasicSection.js +366 -0
- package/cypress/e2e/ILC/ThinkSphere/editThinkSphereQuestion.smoke.js +26 -0
- package/cypress/e2e/ILC/ThinkSphere/headerSection.js +53 -0
- package/cypress/e2e/ILC/ThinkSphere/planPhase.js +216 -0
- package/cypress/e2e/ILC/ThinkSphere/solvePhase.js +263 -0
- package/cypress/fixtures/theme/ilc.json +10 -1
- package/cypress/fixtures/uploads/sample20MB.mp4 +0 -0
- package/cypress/fixtures/uploads/sample2MB.mp4 +0 -0
- package/cypress/fixtures/uploads/sample2MB_2.mp4 +0 -0
- package/cypress/pages/components/backgroundImageUploadComponent.js +32 -24
- package/cypress/pages/components/browseItemsPage.js +891 -7
- package/cypress/pages/components/ckEditorAudioPlayerComponent.js +1 -1
- package/cypress/pages/components/commonComponents.js +4 -1
- package/cypress/pages/components/createQuestionBasePage.js +1 -1
- package/cypress/pages/components/defaultToolDropdown.js +7 -6
- package/cypress/pages/dialogBoxBase.js +2 -1
- package/cypress/pages/index.js +2 -1
- package/cypress/pages/selectQuestionResourceToolPage.js +8 -2
- package/cypress/pages/thinkSpherePage.js +1307 -0
- package/cypress/support/commands.js +9 -4
- package/cypress/support/e2e.js +1 -0
- package/cypress/support/helpers/createItem.js +550 -0
- package/cypress/support/helpers/utilities.js +54 -0
- package/package.json +1 -1
@@ -0,0 +1,263 @@
|
|
1
|
+
import { equationEditorCategoriesAndSymbols } from "../../../fixtures/equationEditorCategoriesAndSymbols ";
|
2
|
+
import { thinkSpherePage } from "../../../pages";
|
3
|
+
import abortEarlySetup from "../../../support/helpers/abortEarly";
|
4
|
+
import utilities from "../../../support/helpers/utilities";
|
5
|
+
const css = Cypress.env('css');
|
6
|
+
const canvasTools = [
|
7
|
+
'Text', 'Pen', 'Highlighter', 'Image', 'Shapes',
|
8
|
+
'Stamps', 'Number bond', 'Unifix Cube', 'Diagrams', 'Array',
|
9
|
+
'Number line', 'Fraction bars', 'Protractor', 'Table', 'Grids',
|
10
|
+
'Equation editor', 'Algebra tiles'
|
11
|
+
];
|
12
|
+
const defaultSelectedCanvasTools = ['Text', 'Pen', 'Highlighter', 'Image', 'Shapes', 'Stamps'];
|
13
|
+
const canvasControls = ['Move', 'Delete', 'Undo', 'Redo', 'Clear all'];
|
14
|
+
const defaultSelectedCanvasControls = ['Move', 'Delete', 'Undo', 'Redo', 'Clear all'];
|
15
|
+
const defaultTool = 'Pen';
|
16
|
+
const defaultSelectedCategories = ['Numpad', 'Keypad', 'Intermediate', 'Primary', 'General', 'Common', 'Algebra', 'Geo', 'Compare', 'Matrices'];
|
17
|
+
const defaultSelectedStamps = ['Stamp 1', 'Stamp 2', 'Stamp 3', 'Stamp 4', 'Stamp 5', 'Stamp 6', 'Stamp 7', 'Stamp 8', 'Stamp 9', 'Stamp 10', 'Stamp 11', 'Stamp 12', 'Stamp 13'];
|
18
|
+
const defaultToolsOptions = ['Text', 'Pen', 'Highlighter'];
|
19
|
+
|
20
|
+
|
21
|
+
describe('ThinkSphere Question - Solve Phases Section', () => {
|
22
|
+
before(() => {
|
23
|
+
cy.loginAs('admin');
|
24
|
+
});
|
25
|
+
|
26
|
+
describe('Create item : ThinkSphere Question - Solve Phases Section - Edit tab', () => {
|
27
|
+
abortEarlySetup();
|
28
|
+
before(() => {
|
29
|
+
cy.loginAs('admin');
|
30
|
+
thinkSpherePage.steps.navigateToThinkSphereCreateQuestion();
|
31
|
+
cy.barsPreLoaderWait();
|
32
|
+
});
|
33
|
+
|
34
|
+
it('By default \'Solve phase\' accordion should be expanded', () => {
|
35
|
+
utilities.verifyInnerText(thinkSpherePage.solvePhaseAccordionLabel(), 'Solve');
|
36
|
+
utilities.verifyElementVisibilityState(thinkSpherePage.solvePhaseAccordionExpandIcon(), 'exist');
|
37
|
+
});
|
38
|
+
|
39
|
+
it('By default \'Customize toolbar options and controls\' accordion should be collapsed and by clicking on the \'Customize toolbar options and controls\' accordion, user should be able to expand the accordion', () => {
|
40
|
+
utilities.verifyInnerText(thinkSpherePage.customizeToolsAndControlsLabel(), 'Customize toolbar options and controls');
|
41
|
+
utilities.verifyElementVisibilityState(thinkSpherePage.customizeToolsAndControlsIcon(), 'exist');
|
42
|
+
thinkSpherePage.steps.expandCustomizeToolsAndControls();
|
43
|
+
});
|
44
|
+
|
45
|
+
it('Accessibility of \'Solve phase\' accordion and contents', { tags: 'a11y' }, () => {
|
46
|
+
cy.checkAccessibility(thinkSpherePage.solvePhaseAccordionContentWrapper());
|
47
|
+
});
|
48
|
+
|
49
|
+
it('CSS of \'Solve phase\' accordion and contents', { tags: 'css' }, () => {
|
50
|
+
cy.log('CSS of accordion label and chevron icon')
|
51
|
+
utilities.verifyCSS(thinkSpherePage.solvePhaseAccordionLabel(), {
|
52
|
+
'color': css.color.accordionLabel,
|
53
|
+
'font-size': css.fontSize.default,
|
54
|
+
'font-weight': css.fontWeight.bold
|
55
|
+
});
|
56
|
+
utilities.verifyCSS(thinkSpherePage.solvePhaseAccordionSvg(), {
|
57
|
+
'fill': css.color.activeButtons
|
58
|
+
});
|
59
|
+
utilities.verifyCSS(thinkSpherePage.customizeToolsAndControlsLabel(), {
|
60
|
+
'color': css.color.accordionLabel,
|
61
|
+
'font-size': css.fontSize.default,
|
62
|
+
'font-weight': css.fontWeight.bold
|
63
|
+
});
|
64
|
+
utilities.verifyCSS(thinkSpherePage.customizeToolsAndControlsSvg(), {
|
65
|
+
'fill': css.color.activeButtons
|
66
|
+
});
|
67
|
+
|
68
|
+
cy.log('CSS of selected toolbar formatting option')
|
69
|
+
utilities.verifyCSS(thinkSpherePage.solveToolsAndControlsOptionsTiles('Text'), {
|
70
|
+
'background-color': css.color.primaryBtnBg
|
71
|
+
});
|
72
|
+
cy.log('CSS of tick icon of selected toolbar formatting option')
|
73
|
+
utilities.verifyCSS(thinkSpherePage.solvePhaseToolsAndControlsOptionsTilesFeatherCheckIcon(), {
|
74
|
+
'fill': css.color.activeButtons
|
75
|
+
});
|
76
|
+
cy.log('CSS of background of tick icon of selected toolbar formatting option')
|
77
|
+
utilities.verifyCSS(thinkSpherePage.solvePhaseToolsAndControlsOptionsTilesRectangle(), {
|
78
|
+
'fill': css.color.defaultBackground
|
79
|
+
});
|
80
|
+
cy.log('CSS of icon of selected toolbar formatting option')
|
81
|
+
utilities.verifyCSS(thinkSpherePage.solvePhaseToolsAndControlsOptionsTilesDragItemFlexWrapperSvg(), {
|
82
|
+
'fill': css.color.primaryBtn
|
83
|
+
});
|
84
|
+
cy.log('CSS of drag handle of selected toolbar formatting option')
|
85
|
+
utilities.verifyCSS(
|
86
|
+
utilities.getNthElement(thinkSpherePage.solvePhaseToolsAndControlsOptionsTilesTextDragIconSvgPath(), 1),
|
87
|
+
{
|
88
|
+
'color': css.color.activeButtons
|
89
|
+
},
|
90
|
+
);
|
91
|
+
cy.log('CSS of unselected toolbar formatting option')
|
92
|
+
utilities.verifyCSS(thinkSpherePage.solveToolsAndControlsOptionsTiles('Array'), {
|
93
|
+
'background-color': css.color.secondaryBtnBg
|
94
|
+
});
|
95
|
+
cy.log('CSS of drag handle of unselected toolbar formatting option')
|
96
|
+
utilities.verifyCSS(
|
97
|
+
utilities.getNthElement(thinkSpherePage.solvePhaseToolsAndControlsOptionsTilesArrayDragIconSvgPath(), 1),
|
98
|
+
{
|
99
|
+
'fill': css.color.secondaryBtn
|
100
|
+
},
|
101
|
+
);
|
102
|
+
});
|
103
|
+
|
104
|
+
it('When \'Solve phase\' accordion is in expanded state, then all the tool options should be displayed along with drag handle.', () => {
|
105
|
+
thinkSpherePage.steps.verifyToolsAndControlsOptions(canvasTools);
|
106
|
+
});
|
107
|
+
|
108
|
+
it(`When the \'Solve phase\' accordion is in expanded state, then the following tools should be in selected state by default - ${defaultSelectedCanvasTools}. All the other options should be in unselected state.`, () => {
|
109
|
+
defaultSelectedCanvasTools.forEach(tool => {
|
110
|
+
thinkSpherePage.steps.verifyOptionIsSelected(tool);
|
111
|
+
});
|
112
|
+
canvasTools.filter(tool => !defaultSelectedCanvasTools.includes(tool)).forEach(tool => {
|
113
|
+
thinkSpherePage.steps.verifyOptionIsNotSelected(tool);
|
114
|
+
});
|
115
|
+
});
|
116
|
+
|
117
|
+
it('User should be able to unselect any default selected tool and should be able to select any default unselected tool.', () => {
|
118
|
+
thinkSpherePage.steps.deselectOptionFromToolsAndControls('Text');
|
119
|
+
thinkSpherePage.steps.verifyOptionIsNotSelected('Text');
|
120
|
+
thinkSpherePage.steps.selectOptionFromToolsAndControls('Array');
|
121
|
+
thinkSpherePage.steps.verifyOptionIsSelected('Array');
|
122
|
+
});
|
123
|
+
|
124
|
+
it('When \'Solve phase\' accordion is in expanded state, then all the control options should be displayed along with drag handle.', () => {
|
125
|
+
thinkSpherePage.steps.verifyToolsAndControlsOptions(canvasControls);
|
126
|
+
});
|
127
|
+
|
128
|
+
it(`When the \'Solve phase\' accordion is in expanded state, then the following controls should be in selected state by default - ${defaultSelectedCanvasControls}. All the other options should be in unselected state.`, () => {
|
129
|
+
defaultSelectedCanvasControls.forEach(control => {
|
130
|
+
thinkSpherePage.steps.verifyOptionIsSelected(control);
|
131
|
+
});
|
132
|
+
canvasControls.filter(control => !defaultSelectedCanvasControls.includes(control)).forEach(control => {
|
133
|
+
thinkSpherePage.steps.verifyOptionIsNotSelected(control);
|
134
|
+
});
|
135
|
+
});
|
136
|
+
|
137
|
+
it('User should be able to unselect any default selected control.', () => {
|
138
|
+
thinkSpherePage.steps.deselectOptionFromToolsAndControls('Move');
|
139
|
+
thinkSpherePage.steps.verifyOptionIsNotSelected('Move');
|
140
|
+
});
|
141
|
+
|
142
|
+
thinkSpherePage.tests.verifyDefaultToolDropdown(defaultToolsOptions, defaultTool);
|
143
|
+
|
144
|
+
it('\'Customize stamps\' component should be present inside \'Customize toolbar options and controls\' accordion of solve phase', () => {
|
145
|
+
thinkSpherePage.steps.verifyCustomizeStampsComponent();
|
146
|
+
utilities.verifyInnerText(thinkSpherePage.customizeStampHeading(), 'Customize stamp');
|
147
|
+
});
|
148
|
+
|
149
|
+
it('Default stamps should be displayed and selected by default in the \'Customize stamps\' component', () => {
|
150
|
+
thinkSpherePage.steps.verifyDefaultStamps(defaultSelectedStamps);
|
151
|
+
});
|
152
|
+
|
153
|
+
it('When user select deselect stamps tool from tools section, then customize stamps section should be visible and hide respectively', () => {
|
154
|
+
thinkSpherePage.steps.clickOnStampsTool();
|
155
|
+
utilities.verifyElementVisibilityState(thinkSpherePage.customizeStampComponent(), 'notExist');
|
156
|
+
thinkSpherePage.steps.clickOnStampsTool();
|
157
|
+
utilities.verifyElementVisibilityState(thinkSpherePage.customizeStampComponent(), 'visible');
|
158
|
+
});
|
159
|
+
|
160
|
+
it('CSS of \'Customize stamps\' component', { tags: 'css' }, () => {
|
161
|
+
thinkSpherePage.customizeStampComponent()
|
162
|
+
.within(() => {
|
163
|
+
utilities.verifyCSS(thinkSpherePage.customizeStampHeading(), {
|
164
|
+
'color': css.color.sectionHeading,
|
165
|
+
'font-size': css.fontSize.normal,
|
166
|
+
'font-weight': css.fontWeight.semibold,
|
167
|
+
'padding-bottom': '8px'
|
168
|
+
});
|
169
|
+
utilities.verifyCSS(utilities.getNthElement(thinkSpherePage.customizeStampCard(), 0), {
|
170
|
+
'width': '80px',
|
171
|
+
'height': '80px',
|
172
|
+
'border': `1px solid ${css.color.figDefaultComponentBorder}`,
|
173
|
+
'background-color': css.color.primaryBtn,
|
174
|
+
'border-radius': '8px',
|
175
|
+
});
|
176
|
+
});
|
177
|
+
});
|
178
|
+
|
179
|
+
it('User should be able to select and unselect any stamp from the \'Customize stamps\' component', () => {
|
180
|
+
thinkSpherePage.steps.verifySelectAndUnselectStamps();
|
181
|
+
});
|
182
|
+
|
183
|
+
it('CSS of unselected \'Customize stamp\' card component', { tags: 'css' }, () => {
|
184
|
+
thinkSpherePage.steps.clickOnCustomizeCard(0);
|
185
|
+
utilities.verifyCSS(utilities.getNthElement(thinkSpherePage.customizeStampCard(), 0), {
|
186
|
+
'width': '80px',
|
187
|
+
'height': '80px',
|
188
|
+
'border': `1px solid ${css.color.secondaryBtnDisabled}`,
|
189
|
+
'background-color': css.color.primaryBtn,
|
190
|
+
'border-radius': '8px',
|
191
|
+
});
|
192
|
+
thinkSpherePage.steps.clickOnCustomizeCard(0);
|
193
|
+
});
|
194
|
+
|
195
|
+
thinkSpherePage.tests.verifyDefaultToolDropdown(canvasTools, defaultTool);
|
196
|
+
|
197
|
+
it('By default, Equation Editor categories should not be displayed', () => {
|
198
|
+
utilities.verifyElementVisibilityState(thinkSpherePage.equationEditorSectionWrapper(), 'notExist');
|
199
|
+
});
|
200
|
+
|
201
|
+
it('When clicking the Equation Editor Tool, Equation Editor categories should be displayed', () => {
|
202
|
+
thinkSpherePage.steps.selectCustomizedFormattingOption(['Equation editor']);
|
203
|
+
utilities.verifyElementVisibilityState(thinkSpherePage.equationEditorSectionWrapper(), 'exist');
|
204
|
+
});
|
205
|
+
|
206
|
+
it(`By default, ${defaultSelectedCategories.toString()} should be selected`, () => {
|
207
|
+
defaultSelectedCategories.forEach((category) => {
|
208
|
+
thinkSpherePage.steps.verifySelectedCategoryInEquationEditorSectionEditTab(category);
|
209
|
+
});
|
210
|
+
});
|
211
|
+
|
212
|
+
it('CSS of selected and deselected category', { tags: 'css' }, () => {
|
213
|
+
cy.log('CSS of selected category')
|
214
|
+
|
215
|
+
utilities.verifyCSS(utilities.getNthElement(thinkSpherePage.equationEditorSectionCategories(), 0), {
|
216
|
+
'background-color': css.color.activeButtons
|
217
|
+
});
|
218
|
+
|
219
|
+
utilities.getNthElement(thinkSpherePage.equationEditorSectionCategories(), 0)
|
220
|
+
.within(() => {
|
221
|
+
utilities.verifyCSS(thinkSpherePage.equationEditorSectionCategoryLabel(), {
|
222
|
+
'color': css.color.primaryBtn,
|
223
|
+
'font-size': css.fontSize.small,
|
224
|
+
'font-weight': css.fontWeight.regular
|
225
|
+
});
|
226
|
+
utilities.verifyCSS(thinkSpherePage.equationEditorSectionTickIcon(), {
|
227
|
+
'fill': css.color.activeButtons
|
228
|
+
});
|
229
|
+
utilities.verifyCSS(thinkSpherePage.equationEditorSectionCategoriesDragIcon(), {
|
230
|
+
'fill': css.color.activeButtons
|
231
|
+
});
|
232
|
+
});
|
233
|
+
|
234
|
+
cy.log('CSS of deselected category')
|
235
|
+
|
236
|
+
utilities.verifyCSS(utilities.getNthElement(thinkSpherePage.equationEditorSectionCategories(), 12), {
|
237
|
+
'background-color': css.color.primaryBtn
|
238
|
+
});
|
239
|
+
|
240
|
+
utilities.getNthElement(thinkSpherePage.equationEditorSectionCategories(), 12)
|
241
|
+
.within(() => {
|
242
|
+
utilities.verifyCSS(thinkSpherePage.equationEditorSectionCategoryLabel(), {
|
243
|
+
'color': css.color.secondaryBtn,
|
244
|
+
'font-size': css.fontSize.small,
|
245
|
+
'font-weight': css.fontWeight.regular
|
246
|
+
});
|
247
|
+
utilities.verifyCSS(thinkSpherePage.equationEditorSectionCategoriesDragIcon(), {
|
248
|
+
'fill': css.color.secondaryBtn
|
249
|
+
});
|
250
|
+
});
|
251
|
+
});
|
252
|
+
|
253
|
+
it('Accessibility of selected and deselected category', { tags: 'a11y' }, () => {
|
254
|
+
cy.checkAccessibility(thinkSpherePage.equationEditorSectionCategories().contains(`${equationEditorCategoriesAndSymbols['numPad'].displayName}`).parents('[class*="DraggableItemsGrid"]'))
|
255
|
+
});
|
256
|
+
|
257
|
+
it('When user add question image then it should replicate at customize stamps first card and it should be unselected', () => {
|
258
|
+
thinkSpherePage.steps.uploadFile('uploads/highlightImage.jpg');
|
259
|
+
cy.wait(5000);
|
260
|
+
thinkSpherePage.steps.verifyQuestionImageCustomStamp();
|
261
|
+
});
|
262
|
+
});
|
263
|
+
})
|
@@ -1,5 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"color": {
|
3
|
+
"boxShadow": "rgba(82, 0, 255, 0.1)",
|
3
4
|
"primaryBtn": "rgb(255, 255, 255)",
|
4
5
|
"primaryBtnBg": "rgb(82, 0, 255)",
|
5
6
|
"primaryBtnBorder": "rgb(0, 0, 124)",
|
@@ -157,7 +158,15 @@
|
|
157
158
|
"newFontColor": "rgb(128, 25, 0)",
|
158
159
|
"newResponseFieldColor": "rgb(119, 60, 60)",
|
159
160
|
"blackText": "rgb(0, 0, 0)",
|
160
|
-
"blackTextBoxText":"rgba(0, 0, 0, 0.38)"
|
161
|
+
"blackTextBoxText":"rgba(0, 0, 0, 0.38)",
|
162
|
+
"whiteColor": "rgba(255, 255, 255, 1)",
|
163
|
+
"phasesSectionBorderColor": "rgba(186, 201, 255, 1)",
|
164
|
+
"optionColor": "rgb(13, 71, 161)",
|
165
|
+
"borderColor": "rgb(205, 205, 206)",
|
166
|
+
"buttonHoverColor": "rgb(68, 0, 211)",
|
167
|
+
"tableRowHoverColor": "rgba(0, 0, 0, 0.04)",
|
168
|
+
"dialogBoxBoxShadow": "rgba(0, 0, 0, 0.25)",
|
169
|
+
"desktopMobileViewtoggleButtonSelectedBg": "rgb(227, 242, 253)"
|
161
170
|
},
|
162
171
|
"fontSize": {
|
163
172
|
"extraSmall": "10px",
|
Binary file
|
Binary file
|
Binary file
|
@@ -59,29 +59,7 @@ const steps = {
|
|
59
59
|
}
|
60
60
|
|
61
61
|
const tests = {
|
62
|
-
|
63
|
-
it('\'Background image\' label should be visible', () => {
|
64
|
-
if (questionType === 'graphing') {
|
65
|
-
utilities.verifyInnerText(backgroundImageUploadComponent.backgroundImageLabel(), 'Background');
|
66
|
-
} else {
|
67
|
-
utilities.verifyInnerText(backgroundImageUploadComponent.backgroundImageLabel(), 'Background image');
|
68
|
-
}
|
69
|
-
});
|
70
|
-
|
71
|
-
it('\'Upload\' label and \'Choose file\' button should be displayed', () => {
|
72
|
-
utilities.verifyInnerText(backgroundImageUploadComponent.uploadLabel(), 'Upload');
|
73
|
-
utilities.verifyElementVisibilityState(backgroundImageUploadComponent.uploadLabel(), 'visible');
|
74
|
-
utilities.verifyInnerText(backgroundImageUploadComponent.chooseFileButton(), 'Choose file');
|
75
|
-
utilities.verifyElementVisibilityState(backgroundImageUploadComponent.chooseFileButton(), 'visible');
|
76
|
-
});
|
77
|
-
|
78
|
-
it('\'File name\' label should be displayed and by default \'No file chosen\' text should be displayed below the \'File name\' label.', () => {
|
79
|
-
utilities.verifyInnerText(backgroundImageUploadComponent.fileNameLabel(), 'File name');
|
80
|
-
utilities.verifyElementVisibilityState(backgroundImageUploadComponent.fileNameLabel(), 'visible');
|
81
|
-
utilities.verifyInnerText(backgroundImageUploadComponent.noFileChosenLabel(), 'No file chosen');
|
82
|
-
utilities.verifyElementVisibilityState(backgroundImageUploadComponent.noFileChosenLabel(), 'visible');
|
83
|
-
});
|
84
|
-
|
62
|
+
verifyCSSAndA11yBeforeUpload: () => {
|
85
63
|
it('CSS of upload section', { tags: 'css' }, () => {
|
86
64
|
utilities.verifyCSS(backgroundImageUploadComponent.uploadLabel(), {
|
87
65
|
'color': css.color.labels,
|
@@ -109,12 +87,14 @@ const tests = {
|
|
109
87
|
it('Accessibility of Upload section before uploading image', { tags: 'a11y' }, () => {
|
110
88
|
cy.checkAccessibility(backgroundImageUploadComponent.uploadLabel().parents('.edit-question-edit-tab-wrapper'));
|
111
89
|
});
|
90
|
+
},
|
112
91
|
|
92
|
+
verifyImageUploadFunctionality: (questionType = null) => {
|
113
93
|
it('When the user adds the image file and file upload is inprogress, file name and progress bar should be displayed below \'File name\' label. Progress bar should disappear once file is uploaded and uploaded image should be displayed', () => {
|
114
94
|
backgroundImageUploadComponent.steps.uploadFile('highlightImage.jpg');
|
115
95
|
utilities.verifyElementVisibilityState(backgroundImageUploadComponent.uploadImageProgressBar(), 'visible');
|
116
96
|
backgroundImageUploadComponent.steps.verifyFileNameLabel('highlightImage.jpg');
|
117
|
-
if (
|
97
|
+
if (!['graphing', 'grid fill', 'image highlight', 'thinkSphere'].includes(questionType)) {
|
118
98
|
imageCanvasComponent.steps.verifyImageIsUploaded();
|
119
99
|
}
|
120
100
|
});
|
@@ -129,6 +109,34 @@ const tests = {
|
|
129
109
|
});
|
130
110
|
},
|
131
111
|
|
112
|
+
verifyBackgroundImageSectionContentWithCSSAndA11y: (questionType = null) => {
|
113
|
+
it('\'Background image\' label should be visible', () => {
|
114
|
+
if (questionType === 'graphing') {
|
115
|
+
utilities.verifyInnerText(backgroundImageUploadComponent.backgroundImageLabel(), 'Background');
|
116
|
+
} else {
|
117
|
+
utilities.verifyInnerText(backgroundImageUploadComponent.backgroundImageLabel(), 'Background image');
|
118
|
+
}
|
119
|
+
});
|
120
|
+
|
121
|
+
it('\'Upload\' label and \'Choose file\' button should be displayed', () => {
|
122
|
+
utilities.verifyInnerText(backgroundImageUploadComponent.uploadLabel(), 'Upload');
|
123
|
+
utilities.verifyElementVisibilityState(backgroundImageUploadComponent.uploadLabel(), 'visible');
|
124
|
+
utilities.verifyInnerText(backgroundImageUploadComponent.chooseFileButton(), 'Choose file');
|
125
|
+
utilities.verifyElementVisibilityState(backgroundImageUploadComponent.chooseFileButton(), 'visible');
|
126
|
+
});
|
127
|
+
|
128
|
+
it('\'File name\' label should be displayed and by default \'No file chosen\' text should be displayed below the \'File name\' label.', () => {
|
129
|
+
utilities.verifyInnerText(backgroundImageUploadComponent.fileNameLabel(), 'File name');
|
130
|
+
utilities.verifyElementVisibilityState(backgroundImageUploadComponent.fileNameLabel(), 'visible');
|
131
|
+
utilities.verifyInnerText(backgroundImageUploadComponent.noFileChosenLabel(), 'No file chosen');
|
132
|
+
utilities.verifyElementVisibilityState(backgroundImageUploadComponent.noFileChosenLabel(), 'visible');
|
133
|
+
});
|
134
|
+
|
135
|
+
tests.verifyCSSAndA11yBeforeUpload();
|
136
|
+
|
137
|
+
tests.verifyImageUploadFunctionality(questionType);
|
138
|
+
},
|
139
|
+
|
132
140
|
verifyDeleteImagePopupContentAndFunctionality: () => {
|
133
141
|
it('When the user hovers on \'Delete\' button, \'Delete image\' text should be displayed in tooltip', () => {
|
134
142
|
backgroundImageUploadComponent.deleteImageIcon()
|