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

47 lines
1.5 KiB
JavaScript

const { expect } = require('@playwright/test');
const Page = require('../core/page');
const e = require('../core/elements');
const { webcamContentCheck } = require('./util');
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);
await this.shareWebcam(videoPreviewTimeout);
await this.hasElement('video');
}
async checksContent() {
const parsedSettings = await this.getSettingsYaml();
const videoPreviewTimeout = parseInt(parsedSettings.public.kurento.gUMTimeout);
await this.shareWebcam(videoPreviewTimeout);
const respUser = await webcamContentCheck(this);
await expect(respUser).toBeTruthy();
}
async talkingIndicator() {
await this.webcamLayoutStart();
await this.waitForSelector(e.webcamContainer, VIDEO_LOADING_WAIT_TIME);
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);
await this.shareWebcam(videoPreviewTimeout);
}
}
exports.Webcam = Webcam;