openvidu-components: Updated captions e2e test

pull/763/head
Carlos Santos 2022-11-16 11:35:07 +01:00
parent 41e9cc95eb
commit 6ab6c22158
3 changed files with 153 additions and 103 deletions

View File

@ -45,7 +45,7 @@ export const WebComponentConfig: BrowserConfig = {
seleniumAddress: LAUNCH_MODE === 'CI' ? 'http://localhost:3000/webdriver' : '', seleniumAddress: LAUNCH_MODE === 'CI' ? 'http://localhost:3000/webdriver' : '',
browserName: 'chrome', browserName: 'chrome',
browserCapabilities: Capabilities.chrome().set('acceptInsecureCerts', true), browserCapabilities: Capabilities.chrome().set('acceptInsecureCerts', true),
browserOptions: new chrome.Options().excludeSwitches().addArguments(...(LAUNCH_MODE === 'CI' ? chromeArgumentsCI : chromeArguments)) browserOptions: new chrome.Options().addArguments(...(LAUNCH_MODE === 'CI' ? chromeArgumentsCI : chromeArguments))
}; };
export const AngularConfig: BrowserConfig = { export const AngularConfig: BrowserConfig = {

View File

@ -33,7 +33,6 @@ $(document).ready(() => {
SINGLE_TOKEN = url.searchParams.get("singleToken") === null ? false : url.searchParams.get("singleToken") === 'true'; SINGLE_TOKEN = url.searchParams.get("singleToken") === null ? false : url.searchParams.get("singleToken") === 'true';
// Directives // Directives
MINIMAL = url.searchParams.get("minimal") === null ? false : url.searchParams.get("minimal") === 'true'; MINIMAL = url.searchParams.get("minimal") === null ? false : url.searchParams.get("minimal") === 'true';
PARTICIPANT_NAME = url.searchParams.get("participantName") || 'TEST_USER'; PARTICIPANT_NAME = url.searchParams.get("participantName") || 'TEST_USER';
@ -247,7 +246,9 @@ function createToken(sessionId) {
Authorization: 'Basic ' + btoa('OPENVIDUAPP:' + OPENVIDU_SERVER_SECRET), Authorization: 'Basic ' + btoa('OPENVIDUAPP:' + OPENVIDU_SERVER_SECRET),
'Content-Type': 'application/json', 'Content-Type': 'application/json',
}, },
success: (response) => resolve(response.token), success: (response) => {
resolve(response.token);
},
error: (error) => reject(error), error: (error) => reject(error),
}); });
}); });

View File

@ -1347,7 +1347,7 @@ describe('Testing captions features', () => {
await browser.quit(); await browser.quit();
}); });
it('should OPEN the CAPTIONS container', async () => { it('should SHOW the CAPTIONS PRO feature dialog', async () => {
await browser.get(`${url}?prejoin=false`); await browser.get(`${url}?prejoin=false`);
await utils.checkSessionIsPresent(); await utils.checkSessionIsPresent();
@ -1364,21 +1364,14 @@ describe('Testing captions features', () => {
await utils.waitForElement('.mat-menu-content'); await utils.waitForElement('.mat-menu-content');
expect(await utils.isPresent('.mat-menu-content')).to.be.true; expect(await utils.isPresent('.mat-menu-content')).to.be.true;
// Checking if captions button is present await utils.waitForElement('#toolbar-settings-btn');
await utils.waitForElement('#captions-btn'); expect(await utils.isPresent('#toolbar-settings-btn')).to.be.true;
expect(await utils.isPresent('#captions-btn')).to.be.true; await utils.clickOn('#toolbar-settings-btn');
await utils.clickOn('#captions-btn');
await utils.waitForElement('.captions-container'); // Expect captions panel shows the pro feature content
}); await utils.waitForElement('#settings-container');
await utils.clickOn('#captions-opt');
it('should OPEN the SETTINGS panel from captions button', async () => { await utils.waitForElement('.pro-feature');
await browser.get(`${url}?prejoin=false`);
await utils.checkSessionIsPresent();
// Checking if toolbar is present
await utils.checkToolbarIsPresent();
// Open more options menu // Open more options menu
await utils.clickOn('#more-options-btn'); await utils.clickOn('#more-options-btn');
@ -1394,109 +1387,165 @@ describe('Testing captions features', () => {
expect(await utils.isPresent('#captions-btn')).to.be.true; expect(await utils.isPresent('#captions-btn')).to.be.true;
await utils.clickOn('#captions-btn'); await utils.clickOn('#captions-btn');
await utils.waitForElement('.captions-container'); await utils.waitForElement('ov-pro-feature-template');
await utils.waitForElement('#caption-settings-btn');
await utils.clickOn('#caption-settings-btn');
await browser.sleep(500);
await utils.waitForElement('.settings-container');
expect(await utils.isPresent('.settings-container')).to.be.true;
await utils.waitForElement('ov-captions-settings');
// Expect caption button is not present
expect(await utils.isPresent('#caption-settings-btn')).to.be.false;
});
it('should TOGGLE the CAPTIONS container from settings panel', async () => {
await browser.get(`${url}?prejoin=false`);
await utils.checkSessionIsPresent();
// Checking if toolbar is present
await utils.checkToolbarIsPresent();
// Open more options menu
await utils.clickOn('#more-options-btn');
await browser.sleep(500);
// Checking if button panel is present
await utils.waitForElement('.mat-menu-content');
expect(await utils.isPresent('.mat-menu-content')).to.be.true;
// Checking if captions button is present
await utils.waitForElement('#captions-btn');
expect(await utils.isPresent('#captions-btn')).to.be.true;
await utils.clickOn('#captions-btn');
await utils.waitForElement('.captions-container');
await utils.waitForElement('#caption-settings-btn');
await utils.clickOn('#caption-settings-btn');
await browser.sleep(500);
await utils.waitForElement('.settings-container');
expect(await utils.isPresent('.settings-container')).to.be.true;
await utils.waitForElement('ov-captions-settings');
expect(await utils.isPresent('.captions-container')).to.be.true;
await utils.clickOn('#captions-toggle-slide');
expect(await utils.isPresent('.captions-container')).to.be.false; expect(await utils.isPresent('.captions-container')).to.be.false;
await browser.sleep(200);
await utils.clickOn('#captions-toggle-slide');
expect(await utils.isPresent('.captions-container')).to.be.true;
}); });
it('should change the CAPTIONS language', async () => { /**
await browser.get(`${url}?prejoin=false`); *
* The following E2E TESTS only work with OpenVidu PRO
*/
await utils.checkSessionIsPresent(); // it('should OPEN the CAPTIONS container', async () => {
// await browser.get(`${url}?prejoin=false`);
// Checking if toolbar is present // await utils.checkSessionIsPresent();
await utils.checkToolbarIsPresent();
// Open more options menu // // Checking if toolbar is present
await utils.clickOn('#more-options-btn'); // await utils.checkToolbarIsPresent();
await browser.sleep(500); // // Open more options menu
// await utils.clickOn('#more-options-btn');
// Checking if button panel is present // await browser.sleep(500);
await utils.waitForElement('.mat-menu-content');
expect(await utils.isPresent('.mat-menu-content')).to.be.true;
// Checking if captions button is present // // Checking if button panel is present
await utils.waitForElement('#captions-btn'); // await utils.waitForElement('.mat-menu-content');
expect(await utils.isPresent('#captions-btn')).to.be.true; // expect(await utils.isPresent('.mat-menu-content')).to.be.true;
await utils.clickOn('#captions-btn');
await utils.waitForElement('.captions-container'); // // Checking if captions button is present
await utils.waitForElement('#caption-settings-btn'); // await utils.waitForElement('#captions-btn');
await utils.clickOn('#caption-settings-btn'); // expect(await utils.isPresent('#captions-btn')).to.be.true;
// await utils.clickOn('#captions-btn');
await browser.sleep(500); // await utils.waitForElement('.captions-container');
// });
await utils.waitForElement('.settings-container'); // it('should OPEN the SETTINGS panel from captions button', async () => {
expect(await utils.isPresent('.settings-container')).to.be.true; // await browser.get(`${url}?prejoin=false`);
await utils.waitForElement('ov-captions-settings'); // await utils.checkSessionIsPresent();
expect(await utils.isPresent('.captions-container')).to.be.true; // // Checking if toolbar is present
// await utils.checkToolbarIsPresent();
await utils.clickOn('.lang-button'); // // Open more options menu
await browser.sleep(500); // await utils.clickOn('#more-options-btn');
await utils.clickOn('#es-ES'); // await browser.sleep(500);
await utils.clickOn('.panel-close-button');
const button = await utils.waitForElement('#caption-settings-btn'); // // Checking if button panel is present
expect(await button.getText()).equals('settingsEspañol'); // await utils.waitForElement('.mat-menu-content');
// expect(await utils.isPresent('.mat-menu-content')).to.be.true;
}); // // Checking if captions button is present
// await utils.waitForElement('#captions-btn');
// expect(await utils.isPresent('#captions-btn')).to.be.true;
// await utils.clickOn('#captions-btn');
// await utils.waitForElement('.captions-container');
// await utils.waitForElement('#caption-settings-btn');
// await utils.clickOn('#caption-settings-btn');
// await browser.sleep(500);
// await utils.waitForElement('.settings-container');
// expect(await utils.isPresent('.settings-container')).to.be.true;
// await utils.waitForElement('ov-captions-settings');
// // Expect caption button is not present
// expect(await utils.isPresent('#caption-settings-btn')).to.be.false;
// });
// it('should TOGGLE the CAPTIONS container from settings panel', async () => {
// await browser.get(`${url}?prejoin=false`);
// await utils.checkSessionIsPresent();
// // Checking if toolbar is present
// await utils.checkToolbarIsPresent();
// // Open more options menu
// await utils.clickOn('#more-options-btn');
// await browser.sleep(500);
// // Checking if button panel is present
// await utils.waitForElement('.mat-menu-content');
// expect(await utils.isPresent('.mat-menu-content')).to.be.true;
// // Checking if captions button is present
// await utils.waitForElement('#captions-btn');
// expect(await utils.isPresent('#captions-btn')).to.be.true;
// await utils.clickOn('#captions-btn');
// await utils.waitForElement('.captions-container');
// await utils.waitForElement('#caption-settings-btn');
// await utils.clickOn('#caption-settings-btn');
// await browser.sleep(500);
// await utils.waitForElement('.settings-container');
// expect(await utils.isPresent('.settings-container')).to.be.true;
// await utils.waitForElement('ov-captions-settings');
// expect(await utils.isPresent('.captions-container')).to.be.true;
// await utils.clickOn('#captions-toggle-slide');
// expect(await utils.isPresent('.captions-container')).to.be.false;
// await browser.sleep(200);
// await utils.clickOn('#captions-toggle-slide');
// expect(await utils.isPresent('.captions-container')).to.be.true;
// });
// it('should change the CAPTIONS language', async () => {
// await browser.get(`${url}?prejoin=false`);
// await utils.checkSessionIsPresent();
// // Checking if toolbar is present
// await utils.checkToolbarIsPresent();
// // Open more options menu
// await utils.clickOn('#more-options-btn');
// await browser.sleep(500);
// // Checking if button panel is present
// await utils.waitForElement('.mat-menu-content');
// expect(await utils.isPresent('.mat-menu-content')).to.be.true;
// // Checking if captions button is present
// await utils.waitForElement('#captions-btn');
// expect(await utils.isPresent('#captions-btn')).to.be.true;
// await utils.clickOn('#captions-btn');
// await utils.waitForElement('.captions-container');
// await utils.waitForElement('#caption-settings-btn');
// await utils.clickOn('#caption-settings-btn');
// await browser.sleep(500);
// await utils.waitForElement('.settings-container');
// expect(await utils.isPresent('.settings-container')).to.be.true;
// await utils.waitForElement('ov-captions-settings');
// expect(await utils.isPresent('.captions-container')).to.be.true;
// await utils.clickOn('.lang-button');
// await browser.sleep(500);
// await utils.clickOn('#es-ES');
// await utils.clickOn('.panel-close-button');
// const button = await utils.waitForElement('#caption-settings-btn');
// expect(await button.getText()).equals('settingsEspañol');
// });
}); });
describe('Testing WITHOUT MEDIA DEVICES permissions', () => { describe('Testing WITHOUT MEDIA DEVICES permissions', () => {