itemengine-cypress-automation 1.0.378 → 1.0.379-IEI-5744-eb36bb7.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.
@@ -1,3 +1,4 @@
1
+ import { thinkSpherePage } from '../../../pages';
1
2
  import { browseItemsPage } from '../../../pages/components/browseItemsPage';
2
3
  import abortEarlySetup from '../../../support/helpers/abortEarly';
3
4
  import utilities from "../../../support/helpers/utilities";
@@ -117,6 +118,8 @@ describe('Navigate to Think Sphere Browse Review Items page and view the page co
117
118
  browseItemsPage.steps.verifySortFunctionalityOnColumnHeaderClick(1);
118
119
  });
119
120
 
121
+ browseItemsPage.tests.verifySupportedQuestionsInItemsList(allowedFilterCategories);
122
+
120
123
  it('When only one search result is present, then column sort should be disabled', () => {
121
124
  /**@TODO Add check for when only one search result is present */
122
125
  });
@@ -152,6 +155,10 @@ describe('Navigate to Think Sphere Browse Review Items page and view the page co
152
155
  browseItemsPage.steps.verifyCloseIcon();
153
156
  });
154
157
 
158
+ it('Search bar should have place holder Search by title, tags and content', () => {
159
+ thinkSpherePage.steps.verifyThinkSphereSearchBarPlaceholder();
160
+ });
161
+
155
162
  it('CSS of search bar component', { tags: 'css' }, () => {
156
163
  utilities.verifyCSS(browseItemsPage.searchBar().parent(), {
157
164
  'background-color': css.color.progressBarRemainingFill,
@@ -166,15 +173,16 @@ describe('Navigate to Think Sphere Browse Review Items page and view the page co
166
173
  });
167
174
  });
168
175
 
169
- it('When user types title/tags/content in search component and search, then it should search', () => {
170
- /**@TODO Add check for when user types title/tags/content in search component and search */
176
+ it('When user hovers on the search bar, it should show the tooltip with text \'search', () => {
177
+ browseItemsPage.steps.hoverOnSearchBarComponent();
178
+ browseItemsPage.searchBarParent().verifyTooltip('Search');
171
179
  });
172
180
 
173
181
  it('CSS of search bar in hover state', { tags: 'css' }, () => {
174
182
  browseItemsPage.steps.hoverOnSearchBarComponent();
175
183
  utilities.verifyCSS(browseItemsPage.searchBar().parent(), {
176
184
  'background-color': css.color.primaryBtn,
177
- });
185
+ });
178
186
  });
179
187
 
180
188
  it('Accessibility of search bar component', { tags: 'a11y' }, () => {
@@ -213,7 +221,10 @@ describe('Navigate to Think Sphere Browse Review Items page and view the page co
213
221
  });
214
222
  });
215
223
 
216
- it('When user clicks on the next page button, then it should display the next page data', () => {
224
+ browseItemsPage.tests.verifyFirstPreviousNextPageButtons();
225
+
226
+ it('When user clicks on the next page button, then it should display the next page data and when the user clicks the previous page button, it should display the previous page data', () => {
227
+ browseItemsPage.steps.navigateToReviewItemsPage();
217
228
  browseItemsPage.steps.clickOnNextPageButton();
218
229
  browseItemsPage.steps.verifyPaginationCount('21 - 40 of');
219
230
  browseItemsPage.steps.clickOnPreviousPageButton();
@@ -250,11 +261,31 @@ describe('Navigate to Think Sphere Browse Review Items page and view the page co
250
261
  utilities.verifyInnerText(browseItemsPage.filterButtonText(), '(show)');
251
262
  });
252
263
 
253
- it('Filter section should open when filter button is clicked', () => {
264
+ it('Filter section should open when filter button is clicked and the question types accordion should be open by default', () => {
254
265
  browseItemsPage.steps.toggleFilterSection();
255
266
  utilities.verifyInnerText(browseItemsPage.filterButtonText(), '(hide)');
267
+ thinkSpherePage.steps.verifyFilterSectionExpanded();
268
+ });
269
+
270
+ it('The author should be able to close and open the question types accordion', () => {
271
+ thinkSpherePage.steps.clickOnQuestionTypesAccordion();
272
+ thinkSpherePage.steps.verifyFilterSectionCollapsed();
273
+ thinkSpherePage.steps.clickOnQuestionTypesAccordion();
274
+ thinkSpherePage.steps.verifyFilterSectionExpanded();
256
275
  });
257
276
 
277
+ it('By default, every question category accordion in the filter section should be closed and all checkboxes unchecked.', () => {
278
+ thinkSpherePage.filterSectionQuestionAccordion().each(($accordion) => {
279
+ thinkSpherePage.steps.verifyElementDoesNotHaveExpandedClass(cy.wrap($accordion));
280
+ });
281
+
282
+ thinkSpherePage.checkBox().each(($ch) => {
283
+ thinkSpherePage.steps.verifyElementDoesNotHaveCheckedClass(cy.wrap($ch));
284
+ });
285
+ });
286
+
287
+ thinkSpherePage.tests.verifyQuestionAccordion();
288
+
258
289
  it('Filter section should have only allowed filter categories and items', () => {
259
290
  utilities.verifyElementCount(browseItemsPage.filterCategories(), categories.length);
260
291
  categories.forEach((category) => {
@@ -265,7 +296,6 @@ describe('Navigate to Think Sphere Browse Review Items page and view the page co
265
296
  });
266
297
  });
267
298
 
268
-
269
299
  it('User should be able to apply filters by selecting the checkboxes and filter chips should be displayed', () => {
270
300
  browseItemsPage.steps.clickOnFilterCategoryCheckbox(categories[0]);
271
301
  cy.pageLoadWait();
@@ -324,8 +354,10 @@ describe('Navigate to Think Sphere Browse Review Items page and view the page co
324
354
  });
325
355
  });
326
356
 
357
+ browseItemsPage.tests.verifyFilterSelectionInList(categories);
358
+
327
359
  it('CLEAR ALL button should be present beside the Applied Filters text', () => {
328
- browseItemsPage.steps.clickOnFilterCategoryCheckbox(categories[0]);
360
+ browseItemsPage.steps.clickOnFilterCategoryCheckbox(categories[1]);
329
361
  cy.pageLoadWait();
330
362
  utilities.verifyElementVisibilityState(browseItemsPage.filterChipClearAll(), 'exist');
331
363
  });
@@ -12,6 +12,16 @@ const allowedQuestions = [
12
12
  'short text response',
13
13
  'Text Entry Math',
14
14
  ]
15
+
16
+ const dropDownArray = [
17
+ 'All question types',
18
+ 'Multiple choice selection',
19
+ 'Fill in the gaps',
20
+ 'Drag and drop',
21
+ 'List',
22
+ 'Constructed response',
23
+ 'Math response',
24
+ ]
15
25
  describe("Create Review Item", () => {
16
26
  abortEarlySetup();
17
27
  before(() => {
@@ -42,6 +52,49 @@ describe("Create Review Item", () => {
42
52
  utilities.verifyElementVisibilityState(thinkSpherePage.browseItemPageHeader(), 'visible');
43
53
  });
44
54
 
55
+ it('When user clicks on create question, search bar should appear with placeholder, \'Search by question and tool tip \'Search\'', () => {
56
+ thinkSpherePage.steps.clickOnCreateItemButton();
57
+ thinkSpherePage.steps.verifySearchBarComponent();
58
+ thinkSpherePage.steps.verifySearchIcon();
59
+ thinkSpherePage.steps.verifyCloseIcon();
60
+ thinkSpherePage.steps.verifyReviewItemSearchBarPlaceholder();
61
+ thinkSpherePage.steps.hoverOnSearchBarComponent();
62
+ thinkSpherePage.searchBarParent().verifyTooltip('Search');
63
+ });
64
+
65
+ it('The author should be able to type in letters numbers, special character, alpha numeric characters in the search input field.', () => {
66
+ const testInputs = [
67
+ 'abc', // letters
68
+ '123', // numbers
69
+ '!@#$%^&*()', // special characters
70
+ 'abc123XYZ', // alphanumeric
71
+ 'test@123.com' // mixed
72
+ ];
73
+
74
+ testInputs.forEach((input) => {
75
+ thinkSpherePage.steps.typeInSearchBar(input);
76
+ });
77
+ });
78
+
79
+ it('When the author types the question type in search bar, only that particular question card should be present', () => {
80
+ thinkSpherePage.steps.searchInSearchBar('single selection');
81
+ thinkSpherePage.steps.verifyLength(thinkSpherePage.cardWrapper(), 1);
82
+ utilities.verifyInnerText(thinkSpherePage.cardLabel(), 'Single selection');
83
+ });
84
+
85
+ it('Create review item page should have a categories dropdown with default value as \'All question types\'', () => {
86
+ utilities.verifyElementVisibilityState(thinkSpherePage.categoriesDropDown(), 'visible');
87
+ utilities.verifyInnerText(thinkSpherePage.categoriesDropDownLabelText(), 'All question types');
88
+ });
89
+
90
+ it(`The category dropdown should contain the following dropdown options and when any question type is clicked the cards should have those question types only `, () => {
91
+ thinkSpherePage.steps.expandDropdown();
92
+ thinkSpherePage.steps.verifyDropdownOptions(dropDownArray);
93
+ thinkSpherePage.steps.clickOnDropDownCategory(3);
94
+ utilities.verifyInnerText(thinkSpherePage.cardLabel(), 'Drag and drop into categories');
95
+ thinkSpherePage.steps.clickOnCancelButton();
96
+ });
97
+
45
98
  it('When the user creates a new review item and then saves it, it should be displayed in the thinkSphere item page', () => {
46
99
  thinkSpherePage.steps.createReviewQuestion();
47
100
  utilities.verifyElementCount(thinkSpherePage.widgetHeaderQuestionTitle(), 2);
@@ -12,6 +12,23 @@ describe('Create item : ThinkSphere - Edit tab basics', () => {
12
12
  cy.loginAs('admin');
13
13
  });
14
14
 
15
+ describe('Create thinkSphere item - create item page', () => {
16
+ abortEarlySetup();
17
+ before(() => {
18
+ cy.visit('/item-engine/thinksphere/create-item');
19
+ });
20
+
21
+ thinkSpherePage.tests.verifyCreateItemHeaderSection();
22
+
23
+ thinkSpherePage.tests.verifyDefaultTab();
24
+
25
+ it('When user clicks on Add ThinkSphere question button, it should navigate to think sphere create question page', () => {
26
+ thinkSpherePage.steps.addThinkSphereQuestion();
27
+ utilities.verifyInnerText(thinkSpherePage.thinkSphereQuestionHeader(), 'ThinkSphere question');
28
+ });
29
+
30
+ });
31
+
15
32
  describe('Question instructions input field - Edit tab', () => {
16
33
  abortEarlySetup();
17
34
  before(() => {
@@ -57,7 +74,7 @@ describe('Create item : ThinkSphere - Edit tab basics', () => {
57
74
  'border-style': 'solid',
58
75
  'border-color': 'rgb(107, 139, 255)',
59
76
  'border-radius': '8px',
60
- 'padding': '30px 12px 12px'
77
+ 'padding': '30px 9px 12px'
61
78
  });
62
79
  });
63
80
 
@@ -446,6 +463,27 @@ describe('Create item : ThinkSphere - Edit tab basics', () => {
446
463
  utilities.verifyElementVisibilityState(thinkSpherePage.ThinkSphereQuestionHeaderPencilIcon(), 'exist');
447
464
  });
448
465
 
466
+ it('When the user has saved think sphere question, \'Add \'Check your math\' question\' button should be visible',() => {
467
+ utilities.verifyInnerText(thinkSpherePage.addCheckMathQuestionButton(), 'Add \'Check your math\' question');
468
+ });
469
+
470
+ it('Verify \'Add \'Check your math\' question\' button', { tags: 'css' }, () => {
471
+ utilities.verifyCSS(thinkSpherePage.addCheckMathQuestionButton().parent(), {
472
+ 'color': css.color.primaryBtn,
473
+ 'background-color': css.color.lightThemeBtnBg,
474
+ 'font-size': css.fontSize.default,
475
+ 'font-weight': css.fontWeight.semibold,
476
+ 'padding': '12px 16px',
477
+ 'min-width': '264px',
478
+ });
479
+ });
480
+
481
+ it('When the user clicks on \'Add \'Check your math\' question button\' and click on cancel button, the user should be redirected back to the item preview page where the \'Add \'Check your math\' question\' button is available',() => {
482
+ thinkSpherePage.steps.clickOnAddCheckMathQuestionButton();
483
+ thinkSpherePage.steps.clickOnCancelButton();
484
+ utilities.verifyInnerText(thinkSpherePage.addCheckMathQuestionButton(), 'Add \'Check your math\' question');
485
+ });
486
+
449
487
  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',() => {
450
488
  thinkSpherePage.steps.clickOnAddCheckMathQuestionButton();
451
489
  thinkSpherePage.steps.clickOnFirstAvailableItemLink();
@@ -501,6 +539,13 @@ describe('Create item : ThinkSphere - Edit tab basics', () => {
501
539
  thinkSpherePage.steps.clickOnSaveButton();
502
540
  });
503
541
 
542
+
543
+ it(`Clicking on edit button icon should take us to edit question page`, () => {
544
+ thinkSpherePage.steps.clickOnEditButton();
545
+ utilities.verifyElementVisibilityState(thinkSpherePage.questionInstructionsWrapper(), 'exist');
546
+ thinkSpherePage.steps.clickOnSaveButton();
547
+ });
548
+
504
549
  it('Clicking on delete icon should remove the math question', () => {
505
550
  thinkSpherePage.steps.clickOnDeleteButton();
506
551
  utilities.verifyElementVisibilityState(thinkSpherePage.thinkSphereMathQuestionHeaderDeleteIcon(), 'notExist');