2021-12-01 01:14:03 +08:00
|
|
|
const { test, devices } = require('@playwright/test');
|
2021-12-02 12:12:14 +08:00
|
|
|
const { ScreenShare } = require('./screenshare');
|
2021-12-01 01:14:03 +08:00
|
|
|
|
|
|
|
test.describe.parallel('Screenshare', () => {
|
|
|
|
test('Share screen', async ({ browser, page }) => {
|
2021-12-02 12:12:14 +08:00
|
|
|
const screenshare = new ScreenShare(browser, page);
|
|
|
|
await screenshare.init(true, true);
|
|
|
|
await screenshare.startSharing();
|
2021-12-01 01:14:03 +08:00
|
|
|
});
|
2021-12-02 12:12:14 +08:00
|
|
|
|
2022-01-20 03:50:59 +08:00
|
|
|
test.describe.parallel('Mobile', () => {
|
|
|
|
test('Share screen unavailable on Mobile Android', async ({ browser }) => {
|
|
|
|
const motoG4 = devices['Moto G4'];
|
|
|
|
const context = await browser.newContext({ ...motoG4 });
|
|
|
|
const page = await context.newPage();
|
|
|
|
const screenshare = new ScreenShare(browser, page);
|
|
|
|
await screenshare.init(true, true);
|
|
|
|
await screenshare.testMobileDevice();
|
|
|
|
});
|
2021-12-01 01:14:03 +08:00
|
|
|
|
2022-01-20 03:50:59 +08:00
|
|
|
test('Share screen unavailable on Mobile iPhone', async ({ browser }) => {
|
|
|
|
const iPhone11 = devices['iPhone 11'];
|
|
|
|
const context = await browser.newContext({ ...iPhone11 });
|
|
|
|
const page = await context.newPage();
|
|
|
|
const screenshare = new ScreenShare(browser, page);
|
|
|
|
await screenshare.init(true, true);
|
|
|
|
await screenshare.testMobileDevice();
|
|
|
|
});
|
2021-12-01 01:14:03 +08:00
|
|
|
|
2022-01-20 03:50:59 +08:00
|
|
|
test('Share screen unavailable on Tablet iPad', async ({ browser }) => {
|
|
|
|
const iPadPro11 = devices['iPad Pro 11'];
|
|
|
|
const context = await browser.newContext({ ...iPadPro11 });
|
|
|
|
const page = await context.newPage();
|
|
|
|
const screenshare = new ScreenShare(browser, page);
|
|
|
|
await screenshare.init(true, true);
|
|
|
|
await screenshare.testMobileDevice();
|
|
|
|
});
|
2021-12-01 01:14:03 +08:00
|
|
|
});
|
2021-12-04 01:01:36 +08:00
|
|
|
});
|