test: fix and enable whiteboard parameter tests on CI

This commit is contained in:
Anton Barboza 2024-06-12 16:06:19 -03:00
parent b4b7879242
commit 29b12b9087
4 changed files with 15 additions and 22 deletions

View File

@ -451,7 +451,7 @@ exports.webcamMirroredVideoPreview = 'video[data-test="mirroredVideoPreview"]';
// Whiteboard
exports.whiteboard = 'div[data-testid="canvas"]';
exports.wbLayer = 'div[data-testid="layer"]';
exports.wbToolbar = 'div[class="tlui-toolbar__tools"]';
exports.wbToolbar = 'div[class^="tlui-toolbar__tools tlui-toolbar__tools__mobile"]';
exports.wbShapesButton = 'button[data-testid="tools.more"]';
exports.wbRectangleShape = 'button[data-testid="tools.rectangle"]';
exports.wbEllipseShape = 'button[data-testid="tools.more.ellipse"]';

View File

@ -35,8 +35,8 @@ exports.logo = 'logo=https://bigbluebutton.org/wp-content/uploads/2021/01/BigBlu
exports.enableVideo = 'userdata-bbb_enable_video=false';
exports.autoShareWebcam = 'userdata-bbb_auto_share_webcam=true';
exports.multiUserPenOnly = 'userdata-bbb_multi_user_pen_only=true';
exports.presenterTools = 'userdata-bbb_presenter_tools=["pencil","hand"]';
exports.multiUserTools = 'userdata-bbb_multi_user_tools=["pencil","hand"]';
exports.presenterTools = 'userdata-bbb_presenter_tools=["select","draw", "arrow"]';
exports.multiUserTools = 'userdata-bbb_multi_user_tools=["arrow","text"]';
const cssCode = `${e.presentationTitle}{display: none;}`;
exports.customStyle = `userdata-bbb_custom_style=${cssCode}`;
exports.customStyleUrl = 'userdata-bbb_custom_style_url=https://develop.bigbluebutton.org/css-test-file.css';

View File

@ -180,29 +180,23 @@ class CustomParameters extends MultiUsers {
async multiUserPenOnly() {
await this.modPage.waitAndClick(e.multiUsersWhiteboardOn);
await this.userPage.waitAndClick(e.wbToolbar);
const resp = await this.userPage.page.evaluate((toolsElement) => {
return document.querySelectorAll(toolsElement)[0].parentElement.childElementCount === 1;
}, e.wbToolbar);
expect(resp).toBeTruthy();
await this.userPage.hasElement(e.wbToolbar);
const toolsCount = await this.userPage.getSelectorCount(`${e.wbToolbar} button:visible`);
await expect(toolsCount, 'should display only 1 tool (pen)').toBe(1);
}
async presenterTools() {
await this.modPage.waitForSelector(e.whiteboard, ELEMENT_WAIT_LONGER_TIME);
await this.modPage.waitAndClick(e.wbToolbar);
const resp = await this.modPage.page.evaluate(([toolsElement, toolbarListSelector]) => {
return document.querySelectorAll(toolsElement)[0].parentElement.querySelector(toolbarListSelector).childElementCount === 2;
}, [e.wbToolbar, e.toolbarToolsList]);
expect(resp).toBeTruthy();
await this.modPage.hasElement(e.wbToolbar);
const toolsCount = await this.modPage.getSelectorCount(`${e.wbToolbar} button:visible`);
await expect(toolsCount, 'should display only the 3 elements passed in the parameter (select, draw and arrow)').toBe(3);
}
async multiUserTools() {
await this.modPage.waitAndClick(e.multiUsersWhiteboardOn);
await this.userPage.waitAndClick(e.wbToolbar);
const resp = await this.userPage.page.evaluate(([toolsElement, toolbarListSelector]) => {
return document.querySelectorAll(toolsElement)[0].parentElement.querySelector(toolbarListSelector).childElementCount === 2;
}, [e.wbToolbar, e.toolbarToolsList]);
expect(resp).toBeTruthy();
await this.userPage.hasElement(e.wbToolbar);
const toolsCount = await this.userPage.getSelectorCount(`${e.wbToolbar} button:visible`);
await expect(toolsCount, 'should display only the 2 elements passed in the parameter (arrow and text)').toBe(2);
}
async autoShareWebcam() {

View File

@ -512,12 +512,11 @@ test.describe.parallel('Custom Parameters', () => {
});
});
test.describe.parallel('Whiteboard', () => {
test.skip();
test.describe.parallel('Whiteboard @ci', () => {
test('Multi Users Pen Only', async ({ browser, context, page }) => {
const customParam = new CustomParameters(browser, context);
await customParam.initModPage(page, true, { joinParameter: c.multiUserPenOnly });
await customParam.initUserPage(true, context, { useModMeetingId: true, createParameter: c.multiUserPenOnly });
await customParam.initModPage(page, true);
await customParam.initUserPage(true, context, { useModMeetingId: true, joinParameter: c.multiUserPenOnly });
await customParam.multiUserPenOnly();
});