2020-02-08 02:03:06 +08:00
|
|
|
const Page = require('../core/page');
|
|
|
|
const ule = require('./elements');
|
2020-02-10 21:47:24 +08:00
|
|
|
const params = require('../params');
|
|
|
|
const helper = require('../core/helper');
|
2020-02-08 02:03:06 +08:00
|
|
|
|
|
|
|
class MultiUsers extends Page {
|
|
|
|
constructor() {
|
2020-02-10 21:47:24 +08:00
|
|
|
super('multi-users', 'params2');
|
2020-02-08 02:03:06 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
async joinExtraUser(args) {
|
2020-02-10 21:47:24 +08:00
|
|
|
this.params2 = { fullName: 'User2' };
|
|
|
|
this.params = { ...params, ...this.params2 };
|
2020-02-08 02:03:06 +08:00
|
|
|
this.context = await this.browser.createIncognitoBrowserContext(args);
|
|
|
|
this.page = await this.context.newPage();
|
2020-02-10 21:47:24 +08:00
|
|
|
const joinURL = helper.getJoinURL(this.meetingId, this.params, true);
|
|
|
|
await this.page.goto(joinURL);
|
2020-02-08 02:03:06 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
async test() {
|
|
|
|
await this.page.waitForSelector(ule.userListItem);
|
|
|
|
const foundUser = await this.page.$$(async () => await document.querySelectorAll(`${ule.userListItem}:not([aria-label="You"])`).length > 0);
|
|
|
|
return foundUser !== false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
module.exports = exports = MultiUsers;
|