itemengine-cypress-automation 1.0.348 → 1.0.350-feature-thinkSphere-01c175a.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.
@@ -0,0 +1,216 @@
1
+ import { thinkSpherePage } from "../../../pages";
2
+ import abortEarlySetup from "../../../support/helpers/abortEarly";
3
+ import utilities from "../../../support/helpers/utilities";
4
+ const css = Cypress.env('css');
5
+
6
+ const planPhaseSectionDescriptionText = "Select and edit sentence starters and strategies for students to use in their planning journal. You can select up to five strategies and five sentence starters.";
7
+ const strategiesTextDefault = [
8
+ 'Create a model',
9
+ 'Look for a pattern',
10
+ 'Guess, check, and revise',
11
+ 'Try with friendlier numbers',
12
+ 'Show with an equation'
13
+ ];
14
+ const sentenceStartersTextDefault = [
15
+ 'The strategy I’m going to use is',
16
+ 'First, I will',
17
+ 'Secondly, I will',
18
+ 'I will check my work by',
19
+ 'If my strategy is not working, I will'
20
+ ];
21
+ describe('Create item : ThinkSphere Question - Plan Phases Section',() => {
22
+ before(() => {
23
+ cy.loginAs('admin');
24
+ });
25
+ describe('Create item : ThinkSphere Question - Plan Phases Section - Edit tab', () => {
26
+ abortEarlySetup();
27
+ before(() => {
28
+ thinkSpherePage.steps.navigateToThinkSphereCreateQuestion();
29
+ cy.barsPreLoaderWait();
30
+ });
31
+
32
+ it('\'Plan Phase\' Section should be present', () => {
33
+ utilities.verifyInnerText(thinkSpherePage.planPhaseAccordianLabel(), 'Plan');
34
+ });
35
+
36
+ it('\'Plan Phase\' Section accordian should be expanded initially', () => {
37
+ thinkSpherePage.steps.verifyAccordianCollapsed('plan', false);
38
+ thinkSpherePage.steps.clickOnAccordian('plan');
39
+ });
40
+
41
+ it('Verify CSS of \'Plan Phase\' Section accordian collapsed state', { tags: 'css' }, () => {
42
+ utilities.verifyCSS(thinkSpherePage.planPhaseAccordian(), {
43
+ 'padding': '17px 0px 17px 12px',
44
+ 'background-color': css.color.primaryBtn,
45
+ });
46
+ utilities.verifyCSS(thinkSpherePage.planPhaseAccordian().parent(), {
47
+ 'border': `1px solid ${css.color.secondaryBtnBorder}`,
48
+ 'border-radius': '12px'
49
+ });
50
+ });
51
+
52
+ it('When the user click on \'Plan Phase\' Section accordion, then \'Plan Phase\' Section should be in expanded state', () => {
53
+ thinkSpherePage.steps.clickOnAccordian('plan');
54
+ thinkSpherePage.steps.verifyAccordianCollapsed('plan', false);
55
+ });
56
+
57
+ it('\'Plan Phase\' Section Description should be displayed', () => {
58
+ utilities.verifyElementVisibilityState(thinkSpherePage.planPhaseSectionDescription(), 'visible');
59
+ utilities.verifyInnerText(thinkSpherePage.planPhaseSectionDescription(), planPhaseSectionDescriptionText);
60
+ });
61
+
62
+ it('\'Plan Phase\' Section Strategies list component should be present', () => {
63
+ utilities.verifyElementVisibilityState(thinkSpherePage.planStrategySection(), 'visible');
64
+ utilities.verifyInnerText(thinkSpherePage.planStrategyListHeader(), 'Strategies');
65
+ utilities.verifyElementVisibilityState(thinkSpherePage.planStrategyListResetToDefault(), 'visible');
66
+ });
67
+
68
+ it('\'Plan Phase\' Section Sentence starters list component should be present', () => {
69
+ utilities.verifyElementVisibilityState(thinkSpherePage.planSentenceStarterSection(), 'visible');
70
+ utilities.verifyInnerText(thinkSpherePage.planSentenceStarterListHeader(), 'Sentence starters');
71
+ utilities.verifyElementVisibilityState(thinkSpherePage.planSentenceStarterListResetToDefault(), 'visible');
72
+ });
73
+
74
+
75
+ it('Verify CSS of \'Plan Phase\' Section accordian expanded state', { tags: 'css' }, () => {
76
+ utilities.verifyCSS(thinkSpherePage.planPhaseAccordian(), {
77
+ 'border-bottom': `1px solid ${css.color.secondaryBtnBorder}`,
78
+ });
79
+ utilities.verifyCSS(thinkSpherePage.planPhaseSectionDescription(), {
80
+ 'color': css.color.helperText,
81
+ 'font-size': css.fontSize.normal,
82
+ 'font-weight': css.fontWeight.regular,
83
+ 'margin-bottom': '16px',
84
+ },
85
+ );
86
+ utilities.verifyCSS(thinkSpherePage.planStrategyListHeader(), {
87
+ 'color': css.color.sectionHeading,
88
+ 'font-size': css.fontSize.normal,
89
+ 'font-weight': css.fontWeight.semibold,
90
+ });
91
+ utilities.verifyCSS(thinkSpherePage.planStrategyListResetToDefault(), {
92
+ 'color': css.color.primaryBtnBg,
93
+ 'font-size': css.fontSize.default,
94
+ 'font-weight': css.fontWeight.regular,
95
+ });
96
+ utilities.verifyCSS(thinkSpherePage.planSentenceStarterListHeader(), {
97
+ 'color': css.color.sectionHeading,
98
+ 'font-size': css.fontSize.normal,
99
+ 'font-weight': css.fontWeight.semibold,
100
+ });
101
+ utilities.verifyCSS(thinkSpherePage.planSentenceStarterListResetToDefault(), {
102
+ 'color': css.color.primaryBtnBg,
103
+ 'font-size': css.fontSize.default,
104
+ 'font-weight': css.fontWeight.regular,
105
+ });
106
+ });
107
+
108
+ describe('\'Plan Phase\' Section Strategies list component', () => {
109
+ abortEarlySetup();
110
+ thinkSpherePage.tests.verifyListSectionContents({
111
+ optionFieldsCount: 5,
112
+ optionList: strategiesTextDefault,
113
+ placeholder: 'Enter strategy name',
114
+ list: 'strategy',
115
+ });
116
+
117
+ thinkSpherePage.tests.verifyDragHandleTooltip(0);
118
+
119
+ it('When the user clicks on the \'Delete\' option button then the respective options input field should get deleted and option numeration should change accordingly', () => {
120
+ const optionsAfterDeleting = strategiesTextDefault.filter((el) => el !== strategiesTextDefault[4]);
121
+ thinkSpherePage.steps.deleteOption(4);
122
+ utilities.verifyElementCount(thinkSpherePage.optionWrapper(), 9);
123
+ optionsAfterDeleting.forEach((inputFieldText, optionIndex) => {
124
+ cy.log(optionsAfterDeleting, optionIndex, inputFieldText)
125
+ utilities.verifyTextContent(utilities.getNthElement(thinkSpherePage.listInputField(), optionIndex), inputFieldText);
126
+ });
127
+ thinkSpherePage.steps.addOption('strategy'),
128
+ thinkSpherePage.steps.addOptionText('strategy', 4, strategiesTextDefault[4]);
129
+ });
130
+
131
+ it('When only one option is present, the delete button should be in disabled state', () => {
132
+ cy.log('Deleting one more option')
133
+ const optionsToBeDeleted = strategiesTextDefault.filter((el) => el !== strategiesTextDefault[0]);
134
+
135
+ optionsToBeDeleted.forEach(() => { thinkSpherePage.steps.deleteOption(1) });
136
+ thinkSpherePage.steps.verifyDeleteOptionButtonDisabledState('strategy');
137
+ optionsToBeDeleted.forEach(() => { thinkSpherePage.steps.addOption('strategy') });
138
+ strategiesTextDefault.forEach((inputFieldText, optionIndex) => {
139
+ thinkSpherePage.steps.addOptionText('strategy', optionIndex, inputFieldText);
140
+ });
141
+ });
142
+
143
+ thinkSpherePage.tests.verifyDisabledDeleteButtonTooltip(0, 'Minimum one option is required');
144
+
145
+ thinkSpherePage.tests.verifyAddOptionFunctionality('strategy', strategiesTextDefault);
146
+
147
+ thinkSpherePage.tests.verifyEnabledDeleteButtonAndTooltip('strategy', 0);
148
+
149
+ thinkSpherePage.tests.verifyOptionsCheckboxComponent('strategy');
150
+
151
+ thinkSpherePage.tests.verifyOptionsInput('strategy');
152
+
153
+ thinkSpherePage.tests.verifyAtleastOneOptionIsRequired('strategy', strategiesTextDefault, 'Minimum one option is required');
154
+
155
+ thinkSpherePage.tests.verifyResetToDefaultFunctionality(strategiesTextDefault, 'strategy');
156
+
157
+ thinkSpherePage.tests.verifyVideoLinkComponent();
158
+
159
+ it('Accessibility of \'Plan Phase\' Section Strategies list component', { tags: 'a11y' }, () => {
160
+ cy.checkAccessibility(thinkSpherePage.planStrategySection());
161
+ });
162
+ });
163
+
164
+ describe('\'Plan Phase\' Section Sentence starters list component', () => {
165
+ abortEarlySetup();
166
+ thinkSpherePage.tests.verifyListSectionContents({
167
+ optionFieldsCount: 5,
168
+ optionList: sentenceStartersTextDefault,
169
+ placeholder: 'Enter sentence starter name',
170
+ list: 'sentenceStarter',
171
+ });
172
+
173
+ thinkSpherePage.tests.verifyDragHandleTooltip(5);
174
+
175
+ it('When the user clicks on the \'Delete\' option button then the respective options input field should get deleted and option numeration should change accordingly', () => {
176
+ const optionsAfterDeleting = sentenceStartersTextDefault.filter((el) => el !== sentenceStartersTextDefault[4]);
177
+ thinkSpherePage.steps.deleteOption(9);
178
+ utilities.verifyElementCount(thinkSpherePage.optionWrapper(), 9);
179
+ optionsAfterDeleting.forEach((inputFieldText, optionIndex) => {
180
+ cy.log(optionsAfterDeleting, optionIndex, inputFieldText)
181
+ utilities.verifyTextContent(utilities.getNthElement(thinkSpherePage.listInputField(), optionIndex + 5), inputFieldText);
182
+ });
183
+ thinkSpherePage.steps.addOption('sentenceStarter'),
184
+ thinkSpherePage.steps.addOptionText('sentenceStarter', 4, sentenceStartersTextDefault[4]);
185
+ });
186
+
187
+ it('When only one option is present, the delete button should be in disabled state', () => {
188
+ cy.log('Deleting one more option')
189
+ const optionsToBeDeleted = sentenceStartersTextDefault.filter((el) => el !== sentenceStartersTextDefault[0]);
190
+
191
+ optionsToBeDeleted.forEach(() => { thinkSpherePage.steps.deleteOption(6) });
192
+ thinkSpherePage.steps.verifyDeleteOptionButtonDisabledState('sentenceStarter');
193
+ optionsToBeDeleted.forEach(() => { thinkSpherePage.steps.addOption('sentenceStarter') });
194
+ strategiesTextDefault.forEach((inputFieldText, optionIndex) => {
195
+ thinkSpherePage.steps.addOptionText('sentenceStarter', optionIndex, inputFieldText);
196
+ });
197
+ });
198
+
199
+ thinkSpherePage.tests.verifyDisabledDeleteButtonTooltip(5, 'Minimum one option is required');
200
+
201
+ thinkSpherePage.tests.verifyAddOptionFunctionality('sentenceStarter', sentenceStartersTextDefault);
202
+
203
+ thinkSpherePage.tests.verifyEnabledDeleteButtonAndTooltip('sentenceStarter', 5);
204
+
205
+ thinkSpherePage.tests.verifyOptionsCheckboxComponent('sentenceStarter');
206
+
207
+ thinkSpherePage.tests.verifyOptionsInput('sentenceStarter');
208
+
209
+ thinkSpherePage.tests.verifyAtleastOneOptionIsRequired('sentenceStarter', sentenceStartersTextDefault, 'Minimum one option is required');
210
+
211
+ it('Accessibility of \'Plan Phase\' Section Sentence starters list component', { tags: 'a11y' }, () => {
212
+ cy.checkAccessibility(thinkSpherePage.planSentenceStarterSection());
213
+ });
214
+ });
215
+ });
216
+ })
@@ -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",
@@ -59,29 +59,7 @@ const steps = {
59
59
  }
60
60
 
61
61
  const tests = {
62
- verifyBackgroundImageSectionContentWithCSSAndA11y: (questionType = null) => {
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 (questionType !== 'graphing' && questionType !== 'grid fill' && questionType !== 'image highlight') {
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()