test: add webcam fullscreen test

This commit is contained in:
Anton B 2023-03-29 13:49:22 -03:00
parent 3a7b59c19a
commit 8ff1493d6b
2 changed files with 20 additions and 0 deletions

View File

@ -74,6 +74,20 @@ class Webcam extends Page {
});
}
async webcamFullscreen() {
await this.shareWebcam();
// get default viewport sizes
const { windowWidth, windowHeight } = await this.page.evaluate(() => { return {
windowWidth: window.innerWidth,
windowHeight: window.innerHeight,
}});
await this.waitAndClick(e.webcamFullscreenButton);
// get fullscreen webcam size
const { width, height } = await this.getLocator('video').boundingBox();
await expect(width + 1).toBe(windowWidth); // not sure why there is a difference of 1 pixel
await expect(height).toBe(windowHeight);
}
async managingNewBackground() {
await this.waitAndClick(e.joinVideo);
await this.waitForSelector(e.noneBackgroundButton);

View File

@ -36,6 +36,12 @@ test.describe.parallel('Webcam @ci', () => {
await webcam.changeVideoQuality();
});
test('Webcam fullscreen', async ({ browser, page }) => {
const webcam = new Webcam(browser, page);
await webcam.init(true, true);
await webcam.webcamFullscreen();
});
test.describe('Webcam background', () => {
test('Select one of the default backgrounds', async ({ browser, page }) => {
const webcam = new Webcam(browser, page);