2021-09-28 11:21:14 +08:00
|
|
|
const Join = require('./join');
|
|
|
|
const Create = require('./create');
|
|
|
|
const Page = require('../core/page');
|
|
|
|
const { MAX_BREAKOUT_TEST_TIMEOUT } = require('../core/constants');
|
2020-10-09 03:25:35 +08:00
|
|
|
const { toMatchImageSnapshot } = require('jest-image-snapshot');
|
|
|
|
|
|
|
|
expect.extend({ toMatchImageSnapshot });
|
2020-08-06 02:44:17 +08:00
|
|
|
|
|
|
|
const breakoutTest = () => {
|
|
|
|
beforeEach(() => {
|
2021-02-17 04:57:10 +08:00
|
|
|
jest.setTimeout(MAX_BREAKOUT_TEST_TIMEOUT);
|
2020-08-06 02:44:17 +08:00
|
|
|
});
|
|
|
|
|
2021-02-26 23:52:17 +08:00
|
|
|
// Create Breakout Room
|
2020-09-22 02:22:11 +08:00
|
|
|
test('Create Breakout room', async () => {
|
|
|
|
const test = new Create();
|
|
|
|
let response;
|
2021-02-17 04:57:10 +08:00
|
|
|
let screenshot;
|
2020-09-22 02:22:11 +08:00
|
|
|
try {
|
|
|
|
const testName = 'createBreakoutrooms';
|
2021-09-23 05:03:47 +08:00
|
|
|
await test.modPage1.logger('begin of ', testName);
|
2021-09-30 20:36:08 +08:00
|
|
|
await test.init(testName);
|
2021-09-23 05:03:47 +08:00
|
|
|
await test.modPage1.startRecording(testName);
|
2020-09-22 02:22:11 +08:00
|
|
|
await test.create(testName);
|
|
|
|
response = await test.testCreatedBreakout(testName);
|
2021-09-23 05:03:47 +08:00
|
|
|
const breakoutUserPage1 = await test.userPage1.getLastTargetPage();
|
|
|
|
await breakoutUserPage1.bringToFront();
|
|
|
|
await test.modPage1.stopRecording();
|
|
|
|
screenshot = await breakoutUserPage1.page.screenshot();
|
|
|
|
await test.modPage1.logger('end of ', testName);
|
2021-08-26 22:13:18 +08:00
|
|
|
} catch (err) {
|
2021-09-23 05:03:47 +08:00
|
|
|
await test.modPage1.logger(err);
|
2020-09-22 02:22:11 +08:00
|
|
|
} finally {
|
|
|
|
await test.close();
|
|
|
|
}
|
|
|
|
expect(response).toBe(true);
|
2021-10-01 02:45:59 +08:00
|
|
|
Page.checkRegression(8.0, screenshot);
|
2020-09-22 02:22:11 +08:00
|
|
|
});
|
2020-08-06 02:44:17 +08:00
|
|
|
|
2020-09-22 02:22:11 +08:00
|
|
|
// Join Breakout Room
|
|
|
|
test('Join Breakout room', async () => {
|
|
|
|
const test = new Join();
|
|
|
|
let response;
|
2021-02-17 04:57:10 +08:00
|
|
|
let screenshot;
|
2020-09-22 02:22:11 +08:00
|
|
|
try {
|
|
|
|
const testName = 'joinBreakoutroomsWithoutFeatures';
|
2021-09-23 05:03:47 +08:00
|
|
|
await test.modPage1.logger('begin of ', testName);
|
2021-09-30 20:36:08 +08:00
|
|
|
await test.init(testName);
|
2021-09-23 05:03:47 +08:00
|
|
|
await test.modPage1.startRecording(testName);
|
2020-09-22 02:22:11 +08:00
|
|
|
await test.create(testName);
|
|
|
|
await test.join(testName);
|
|
|
|
response = await test.testJoined(testName);
|
2021-09-23 05:03:47 +08:00
|
|
|
const breakoutUserPage1 = await test.userPage1.getLastTargetPage();
|
|
|
|
await breakoutUserPage1.bringToFront();
|
|
|
|
await test.modPage1.stopRecording();
|
|
|
|
screenshot = await breakoutUserPage1.page.screenshot();
|
|
|
|
await test.modPage1.logger('end of ', testName);
|
2021-08-26 22:13:18 +08:00
|
|
|
} catch (err) {
|
2021-09-23 05:03:47 +08:00
|
|
|
await test.modPage1.logger(err);
|
2020-09-22 02:22:11 +08:00
|
|
|
} finally {
|
|
|
|
await test.close();
|
|
|
|
}
|
|
|
|
expect(response).toBe(true);
|
2021-10-01 02:45:59 +08:00
|
|
|
Page.checkRegression(4.0, screenshot);
|
2020-09-22 02:22:11 +08:00
|
|
|
});
|
2020-08-06 02:44:17 +08:00
|
|
|
|
2020-09-22 02:22:11 +08:00
|
|
|
// Join Breakout Room with Video
|
|
|
|
test('Join Breakout room with Video', async () => {
|
|
|
|
const test = new Join();
|
|
|
|
let response;
|
2021-02-17 04:57:10 +08:00
|
|
|
let screenshot;
|
2020-09-22 02:22:11 +08:00
|
|
|
try {
|
|
|
|
const testName = 'joinBreakoutroomsWithVideo';
|
2021-09-23 05:03:47 +08:00
|
|
|
await test.modPage1.logger('begin of ', testName);
|
2021-09-30 20:36:08 +08:00
|
|
|
await test.init(testName);
|
2021-09-23 05:03:47 +08:00
|
|
|
await test.modPage1.startRecording(testName);
|
2020-09-22 02:22:11 +08:00
|
|
|
await test.create(testName);
|
|
|
|
await test.join(testName);
|
|
|
|
response = await test.testJoined(testName);
|
2021-09-23 05:03:47 +08:00
|
|
|
const breakoutUserPage1 = await test.userPage1.getLastTargetPage();
|
|
|
|
await breakoutUserPage1.bringToFront();
|
|
|
|
await test.modPage1.stopRecording();
|
|
|
|
screenshot = await breakoutUserPage1.page.screenshot();
|
|
|
|
await test.modPage1.logger('end of ', testName);
|
2021-08-26 22:13:18 +08:00
|
|
|
} catch (err) {
|
2021-09-23 05:03:47 +08:00
|
|
|
await test.modPage1.logger(err);
|
2020-09-22 02:22:11 +08:00
|
|
|
} finally {
|
|
|
|
await test.close();
|
|
|
|
}
|
|
|
|
expect(response).toBe(true);
|
2021-10-01 02:45:59 +08:00
|
|
|
Page.checkRegression(0.6, screenshot);
|
2020-09-22 02:22:11 +08:00
|
|
|
});
|
2020-08-06 02:44:17 +08:00
|
|
|
|
2020-10-09 03:25:35 +08:00
|
|
|
// Join Breakout Room and start Screen Share
|
|
|
|
test('Join Breakout room and share screen', async () => {
|
|
|
|
const test = new Join();
|
|
|
|
let response;
|
|
|
|
let screenshot;
|
|
|
|
try {
|
|
|
|
const testName = 'joinBreakoutroomsAndShareScreen';
|
2021-09-23 05:03:47 +08:00
|
|
|
await test.modPage1.logger('begin of ', testName);
|
2021-09-30 20:36:08 +08:00
|
|
|
await test.init(testName);
|
2021-09-23 05:03:47 +08:00
|
|
|
await test.modPage1.startRecording(testName);
|
2020-10-09 03:25:35 +08:00
|
|
|
await test.create(testName);
|
|
|
|
await test.join(testName);
|
|
|
|
response = await test.testJoined(testName);
|
2021-09-23 05:03:47 +08:00
|
|
|
const breakoutUserPage1 = await test.userPage1.getLastTargetPage();
|
|
|
|
await breakoutUserPage1.bringToFront();
|
|
|
|
await test.modPage1.stopRecording();
|
|
|
|
screenshot = await breakoutUserPage1.page.screenshot();
|
|
|
|
await test.modPage1.logger('end of ', testName);
|
2021-08-26 22:13:18 +08:00
|
|
|
} catch (err) {
|
2021-09-23 05:03:47 +08:00
|
|
|
await test.modPage1.logger(err);
|
2020-10-09 03:25:35 +08:00
|
|
|
} finally {
|
|
|
|
await test.close();
|
|
|
|
}
|
|
|
|
expect(response).toBe(true);
|
2021-10-01 02:45:59 +08:00
|
|
|
Page.checkRegression(0.7, screenshot);
|
2020-10-09 03:25:35 +08:00
|
|
|
});
|
2020-08-06 02:44:17 +08:00
|
|
|
|
|
|
|
// Join Breakout Room with Audio
|
|
|
|
test('Join Breakout room with Audio', async () => {
|
|
|
|
const test = new Join();
|
|
|
|
let response;
|
2020-10-09 03:25:35 +08:00
|
|
|
let screenshot;
|
2020-08-06 02:44:17 +08:00
|
|
|
try {
|
|
|
|
const testName = 'joinBreakoutroomsWithAudio';
|
2021-09-23 05:03:47 +08:00
|
|
|
await test.modPage1.logger('begin of ', testName);
|
2021-09-30 20:36:08 +08:00
|
|
|
await test.init(testName);
|
2021-09-23 05:03:47 +08:00
|
|
|
await test.modPage1.startRecording(testName);
|
2020-08-06 02:44:17 +08:00
|
|
|
await test.create(testName);
|
|
|
|
await test.join(testName);
|
|
|
|
response = await test.testJoined(testName);
|
2021-09-23 05:03:47 +08:00
|
|
|
const breakoutUserPage1 = await test.userPage1.getLastTargetPage();
|
|
|
|
await breakoutUserPage1.bringToFront();
|
|
|
|
await test.modPage1.stopRecording();
|
|
|
|
screenshot = await breakoutUserPage1.page.screenshot();
|
|
|
|
await test.modPage1.logger('end of ', testName);
|
2021-08-26 22:13:18 +08:00
|
|
|
} catch (err) {
|
2021-09-23 05:03:47 +08:00
|
|
|
await test.modPage1.logger(err);
|
2020-08-06 02:44:17 +08:00
|
|
|
} finally {
|
|
|
|
await test.close();
|
|
|
|
}
|
|
|
|
expect(response).toBe(true);
|
2021-10-01 02:45:59 +08:00
|
|
|
Page.checkRegression(3.6, screenshot);
|
2020-08-06 02:44:17 +08:00
|
|
|
});
|
|
|
|
};
|
2021-08-14 02:03:01 +08:00
|
|
|
|
2020-08-06 02:44:17 +08:00
|
|
|
module.exports = exports = breakoutTest;
|