2021-12-10 21:30:29 +08:00
|
|
|
const { test, devices } = require('@playwright/test');
|
2021-11-03 00:45:52 +08:00
|
|
|
const { Status } = require('./status');
|
2021-11-16 00:42:29 +08:00
|
|
|
const { MultiUsers } = require('./multiusers');
|
2022-01-20 03:50:59 +08:00
|
|
|
const { GuestPolicy } = require('./guestPolicy');
|
2022-01-29 03:52:22 +08:00
|
|
|
const { LockViewers } = require('./lockViewers');
|
2022-01-20 03:50:59 +08:00
|
|
|
const { MobileDevices } = require('./mobileDevices');
|
2021-12-10 21:30:29 +08:00
|
|
|
const motoG4 = devices['Moto G4'];
|
|
|
|
const iPhone11 = devices['iPhone 11'];
|
2021-11-03 00:45:52 +08:00
|
|
|
|
2022-01-20 03:50:59 +08:00
|
|
|
test.describe.parallel('User', () => {
|
2022-01-20 21:12:54 +08:00
|
|
|
test.describe.parallel('Actions', () => {
|
2022-06-21 08:52:00 +08:00
|
|
|
// https://docs.bigbluebutton.org/2.5/release-tests.html#set-status--raise-hand-automated
|
2022-01-20 21:12:54 +08:00
|
|
|
test('Raise and lower Hand Toast', async ({ browser, context, page }) => {
|
|
|
|
const multiusers = new MultiUsers(browser, context);
|
2022-07-15 22:08:02 +08:00
|
|
|
await multiusers.initModPage(page, true);
|
2022-03-29 21:53:07 +08:00
|
|
|
await multiusers.raiseAndLowerHand();
|
2022-01-20 21:12:54 +08:00
|
|
|
});
|
2022-02-08 03:22:48 +08:00
|
|
|
|
2022-06-08 02:52:22 +08:00
|
|
|
test('Toggle user list @ci', async ({ browser, context, page }) => {
|
2022-02-08 03:22:48 +08:00
|
|
|
const multiusers = new MultiUsers(browser, context);
|
|
|
|
await multiusers.initModPage(page);
|
|
|
|
await multiusers.toggleUserList();
|
|
|
|
});
|
2021-11-03 00:45:52 +08:00
|
|
|
});
|
2021-12-02 12:12:14 +08:00
|
|
|
|
2022-01-20 21:12:54 +08:00
|
|
|
test.describe.parallel('List', () => {
|
2022-06-21 08:52:00 +08:00
|
|
|
// https://docs.bigbluebutton.org/2.5/release-tests.html#set-status--raise-hand-automated
|
2022-06-08 02:52:22 +08:00
|
|
|
test('Change user status @ci', async ({ browser, page }) => {
|
2022-01-20 21:12:54 +08:00
|
|
|
const status = new Status(browser, page);
|
|
|
|
await status.init(true, true);
|
|
|
|
await status.changeUserStatus();
|
|
|
|
});
|
2021-12-10 21:30:29 +08:00
|
|
|
|
2022-01-20 21:12:54 +08:00
|
|
|
test('User presence check (multiple users)', async ({ browser, context, page }) => {
|
|
|
|
const multiusers = new MultiUsers(browser, context);
|
|
|
|
await multiusers.initPages(page);
|
|
|
|
await multiusers.userPresence();
|
|
|
|
});
|
2022-02-08 02:01:47 +08:00
|
|
|
|
2022-06-08 02:52:22 +08:00
|
|
|
test('Make presenter @ci', async ({ browser, context, page }) => {
|
2022-02-08 02:45:42 +08:00
|
|
|
const multiusers = new MultiUsers(browser, context);
|
|
|
|
await multiusers.initPages(page);
|
|
|
|
await multiusers.makePresenter();
|
|
|
|
});
|
|
|
|
|
2022-06-08 02:52:22 +08:00
|
|
|
test('Take presenter @ci', async ({ browser, context, page }) => {
|
2022-02-08 02:45:42 +08:00
|
|
|
const multiusers = new MultiUsers(browser, context);
|
|
|
|
await multiusers.initModPage(page);
|
|
|
|
await multiusers.initModPage2();
|
|
|
|
await multiusers.takePresenter();
|
|
|
|
});
|
|
|
|
|
2022-06-08 02:52:22 +08:00
|
|
|
test('Promote to moderator @ci', async ({ browser, context, page }) => {
|
2022-02-08 02:01:47 +08:00
|
|
|
const multiusers = new MultiUsers(browser, context);
|
2022-02-08 03:22:48 +08:00
|
|
|
await multiusers.initPages(page);
|
2022-02-08 02:01:47 +08:00
|
|
|
await multiusers.promoteToModerator();
|
|
|
|
});
|
|
|
|
|
2022-06-08 02:52:22 +08:00
|
|
|
test('Demote to viewer @ci', async ({ browser, context, page }) => {
|
2022-02-08 02:01:47 +08:00
|
|
|
const multiusers = new MultiUsers(browser, context);
|
|
|
|
await multiusers.initModPage(page);
|
|
|
|
await multiusers.initModPage2();
|
|
|
|
await multiusers.demoteToViewer();
|
|
|
|
});
|
2021-12-10 21:30:29 +08:00
|
|
|
});
|
|
|
|
|
2022-01-20 21:12:54 +08:00
|
|
|
test.describe.parallel('Manage', () => {
|
|
|
|
test.describe.parallel('Guest policy', () => {
|
|
|
|
test('ASK_MODERATOR', async ({ browser, context, page }) => {
|
|
|
|
const guestPolicy = new GuestPolicy(browser, context);
|
|
|
|
await guestPolicy.initModPage(page);
|
|
|
|
await guestPolicy.askModerator();
|
|
|
|
});
|
2021-12-10 21:30:29 +08:00
|
|
|
|
2022-01-20 21:12:54 +08:00
|
|
|
test('ALWAYS_ACCEPT', async ({ browser, context, page }) => {
|
|
|
|
const guestPolicy = new GuestPolicy(browser, context);
|
|
|
|
await guestPolicy.initModPage(page);
|
|
|
|
await guestPolicy.alwaysAccept();
|
|
|
|
});
|
2021-12-10 21:30:29 +08:00
|
|
|
|
2022-01-20 21:12:54 +08:00
|
|
|
test('ALWAYS_DENY', async ({ browser, context, page }) => {
|
|
|
|
const guestPolicy = new GuestPolicy(browser, context);
|
|
|
|
await guestPolicy.initModPage(page);
|
|
|
|
await guestPolicy.alwaysDeny();
|
|
|
|
});
|
2022-01-20 03:50:59 +08:00
|
|
|
});
|
2022-02-04 04:07:25 +08:00
|
|
|
|
2022-06-08 02:52:22 +08:00
|
|
|
test.describe.parallel('Lock viewers @ci', () => {
|
2022-02-04 04:07:25 +08:00
|
|
|
test('Lock Share webcam', async ({ browser, context, page }) => {
|
|
|
|
const lockViewers = new LockViewers(browser, context);
|
|
|
|
await lockViewers.initPages(page);
|
|
|
|
await lockViewers.initUserPage2();
|
|
|
|
await lockViewers.lockShareWebcam();
|
|
|
|
});
|
|
|
|
|
|
|
|
test('Lock See other viewers webcams', async ({ browser, context, page }) => {
|
|
|
|
const lockViewers = new LockViewers(browser, context);
|
|
|
|
await lockViewers.initPages(page);
|
|
|
|
await lockViewers.initUserPage2();
|
|
|
|
await lockViewers.lockSeeOtherViewersWebcams();
|
|
|
|
});
|
|
|
|
|
|
|
|
test('Lock Share microphone', async ({ browser, context, page }) => {
|
|
|
|
const lockViewers = new LockViewers(browser, context);
|
|
|
|
await lockViewers.initPages(page);
|
|
|
|
await lockViewers.initUserPage2();
|
|
|
|
await lockViewers.lockShareMicrophone();
|
|
|
|
});
|
|
|
|
|
|
|
|
test('Lock Send public chat messages', async ({ browser, context, page }) => {
|
|
|
|
const lockViewers = new LockViewers(browser, context);
|
|
|
|
await lockViewers.initPages(page);
|
|
|
|
await lockViewers.initUserPage2();
|
|
|
|
await lockViewers.lockSendPublicChatMessages();
|
|
|
|
});
|
|
|
|
|
|
|
|
test('Lock Send private chat messages', async ({ browser, context, page }) => {
|
|
|
|
const lockViewers = new LockViewers(browser, context);
|
|
|
|
await lockViewers.initPages(page);
|
|
|
|
await lockViewers.initUserPage2();
|
|
|
|
await lockViewers.lockSendPrivateChatMessages();
|
|
|
|
});
|
|
|
|
|
|
|
|
test('Lock Edit Shared Notes', async ({ browser, context, page }) => {
|
|
|
|
const lockViewers = new LockViewers(browser, context);
|
|
|
|
await lockViewers.initPages(page);
|
|
|
|
await lockViewers.lockEditSharedNotes();
|
|
|
|
});
|
|
|
|
|
|
|
|
test('Lock See other viewers in the Users list', async ({ browser, context, page }) => {
|
|
|
|
const lockViewers = new LockViewers(browser, context);
|
|
|
|
await lockViewers.initPages(page);
|
|
|
|
await lockViewers.initUserPage2();
|
|
|
|
await lockViewers.lockSeeOtherViewersUserList();
|
|
|
|
});
|
|
|
|
|
|
|
|
test('Unlock a user', async ({ browser, context, page }) => {
|
|
|
|
const lockViewers = new LockViewers(browser, context);
|
|
|
|
await lockViewers.initPages(page);
|
|
|
|
await lockViewers.initUserPage2();
|
|
|
|
await lockViewers.unlockUser();
|
|
|
|
});
|
|
|
|
});
|
2022-02-04 22:13:42 +08:00
|
|
|
|
2022-03-21 23:04:43 +08:00
|
|
|
test('Save user names', async ({ browser, context, page }, testInfo) => {
|
|
|
|
const multiusers = new MultiUsers(browser, context);
|
|
|
|
await multiusers.initPages(page);
|
|
|
|
await multiusers.saveUserNames(testInfo);
|
|
|
|
});
|
|
|
|
|
2022-06-08 02:52:22 +08:00
|
|
|
test('Select random user @ci', async ({ browser, context, page }) => {
|
2022-02-04 22:13:42 +08:00
|
|
|
const multiusers = new MultiUsers(browser, context);
|
|
|
|
await multiusers.initModPage(page);
|
|
|
|
await multiusers.selectRandomUser();
|
|
|
|
});
|
2021-12-10 21:30:29 +08:00
|
|
|
});
|
|
|
|
|
2022-01-20 03:50:59 +08:00
|
|
|
test.describe.parallel('Mobile devices', () => {
|
2022-03-08 02:56:08 +08:00
|
|
|
test.beforeEach(({ browserName }) => {
|
|
|
|
test.skip(browserName === 'firefox', 'Mobile tests are not able in Firefox browser');
|
|
|
|
});
|
|
|
|
|
2022-06-08 02:52:22 +08:00
|
|
|
test('Mobile Tag Name For Mobile User @ci', async ({ browser }) => {
|
2022-01-20 03:50:59 +08:00
|
|
|
const context = await browser.newContext({ ...iPhone11 });
|
|
|
|
const mobilePage = await context.newPage();
|
|
|
|
const mobileDevices = new MobileDevices(browser, context);
|
|
|
|
await mobileDevices.initModPage(mobilePage);
|
|
|
|
await mobileDevices.mobileTagName();
|
|
|
|
});
|
2021-12-10 21:30:29 +08:00
|
|
|
|
2022-01-20 03:50:59 +08:00
|
|
|
test('Whiteboard should not be accessible when chat panel or userlist are active on mobile devices', async ({ browser }) => {
|
|
|
|
test.fixme();
|
|
|
|
const iphoneContext = await browser.newContext({ ...iPhone11 });
|
|
|
|
const motoContext = await browser.newContext({ ...motoG4 });
|
|
|
|
const modPage = await iphoneContext.newPage();
|
|
|
|
const mobileDevices = new MobileDevices(browser, iphoneContext);
|
|
|
|
await mobileDevices.initModPage(modPage);
|
|
|
|
await mobileDevices.initUserPage(true, motoContext);
|
|
|
|
await mobileDevices.whiteboardNotAppearOnMobile();
|
|
|
|
});
|
|
|
|
|
|
|
|
test('Userslist should not appear when Chat Panel or Whiteboard are active on mobile devices', async ({ browser }) => {
|
|
|
|
const iphoneContext = await browser.newContext({ ...iPhone11 });
|
|
|
|
const motoContext = await browser.newContext({ ...motoG4 });
|
|
|
|
const modPage = await iphoneContext.newPage();
|
|
|
|
const mobileDevices = new MobileDevices(browser, iphoneContext);
|
|
|
|
await mobileDevices.initModPage(modPage);
|
|
|
|
await mobileDevices.initUserPage(true, motoContext);
|
|
|
|
await mobileDevices.userlistNotAppearOnMobile();
|
|
|
|
});
|
2021-12-10 21:30:29 +08:00
|
|
|
|
2022-01-20 03:50:59 +08:00
|
|
|
test('Chat Panel should not appear when Userlist or Whiteboard are active on mobile devices', async ({ browser }) => {
|
|
|
|
const iphoneContext = await browser.newContext({ ...iPhone11 });
|
|
|
|
const motoContext = await browser.newContext({ ...motoG4 });
|
|
|
|
const modPage = await iphoneContext.newPage();
|
|
|
|
const mobileDevices = new MobileDevices(browser, iphoneContext);
|
|
|
|
await mobileDevices.initModPage(modPage);
|
|
|
|
await mobileDevices.initUserPage(true, motoContext);
|
|
|
|
await mobileDevices.chatPanelNotAppearOnMobile();
|
|
|
|
});
|
2021-12-10 21:30:29 +08:00
|
|
|
});
|
2021-11-03 06:50:20 +08:00
|
|
|
});
|