bigbluebutton-Github/bigbluebutton-tests/playwright/webcam/webcam.js

47 lines
1.5 KiB
JavaScript
Raw Normal View History

2021-11-27 04:01:41 +08:00
const { expect } = require('@playwright/test');
const Page = require('../core/page');
const e = require('../core/elements');
const { webcamContentCheck } = require('./util');
2021-11-27 04:01:41 +08:00
const { VIDEO_LOADING_WAIT_TIME } = require('../core/constants');
class Webcam extends Page {
constructor(browser, page) {
super(browser, page);
}
async share() {
const parsedSettings = await this.getSettingsYaml();
const videoPreviewTimeout = parseInt(parsedSettings.public.kurento.gUMTimeout);
2022-01-29 03:52:22 +08:00
await this.shareWebcam(videoPreviewTimeout);
2021-11-27 04:01:41 +08:00
await this.hasElement('video');
}
async checksContent() {
const parsedSettings = await this.getSettingsYaml();
const videoPreviewTimeout = parseInt(parsedSettings.public.kurento.gUMTimeout);
2022-01-29 03:52:22 +08:00
await this.shareWebcam(videoPreviewTimeout);
const respUser = await webcamContentCheck(this);
2021-11-27 04:01:41 +08:00
await expect(respUser).toBeTruthy();
}
async talkingIndicator() {
await this.webcamLayoutStart();
await this.waitForSelector(e.webcamContainer, VIDEO_LOADING_WAIT_TIME);
2021-11-27 04:01:41 +08:00
await this.waitForSelector(e.leaveVideo, VIDEO_LOADING_WAIT_TIME);
await this.waitForSelector(e.isTalking);
await this.hasElement(e.webcamItemTalkingUser);
}
async webcamLayoutStart() {
await this.joinMicrophone();
const parsedSettings = await this.getSettingsYaml();
const videoPreviewTimeout = parseInt(parsedSettings.public.kurento.gUMTimeout);
2022-01-29 03:52:22 +08:00
await this.shareWebcam(videoPreviewTimeout);
2021-11-27 04:01:41 +08:00
}
}
exports.Webcam = Webcam;