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.
- 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/package.json +2 -2
@@ -0,0 +1,52 @@
|
|
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 fontSizeDropdownOptions = ['Tiny', 'Small', 'Default', 'Normal', 'Big', 'Huge'];
|
7
|
+
const fontSizes = ['12px', '14px', '16px', '18px', '22px', '26px'];
|
8
|
+
|
9
|
+
describe('ThinkSphere: Additional Settings accordion', () => {
|
10
|
+
before(() => {
|
11
|
+
cy.loginAs('admin');
|
12
|
+
});
|
13
|
+
|
14
|
+
describe('Additional Settings accordion', () => {
|
15
|
+
abortEarlySetup();
|
16
|
+
before(() => {
|
17
|
+
thinkSpherePage.steps.navigateToThinkSphereCreateQuestion();
|
18
|
+
cy.barsPreLoaderWait();
|
19
|
+
});
|
20
|
+
|
21
|
+
thinkSpherePage.tests.verifyAdditionalSettingsAccordionProperties();
|
22
|
+
});
|
23
|
+
|
24
|
+
describe('Additional settings: Font size contents', () => {
|
25
|
+
abortEarlySetup();
|
26
|
+
before(() => {
|
27
|
+
thinkSpherePage.steps.navigateToThinkSphereCreateQuestion();
|
28
|
+
cy.barsPreLoaderWait();
|
29
|
+
thinkSpherePage.steps.expandAdditionalSettings();
|
30
|
+
});
|
31
|
+
|
32
|
+
thinkSpherePage.tests.verifyFontSizeSectionContents();
|
33
|
+
});
|
34
|
+
|
35
|
+
describe('Additional settings: Font size functionality preview tab', () => {
|
36
|
+
abortEarlySetup();
|
37
|
+
before(() => {
|
38
|
+
thinkSpherePage.steps.navigateToThinkSphereCreateQuestion();
|
39
|
+
cy.barsPreLoaderWait();
|
40
|
+
thinkSpherePage.steps.addQuestionInstructions();
|
41
|
+
thinkSpherePage.steps.expandAdditionalSettings();
|
42
|
+
utilities.verifyElementVisibilityState(thinkSpherePage.fontSizeDropdown(), 'visible');
|
43
|
+
});
|
44
|
+
|
45
|
+
fontSizeDropdownOptions.forEach((option, fontsIndex) => {
|
46
|
+
it(`When the user selects '${option}' option from the Font Size dropdown, then font size of the preview tab should change to ${option} accordingly`, () => {
|
47
|
+
thinkSpherePage.steps.selectFontSizeOptionFromFontSizeDropdown(option);
|
48
|
+
utilities.verifyInnerText(thinkSpherePage.fontSizeDropdown(), `${option}`);
|
49
|
+
});
|
50
|
+
});
|
51
|
+
});
|
52
|
+
});
|
@@ -0,0 +1,58 @@
|
|
1
|
+
import { thinkSpherePage } from "../../../pages";
|
2
|
+
import abortEarlySetup from "../../../support/helpers/abortEarly";
|
3
|
+
import utilities from "../../../support/helpers/utilities";
|
4
|
+
|
5
|
+
const allowedQuestions = [
|
6
|
+
'multiple selection',
|
7
|
+
'single selection',
|
8
|
+
'fill in the gaps with text',
|
9
|
+
'Drawing Response',
|
10
|
+
'short text response',
|
11
|
+
'Text Entry Math'
|
12
|
+
]
|
13
|
+
describe("Create Review Item", () => {
|
14
|
+
abortEarlySetup();
|
15
|
+
before(() => {
|
16
|
+
cy.loginAs('admin');
|
17
|
+
cy.deleteThinkSphereItem('~zzz item name');
|
18
|
+
cy.createThinkSphereItem('~zzz item name');
|
19
|
+
thinkSpherePage.steps.navigateToReviewItemsPage();
|
20
|
+
})
|
21
|
+
|
22
|
+
after(() => {
|
23
|
+
cy.deleteThinkSphereItem('~zzz item name');
|
24
|
+
});
|
25
|
+
|
26
|
+
it('When the user clicks on the \'Create Question\' button then the user should be navigated to create review question page',() => {
|
27
|
+
thinkSpherePage.steps.clickOnCreateItemButton();
|
28
|
+
utilities.verifyElementVisibilityState(thinkSpherePage.selectAQuestionHeaderText(), 'visible');
|
29
|
+
})
|
30
|
+
|
31
|
+
it(`When the user lands on the create review question page, only ${allowedQuestions} should be displayed`, () => {
|
32
|
+
utilities.verifyElementCount(thinkSpherePage.resourceTypeCategory(), allowedQuestions.length);
|
33
|
+
allowedQuestions.forEach(questionType => {
|
34
|
+
utilities.verifyElementVisibilityState(thinkSpherePage.questionTypeOptionTitle(questionType), 'visible');
|
35
|
+
});
|
36
|
+
});
|
37
|
+
|
38
|
+
it('When user clicks the \'Cancel\' button then it should navigate to browse review item page', () => {
|
39
|
+
thinkSpherePage.steps.clickOnCancelCreateQuestionButton();
|
40
|
+
utilities.verifyElementVisibilityState(thinkSpherePage.browseItemPageHeader(), 'visible');
|
41
|
+
});
|
42
|
+
|
43
|
+
it('When the user creates a new review item and then saves it, it should be displayed in the thinkSphere item page', () => {
|
44
|
+
thinkSpherePage.steps.createReviewQuestion();
|
45
|
+
thinkSpherePage.steps.clickOnSaveButton();
|
46
|
+
utilities.verifyElementCount(thinkSpherePage.widgetHeaderQuestionTitle(), 2);
|
47
|
+
});
|
48
|
+
|
49
|
+
it('When a user cancels creating a review question and adds item from the item bank then the thinkSphere question and the review item selected should be displayed', () => {
|
50
|
+
thinkSpherePage.steps.clickOnDeleteButton();
|
51
|
+
thinkSpherePage.steps.clickOnAddCheckMathQuestionButton();
|
52
|
+
thinkSpherePage.steps.clickOnCreateItemButton();
|
53
|
+
thinkSpherePage.steps.clickOnCancelCreateQuestionButton();
|
54
|
+
thinkSpherePage.steps.clickOnFirstAvailableItemLink();
|
55
|
+
thinkSpherePage.steps.clickOnSaveButton();
|
56
|
+
utilities.verifyElementCount(thinkSpherePage.widgetHeaderQuestionTitle(), 2);
|
57
|
+
});
|
58
|
+
});
|
@@ -0,0 +1,366 @@
|
|
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 fileTypes = ['GIF', 'HEIC', 'HEIF', 'JPG', 'SVG', 'PNG' ];
|
7
|
+
const fileTypesString = fileTypes.toString().replaceAll(',', ', ')
|
8
|
+
const infoIconTooltipText = 'Supported file formats: ' + fileTypesString + '.';
|
9
|
+
|
10
|
+
describe('Create item : ThinkSphere - Edit tab basics', () => {
|
11
|
+
before(() => {
|
12
|
+
cy.loginAs('admin');
|
13
|
+
});
|
14
|
+
|
15
|
+
describe('Question instructions input field - Edit tab', () => {
|
16
|
+
abortEarlySetup();
|
17
|
+
before(() => {
|
18
|
+
thinkSpherePage.steps.navigateToThinkSphereCreateQuestion();
|
19
|
+
cy.barsPreLoaderWait();
|
20
|
+
});
|
21
|
+
|
22
|
+
thinkSpherePage.tests.verifyQuestionInstructionsInputFieldEditTab();
|
23
|
+
});
|
24
|
+
|
25
|
+
describe('Question instructions input field - Edit tab functionality', () => {
|
26
|
+
abortEarlySetup();
|
27
|
+
before(() => {
|
28
|
+
thinkSpherePage.steps.navigateToThinkSphereCreateQuestion();
|
29
|
+
cy.barsPreLoaderWait();
|
30
|
+
});
|
31
|
+
|
32
|
+
thinkSpherePage.tests.verifyQuestionInstructionsInputFieldThinkSpherePreviewTab();
|
33
|
+
});
|
34
|
+
|
35
|
+
describe('Question image section - Edit tab', () => {
|
36
|
+
abortEarlySetup();
|
37
|
+
before(() => {
|
38
|
+
thinkSpherePage.steps.navigateToThinkSphereCreateQuestion();
|
39
|
+
cy.barsPreLoaderWait();
|
40
|
+
});
|
41
|
+
|
42
|
+
it('\'Question Image\' Section should be present', () => {
|
43
|
+
utilities.verifyInnerText(thinkSpherePage.imageUploadSectionImageLabel(), 'Question image');
|
44
|
+
});
|
45
|
+
|
46
|
+
it('Verify CSS of \'Question Image\' Section Before Upload', { tags: 'css' }, () => {
|
47
|
+
utilities.verifyCSS(thinkSpherePage.imageUploadSectionImageLabel(), {
|
48
|
+
'color': css.color.sectionHeading,
|
49
|
+
'font-size': css.fontSize.normal,
|
50
|
+
'font-weight': css.fontWeight.semibold,
|
51
|
+
'margin-top': '16px',
|
52
|
+
'margin-bottom': '8px'
|
53
|
+
});
|
54
|
+
|
55
|
+
utilities.verifyCSS(thinkSpherePage.imageUploadSectionUploadFileContent(), {
|
56
|
+
'border-width': '1px',
|
57
|
+
'border-style': 'solid',
|
58
|
+
'border-color': 'rgb(107, 139, 255)',
|
59
|
+
'border-radius': '8px',
|
60
|
+
'padding': '30px 12px 0px'
|
61
|
+
});
|
62
|
+
});
|
63
|
+
|
64
|
+
it('Question Image area should have a Cloud icon and text \'Drag & Drop an image \'or browse image on your device\' should be displayed', () => {
|
65
|
+
utilities.verifyElementVisibilityState(thinkSpherePage.imageUploadSectionUploadCloudIconWrapper(), 'visible');
|
66
|
+
utilities.verifyInnerText(thinkSpherePage.imageUploadSectionDragDropFileText(), 'Drag & Drop an image');
|
67
|
+
utilities.verifyContainText(thinkSpherePage.imageUploadSectionFileInputLabel(), 'or browse image on your device');
|
68
|
+
});
|
69
|
+
|
70
|
+
it('Computer icon should be displayed before link texts \'device\'', () => {
|
71
|
+
thinkSpherePage.imageUploadSectionDeviceIcon().verifyPseudoClassBeforeProperty('content', '""');
|
72
|
+
});
|
73
|
+
|
74
|
+
it('\'Supported file formats\' label should be displayed along with an info icon, hovering over the Supported file formats info icon a tooltip should be displayed with list of all the selected supported file types', () => {
|
75
|
+
utilities.verifyInnerText(thinkSpherePage.imageUploadSectionSupportedFileText(), 'Supported file formats');
|
76
|
+
utilities.verifyElementVisibilityState(thinkSpherePage.imageUploadSectionSupportedFileText(), 'visible');
|
77
|
+
thinkSpherePage.imageUploadSectionSupportedFileIconWrapper()
|
78
|
+
.verifyTooltip(infoIconTooltipText);
|
79
|
+
});
|
80
|
+
|
81
|
+
it('\'Maximum file size\' label should be displayed along with the file size limit', () => {
|
82
|
+
utilities.verifyInnerText(thinkSpherePage.imageUploadSectionMaximumFileSize(), 'Maximum file size: 5MB');
|
83
|
+
});
|
84
|
+
|
85
|
+
it('Accessibility of Image Upload Section Before Upload', { tags: 'a11y' }, () => {
|
86
|
+
cy.checkAccessibility(thinkSpherePage.imageUploadSection());
|
87
|
+
});
|
88
|
+
|
89
|
+
it('When the user uploads an image, then uploaded image should be visible', () => {
|
90
|
+
thinkSpherePage.steps.uploadFile('uploads/highlightImage.jpg');
|
91
|
+
utilities.verifyElementVisibilityStateWithOption(thinkSpherePage.imageUploadSectionFileUploaderWrapper(), 'notExist', { timeout: 15000 });
|
92
|
+
utilities.verifyElementVisibilityStateWithOption(thinkSpherePage.imageUploadSectionQuestionImage(), 'exist', { timeout: 15000 });
|
93
|
+
utilities.verifyElementVisibilityStateWithOption(thinkSpherePage.iconPencil(), 'exist', { timeout: 15000 });
|
94
|
+
utilities.verifyElementVisibilityStateWithOption(thinkSpherePage.iconXCircle(), 'exist', { timeout: 15000 });
|
95
|
+
thinkSpherePage.iconPencil().verifyTooltip('Change image', { timeout: 15000 });
|
96
|
+
thinkSpherePage.iconXCircle().verifyTooltip('Delete image', { timeout: 15000 });
|
97
|
+
});
|
98
|
+
|
99
|
+
it('User is able to upload supported image types other than jpg', () => {
|
100
|
+
thinkSpherePage.steps.uploadFile('uploads/image.png');
|
101
|
+
thinkSpherePage.steps.uploadFile('uploads/sample.heic', { timeout: 1500 });
|
102
|
+
thinkSpherePage.steps.uploadFile('uploads/sample.heif', { timeout: 1500 });
|
103
|
+
thinkSpherePage.steps.uploadFile('uploads/sample.svg', { timeout: 1500 });
|
104
|
+
thinkSpherePage.steps.uploadFile('uploads/sample.gif', { timeout: 1500 });
|
105
|
+
});
|
106
|
+
|
107
|
+
it('Verify CSS of \'Question Image\' Section After Upload', { tags: 'css' }, () => {
|
108
|
+
utilities.verifyCSS(thinkSpherePage.imageUploadSectionQuestionImageContainer(), {
|
109
|
+
'border-width': '1px',
|
110
|
+
'border-style': 'solid',
|
111
|
+
'border-color': 'rgb(107, 139, 255)',
|
112
|
+
'border-radius': '8px',
|
113
|
+
'padding': '4px'
|
114
|
+
});
|
115
|
+
utilities.verifyCSS(thinkSpherePage.imageUploadSectionQuestionImageEditIcon(), {
|
116
|
+
'border-width': '1px',
|
117
|
+
'border-style': 'solid',
|
118
|
+
'border-color': 'rgb(107, 139, 255)',
|
119
|
+
'border-radius': '4px',
|
120
|
+
'width': '24px',
|
121
|
+
'height': '24px',
|
122
|
+
});
|
123
|
+
utilities.verifyCSS(thinkSpherePage.imageUploadSectionQuestionImageCrossIcon(), {
|
124
|
+
'border-width': '1px',
|
125
|
+
'border-style': 'solid',
|
126
|
+
'border-color': 'rgb(107, 139, 255)',
|
127
|
+
'border-radius': '4px',
|
128
|
+
'width': '24px',
|
129
|
+
'height': '24px',
|
130
|
+
});
|
131
|
+
});
|
132
|
+
|
133
|
+
it('Accessibility of Image Upload Section After upload', { tags: 'a11y' }, () => {
|
134
|
+
cy.checkAccessibility(thinkSpherePage.imageUploadSection(), { timeout: 15000 });
|
135
|
+
});
|
136
|
+
});
|
137
|
+
|
138
|
+
describe('Phases Section - Edit tab', () => {
|
139
|
+
abortEarlySetup();
|
140
|
+
before(() => {
|
141
|
+
thinkSpherePage.steps.navigateToThinkSphereCreateQuestion();
|
142
|
+
cy.barsPreLoaderWait();
|
143
|
+
});
|
144
|
+
|
145
|
+
it('\'Phases\' Section should be present', () => {
|
146
|
+
utilities.verifyInnerText(thinkSpherePage.phasesSectionTitle(), 'Phases');
|
147
|
+
});
|
148
|
+
|
149
|
+
it('Verify CSS of \'Phases\' Section', { tags: 'css' }, () => {
|
150
|
+
utilities.verifyCSS(thinkSpherePage.phasesSectionTitle(), {
|
151
|
+
'color': css.color.sectionHeading,
|
152
|
+
'font-size': css.fontSize.extraLarge,
|
153
|
+
'font-weight': css.fontWeight.bold,
|
154
|
+
'padding-bottom': '16px'
|
155
|
+
});
|
156
|
+
});
|
157
|
+
});
|
158
|
+
|
159
|
+
describe('WhiteBoardImageProperties - Edit tab', () => {
|
160
|
+
abortEarlySetup();
|
161
|
+
before(() => {
|
162
|
+
thinkSpherePage.steps.navigateToThinkSphereCreateQuestion();
|
163
|
+
cy.barsPreLoaderWait();
|
164
|
+
});
|
165
|
+
|
166
|
+
it('Before image upload by default the Page 1 image label and radio button component should be rendered', () => {
|
167
|
+
utilities.verifyInnerText(thinkSpherePage.pageImageTitle(), 'Page 1 image');
|
168
|
+
utilities.verifyElementVisibilityState(thinkSpherePage.radioGroupWrapper(), 'exist');
|
169
|
+
});
|
170
|
+
|
171
|
+
it('By default Blank whiteboard radio button should be checked and Image radio button should not be checked', () => {
|
172
|
+
utilities.verifyElementCheckedNotCheckedState(thinkSpherePage.blankCanvasRadioInput(), 'checked');
|
173
|
+
utilities.verifyElementCheckedNotCheckedState(thinkSpherePage.imageRadioInput(), 'notChecked');
|
174
|
+
});
|
175
|
+
|
176
|
+
it('Before image upload by default Image upload and Image properties sections should not be visible', () => {
|
177
|
+
utilities.verifyElementVisibilityState(thinkSpherePage.imageUploadSectionWrapper(), 'notExist');
|
178
|
+
utilities.verifyElementVisibilityState(thinkSpherePage.pageImagePropertiesTitle(), 'notExist');
|
179
|
+
});
|
180
|
+
|
181
|
+
it('Before image upload clicking on image radio button should make Image upload and Image properties sections visible', () => {
|
182
|
+
thinkSpherePage.steps.clickOnImageRadioButton();
|
183
|
+
utilities.verifyElementVisibilityState(thinkSpherePage.imageUploadSectionWrapper(), 'exist');
|
184
|
+
utilities.verifyElementVisibilityState(thinkSpherePage.pageImagePropertiesTitle(), 'exist');
|
185
|
+
});
|
186
|
+
|
187
|
+
it('Verify image upload section', () => {
|
188
|
+
thinkSpherePage.tests.verifyUploadImageSectionContentWithCSSAndA11y();
|
189
|
+
thinkSpherePage.tests.verifyDeleteImagePopupContentAndFunctionality();
|
190
|
+
});
|
191
|
+
|
192
|
+
it('Verify that the uploaded image is visible', () => {
|
193
|
+
// Fill tests when whiteboard component is ready
|
194
|
+
});
|
195
|
+
|
196
|
+
it('\'Image alignment\' label and 3 alignment options: Top left, Center and Top right should be displayed. By default, \'Center\' should be selected', () => {
|
197
|
+
utilities.verifyInnerText(thinkSpherePage.layoutLabel(), 'Image alignment');
|
198
|
+
utilities.verifyElementVisibilityState(thinkSpherePage.alignmentOptions(), 'exist');
|
199
|
+
utilities.verifyInnerText(thinkSpherePage.topLeftButton(), 'Top left');
|
200
|
+
utilities.verifyElementVisibilityState(thinkSpherePage.topLeftButton(), 'exist');
|
201
|
+
utilities.verifyInnerText(thinkSpherePage.centerButton(), 'Center');
|
202
|
+
utilities.verifyElementVisibilityState(thinkSpherePage.centerButton(), 'exist');
|
203
|
+
utilities.verifyInnerText(thinkSpherePage.topRightButton(), 'Top right');
|
204
|
+
utilities.verifyElementVisibilityState(thinkSpherePage.topRightButton(), 'exist');
|
205
|
+
thinkSpherePage.steps.verifyCenterOptionAlignmentIsSelected();
|
206
|
+
});
|
207
|
+
|
208
|
+
it('When a new alignment option is selected, the image alignment should change', () => {
|
209
|
+
/**@TODO Add check for when a new alignment option is selected */
|
210
|
+
});
|
211
|
+
|
212
|
+
it('\'Opacity\' label, a slider and opacity input field should be displayed. By default, the slider and the input field value should be 100%', () => {
|
213
|
+
utilities.verifyInnerText(thinkSpherePage.opacityLabel(), 'Opacity');
|
214
|
+
utilities.verifyElementVisibilityState(thinkSpherePage.opacityLabel(), 'exist');
|
215
|
+
thinkSpherePage.steps.verifyOpacitySliderValue('100');
|
216
|
+
thinkSpherePage.steps.verifyOpacityInputFieldValue('100');
|
217
|
+
utilities.verifyElementVisibilityState(thinkSpherePage.opacitySlider(), 'exist');
|
218
|
+
utilities.verifyElementVisibilityState(thinkSpherePage.opacityInputField(), 'exist');
|
219
|
+
});
|
220
|
+
|
221
|
+
it('When the user changes the opacity slider value, value in the opacity input field should also change', () => {
|
222
|
+
thinkSpherePage.steps.clickOnOpacitySlider();
|
223
|
+
thinkSpherePage.steps.verifyOpacitySliderValue(50);
|
224
|
+
thinkSpherePage.steps.verifyOpacityInputFieldValue(50);
|
225
|
+
});
|
226
|
+
|
227
|
+
it('When the user changes value in the opacity input field, the slider value should also change accordingly', () => {
|
228
|
+
thinkSpherePage.steps.addInputToOpacityInputField(30);
|
229
|
+
thinkSpherePage.steps.verifyOpacityInputFieldValue(30);
|
230
|
+
thinkSpherePage.steps.verifyOpacitySliderValue(30);
|
231
|
+
});
|
232
|
+
|
233
|
+
it('When the user changes value in the opacity input field, the image opacity should change', () => {
|
234
|
+
/**@TODO Add check for when the user changes value in the opacity input field */
|
235
|
+
});
|
236
|
+
|
237
|
+
it('\'Image alternative text\' label and input field should be displayed. By default, the input field should be blank', () => {
|
238
|
+
utilities.verifyInnerText(thinkSpherePage.imageAlternativeTextLabel(), 'Image alternative text');
|
239
|
+
utilities.verifyElementVisibilityState(thinkSpherePage.imageAlternativeTextLabel(), 'exist');
|
240
|
+
thinkSpherePage.steps.verifyImageAlternativeTextInputField('');
|
241
|
+
utilities.verifyElementVisibilityState(thinkSpherePage.imageAlternativeTextInputField(), 'exist');
|
242
|
+
});
|
243
|
+
|
244
|
+
it('When the user adds the alt value, it should be availabl in the image attribute', () => {
|
245
|
+
/**@TODO Add check for when the user adds the alt value */
|
246
|
+
});
|
247
|
+
|
248
|
+
it('CSS of whiteBoard Image and Image Properties Section', { tags: 'css' }, () => {
|
249
|
+
utilities.verifyCSS(thinkSpherePage.pageImageTitle(), {
|
250
|
+
'color': css.color.labels,
|
251
|
+
'font-size': css.fontSize.normal,
|
252
|
+
'font-weight': css.fontWeight.semibold
|
253
|
+
});
|
254
|
+
utilities.verifyCSS(thinkSpherePage.imageRadioButtonParentSvg(), {
|
255
|
+
'fill': css.color.activeButtons,
|
256
|
+
});
|
257
|
+
utilities.verifyCSS(thinkSpherePage.pageImagePropertiesTitle(), {
|
258
|
+
'color': css.color.labels,
|
259
|
+
'font-size': css.fontSize.default,
|
260
|
+
'font-weight': css.fontWeight.semibold
|
261
|
+
});
|
262
|
+
utilities.verifyCSS(thinkSpherePage.layoutLabel(), {
|
263
|
+
'color': css.color.labels,
|
264
|
+
'font-size': css.fontSize.normal,
|
265
|
+
'font-weight': css.fontWeight.semibold
|
266
|
+
});
|
267
|
+
cy.log('Css of selected option button')
|
268
|
+
utilities.verifyCSS(thinkSpherePage.centerButton(), {
|
269
|
+
'color': css.color.activeButtons,
|
270
|
+
'border': `2px solid ${css.color.activeButtons}`
|
271
|
+
});
|
272
|
+
cy.log('Css of Unselected option button')
|
273
|
+
utilities.verifyCSS(thinkSpherePage.topLeftButton(), {
|
274
|
+
'color': css.color.liText,
|
275
|
+
'border': `2px solid ${css.color.figDefaultComponentBorder}`
|
276
|
+
});
|
277
|
+
utilities.verifyCSS(thinkSpherePage.opacityLabel(), {
|
278
|
+
'color': css.color.labels,
|
279
|
+
'font-size': css.fontSize.normal,
|
280
|
+
'font-weight': css.fontWeight.semibold
|
281
|
+
});
|
282
|
+
});
|
283
|
+
|
284
|
+
it('Accessibility of image canvas contents', { tags: 'a11y' }, () => {
|
285
|
+
cy.checkAccessibility(thinkSpherePage.whiteBoardImageProperties());
|
286
|
+
});
|
287
|
+
|
288
|
+
});
|
289
|
+
|
290
|
+
describe('Verify css, accessibility and functionality of edit question action buttons', () => {
|
291
|
+
before(() => {
|
292
|
+
cy.loginAs('admin');
|
293
|
+
cy.visit('/item-engine/thinksphere/browse-items');
|
294
|
+
cy.interceptGraphql('getItems');
|
295
|
+
});
|
296
|
+
|
297
|
+
it('The pencil icon should be visible, and the drag icon and more icon should not be visible in the thinkSphere Question header', () => {
|
298
|
+
thinkSpherePage.steps.clickOnEditThinkSphereItem();
|
299
|
+
thinkSpherePage.steps.clearQuestionInstructionsInputField();
|
300
|
+
thinkSpherePage.steps.clickOnSaveQuestionButton();
|
301
|
+
utilities.verifyElementVisibilityState(thinkSpherePage.dragIcon(), 'notExist');
|
302
|
+
utilities.verifyElementVisibilityState(thinkSpherePage.moreOptionsIcon(), 'notExist');
|
303
|
+
utilities.verifyElementVisibilityState(thinkSpherePage.ThinkSphereQuestionHeaderPencilIcon(), 'exist');
|
304
|
+
});
|
305
|
+
|
306
|
+
it('When the user selects an item from the review item bank and saves it, the item should be displayed in the thinkSphere item page',() => {
|
307
|
+
thinkSpherePage.steps.clickOnAddCheckMathQuestionButton();
|
308
|
+
thinkSpherePage.steps.clickOnFirstAvailableItemLink();
|
309
|
+
thinkSpherePage.steps.clickOnSaveButton();
|
310
|
+
utilities.verifyElementCount(thinkSpherePage.widgetHeaderQuestionTitle(), 2);
|
311
|
+
});
|
312
|
+
|
313
|
+
it('The swap icon, pencil icon and delete should be visible in the thinkSphere math question header', () => {
|
314
|
+
utilities.verifyElementVisibilityState(thinkSpherePage.ThinkSphereMathQuestionHeaderSwapIcon(), 'exist');
|
315
|
+
thinkSpherePage.ThinkSphereMathQuestionHeaderSwapIcon().verifyTooltip('Swap');
|
316
|
+
utilities.verifyElementVisibilityState(thinkSpherePage.ThinkSphereMathQuestionHeaderPencilIcon(), 'exist');
|
317
|
+
thinkSpherePage.ThinkSphereMathQuestionHeaderPencilIcon().verifyTooltip('Edit');
|
318
|
+
utilities.verifyElementVisibilityState(thinkSpherePage.thinkSphereMathQuestionHeaderDeleteIcon(), 'exist');
|
319
|
+
thinkSpherePage.thinkSphereMathQuestionHeaderDeleteIcon().verifyTooltip('Delete');
|
320
|
+
});
|
321
|
+
|
322
|
+
it('Verify CSS of swap, pencil and delete icons', () => {
|
323
|
+
utilities.verifyCSS(thinkSpherePage.ThinkSphereQuestionHeaderPencilIcon(), {
|
324
|
+
'padding': '5px',
|
325
|
+
});
|
326
|
+
utilities.verifyCSS(thinkSpherePage.ThinkSphereQuestionHeaderPencilIcon().parent(), {
|
327
|
+
'margin-right': '11px',
|
328
|
+
});
|
329
|
+
utilities.verifyCSS(thinkSpherePage.ThinkSphereMathQuestionHeaderSwapIcon(), {
|
330
|
+
'padding': '5px',
|
331
|
+
});
|
332
|
+
utilities.verifyCSS(thinkSpherePage.ThinkSphereMathQuestionHeaderSwapIcon().parent(), {
|
333
|
+
'margin-right': '6px',
|
334
|
+
});
|
335
|
+
utilities.verifyCSS(thinkSpherePage.ThinkSphereMathQuestionHeaderPencilIcon(), {
|
336
|
+
'padding': '5px',
|
337
|
+
});
|
338
|
+
utilities.verifyCSS(thinkSpherePage.ThinkSphereMathQuestionHeaderPencilIcon().parent(), {
|
339
|
+
'margin-right': '6px',
|
340
|
+
});
|
341
|
+
utilities.verifyCSS(thinkSpherePage.thinkSphereMathQuestionHeaderDeleteIcon(), {
|
342
|
+
'padding': '5px',
|
343
|
+
});
|
344
|
+
utilities.verifyCSS(thinkSpherePage.thinkSphereMathQuestionHeaderDeleteIcon().parent(), {
|
345
|
+
'margin-right': '11px',
|
346
|
+
});
|
347
|
+
});
|
348
|
+
|
349
|
+
it('Accessibility of icons', { tags: 'a11y' }, () => {
|
350
|
+
cy.checkAccessibility(thinkSpherePage.ThinkSphereMathQuestionHeaderSwapIcon());
|
351
|
+
cy.checkAccessibility(thinkSpherePage.thinkSphereMathQuestionHeaderDeleteIcon());
|
352
|
+
});
|
353
|
+
|
354
|
+
it(`Clicking on swap icon should take us to Add 'Check your math' question`, () => {
|
355
|
+
thinkSpherePage.steps.clickOnSwapButton();
|
356
|
+
utilities.verifyElementVisibilityState(thinkSpherePage.AddCheckMathQuestionHeader(), 'exist');
|
357
|
+
thinkSpherePage.steps.clickOnFirstAvailableItemLink();
|
358
|
+
thinkSpherePage.steps.clickOnSaveButton();
|
359
|
+
});
|
360
|
+
|
361
|
+
it('Clicking on delete icon should remove the math question', () => {
|
362
|
+
thinkSpherePage.steps.clickOnDeleteButton();
|
363
|
+
utilities.verifyElementVisibilityState(thinkSpherePage.thinkSphereMathQuestionHeaderDeleteIcon(), 'notExist');
|
364
|
+
});
|
365
|
+
});
|
366
|
+
});
|
@@ -0,0 +1,26 @@
|
|
1
|
+
import { thinkSpherePage } from '../../../pages/thinkSpherePage';
|
2
|
+
|
3
|
+
describe('Edit Question and edit item', () => {
|
4
|
+
before(() => {
|
5
|
+
cy.loginAs('admin');
|
6
|
+
cy.deleteThinkSphereItem('~zzz item name');
|
7
|
+
cy.createThinkSphereItem('~zzz item name');
|
8
|
+
cy.visit('/item-engine/thinksphere/browse-items');
|
9
|
+
cy.interceptGraphql('getItems');
|
10
|
+
});
|
11
|
+
|
12
|
+
describe('Edit question', () => {
|
13
|
+
it('When user edits the question instructions, then the changes should be saved correctly', () => {
|
14
|
+
thinkSpherePage.steps.clickOnEditThinkSphereItem();
|
15
|
+
thinkSpherePage.steps.clearQuestionInstructionsInputField();
|
16
|
+
thinkSpherePage.steps.addTextInQuestionInstructionsInputField('Edit question instructions');
|
17
|
+
thinkSpherePage.steps.clickOnSaveQuestionButton();
|
18
|
+
});
|
19
|
+
|
20
|
+
/** @TODO Modify other fields and test the save functionality */
|
21
|
+
|
22
|
+
it('The saved questions should be displayed in the list of questions', () => {
|
23
|
+
thinkSpherePage.steps.verifyQuestionTitle('Thinksphere question');
|
24
|
+
});
|
25
|
+
});
|
26
|
+
});
|
@@ -0,0 +1,53 @@
|
|
1
|
+
import { thinkSpherePage } from "../../../pages";
|
2
|
+
import abortEarlySetup from "../../../support/helpers/abortEarly";
|
3
|
+
|
4
|
+
describe('Create item page - ThinkSphere: Question', () => {
|
5
|
+
before(() => {
|
6
|
+
cy.loginAs('admin');
|
7
|
+
});
|
8
|
+
|
9
|
+
describe('Header section contents', () => {
|
10
|
+
abortEarlySetup();
|
11
|
+
before(() => {
|
12
|
+
thinkSpherePage.steps.navigateToThinkSphereCreateQuestion();
|
13
|
+
cy.barsPreLoaderWait();
|
14
|
+
});
|
15
|
+
|
16
|
+
thinkSpherePage.tests.verifyCreateQuestionPageQuestionTypeHeader('ThinkSphere question');
|
17
|
+
});
|
18
|
+
|
19
|
+
describe('Tabs section', () => {
|
20
|
+
abortEarlySetup();
|
21
|
+
before(() => {
|
22
|
+
thinkSpherePage.steps.navigateToThinkSphereCreateQuestion();
|
23
|
+
cy.barsPreLoaderWait();
|
24
|
+
});
|
25
|
+
|
26
|
+
thinkSpherePage.tests.verifyTabsSection();
|
27
|
+
});
|
28
|
+
|
29
|
+
describe('Cancel button', () => {
|
30
|
+
abortEarlySetup();
|
31
|
+
before(() => {
|
32
|
+
thinkSpherePage.steps.navigateToThinkSphereCreateQuestion();
|
33
|
+
cy.barsPreLoaderWait();
|
34
|
+
});
|
35
|
+
|
36
|
+
thinkSpherePage.tests.verifyThinkSphereCancelButton('think sphere')
|
37
|
+
});
|
38
|
+
|
39
|
+
describe('Save Question button', () => {
|
40
|
+
abortEarlySetup();
|
41
|
+
before(() => {
|
42
|
+
thinkSpherePage.steps.navigateToThinkSphereCreateQuestion();
|
43
|
+
cy.barsPreLoaderWait();
|
44
|
+
});
|
45
|
+
|
46
|
+
it('Clicking on Save Question button the question should get saved and a snackbar with text \'Saved successfully!\' should be displayed', () => {
|
47
|
+
thinkSpherePage.steps.addTextInQuestionInstructionsInputField('Edited');
|
48
|
+
thinkSpherePage.steps.saveAQuestionAndVerifySnackbar();
|
49
|
+
});
|
50
|
+
|
51
|
+
thinkSpherePage.tests.verifySavedSuccessfullySnackbarCSSAndA11y();
|
52
|
+
});
|
53
|
+
});
|