2020-03-05 03:00:45 +08:00
|
|
|
const Page = require('../core/page');
|
|
|
|
const util = require('./util');
|
2020-03-05 01:44:05 +08:00
|
|
|
const params = require('../params');
|
2020-03-05 03:00:45 +08:00
|
|
|
|
2020-03-05 01:44:05 +08:00
|
|
|
class Share {
|
2020-03-05 03:00:45 +08:00
|
|
|
constructor() {
|
2020-03-05 01:44:05 +08:00
|
|
|
this.page1 = new Page();
|
|
|
|
this.page2 = new Page();
|
|
|
|
}
|
|
|
|
|
|
|
|
async init(meetingId) {
|
|
|
|
await this.page1.init(Page.getArgsWithVideo(), meetingId, { ...params, fullName: 'Streamer1' });
|
|
|
|
await this.page2.init(Page.getArgsWithVideo(), this.page1.meetingId, { ...params, fullName: 'Streamer2' });
|
2020-03-05 03:00:45 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
async test() {
|
2020-03-10 23:20:48 +08:00
|
|
|
await util.enableWebcam(this.page1);
|
|
|
|
await util.enableWebcam(this.page2);
|
2020-03-11 04:18:42 +08:00
|
|
|
const responseUser1 = await util.evaluateCheck(this.page1);
|
|
|
|
const responseUser2 = await util.evaluateCheck(this.page2);
|
|
|
|
return responseUser1 && responseUser2;
|
2020-03-05 03:00:45 +08:00
|
|
|
}
|
2020-03-05 01:44:05 +08:00
|
|
|
|
|
|
|
async close() {
|
|
|
|
await this.page1.close();
|
|
|
|
await this.page2.close();
|
|
|
|
}
|
2020-03-05 03:00:45 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
module.exports = exports = Share;
|