itemengine-cypress-automation 1.0.376-resourceAndTools-fbbcf92.0 → 1.0.376
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,36 @@
|
|
1
|
+
import { thinkSpherePage } from "../../../pages";
|
2
|
+
import { browseItemsPage } from "../../../pages/components/browseItemsPage";
|
3
|
+
import { commonComponents } from "../../../pages/components/commonComponents";
|
4
|
+
import abortEarlySetup from "../../../support/helpers/abortEarly";
|
5
|
+
import utilities from "../../../support/helpers/utilities";
|
6
|
+
import { whiteBoardTools, editSectionWhiteBoardToolButtons } from "../../../fixtures/thinkSphereWhiteboardTools";
|
7
|
+
const css = Cypress.env('css');
|
8
|
+
|
9
|
+
describe('Preview question : ThinkSphere Question - Solve Section - preview tab', () => {
|
10
|
+
before(() => {
|
11
|
+
cy.loginAs('admin');
|
12
|
+
thinkSpherePage.steps.navigateToThinkSphereCreateQuestion();
|
13
|
+
thinkSpherePage.steps.switchToPreviewTab();
|
14
|
+
thinkSpherePage.steps.clickOnSolveTab();
|
15
|
+
});
|
16
|
+
|
17
|
+
describe('Whiteboard and its sections should be present', () => {
|
18
|
+
abortEarlySetup();
|
19
|
+
thinkSpherePage.tests.verifyWhiteBoardAndSections();
|
20
|
+
});
|
21
|
+
|
22
|
+
describe('Whiteboard tools and sub tools should be present', () => {
|
23
|
+
abortEarlySetup();
|
24
|
+
thinkSpherePage.tests.verifyWhiteboardToolsAndSubTools(whiteBoardTools, editSectionWhiteBoardToolButtons);
|
25
|
+
});
|
26
|
+
|
27
|
+
describe('Whiteboard page navigation', () => {
|
28
|
+
abortEarlySetup();
|
29
|
+
thinkSpherePage.tests.verifyWhiteboardPageNavigation();
|
30
|
+
});
|
31
|
+
|
32
|
+
describe('Verify Whiteboard recording', () => {
|
33
|
+
abortEarlySetup();
|
34
|
+
thinkSpherePage.tests.verifyWhiteboardRecordingAndPlayback(whiteBoardTools);
|
35
|
+
});
|
36
|
+
});
|
@@ -0,0 +1,66 @@
|
|
1
|
+
export const whiteBoardTools = [
|
2
|
+
{
|
3
|
+
dataTestId: 'add-text', isDefault: true,
|
4
|
+
name: 'text', subToolS: ['SPECIAL_CHARACTERS', 'MATH_CHARACTERS', 'TEXT_SIZE', 'TEXT_COLOR']
|
5
|
+
},
|
6
|
+
{ dataTestId: 'draw', isDefault: true, name: 'pen', subToolS: ['STROKE_COLOR'] },
|
7
|
+
{ dataTestId: 'highlighter', isDefault: true, name: 'highlighter' },
|
8
|
+
{ dataTestId: 'add-image', isDefault: true, name: 'image' },
|
9
|
+
{
|
10
|
+
dataTestId: 'add-shape', isDefault: true, name: 'shapes', subToolS: ['line', 'curvedarrow', 'verticalcurvedarrow',
|
11
|
+
'triangle', 'righttriangle', 'rectangle', 'oval', 'parallelogram', 'trapezoid', 'pentagon', 'hexagon',
|
12
|
+
'octagon', 'FILL_COLOR',
|
13
|
+
]
|
14
|
+
},
|
15
|
+
{
|
16
|
+
dataTestId: 'stamp', isDefault: true, name: 'stamp', popupSelector: 'stamps', popupContent: ['one-block', 'ten-block',
|
17
|
+
'hundred-block', 'stick-figure', 'one-cent', 'five-cent', 'ten-cent', 'twenty-five-cent',
|
18
|
+
'dollar one-dollar', 'dollar five-dollar', 'dollar ten-dollar', 'red-disc', 'yellow-disc'
|
19
|
+
]
|
20
|
+
},
|
21
|
+
{
|
22
|
+
dataTestId: 'unifix-cube', isDefault: false, name: 'unifix cube', subToolS: ['vertical-blue-unifix-cube', 'vertical-red-unifix-cube',
|
23
|
+
'vertical-green-unifix-cube', 'vertical-black-unifix-cube'
|
24
|
+
]
|
25
|
+
},
|
26
|
+
{ dataTestId: 'equation', isDefault: false, name: 'equation editor' },
|
27
|
+
{
|
28
|
+
dataTestId: 'diagram', isDefault: false, name: 'diagram', subToolS: ['ten-frame', 'place-value-mat',
|
29
|
+
'part-part-whole', 'l-diagram', 'equality-diagram'
|
30
|
+
]
|
31
|
+
},
|
32
|
+
{ dataTestId: 'array', isDefault: false, name: 'array', popupSelector: 'array-dimensions' },
|
33
|
+
{
|
34
|
+
dataTestId: 'numberline', isDefault: false, name: 'number line', popupSelector: 'number-line-chooser',
|
35
|
+
popupContent: ['number-line-0-10', 'number-line-0-20', 'blank', 'open', 'generator']
|
36
|
+
},
|
37
|
+
{
|
38
|
+
dataTestId: 'fraction-bar', isDefault: false, name: 'fraction bar', subToolS: ['fraction-bar-1', 'fraction-bar-1-2',
|
39
|
+
'fraction-bar-1-4', 'fraction-bar-1-3', 'fraction-bar-1-5', 'fraction-bar-1-6', 'fraction-bar-1-8',
|
40
|
+
'fraction-bar-1-10', 'fraction-bar-1-12', 'fraction-label-switch-div'
|
41
|
+
]
|
42
|
+
},
|
43
|
+
{ dataTestId: 'table', isDefault: false, name: 'table', popupSelector: 'array-dimensions' },
|
44
|
+
{
|
45
|
+
dataTestId: 'algebra-tile', isDefault: false, name: 'algebra tile', subToolS: ['algebra-tile-1', 'algebra-tile--1',
|
46
|
+
'algebra-tile-x2', 'algebra-tile--x2', 'algebra-tile-x', 'algebra-tile--x']
|
47
|
+
},
|
48
|
+
{ dataTestId: 'grid', isDefault: false, name: 'grid', subToolS: ['full-grid', 'positive-grid', 'open-grid', 'label-switch-div'] },
|
49
|
+
{ dataTestId: 'protractor', isDefault: false, name: 'protractor' },
|
50
|
+
{ dataTestId: 'ruler', isDefault: false, name: 'ruler' },
|
51
|
+
{ dataTestId: 'simplecalculator', isDefault: false, name: 'simple calculator' },
|
52
|
+
{ dataTestId: 'scientificcalculator', isDefault: false, name: 'scientific calculator' },
|
53
|
+
{ dataTestId: 'select', isDefault: true, name: 'select' },
|
54
|
+
{ dataTestId: 'eraser', isDefault: true, name: 'eraser', popupSelector: 'eraser-width-picker' },
|
55
|
+
{ dataTestId: 'item-eraser', isDefault: true, name: 'item eraser' },
|
56
|
+
// { dataTestId: 'delete', isDefault: true, name: 'delete' },
|
57
|
+
{ dataTestId: 'undo', isDefault: true, name: 'undo' },
|
58
|
+
{ dataTestId: 'redo', isDefault: true, name: 'redo' },
|
59
|
+
{ dataTestId: 'clear', isDefault: true, name: 'clear' }
|
60
|
+
];
|
61
|
+
|
62
|
+
export const editSectionWhiteBoardToolButtons = ['Unifix Cube', 'Diagrams', 'Array',
|
63
|
+
'Number line', 'Fraction bars', 'Protractor', 'Table', 'Grids',
|
64
|
+
'Equation editor', 'Algebra tiles', 'Ruler',
|
65
|
+
'Simple Calculator', 'Scientific Calculator'
|
66
|
+
];
|
@@ -213,6 +213,7 @@ const selectors = {
|
|
213
213
|
cardLabel: () => cy.get('.widget-card-label'),
|
214
214
|
thinkSphereQuestionInstructionCKEditor: () => cy.get('div.cke_editable[contenteditable="true"]'),
|
215
215
|
reviewTab: () => cy.get('div[aria-label="Review tab"]'),
|
216
|
+
solveTab: () => cy.get('div[aria-label="Solve tab"]'),
|
216
217
|
planTab: () => cy.get('div[aria-label="Plan tab"]'),
|
217
218
|
checkYourMathHeading: () => utilities.getNthElement(cy.get('div[class*="ReviewTabstyles__CheckYourMathTextWrapper"]'), 0),
|
218
219
|
problemAskingToMeTextWrapper: () => utilities.getNthElement(cy.get('div[class*="ReviewTabstyles__ProblemAskingToMeTextWrapper"]'), 0),
|
@@ -222,6 +223,34 @@ const selectors = {
|
|
222
223
|
gradingViewRadioButton: () => cy.get('label[aria-label="Grading View"]'),
|
223
224
|
studentViewRadioButton: () => cy.get('label[aria-label="Student View"]'),
|
224
225
|
correctAnswerLabelWrapper: () => cy.get('div[class*="CorrectAnswerLabelWrapper"]'),
|
226
|
+
whiteboardComponent: () => cy.get('.whiteboard'),
|
227
|
+
whiteBoardTools: () => cy.get('.tools'),
|
228
|
+
whiteBoardSubTools: () => cy.get('.subtools'),
|
229
|
+
whiteBoardCanvasContainer: () => cy.get('.canvas-container'),
|
230
|
+
whiteBoardFooter: () => cy.get('.footer-container'),
|
231
|
+
whiteBoardNewPage: () => cy.get('[data-testid=new-page]'),
|
232
|
+
whiteBoardPreviousPage: () => cy.get('[data-testid=previous]'),
|
233
|
+
whiteBoardNextPage: () => cy.get('[data-testid=next]'),
|
234
|
+
whiteBoardRecordOrPauseButton: () => cy.get('[data-testid=record]'),
|
235
|
+
whiteBoardStopButton: () => cy.get('[data-testid=stop]'),
|
236
|
+
whiteBoardPage: () => cy.get('.page'),
|
237
|
+
whiteboardRecordingStatus: () => cy.get('.status-container'),
|
238
|
+
whiteboardRecordingTimeStatus: () => cy.get('.timecode-container'),
|
239
|
+
whiteboardPlayBackStatus: () => cy.get('[class*=ReviewTabstyles__ThinkSphereWhiteboardPlayerContainer]'),
|
240
|
+
whiteboardPlayer: () => cy.get('[class*=ThinkSphereWhiteboardPlayerstyles__ThinkSphereWhiteboardPlayerWrapper]'),
|
241
|
+
whiteboardRecordingInProgressWarning: () => cy.get('[class*=whiteboard-recording-warning-popup]'),
|
242
|
+
whiteboardRecordingInProgressWarningOkButton: () => cy.get('[data-testid=accept-button]'),
|
243
|
+
whiteboardRecordingInProgressWarningHeader: () => cy.get('#alert-dialog-title'),
|
244
|
+
whiteboardRecordingInProgressWarningDescription: () => cy.get('#alert-dialog-description'),
|
245
|
+
whiteboardPlaybackPlayButton: () => cy.get('[data-testid=play]'),
|
246
|
+
whiteboardPlaybackPauseButton: () => cy.get('[data-testid=pause]'),
|
247
|
+
whiteboardPlaybackTime: () => cy.get('[data-testid=time]'),
|
248
|
+
whiteboardPlaybackSpeakerButton: () => cy.get('.speaker-button'),
|
249
|
+
whiteboardVolumeIcon: () => cy.get('.volume-icon'),
|
250
|
+
whiteboardMutedIcon: () => cy.get('.mute-icon'),
|
251
|
+
whiteboardVolumeSlider: () => cy.get('[class*=slider-container]'),
|
252
|
+
submitButton: () => cy.get('button[aria-label="Submit"]'),
|
253
|
+
goToGradingViewButton: () => cy.contains('button', 'GO TO GRADING VIEW'),
|
225
254
|
};
|
226
255
|
|
227
256
|
const steps = {
|
@@ -317,7 +346,7 @@ const steps = {
|
|
317
346
|
clickOnCancelButton: () => {
|
318
347
|
cy.interceptGraphql('setItem');
|
319
348
|
thinkSpherePage.cancelButton()
|
320
|
-
.click(
|
349
|
+
.click();
|
321
350
|
},
|
322
351
|
|
323
352
|
clickOnSwapButton: () => {
|
@@ -1218,12 +1247,15 @@ const steps = {
|
|
1218
1247
|
});
|
1219
1248
|
},
|
1220
1249
|
|
1221
|
-
verifyProblemAskingMicSection: () => {
|
1250
|
+
verifyProblemAskingMicSection: (isGrading=false) => {
|
1222
1251
|
thinkSpherePage.problemAskingWrapper()
|
1223
1252
|
.within(() => {
|
1224
1253
|
utilities.verifyElementVisibilityState(thinkSpherePage.micIconWrapper(), 'visible');
|
1225
1254
|
utilities.verifyElementAttribute(thinkSpherePage.micIconWrapper(), 'role', 'button');
|
1226
1255
|
utilities.verifyElementAttribute(thinkSpherePage.micIconWrapper(), 'aria-label', 'Mic button');
|
1256
|
+
if(isGrading) {
|
1257
|
+
utilities.verifyElementAttribute(thinkSpherePage.micIconWrapper(), 'tabindex', -1);
|
1258
|
+
}
|
1227
1259
|
});
|
1228
1260
|
},
|
1229
1261
|
|
@@ -1259,13 +1291,16 @@ const steps = {
|
|
1259
1291
|
});
|
1260
1292
|
},
|
1261
1293
|
|
1262
|
-
verifyWritePlanMicSection: () => {
|
1294
|
+
verifyWritePlanMicSection: (isGrading=false) => {
|
1263
1295
|
thinkSpherePage.writePlanWrapper()
|
1264
|
-
|
1265
|
-
|
1266
|
-
|
1267
|
-
|
1268
|
-
|
1296
|
+
.within(() => {
|
1297
|
+
utilities.verifyElementVisibilityState(thinkSpherePage.micIconWrapper(), 'visible');
|
1298
|
+
utilities.verifyElementAttribute(thinkSpherePage.micIconWrapper(), 'role', 'button');
|
1299
|
+
utilities.verifyElementAttribute(thinkSpherePage.micIconWrapper(), 'aria-label', 'Mic button');
|
1300
|
+
if(isGrading) {
|
1301
|
+
utilities.verifyElementAttribute(thinkSpherePage.micIconWrapper(), 'tabindex', -1);
|
1302
|
+
}
|
1303
|
+
});
|
1269
1304
|
},
|
1270
1305
|
|
1271
1306
|
verifyWritePlanTextAreaFunctionality: (planTextToEnter) => {
|
@@ -1319,6 +1354,11 @@ const steps = {
|
|
1319
1354
|
.click();
|
1320
1355
|
},
|
1321
1356
|
|
1357
|
+
clickOnSolveTab: () => {
|
1358
|
+
thinkSpherePage.solveTab()
|
1359
|
+
.click();
|
1360
|
+
},
|
1361
|
+
|
1322
1362
|
clickOnPlanTab: () => {
|
1323
1363
|
thinkSpherePage.planTab()
|
1324
1364
|
.click();
|
@@ -1343,6 +1383,53 @@ const steps = {
|
|
1343
1383
|
cy.wait(2000);
|
1344
1384
|
},
|
1345
1385
|
|
1386
|
+
stepsBeforeGradingView: () => {
|
1387
|
+
thinkSpherePage.steps.expandChooseStarterDropdown();
|
1388
|
+
utilities.getNthElement(thinkSpherePage.chooseStartersListOptions(), 1).click();
|
1389
|
+
thinkSpherePage.problemAskingWrapper().first()
|
1390
|
+
.within(() => {
|
1391
|
+
thinkSpherePage.contentEditableDiv().type('This is a test text for the problem.');
|
1392
|
+
});
|
1393
|
+
thinkSpherePage.strategyChip().click();
|
1394
|
+
thinkSpherePage.submitButton().click();
|
1395
|
+
thinkSpherePage.goToGradingViewButton().click();
|
1396
|
+
},
|
1397
|
+
|
1398
|
+
verifyAddStrategiesButtonDisabled: () => {
|
1399
|
+
thinkSpherePage.addNewStrategyButton().should('have.attr', 'tabindex', '-1');
|
1400
|
+
thinkSpherePage.addNewStrategyButton().click({ force: true });
|
1401
|
+
utilities.verifyElementVisibilityState(thinkSpherePage.popupTitle(), 'notExist');
|
1402
|
+
},
|
1403
|
+
|
1404
|
+
verifyStrategiesListButtonDisabled: () => {
|
1405
|
+
utilities.getNthElement(thinkSpherePage.strategiesPreviewListLI(), 0).should('have.attr', 'tabindex', '-1');
|
1406
|
+
utilities.getNthElement(thinkSpherePage.strategiesPreviewListLI(), 0).should('have.attr', 'aria-disabled', 'true');
|
1407
|
+
},
|
1408
|
+
|
1409
|
+
verifySentenceStarterDropDownDisabled: () => {
|
1410
|
+
thinkSpherePage.chooseStarterDropdown().should('have.attr', 'aria-disabled', 'true');
|
1411
|
+
},
|
1412
|
+
|
1413
|
+
verifyDisabledProblemTextContainer: (textToEnter) => {
|
1414
|
+
thinkSpherePage.problemAskingWrapper()
|
1415
|
+
.within(() => {
|
1416
|
+
thinkSpherePage.contentEditableDiv().should('have.attr', 'readonly');
|
1417
|
+
thinkSpherePage.contentEditableDiv().should('have.value', textToEnter);
|
1418
|
+
});
|
1419
|
+
},
|
1420
|
+
|
1421
|
+
verifyDisabledWriteYourPlanTextContainer: (textToEnter) => {
|
1422
|
+
thinkSpherePage.writePlanWrapper()
|
1423
|
+
.within(() => {
|
1424
|
+
thinkSpherePage.contentEditableDiv().should('have.attr', 'readonly');
|
1425
|
+
thinkSpherePage.contentEditableDiv().should('have.value', textToEnter);
|
1426
|
+
});
|
1427
|
+
},
|
1428
|
+
|
1429
|
+
verifyDisabledStrategyChip: () => {
|
1430
|
+
thinkSpherePage.strategyChip().should('have.attr', 'tabindex', -1);
|
1431
|
+
},
|
1432
|
+
|
1346
1433
|
verifyQuestionInstructionPreviewTexWrapperVisibility: (instructionText) => {
|
1347
1434
|
utilities.verifyElementVisibilityState(thinkSpherePage.questionInstructionPreviewTexWrapper(), 'visible');
|
1348
1435
|
utilities.verifyInnerText(thinkSpherePage.questionInstructionPreviewTexWrapper(), instructionText);
|
@@ -1352,6 +1439,197 @@ const steps = {
|
|
1352
1439
|
utilities.verifyElementVisibilityState(thinkSpherePage.questionInstructionPreviewImageWrapper(), 'visible');
|
1353
1440
|
utilities.verifyElementVisibilityState(thinkSpherePage.questionInstructionPreviewImageExpandButton(), 'visible');
|
1354
1441
|
},
|
1442
|
+
|
1443
|
+
verifyWhiteBoardVisibility: () => {
|
1444
|
+
utilities.verifyElementVisibilityState(thinkSpherePage.whiteboardComponent(), 'visible');
|
1445
|
+
},
|
1446
|
+
|
1447
|
+
verifyWhiteBoardSectionsVisibility: () => {
|
1448
|
+
utilities.verifyElementVisibilityState(thinkSpherePage.whiteBoardTools(), 'visible');
|
1449
|
+
utilities.verifyElementVisibilityState(thinkSpherePage.whiteBoardSubTools(), 'visible');
|
1450
|
+
utilities.verifyElementVisibilityState(thinkSpherePage.whiteBoardCanvasContainer(), 'visible');
|
1451
|
+
utilities.verifyElementVisibilityState(thinkSpherePage.whiteBoardFooter(), 'visible');
|
1452
|
+
},
|
1453
|
+
|
1454
|
+
/**
|
1455
|
+
* Verifies that the inner text of the whiteboard's page label matches the expected text.
|
1456
|
+
*
|
1457
|
+
* @param {string} text - The exact text expected to be present in the page label element (e.g., "Page1 / 1").
|
1458
|
+
*/
|
1459
|
+
|
1460
|
+
verifyInnerTextOfPageLabel: (text) => {
|
1461
|
+
thinkSpherePage.whiteBoardPage()
|
1462
|
+
.should('have.text', text);
|
1463
|
+
},
|
1464
|
+
|
1465
|
+
clickOnWhiteBoardNewPageButton: () => {
|
1466
|
+
thinkSpherePage.whiteBoardNewPage()
|
1467
|
+
.click();
|
1468
|
+
},
|
1469
|
+
|
1470
|
+
clickOnPreviousButton: () => {
|
1471
|
+
thinkSpherePage.whiteBoardPreviousPage()
|
1472
|
+
.click();
|
1473
|
+
},
|
1474
|
+
|
1475
|
+
clickOnNextButton: () => {
|
1476
|
+
thinkSpherePage.whiteBoardNextPage()
|
1477
|
+
.click();
|
1478
|
+
},
|
1479
|
+
|
1480
|
+
verifyPreviousButtonDisabled: () => {
|
1481
|
+
thinkSpherePage.whiteBoardPreviousPage()
|
1482
|
+
.should('have.attr', 'disabled');
|
1483
|
+
},
|
1484
|
+
|
1485
|
+
verifyNextButtonDisabled: () => {
|
1486
|
+
thinkSpherePage.whiteBoardNextPage()
|
1487
|
+
.should('have.attr', 'disabled');
|
1488
|
+
},
|
1489
|
+
|
1490
|
+
/**
|
1491
|
+
* Verifies that the inner text of the whiteboard's recording status matches the expected text.
|
1492
|
+
*
|
1493
|
+
* @param {string} text - The exact text expected to be present in the recording status element (e.g., "Ready").
|
1494
|
+
*/
|
1495
|
+
|
1496
|
+
verifyRecordingStatus: (text) => {
|
1497
|
+
thinkSpherePage.whiteboardRecordingStatus()
|
1498
|
+
.should('have.text', text);
|
1499
|
+
},
|
1500
|
+
|
1501
|
+
verifyRecordingTimeStatusNotPresent: () => {
|
1502
|
+
thinkSpherePage.whiteboardRecordingTimeStatus()
|
1503
|
+
.should('have.text', '');
|
1504
|
+
},
|
1505
|
+
|
1506
|
+
verifyRecordingTimeStatusPresent: () => {
|
1507
|
+
thinkSpherePage.whiteboardRecordingTimeStatus()
|
1508
|
+
.invoke('text')
|
1509
|
+
.should('not.be.empty');
|
1510
|
+
},
|
1511
|
+
|
1512
|
+
clickOnRecordingOrPauseButton: () => {
|
1513
|
+
thinkSpherePage.whiteBoardRecordOrPauseButton()
|
1514
|
+
.click();
|
1515
|
+
},
|
1516
|
+
|
1517
|
+
clickOnStopButton: () => {
|
1518
|
+
thinkSpherePage.whiteBoardStopButton()
|
1519
|
+
.click();
|
1520
|
+
},
|
1521
|
+
|
1522
|
+
/**
|
1523
|
+
* Verifies that the inner text of the whiteboard's playback element matches the expected text.
|
1524
|
+
*
|
1525
|
+
* @param {string} text - The exact text expected to be present in the playback element (e.g., "Watch your recordingNo recording available.").
|
1526
|
+
*/
|
1527
|
+
|
1528
|
+
verifyPlayBackNotAvailable: (text) => {
|
1529
|
+
thinkSpherePage.whiteboardPlayBackStatus().should('have.text', text);
|
1530
|
+
},
|
1531
|
+
|
1532
|
+
verifyWhiteBoardPlayer: () => {
|
1533
|
+
utilities.verifyElementVisibilityState(thinkSpherePage.whiteboardPlayer(), 'visible');
|
1534
|
+
},
|
1535
|
+
|
1536
|
+
verifyWhiteBoardRecordingInprogressWarning: () => {
|
1537
|
+
utilities.verifyElementVisibilityState(thinkSpherePage.whiteboardRecordingInProgressWarning(), 'visible');
|
1538
|
+
},
|
1539
|
+
|
1540
|
+
verifyWhiteBoardRecordingInprogressWarningNotVisible: () => {
|
1541
|
+
utilities.verifyElementVisibilityState(thinkSpherePage.whiteboardRecordingInProgressWarning(), 'not.be.visible');
|
1542
|
+
},
|
1543
|
+
|
1544
|
+
clickOnWhiteBoardRecordingInProgressWarningOkButton: () => {
|
1545
|
+
thinkSpherePage.whiteboardRecordingInProgressWarningOkButton()
|
1546
|
+
.click();
|
1547
|
+
},
|
1548
|
+
|
1549
|
+
/**
|
1550
|
+
* Verifies that the inner text of the whiteboard's warning text header matches the expected text.
|
1551
|
+
*
|
1552
|
+
* @param {string} text - The exact text expected to be present in the warning text header element (e.g., "Recording in Progress").
|
1553
|
+
*/
|
1554
|
+
|
1555
|
+
verifyWhiteboardWarningHeaderText: (text) => {
|
1556
|
+
thinkSpherePage.whiteboardRecordingInProgressWarningHeader()
|
1557
|
+
.should('have.text', text);
|
1558
|
+
},
|
1559
|
+
|
1560
|
+
/**
|
1561
|
+
* Verifies that the inner text of the whiteboard's whiteboard warning description matches the expected text.
|
1562
|
+
*
|
1563
|
+
* @param {string} expected - The exact text expected to be present in the whiteboard warning description element (e.g., "You're currently recording your work. To avoid losing progress, please return and click Stop to save the recording.").
|
1564
|
+
*/
|
1565
|
+
|
1566
|
+
verifyWhiteboardWarningDescriptionText: (expected) => {
|
1567
|
+
thinkSpherePage.whiteboardRecordingInProgressWarningDescription()
|
1568
|
+
.invoke('text')
|
1569
|
+
.then((text) => {
|
1570
|
+
const cleanText = text.replace(/\s+/g, ' ').trim();
|
1571
|
+
expect(cleanText).to.eq(expected);
|
1572
|
+
});
|
1573
|
+
},
|
1574
|
+
|
1575
|
+
clickOnWhiteBoardPlaybackPlayButton: () => {
|
1576
|
+
thinkSpherePage.whiteboardPlaybackPlayButton()
|
1577
|
+
.click();
|
1578
|
+
},
|
1579
|
+
|
1580
|
+
clickOnWhiteBoardPlaybackPauseButton: () => {
|
1581
|
+
thinkSpherePage.whiteboardPlaybackPauseButton()
|
1582
|
+
.click();
|
1583
|
+
},
|
1584
|
+
|
1585
|
+
verifyWhiteBoardPlayerPauseButtonVisible: () => {
|
1586
|
+
thinkSpherePage.whiteboardPlaybackPauseButton()
|
1587
|
+
.should('be.visible')
|
1588
|
+
cy.wait(1000);
|
1589
|
+
},
|
1590
|
+
|
1591
|
+
verifyWhiteBoardPlayerPlayButtonVisible: () => {
|
1592
|
+
thinkSpherePage.whiteboardPlaybackPlayButton()
|
1593
|
+
.should('be.visible');
|
1594
|
+
},
|
1595
|
+
|
1596
|
+
/**
|
1597
|
+
* Verifies that the inner text of the whiteboard's player time status matches the expected text.
|
1598
|
+
*
|
1599
|
+
* @param {string} time - The exact text expected to be present in the player time status element (e.g., "00:00").
|
1600
|
+
*/
|
1601
|
+
|
1602
|
+
verifyWhiteBoardPlayerTimeStatus: (time) => {
|
1603
|
+
thinkSpherePage.whiteboardPlaybackTime()
|
1604
|
+
.invoke('text')
|
1605
|
+
.then((text) => {
|
1606
|
+
const currentTime = text.split('/')[0].trim(); // get part before "/"
|
1607
|
+
expect(currentTime).to.eq(time);
|
1608
|
+
});
|
1609
|
+
},
|
1610
|
+
|
1611
|
+
clickOnWhiteBoardPlaybackSpeakerButton: () => {
|
1612
|
+
thinkSpherePage.whiteboardPlaybackSpeakerButton()
|
1613
|
+
.click();
|
1614
|
+
},
|
1615
|
+
|
1616
|
+
verifyWhiteBoardPlayerVolumeMuted: () => {
|
1617
|
+
utilities.verifyElementVisibilityState(thinkSpherePage.whiteboardMutedIcon(), 'visible');
|
1618
|
+
},
|
1619
|
+
|
1620
|
+
verifyWhiteBoardPlayerVolumeUnmuted: () => {
|
1621
|
+
utilities.verifyElementVisibilityState(thinkSpherePage.whiteboardVolumeIcon(), 'visible');
|
1622
|
+
},
|
1623
|
+
|
1624
|
+
hoverOverWhiteBoardPlaybackSpeakerButton: () => {
|
1625
|
+
thinkSpherePage.whiteboardPlaybackSpeakerButton()
|
1626
|
+
.realHover({ position: 'top' });
|
1627
|
+
},
|
1628
|
+
|
1629
|
+
verifyWhiteBoardPlayerVolumeSliderVisible: () => {
|
1630
|
+
thinkSpherePage.whiteboardVolumeSlider()
|
1631
|
+
.should('be.visible');
|
1632
|
+
}
|
1355
1633
|
};
|
1356
1634
|
|
1357
1635
|
const tests = {
|
@@ -2176,6 +2454,258 @@ const tests = {
|
|
2176
2454
|
utilities.clickOnBody();
|
2177
2455
|
});
|
2178
2456
|
},
|
2457
|
+
|
2458
|
+
verifyWhiteBoardAndSections: () => {
|
2459
|
+
it('Whiteboard should be present in the solve tab', () => {
|
2460
|
+
thinkSpherePage.steps.verifyWhiteBoardVisibility();
|
2461
|
+
});
|
2462
|
+
|
2463
|
+
it('Whiteboard should contain toolbar, subtools, whiteboard canvas and footer sections', () => {
|
2464
|
+
thinkSpherePage.steps.verifyWhiteBoardSectionsVisibility();
|
2465
|
+
});
|
2466
|
+
|
2467
|
+
it('CSS of whiteboard sections', { tags: 'css' }, () => {
|
2468
|
+
utilities.verifyCSS(thinkSpherePage.whiteBoardTools(), {
|
2469
|
+
'padding': '5px 8px',
|
2470
|
+
'position': 'static',
|
2471
|
+
'display': 'flex',
|
2472
|
+
'flex-wrap': 'wrap'
|
2473
|
+
});
|
2474
|
+
utilities.verifyCSS(thinkSpherePage.whiteBoardSubTools(), {
|
2475
|
+
'margin': '0px 8px',
|
2476
|
+
'padding': '4px 8px',
|
2477
|
+
'borderTop': `1px solid ${css.color.secondaryBtnBorder}`,
|
2478
|
+
'minHeight': '49px',
|
2479
|
+
});
|
2480
|
+
});
|
2481
|
+
|
2482
|
+
it('Accessibility of Whiteboard', { tags: 'a11y' }, () => {
|
2483
|
+
cy.checkAccessibility(thinkSpherePage.whiteboardComponent());
|
2484
|
+
});
|
2485
|
+
},
|
2486
|
+
|
2487
|
+
/**
|
2488
|
+
* Verifies default visibility, selection, and behavior of whiteboard tools and their subtools.
|
2489
|
+
*
|
2490
|
+
* @param {Array<Object>} whiteBoardTools - An array of tool objects, where each object contains:
|
2491
|
+
* @param {string} whiteBoardTools[].name - Display name of the tool.
|
2492
|
+
* @param {string} whiteBoardTools[].dataTestId - The `data-testid` used to locate the tool in the DOM.
|
2493
|
+
* @param {boolean} [whiteBoardTools[].isDefault] - Whether the tool is visible by default.
|
2494
|
+
* @param {string[]} [whiteBoardTools[].subToolS] - An array of subtool identifiers (data-testid, data-name, or class).
|
2495
|
+
* @param {string} [whiteBoardTools[].popupSelector] - A selector used to locate popup elements that appear after tool interaction.
|
2496
|
+
* @param {string[]} [whiteBoardTools[].popupContent] - Optional array of class names used to verify the popup’s inner content.
|
2497
|
+
*
|
2498
|
+
* @param {string[]} editSectionWhiteBoardToolButtons - A list of tool names that will be enabled during edit phase.
|
2499
|
+
*/
|
2500
|
+
|
2501
|
+
verifyWhiteboardToolsAndSubTools: (whiteBoardTools, editSectionWhiteBoardToolButtons) => {
|
2502
|
+
const allToolIds = whiteBoardTools.map(tool => tool.dataTestId);
|
2503
|
+
|
2504
|
+
const defaultToolIds = whiteBoardTools.filter(tool => tool.isDefault).map(tool => tool.dataTestId);
|
2505
|
+
|
2506
|
+
it(`${defaultToolIds.join(', ')} should be visible in the whiteboard by default`, () => {
|
2507
|
+
defaultToolIds.forEach((toolId) => {
|
2508
|
+
cy.get(`[data-testid="${toolId}"]`).should('exist').and('be.visible');
|
2509
|
+
});
|
2510
|
+
});
|
2511
|
+
|
2512
|
+
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
|
+
allToolIds.forEach((toolId) => {
|
2522
|
+
cy.get(`[data-testid="${toolId}"]`).should('exist').and('be.visible');
|
2523
|
+
});
|
2524
|
+
})
|
2525
|
+
|
2526
|
+
whiteBoardTools.forEach((tool) => {
|
2527
|
+
it(`When user clicks on "${tool.name}" tool it should display its sub tools`, () => {
|
2528
|
+
// Click the main tool by data-testid
|
2529
|
+
cy.get(`[data-testid="${tool.dataTestId}"]`)
|
2530
|
+
.and('be.visible')
|
2531
|
+
.first()
|
2532
|
+
.click({ force: true }) // force in case some are behind overlays
|
2533
|
+
cy.wait(1000); // Wait for any animations or transitions to complete
|
2534
|
+
|
2535
|
+
// If the tool has subtools, verify each
|
2536
|
+
if (tool.subToolS && tool.subToolS.length > 0) {
|
2537
|
+
tool.subToolS.forEach((subTool) => {
|
2538
|
+
// Try data-testid first, fall back to data-name if needed
|
2539
|
+
cy.get(`[data-testid="${subTool}"], [data-name="${subTool}"], [class*="${subTool}"]`)
|
2540
|
+
.should('exist')
|
2541
|
+
.and('be.visible');
|
2542
|
+
});
|
2543
|
+
}
|
2544
|
+
|
2545
|
+
if(tool.popupSelector) {
|
2546
|
+
// Verify the popup selector if it exists
|
2547
|
+
if(tool.popupSelector === 'eraser-width-picker') {
|
2548
|
+
cy.get(`[data-name="ERASER_THICKNESS"]`)
|
2549
|
+
.should('exist')
|
2550
|
+
.and('be.visible')
|
2551
|
+
.first()
|
2552
|
+
.click({ force: true });
|
2553
|
+
cy.get(`[class*="${tool.popupSelector}"]`).should('exist').and('be.visible');
|
2554
|
+
} else {
|
2555
|
+
cy.get(`[data-testid="${tool.popupSelector}"]`).should('exist').and('be.visible');
|
2556
|
+
}
|
2557
|
+
if(tool.popupContent) {
|
2558
|
+
// Verify the content inside the popup
|
2559
|
+
tool.popupContent.forEach((content) => {
|
2560
|
+
cy.get(`[class="${content}"]`).should('exist').and('be.visible');
|
2561
|
+
});
|
2562
|
+
}
|
2563
|
+
}
|
2564
|
+
|
2565
|
+
if(tool.name === 'simple calculator' || tool.name ==='scientific calculator') {
|
2566
|
+
cy.get(`[data-testid="${tool.dataTestId}"]`)
|
2567
|
+
.and('be.visible')
|
2568
|
+
.first()
|
2569
|
+
.click({ force: true }) // force in case some are behind overlays
|
2570
|
+
cy.wait(1000);
|
2571
|
+
}
|
2572
|
+
});
|
2573
|
+
});
|
2574
|
+
},
|
2575
|
+
|
2576
|
+
verifyWhiteboardPageNavigation: () => {
|
2577
|
+
it('By default "Previous" and "Next" page buttons should be disabled', () => {
|
2578
|
+
thinkSpherePage.steps.verifyPreviousButtonDisabled();
|
2579
|
+
thinkSpherePage.steps.verifyNextButtonDisabled();
|
2580
|
+
});
|
2581
|
+
it('When user clicks on "New Page" button it should create new page', () => {
|
2582
|
+
thinkSpherePage.steps.verifyInnerTextOfPageLabel('Page1 / 1');
|
2583
|
+
thinkSpherePage.steps.clickOnWhiteBoardNewPageButton();
|
2584
|
+
thinkSpherePage.steps.verifyInnerTextOfPageLabel('Page2 / 2');
|
2585
|
+
thinkSpherePage.steps.verifyNextButtonDisabled();
|
2586
|
+
});
|
2587
|
+
it('When user clicks on "Previous" button then it should navigate to the previous page', () => {
|
2588
|
+
thinkSpherePage.steps.clickOnPreviousButton();
|
2589
|
+
thinkSpherePage.steps.verifyInnerTextOfPageLabel('Page1 / 2');
|
2590
|
+
thinkSpherePage.steps.verifyPreviousButtonDisabled();
|
2591
|
+
});
|
2592
|
+
it('When user clicks on "Next" button then it should navigate to the next page', () => {
|
2593
|
+
thinkSpherePage.steps.clickOnNextButton();
|
2594
|
+
thinkSpherePage.steps.verifyInnerTextOfPageLabel('Page2 / 2');
|
2595
|
+
thinkSpherePage.steps.verifyNextButtonDisabled();
|
2596
|
+
});
|
2597
|
+
},
|
2598
|
+
|
2599
|
+
/**
|
2600
|
+
* Verifies the full recording and playback functionality of the whiteboard, including status changes,
|
2601
|
+
* UI updates, warnings, and accessibility features.
|
2602
|
+
*
|
2603
|
+
* @param {Array<Object>} whiteBoardTools - An array of whiteboard tool objects used to simulate interactions during recording.
|
2604
|
+
* @param {string} whiteBoardTools[].dataTestId - The `data-testid` used to identify the tool.
|
2605
|
+
*/
|
2606
|
+
|
2607
|
+
verifyWhiteboardRecordingAndPlayback: (whiteBoardTools) => {
|
2608
|
+
it('By default the recording status should be "Ready" and there should be no time status of recording', () => {
|
2609
|
+
thinkSpherePage.steps.verifyRecordingStatus('Ready');
|
2610
|
+
thinkSpherePage.steps.verifyRecordingTimeStatusNotPresent();
|
2611
|
+
});
|
2612
|
+
|
2613
|
+
it('By default "Review" tab should contain "Watch your recording No recording available." before recording', () => {
|
2614
|
+
thinkSpherePage.steps.clickOnReviewTab();
|
2615
|
+
thinkSpherePage.steps.verifyPlayBackNotAvailable('Watch your recordingNo recording available.');
|
2616
|
+
thinkSpherePage.steps.clickOnSolveTab();
|
2617
|
+
});
|
2618
|
+
|
2619
|
+
it('When the user clicks on the recording button, the recording status should be "Recording"', () => {
|
2620
|
+
thinkSpherePage.steps.clickOnRecordingOrPauseButton();
|
2621
|
+
thinkSpherePage.steps.verifyRecordingStatus('Recording');
|
2622
|
+
thinkSpherePage.steps.verifyRecordingTimeStatusPresent();
|
2623
|
+
});
|
2624
|
+
|
2625
|
+
it('When the user clicks on the pause button, the recording status should be "Paused"', () => {
|
2626
|
+
thinkSpherePage.steps.clickOnRecordingOrPauseButton();
|
2627
|
+
thinkSpherePage.steps.verifyRecordingStatus('Paused');
|
2628
|
+
});
|
2629
|
+
|
2630
|
+
it('When the user click on Plan, or Review tab while recording, it should show a warning popup to the user', () => {
|
2631
|
+
thinkSpherePage.steps.clickOnRecordingOrPauseButton();
|
2632
|
+
thinkSpherePage.steps.clickOnReviewTab();
|
2633
|
+
thinkSpherePage.steps.verifyWhiteBoardRecordingInprogressWarning();
|
2634
|
+
thinkSpherePage.steps.clickOnWhiteBoardRecordingInProgressWarningOkButton();
|
2635
|
+
thinkSpherePage.steps.clickOnPlanTab();
|
2636
|
+
thinkSpherePage.steps.verifyWhiteboardWarningHeaderText('Recording in Progress');
|
2637
|
+
thinkSpherePage.steps.verifyWhiteboardWarningDescriptionText("You're currently recording your work. To avoid losing progress, please return and click Stop to save the recording.");
|
2638
|
+
});
|
2639
|
+
|
2640
|
+
it('CSS of Recording in Progress warning', { tags: 'css' }, () => {
|
2641
|
+
utilities.verifyCSS(thinkSpherePage.whiteboardRecordingInProgressWarningHeader(), {
|
2642
|
+
'border-bottom': `1px solid ${css.color.secondaryBtnBorder}`,
|
2643
|
+
'padding': '20px 0px',
|
2644
|
+
'margin': '0px 16px',
|
2645
|
+
'text-align': 'left',
|
2646
|
+
});
|
2647
|
+
utilities.verifyCSS(thinkSpherePage.whiteboardRecordingInProgressWarningDescription(), {
|
2648
|
+
'padding': '0px 16px',
|
2649
|
+
'font-size': '16px',
|
2650
|
+
'color': css.color.sectionHeading,
|
2651
|
+
'line-height': '22px',
|
2652
|
+
'font-weight': '400',
|
2653
|
+
});
|
2654
|
+
utilities.verifyCSS(thinkSpherePage.whiteboardRecordingInProgressWarningOkButton(), {
|
2655
|
+
'color': css.color.primaryBtn,
|
2656
|
+
'font-size': css.fontSize.default,
|
2657
|
+
'font-weight': css.fontWeight.semibold,
|
2658
|
+
'background-color': css.color.primaryBtnBg
|
2659
|
+
});
|
2660
|
+
});
|
2661
|
+
|
2662
|
+
it('Accessibility of whiteboard warning popup', { tags: 'a11y' }, () => {
|
2663
|
+
cy.checkAccessibility(thinkSpherePage.whiteboardRecordingInProgressWarning());
|
2664
|
+
thinkSpherePage.steps.clickOnWhiteBoardRecordingInProgressWarningOkButton();
|
2665
|
+
});
|
2666
|
+
|
2667
|
+
|
2668
|
+
it('The user should be able to switch to Review tab without warning after stopping the recording and the Review tab should contain the Playback option', () => {
|
2669
|
+
cy.get(`[data-testid="${whiteBoardTools[0].dataTestId}"]`)
|
2670
|
+
.should('exist')
|
2671
|
+
.and('be.visible')
|
2672
|
+
.first()
|
2673
|
+
.click({ force: true });
|
2674
|
+
cy.get('.upper-canvas').click({ force: true });
|
2675
|
+
cy.focused().type('Test text for recording');
|
2676
|
+
thinkSpherePage.steps.clickOnStopButton();
|
2677
|
+
thinkSpherePage.steps.clickOnReviewTab();
|
2678
|
+
thinkSpherePage.steps.verifyWhiteBoardRecordingInprogressWarningNotVisible();
|
2679
|
+
thinkSpherePage.steps.verifyWhiteBoardPlayer();
|
2680
|
+
});
|
2681
|
+
|
2682
|
+
it('By default the user should see the playback time as 00:00 / total duration', () => {
|
2683
|
+
thinkSpherePage.steps.verifyWhiteBoardPlayerTimeStatus('00:00');
|
2684
|
+
});
|
2685
|
+
|
2686
|
+
it('When the user clicks on the Play button, it should play the recording', () => {
|
2687
|
+
thinkSpherePage.steps.clickOnWhiteBoardPlaybackPlayButton();
|
2688
|
+
thinkSpherePage.steps.verifyWhiteBoardPlayerPauseButtonVisible();
|
2689
|
+
thinkSpherePage.steps.verifyWhiteBoardPlayerTimeStatus('00:01');
|
2690
|
+
});
|
2691
|
+
|
2692
|
+
it('When the user clicks on the Pause button, it should pause the recording', () => {
|
2693
|
+
thinkSpherePage.steps.clickOnWhiteBoardPlaybackPauseButton();
|
2694
|
+
thinkSpherePage.steps.verifyWhiteBoardPlayerPlayButtonVisible();
|
2695
|
+
});
|
2696
|
+
|
2697
|
+
it('When the user hovers over the speaker button, it should display the volume slider', () => {
|
2698
|
+
thinkSpherePage.steps.hoverOverWhiteBoardPlaybackSpeakerButton();
|
2699
|
+
thinkSpherePage.steps.verifyWhiteBoardPlayerVolumeSliderVisible();
|
2700
|
+
});
|
2701
|
+
|
2702
|
+
it('When the user clicks on the speaker button, it should mute the volume, and when the user clicks on it again, it should unmute the volume', () => {
|
2703
|
+
thinkSpherePage.steps.clickOnWhiteBoardPlaybackSpeakerButton();
|
2704
|
+
thinkSpherePage.steps.verifyWhiteBoardPlayerVolumeMuted();
|
2705
|
+
thinkSpherePage.steps.clickOnWhiteBoardPlaybackSpeakerButton();
|
2706
|
+
thinkSpherePage.steps.verifyWhiteBoardPlayerVolumeUnmuted();
|
2707
|
+
});
|
2708
|
+
}
|
2179
2709
|
};
|
2180
2710
|
|
2181
2711
|
export const thinkSpherePage = {
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "itemengine-cypress-automation",
|
3
|
-
"version": "1.0.376
|
3
|
+
"version": "1.0.376",
|
4
4
|
"description": "",
|
5
5
|
"main": "index.js",
|
6
6
|
"scripts": {
|
@@ -52,4 +52,4 @@
|
|
52
52
|
"devDependencies": {
|
53
53
|
"@applitools/eyes-cypress": "^3.47.0"
|
54
54
|
}
|
55
|
-
}
|
55
|
+
}
|