2018-08-27 23:00:42 +08:00
|
|
|
const Page = require('./page');
|
|
|
|
const helper = require('./helper');
|
|
|
|
const e = require('./elements');
|
|
|
|
|
2018-10-13 02:46:26 +08:00
|
|
|
class HotkeysTestPage extends Page {
|
|
|
|
constructor() {
|
2018-08-27 23:00:42 +08:00
|
|
|
super();
|
2018-10-13 02:46:26 +08:00
|
|
|
this.tabCounts =
|
2018-08-27 23:00:42 +08:00
|
|
|
{
|
|
|
|
options: 1,
|
|
|
|
actions: 11,
|
|
|
|
audioNoMic: 12,
|
|
|
|
audioMic: 13,
|
|
|
|
mute: 12,
|
|
|
|
chat: 15,
|
|
|
|
closeChat: 17, // Only when chat is open
|
|
|
|
status: 16,
|
2018-10-13 02:46:26 +08:00
|
|
|
userList: 18,
|
|
|
|
};
|
2018-08-27 23:00:42 +08:00
|
|
|
}
|
|
|
|
|
2018-10-13 02:46:26 +08:00
|
|
|
async test() {
|
2018-08-27 23:00:42 +08:00
|
|
|
await this.createBBBMeeting();
|
|
|
|
await this.joinAudioListenOnly();
|
|
|
|
|
|
|
|
await this.page.waitFor(e.whiteboard);
|
|
|
|
await this.page.waitFor(e.options);
|
|
|
|
await this.page.waitFor(e.userList);
|
|
|
|
await this.page.waitFor(e.toolbox);
|
|
|
|
await this.page.waitFor(e.leaveAudio);
|
|
|
|
await this.page.waitFor(e.chatButton);
|
|
|
|
await this.page.waitFor(e.firstUser);
|
|
|
|
await this.page.waitFor(e.screenShare);
|
|
|
|
await this.page.waitFor(e.videoMenu);
|
|
|
|
await this.page.waitFor(e.actions);
|
|
|
|
await this.page.waitFor(e.nextSlide);
|
|
|
|
await this.page.waitFor(e.prevSlide);
|
|
|
|
|
|
|
|
await this.elementRemoved(e.alerts);
|
2018-10-13 02:46:26 +08:00
|
|
|
|
2018-08-27 23:00:42 +08:00
|
|
|
// Options
|
|
|
|
await this.page.click(e.title);
|
|
|
|
await this.tab(this.tabCounts.options);
|
|
|
|
await this.enter();
|
|
|
|
await helper.sleep(500);
|
2018-10-13 02:46:26 +08:00
|
|
|
await this.page.screenshot({ path: 'screenshots/test-hotkeys-options-0.png' });
|
2018-08-27 23:00:42 +08:00
|
|
|
await this.enter();
|
|
|
|
await helper.sleep(500);
|
2018-10-13 02:46:26 +08:00
|
|
|
await this.page.screenshot({ path: 'screenshots/test-hotkeys-options-1.png' });
|
2018-08-27 23:00:42 +08:00
|
|
|
|
|
|
|
// User List
|
|
|
|
await this.page.click(e.title);
|
|
|
|
await this.tab(this.tabCounts.userList);
|
|
|
|
await this.enter();
|
|
|
|
await helper.sleep(500);
|
2018-10-13 02:46:26 +08:00
|
|
|
await this.page.screenshot({ path: 'screenshots/test-hotkeys-userlist-0.png' });
|
2018-08-27 23:00:42 +08:00
|
|
|
await this.enter();
|
|
|
|
await helper.sleep(500);
|
2018-10-13 02:46:26 +08:00
|
|
|
await this.page.screenshot({ path: 'screenshots/test-hotkeys-userlist-1.png' });
|
2018-08-27 23:00:42 +08:00
|
|
|
|
|
|
|
// Toggle Public Chat
|
|
|
|
await this.elementRemoved(e.alerts);
|
|
|
|
await this.page.click(e.title);
|
|
|
|
await this.tab(this.tabCounts.chat);
|
|
|
|
await this.up(1);
|
|
|
|
await this.enter();
|
|
|
|
await helper.sleep(500);
|
2018-10-13 02:46:26 +08:00
|
|
|
await this.page.screenshot({ path: 'screenshots/test-hotkeys-chat-0.png' });
|
2018-08-27 23:00:42 +08:00
|
|
|
await this.page.click(e.title);
|
|
|
|
await this.tab(this.tabCounts.closeChat);
|
|
|
|
await this.enter();
|
|
|
|
await helper.sleep(500);
|
2018-10-13 02:46:26 +08:00
|
|
|
await this.page.screenshot({ path: 'screenshots/test-hotkeys-chat-1.png' });
|
2018-08-27 23:00:42 +08:00
|
|
|
|
|
|
|
// Open Actions Menu
|
|
|
|
await this.page.click(e.title);
|
|
|
|
await this.tab(this.tabCounts.actions);
|
|
|
|
await this.enter();
|
|
|
|
await helper.sleep(500);
|
2018-10-13 02:46:26 +08:00
|
|
|
await this.page.screenshot({ path: 'screenshots/test-hotkeys-actions-0.png' });
|
2018-08-27 23:00:42 +08:00
|
|
|
await this.enter();
|
|
|
|
await helper.sleep(500);
|
2018-10-13 02:46:26 +08:00
|
|
|
await this.page.screenshot({ path: 'screenshots/test-hotkeys-actions-1.png' });
|
2018-08-27 23:00:42 +08:00
|
|
|
|
|
|
|
// Open Status Menu
|
|
|
|
await this.elementRemoved(e.alerts);
|
|
|
|
await this.page.click(e.title);
|
|
|
|
await this.tab(this.tabCounts.status);
|
|
|
|
await this.up(1);
|
|
|
|
await this.enter();
|
|
|
|
await helper.sleep(500);
|
2018-10-13 02:46:26 +08:00
|
|
|
await this.page.screenshot({ path: 'screenshots/test-hotkeys-status-0.png' });
|
2018-08-27 23:00:42 +08:00
|
|
|
await this.tab(1);
|
|
|
|
await this.enter();
|
|
|
|
await this.tab(1);
|
2018-10-13 02:46:26 +08:00
|
|
|
await this.down(7); // Applaud status
|
2018-08-27 23:00:42 +08:00
|
|
|
await this.enter();
|
|
|
|
await helper.sleep(500);
|
2018-10-13 02:46:26 +08:00
|
|
|
await this.page.screenshot({ path: 'screenshots/test-hotkeys-status-1.png' });
|
2018-08-27 23:00:42 +08:00
|
|
|
|
|
|
|
// Leave/Join Audio
|
|
|
|
await this.page.click(e.title);
|
|
|
|
await this.tab(this.tabCounts.audioNoMic);
|
|
|
|
await this.enter();
|
|
|
|
await helper.sleep(500);
|
2018-10-13 02:46:26 +08:00
|
|
|
await this.page.screenshot({ path: 'screenshots/test-hotkeys-audio-0.png' });
|
2018-08-27 23:00:42 +08:00
|
|
|
await this.enter();
|
|
|
|
await this.page.waitFor(e.microphoneButton);
|
|
|
|
await this.tab(2);
|
|
|
|
await this.enter();
|
|
|
|
await this.page.waitFor(e.echoYes);
|
|
|
|
await helper.sleep(500); // Echo test confirmation sometimes fails without this
|
|
|
|
await this.tab(1);
|
|
|
|
await this.enter();
|
|
|
|
await this.elementRemoved(e.audioDialog);
|
|
|
|
await helper.sleep(500);
|
2018-10-13 02:46:26 +08:00
|
|
|
await this.page.screenshot({ path: 'screenshots/test-hotkeys-audio-1.png' });
|
2018-08-27 23:00:42 +08:00
|
|
|
|
|
|
|
// Mute/Unmute
|
|
|
|
await this.elementRemoved(e.alerts);
|
|
|
|
await this.page.click(e.title);
|
|
|
|
await this.tab(this.tabCounts.mute);
|
|
|
|
await this.enter();
|
|
|
|
await helper.sleep(500);
|
2018-10-13 02:46:26 +08:00
|
|
|
await this.page.screenshot({ path: 'screenshots/test-hotkeys-mute-0.png' });
|
2018-08-27 23:00:42 +08:00
|
|
|
await this.enter();
|
|
|
|
await helper.sleep(500);
|
2018-10-13 02:46:26 +08:00
|
|
|
await this.page.screenshot({ path: 'screenshots/test-hotkeys-mute-1.png' });
|
2018-08-27 23:00:42 +08:00
|
|
|
}
|
|
|
|
|
2018-10-13 02:46:26 +08:00
|
|
|
async tab(count) {
|
|
|
|
for (let i = 0; i < count; i++) {
|
2018-08-27 23:00:42 +08:00
|
|
|
await this.page.keyboard.press('Tab');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-10-13 02:46:26 +08:00
|
|
|
async enter() {
|
2018-08-27 23:00:42 +08:00
|
|
|
await this.page.keyboard.press('Enter');
|
|
|
|
}
|
|
|
|
|
2018-10-13 02:46:26 +08:00
|
|
|
async down(count) {
|
|
|
|
for (let i = 0; i < count; i++) {
|
2018-08-27 23:00:42 +08:00
|
|
|
await this.page.keyboard.press('ArrowDown');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-10-13 02:46:26 +08:00
|
|
|
async up(count) {
|
|
|
|
for (let i = 0; i < count; i++) {
|
2018-08-27 23:00:42 +08:00
|
|
|
await this.page.keyboard.press('ArrowUp');
|
|
|
|
}
|
|
|
|
}
|
2018-10-13 02:46:26 +08:00
|
|
|
}
|
2018-08-27 23:00:42 +08:00
|
|
|
|
2018-10-13 02:46:26 +08:00
|
|
|
module.exports = exports = HotkeysTestPage;
|