adds hideAndSwapPresentation(), hideAndSwapPresentation() and forceRestorePresentationOnNewEvents()

This commit is contained in:
Mohamed Amine Ben Salah 2020-06-08 16:40:28 -03:00
parent eb47227caf
commit ed185de471
6 changed files with 595 additions and 379 deletions

View File

@ -130,6 +130,7 @@ class ActionsDropdown extends PureComponent {
icon="polling"
data-test="polling"
label={formatMessage(pollBtnLabel)}
data-test="pollBtn"
description={formatMessage(pollBtnDesc)}
key={this.pollId}
onClick={() => {

View File

@ -8,385 +8,385 @@ describe('Custom parameters', () => {
jest.setTimeout(30000);
});
// // This test spec sets the userdata-autoJoin parameter to false
// // and checks that the users don't get audio modal on login
// test('Auto join', async () => {
// const test = new CustomParameters();
// let response;
// try {
// console.log('before');
// const testName = 'autoJoin';
// response = await test.autoJoin(testName, Page.getArgs(), undefined, c.autoJoin);
// console.log('after');
// } catch (e) {
// console.log(e);
// } finally {
// await test.closePage(test.page1);
// }
// expect(response).toBe(true);
// });
// This test spec sets the userdata-autoJoin parameter to false
// and checks that the users don't get audio modal on login
test('Auto join', async () => {
const test = new CustomParameters();
let response;
try {
console.log('before');
const testName = 'autoJoin';
response = await test.autoJoin(testName, Page.getArgs(), undefined, c.autoJoin);
console.log('after');
} catch (e) {
console.log(e);
} finally {
await test.closePage(test.page1);
}
expect(response).toBe(true);
});
// // This test spec sets the userdata-listenOnlyMode parameter to false
// // and checks that the users can't see or use listen Only mode
// test('Listen Only Mode', async () => {
// const test = new CustomParameters();
// let response;
// try {
// console.log('before');
// const testName = 'listenOnlyMode';
// response = await test.listenOnlyMode(testName, Page.getArgs(), undefined, c.listenOnlyMode);
// console.log('after');
// } catch (e) {
// console.log(e);
// } finally {
// await test.close(test.page1, test.page2);
// }
// expect(response).toBe(true);
// });
// This test spec sets the userdata-listenOnlyMode parameter to false
// and checks that the users can't see or use listen Only mode
test('Listen Only Mode', async () => {
const test = new CustomParameters();
let response;
try {
console.log('before');
const testName = 'listenOnlyMode';
response = await test.listenOnlyMode(testName, Page.getArgs(), undefined, c.listenOnlyMode);
console.log('after');
} catch (e) {
console.log(e);
} finally {
await test.close(test.page1, test.page2);
}
expect(response).toBe(true);
});
// // This test spec sets the userdata-forceListenOnly parameter to false
// // and checks that the Viewers can only use listen only mode
// test('Force Listen Only', async () => {
// const test = new CustomParameters();
// let response;
// try {
// console.log('before');
// const testName = 'forceListenOnly';
// response = await test.forceListenOnly(testName, Page.getArgs(), undefined, c.forceListenOnly);
// console.log('after');
// } catch (e) {
// console.log(e);
// } finally {
// await test.closePage(test.page2);
// }
// expect(response).toBe(true);
// });
// This test spec sets the userdata-forceListenOnly parameter to false
// and checks that the Viewers can only use listen only mode
test('Force Listen Only', async () => {
const test = new CustomParameters();
let response;
try {
console.log('before');
const testName = 'forceListenOnly';
response = await test.forceListenOnly(testName, Page.getArgs(), undefined, c.forceListenOnly);
console.log('after');
} catch (e) {
console.log(e);
} finally {
await test.closePage(test.page2);
}
expect(response).toBe(true);
});
// // This test spec sets the userdata-skipCheck parameter to true
// // and checks that the users automatically skip audio check when clicking on Microphone
// test('Skip audio check', async () => {
// const test = new CustomParameters();
// let response;
// try {
// console.log('before');
// const testName = 'skipCheck';
// response = await test.skipCheck(testName, Page.getArgs(), undefined, c.skipCheck);
// console.log('after');
// } catch (e) {
// console.log(e);
// } finally {
// await test.closePage(test.page1);
// }
// expect(response).toBe(true);
// });
// This test spec sets the userdata-skipCheck parameter to true
// and checks that the users automatically skip audio check when clicking on Microphone
test('Skip audio check', async () => {
const test = new CustomParameters();
let response;
try {
console.log('before');
const testName = 'skipCheck';
response = await test.skipCheck(testName, Page.getArgs(), undefined, c.skipCheck);
console.log('after');
} catch (e) {
console.log(e);
} finally {
await test.closePage(test.page1);
}
expect(response).toBe(true);
});
// // This test spec sets the userdata-clientTitle parameter to some value
// // and checks that the meeting window name starts with that value
// test('Client title', async () => {
// const test = new CustomParameters();
// let response;
// try {
// console.log('before');
// const testName = 'clientTitle';
// response = await test.clientTitle(testName, Page.getArgs(), undefined, c.clientTitle);
// console.log('after');
// } catch (e) {
// console.log(e);
// } finally {
// await test.closePage(test.page1);
// }
// expect(response).toBe(true);
// });
// This test spec sets the userdata-clientTitle parameter to some value
// and checks that the meeting window name starts with that value
test('Client title', async () => {
const test = new CustomParameters();
let response;
try {
console.log('before');
const testName = 'clientTitle';
response = await test.clientTitle(testName, Page.getArgs(), undefined, c.clientTitle);
console.log('after');
} catch (e) {
console.log(e);
} finally {
await test.closePage(test.page1);
}
expect(response).toBe(true);
});
// // This test spec sets the userdata-askForFeedbackOnLogout parameter to true
// // and checks that the users automatically get asked for feedback on logout page
// test('Ask For Feed back On Logout', async () => {
// const test = new CustomParameters();
// let response;
// try {
// console.log('before');
// const testName = 'askForFeedbackOnLogout';
// response = await test.askForFeedbackOnLogout(testName, Page.getArgs(), undefined, c.askForFeedbackOnLogout);
// console.log('after');
// } catch (e) {
// console.log(e);
// } finally {
// await test.closePage(test.page1);
// }
// expect(response).toBe(true);
// });
// This test spec sets the userdata-askForFeedbackOnLogout parameter to true
// and checks that the users automatically get asked for feedback on logout page
test('Ask For Feedback On Logout', async () => {
const test = new CustomParameters();
let response;
try {
console.log('before');
const testName = 'askForFeedbackOnLogout';
response = await test.askForFeedbackOnLogout(testName, Page.getArgs(), undefined, c.askForFeedbackOnLogout);
console.log('after');
} catch (e) {
console.log(e);
} finally {
await test.closePage(test.page1);
}
expect(response).toBe(true);
});
// // This test spec sets the userdata-displayBrandingArea parameter to true and add a logo link
// // and checks that the users see the logo displaying in the meeting
// test('Display Branding Area', async () => {
// const test = new CustomParameters();
// let response;
// try {
// console.log('before');
// const testName = 'displayBrandingArea';
// const parameterWithLogo = `${c.displayBrandingArea}&${c.logo}`;
// response = await test.displayBrandingArea(testName, Page.getArgs(), undefined, parameterWithLogo);
// console.log('after');
// } catch (e) {
// console.log(e);
// } finally {
// await test.closePage(test.page1);
// }
// expect(response).toBe(true);
// });
// This test spec sets the userdata-displayBrandingArea parameter to true and add a logo link
// and checks that the users see the logo displaying in the meeting
test('Display Branding Area', async () => {
const test = new CustomParameters();
let response;
try {
console.log('before');
const testName = 'displayBrandingArea';
const parameterWithLogo = `${c.displayBrandingArea}&${c.logo}`;
response = await test.displayBrandingArea(testName, Page.getArgs(), undefined, parameterWithLogo);
console.log('after');
} catch (e) {
console.log(e);
} finally {
await test.closePage(test.page1);
}
expect(response).toBe(true);
});
// // This test spec sets the userdata-shortcuts parameter to one or a list of shortcuts parameters
// // and checks that the users can use those shortcuts
// test('Shortcuts', async () => {
// const test = new CustomParameters();
// let response;
// try {
// console.log('before');
// const testName = 'shortcuts';
// response = await test.shortcuts(testName, Page.getArgs(), undefined, encodeURI(c.shortcuts));
// console.log('after');
// } catch (e) {
// console.log(e);
// } finally {
// await test.closePage(test.page1);
// }
// expect(response).toBe(true);
// });
// This test spec sets the userdata-shortcuts parameter to one or a list of shortcuts parameters
// and checks that the users can use those shortcuts
test('Shortcuts', async () => {
const test = new CustomParameters();
let response;
try {
console.log('before');
const testName = 'shortcuts';
response = await test.shortcuts(testName, Page.getArgs(), undefined, encodeURI(c.shortcuts));
console.log('after');
} catch (e) {
console.log(e);
} finally {
await test.closePage(test.page1);
}
expect(response).toBe(true);
});
// // This test spec sets the userdata-enableScreensharing parameter to false
// // and checks that the Moderator can not see the Screen sharing button
// test('Enable Screensharing', async () => {
// const test = new CustomParameters();
// let response;
// try {
// console.log('before');
// const testName = 'enableScreensharing';
// response = await test.enableScreensharing(testName, Page.getArgs(), undefined, c.enableScreensharing);
// console.log('after');
// } catch (e) {
// console.log(e);
// } finally {
// await test.closePage(test.page1);
// }
// expect(response).toBe(true);
// });
// This test spec sets the userdata-enableScreensharing parameter to false
// and checks that the Moderator can not see the Screen sharing button
test('Enable Screensharing', async () => {
const test = new CustomParameters();
let response;
try {
console.log('before');
const testName = 'enableScreensharing';
response = await test.enableScreensharing(testName, Page.getArgs(), undefined, c.enableScreensharing);
console.log('after');
} catch (e) {
console.log(e);
} finally {
await test.closePage(test.page1);
}
expect(response).toBe(true);
});
// // This test spec sets the userdata-enableVideo parameter to false
// // and checks that the Moderator can not see the Webcam sharing button
// test('Enable Webcam', async () => {
// const test = new CustomParameters();
// let response;
// try {
// console.log('before');
// const testName = 'enableVideo';
// response = await test.enableVideo(testName, Page.getArgsWithVideo(), undefined, c.enableVideo);
// console.log('after');
// } catch (e) {
// console.log(e);
// } finally {
// await test.closePage(test.page1);
// }
// expect(response).toBe(true);
// });
// This test spec sets the userdata-enableVideo parameter to false
// and checks that the Moderator can not see the Webcam sharing button
test('Enable Webcam', async () => {
const test = new CustomParameters();
let response;
try {
console.log('before');
const testName = 'enableVideo';
response = await test.enableVideo(testName, Page.getArgsWithVideo(), undefined, c.enableVideo);
console.log('after');
} catch (e) {
console.log(e);
} finally {
await test.closePage(test.page1);
}
expect(response).toBe(true);
});
// // This test spec sets the userdata-autoShareWebcam parameter to true
// // and checks that the Moderator sees the Webcam Settings Modal automatically at his connection to meeting
// test('Auto Share Webcam', async () => {
// const test = new CustomParameters();
// let response;
// try {
// console.log('before');
// const testName = 'autoShareWebcam';
// response = await test.autoShareWebcam(testName, Page.getArgsWithVideo(), undefined, c.autoShareWebcam);
// console.log('after');
// } catch (e) {
// console.log(e);
// } finally {
// await test.closePage(test.page1);
// }
// expect(response).toBe(true);
// });
// This test spec sets the userdata-autoShareWebcam parameter to true
// and checks that the Moderator sees the Webcam Settings Modal automatically at his connection to meeting
test('Auto Share Webcam', async () => {
const test = new CustomParameters();
let response;
try {
console.log('before');
const testName = 'autoShareWebcam';
response = await test.autoShareWebcam(testName, Page.getArgsWithVideo(), undefined, c.autoShareWebcam);
console.log('after');
} catch (e) {
console.log(e);
} finally {
await test.closePage(test.page1);
}
expect(response).toBe(true);
});
// // This test spec sets the userdata-multiUserPenOnly parameter to true
// // and checks that at multi Users whiteboard other users can see only pencil as drawing tool
// test('Multi Users Pen Only', async () => {
// const test = new CustomParameters();
// let response;
// try {
// console.log('before');
// const testName = 'multiUserPenOnly';
// response = await test.multiUserPenOnly(testName, Page.getArgsWithVideo(), undefined, c.multiUserPenOnly);
// console.log('after');
// } catch (e) {
// console.log(e);
// } finally {
// await test.close(test.page1, test.page2);
// }
// expect(response).toBe(true);
// });
// This test spec sets the userdata-multiUserPenOnly parameter to true
// and checks that at multi Users whiteboard other users can see only pencil as drawing tool
test('Multi Users Pen Only', async () => {
const test = new CustomParameters();
let response;
try {
console.log('before');
const testName = 'multiUserPenOnly';
response = await test.multiUserPenOnly(testName, Page.getArgsWithVideo(), undefined, c.multiUserPenOnly);
console.log('after');
} catch (e) {
console.log(e);
} finally {
await test.close(test.page1, test.page2);
}
expect(response).toBe(true);
});
// // This test spec sets the userdata-presenterTools parameter to an interval of parameters
// // and checks that at multi Users whiteboard Presenter can see only the set tools from the interval
// test('Presenter Tools', async () => {
// const test = new CustomParameters();
// let response;
// try {
// console.log('before');
// const testName = 'presenterTools';
// response = await test.presenterTools(testName, Page.getArgsWithVideo(), undefined, encodeURI(c.presenterTools));
// console.log('after');
// } catch (e) {
// console.log(e);
// } finally {
// await test.closePage(test.page1);
// }
// expect(response).toBe(true);
// });
// This test spec sets the userdata-presenterTools parameter to an interval of parameters
// and checks that at multi Users whiteboard Presenter can see only the set tools from the interval
test('Presenter Tools', async () => {
const test = new CustomParameters();
let response;
try {
console.log('before');
const testName = 'presenterTools';
response = await test.presenterTools(testName, Page.getArgsWithVideo(), undefined, encodeURI(c.presenterTools));
console.log('after');
} catch (e) {
console.log(e);
} finally {
await test.closePage(test.page1);
}
expect(response).toBe(true);
});
// // This test spec sets the userdata-multiUserTools parameter to an interval of parameters
// // and checks that at multi Users whiteboard other users can see only the set tools from the interval
// test('Multi Users Tools', async () => {
// const test = new CustomParameters();
// let response;
// try {
// console.log('before');
// const testName = 'multiUserTools';
// response = await test.multiUserTools(testName, Page.getArgsWithVideo(), undefined, encodeURI(c.multiUserTools));
// console.log('after');
// } catch (e) {
// console.log(e);
// } finally {
// await test.close(test.page1, test.page2);
// }
// expect(response).toBe(true);
// });
// This test spec sets the userdata-multiUserTools parameter to an interval of parameters
// and checks that at multi Users whiteboard other users can see only the set tools from the interval
test('Multi Users Tools', async () => {
const test = new CustomParameters();
let response;
try {
console.log('before');
const testName = 'multiUserTools';
response = await test.multiUserTools(testName, Page.getArgsWithVideo(), undefined, encodeURI(c.multiUserTools));
console.log('after');
} catch (e) {
console.log(e);
} finally {
await test.close(test.page1, test.page2);
}
expect(response).toBe(true);
});
// // This test spec sets the userdata-customStyle parameter to an interval of styles
// // and checks that the meeting displays what was called in the styles interval
// test('Custom Styles', async () => {
// const test = new CustomParameters();
// let response;
// try {
// console.log('before');
// const testName = 'customStyle';
// response = await test.customStyle(testName, Page.getArgsWithVideo(), undefined, encodeURIComponent(c.customStyle));
// console.log('after');
// } catch (e) {
// console.log(e);
// } finally {
// await test.closePage(test.page1);
// }
// expect(response).toBe(true);
// });
// This test spec sets the userdata-customStyle parameter to an interval of styles
// and checks that the meeting displays what was called in the styles interval
test('Custom Styles', async () => {
const test = new CustomParameters();
let response;
try {
console.log('before');
const testName = 'customStyle';
response = await test.customStyle(testName, Page.getArgsWithVideo(), undefined, encodeURIComponent(c.customStyle));
console.log('after');
} catch (e) {
console.log(e);
} finally {
await test.closePage(test.page1);
}
expect(response).toBe(true);
});
// // This test spec sets the userdata-customStyleUrl parameter to a styles URL
// // and checks that the meeting displays what was called in the styles URL
// test('Custom Styles URL', async () => {
// const test = new CustomParameters();
// let response;
// try {
// console.log('before');
// const testName = 'customStyleUrl';
// response = await test.customStyleUrl(testName, Page.getArgsWithVideo(), undefined, encodeURI(c.customStyleUrl));
// console.log('after');
// } catch (e) {
// console.log(e);
// } finally {
// await test.closePage(test.page1);
// }
// expect(response).toBe(true);
// });
// This test spec sets the userdata-customStyleUrl parameter to a styles URL
// and checks that the meeting displays what was called in the styles URL
test('Custom Styles URL', async () => {
const test = new CustomParameters();
let response;
try {
console.log('before');
const testName = 'customStyleUrl';
response = await test.customStyleUrl(testName, Page.getArgsWithVideo(), undefined, encodeURI(c.customStyleUrl));
console.log('after');
} catch (e) {
console.log(e);
} finally {
await test.closePage(test.page1);
}
expect(response).toBe(true);
});
// // This test spec sets the userdata-autoSwapLayout parameter to true
// // and checks that at any webcam share, the focus will be on the webcam,
// // and the presentation gets minimized and the available shared webcam will replace the Presentation
// test('Auto Swap Layout', async () => {
// const test = new CustomParameters();
// let response;
// try {
// console.log('before');
// const testName = 'autoSwapLayout';
// response = await test.autoSwapLayout(testName, Page.getArgsWithVideo(), undefined, encodeURI(c.autoSwapLayout));
// console.log('after');
// } catch (e) {
// console.log(e);
// } finally {
// await test.closePage(test.page1);
// }
// expect(response).toBe(true);
// });
// This test spec sets the userdata-autoSwapLayout parameter to true
// and checks that at any webcam share, the focus will be on the webcam,
// and the presentation gets minimized and the available shared webcam will replace the Presentation
test('Auto Swap Layout', async () => {
const test = new CustomParameters();
let response;
try {
console.log('before');
const testName = 'autoSwapLayout';
response = await test.autoSwapLayout(testName, Page.getArgsWithVideo(), undefined, encodeURI(c.autoSwapLayout));
console.log('after');
} catch (e) {
console.log(e);
} finally {
await test.closePage(test.page1);
}
expect(response).toBe(true);
});
// // This test spec sets the userdata-hidePresentation parameter to true
// // and checks that the Presentation is totally hidden, and its place will be displaying a message
// test('Hide Presentation', async () => {
// const test = new CustomParameters();
// let response;
// try {
// console.log('before');
// const testName = 'hidePresentation';
// response = await test.hidePresentation(testName, Page.getArgsWithVideo(), undefined, encodeURI(c.hidePresentation));
// console.log('after');
// } catch (e) {
// console.log(e);
// } finally {
// await test.closePage(test.page1);
// }
// expect(response).toBe(true);
// });
// This test spec sets the userdata-hidePresentation parameter to true
// and checks that the Presentation is totally hidden, and its place will be displaying a message
test('Hide Presentation', async () => {
const test = new CustomParameters();
let response;
try {
console.log('before');
const testName = 'hidePresentation';
response = await test.hidePresentation(testName, Page.getArgsWithVideo(), undefined, encodeURI(c.hidePresentation));
console.log('after');
} catch (e) {
console.log(e);
} finally {
await test.closePage(test.page1);
}
expect(response).toBe(true);
});
// // This test spec sets the userdata-hidePresentation parameter to true
// // and checks that the Presentation is totally hidden, and its place will be displaying a message
// test('Outside Toggle', async () => {
// const test = new CustomParameters();
// let response;
// try {
// console.log('before');
// const testName = 'hidePresentation';
// response = await test.hidePresentation(testName, Page.getArgsWithVideo(), undefined, encodeURI(c.hidePresentation));
// console.log('after');
// } catch (e) {
// console.log(e);
// } finally {
// await test.closePage(test.page1);
// }
// expect(response).toBe(true);
// });
// This test spec sets the userdata-hidePresentation parameter to true
// and checks that the Presentation is totally hidden, and its place will be displaying a message
test('Outside Toggle', async () => {
const test = new CustomParameters();
let response;
try {
console.log('before');
const testName = 'hidePresentation';
response = await test.hidePresentation(testName, Page.getArgsWithVideo(), undefined, encodeURI(c.hidePresentation));
console.log('after');
} catch (e) {
console.log(e);
} finally {
await test.closePage(test.page1);
}
expect(response).toBe(true);
});
// // This test spec sets the userdata-hidePresentation parameter to true
// // and checks that the Presentation is totally hidden, and its place will be displaying a message
// test('Outside Toggle', async () => {
// const test = new CustomParameters();
// let response;
// try {
// console.log('before');
// const testName = 'hidePresentation';
// response = await test.hidePresentation(testName, Page.getArgsWithVideo(), undefined, encodeURI(c.hidePresentation));
// console.log('after');
// } catch (e) {
// console.log(e);
// } finally {
// await test.closePage(test.page1);
// }
// expect(response).toBe(true);
// });
// This test spec sets the userdata-hidePresentation parameter to true
// and checks that the Presentation is totally hidden, and its place will be displaying a message
test('Outside Toggle', async () => {
const test = new CustomParameters();
let response;
try {
console.log('before');
const testName = 'hidePresentation';
response = await test.hidePresentation(testName, Page.getArgsWithVideo(), undefined, encodeURI(c.hidePresentation));
console.log('after');
} catch (e) {
console.log(e);
} finally {
await test.closePage(test.page1);
}
expect(response).toBe(true);
});
// // This test spec sets the userdata-bannerText parameter to some text
// // and checks that the meeting has a banner bar containing the same text
// test('Banner Text', async () => {
// const test = new CustomParameters();
// let response;
// try {
// console.log('before');
// const testName = 'bannerText';
// response = await test.bannerText(testName, Page.getArgsWithVideo(), undefined, c.bannerText);
// console.log('after');
// } catch (e) {
// console.log(e);
// } finally {
// await test.closePage(test.page1);
// }
// expect(response).toBe(true);
// });
// This test spec sets the userdata-bannerText parameter to some text
// and checks that the meeting has a banner bar containing the same text
test('Banner Text', async () => {
const test = new CustomParameters();
let response;
try {
console.log('before');
const testName = 'bannerText';
response = await test.bannerText(testName, Page.getArgsWithVideo(), undefined, c.bannerText);
console.log('after');
} catch (e) {
console.log(e);
} finally {
await test.closePage(test.page1);
}
expect(response).toBe(true);
});
// This test spec sets the userdata-bannerColor parameter to some hex color value
// and checks that the meeting has a banner bar containing that color in rgb(r, g, b)
@ -406,4 +406,41 @@ describe('Custom parameters', () => {
}
expect(response).toBe(true);
});
// This test spec sets the userdata-bbb_show_public_chat_on_login parameter to false
// and checks that the users don't see that box by default
test('Show Public Chat On Login', async () => {
const test = new CustomParameters();
let response;
try {
console.log('before');
const testName = 'showPublicChatOnLogin';
response = await test.showPublicChatOnLogin(testName, Page.getArgsWithVideo(), undefined, `${c.showPublicChatOnLogin}`);
console.log('after');
} catch (e) {
console.log(e);
} finally {
await test.closePage(test.page1);
}
expect(response).toBe(true);
});
// This test spec sets the userdata-bbb_force_restore_presentation_on_new_events parameter to true
// and checks that the viewers get the presentation restored forcefully when the Moderator zooms
// in/out the presentation or publishes a poll or adds an annotation
test('Force Restore Presentation On New Events', async () => {
const test = new CustomParameters();
let response;
try {
console.log('before');
const testName = 'forceRestorePresentationOnNewEvents';
response = await test.forceRestorePresentationOnNewEvents(testName, Page.getArgsWithVideo(), undefined, `${c.forceRestorePresentationOnNewEvents}`);
console.log('after');
} catch (e) {
console.log(e);
} finally {
await test.close(test.page1, test.page2);
}
expect(response).toBe(true);
});
});

View File

@ -1,26 +1,28 @@
exports.autoJoin = 'userdata-autoJoin=false';
exports.listenOnlyMode = 'userdata-listenOnlyMode=false';
exports.forceListenOnly = 'userdata-forceListenOnly=true';
exports.skipCheck = 'userdata-skipCheck=true';
exports.autoJoin = 'userdata-bbb_auto_join_audio=false';
exports.listenOnlyMode = 'userdata-bbb_listen_only_mode=false';
exports.forceListenOnly = 'userdata-bbb_force_listen_only=true';
exports.skipCheck = 'userdata-bbb_skip_check_audio=true';
const docTitle = 'puppeteer';
exports.docTitle = docTitle;
exports.clientTitle = `userdata-clientTitle=${docTitle}`;
exports.askForFeedbackOnLogout = 'userdata-askForFeedbackOnLogout=true';
exports.displayBrandingArea = 'userdata-displayBrandingArea=true';
exports.clientTitle = `userdata-bbb_client_title=${docTitle}`;
exports.askForFeedbackOnLogout = 'userdata-bbb_ask_for_feedback_on_logout=true';
exports.displayBrandingArea = 'userdata-bbb_display_branding_area=true';
exports.logo = 'logo=https://bigbluebutton.org/wp-content/themes/bigbluebutton/library/images/bigbluebutton-logo.png';
exports.shortcuts = 'userdata-shortcuts=["openOptions", "toggleUserList", "toggleMute", "joinAudio", "leaveAudio", "togglePublicChat", "hidePrivateChat", "closePrivateChat", "openActions", "openStatus"]';
exports.enableScreensharing = 'userdata-enableScreensharing=false';
exports.enableVideo = 'userdata-enableVideo=false';
exports.autoShareWebcam = 'userdata-autoShareWebcam=true';
exports.multiUserPenOnly = 'userdata-multiUserPenOnly=true';
exports.presenterTools = 'userdata-presenterTools=["pencil", "hand"]';
exports.multiUserTools = 'userdata-multiUserTools=["pencil", "hand"]';
exports.customStyle = 'userdata-customStyle=:root{--loader-bg:#000;}.overlay--1aTlbi{background-color:#000!important;}body{background-color:#000!important;}.presentationTitle--1LT79g{display: none;}.navbar--Z2lHYbG{display:none;}.actionsbar--Z1ant6U{display:none;}';
exports.customStyleUrl = 'userdata-customStyleUrl=https://bbb22.bbbvm.imdt.com.br/styles.css';
exports.autoSwapLayout = 'userdata-autoSwapLayout=true';
exports.hidePresentation = 'userdata-hidePresentation=false';
// exports.outsideToggleSelfVoice...;
// exports.outsideToggleRecording...;
exports.shortcuts = 'userdata-bbb_shortcuts=["openOptions", "toggleUserList", "toggleMute", "joinAudio", "leaveAudio", "togglePublicChat", "hidePrivateChat", "closePrivateChat", "openActions", "openStatus"]';
exports.enableScreensharing = 'userdata-bbb_enable_screen_sharing=false';
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.customStyle = 'userdata-bbb_custom_style=:root{--loader-bg:#000;}.overlay--1aTlbi{background-color:#000!important;}body{background-color:#000!important;}.presentationTitle--1LT79g{display: none;}.navbar--Z2lHYbG{display:none;}.actionsbar--Z1ant6U{display:none;}';
exports.customStyleUrl = 'userdata-bbb_custom_style_url=https://bbb22.bbbvm.imdt.com.br/styles.css';
exports.autoSwapLayout = 'userdata-bbb_auto_swap_layout=true';
exports.hidePresentation = 'userdata-bbb_hide_presentation=true';
exports.outsideToggleSelfVoice = 'userdata-bbb_outside_toggle_self_voice=true';
exports.outsideToggleRecording = 'userdata-bbb_outside_toggle_recording=true';
exports.showPublicChatOnLogin = 'userdata-bbb_show_public_chat_on_login=false';
exports.forceRestorePresentationOnNewEvents = 'userdata-bbb_force_restore_presentation_on_new_events=true';
exports.bannerText = 'bannerText=some text';
exports.color = '111111';
exports.bannerColor = `bannerColor=%23${this.color}`;

View File

@ -399,6 +399,82 @@ class CustomParameters {
return resp === colorToRGB;
}
async hideAndSwapPresentation(testName, args, meetingId, customParameter) {
console.log('before init');
await this.page1.init(args, meetingId, { ...params, fullName: 'Moderator1' }, customParameter, testName);
await this.page1.screenshot(`${testName}`, `01-${testName}`);
console.log('after init');
await this.page1.closeAudioModal();
await this.page1.waitForSelector(cpe.container);
if (await this.page1.page.evaluate(util.countTestElements, cpe.restorePresentation) === false && await this.page1.page.evaluate(util.countTestElements, cpe.defaultContent) === false) {
await this.page1.screenshot(`${testName}`, `03-fail-${testName}`);
return false;
}
const resp = await this.page1.page.evaluate(util.countTestElements, cpe.restorePresentation) === true && await this.page1.page.evaluate(util.countTestElements, cpe.defaultContent) === true;
await this.page1.screenshot(`${testName}`, `03-success-${testName}`);
return resp === true;
}
async showPublicChatOnLogin(testName, args, meetingId, customParameter) {
console.log('before init');
await this.page1.init(args, meetingId, { ...params, fullName: 'Moderator1' }, customParameter, testName);
await this.page1.screenshot(`${testName}`, `01-${testName}`);
console.log('after init');
await this.page1.closeAudioModal();
await this.page1.waitForSelector(cpe.container);
if (await this.page1.page.evaluate(util.countTestElements, cpe.chat) === true) {
await this.page1.screenshot(`${testName}`, `03-fail-${testName}`);
return false;
}
const resp = await this.page1.page.evaluate(util.countTestElements, cpe.chat) === false;
await this.page1.screenshot(`${testName}`, `03-success-${testName}`);
return resp === true;
}
async forceRestorePresentationOnNewEvents(testName, args, meetingId, customParameter) {
console.log('before init');
await this.page1.init(args, meetingId, { ...params, fullName: 'Moderator1' }, customParameter, testName);
await this.page2.init(args, this.page1.meetingId, { ...params, fullName: 'Viewer1', moderatorPW: '' }, customParameter, testName);
await this.page1.screenshot(`${testName}`, `01-page1-${testName}`);
await this.page2.screenshot(`${testName}`, `01-page2-${testName}`);
console.log('after init');
await this.page1.closeAudioModal();
await this.page1.screenshot(`${testName}`, `02-page1-${testName}`);
await this.page2.closeAudioModal();
await this.page2.screenshot(`${testName}`, `02-page2-${testName}`);
await this.page1.waitForSelector(cpe.container);
await this.page2.waitForSelector(cpe.hidePresentation);
await this.page2.click(cpe.hidePresentation, true);
await this.page2.screenshot(`${testName}`, `03-page2-${testName}`);
const zoomInCase = await util.zoomIn(this.page1);
await this.page1.screenshot(`${testName}`, `03-page1-${testName}`);
await this.page2.screenshot(`${testName}`, `04-page2-${testName}`);
const zoomOutCase = await util.zoomOut(this.page1);
await this.page1.screenshot(`${testName}`, `03-page1-${testName}`);
await this.page2.screenshot(`${testName}`, `04-page2-${testName}`);
const pollCase = await util.poll(this.page1);
await this.page1.screenshot(`${testName}`, `03-page1-${testName}`);
await this.page2.screenshot(`${testName}`, `04-page2-${testName}`);
const previousSlideCase = await util.previousSlide(this.page1);
await this.page1.screenshot(`${testName}`, `04-page1-${testName}`);
await this.page2.screenshot(`${testName}`, `05-page2-${testName}`);
const nextSlideCase = await util.nextSlide(this.page1);
await this.page1.screenshot(`${testName}`, `05-page1-${testName}`);
await this.page2.screenshot(`${testName}`, `06-page2-${testName}`);
const annotationCase = await util.annotation(this.page1);
await this.page1.screenshot(`${testName}`, `06-page1-${testName}`);
await this.page2.screenshot(`${testName}`, `07-page2-${testName}`);
if ( zoomInCase === true && zoomOutCase === true && pollCase === true && previousSlideCase === true && nextSlideCase === true && annotationCase === true &&
await this.page2.page.evaluate(util.countTestElements, cpe.restorePresentation) === true) {
await this.page2.screenshot(`${testName}`, `05-page2-fail-${testName}`);
console.log('fail');
return false;
}
await this.page2.page.evaluate(util.countTestElements, cpe.restorePresentation) === false;
await this.page2.screenshot(`${testName}`, `05-page2-success-${testName}`);
return true;
}
async closePage(page) {
page.close();
}

View File

@ -21,3 +21,5 @@ exports.restorePresentation = 'button[aria-label="Restore presentation"]';
exports.container = 'div[id="container"]';
exports.defaultContent = 'div[class^="defaultContent--"]';
exports.notificationBar = 'div[class^="notificationsBar--"]';
exports.chat = 'section[aria-label="Chat"]';
exports.hidePresentation = 'button[aria-label="Hide presentation"]';

View File

@ -1,3 +1,5 @@
const path = require('path');
async function autoJoinTest(test) {
const resp = await test.page.evaluate(async () => {
const rep = await document.querySelectorAll('div[aria-label="Join audio modal"]').length === 0;
@ -68,6 +70,102 @@ function hexToRgb(hex) {
return `rgb(${r}, ${g}, ${b})`;
}
async function zoomIn(test) {
try {
await test.page.evaluate(() => {
setInterval(() => {
document.querySelector('button[aria-label="Zoom in"]').scrollBy(0, 10);
}, 100);
});
return true;
} catch (e) {
console.log(e);
return false;
}
}
async function zoomOut(test) {
try {
await test.page.evaluate(() => {
setInterval(() => {
document.querySelector('button[aria-label="Zoom in"]').scrollBy(10, 0);
}, 100);
}); return true;
} catch (e) {
console.log(e);
return false;
}
}
async function poll(test) {
try {
await test.page.evaluate(async () => await document.querySelectorAll('button[aria-label="Actions"]')[0].click());
await test.waitForSelector('li[data-test="pollBtn"]');
await test.click('li[data-test="pollBtn"]', true);
await test.waitForSelector('button[aria-label="Yes / No"]');
await test.click('button[aria-label="Yes / No"]', true);
await test.waitForSelector('button[aria-label="Publish polling results"]');
await test.click('button[aria-label="Publish polling results"]', true);
return true;
} catch (e) {
console.log(e);
return false;
}
}
async function previousSlide(test) {
try {
await test.page.evaluate(() => document.querySelectorAll('button[aria-describedby="prevSlideDesc"]')[0].click());
return true;
} catch (e) {
console.log(e);
return false;
}
}
async function nextSlide(test) {
try {
await test.page.evaluate(() => document.querySelectorAll('button[aria-describedby="nextSlideDesc"]')[0].click());
return true;
} catch (e) {
console.log(e);
return false;
}
}
async function annotation(test) {
await test.waitForSelector('button[aria-label="Tools"]');
await test.click('button[aria-label="Tools"]', true);
await test.waitForSelector('button[aria-label="Pencil"]');
await test.click('button[aria-label="Pencil"]', true);
await test.click('svg[data-test="whiteboard"]', true);
const annoted = await test.page.evaluate(async () => await document.querySelectorAll('[data-test="whiteboard"] > g > g')[1].innerHTML !== '');
return annoted;
}
async function presetationUpload(test) {
try {
await test.waitForSelector('button[aria-label="Actions"]');
await test.click('button[aria-label="Actions"]', true);
await test.waitForSelector('li[data-test="uploadPresentation"]');
await test.click('li[data-test="uploadPresentation"]', true);
const elementHandle = await test.page.$('input[type=file]');
await elementHandle.uploadFile(path.join(__dirname, '../media/DifferentSizes.pdf'));
await test.click('button[aria-label="Confirm "]', true);
return true;
} catch (e) {
console.log(e);
return false;
}
}
exports.zoomIn = zoomIn;
exports.zoomOut = zoomOut;
exports.poll = poll;
exports.previousSlide = previousSlide;
exports.nextSlide = nextSlide;
exports.annotation = annotation;
exports.presetationUpload = presetationUpload;
exports.hexToRgb = hexToRgb;
exports.getTestElement = getTestElement;
exports.countTestElements = countTestElements;