2020-03-14 04:08:30 +08:00
|
|
|
const Notifications = require('./notifications/notifications');
|
2020-03-23 22:14:56 +08:00
|
|
|
const ShareScreen = require('./screenshare/screenshare');
|
2020-03-24 01:11:30 +08:00
|
|
|
const Audio = require('./audio/audio');
|
2020-03-14 04:08:30 +08:00
|
|
|
|
|
|
|
describe('Notifications', () => {
|
2020-06-17 23:29:43 +08:00
|
|
|
beforeEach(() => {
|
|
|
|
jest.setTimeout(30000);
|
|
|
|
});
|
|
|
|
|
2020-03-14 04:08:30 +08:00
|
|
|
test('Save settings notification', async () => {
|
|
|
|
const test = new Notifications();
|
|
|
|
let response;
|
|
|
|
try {
|
2020-03-18 01:13:30 +08:00
|
|
|
response = await test.saveSettingsNotification();
|
2020-03-14 04:08:30 +08:00
|
|
|
} catch (e) {
|
|
|
|
console.log(e);
|
|
|
|
} finally {
|
2020-06-17 23:29:43 +08:00
|
|
|
await test.close(test.page1, test.page2);
|
2020-03-14 04:08:30 +08:00
|
|
|
}
|
|
|
|
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);
|
2020-03-14 04:08:30 +08:00
|
|
|
}
|
|
|
|
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);
|
2020-03-14 04:08:30 +08:00
|
|
|
}
|
|
|
|
expect(response).toBe(true);
|
|
|
|
});
|
2020-03-18 01:13:30 +08:00
|
|
|
|
|
|
|
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();
|
2020-03-18 01:13:30 +08:00
|
|
|
}
|
|
|
|
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');
|
|
|
|
});
|
2020-03-23 22:14:56 +08:00
|
|
|
|
|
|
|
test('Screenshare notification', async () => {
|
|
|
|
const test = new ShareScreen();
|
2020-06-17 23:29:43 +08:00
|
|
|
const page = new Notifications();
|
2020-03-23 22:14:56 +08:00
|
|
|
let response;
|
|
|
|
try {
|
2020-06-17 23:29:43 +08:00
|
|
|
await page.initUser3(undefined);
|
2020-03-23 22:14:56 +08:00
|
|
|
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
|
|
|
});
|
2020-03-14 04:08:30 +08:00
|
|
|
});
|