itemengine-cypress-automation 1.0.350-feature-thinkSphere-01c175a.0 → 1.0.351-feature-thinkSphere-8768c9c.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/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,360 @@
|
|
1
|
+
import { browseItemsPage } from '../../../pages/components/browseItemsPage';
|
2
|
+
import abortEarlySetup from '../../../support/helpers/abortEarly';
|
3
|
+
import utilities from "../../../support/helpers/utilities";
|
4
|
+
const css = Cypress.env('css');
|
5
|
+
const tableHeader = ['Question', 'Last updated', 'Created on', 'Tags'];
|
6
|
+
const sortEnable = ['have.class', 'have.class', 'have.class', 'not.have.class'];
|
7
|
+
const sortDisable = ['not.have.class', 'not.have.class', 'not.have.class', 'not.have.class'];
|
8
|
+
const allowedFilterCategories = {
|
9
|
+
'Multiple choice selection': [
|
10
|
+
'multiple selection',
|
11
|
+
'single selection'
|
12
|
+
],
|
13
|
+
'Fill in the gaps': [
|
14
|
+
'fill in the gaps with text'
|
15
|
+
],
|
16
|
+
'Constructed response': [
|
17
|
+
'Drawing Response',
|
18
|
+
'short text response'
|
19
|
+
],
|
20
|
+
'Math response': [
|
21
|
+
'Text Entry Math'
|
22
|
+
]
|
23
|
+
};
|
24
|
+
|
25
|
+
describe('Navigate to Think Sphere Browse Review Items page and view the page contents', () => {
|
26
|
+
before(() => {
|
27
|
+
cy.loginAs('admin');
|
28
|
+
cy.deleteThinkSphereItem('~zzz item name');
|
29
|
+
cy.createThinkSphereItem('~zzz item name');
|
30
|
+
browseItemsPage.steps.navigateToReviewItemsPage();
|
31
|
+
});
|
32
|
+
|
33
|
+
after(() => {
|
34
|
+
cy.deleteThinkSphereItem('~zzz item name');
|
35
|
+
});
|
36
|
+
|
37
|
+
describe('\'Browse ThinkSphere Review Items\' page header section', () => {
|
38
|
+
abortEarlySetup();
|
39
|
+
|
40
|
+
it('\'Browse ThinkSphere Review Items\' page header section present', () => {
|
41
|
+
utilities.verifyElementVisibilityState(browseItemsPage.browseItemPageHeaderActionWrapper(), 'exist')
|
42
|
+
utilities.verifyInnerText(browseItemsPage.browseItemPageHeader(), 'Add \'Check your math\' question');
|
43
|
+
utilities.verifyInnerText(browseItemsPage.buttonCancelCreateQuestion(), 'Cancel');
|
44
|
+
utilities.verifyInnerText(browseItemsPage.buttonCreateItem(), 'Create question');
|
45
|
+
});
|
46
|
+
|
47
|
+
it('When user clicks on \'Browse ThinkSphere Review Items\' create item button, then it should navigate to think sphere create item page', () => {
|
48
|
+
/**@TODO Add check for when user click on browse thinksphere review items create item button */
|
49
|
+
});
|
50
|
+
|
51
|
+
it('CSS of \'Browse ThinkSphere Review Items\' page header section', { tags: 'css' }, () => {
|
52
|
+
utilities.verifyCSS(browseItemsPage.browseItemPageHeaderActionWrapper(), {
|
53
|
+
'border-bottom': `1px solid ${css.color.secondaryBtnBorder}`,
|
54
|
+
'padding': '16px'
|
55
|
+
});
|
56
|
+
utilities.verifyCSS(browseItemsPage.browseItemPageHeader(), {
|
57
|
+
'color': css.color.secondaryBtn,
|
58
|
+
'font-size': css.fontSize.heading,
|
59
|
+
'font-weight': css.fontWeight.bold
|
60
|
+
});
|
61
|
+
utilities.verifyCSS(browseItemsPage.buttonCreateItem(), {
|
62
|
+
'background-color': css.color.primaryBtnBg,
|
63
|
+
'padding': '12px 16px'
|
64
|
+
});
|
65
|
+
utilities.verifyCSS(browseItemsPage.createItemButtonTypography(), {
|
66
|
+
'color': css.color.primaryBtn,
|
67
|
+
'font-size': css.fontSize.default,
|
68
|
+
'font-weight': css.fontWeight.semibold
|
69
|
+
});
|
70
|
+
utilities.verifyCSS(browseItemsPage.buttonCancelCreateQuestion(), {
|
71
|
+
'background-color': css.color.transparent,
|
72
|
+
'padding': '12px 16px'
|
73
|
+
});
|
74
|
+
utilities.verifyCSS(browseItemsPage.createQuestionCancelButtonTypography(), {
|
75
|
+
'color': css.color.secondaryBtn,
|
76
|
+
'font-size': css.fontSize.default,
|
77
|
+
'font-weight': css.fontWeight.semibold
|
78
|
+
});
|
79
|
+
|
80
|
+
cy.log('CSS of \'Browse ThinkSphere Review Items\' page header section create question button in hover state');
|
81
|
+
browseItemsPage.steps.hoverOnCreateItemButton();
|
82
|
+
utilities.verifyCSS(browseItemsPage.buttonCreateItem(), {
|
83
|
+
'background-color': css.color.buttonHoverColor,
|
84
|
+
'box-shadow': `${css.color.secondaryBtn} 0px 3px 0px 0px`
|
85
|
+
});
|
86
|
+
utilities.verifyCSS(browseItemsPage.createItemButtonTypography(), {
|
87
|
+
'color': css.color.primaryBtn
|
88
|
+
});
|
89
|
+
});
|
90
|
+
|
91
|
+
it('Accessibility of create question button and cancel button', { tags: 'a11y' }, () => {
|
92
|
+
cy.checkAccessibility(browseItemsPage.headerActionButtonWrapper());
|
93
|
+
});
|
94
|
+
});
|
95
|
+
|
96
|
+
describe('\'Browse ThinkSphere Review Items\' list table section columns headers', () => {
|
97
|
+
abortEarlySetup();
|
98
|
+
it('The column headers should be present in the listing table header', () => {
|
99
|
+
browseItemsPage.steps.verifyColumnHeadersInListingTable(tableHeader);
|
100
|
+
});
|
101
|
+
|
102
|
+
it('The column headers should have sort enable', () => {
|
103
|
+
browseItemsPage.steps.verifySortEnableDisableForTableColumnHeader(sortEnable);
|
104
|
+
browseItemsPage.steps.verifyTableSortDescendingByDefault();
|
105
|
+
});
|
106
|
+
|
107
|
+
it('When user clicks on the column name list data should updated in Ascending and in descending order', () => {
|
108
|
+
tableHeader.slice(0, 3).forEach((_, count) => {
|
109
|
+
browseItemsPage.steps.verifySortFunctionalityOnColumnHeaderClick(count);
|
110
|
+
});
|
111
|
+
browseItemsPage.steps.verifySortFunctionalityOnColumnHeaderClick(1);
|
112
|
+
});
|
113
|
+
|
114
|
+
it('When only one search result is present, then column sort should be disabled', () => {
|
115
|
+
/**@TODO Add check for when only one search result is present */
|
116
|
+
});
|
117
|
+
|
118
|
+
it('CSS of \'Browse ThinkSphere Review Items\' list table section', { tags: 'css' }, () => {
|
119
|
+
tableHeader.forEach((_, count) => {
|
120
|
+
utilities.verifyCSS(browseItemsPage.tableColumnHeaderBrowseItemWrapperDiv(count), {
|
121
|
+
'color': css.color.primaryBtnBorder,
|
122
|
+
'font-size': css.fontSize.default,
|
123
|
+
'font-weight': css.fontWeight.bold
|
124
|
+
});
|
125
|
+
utilities.verifyCSS(browseItemsPage.tableColumnHeader(count).parent().parent(), {
|
126
|
+
'background-color': css.color.optionsBg,
|
127
|
+
});
|
128
|
+
});
|
129
|
+
utilities.verifyCSS(browseItemsPage.iconSortDescending(), {
|
130
|
+
'fill': css.color.primaryBtnBg
|
131
|
+
});
|
132
|
+
});
|
133
|
+
});
|
134
|
+
|
135
|
+
describe('\'Browse ThinkSphere Review Items\' list table rows section', () => {
|
136
|
+
abortEarlySetup();
|
137
|
+
browseItemsPage.tests.verifyItemListTableRows();
|
138
|
+
/**@TODO Verify item fields after review item creation*/
|
139
|
+
});
|
140
|
+
|
141
|
+
describe('\'Browse ThinkSphere Review Items\' search section', () => {
|
142
|
+
abortEarlySetup();
|
143
|
+
it('Search bar component should be present', () => {
|
144
|
+
browseItemsPage.steps.verifySearchBarComponent();
|
145
|
+
browseItemsPage.steps.verifySearchIcon();
|
146
|
+
browseItemsPage.steps.verifyCloseIcon();
|
147
|
+
});
|
148
|
+
|
149
|
+
it('CSS of search bar component', { tags: 'css' }, () => {
|
150
|
+
utilities.verifyCSS(browseItemsPage.searchBar().parent(), {
|
151
|
+
'background-color': css.color.progressBarRemainingFill,
|
152
|
+
'border': `1px solid ${css.color.figDefaultComponentBorder}`,
|
153
|
+
'border-radius': '50px',
|
154
|
+
'padding': '0px 8px'
|
155
|
+
});
|
156
|
+
utilities.verifyCSS(browseItemsPage.buttonSearchSVG(), {
|
157
|
+
'fill': css.color.primaryBtnBorder,
|
158
|
+
'height': '18px',
|
159
|
+
'width': '18px'
|
160
|
+
});
|
161
|
+
});
|
162
|
+
|
163
|
+
it('When user types title/tags/content in search component and search, then it should search', () => {
|
164
|
+
/**@TODO Add check for when user types title/tags/content in search component and search */
|
165
|
+
});
|
166
|
+
|
167
|
+
it('CSS of search bar in hover state', { tags: 'css' }, () => {
|
168
|
+
browseItemsPage.steps.hoverOnSearchBarComponent();
|
169
|
+
utilities.verifyCSS(browseItemsPage.searchBar().parent(), {
|
170
|
+
'background-color': css.color.primaryBtn,
|
171
|
+
});
|
172
|
+
});
|
173
|
+
|
174
|
+
it('Accessibility of search bar component', { tags: 'a11y' }, () => {
|
175
|
+
cy.checkAccessibility(browseItemsPage.itemListFilterWrapper());
|
176
|
+
});
|
177
|
+
});
|
178
|
+
|
179
|
+
describe('\'Browse ThinkSphere Review Items\' pagination section', () => {
|
180
|
+
abortEarlySetup();
|
181
|
+
it('Pagination section should be present', () => {
|
182
|
+
browseItemsPage.steps.verifyPaginationSection();
|
183
|
+
browseItemsPage.steps.verifyPaginationCount('1 - 20 of');
|
184
|
+
browseItemsPage.steps.verifyItemsOnPage(20);
|
185
|
+
});
|
186
|
+
|
187
|
+
it('CSS of \'Browse ThinkSphere Review Items\' pagination section', { tags: 'css' }, () => {
|
188
|
+
utilities.verifyCSS(utilities.getNthElement(browseItemsPage.paginationCountText(), 0), {
|
189
|
+
'color': css.color.labels,
|
190
|
+
'font-size': css.fontSize.small,
|
191
|
+
'font-weight': css.fontWeight.regular
|
192
|
+
});
|
193
|
+
utilities.getNthElement(browseItemsPage.paginationBlock(), 0)
|
194
|
+
.within(() => {
|
195
|
+
utilities.verifyCSS(browseItemsPage.buttonNext(), {
|
196
|
+
'box-shadow': `${css.color.secondaryBtnBorder} 0px 5px 0px 0px`,
|
197
|
+
'border': `1px solid ${css.color.secondaryBtnBorder}`,
|
198
|
+
'color': css.color.secondaryBtn,
|
199
|
+
'padding': '7px'
|
200
|
+
});
|
201
|
+
utilities.verifyCSS(browseItemsPage.buttonPrevious(), {
|
202
|
+
'opacity': '0.5',
|
203
|
+
'border': `1px solid ${css.color.secondaryBtnBorder}`,
|
204
|
+
'color': css.color.secondaryBtn,
|
205
|
+
'padding': '7px'
|
206
|
+
});
|
207
|
+
});
|
208
|
+
});
|
209
|
+
|
210
|
+
it('When user clicks on the next page button, then it should display the next page data', () => {
|
211
|
+
browseItemsPage.steps.clickOnNextPageButton();
|
212
|
+
browseItemsPage.steps.verifyPaginationCount('21 - 40 of');
|
213
|
+
browseItemsPage.steps.clickOnPreviousPageButton();
|
214
|
+
browseItemsPage.steps.verifyPaginationCount('1 - 20 of');
|
215
|
+
});
|
216
|
+
|
217
|
+
it('CSS of pagination section next button in hover state', { tags: 'css' }, () => {
|
218
|
+
browseItemsPage.steps.hoverOnNextPageButton();
|
219
|
+
utilities.getNthElement(browseItemsPage.paginationBlock(), 0)
|
220
|
+
.within(() => {
|
221
|
+
utilities.verifyCSS(browseItemsPage.buttonNext(), {
|
222
|
+
'border-color': css.color.primaryBtnBg,
|
223
|
+
'box-shadow': `${css.color.primaryBtnBg} 0px 3px 0px 0px`
|
224
|
+
});
|
225
|
+
});
|
226
|
+
});
|
227
|
+
|
228
|
+
it('Accessibility of pagination block', { tags: 'a11y' }, () => {
|
229
|
+
cy.checkAccessibility(browseItemsPage.paginationBlock());
|
230
|
+
});
|
231
|
+
});
|
232
|
+
|
233
|
+
describe('Browse Review Items Filter Section', () => {
|
234
|
+
abortEarlySetup();
|
235
|
+
beforeEach(() => {
|
236
|
+
cy.setGraphqlWait();
|
237
|
+
});
|
238
|
+
const categories = Object.keys(allowedFilterCategories);
|
239
|
+
it('Filter button should be displayed with text \'Filter\'', () => {
|
240
|
+
utilities.verifyContainText(browseItemsPage.filterButton(), 'Filter');
|
241
|
+
});
|
242
|
+
|
243
|
+
it('Filter section should be closed by default', () => {
|
244
|
+
utilities.verifyInnerText(browseItemsPage.filterButtonText(), '(show)');
|
245
|
+
});
|
246
|
+
|
247
|
+
it('Filter section should open when filter button is clicked', () => {
|
248
|
+
browseItemsPage.steps.toggleFilterSection();
|
249
|
+
utilities.verifyInnerText(browseItemsPage.filterButtonText(), '(hide)');
|
250
|
+
});
|
251
|
+
|
252
|
+
it('Filter section should have only allowed filter categories and items', () => {
|
253
|
+
utilities.verifyElementCount(browseItemsPage.filterCategories(), categories.length);
|
254
|
+
categories.forEach((category) => {
|
255
|
+
browseItemsPage.steps.clickOnFilterCategory(category);
|
256
|
+
allowedFilterCategories[category].forEach((item) => {
|
257
|
+
utilities.verifyElementVisibilityState(browseItemsPage.filterItem(item), 'exist');
|
258
|
+
});
|
259
|
+
});
|
260
|
+
});
|
261
|
+
|
262
|
+
|
263
|
+
it('User should be able to apply filters by selecting the checkboxes and filter chips should be displayed', () => {
|
264
|
+
browseItemsPage.steps.clickOnFilterCategoryCheckbox(categories[0]);
|
265
|
+
cy.pageLoadWait();
|
266
|
+
utilities.verifyElementVisibilityState(browseItemsPage.filterSection(), 'exist');
|
267
|
+
utilities.verifyElementVisibilityState(browseItemsPage.filterChip(categories[0]), 'exist');
|
268
|
+
allowedFilterCategories[categories[0]].forEach((item) => {
|
269
|
+
utilities.verifyElementVisibilityState(browseItemsPage.filterChip(item), 'exist');
|
270
|
+
});
|
271
|
+
});
|
272
|
+
|
273
|
+
it('Filter chips should display a \'X\' button to remove the applied filter', () => {
|
274
|
+
utilities.verifyElementVisibilityState(browseItemsPage.filterChipCancelButton(categories[0]), 'exist');
|
275
|
+
allowedFilterCategories[categories[0]].forEach((item) => {
|
276
|
+
utilities.verifyElementVisibilityState(browseItemsPage.filterChipCancelButton(item), 'exist');
|
277
|
+
});
|
278
|
+
});
|
279
|
+
|
280
|
+
it('CSS of filter chips', { tags: 'css' }, () => {
|
281
|
+
utilities.verifyCSS(browseItemsPage.filterChip(categories[0]), {
|
282
|
+
'color': css.color.secondaryBtn,
|
283
|
+
'font-size': css.fontSize.default,
|
284
|
+
'font-weight': css.fontWeight.regular,
|
285
|
+
'background-color': css.color.successBtnBg
|
286
|
+
});
|
287
|
+
allowedFilterCategories[categories[0]].forEach((item) => {
|
288
|
+
utilities.verifyCSS(browseItemsPage.filterChip(item), {
|
289
|
+
'color': css.color.secondaryBtn,
|
290
|
+
'font-size': css.fontSize.default,
|
291
|
+
'font-weight': css.fontWeight.regular,
|
292
|
+
'background-color': css.color.successBtnBg
|
293
|
+
});
|
294
|
+
});
|
295
|
+
});
|
296
|
+
|
297
|
+
it('The assessment with the applied filter should get filtered in the details table', () => {
|
298
|
+
/**@TODO Add check for the most recent item created */
|
299
|
+
});
|
300
|
+
|
301
|
+
it('Applied filters should persist after applying sort', () => {
|
302
|
+
/**@TODO Add check for the most recent item created */
|
303
|
+
});
|
304
|
+
|
305
|
+
it('If the user clicks on the \'X\' button it should clear the applied filter chip', () => {
|
306
|
+
browseItemsPage.steps.clickOnFilterChipCancelButton(categories[0]);
|
307
|
+
allowedFilterCategories[categories[0]].forEach((item) => {
|
308
|
+
utilities.verifyElementVisibilityState(browseItemsPage.filterChip(item), 'notExist');
|
309
|
+
});
|
310
|
+
cy.pageLoadWait();
|
311
|
+
utilities.verifyElementVisibilityState(browseItemsPage.filterChip(categories[0]), 'notExist');
|
312
|
+
});
|
313
|
+
|
314
|
+
it('The checkbox for that chip in the filter panel should get unchecked', () => {
|
315
|
+
utilities.verifyElementCheckedNotCheckedState(browseItemsPage.filterCategoryCheckbox(categories[0]), 'notChecked');
|
316
|
+
allowedFilterCategories[categories[0]].forEach((item) => {
|
317
|
+
utilities.verifyElementCheckedNotCheckedState(browseItemsPage.filterItem(item), 'notChecked');
|
318
|
+
});
|
319
|
+
});
|
320
|
+
|
321
|
+
it('CLEAR ALL button should be present beside the Applied Filters text', () => {
|
322
|
+
browseItemsPage.steps.clickOnFilterCategoryCheckbox(categories[0]);
|
323
|
+
cy.pageLoadWait();
|
324
|
+
utilities.verifyElementVisibilityState(browseItemsPage.filterChipClearAll(), 'exist');
|
325
|
+
});
|
326
|
+
|
327
|
+
it('If a user clicks on CLEAR ALL button, it should clear all the applied filters', () => {
|
328
|
+
browseItemsPage.steps.clickOnFilterChipClearAll();
|
329
|
+
cy.pageLoadWait();
|
330
|
+
utilities.verifyElementVisibilityState(browseItemsPage.filterChip(categories[0]), 'notExist');
|
331
|
+
allowedFilterCategories[categories[0]].forEach((item) => {
|
332
|
+
utilities.verifyElementVisibilityState(browseItemsPage.filterChip(item), 'notExist');
|
333
|
+
});
|
334
|
+
});
|
335
|
+
|
336
|
+
it('The items should get updated in the listing table', () => {
|
337
|
+
/**@TODO Add check for the most recent item created */
|
338
|
+
});
|
339
|
+
|
340
|
+
it('The applied filter options should get cleared from the filter panel', () => {
|
341
|
+
utilities.verifyElementCheckedNotCheckedState(browseItemsPage.filterCategoryCheckbox(categories[0]), 'notChecked');
|
342
|
+
allowedFilterCategories[categories[0]].forEach((item) => {
|
343
|
+
utilities.verifyElementCheckedNotCheckedState(browseItemsPage.filterItem(item), 'notChecked');
|
344
|
+
});
|
345
|
+
});
|
346
|
+
|
347
|
+
it('CSS of Filter section', { tags: 'css' }, () => {
|
348
|
+
utilities.verifyCSS(browseItemsPage.filterButton(), {
|
349
|
+
'color': css.color.secondaryBtn,
|
350
|
+
'font-size': css.fontSize.default,
|
351
|
+
'font-weight': css.fontWeight.semibold,
|
352
|
+
'background-color': css.color.transparent
|
353
|
+
});
|
354
|
+
});
|
355
|
+
|
356
|
+
it('Accessibility of Filter section', { tags: 'a11y' }, () => {
|
357
|
+
cy.checkAccessibility(browseItemsPage.filterSection());
|
358
|
+
});
|
359
|
+
});
|
360
|
+
});
|