adds webcams layout test suite
This commit is contained in:
parent
04833ce655
commit
b48b82330a
@ -190,6 +190,34 @@ class Page {
|
||||
};
|
||||
}
|
||||
|
||||
static getArgsWithAudioAndVideo() {
|
||||
if (process.env.BROWSERLESS_ENABLED === 'true') {
|
||||
const args = [
|
||||
'--no-sandbox',
|
||||
'--use-fake-ui-for-media-stream',
|
||||
'--use-fake-device-for-media-stream',
|
||||
'--lang=en-US',
|
||||
];
|
||||
return {
|
||||
headless: true,
|
||||
args,
|
||||
};
|
||||
}
|
||||
const args = [
|
||||
'--no-sandbox',
|
||||
'--use-fake-ui-for-media-stream',
|
||||
'--use-fake-device-for-media-stream',
|
||||
`--use-file-for-fake-audio-capture=${path.join(__dirname, '../media/audio.wav')}`,
|
||||
`--use-file-for-fake-video-capture=${path.join(__dirname, '../media/video_rgb.y4m')}`,
|
||||
'--allow-file-access',
|
||||
'--lang=en-US',
|
||||
];
|
||||
return {
|
||||
headless: true,
|
||||
args,
|
||||
};
|
||||
}
|
||||
|
||||
// Returns a Promise that resolves when an element does not exist/is removed from the DOM
|
||||
elementRemoved(element) {
|
||||
return this.page.waitFor(element => !document.querySelector(element), {}, element);
|
||||
|
@ -6,7 +6,7 @@ usage() {
|
||||
BBB Health Check
|
||||
|
||||
OPTIONS:
|
||||
-t <test name: whiteboard/webcam/virtualizedlist/user/sharednotes/screenshare/presentation/notifications/customparameters/chat/breakout/audio/all>
|
||||
-t <test name: webcamlayout/whiteboard/webcam/virtualizedlist/user/sharednotes/screenshare/presentation/notifications/customparameters/chat/breakout/audio/all>
|
||||
-h <hostname name of BigBlueButton server>
|
||||
-s <Shared secret>
|
||||
|
||||
|
@ -4,3 +4,5 @@ exports.startSharingWebcam = 'button[aria-label="Start sharing"]';
|
||||
exports.videoContainer = 'div[class^="videoListItem"]';
|
||||
exports.webcamConnecting = '[class^="connecting-"]';
|
||||
exports.presentationFullscreenButton = 'button[data-test="presentationFullscreenButton"]';
|
||||
exports.webcamItemTalkingUser = 'div[data-test="webcamItemTalkingUser"]';
|
||||
exports.webcamVideo = 'video[data-test="videoContainer"]';
|
||||
|
@ -66,8 +66,13 @@ async function clickTestElement(element) {
|
||||
document.querySelectorAll(element)[0].click();
|
||||
}
|
||||
|
||||
async function countTestElements(element) {
|
||||
return await document.querySelectorAll(element).length;
|
||||
}
|
||||
|
||||
exports.startAndCheckForWebcams = startAndCheckForWebcams;
|
||||
exports.webcamContentCheck = webcamContentCheck;
|
||||
exports.evaluateCheck = evaluateCheck;
|
||||
exports.getFullScreenWebcamButton = getFullScreenWebcamButton;
|
||||
exports.enableWebcam = enableWebcam;
|
||||
exports.countTestElements = countTestElements;
|
||||
|
21
bigbluebutton-html5/tests/puppeteer/webcam/webcamlayout.js
Normal file
21
bigbluebutton-html5/tests/puppeteer/webcam/webcamlayout.js
Normal file
@ -0,0 +1,21 @@
|
||||
const util = require('./util');
|
||||
const wle = require('./elements');
|
||||
const Page = require('../core/page');
|
||||
|
||||
class WebcamLayout extends Page {
|
||||
constructor() {
|
||||
super('webcam-layout-test');
|
||||
}
|
||||
|
||||
async share() {
|
||||
await this.joinMicrophone(this);
|
||||
await util.enableWebcam(this);
|
||||
}
|
||||
|
||||
async test() {
|
||||
await this.page.waitForSelector(wle.webcamConnecting);
|
||||
await this.page.waitForSelector(wle.webcamVideo);
|
||||
return await this.page.evaluate(util.countTestElements, wle.webcamItemTalkingUser) !== 0;
|
||||
}
|
||||
}
|
||||
module.exports = exports = WebcamLayout;
|
24
bigbluebutton-html5/tests/puppeteer/webcamlayout.obj.js
Normal file
24
bigbluebutton-html5/tests/puppeteer/webcamlayout.obj.js
Normal file
@ -0,0 +1,24 @@
|
||||
const Page = require('./core/page');
|
||||
const webcamLayout = require('./webcam/webcamlayout');
|
||||
|
||||
const webcamLayoutTest = () => {
|
||||
beforeEach(() => {
|
||||
jest.setTimeout(50000);
|
||||
});
|
||||
|
||||
test('Join Webcam and microphone', async () => {
|
||||
const test = new webcamLayout();
|
||||
let response;
|
||||
try {
|
||||
await test.init(Page.getArgsWithAudioAndVideo());
|
||||
await test.share();
|
||||
response = await test.test();
|
||||
} catch (e) {
|
||||
console.log(e);
|
||||
} finally {
|
||||
await test.close();
|
||||
}
|
||||
expect(response).toBe(true);
|
||||
});
|
||||
};
|
||||
module.exports = exports = webcamLayoutTest;
|
3
bigbluebutton-html5/tests/puppeteer/webcamlayout.test.js
Normal file
3
bigbluebutton-html5/tests/puppeteer/webcamlayout.test.js
Normal file
@ -0,0 +1,3 @@
|
||||
const webcamLayoutTest = require('./webcamlayout.obj');
|
||||
|
||||
describe('Webcams Layout', webcamLayoutTest);
|
Loading…
Reference in New Issue
Block a user