itemengine-cypress-automation 1.0.378 → 1.0.379-IEI-5744-25232c0.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,292 @@
1
+ import { equationEditorCategoriesAndSymbols } from "../../../fixtures/equationEditorCategoriesAndSymbols ";
2
+ import { thinkSpherePage } from "../../../pages";
3
+ import { editCategoryFlyout } from "../../../pages/components/editCategoryFlyout";
4
+ import abortEarlySetup from "../../../support/helpers/abortEarly";
5
+ import utilities from "../../../support/helpers/utilities";
6
+ const css = Cypress.env('css');
7
+ const defaultSelectedCategories = ['numPad', 'keyPad', 'intermediate', 'primary', 'general', 'common', 'algebra', 'geo', 'compare', 'matrices', 'setNotation', 'delimiters', 'trig', 'measurement', 'calculus', 'otherSymbols', 'greekSymbols'];
8
+
9
+ describe('Create question page - Essay Response: Edit category', () => {
10
+ before(() => {
11
+ cy.loginAs('admin');
12
+ });
13
+
14
+ describe('Edit category flyout contents', () => {
15
+ abortEarlySetup();
16
+ before(() => {
17
+ thinkSpherePage.steps.navigateToThinkSphereCreateQuestion();
18
+ thinkSpherePage.steps.expandCustomizeToolsAndControls();
19
+ thinkSpherePage.steps.selectCustomizedFormattingOption(['Equation editor']);
20
+ });
21
+
22
+ it('When user clicks on the Edit category icon below the categories in the Equation Editor section the Edit category flyout should open', () => {
23
+ editCategoryFlyout.steps.openEditCategoryFlyout();
24
+ utilities.verifyElementVisibilityState(editCategoryFlyout.dialogBox(), 'visible');
25
+ });
26
+
27
+ it('Title of the flyout should be \'Edit category\'', () => {
28
+ utilities.verifyElementVisibilityState(editCategoryFlyout.dialogBoxTitle(), 'exist');
29
+ utilities.verifyInnerText(editCategoryFlyout.dialogBoxTitle(), 'Edit category');
30
+ });
31
+
32
+ it('\'Select the symbols to display to the students.\' help text should be displayed below the title', () => {
33
+ utilities.verifyElementVisibilityState(editCategoryFlyout.selectSymbolsToDisplayLabel(), 'exist');
34
+ utilities.verifyInnerText(editCategoryFlyout.selectSymbolsToDisplayLabel(), 'Select the symbols to display to the students.');
35
+ });
36
+
37
+ it('The name of the category should be displayed in the flyout with a checked checkbox', () => {
38
+ utilities.verifyElementVisibilityState(editCategoryFlyout.categoryLabel(), 'visible');
39
+ utilities.verifyInnerText(editCategoryFlyout.categoryLabel(), `${equationEditorCategoriesAndSymbols['general'].displayName}`);
40
+ editCategoryFlyout.steps.verifyCategoryCheckboxIsChecked();
41
+ thinkSpherePage.steps.cancelCustomCategory();
42
+ });
43
+
44
+ defaultSelectedCategories.forEach((key) => {
45
+ if (key === 'numPad') {
46
+ it(`All the ${equationEditorCategoriesAndSymbols['numPad'].displayName} characters should be displayed and should be in selected state except the last three ones also each one should have necessary tooltips`, () => {
47
+ const symbolsArray = Object.values(equationEditorCategoriesAndSymbols['numPad'].symbols);
48
+ const selectedSymbolsArray = symbolsArray.slice(0, 10);
49
+ const unselectedSymbolsArray = symbolsArray.slice(-3);
50
+ editCategoryFlyout.steps.openEditCategoryFlyout(key);
51
+ thinkSpherePage.steps.verifyCategoryCharactersAndSelectedState(selectedSymbolsArray);
52
+ thinkSpherePage.steps.verifyCategoryCharactersAndUnSelectedState(unselectedSymbolsArray);
53
+ thinkSpherePage.steps.cancelCustomCategory();
54
+ });
55
+ } else if (key !== 'keyPad') {
56
+ it(`All the ${equationEditorCategoriesAndSymbols[key]?.displayName} characters should be displayed and should be in selected state also each one should have necessary tooltips`, () => {
57
+ const symbolsArray = Object.values(equationEditorCategoriesAndSymbols[key]?.symbols);
58
+ editCategoryFlyout.steps.openEditCategoryFlyout(key);
59
+ thinkSpherePage.steps.verifyCategoryCharactersAndSelectedState(symbolsArray);
60
+ editCategoryFlyout.steps.verifyCategoryCharactersDragIcon();
61
+ thinkSpherePage.steps.cancelCustomCategory();
62
+ });
63
+ }
64
+ })
65
+
66
+ it(`All the ${equationEditorCategoriesAndSymbols['numPad'].displayName} characters should be displayed and should be in selected state except the last three ones`, () => {
67
+ const symbolsArray = Object.values(equationEditorCategoriesAndSymbols['numPad'].symbols);
68
+ const selectedSymbolsArray = symbolsArray.slice(0, -3);
69
+ const unselectedSymbolsArray = symbolsArray.slice(-3);
70
+ editCategoryFlyout.steps.verifyCategoryCharactersAndSelectedState(selectedSymbolsArray);
71
+ editCategoryFlyout.steps.verifyCategoryCharactersDragIcon();
72
+ thinkSpherePage.steps.verifyCategoryCharactersAndUnSelectedState(unselectedSymbolsArray);
73
+ });
74
+
75
+ it('Reset button should be displayed in the flyout', () => {
76
+ utilities.verifyElementVisibilityState(editCategoryFlyout.buttonReset(), 'exist');
77
+ utilities.verifyInnerText(editCategoryFlyout.buttonReset(), 'Reset');
78
+ utilities.verifyElementVisibilityState(editCategoryFlyout.resetIcon(), 'exist');
79
+ });
80
+
81
+ it('\'Save\' button should be displayed in the flyout', () => {
82
+ utilities.verifyElementVisibilityState(thinkSpherePage.buttonSave(), 'visible');
83
+ utilities.verifyInnerText(thinkSpherePage.buttonSave(), 'Save');
84
+ });
85
+
86
+ it('CSS of Edit category flyout components', { tags: 'css' }, () => {
87
+ utilities.verifyCSS(editCategoryFlyout.dialogBoxTitle(), {
88
+ 'color': css.color.flyoutTitle,
89
+ 'font-size': css.fontSize.heading,
90
+ 'font-weight': css.fontWeight.semibold
91
+ });
92
+ utilities.verifyCSS(editCategoryFlyout.categoryLabel(), {
93
+ 'color': css.color.accordionLabel,
94
+ 'font-size': css.fontSize.default,
95
+ 'font-weight': css.fontWeight.bold
96
+ });
97
+ utilities.verifyCSS(editCategoryFlyout.categoryCheckbox().parents('.MuiCheckbox-root').find('svg'), {
98
+ 'fill': css.color.activeButtons
99
+ });
100
+ utilities.verifyCSS(editCategoryFlyout.selectSymbolsToDisplayLabel(), {
101
+ 'color': css.color.labels,
102
+ 'font-size': css.fontSize.normal,
103
+ 'font-weight': css.fontWeight.semibold
104
+ });
105
+ utilities.verifyCSS(editCategoryFlyout.categoryCharacters().eq(0), {
106
+ 'background-color': css.color.activeButtons
107
+ });
108
+ utilities.verifyCSS(editCategoryFlyout.characterDragIcon(), {
109
+ 'background-color': css.color.defaultBackground
110
+ });
111
+ utilities.verifyCSS(editCategoryFlyout.characterDragIcon().eq(0).find('path').eq(1), {
112
+ 'color': css.color.activeButtons,
113
+ 'font-size': css.fontSize.normal,
114
+ 'font-weight': css.fontWeight.bold
115
+ });
116
+ utilities.verifyCSS(editCategoryFlyout.characterTickIcon().eq(0).find('path').eq(1), {
117
+ 'fill': css.color.activeButtons
118
+ });
119
+ utilities.verifyCSS(thinkSpherePage.buttonSave(), {
120
+ 'color': css.color.primaryBtn,
121
+ 'font-size': css.fontSize.default,
122
+ 'font-weight': css.fontWeight.semibold,
123
+ 'background-color': css.color.primaryBtnBg
124
+ });
125
+ utilities.verifyCSS(thinkSpherePage.buttonCancel(), {
126
+ 'color': css.color.secondaryBtn,
127
+ 'font-size': css.fontSize.default,
128
+ 'font-weight': css.fontWeight.semibold,
129
+ 'background-color': css.color.transparent
130
+ });
131
+ });
132
+
133
+ it('Accessibility of Edit category flyout components', { tags: 'a11y' }, () => {
134
+ cy.checkAccessibility(editCategoryFlyout.dialogBox());
135
+ });
136
+
137
+ it('\'Cancel\' button should be displayed and on clicking it the flyout should close', () => {
138
+ utilities.verifyElementVisibilityState(thinkSpherePage.buttonCancel(), 'visible');
139
+ utilities.verifyInnerText(thinkSpherePage.buttonCancel(), 'Cancel');
140
+ thinkSpherePage.steps.cancelCustomCategory();
141
+ utilities.verifyElementVisibilityState(editCategoryFlyout.dialogBox(), 'notExist');
142
+ });
143
+ });
144
+
145
+ describe('Category checkbox validation states', () => {
146
+ abortEarlySetup();
147
+ before(() => {
148
+ thinkSpherePage.steps.navigateToThinkSphereCreateQuestion();
149
+ thinkSpherePage.steps.expandCustomizeToolsAndControls();
150
+ thinkSpherePage.steps.selectCustomizedFormattingOption(['Equation editor']);
151
+ editCategoryFlyout.steps.openEditCategoryFlyout();
152
+ });
153
+
154
+ it('When user deselects any one character by clicking on it then the category checkbox should be in partially checked state', () => {
155
+ editCategoryFlyout.steps.deselectCategoryCharacters(equationEditorCategoriesAndSymbols.general.symbols.dollar.ariaLabel);
156
+ editCategoryFlyout.steps.verifyCategoryCheckboxIsPartiallyChecked();
157
+ });
158
+
159
+ it('When user clicks on the partially checked category checkbox then all the characters should be selected', () => {
160
+ editCategoryFlyout.steps.verifyCategoryCheckboxIsPartiallyChecked();
161
+ editCategoryFlyout.steps.checkCategoryCheckbox();
162
+ editCategoryFlyout.steps.verifyAllCategoryCharactersSelected();
163
+ });
164
+
165
+ it('When user clicks on checked category checkbox then all the characters should get de-selected', () => {
166
+ editCategoryFlyout.steps.verifyCategoryCheckboxIsChecked()
167
+ editCategoryFlyout.steps.uncheckCategoryCheckbox();
168
+ editCategoryFlyout.steps.verifyAllCategoryCharactersNotSelected()
169
+ });
170
+
171
+ it('CSS of de-selected character', { tags: 'css' }, () => {
172
+ utilities.verifyCSS(editCategoryFlyout.categoryCharacters().eq(0).find('text'), {
173
+ 'color': css.color.liText,
174
+ 'font-size': css.fontSize.normal,
175
+ 'font-weight': css.fontWeight.bold,
176
+ });
177
+ utilities.verifyCSS(editCategoryFlyout.categoryCharacters().eq(0), {
178
+ 'background-color': css.color.defaultBackground
179
+ });
180
+ utilities.verifyCSS(editCategoryFlyout.categoryCharacters().eq(0).find('.drag-icon-button-custom-format'), {
181
+ 'background-color': css.color.defaultBackgrounds
182
+ });
183
+ utilities.verifyCSS(editCategoryFlyout.categoryCharacters().eq(0).find('.drag-icon-button-custom-format path').eq(1), {
184
+ 'color': css.color.secondaryBtn,
185
+ 'font-size': css.fontSize.normal,
186
+ 'font-weight': css.fontWeight.bold,
187
+ });
188
+ });
189
+
190
+ it('Accessibility of de-selected character', { tags: 'a11y' }, () => {
191
+ cy.checkAccessibility(editCategoryFlyout.categoryCharacters(0).parents('[class*="DragItemstyles__ItemContainer"]'))
192
+ });
193
+
194
+ it('When user clicks on the unchecked category checkbox then all the characters should get selected', () => {
195
+ editCategoryFlyout.steps.verifyCategoryCheckboxIsUnchecked()
196
+ editCategoryFlyout.steps.checkCategoryCheckbox();
197
+ editCategoryFlyout.steps.verifyAllCategoryCharactersSelected();
198
+ });
199
+
200
+ it('When user clicks on all the selected characters then the category checkbox should get unchecked', () => {
201
+ editCategoryFlyout.steps.verifyCategoryCheckboxIsChecked();
202
+ editCategoryFlyout.steps.deselectCategoryCharacter('QuestionMark selected');
203
+ editCategoryFlyout.steps.deselectCategoryCharacters(equationEditorCategoriesAndSymbols.general.symbols.cents.ariaLabel);
204
+ editCategoryFlyout.steps.deselectCategoryCharacters(equationEditorCategoriesAndSymbols.general.symbols.dollar.ariaLabel);
205
+ editCategoryFlyout.steps.deselectCategoryCharacters('colon');
206
+ editCategoryFlyout.steps.verifyCategoryCheckboxIsUnchecked();
207
+ });
208
+
209
+ it('When user clicks on all the de-selected characters the category checkbox should get checked', () => {
210
+ editCategoryFlyout.steps.selectCategoryCharactersUsingIndex(0);
211
+ editCategoryFlyout.steps.selectCategoryCharacters('Dollar');
212
+ editCategoryFlyout.steps.selectCategoryCharacters('Cents');
213
+ editCategoryFlyout.steps.selectCategoryCharacters('Colon');
214
+ editCategoryFlyout.steps.verifyCategoryCheckboxIsChecked();
215
+ });
216
+ });
217
+
218
+ describe('\'Reset\' button validation states', () => {
219
+ abortEarlySetup();
220
+ before(() => {
221
+ thinkSpherePage.steps.navigateToThinkSphereCreateQuestion();
222
+ thinkSpherePage.steps.expandCustomizeToolsAndControls();
223
+ thinkSpherePage.steps.selectCustomizedFormattingOption(['Equation editor']);
224
+ });
225
+
226
+ it('When user opens the Edit category flyout then the Reset button should be disabled by default', () => {
227
+ editCategoryFlyout.steps.openEditCategoryFlyout();
228
+ utilities.verifyElementDisabled(editCategoryFlyout.buttonReset());
229
+ });
230
+
231
+ it('When user de-selects any character by clicking on it then the Reset button should get enabled', () => {
232
+ editCategoryFlyout.steps.deselectCategoryCharacters(`${equationEditorCategoriesAndSymbols.general.symbols.dollar.ariaLabel}`);
233
+ utilities.verifyElementNotDisabled(editCategoryFlyout.buttonReset());
234
+ });
235
+
236
+ it('CSS of enabled Reset button', { tags: 'css' }, () => {
237
+ utilities.verifyCSS(editCategoryFlyout.buttonReset(), {
238
+ 'color': css.color.activeButtons,
239
+ 'font-size': css.fontSize.default,
240
+ 'font-weight': css.fontWeight.regular
241
+ });
242
+ });
243
+
244
+ it('Accessibility of enabled Reset button', { tags: 'a11y' }, () => {
245
+ cy.checkAccessibility(editCategoryFlyout.buttonReset());
246
+ })
247
+
248
+ it('When user clicks on the Reset button the changes should be reverted and the all the character should be selected again', () => {
249
+ editCategoryFlyout.steps.reset();
250
+ editCategoryFlyout.steps.verifyAllCategoryCharactersSelected();
251
+ });
252
+
253
+ it('When user de-selects characters and re-selects them then the Reset button should be disabled', () => {
254
+ editCategoryFlyout.steps.deselectCategoryCharacters(`${equationEditorCategoriesAndSymbols.general.symbols.dollar.ariaLabel}`);
255
+ editCategoryFlyout.steps.deselectCategoryCharacters(`${equationEditorCategoriesAndSymbols.general.symbols.cents.ariaLabel}`)
256
+ editCategoryFlyout.steps.selectCategoryCharacters(`${equationEditorCategoriesAndSymbols.general.symbols.dollar.ariaLabel}`)
257
+ editCategoryFlyout.steps.selectCategoryCharacters(`${equationEditorCategoriesAndSymbols.general.symbols.cents.ariaLabel}`)
258
+ utilities.verifyElementDisabled(editCategoryFlyout.buttonReset())
259
+ });
260
+
261
+ it('When user edits and saves the category then on opening the same Edit category flyout the \'Reset\' button should be disabled and the previously Saved changes should be displayed', () => {
262
+ editCategoryFlyout.steps.deselectCategoryCharacters(`${equationEditorCategoriesAndSymbols.general.symbols.dollar.ariaLabel}`);
263
+ editCategoryFlyout.steps.deselectCategoryCharacters(`${equationEditorCategoriesAndSymbols.general.symbols.cents.ariaLabel}`);
264
+ thinkSpherePage.steps.saveCustomCategory();
265
+ utilities.verifyElementVisibilityState(editCategoryFlyout.dialogBox(), 'notExist');
266
+ editCategoryFlyout.steps.openEditCategoryFlyout();
267
+ utilities.verifyElementDisabled(editCategoryFlyout.buttonReset());
268
+ editCategoryFlyout.steps.verifyCategoryCharacterNotSelected(`${equationEditorCategoriesAndSymbols.general.symbols.dollar.ariaLabel}`)
269
+ editCategoryFlyout.steps.verifyCategoryCharacterNotSelected(`${equationEditorCategoriesAndSymbols.general.symbols.dollar.ariaLabel}`)
270
+ });
271
+ });
272
+
273
+ describe('Save a edited category', () => {
274
+ abortEarlySetup();
275
+ before(() => {
276
+ thinkSpherePage.steps.navigateToThinkSphereCreateQuestion();
277
+ thinkSpherePage.steps.expandCustomizeToolsAndControls();
278
+ thinkSpherePage.steps.selectCustomizedFormattingOption(['Equation editor']);
279
+ editCategoryFlyout.steps.openEditCategoryFlyout()
280
+ });
281
+
282
+ it('When user edits a category and clicks on Cancel button then the flyout should close and the changes should not be saved', () => {
283
+ editCategoryFlyout.steps.deselectCategoryCharacters(`${equationEditorCategoriesAndSymbols.general.symbols.dollar.ariaLabel}`);
284
+ editCategoryFlyout.steps.deselectCategoryCharacters(`${equationEditorCategoriesAndSymbols.general.symbols.cents.ariaLabel}`);
285
+ thinkSpherePage.steps.cancelCustomCategory();
286
+ utilities.verifyElementVisibilityState(editCategoryFlyout.dialogBox(), 'notExist');
287
+ editCategoryFlyout.steps.openEditCategoryFlyout()
288
+ editCategoryFlyout.steps.verifyAllCategoryCharactersSelected();
289
+ });
290
+
291
+ });
292
+ });
@@ -287,12 +287,10 @@ describe('Create item : ThinkSphere Question - Plan Phases Section',() => {
287
287
 
288
288
  it('When popup is open it should have the title visible and it should contain the title', () => {
289
289
  utilities.verifyElementVisibilityState(thinkSpherePage.videoPopupTitle(), 'visible');
290
- thinkSpherePage.videoPopupTitle()
291
- .invoke('text')
292
- .should('not.be.empty');
290
+ thinkSpherePage.steps.verifyTextIsNotEmpty(thinkSpherePage.videoPopupTitle());
293
291
  });
294
292
 
295
- it.skip('The play and pause button should be visible in the center of the video', () => {
293
+ it('The play and pause button should be visible in the center of the video', () => {
296
294
  //TODO: the play and pause button should be visible in the center of the video
297
295
  });
298
296
 
@@ -474,6 +472,27 @@ describe('Create item : ThinkSphere Question - Plan Phases Section',() => {
474
472
  thinkSpherePage.tests.verifyOptionsInput('strategy');
475
473
 
476
474
  thinkSpherePage.tests.verifyAtleastOneOptionIsRequired('strategy', strategiesTextDefault, 'Minimum one option is required');
475
+
476
+ it('The author should be able to add up to 15 strategies using the \'Add strategy\' button and newly added option\'s checkbox should be unchecked by default', () => {
477
+ for (let index = 0; index < 10; index++) {
478
+ thinkSpherePage.steps.addOption('strategy');
479
+ }
480
+ thinkSpherePage.tests.verifyListSectionContents({
481
+ optionFieldsCount: 15,
482
+ optionList: [...strategiesTextDefault, ...Array(10).fill('')],
483
+ placeholder: 'Enter strategy name',
484
+ list: 'strategy',
485
+ });
486
+ thinkSpherePage.steps.verifyTypeCheckBoxStrategy();
487
+ thinkSpherePage.steps.verifyStrategyCheckBoxNotChecked();
488
+ });
489
+
490
+ it('When 5 strategies are checked, further checkboxes should have tool tip \'Only 5 strategies can be selected\'', () => {
491
+ for(let i = 1; i < 5; i++) {
492
+ thinkSpherePage.steps.selectOption('strategy', i)
493
+ }
494
+ utilities.getNthElement(thinkSpherePage.planStrategyCheckbox(), 5).verifyTooltip('Only 5 strategies can be selected')
495
+ });
477
496
 
478
497
  thinkSpherePage.tests.verifyResetToDefaultFunctionality(strategiesTextDefault, 'strategy');
479
498
 
@@ -530,6 +549,29 @@ describe('Create item : ThinkSphere Question - Plan Phases Section',() => {
530
549
  thinkSpherePage.tests.verifyOptionsInput('sentenceStarter');
531
550
 
532
551
  thinkSpherePage.tests.verifyAtleastOneOptionIsRequired('sentenceStarter', sentenceStartersTextDefault, 'Minimum one option is required');
552
+
553
+ it('The author should be able to add up to 15 sentence starters using the \'Add sentence starters\' button and newly added option\'s checkbox should be unchecked by default', () => {
554
+ for (let index = 0; index < 10; index++) {
555
+ thinkSpherePage.steps.addOption('sentenceStarter');
556
+ }
557
+ thinkSpherePage.tests.verifyListSectionContents({
558
+ optionFieldsCount: 15,
559
+ optionList: [...sentenceStartersTextDefault, ...Array(10).fill('')],
560
+ placeholder: 'Enter sentence starter name',
561
+ list: 'sentenceStarter',
562
+ });
563
+ thinkSpherePage.steps.verifyTypeCheckBoxSentenceStarter();
564
+ thinkSpherePage.steps.verifySentenceStrategyCheckBoxNotChecked();
565
+ });
566
+
567
+ it('When 5 sentence starters are checked, further checkboxes should have tool tip \'Only 5 sentence starters can be selected\'', () => {
568
+ for(let i = 1; i < 5; i++) {
569
+ thinkSpherePage.steps.selectOption(sentenceStartersTextDefault, i)
570
+ }
571
+ utilities.getNthElement(thinkSpherePage.planSentenceStarterCheckbox(), 5).verifyTooltip('Only 5 sentence starters can be selected')
572
+ });
573
+
574
+ thinkSpherePage.tests.verifyResetToDefaultFunctionality(sentenceStartersTextDefault, 'sentenceStarter');
533
575
 
534
576
  it('Accessibility of \'Plan Phase\' Section Sentence starters list component', { tags: 'a11y' }, () => {
535
577
  cy.checkAccessibility(thinkSpherePage.planSentenceStarterSection());
@@ -36,6 +36,13 @@ describe('ThinkSphere Question - Solve Phases Section', () => {
36
36
  utilities.verifyElementVisibilityState(thinkSpherePage.solvePhaseAccordionExpandIcon(), 'exist');
37
37
  });
38
38
 
39
+ it('When the user clicks the expanded \'Solve phase\' accordion should be collapsed when collapsed accordion is clicked it should be expanded', () => {
40
+ thinkSpherePage.steps.clickOnSolvePhaseAccordionIcon();
41
+ thinkSpherePage.steps.verifySolvePhaseAccordionCollapsed();
42
+ thinkSpherePage.steps.clickOnSolvePhaseAccordionIcon();
43
+ thinkSpherePage.steps.verifySolvePhaseAccordionExpanded();
44
+ });
45
+
39
46
  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
47
  utilities.verifyInnerText(thinkSpherePage.customizeToolsAndControlsLabel(), 'Customize toolbar options and controls');
41
48
  utilities.verifyElementVisibilityState(thinkSpherePage.customizeToolsAndControlsIcon(), 'exist');
@@ -150,6 +157,12 @@ describe('ThinkSphere Question - Solve Phases Section', () => {
150
157
  thinkSpherePage.steps.verifyDefaultStamps(defaultSelectedStamps);
151
158
  });
152
159
 
160
+ it('Default stamps should have visible tool tips', () => {
161
+ defaultSelectedStamps.forEach((ele) => {
162
+ thinkSpherePage.customizeStampCard(ele).verifyTooltip(ele);
163
+ });
164
+ });
165
+
153
166
  it('When user select deselect stamps tool from tools section, then customize stamps section should be visible and hide respectively', () => {
154
167
  thinkSpherePage.steps.clickOnStampsTool();
155
168
  utilities.verifyElementVisibilityState(thinkSpherePage.customizeStampComponent(), 'notExist');
@@ -250,6 +263,26 @@ describe('ThinkSphere Question - Solve Phases Section', () => {
250
263
  });
251
264
  });
252
265
 
266
+ it('The edit button should not be displayed for the keypad category button.', () => {
267
+ utilities.verifyElementVisibilityState(thinkSpherePage.equationEditorSectionCategories().contains(`${equationEditorCategoriesAndSymbols['keyPad'].displayName}`).find(thinkSpherePage.equationEditorSectionCategoriesEditIcon()), 'visible');
268
+ })
269
+
270
+ it('User should be able to unselect default selected category and should be able to select default unselected category.', () => {
271
+ thinkSpherePage.equationEditorSectionCategories().contains(`${equationEditorCategoriesAndSymbols['keyPad'].displayName}`).click();
272
+ thinkSpherePage.steps.verifyEquationEditorSectionCategoryNotPressed()
273
+ thinkSpherePage.equationEditorSectionCategories().contains(`${equationEditorCategoriesAndSymbols['setNotation'].displayName}`).click();
274
+ thinkSpherePage.steps.verifyEquationEditorSectionCategoryIsPressed();
275
+ });
276
+
277
+ it('The \'Equation Editor\' should be displayed along with helper text \'Select the categories to display to the students in the equation editor.\' and \'Create custom category\' button should be displayed', () => {
278
+ utilities.verifyElementVisibilityState(thinkSpherePage.equationEditorSectionTitle(), 'visible');
279
+ utilities.verifyInnerText(thinkSpherePage.equationEditorSectionTitle(), 'Equation editor');
280
+ utilities.verifyElementVisibilityState(thinkSpherePage.equationEditorSectionHelperText(), 'visible');
281
+ utilities.verifyInnerText(thinkSpherePage.equationEditorSectionHelperText(), 'Select the categories to display to the students in the equation editor.');
282
+ utilities.verifyElementVisibilityState(thinkSpherePage.createCustomCategoryButton(), 'visible');
283
+ utilities.verifyInnerText(thinkSpherePage.createCustomCategoryButton(), 'Create custom category');
284
+ });
285
+
253
286
  it.skip('Accessibility of selected and deselected category', { tags: 'a11y' }, () => {
254
287
  cy.checkAccessibility(thinkSpherePage.equationEditorSectionCategories().contains(`${equationEditorCategoriesAndSymbols['numPad'].displayName}`).parents('[class*="DraggableItemsGrid"]'))
255
288
  });
@@ -45,15 +45,24 @@ const selectors = {
45
45
  createItemButtonTypography: () => browseItemsPage.buttonCreateItem().find('.ngie-btn-typography'),
46
46
  createQuestionCancelButtonTypography: () => browseItemsPage.buttonCancelCreateQuestion().find('.ngie-btn-typography'),
47
47
  tableColumnHeaderBrowseItemWrapperDiv: (count) => browseItemsPage.tableColumnHeader(count).find('div.browse-item-component-wrapper div'),
48
+ rowItemTitle: () => cy.get('.browse-item-styled-link'),
49
+ previewModeWrapper: () => cy.get('.preview-mode-wrapper'),
50
+ saveButton: () => cy.get('.ngie-btn-typography').contains('save',{matchCase: false}),
51
+ cancelButton: () => cy.get('.ngie-btn-typography').contains('cancel',{matchCase: false}),
52
+ radioGroup: () => cy.get('.ngie-radio-group'),
53
+ studentViewRadioButton: () => cy.get('[class*="RadioGroupMUI5styles__RadioOptionContainer"]').eq(0),
54
+ gradingViewRadioButton: () => cy.get('[class*="RadioGroupMUI5styles__RadioOptionContainer"]').eq(1),
55
+ browseItemQuestionItem: () => cy.get('.browse-item-question-item')
48
56
  };
49
57
 
50
58
  const searchBarSelectors = {
51
- searchBar: () => cy.get('input[placeholder="Search by title, tags and content"]'),
59
+ searchBar: () => cy.get('input[placeholder*="Search by"]'),
52
60
  buttonClearSearch: () => cy.get('[data-at="clear-button"]'),
53
61
  buttonSearch: () => cy.get('button[aria-label="Search"]'),
54
62
  buttonSearchSVG: () => cy.get('button[aria-label="Search"]').find('svg'),
55
- mobileViewSearchBar: () => cy.get('input[placeholder="Search by title, tags and content"]'),
63
+ mobileViewSearchBar: () => cy.get('input[placeholder*="Search by title"]'),
56
64
  searchInputField: () => cy.get('.ngie-search input'),
65
+ searchBarParent: () => cy.get('input[placeholder*="Search by"]').parent(),
57
66
  };
58
67
 
59
68
  const mobileViewBrowsePageSelectors = {
@@ -107,6 +116,7 @@ const mobileViewBrowsePageSelectors = {
107
116
  return utilities.getNthElement(cy.get(`.filter-chip[aria-label*="${chip}"] button[aria-label*="Remove"]`), 0);
108
117
  },
109
118
  filterChipClearAll: () => cy.get('.filter-chip-clearall'),
119
+ itemTitleCell: () => cy.get('[class*=ItemTitleCellstyles__ItemCellWrapper]'),
110
120
  };
111
121
 
112
122
  const steps = {
@@ -962,6 +972,103 @@ const tests = {
962
972
  });
963
973
  });
964
974
  },
975
+
976
+ verifyBrowseItemsRowContent: () => {
977
+ it('Browse review items list row should have title, reference id, and question type', () => {
978
+ browseItemsPage.itemTitleCell().each(($item) => {
979
+ cy.wrap($item).within(() => {
980
+ cy.get('button.browse-item-styled-link').invoke('text').should('not.be.empty');
981
+ cy.get('.browse-item-question-text-container').contains('Ref ID:').should('exist'); // safer
982
+ cy.get('[class*=ItemTitleCellstyles__ReferenceId]').invoke('text').should('not.be.empty');
983
+ cy.get('.browse-item-label-text').contains('Type:').should('exist');
984
+ cy.get('.browse-item-question-item').invoke('text').should('not.be.empty');
985
+ });
986
+ });
987
+ });
988
+ },
989
+
990
+ verifyItemOpening: () => {
991
+ it('When the author clicks on the title of the item in the \'check your math\' browse item list page then the question preview for that item should be displayed along with cancel and save button, and student and grading view radio buttons', () => {
992
+ browseItemsPage.rowItemTitle().eq(0).click();
993
+ utilities.verifyElementVisibilityState(browseItemsPage.previewModeWrapper(), 'visible');
994
+ utilities.verifyElementVisibilityState(browseItemsPage.saveButton(), 'visible');
995
+ utilities.verifyElementVisibilityState(browseItemsPage.cancelButton(), 'visible');
996
+ utilities.verifyElementVisibilityState(browseItemsPage.radioGroup(), 'visible');
997
+ })
998
+
999
+ it('student radio button should be checked by default and author should be able to toggle between student and grading view radio buttons', () => {
1000
+ utilities.verifyElementVisibilityState(browseItemsPage.studentViewRadioButton(), 'exist');
1001
+ utilities.verifyElementVisibilityState(browseItemsPage.gradingViewRadioButton(), 'exist');
1002
+ browseItemsPage.studentViewRadioButton().should('have.class', 'radio-option-checked');
1003
+ browseItemsPage.gradingViewRadioButton().should('have.class', 'radio-option-not-checked');
1004
+ browseItemsPage.gradingViewRadioButton().click();
1005
+ browseItemsPage.studentViewRadioButton().should('have.class', 'radio-option-not-checked');
1006
+ browseItemsPage.gradingViewRadioButton().should('have.class', 'radio-option-checked');
1007
+ browseItemsPage.studentViewRadioButton().click();
1008
+ browseItemsPage.studentViewRadioButton().should('have.class', 'radio-option-checked');;
1009
+ browseItemsPage.gradingViewRadioButton().should('have.class', 'radio-option-not-checked');
1010
+ browseItemsPage.cancelButton().click();
1011
+ });
1012
+ },
1013
+
1014
+ verifyFilterSelectionInList: (categories) => {
1015
+ it('When the author checks the \'multiple choice selection\' checkbox then only multiple choice question (single selection and multiple selection) should be displayed on the question list.', () => {
1016
+ browseItemsPage.steps.clickOnFilterCategoryCheckbox(categories[0]);
1017
+ cy.pageLoadWait();
1018
+ const allowedTypes = ['multiple selection','single selection'];
1019
+ browseItemsPage.browseItemQuestionItem().each(($item) => {
1020
+ cy.wrap($item)
1021
+ .invoke('text')
1022
+ .then((text) => {
1023
+ const trimmedText = text.trim();
1024
+ if (trimmedText === '' || trimmedText === ',' || /^,+$/.test(trimmedText)) {
1025
+ cy.log('Skipped invalid/empty item text:', trimmedText);
1026
+ return;
1027
+ }
1028
+ expect(allowedTypes).to.include(trimmedText.toLowerCase());
1029
+ });
1030
+ });
1031
+ });
1032
+ },
1033
+
1034
+ verifySupportedQuestionsInItemsList: (allowedFilterCategories) => {
1035
+ it('The items list page should display items for only the supported question types', () => {
1036
+ const allowedTypes = Object.values(allowedFilterCategories).flat();
1037
+ browseItemsPage.browseItemQuestionItem().each(($item) => {
1038
+ cy.wrap($item)
1039
+ .invoke('text')
1040
+ .then((text) => {
1041
+ const trimmedText = text.trim();
1042
+ if (trimmedText === '' || trimmedText === ',' || /^,+$/.test(trimmedText)) {
1043
+ cy.log('Skipped invalid/empty item text:', trimmedText);
1044
+ return;
1045
+ }
1046
+ expect(allowedTypes).to.include(trimmedText.toLowerCase());
1047
+ });
1048
+ });
1049
+ });
1050
+ },
1051
+
1052
+ verifyFirstPreviousNextPageButtons: () => {
1053
+ it('When user is on first page, previous button should be disabled and when the user is in last page, the next button should be disabled,', () => {
1054
+ browseItemsPage.buttonPrevious().should('have.attr', 'disabled');
1055
+ browseItemsPage.buttonNext().should('not.have.attr', 'disabled');
1056
+ utilities.getNthElement(browseItemsPage.paginationCountText(), 0)
1057
+ .invoke('text')
1058
+ .then((text) => {
1059
+ const totalItems = parseInt(text.split(' ').pop(), 10);
1060
+ const totalPages = Math.ceil(totalItems / 20);
1061
+
1062
+ Cypress._.times(totalPages - 1, () => {
1063
+ browseItemsPage.steps.clickOnNextPageButton();
1064
+ cy.wait(500);
1065
+ });
1066
+ });
1067
+
1068
+ browseItemsPage.buttonNext().should('have.attr', 'disabled');
1069
+ browseItemsPage.buttonPrevious().should('not.have.attr', 'disabled');
1070
+ });
1071
+ }
965
1072
  };
966
1073
 
967
1074
  export const browseItemsPage = {
@@ -23,9 +23,9 @@ const selectors = {
23
23
  }
24
24
 
25
25
  const steps = {
26
- openEditCategoryFlyout: () => {
26
+ openEditCategoryFlyout: (categoryName = 'general') => {
27
27
  essayResponsePage.equationEditorSectionCategories()
28
- .contains(`${equationEditorCategoriesAndSymbols['general'].displayName}`)
28
+ .contains(`${equationEditorCategoriesAndSymbols[categoryName].displayName}`)
29
29
  .parents('[id*="DraggableItem"]')
30
30
  .within(() => {
31
31
  essayResponsePage.equationEditorSectionCategoriesEditIcon()