mirror of https://github.com/OpenVidu/openvidu.git
openvidu-components: Added PRO feature e2e tests
parent
595ad9564e
commit
7105fe448d
|
@ -58,6 +58,11 @@ export class OpenViduComponentsPO {
|
||||||
expect(await this.isPresent('#media-buttons-container')).to.be.true;
|
expect(await this.isPresent('#media-buttons-container')).to.be.true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async chceckProFeatureAlertIsPresent(): Promise<void> {
|
||||||
|
await this.waitForElement('ov-pro-feature-template');
|
||||||
|
expect(await this.isPresent('ov-pro-feature-template')).to.be.true;
|
||||||
|
}
|
||||||
|
|
||||||
async clickOn(selector: string): Promise<void> {
|
async clickOn(selector: string): Promise<void> {
|
||||||
const element = await this.waitForElement(selector);
|
const element = await this.waitForElement(selector);
|
||||||
await element.click();
|
await element.click();
|
||||||
|
|
|
@ -120,14 +120,16 @@ describe('Testing API Directives', () => {
|
||||||
// Checking if video is displayed
|
// Checking if video is displayed
|
||||||
await utils.checkVideoElementIsPresent();
|
await utils.checkVideoElementIsPresent();
|
||||||
|
|
||||||
|
// Checking if virtual background button is disabled
|
||||||
|
const button = await utils.waitForElement('#background-effects-btn');
|
||||||
|
expect(button.isEnabled()).to.be.false;
|
||||||
|
|
||||||
// Checking if video track is disabled/muted
|
// Checking if video track is disabled/muted
|
||||||
idVideoEnabled = await browser.executeScript<boolean>(script);
|
idVideoEnabled = await browser.executeScript<boolean>(script);
|
||||||
expect(idVideoEnabled).to.be.false;
|
expect(idVideoEnabled).to.be.false;
|
||||||
|
|
||||||
await utils.waitForElement('#videocam_off');
|
await utils.waitForElement('#videocam_off');
|
||||||
|
await utils.clickOn('#join-button');
|
||||||
const joinButton = await utils.waitForElement('#join-button');
|
|
||||||
await joinButton.click();
|
|
||||||
|
|
||||||
// Checking if video is muted after join the room
|
// Checking if video is muted after join the room
|
||||||
await utils.checkSessionIsPresent();
|
await utils.checkSessionIsPresent();
|
||||||
|
@ -1325,8 +1327,7 @@ describe('Testing CHAT features', () => {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
describe('Testing PRO features with OpenVidu CE', () => {
|
||||||
describe('Testing captions features', () => {
|
|
||||||
let browser: WebDriver;
|
let browser: WebDriver;
|
||||||
let utils: OpenViduComponentsPO;
|
let utils: OpenViduComponentsPO;
|
||||||
async function createChromeBrowser(): Promise<WebDriver> {
|
async function createChromeBrowser(): Promise<WebDriver> {
|
||||||
|
@ -1347,6 +1348,41 @@ describe('Testing captions features', () => {
|
||||||
await browser.quit();
|
await browser.quit();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('should SHOW the VIRTUAL BACKGROUND PRO feature dialog', async () => {
|
||||||
|
await browser.get(`${url}?prejoin=true`);
|
||||||
|
|
||||||
|
await utils.checkPrejoinIsPresent();
|
||||||
|
|
||||||
|
await utils.waitForElement('#background-effects-btn');
|
||||||
|
await utils.clickOn('#background-effects-btn');
|
||||||
|
|
||||||
|
await utils.chceckProFeatureAlertIsPresent();
|
||||||
|
|
||||||
|
// Join to room
|
||||||
|
await utils.clickOn('#join-button');
|
||||||
|
|
||||||
|
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;
|
||||||
|
|
||||||
|
await utils.waitForElement('#virtual-bg-btn');
|
||||||
|
await utils.clickOn('#virtual-bg-btn');
|
||||||
|
|
||||||
|
// Expect it shows the pro feature alert
|
||||||
|
await utils.chceckProFeatureAlertIsPresent();
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
it('should SHOW the CAPTIONS PRO feature dialog', async () => {
|
it('should SHOW the CAPTIONS PRO feature dialog', async () => {
|
||||||
await browser.get(`${url}?prejoin=false`);
|
await browser.get(`${url}?prejoin=false`);
|
||||||
|
|
||||||
|
@ -1390,163 +1426,186 @@ describe('Testing captions features', () => {
|
||||||
await utils.waitForElement('ov-pro-feature-template');
|
await utils.waitForElement('ov-pro-feature-template');
|
||||||
expect(await utils.isPresent('.captions-container')).to.be.false;
|
expect(await utils.isPresent('.captions-container')).to.be.false;
|
||||||
});
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* TODO:
|
||||||
* The following E2E TESTS only work with OpenVidu PRO
|
* The following E2E TESTS only work with OpenVidu PRO.
|
||||||
|
* It should run with OpenVidu PRO
|
||||||
*/
|
*/
|
||||||
|
// describe('Testing captions features', () => {
|
||||||
|
// let browser: WebDriver;
|
||||||
|
// let utils: OpenViduComponentsPO;
|
||||||
|
// async function createChromeBrowser(): Promise<WebDriver> {
|
||||||
|
// return await new Builder()
|
||||||
|
// .forBrowser(WebComponentConfig.browserName)
|
||||||
|
// .withCapabilities(WebComponentConfig.browserCapabilities)
|
||||||
|
// .setChromeOptions(WebComponentConfig.browserOptions)
|
||||||
|
// .usingServer(WebComponentConfig.seleniumAddress)
|
||||||
|
// .build();
|
||||||
|
// }
|
||||||
|
|
||||||
// it('should OPEN the CAPTIONS container', async () => {
|
// beforeEach(async () => {
|
||||||
// await browser.get(`${url}?prejoin=false`);
|
// browser = await createChromeBrowser();
|
||||||
|
// utils = new OpenViduComponentsPO(browser);
|
||||||
|
// });
|
||||||
|
|
||||||
// await utils.checkSessionIsPresent();
|
// afterEach(async () => {
|
||||||
|
// await browser.quit();
|
||||||
|
// });
|
||||||
|
|
||||||
// // Checking if toolbar is present
|
// it('should OPEN the CAPTIONS container', async () => {
|
||||||
// await utils.checkToolbarIsPresent();
|
// await browser.get(`${url}?prejoin=false`);
|
||||||
|
|
||||||
// // Open more options menu
|
// await utils.checkSessionIsPresent();
|
||||||
// await utils.clickOn('#more-options-btn');
|
|
||||||
|
|
||||||
// await browser.sleep(500);
|
// // Checking if toolbar is present
|
||||||
|
// await utils.checkToolbarIsPresent();
|
||||||
|
|
||||||
// // Checking if button panel is present
|
// // Open more options menu
|
||||||
// await utils.waitForElement('.mat-menu-content');
|
// await utils.clickOn('#more-options-btn');
|
||||||
// expect(await utils.isPresent('.mat-menu-content')).to.be.true;
|
|
||||||
|
|
||||||
// // Checking if captions button is present
|
// await browser.sleep(500);
|
||||||
// await utils.waitForElement('#captions-btn');
|
|
||||||
// expect(await utils.isPresent('#captions-btn')).to.be.true;
|
|
||||||
// await utils.clickOn('#captions-btn');
|
|
||||||
|
|
||||||
// await utils.waitForElement('.captions-container');
|
// // Checking if button panel is present
|
||||||
// });
|
// await utils.waitForElement('.mat-menu-content');
|
||||||
|
// expect(await utils.isPresent('.mat-menu-content')).to.be.true;
|
||||||
|
|
||||||
// it('should OPEN the SETTINGS panel from captions button', async () => {
|
// // Checking if captions button is present
|
||||||
// await browser.get(`${url}?prejoin=false`);
|
// await utils.waitForElement('#captions-btn');
|
||||||
|
// expect(await utils.isPresent('#captions-btn')).to.be.true;
|
||||||
|
// await utils.clickOn('#captions-btn');
|
||||||
|
|
||||||
// await utils.checkSessionIsPresent();
|
// await utils.waitForElement('.captions-container');
|
||||||
|
// });
|
||||||
|
|
||||||
// // Checking if toolbar is present
|
// it('should OPEN the SETTINGS panel from captions button', async () => {
|
||||||
// await utils.checkToolbarIsPresent();
|
// await browser.get(`${url}?prejoin=false`);
|
||||||
|
|
||||||
// // Open more options menu
|
// await utils.checkSessionIsPresent();
|
||||||
// await utils.clickOn('#more-options-btn');
|
|
||||||
|
|
||||||
// await browser.sleep(500);
|
// // Checking if toolbar is present
|
||||||
|
// await utils.checkToolbarIsPresent();
|
||||||
|
|
||||||
// // Checking if button panel is present
|
// // Open more options menu
|
||||||
// await utils.waitForElement('.mat-menu-content');
|
// await utils.clickOn('#more-options-btn');
|
||||||
// expect(await utils.isPresent('.mat-menu-content')).to.be.true;
|
|
||||||
|
|
||||||
// // Checking if captions button is present
|
// await browser.sleep(500);
|
||||||
// await utils.waitForElement('#captions-btn');
|
|
||||||
// expect(await utils.isPresent('#captions-btn')).to.be.true;
|
|
||||||
// await utils.clickOn('#captions-btn');
|
|
||||||
|
|
||||||
// await utils.waitForElement('.captions-container');
|
// // Checking if button panel is present
|
||||||
// await utils.waitForElement('#caption-settings-btn');
|
// await utils.waitForElement('.mat-menu-content');
|
||||||
// await utils.clickOn('#caption-settings-btn');
|
// expect(await utils.isPresent('.mat-menu-content')).to.be.true;
|
||||||
|
|
||||||
// await browser.sleep(500);
|
// // 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('.settings-container');
|
// await utils.waitForElement('.captions-container');
|
||||||
// expect(await utils.isPresent('.settings-container')).to.be.true;
|
// await utils.waitForElement('#caption-settings-btn');
|
||||||
|
// await utils.clickOn('#caption-settings-btn');
|
||||||
|
|
||||||
// await utils.waitForElement('ov-captions-settings');
|
// await browser.sleep(500);
|
||||||
|
|
||||||
// // Expect caption button is not present
|
// await utils.waitForElement('.settings-container');
|
||||||
// expect(await utils.isPresent('#caption-settings-btn')).to.be.false;
|
// expect(await utils.isPresent('.settings-container')).to.be.true;
|
||||||
// });
|
|
||||||
|
|
||||||
// it('should TOGGLE the CAPTIONS container from settings panel', async () => {
|
// await utils.waitForElement('ov-captions-settings');
|
||||||
// await browser.get(`${url}?prejoin=false`);
|
|
||||||
|
|
||||||
// await utils.checkSessionIsPresent();
|
// // Expect caption button is not present
|
||||||
|
// expect(await utils.isPresent('#caption-settings-btn')).to.be.false;
|
||||||
|
// });
|
||||||
|
|
||||||
// // Checking if toolbar is present
|
// it('should TOGGLE the CAPTIONS container from settings panel', async () => {
|
||||||
// await utils.checkToolbarIsPresent();
|
// await browser.get(`${url}?prejoin=false`);
|
||||||
|
|
||||||
// // Open more options menu
|
// await utils.checkSessionIsPresent();
|
||||||
// await utils.clickOn('#more-options-btn');
|
|
||||||
|
|
||||||
// await browser.sleep(500);
|
// // Checking if toolbar is present
|
||||||
|
// await utils.checkToolbarIsPresent();
|
||||||
|
|
||||||
// // Checking if button panel is present
|
// // Open more options menu
|
||||||
// await utils.waitForElement('.mat-menu-content');
|
// await utils.clickOn('#more-options-btn');
|
||||||
// expect(await utils.isPresent('.mat-menu-content')).to.be.true;
|
|
||||||
|
|
||||||
// // Checking if captions button is present
|
// await browser.sleep(500);
|
||||||
// await utils.waitForElement('#captions-btn');
|
|
||||||
// expect(await utils.isPresent('#captions-btn')).to.be.true;
|
|
||||||
// await utils.clickOn('#captions-btn');
|
|
||||||
|
|
||||||
// await utils.waitForElement('.captions-container');
|
// // Checking if button panel is present
|
||||||
// await utils.waitForElement('#caption-settings-btn');
|
// await utils.waitForElement('.mat-menu-content');
|
||||||
// await utils.clickOn('#caption-settings-btn');
|
// expect(await utils.isPresent('.mat-menu-content')).to.be.true;
|
||||||
|
|
||||||
// await browser.sleep(500);
|
// // 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('.settings-container');
|
// await utils.waitForElement('.captions-container');
|
||||||
// expect(await utils.isPresent('.settings-container')).to.be.true;
|
// await utils.waitForElement('#caption-settings-btn');
|
||||||
|
// await utils.clickOn('#caption-settings-btn');
|
||||||
|
|
||||||
// await utils.waitForElement('ov-captions-settings');
|
// await browser.sleep(500);
|
||||||
|
|
||||||
// expect(await utils.isPresent('.captions-container')).to.be.true;
|
// await utils.waitForElement('.settings-container');
|
||||||
// await utils.clickOn('#captions-toggle-slide');
|
// expect(await utils.isPresent('.settings-container')).to.be.true;
|
||||||
// expect(await utils.isPresent('.captions-container')).to.be.false;
|
|
||||||
|
|
||||||
// await browser.sleep(200);
|
// await utils.waitForElement('ov-captions-settings');
|
||||||
|
|
||||||
// await utils.clickOn('#captions-toggle-slide');
|
// expect(await utils.isPresent('.captions-container')).to.be.true;
|
||||||
// expect(await utils.isPresent('.captions-container')).to.be.true;
|
// await utils.clickOn('#captions-toggle-slide');
|
||||||
// });
|
// expect(await utils.isPresent('.captions-container')).to.be.false;
|
||||||
|
|
||||||
// it('should change the CAPTIONS language', async () => {
|
// await browser.sleep(200);
|
||||||
// await browser.get(`${url}?prejoin=false`);
|
|
||||||
|
|
||||||
// await utils.checkSessionIsPresent();
|
// await utils.clickOn('#captions-toggle-slide');
|
||||||
|
// expect(await utils.isPresent('.captions-container')).to.be.true;
|
||||||
|
// });
|
||||||
|
|
||||||
// // Checking if toolbar is present
|
// it('should change the CAPTIONS language', async () => {
|
||||||
// await utils.checkToolbarIsPresent();
|
// await browser.get(`${url}?prejoin=false`);
|
||||||
|
|
||||||
// // Open more options menu
|
// await utils.checkSessionIsPresent();
|
||||||
// await utils.clickOn('#more-options-btn');
|
|
||||||
|
|
||||||
// await browser.sleep(500);
|
// // Checking if toolbar is present
|
||||||
|
// await utils.checkToolbarIsPresent();
|
||||||
|
|
||||||
// // Checking if button panel is present
|
// // Open more options menu
|
||||||
// await utils.waitForElement('.mat-menu-content');
|
// await utils.clickOn('#more-options-btn');
|
||||||
// expect(await utils.isPresent('.mat-menu-content')).to.be.true;
|
|
||||||
|
|
||||||
// // Checking if captions button is present
|
// await browser.sleep(500);
|
||||||
// await utils.waitForElement('#captions-btn');
|
|
||||||
// expect(await utils.isPresent('#captions-btn')).to.be.true;
|
|
||||||
// await utils.clickOn('#captions-btn');
|
|
||||||
|
|
||||||
// await utils.waitForElement('.captions-container');
|
// // Checking if button panel is present
|
||||||
// await utils.waitForElement('#caption-settings-btn');
|
// await utils.waitForElement('.mat-menu-content');
|
||||||
// await utils.clickOn('#caption-settings-btn');
|
// expect(await utils.isPresent('.mat-menu-content')).to.be.true;
|
||||||
|
|
||||||
// await browser.sleep(500);
|
// // 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('.settings-container');
|
// await utils.waitForElement('.captions-container');
|
||||||
// expect(await utils.isPresent('.settings-container')).to.be.true;
|
// await utils.waitForElement('#caption-settings-btn');
|
||||||
|
// await utils.clickOn('#caption-settings-btn');
|
||||||
|
|
||||||
// await utils.waitForElement('ov-captions-settings');
|
// await browser.sleep(500);
|
||||||
|
|
||||||
// expect(await utils.isPresent('.captions-container')).to.be.true;
|
// await utils.waitForElement('.settings-container');
|
||||||
|
// expect(await utils.isPresent('.settings-container')).to.be.true;
|
||||||
|
|
||||||
// await utils.clickOn('.lang-button');
|
// await utils.waitForElement('ov-captions-settings');
|
||||||
// await browser.sleep(500);
|
|
||||||
|
|
||||||
// await utils.clickOn('#es-ES');
|
// expect(await utils.isPresent('.captions-container')).to.be.true;
|
||||||
// await utils.clickOn('.panel-close-button');
|
|
||||||
|
|
||||||
// const button = await utils.waitForElement('#caption-settings-btn');
|
// await utils.clickOn('.lang-button');
|
||||||
// expect(await button.getText()).equals('settingsEspañol');
|
// 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', () => {
|
||||||
let browser: WebDriver;
|
let browser: WebDriver;
|
||||||
|
|
Loading…
Reference in New Issue