2020-03-05 03:00:45 +08:00
|
|
|
const Page = require('../core/page');
|
|
|
|
const util = require('./util');
|
2020-10-19 01:33:06 +08:00
|
|
|
const wle = require('./elements');
|
2020-03-05 03:00:45 +08:00
|
|
|
|
2020-06-25 03:51:20 +08:00
|
|
|
class Share extends Page {
|
2020-03-05 03:00:45 +08:00
|
|
|
constructor() {
|
2020-06-25 03:51:20 +08:00
|
|
|
super('webcam-share-test');
|
2020-03-27 02:52:15 +08:00
|
|
|
}
|
|
|
|
|
2020-10-19 01:33:06 +08:00
|
|
|
async webcamLayoutStart() {
|
|
|
|
await this.joinMicrophone();
|
|
|
|
await util.enableWebcam(this);
|
|
|
|
}
|
|
|
|
|
|
|
|
async webcamLayoutTest() {
|
|
|
|
await this.page.waitForSelector(wle.webcamConnecting);
|
|
|
|
await this.page.waitForSelector(wle.webcamVideo);
|
|
|
|
return await this.page.evaluate(util.countTestElements, wle.webcamItemTalkingUser) !== 0;
|
|
|
|
}
|
|
|
|
|
2020-03-05 03:00:45 +08:00
|
|
|
async test() {
|
2020-06-25 03:51:20 +08:00
|
|
|
await util.enableWebcam(this);
|
|
|
|
const response = await util.evaluateCheck(this);
|
2020-03-27 02:52:15 +08:00
|
|
|
return response;
|
|
|
|
}
|
2020-03-05 03:00:45 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
module.exports = exports = Share;
|