2021-11-23 05:51:16 +08:00
|
|
|
const { test } = require('@playwright/test');
|
2021-12-02 12:12:14 +08:00
|
|
|
const { Draw } = require('./draw');
|
2022-08-30 04:07:44 +08:00
|
|
|
const { DrawRectangle } = require('./drawRectangle');
|
|
|
|
const { DrawEllipse } = require('./drawEllipse');
|
|
|
|
const { DrawTriangle } = require('./drawTriangle');
|
|
|
|
const { DrawLine } = require('./drawLine');
|
2022-12-16 23:39:21 +08:00
|
|
|
const { DrawPencil } = require('./drawPencil');
|
|
|
|
const { DrawText } = require('./drawText');
|
|
|
|
const { DrawStickyNote } = require('./drawStickyNote');
|
2023-03-08 23:33:05 +08:00
|
|
|
const { Zoom } = require('./zoom');
|
|
|
|
const { Pan } = require('./pan');
|
|
|
|
const { Eraser } = require('./eraser');
|
|
|
|
const { DrawArrow } = require('./drawArrow');
|
2021-11-23 05:51:16 +08:00
|
|
|
const { MultiUsers } = require('../user/multiusers');
|
2023-07-08 01:05:06 +08:00
|
|
|
const { encodeCustomParams } = require('../parameters/util');
|
2023-03-08 23:33:05 +08:00
|
|
|
const { PARAMETER_HIDE_PRESENTATION_TOAST } = require('../core/constants');
|
2023-04-12 21:29:25 +08:00
|
|
|
const { DeleteDrawing } = require('./deleteDrawing');
|
|
|
|
const { UndoDrawing } = require('./undoDraw');
|
|
|
|
const { RedoDrawing } = require('./redoDraw');
|
|
|
|
const { ChangeStyles } = require('./changeStyles');
|
|
|
|
const { RealTimeText } = require('./realTimeText');
|
2023-03-08 23:33:05 +08:00
|
|
|
|
|
|
|
const hidePresentationToast = encodeCustomParams(PARAMETER_HIDE_PRESENTATION_TOAST);
|
2021-11-23 05:51:16 +08:00
|
|
|
|
2022-06-08 02:52:22 +08:00
|
|
|
test.describe.parallel('Whiteboard @ci', () => {
|
2022-11-19 04:03:38 +08:00
|
|
|
test('Draw rectangle', async ({ browser, page }) => {
|
2021-11-23 05:51:16 +08:00
|
|
|
const draw = new Draw(browser, page);
|
|
|
|
await draw.init(true, true);
|
|
|
|
await draw.test();
|
|
|
|
})
|
|
|
|
|
2022-11-19 04:03:38 +08:00
|
|
|
test('Give Additional Whiteboard Access', async ({ browser, context, page }) => {
|
2021-12-02 12:12:14 +08:00
|
|
|
const multiusers = new MultiUsers(browser, context);
|
|
|
|
await multiusers.initPages(page);
|
2021-11-23 05:51:16 +08:00
|
|
|
await multiusers.whiteboardAccess();
|
|
|
|
});
|
2021-12-04 01:01:36 +08:00
|
|
|
});
|
2022-08-30 04:07:44 +08:00
|
|
|
|
2023-03-08 23:33:05 +08:00
|
|
|
test.describe.parallel('Whiteboard tools - visual regression', () => {
|
2022-08-30 04:07:44 +08:00
|
|
|
test.beforeEach(({ browserName }) => {
|
|
|
|
test.skip(browserName !== 'chromium',
|
|
|
|
'Drawing visual regression tests are enabled for Chromium only');
|
|
|
|
});
|
|
|
|
|
|
|
|
test('Draw rectangle', async ({ browser, context, page }) => {
|
|
|
|
const drawRectangle = new DrawRectangle(browser, context);
|
2023-03-08 23:33:05 +08:00
|
|
|
await drawRectangle.initModPage(page, true, { customMeetingId: 'draw_rectangle_meeting', customParameter: hidePresentationToast });
|
2023-04-13 01:17:52 +08:00
|
|
|
await drawRectangle.initUserPage(true, context, { customParameter: hidePresentationToast });
|
2022-08-30 04:07:44 +08:00
|
|
|
await drawRectangle.test();
|
|
|
|
});
|
|
|
|
|
|
|
|
test('Draw ellipse', async ({ browser, context, page }) => {
|
|
|
|
const drawEllipse = new DrawEllipse(browser, context);
|
2023-03-08 23:33:05 +08:00
|
|
|
await drawEllipse.initModPage(page, true, { customMeetingId: 'draw_ellipse_meeting', customParameter: hidePresentationToast });
|
2023-04-13 01:17:52 +08:00
|
|
|
await drawEllipse.initUserPage(true, context, { customParameter: hidePresentationToast });
|
2022-08-30 04:07:44 +08:00
|
|
|
await drawEllipse.test();
|
|
|
|
});
|
|
|
|
|
|
|
|
test('Draw triangle', async ({ browser, context, page }) => {
|
|
|
|
const drawTriangle = new DrawTriangle(browser, context);
|
2023-03-08 23:33:05 +08:00
|
|
|
await drawTriangle.initModPage(page, true, { customMeetingId: 'draw_triangle_meeting', customParameter: hidePresentationToast });
|
2023-04-13 01:17:52 +08:00
|
|
|
await drawTriangle.initUserPage(true, context, { customParameter: hidePresentationToast });
|
2022-08-30 04:07:44 +08:00
|
|
|
await drawTriangle.test();
|
|
|
|
});
|
|
|
|
|
|
|
|
test('Draw line', async ({ browser, context, page }) => {
|
2022-11-26 03:54:32 +08:00
|
|
|
const drawLine = new DrawLine(browser, context);
|
2023-03-08 23:33:05 +08:00
|
|
|
await drawLine.initModPage(page, true, { customMeetingId: 'draw_line_meeting', customParameter: hidePresentationToast });
|
2023-04-13 01:17:52 +08:00
|
|
|
await drawLine.initUserPage(true, context, { customParameter: hidePresentationToast });
|
2022-08-30 04:07:44 +08:00
|
|
|
await drawLine.test();
|
|
|
|
});
|
2022-12-16 23:39:21 +08:00
|
|
|
|
|
|
|
test('Draw with pencil', async ({ browser, context, page }) => {
|
|
|
|
const drawPencil = new DrawPencil(browser, context);
|
2023-03-08 23:33:05 +08:00
|
|
|
await drawPencil.initModPage(page, true, { customMeetingId: 'draw_pencil_meeting', customParameter: hidePresentationToast });
|
2023-04-13 01:17:52 +08:00
|
|
|
await drawPencil.initUserPage(true, context, { customParameter: hidePresentationToast });
|
2022-12-16 23:39:21 +08:00
|
|
|
await drawPencil.test();
|
|
|
|
});
|
|
|
|
|
|
|
|
test('Type text', async ({ browser, context, page }) => {
|
|
|
|
const drawText = new DrawText(browser, context);
|
2023-03-08 23:33:05 +08:00
|
|
|
await drawText.initModPage(page, true, { customMeetingId: 'draw_text_meeting', customParameter: hidePresentationToast });
|
2023-04-13 01:17:52 +08:00
|
|
|
await drawText.initUserPage(true, context, { customParameter: hidePresentationToast });
|
2022-12-16 23:39:21 +08:00
|
|
|
await drawText.test();
|
|
|
|
});
|
|
|
|
|
|
|
|
test('Create sticky note', async ({ browser, context, page }) => {
|
|
|
|
const drawStickyNote = new DrawStickyNote(browser, context);
|
2023-03-08 23:33:05 +08:00
|
|
|
await drawStickyNote.initModPage(page, true, { customMeetingId: 'draw_sticky_meeting', customParameter: hidePresentationToast });
|
2023-04-13 01:17:52 +08:00
|
|
|
await drawStickyNote.initUserPage(true, context, { customParameter: hidePresentationToast });
|
2022-12-16 23:39:21 +08:00
|
|
|
await drawStickyNote.test();
|
|
|
|
});
|
2023-03-08 23:33:05 +08:00
|
|
|
|
|
|
|
test('Zoom', async ({ browser, context, page }) => {
|
|
|
|
const zoom = new Zoom(browser, context);
|
|
|
|
await zoom.initModPage(page, true, { customMeetingId: 'draw_line_meeting', customParameter: hidePresentationToast });
|
2023-04-13 01:17:52 +08:00
|
|
|
await zoom.initUserPage(true, context, { customParameter: hidePresentationToast });
|
2023-03-08 23:33:05 +08:00
|
|
|
await zoom.test();
|
|
|
|
});
|
|
|
|
|
2023-03-27 22:42:04 +08:00
|
|
|
test('Pan', async ({ browser, context, page }) => {
|
2023-03-08 23:33:05 +08:00
|
|
|
const pan = new Pan(browser, context);
|
|
|
|
await pan.initModPage(page, true, { customMeetingId: 'draw_line_meeting', customParameter: hidePresentationToast });
|
2023-04-13 01:17:52 +08:00
|
|
|
await pan.initUserPage(true, context, { customParameter: hidePresentationToast });
|
2023-03-08 23:33:05 +08:00
|
|
|
await pan.test();
|
|
|
|
});
|
|
|
|
|
|
|
|
test('Eraser', async ({ browser, context, page }) => {
|
|
|
|
const eraser = new Eraser(browser, context);
|
|
|
|
await eraser.initModPage(page, true, { customMeetingId: 'draw_line_meeting', customParameter: hidePresentationToast });
|
2023-04-13 01:17:52 +08:00
|
|
|
await eraser.initUserPage(true, context, { customParameter: hidePresentationToast });
|
2023-03-08 23:33:05 +08:00
|
|
|
await eraser.test();
|
|
|
|
});
|
|
|
|
|
|
|
|
test('Draw arrow', async ({ browser, context, page }) => {
|
|
|
|
const drawArrow = new DrawArrow(browser, context);
|
|
|
|
await drawArrow.initModPage(page, true, { customMeetingId: 'draw_line_meeting', customParameter: hidePresentationToast });
|
2023-04-13 01:17:52 +08:00
|
|
|
await drawArrow.initUserPage(true, context, { customParameter: hidePresentationToast });
|
2023-03-08 23:33:05 +08:00
|
|
|
await drawArrow.test();
|
|
|
|
});
|
2023-04-12 21:29:25 +08:00
|
|
|
|
|
|
|
test('Delete drawing', async ({ browser, context, page }) => {
|
|
|
|
const deleteDrawing = new DeleteDrawing(browser, context);
|
|
|
|
await deleteDrawing.initModPage(page, true, { customMeetingId: 'draw_line_meeting', customParameter: hidePresentationToast });
|
|
|
|
await deleteDrawing.initUserPage(true, context, { customParameter: hidePresentationToast });
|
|
|
|
await deleteDrawing.test();
|
|
|
|
});
|
|
|
|
|
|
|
|
test('Undo drawing', async ({ browser, context, page }) => {
|
|
|
|
const undoDrawing = new UndoDrawing(browser, context);
|
|
|
|
await undoDrawing.initModPage(page, true, { customMeetingId: 'draw_line_meeting', customParameter: hidePresentationToast });
|
|
|
|
await undoDrawing.initUserPage(true, context, { customParameter: hidePresentationToast });
|
|
|
|
await undoDrawing.test();
|
|
|
|
});
|
|
|
|
|
|
|
|
test('Redo drawing', async ({ browser, context, page }) => {
|
|
|
|
const redoDrawing = new RedoDrawing(browser, context);
|
|
|
|
await redoDrawing.initModPage(page, true, { customMeetingId: 'draw_line_meeting', customParameter: hidePresentationToast });
|
|
|
|
await redoDrawing.initUserPage(true, context, { customParameter: hidePresentationToast });
|
|
|
|
await redoDrawing.test();
|
|
|
|
});
|
|
|
|
|
|
|
|
test('Change color', async ({ browser, context, page }) => {
|
|
|
|
const changeColor = new ChangeStyles(browser, context);
|
|
|
|
await changeColor.initModPage(page, true, { customMeetingId: 'draw_line_meeting', customParameter: hidePresentationToast });
|
|
|
|
await changeColor.initUserPage(true, context, { customParameter: hidePresentationToast });
|
|
|
|
await changeColor.changingColor();
|
|
|
|
});
|
|
|
|
|
|
|
|
test('Fill drawing', async ({ browser, context, page }) => {
|
|
|
|
const fillDrawing = new ChangeStyles(browser, context);
|
|
|
|
await fillDrawing.initModPage(page, true, { customMeetingId: 'draw_line_meeting', customParameter: hidePresentationToast });
|
|
|
|
await fillDrawing.initUserPage(true, context, { customParameter: hidePresentationToast });
|
|
|
|
await fillDrawing.fillDrawing();
|
|
|
|
});
|
|
|
|
|
|
|
|
test('Dash drawing', async ({ browser, context, page }) => {
|
|
|
|
const dashDrawing = new ChangeStyles(browser, context);
|
|
|
|
await dashDrawing.initModPage(page, true, { customMeetingId: 'draw_line_meeting', customParameter: hidePresentationToast });
|
|
|
|
await dashDrawing.initUserPage(true, context, { customParameter: hidePresentationToast });
|
|
|
|
await dashDrawing.dashDrawing();
|
|
|
|
});
|
|
|
|
|
|
|
|
test('Size drawing', async ({ browser, context, page }) => {
|
|
|
|
const sizeDrawing = new ChangeStyles(browser, context);
|
|
|
|
await sizeDrawing.initModPage(page, true, { customMeetingId: 'draw_line_meeting', customParameter: hidePresentationToast });
|
|
|
|
await sizeDrawing.initUserPage(true, context, { customParameter: hidePresentationToast });
|
|
|
|
await sizeDrawing.sizeDrawing();
|
|
|
|
});
|
|
|
|
|
|
|
|
test('Real time text typing', async ({ browser, context, page }) => {
|
|
|
|
const realTimeText = new RealTimeText(browser, context);
|
|
|
|
await realTimeText.initModPage(page, true, { customMeetingId: 'draw_line_meeting', customParameter: hidePresentationToast });
|
|
|
|
await realTimeText.initUserPage(true, context, { customParameter: hidePresentationToast });
|
|
|
|
await realTimeText.realTimeTextTyping();
|
|
|
|
});
|
2022-08-30 04:07:44 +08:00
|
|
|
});
|