bigbluebutton-Github/bigbluebutton-html5/tests/puppeteer/notifications.test.js

119 lines
3.0 KiB
JavaScript
Raw Normal View History

const Notifications = require('./notifications/notifications');
const ShareScreen = require('./screenshare/screenshare');
2020-03-24 01:11:30 +08:00
const Audio = require('./audio/audio');
describe('Notifications', () => {
2020-06-17 23:29:43 +08:00
beforeEach(() => {
jest.setTimeout(30000);
});
test('Save settings notification', async () => {
const test = new Notifications();
let response;
try {
response = await test.saveSettingsNotification();
} catch (e) {
console.log(e);
} finally {
2020-06-17 23:29:43 +08:00
await test.close(test.page1, test.page2);
}
expect(response).toBe(true);
});
test('Public Chat notification', async () => {
const test = new Notifications();
let response;
try {
response = await test.publicChatNotification();
} catch (e) {
console.log(e);
} finally {
2020-06-17 23:29:43 +08:00
await test.close(test.page1, test.page2);
}
expect(response).toBe(true);
});
test('Private Chat notification', async () => {
const test = new Notifications();
let response;
try {
response = await test.privateChatNotification();
} catch (e) {
console.log(e);
} finally {
2020-06-17 23:29:43 +08:00
await test.close(test.page1, test.page2);
}
expect(response).toBe(true);
});
test('User join notification', async () => {
const test = new Notifications();
let response;
try {
response = await test.getUserJoinPopupResponse();
} catch (e) {
console.log(e);
} finally {
2020-03-23 20:15:10 +08:00
await test.closePages();
}
expect(response).toBe('User4 joined the session');
});
2020-03-20 01:01:55 +08:00
test('Presentation upload notification', async () => {
const test = new Notifications();
let response;
try {
response = await test.fileUploaderNotification();
} catch (e) {
console.log(e);
} finally {
2020-03-23 20:15:10 +08:00
await test.closePage(test.page3);
2020-03-20 01:01:55 +08:00
}
expect(response).toContain('Current presentation');
});
2020-03-20 22:42:04 +08:00
test('Poll results notification', async () => {
const test = new Notifications();
let response;
try {
response = await test.publishPollResults();
} catch (e) {
console.log(e);
} finally {
2020-03-23 20:15:10 +08:00
await test.closePage(test.page3);
2020-03-20 22:42:04 +08:00
}
expect(response).toContain('Poll results were published to Public Chat and Whiteboard');
});
test('Screenshare notification', async () => {
const test = new ShareScreen();
2020-06-17 23:29:43 +08:00
const page = new Notifications();
let response;
try {
2020-06-17 23:29:43 +08:00
await page.initUser3(undefined);
response = await test.toast(page.page3);
} catch (e) {
console.log(e);
} finally {
await page.closePage(page.page3);
}
expect(response).toBe('Screenshare has started');
});
2020-03-24 01:11:30 +08:00
test('Audio notifications', async () => {
const test = new Audio();
const page = new Notifications();
let response;
try {
process.env.IS_AUDIO_TEST = true;
await test.initOneUser(page.page3);
response = await test.audioNotification(page.page3);
} catch (e) {
console.log(e);
} finally {
await page.closePage(page.page3);
}
expect(response).toBe('You have joined the audio conference');
2020-06-17 23:29:43 +08:00
});
});