2020-03-10 23:20:48 +08:00
|
|
|
const Share = require('./share');
|
|
|
|
const util = require('./util');
|
|
|
|
|
|
|
|
class Check extends Share {
|
|
|
|
constructor() {
|
2020-06-25 03:51:20 +08:00
|
|
|
super('webcam-check-content-test');
|
2020-03-10 23:20:48 +08:00
|
|
|
}
|
|
|
|
|
2020-09-22 02:22:11 +08:00
|
|
|
async compare() {
|
2021-08-14 01:35:00 +08:00
|
|
|
try {
|
|
|
|
await util.enableWebcam(page1, page2);
|
|
|
|
const respUser = await util.compareWebcamsContents(this);
|
|
|
|
return respUser === true;
|
2021-08-26 22:13:18 +08:00
|
|
|
} catch (err) {
|
|
|
|
await this.logger(err);
|
2021-08-14 01:35:00 +08:00
|
|
|
return false;
|
|
|
|
}
|
2020-09-22 02:22:11 +08:00
|
|
|
}
|
|
|
|
|
2020-03-10 23:20:48 +08:00
|
|
|
async test() {
|
2021-08-14 01:35:00 +08:00
|
|
|
try {
|
|
|
|
const parsedSettings = await this.getSettingsYaml();
|
|
|
|
const videoPreviewTimeout = parseInt(parsedSettings.public.kurento.gUMTimeout);
|
2021-02-17 04:57:10 +08:00
|
|
|
|
2021-08-14 01:35:00 +08:00
|
|
|
await util.enableWebcam(this, videoPreviewTimeout);
|
|
|
|
const respUser = await util.webcamContentCheck(this);
|
|
|
|
return respUser === true;
|
2021-08-26 22:13:18 +08:00
|
|
|
} catch (err) {
|
|
|
|
await this.logger(err);
|
2021-08-14 01:35:00 +08:00
|
|
|
return false;
|
|
|
|
}
|
2020-03-10 23:20:48 +08:00
|
|
|
}
|
|
|
|
}
|
2021-08-14 01:35:00 +08:00
|
|
|
|
2020-03-10 23:20:48 +08:00
|
|
|
module.exports = exports = Check;
|