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');
|
2021-11-23 05:51:16 +08:00
|
|
|
const { MultiUsers } = require('../user/multiusers');
|
2022-08-30 04:07:44 +08:00
|
|
|
const { CUSTOM_MEETING_ID } = require('../core/constants');
|
2022-11-15 12:34:13 +08:00
|
|
|
const { encodeCustomParams } = require('../customparameters/util');
|
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
|
|
|
|
|
|
|
test.describe.parallel('Drawing - visual regression', () => {
|
|
|
|
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);
|
2022-11-15 12:34:13 +08:00
|
|
|
await drawRectangle.initModPage(page, true, { customMeetingId : 'draw_rectangle_meeting', customParameter: encodeCustomParams(`userdata-bbb_custom_style=.presentationUploaderToast{display: none;}.currentPresentationToast{display:none;}`) });
|
|
|
|
await drawRectangle.initModPage2(true, context, { customParameter: encodeCustomParams(`userdata-bbb_custom_style=.presentationUploaderToast{display: none;}.currentPresentationToast{display:none;}`) });
|
2022-08-30 04:07:44 +08:00
|
|
|
await drawRectangle.test();
|
|
|
|
});
|
|
|
|
|
|
|
|
test('Draw ellipse', async ({ browser, context, page }) => {
|
|
|
|
const drawEllipse = new DrawEllipse(browser, context);
|
2022-11-15 12:34:13 +08:00
|
|
|
await drawEllipse.initModPage(page, true, { customMeetingId : 'draw_ellipse_meeting', customParameter: encodeCustomParams(`userdata-bbb_custom_style=.presentationUploaderToast{display: none;}.currentPresentationToast{display:none;}`) });
|
|
|
|
await drawEllipse.initModPage2(true, context, { customParameter: encodeCustomParams(`userdata-bbb_custom_style=.presentationUploaderToast{display: none;}.currentPresentationToast{display:none;}`) });
|
2022-08-30 04:07:44 +08:00
|
|
|
await drawEllipse.test();
|
|
|
|
});
|
|
|
|
|
|
|
|
test('Draw triangle', async ({ browser, context, page }) => {
|
|
|
|
const drawTriangle = new DrawTriangle(browser, context);
|
2022-11-15 12:34:13 +08:00
|
|
|
await drawTriangle.initModPage(page, true, { customMeetingId : 'draw_triangle_meeting', customParameter: encodeCustomParams(`userdata-bbb_custom_style=.presentationUploaderToast{display: none;}.currentPresentationToast{display:none;}`) });
|
|
|
|
await drawTriangle.initModPage2(true, context, { customParameter: encodeCustomParams(`userdata-bbb_custom_style=.presentationUploaderToast{display: none;}.currentPresentationToast{display:none;}`) });
|
2022-08-30 04:07:44 +08:00
|
|
|
await drawTriangle.test();
|
|
|
|
});
|
|
|
|
|
|
|
|
test('Draw line', async ({ browser, context, page }) => {
|
|
|
|
const drawLine= new DrawLine(browser, context);
|
2022-11-15 12:34:13 +08:00
|
|
|
await drawLine.initModPage(page, true, { customMeetingId : 'draw_line_meeting', customParameter: encodeCustomParams(`userdata-bbb_custom_style=.presentationUploaderToast{display: none;}.currentPresentationToast{display:none;}`) });
|
|
|
|
await drawLine.initModPage2(true, context, { customParameter: encodeCustomParams(`userdata-bbb_custom_style=.presentationUploaderToast{display: none;}.currentPresentationToast{display:none;}`) });
|
2022-08-30 04:07:44 +08:00
|
|
|
await drawLine.test();
|
|
|
|
});
|
|
|
|
});
|