itemengine-cypress-automation 1.0.387-IEI-6161-IEI-6162-manualAndNonScoredScript-481a8a8.0 → 1.0.387-IEI-6273-6d750cf.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,334 @@
1
+ import uuid from 'react-uuid';
2
+ import { thinkSpherePage } from "../../../pages";
3
+ import { browseItemsPage } from "../../../pages/components/browseItemsPage";
4
+ import abortEarlySetup from "../../../support/helpers/abortEarly";
5
+ import utilities from "../../../support/helpers/utilities";
6
+ const css = Cypress.env('css');
7
+
8
+ describe('Grading view : ThinkSphere Question - Plan Section', () => {
9
+ const uuidString = uuid();
10
+
11
+ before(() => {
12
+ cy.loginAs('admin');
13
+ cy.createThinkSphereItem(uuidString, true);
14
+ cy.visit('/item-engine/thinksphere/browse-items');
15
+ browseItemsPage.steps.clickOnActionButton();
16
+ browseItemsPage.steps.clickOnActionMenuItem(0);
17
+ thinkSpherePage.steps.clickOnStrategiesPreviewListLI();
18
+ thinkSpherePage.steps.stepsBeforeGradingView();
19
+ });
20
+
21
+ describe('\'Question instruction\' section', () => {
22
+ abortEarlySetup();
23
+ it('\'Question instruction\' section should be present', () => {
24
+ utilities.verifyElementVisibilityState(thinkSpherePage.questionInstructionPreviewTexWrapper(), 'visible');
25
+ utilities.verifyInnerText(thinkSpherePage.questionInstructionPreviewTexWrapper(), 'question instruction text');
26
+ });
27
+
28
+ it('CSS of \'Question instruction\' section', { tags: 'css' }, () => {
29
+ utilities.verifyCSS(thinkSpherePage.questionInstructionPreviewTexWrapper(), {
30
+ 'border-radius': '12px',
31
+ 'background-color': css.color.questionInstructionBG,
32
+ 'padding': '10px 170px 10px 27px',
33
+ 'font-size': css.fontSize.default,
34
+ 'font-weight': css.fontWeight.regular,
35
+ });
36
+ });
37
+
38
+ it('Question instruction image should visible in the preview', () => {
39
+ thinkSpherePage.steps.verifyQuestionInstructionPreviewImageWrapperVisibility();
40
+ });
41
+
42
+ it('CSS of question instruction image section', { tags: 'css' }, () => {
43
+ utilities.verifyCSS(thinkSpherePage.questionInstructionPreviewImageWrapper(), {
44
+ 'width': '143px',
45
+ 'height': '110px',
46
+ 'border': `1px solid ${css.color.secondaryBtnBorder}`,
47
+ 'background-color': css.color.primaryBtn,
48
+ });
49
+ utilities.verifyCSS(thinkSpherePage.questionInstructionPreviewImageExpandButton(), {
50
+ 'width': '24px',
51
+ 'height': '24px',
52
+ 'box-shadow': `${css.color.boxShadow} 0px 2px 8px 0px`,
53
+ 'border': `1px solid ${css.color.figDefaultComponentBorder}`,
54
+ 'border-radius': '4px',
55
+ 'background-color': css.color.primaryBtn,
56
+ });
57
+ });
58
+
59
+ it('When user clicks on expand question instruction image then it should open in the popup', () => {
60
+ thinkSpherePage.steps.clickOnQuestionInstructionExpandImageButton();
61
+ utilities.verifyElementVisibilityState(thinkSpherePage.dialogBoxRoot(), 'visible');
62
+ thinkSpherePage.steps.verifyQuestionImagePopup();
63
+ });
64
+
65
+ it('CSS of question instruction image popup', { tags: 'css' }, () => {
66
+ utilities.verifyCSS(thinkSpherePage.dialogBoxRoot(), {
67
+ 'border-radius': '8px',
68
+ 'border': `1px solid ${css.color.secondaryBtnBorder}`,
69
+ 'box-shadow': `${css.color.dialogBoxBoxShadow} 0px 0px 10px 0px`,
70
+ });
71
+ utilities.verifyCSS(thinkSpherePage.closeExpandImagePopupButton(), {
72
+ 'background-color': css.color.primaryBtn,
73
+ 'font-size': css.fontSize.normal,
74
+ 'font-weight': css.fontWeight.semibold,
75
+ 'border': `1px solid ${css.color.secondaryBtnBorder}`,
76
+ 'color': css.color.primaryBtnBorder,
77
+ });
78
+ });
79
+
80
+ it('Accessibility of question instruction image popup', { tags: 'a11y' }, () => {
81
+ cy.checkAccessibility(thinkSpherePage.dialogBoxRoot());
82
+ cy.checkAccessibility(thinkSpherePage.closeExpandImagePopupButton());
83
+ });
84
+
85
+ it('When user clicks on close expand image popup button then it should remove the popup', () => {
86
+ thinkSpherePage.steps.clickOnCloseExpandImagePopupButton();
87
+ utilities.verifyElementVisibilityState(thinkSpherePage.dialogBoxRoot(), 'notExist');
88
+ });
89
+ });
90
+
91
+ describe('\'Choose your strategies\' section', () => {
92
+ abortEarlySetup();
93
+ it('\'Choose your strategies\' section and title should be present', () => {
94
+ utilities.verifyInnerText(thinkSpherePage.strategiesPreviewHeader(), 'Choose your strategies');
95
+ utilities.verifyElementVisibilityState(thinkSpherePage.strategiesPreviewHeader(), 'visible');
96
+ });
97
+
98
+ it('\'Add new strategy\' button should be present', () => {
99
+ utilities.verifyInnerText(thinkSpherePage.addNewStrategyButton(), 'Add new strategy');
100
+ utilities.verifyElementVisibilityState(thinkSpherePage.addNewStrategyButton(), 'visible');
101
+ });
102
+
103
+ it('CSS of strategies header and add new strategy button', { tags: 'css' }, () => {
104
+ utilities.verifyCSS(thinkSpherePage.strategiesPreviewHeader(), {
105
+ 'font-size': css.fontSize.heading,
106
+ 'font-weight': css.fontWeight.semibold,
107
+ 'color': css.color.primaryBtnBorder,
108
+ });
109
+ utilities.verifyCSS(thinkSpherePage.addNewStrategyButton(), {
110
+ 'border': `1px solid ${css.color.figDefaultComponentBorder}`,
111
+ 'padding': '12px 16px',
112
+ 'border-radius': '8px',
113
+ 'box-shadow': `${css.color.boxShadow} 0px 2px 8px 0px`,
114
+ });
115
+ utilities.verifyCSS(thinkSpherePage.addNewStrategyTextWrapper(), {
116
+ 'color': css.color.primaryBtnBorder,
117
+ 'font-size': css.fontSize.default,
118
+ 'font-weight': css.fontWeight.regular,
119
+ });
120
+ });
121
+
122
+ it('CSS of strategies list', { tags: 'css' }, () => {
123
+ utilities.verifyCSS(utilities.getNthElement(thinkSpherePage.strategiesPreviewListLI(), 0), {
124
+ 'padding': '8px 16px 8px 24px',
125
+ 'border': `2px solid ${css.color.transparent}`,
126
+ 'background-color': css.color.progressBarRemainingFill,
127
+ 'border-radius': '12px',
128
+ });
129
+ utilities.verifyCSS(utilities.getNthElement(thinkSpherePage.strategyTextWrapper(), 0), {
130
+ 'color': css.color.strategyTextDisabled,
131
+ 'margin-right': '40px',
132
+ 'font-size': '18px',
133
+ 'font-weight': '600',
134
+ });
135
+ utilities.verifyCSS(utilities.getNthElement(thinkSpherePage.strategyTextWrapper(), 1), {
136
+ 'color': css.color.primaryBtnBg,
137
+ 'font-size': '18px',
138
+ 'font-weight': '600',
139
+ });
140
+ });
141
+
142
+ it('When the user clicks on add new strategy button in grading view, no popup should be displayed and the button should not be accessible with keyboard', () => {
143
+ thinkSpherePage.steps.verifyAddStrategiesButtonDisabled()
144
+ });
145
+
146
+ it('Strategies list buttons should be in disabled state', () => {
147
+ thinkSpherePage.steps.verifyStrategiesListButtonDisabled()
148
+ });
149
+
150
+ it('CSS of strategies list in selected state', { tags: 'css' }, () => {
151
+ utilities.verifyCSS(utilities.getNthElement(thinkSpherePage.strategiesPreviewListLI(), 1), {
152
+ 'border': `2px solid ${css.color.toggleButtonSelectedBg}`,
153
+ 'background-color': css.color.transparent,
154
+ });
155
+ utilities.verifyCSS(utilities.getNthElement(thinkSpherePage.strategyTextWrapper(), 1), {
156
+ 'color': css.color.primaryBtnBg,
157
+ });
158
+ });
159
+
160
+ it('Video icon for should present by default besides the strategy name', () => {
161
+ utilities.verifyElementVisibilityState(utilities.getNthElement(thinkSpherePage.videoIconWrapper(), 0), 'visible');
162
+ });
163
+
164
+ it('When user clicks on video icon then video should be played in the popup', () => {
165
+ thinkSpherePage.steps.clickOnVideoIcon();
166
+ utilities.verifyElementVisibilityState(thinkSpherePage.dialogBoxRoot(), 'visible');
167
+ thinkSpherePage.steps.verifyVideoPopupDialogBox();
168
+ thinkSpherePage.steps.closeVideoPopup();
169
+ });
170
+ });
171
+
172
+ describe('\'Planning journal\' Section', () => {
173
+ abortEarlySetup();
174
+ it('\'Planning journal\' section should be present', () => {
175
+ utilities.verifyElementVisibilityState(thinkSpherePage.PlanningPreviewWrapper(), 'visible');
176
+ });
177
+
178
+ it('\'Planning journal\' section heading should be present', () => {
179
+ utilities.verifyElementVisibilityState(thinkSpherePage.planningPreviewHeading(), 'visible');
180
+ utilities.verifyInnerText(thinkSpherePage.planningPreviewHeading(), 'Planning journal');
181
+ });
182
+
183
+ it('\'Sentence starters\' label and dropdown should be displayed and the dropdown should be disabled', () => {
184
+ utilities.verifyElementVisibilityState(thinkSpherePage.chooseStarterLabel(), 'visible');
185
+ utilities.verifyElementVisibilityState(thinkSpherePage.chooseStarterDropdown(), 'visible');
186
+ utilities.verifyInnerText(thinkSpherePage.chooseStarterLabel(), 'Sentence starter');
187
+ });
188
+
189
+ it('CSS of \'Sentence starter\' dropdown - default state', { tags: 'css' }, () => {
190
+ utilities.verifyCSS(thinkSpherePage.chooseStarterLabel(), {
191
+ 'color': css.color.sectionHeading,
192
+ 'font-size': css.fontSize.normal,
193
+ 'font-weight': css.fontWeight.semibold,
194
+ });
195
+ utilities.verifyCSS(thinkSpherePage.chooseStarterDropdown(), {
196
+ 'color': css.color.liText,
197
+ 'font-size': css.fontSize.default,
198
+ 'font-weight': css.fontWeight.regular
199
+ });
200
+ });
201
+
202
+ it('\'Planning journal\' write wrapper should be present', () => {
203
+ utilities.verifyElementVisibilityState(thinkSpherePage.planningWriteWrapper(), 'visible');
204
+ });
205
+
206
+ it('\'The problem is asking me to\' section should be present', () => {
207
+ utilities.verifyElementVisibilityState(thinkSpherePage.problemAskingWrapper(), 'visible');
208
+ });
209
+
210
+ it('\'The problem is asking me to\' subheading should be present', () => {
211
+ thinkSpherePage.steps.verifyProblemAskingHeading();
212
+ });
213
+
214
+ it('Text area with placeholder \'Enter your text here\' should be present under \'The problem is asking me to\' section', () => {
215
+ thinkSpherePage.steps.verifyProblemAskingTextArea();
216
+ });
217
+
218
+ it('Mic button should be present under \'The problem is asking me to\' section and it should be disabled', () => {
219
+ thinkSpherePage.steps.verifyProblemAskingMicSection(true);
220
+ });
221
+
222
+ it('User should not be able to write in the \'Enter your text here\' textarea under \'The problem is asking me to\' section', () => {
223
+ thinkSpherePage.steps.verifyDisabledProblemTextContainer('This is a test text for the problem.');
224
+ });
225
+
226
+ it('\'Add strategies to plan\' section should be present', () => {
227
+ utilities.verifyElementVisibilityState(thinkSpherePage.strategiesToPlanWrapper(), 'visible');
228
+ });
229
+
230
+ it('\'Add strategies to plan\' subheading should be present', () => {
231
+ thinkSpherePage.steps.verifyStrategiesToPlanHeading();
232
+ });
233
+
234
+ it('\'Write your plan\' section should be present', () => {
235
+ utilities.verifyElementVisibilityState(thinkSpherePage.writePlanWrapper(), 'visible');
236
+ });
237
+
238
+ it('\'Write your plan\' subheading should be present', () => {
239
+ thinkSpherePage.steps.verifyWritePlanHeading();
240
+ });
241
+
242
+ it('Text area with placeholder \'Enter your plan here\' should be present under \'Write your plan\' section', () => {
243
+ thinkSpherePage.steps.verifyWritePlanTextArea();
244
+ });
245
+
246
+ it('Mic button should be present under \'Write your plan\' section', () => {
247
+ thinkSpherePage.steps.verifyWritePlanMicSection(true);
248
+ });
249
+
250
+ it('User should not be able to write in the \'Enter your plan here\' textarea under \'Write your plan\' section', () => {
251
+ thinkSpherePage.steps.verifyDisabledWriteYourPlanTextContainer('First, I will look for a pattern ');
252
+ });
253
+
254
+ it('The strategy chip selected by the student should display inside \'Add strategies to plan\' wrapper in the form of chip', () => {
255
+ utilities.verifyElementVisibilityState(thinkSpherePage.strategyChipWrapper(), 'visible');
256
+ utilities.verifyElementVisibilityState(thinkSpherePage.strategyChip(), 'visible');
257
+ utilities.verifyInnerText(thinkSpherePage.strategyChip(), 'Look for a pattern');
258
+ });
259
+
260
+ it('CSS of strategy chip when it is not selected', { tags: 'css' }, () => {
261
+ utilities.verifyCSS(thinkSpherePage.strategyChip(), {
262
+ 'border': `1px solid ${css.color.primaryBtnBg}`,
263
+ 'color': css.color.sectionHeading,
264
+ 'border-radius': '20px',
265
+ 'font-size': css.fontSize.normal,
266
+ 'font-weight': css.fontWeight.regular,
267
+ 'background-color': css.color.secondaryBtnBorder,
268
+ });
269
+ });
270
+
271
+ it('The user should not be able to click on strategy chip', () => {
272
+ thinkSpherePage.steps.verifyDisabledStrategyChip();
273
+ });
274
+
275
+ it('CSS of planning journal section', { tags: 'css' }, () => {
276
+ utilities.verifyCSS(thinkSpherePage.planningPreviewHeading(), {
277
+ 'color': css.color.primaryBtnBorder,
278
+ 'font-size': css.fontSize.heading,
279
+ 'font-weight': css.fontWeight.semibold,
280
+ });
281
+
282
+ utilities.verifyCSS(thinkSpherePage.planningWriteWrapper(), {
283
+ 'border': `1px solid ${css.color.secondaryBtnBorderDisabled}`,
284
+ 'border-radius': '12px'
285
+ });
286
+
287
+ utilities.verifyCSS(thinkSpherePage.problemAskingWrapper(), {
288
+ 'padding': '16px 16px 14px',
289
+ 'border-bottom': `1px solid ${css.color.secondaryBtnBorderDisabled}`
290
+ });
291
+
292
+ utilities.verifyCSS(thinkSpherePage.strategiesToPlanWrapper(), {
293
+ 'padding': '16px',
294
+ 'border-bottom': `1px solid ${css.color.secondaryBtnBorderDisabled}`
295
+ });
296
+
297
+ utilities.verifyCSS(thinkSpherePage.writePlanWrapper(), {
298
+ 'padding': '16px'
299
+ });
300
+
301
+ thinkSpherePage.problemAskingWrapper()
302
+ .within(() => {
303
+ utilities.verifyCSS(thinkSpherePage.subheadingWrapper(), {
304
+ 'color': css.color.primaryBtnBorder,
305
+ 'font-size': css.fontSize.normal,
306
+ 'font-weight': css.fontWeight.bold,
307
+ });
308
+ });
309
+
310
+ thinkSpherePage.strategiesToPlanWrapper()
311
+ .within(() => {
312
+ utilities.verifyCSS(thinkSpherePage.subheadingWrapper(), {
313
+ 'color': css.color.primaryBtnBorder,
314
+ 'font-size': css.fontSize.normal,
315
+ 'font-weight': css.fontWeight.bold,
316
+ });
317
+ });
318
+
319
+ thinkSpherePage.writePlanWrapper()
320
+ .within(() => {
321
+ utilities.verifyCSS(thinkSpherePage.subheadingWrapper(), {
322
+ 'color': css.color.primaryBtnBorder,
323
+ 'font-size': css.fontSize.normal,
324
+ 'font-weight': css.fontWeight.bold,
325
+ });
326
+ });
327
+ });
328
+
329
+ it('Accessibility of planning journal', { tags: 'a11y' }, () => {
330
+ cy.checkAccessibility(thinkSpherePage.PlanningPreviewWrapper());
331
+ });
332
+ });
333
+
334
+ });
@@ -0,0 +1,65 @@
1
+ import uuid from 'react-uuid';
2
+ import { thinkSpherePage } from "../../../pages";
3
+ import { browseItemsPage } from "../../../pages/components/browseItemsPage";
4
+ import abortEarlySetup from "../../../support/helpers/abortEarly";
5
+ import utilities from "../../../support/helpers/utilities";
6
+ import { editSectionWhiteBoardToolButtons, whiteBoardTools } from '../../../fixtures/thinkSphereWhiteboardTools';
7
+ const css = Cypress.env('css');
8
+
9
+ describe('Grading view : ThinkSphere Question - Solve Section', () => {
10
+ before(() => {
11
+ cy.loginAs('admin');
12
+ thinkSpherePage.steps.navigateToThinkSphereCreateQuestion();
13
+ cy.barsPreLoaderWait();
14
+ thinkSpherePage.steps.switchToEditTab();
15
+ thinkSpherePage.steps.addTextInQuestionInstructionsInputField('question instruction text');
16
+ thinkSpherePage.steps.clickOnSolvePhaseAccordionIcon();
17
+ thinkSpherePage.steps.expandCustomizeToolsAndControls();
18
+ editSectionWhiteBoardToolButtons.forEach((toolName) => {
19
+ thinkSpherePage.steps.selectOptionFromToolsAndControls(toolName);
20
+ })
21
+ thinkSpherePage.steps.clickOnSaveButton();
22
+ cy.visit('/item-engine/thinksphere/browse-items');
23
+ browseItemsPage.steps.clickOnActionButton();
24
+ browseItemsPage.steps.clickOnActionMenuItem(0);
25
+ thinkSpherePage.steps.clickOnSolveTab();
26
+ thinkSpherePage.steps.submitResponseAndGotoGradingView();
27
+ thinkSpherePage.steps.clickOnSolveTab();
28
+ });
29
+
30
+ describe('\'Question instruction\' section', () => {
31
+ abortEarlySetup();
32
+ it('\'Question instruction\' section should be present', () => {
33
+ utilities.verifyElementVisibilityState(thinkSpherePage.questionInstructionPreviewTexWrapper(), 'visible');
34
+ utilities.verifyInnerText(thinkSpherePage.questionInstructionPreviewTexWrapper(), 'question instruction text');
35
+ });
36
+
37
+ });
38
+
39
+ describe('Whiteboard and its sections should be present', () => {
40
+ abortEarlySetup();
41
+ thinkSpherePage.tests.verifyWhiteBoardAndSections();
42
+ });
43
+
44
+ describe('Whiteboard tools and sub tools should be present', () => {
45
+ abortEarlySetup();
46
+ const allToolIds = whiteBoardTools.map(tool => tool.dataTestId);
47
+ const defaultToolIds = whiteBoardTools.filter(tool => tool.isDefault).map(tool => tool.dataTestId);
48
+ thinkSpherePage.tests.verifyDisabledWhiteboardTools(defaultToolIds, allToolIds);
49
+ });
50
+
51
+ describe('Verify the Your plan Button', () => {
52
+ abortEarlySetup();
53
+ it('Your Plan button should be visible and display the correct disabled styles', () => {
54
+ utilities.verifyElementVisibilityState(thinkSpherePage.yourPlanButton(), 'visible');
55
+ utilities.verifyCSS(thinkSpherePage.yourPlanButton(), {
56
+ 'background-color' : css.color.boxShadow,
57
+ 'color': css.color.primaryBtnDisabled,
58
+ });
59
+ });
60
+
61
+ it('Your Plan button should have disabled attribute', () => {
62
+ thinkSpherePage.steps.verifyYourPlanButtonInDisableState();
63
+ });
64
+ });
65
+ });
@@ -24,6 +24,11 @@ describe('Preview question : ThinkSphere Question - Solve Section - preview tab'
24
24
  thinkSpherePage.tests.verifyWhiteboardToolsAndSubTools(whiteBoardTools, editSectionWhiteBoardToolButtons);
25
25
  });
26
26
 
27
+ describe('Verify the Your plan Section', () => {
28
+ abortEarlySetup();
29
+ thinkSpherePage.tests.verifyYourPlanSection();
30
+ });
31
+
27
32
  describe('Whiteboard page navigation', () => {
28
33
  abortEarlySetup();
29
34
  thinkSpherePage.tests.verifyWhiteboardPageNavigation();
@@ -0,0 +1,53 @@
1
+ import uuid from 'react-uuid';
2
+ import { thinkSpherePage } from "../../../pages";
3
+ import { browseItemsPage } from "../../../pages/components/browseItemsPage";
4
+ import { commonComponents } from "../../../pages/components/commonComponents";
5
+ import abortEarlySetup from "../../../support/helpers/abortEarly";
6
+ import utilities from "../../../support/helpers/utilities";
7
+ import { whiteBoardTools, editSectionWhiteBoardToolButtons } from "../../../fixtures/thinkSphereWhiteboardTools";
8
+ const css = Cypress.env('css');
9
+
10
+ describe('Student view : ThinkSphere Question - Solve Section', () => {
11
+ before(() => {
12
+ cy.loginAs('admin');
13
+ thinkSpherePage.steps.navigateToThinkSphereCreateQuestion();
14
+ cy.barsPreLoaderWait();
15
+ thinkSpherePage.steps.switchToEditTab();
16
+ thinkSpherePage.steps.clickOnSolvePhaseAccordionIcon();
17
+ thinkSpherePage.steps.expandCustomizeToolsAndControls();
18
+ editSectionWhiteBoardToolButtons.forEach((toolName) => {
19
+ thinkSpherePage.steps.selectOptionFromToolsAndControls(toolName);
20
+ })
21
+ thinkSpherePage.steps.clickOnSaveButton();
22
+ cy.visit('/item-engine/thinksphere/browse-items');
23
+ browseItemsPage.steps.clickOnActionButton();
24
+ browseItemsPage.steps.clickOnActionMenuItem(0);
25
+ thinkSpherePage.steps.clickOnSolveTab();
26
+ });
27
+
28
+ describe('Whiteboard and its sections should be present', () => {
29
+ abortEarlySetup();
30
+ thinkSpherePage.tests.verifyWhiteBoardAndSections();
31
+ });
32
+
33
+ describe('Whiteboard tools and sub tools should be present', () => {
34
+ abortEarlySetup();
35
+ thinkSpherePage.tests.verifyAllDefaultToolIds(whiteBoardTools, editSectionWhiteBoardToolButtons);
36
+ thinkSpherePage.tests.verifyWhiteBoardSubTools(whiteBoardTools);
37
+ });
38
+
39
+ describe('Verify the Your plan Section', () => {
40
+ abortEarlySetup();
41
+ thinkSpherePage.tests.verifyYourPlanSection();
42
+ });
43
+
44
+ describe('Whiteboard page navigation', () => {
45
+ abortEarlySetup();
46
+ thinkSpherePage.tests.verifyWhiteboardPageNavigation();
47
+ });
48
+
49
+ describe('Verify Whiteboard recording', () => {
50
+ abortEarlySetup();
51
+ thinkSpherePage.tests.verifyWhiteboardRecordingAndPlayback(whiteBoardTools);
52
+ });
53
+ });
@@ -251,6 +251,14 @@ const selectors = {
251
251
  whiteboardVolumeSlider: () => cy.get('[class*=slider-container]'),
252
252
  submitButton: () => cy.get('button[aria-label="Submit"]'),
253
253
  goToGradingViewButton: () => cy.contains('button', 'GO TO GRADING VIEW'),
254
+ yourPlanButton: () => cy.get('button[class*="YourPlanButton"]'),
255
+ yourPlanContainer: () => cy.get('[class*="YourPlanContainer"]'),
256
+ yourPlanHeaderContainer: () => cy.get('[class*="ThinkSpherePreviewstyles__YourPlanHeaderContainer"]'),
257
+ yourPlanHeadingLabel: () => cy.get('[class*="ThinkSpherePreviewstyles__HeadingLabel"]'),
258
+ yourPlanCloseButton: () => cy.get('[class*="ThinkSpherePreviewstyles__CloseButton"]'),
259
+ yourPlanSubheading: () => cy.get('[class*="YourPlanstyles__Subheading"]'),
260
+ yourPlanTextarea: () => cy.get('[class*="YourPlanstyles__TextareaBox"]'),
261
+ yourPlanStrategiesList: () => cy.get('[class*="YourPlanstyles__StrategiesList"]'),
254
262
  };
255
263
 
256
264
  const steps = {
@@ -1349,6 +1357,11 @@ const steps = {
1349
1357
  })
1350
1358
  },
1351
1359
 
1360
+ /**
1361
+ * @description simulate a keyboard key press
1362
+ * @param {string} key - key to be pressed at the cursor
1363
+ */
1364
+
1352
1365
  clickOnReviewTab: () => {
1353
1366
  thinkSpherePage.reviewTab()
1354
1367
  .click();
@@ -1364,6 +1377,11 @@ const steps = {
1364
1377
  .click();
1365
1378
  },
1366
1379
 
1380
+ clickOnYourPlanButton : () => {
1381
+ thinkSpherePage.yourPlanButton()
1382
+ .click();
1383
+ },
1384
+
1367
1385
  switchToGradingView: () => {
1368
1386
  thinkSpherePage.gradingViewRadioButton()
1369
1387
  .click();
@@ -1383,6 +1401,11 @@ const steps = {
1383
1401
  cy.wait(2000);
1384
1402
  },
1385
1403
 
1404
+ submitResponseAndGotoGradingView : () => {
1405
+ thinkSpherePage.submitButton().click();
1406
+ thinkSpherePage.goToGradingViewButton().click();
1407
+ },
1408
+
1386
1409
  stepsBeforeGradingView: () => {
1387
1410
  thinkSpherePage.steps.expandChooseStarterDropdown();
1388
1411
  utilities.getNthElement(thinkSpherePage.chooseStartersListOptions(), 1).click();
@@ -1487,6 +1510,15 @@ const steps = {
1487
1510
  .should('have.attr', 'disabled');
1488
1511
  },
1489
1512
 
1513
+ verifyYourPlanButtonInDisableState : () => {
1514
+ thinkSpherePage.yourPlanButton()
1515
+ .should('have.attr', 'disabled');
1516
+ },
1517
+
1518
+ verifyYourPlanContainerVisibility: () => {
1519
+ utilities.verifyElementVisibilityState(thinkSpherePage.yourPlanContainer(), 'visible');
1520
+ },
1521
+
1490
1522
  /**
1491
1523
  * Verifies that the inner text of the whiteboard's recording status matches the expected text.
1492
1524
  *
@@ -1538,7 +1570,7 @@ const steps = {
1538
1570
  },
1539
1571
 
1540
1572
  verifyWhiteBoardRecordingInprogressWarningNotVisible: () => {
1541
- utilities.verifyElementVisibilityState(thinkSpherePage.whiteboardRecordingInProgressWarning(), 'not.be.visible');
1573
+ utilities.verifyElementVisibilityState(thinkSpherePage.whiteboardRecordingInProgressWarning(), 'notExist');
1542
1574
  },
1543
1575
 
1544
1576
  clickOnWhiteBoardRecordingInProgressWarningOkButton: () => {
@@ -1574,12 +1606,12 @@ const steps = {
1574
1606
 
1575
1607
  clickOnWhiteBoardPlaybackPlayButton: () => {
1576
1608
  thinkSpherePage.whiteboardPlaybackPlayButton()
1577
- .click();
1609
+ .click({ force: true });
1578
1610
  },
1579
1611
 
1580
1612
  clickOnWhiteBoardPlaybackPauseButton: () => {
1581
1613
  thinkSpherePage.whiteboardPlaybackPauseButton()
1582
- .click();
1614
+ .click({ force: true });
1583
1615
  },
1584
1616
 
1585
1617
  verifyWhiteBoardPlayerPauseButtonVisible: () => {
@@ -2498,9 +2530,8 @@ const tests = {
2498
2530
  * @param {string[]} editSectionWhiteBoardToolButtons - A list of tool names that will be enabled during edit phase.
2499
2531
  */
2500
2532
 
2501
- verifyWhiteboardToolsAndSubTools: (whiteBoardTools, editSectionWhiteBoardToolButtons) => {
2533
+ verifyAllDefaultToolIds: (whiteBoardTools, editSectionWhiteBoardToolButtons) => {
2502
2534
  const allToolIds = whiteBoardTools.map(tool => tool.dataTestId);
2503
-
2504
2535
  const defaultToolIds = whiteBoardTools.filter(tool => tool.isDefault).map(tool => tool.dataTestId);
2505
2536
 
2506
2537
  it(`${defaultToolIds.join(', ')} should be visible in the whiteboard by default`, () => {
@@ -2510,19 +2541,13 @@ const tests = {
2510
2541
  });
2511
2542
 
2512
2543
  it('All tools should be visible in the whiteboard after selected by the author', () => {
2513
- thinkSpherePage.steps.switchToEditTab();
2514
- thinkSpherePage.steps.clickOnSolvePhaseAccordionIcon();
2515
- thinkSpherePage.steps.expandCustomizeToolsAndControls();
2516
- editSectionWhiteBoardToolButtons.forEach((toolName) => {
2517
- thinkSpherePage.steps.selectOptionFromToolsAndControls(toolName);
2518
- })
2519
- thinkSpherePage.steps.switchToPreviewTab();
2520
- thinkSpherePage.steps.clickOnSolveTab();
2521
2544
  allToolIds.forEach((toolId) => {
2522
2545
  cy.get(`[data-testid="${toolId}"]`).should('exist').and('be.visible');
2523
2546
  });
2524
2547
  })
2548
+ },
2525
2549
 
2550
+ verifyWhiteBoardSubTools: (whiteBoardTools) => {
2526
2551
  whiteBoardTools.forEach((tool) => {
2527
2552
  it(`When user clicks on "${tool.name}" tool it should display its sub tools`, () => {
2528
2553
  // Click the main tool by data-testid
@@ -2573,6 +2598,169 @@ const tests = {
2573
2598
  });
2574
2599
  },
2575
2600
 
2601
+ verifyWhiteboardToolsAndSubTools: (whiteBoardTools, editSectionWhiteBoardToolButtons) => {
2602
+ const allToolIds = whiteBoardTools.map(tool => tool.dataTestId);
2603
+
2604
+ const defaultToolIds = whiteBoardTools.filter(tool => tool.isDefault).map(tool => tool.dataTestId);
2605
+
2606
+ it(`${defaultToolIds.join(', ')} should be visible in the whiteboard by default`, () => {
2607
+ defaultToolIds.forEach((toolId) => {
2608
+ cy.get(`[data-testid="${toolId}"]`).should('exist').and('be.visible');
2609
+ });
2610
+ });
2611
+
2612
+ it('All tools should be visible in the whiteboard after selected by the author', () => {
2613
+ thinkSpherePage.steps.switchToEditTab();
2614
+ thinkSpherePage.steps.clickOnSolvePhaseAccordionIcon();
2615
+ thinkSpherePage.steps.expandCustomizeToolsAndControls();
2616
+ editSectionWhiteBoardToolButtons.forEach((toolName) => {
2617
+ thinkSpherePage.steps.selectOptionFromToolsAndControls(toolName);
2618
+ })
2619
+ thinkSpherePage.steps.switchToPreviewTab();
2620
+ thinkSpherePage.steps.clickOnSolveTab();
2621
+ allToolIds.forEach((toolId) => {
2622
+ cy.get(`[data-testid="${toolId}"]`).should('exist').and('be.visible');
2623
+ });
2624
+ })
2625
+
2626
+ thinkSpherePage.tests.verifyWhiteBoardSubTools(whiteBoardTools);
2627
+ },
2628
+
2629
+ verifyDisabledWhiteboardTools: (defaultToolIds, allToolIds) => {
2630
+ it(`${defaultToolIds.join(', ')} should be visible in the whiteboard by default and it should be disabled with opacity 0.4`, () => {
2631
+ defaultToolIds.forEach((toolId) => {
2632
+ cy.get(`[data-testid="${toolId}"]`).should('exist').and('be.visible');
2633
+ cy.get(`[data-testid="${toolId}"]`).should('have.css', 'opacity', '0.4');
2634
+ });
2635
+ });
2636
+
2637
+ it('All tools should be visible in the whiteboard after selected by the author and it should be disabled with opacity 0.4', () => {
2638
+ allToolIds.forEach((toolId) => {
2639
+ cy.get(`[data-testid="${toolId}"]`).should('exist').and('be.visible');
2640
+ cy.get(`[data-testid="${toolId}"]`).should('have.css', 'opacity', '0.4');
2641
+ });
2642
+ });
2643
+ },
2644
+
2645
+ verifyYourPlanSection: () => {
2646
+ it('When user clicks on "Your Plan" button then it should navigate to Your Plan section', () => {
2647
+ thinkSpherePage.steps.clickOnYourPlanButton();
2648
+ thinkSpherePage.steps.verifyYourPlanContainerVisibility();
2649
+ });
2650
+
2651
+ it('Your Plan section should have a header with title and close button', () => {
2652
+ utilities.verifyElementVisibilityState(thinkSpherePage.yourPlanHeaderContainer(), 'visible');
2653
+ utilities.verifyInnerText(thinkSpherePage.yourPlanHeadingLabel(), 'Your plan');
2654
+ utilities.verifyElementVisibilityState(thinkSpherePage.yourPlanCloseButton(), 'visible');
2655
+ });
2656
+
2657
+ it('Your Plan section should display "The problem is asking me to" section with textarea', () => {
2658
+ utilities.verifyElementVisibilityState(thinkSpherePage.yourPlanSubheading().contains('The problem is asking me to'), 'visible');
2659
+ const problemTextarea = thinkSpherePage.yourPlanTextarea().first();
2660
+ utilities.verifyElementVisibilityState(problemTextarea, 'visible');
2661
+ problemTextarea.should('have.attr', 'placeholder', 'Enter your text here');
2662
+ });
2663
+
2664
+ it('Your Plan section should display "Selected strategies" section with checkboxes', () => {
2665
+ utilities.verifyElementVisibilityState(thinkSpherePage.yourPlanSubheading().contains('Selected strategies'), 'visible');
2666
+ utilities.verifyElementVisibilityState(thinkSpherePage.yourPlanStrategiesList(), 'visible');
2667
+ thinkSpherePage.yourPlanStrategiesList()
2668
+ .find('li')
2669
+ .should('have.length', 5);
2670
+ });
2671
+
2672
+ it('Your Plan section should display correct strategy options with checkboxes', () => {
2673
+ const expectedStrategies = [
2674
+ 'Create a model',
2675
+ 'Look for a pattern',
2676
+ 'Guess, check, and revise',
2677
+ 'Try with friendlier numbers',
2678
+ 'Show with an equation'
2679
+ ];
2680
+
2681
+ expectedStrategies.forEach((strategyText) => {
2682
+ thinkSpherePage.yourPlanStrategiesList()
2683
+ .contains(strategyText)
2684
+ .should('be.visible');
2685
+ });
2686
+
2687
+ thinkSpherePage.yourPlanStrategiesList()
2688
+ .find('input[type="checkbox"]')
2689
+ .should('have.length', 5)
2690
+ .and('not.be.checked');
2691
+ });
2692
+
2693
+ it('Your Plan section should display "Planning journal" section with textarea', () => {
2694
+ utilities.verifyElementVisibilityState(thinkSpherePage.yourPlanSubheading().contains('Planning journal'), 'visible');
2695
+ const journalTextarea = thinkSpherePage.yourPlanTextarea().last();
2696
+ utilities.verifyElementVisibilityState(journalTextarea, 'visible');
2697
+ journalTextarea.should('have.attr', 'placeholder', 'Enter your text here');
2698
+ });
2699
+
2700
+ it('User should be able to enter text in the "The problem is asking me to" textarea', () => {
2701
+ const testText = 'Find the value of x in the equation';
2702
+ thinkSpherePage.yourPlanTextarea().first().click({ force: true }).type(testText);
2703
+ thinkSpherePage.yourPlanTextarea().first().should('have.value', testText);
2704
+ });
2705
+
2706
+ it('User should be able to check and uncheck strategy options', () => {
2707
+ // Check first and third strategy options
2708
+ thinkSpherePage.yourPlanStrategiesList()
2709
+ .find('input[type="checkbox"]')
2710
+ .eq(0)
2711
+ .check()
2712
+ .should('be.checked');
2713
+
2714
+ thinkSpherePage.yourPlanStrategiesList()
2715
+ .find('input[type="checkbox"]')
2716
+ .eq(2)
2717
+ .check()
2718
+ .should('be.checked');
2719
+
2720
+ // Uncheck first strategy option
2721
+ thinkSpherePage.yourPlanStrategiesList()
2722
+ .find('input[type="checkbox"]')
2723
+ .eq(0)
2724
+ .uncheck()
2725
+ .should('not.be.checked');
2726
+ });
2727
+
2728
+ it('User should be able to enter text in the "Planning journal" textarea', () => {
2729
+ const testText = 'I will first identify the variables and then solve the equation';
2730
+ thinkSpherePage.yourPlanTextarea().last().clear().type(testText);
2731
+ thinkSpherePage.yourPlanTextarea().last().should('have.value', testText);
2732
+ });
2733
+
2734
+ it('When the user clicks on close button, the Your Plan section should be closed', () => {
2735
+ thinkSpherePage.yourPlanCloseButton().click();
2736
+ utilities.verifyElementVisibilityState(thinkSpherePage.yourPlanContainer(), 'notExist');
2737
+ });
2738
+
2739
+ it('CSS of Your Plan section', { tags: 'css' }, () => {
2740
+ thinkSpherePage.steps.clickOnYourPlanButton();
2741
+ utilities.verifyCSS(thinkSpherePage.yourPlanHeaderContainer(), {
2742
+ 'display': 'flex',
2743
+ 'justify-content': 'space-between',
2744
+ 'align-items': 'center',
2745
+ });
2746
+
2747
+ utilities.verifyCSS(thinkSpherePage.yourPlanHeadingLabel(), {
2748
+ 'font-size': css.fontSize.huge,
2749
+ 'font-weight': css.fontWeight.bold,
2750
+ 'color': css.color.panelLabel,
2751
+ });
2752
+
2753
+ utilities.verifyCSS(thinkSpherePage.yourPlanStrategiesList(), {
2754
+ 'padding': '0px',
2755
+ 'margin': '0px 0px 24px'
2756
+ });
2757
+ });
2758
+
2759
+ it('Accessibility of Your Plan section', { tags: 'a11y' }, () => {
2760
+ cy.checkAccessibility(thinkSpherePage.yourPlanContainer());
2761
+ });
2762
+ },
2763
+
2576
2764
  verifyWhiteboardPageNavigation: () => {
2577
2765
  it('By default "Previous" and "Next" page buttons should be disabled', () => {
2578
2766
  thinkSpherePage.steps.verifyPreviousButtonDisabled();
@@ -2655,7 +2843,7 @@ const tests = {
2655
2843
  'color': css.color.primaryBtn,
2656
2844
  'font-size': css.fontSize.default,
2657
2845
  'font-weight': css.fontWeight.semibold,
2658
- 'background-color': css.color.primaryBtnBg
2846
+ // 'background-color': css.color.primaryBtnBg
2659
2847
  });
2660
2848
  });
2661
2849
 
@@ -2672,7 +2860,7 @@ const tests = {
2672
2860
  .first()
2673
2861
  .click({ force: true });
2674
2862
  cy.get('.upper-canvas').click({ force: true });
2675
- cy.focused().type('Test text for recording');
2863
+ cy.wait(1000);
2676
2864
  thinkSpherePage.steps.clickOnStopButton();
2677
2865
  thinkSpherePage.steps.clickOnReviewTab();
2678
2866
  thinkSpherePage.steps.verifyWhiteBoardRecordingInprogressWarningNotVisible();
@@ -2684,6 +2872,8 @@ const tests = {
2684
2872
  });
2685
2873
 
2686
2874
  it('When the user clicks on the Play button, it should play the recording', () => {
2875
+ cy.wait(1000);
2876
+ thinkSpherePage.steps.verifyWhiteBoardPlayerPlayButtonVisible();
2687
2877
  thinkSpherePage.steps.clickOnWhiteBoardPlaybackPlayButton();
2688
2878
  thinkSpherePage.steps.verifyWhiteBoardPlayerPauseButtonVisible();
2689
2879
  thinkSpherePage.steps.verifyWhiteBoardPlayerTimeStatus('00:01');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "itemengine-cypress-automation",
3
- "version": "1.0.387-IEI-6161-IEI-6162-manualAndNonScoredScript-481a8a8.0",
3
+ "version": "1.0.387-IEI-6273-6d750cf.0",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {