2024-07-02 19:19:05 +02:00
|
|
|
import { Builder, Key, WebDriver } from 'selenium-webdriver';
|
|
|
|
import { OPENVIDU_CALL_SERVER } from '../config';
|
|
|
|
import { WebComponentConfig } from '../selenium.conf';
|
|
|
|
import { OpenViduComponentsPO } from '../utils.po.test';
|
|
|
|
|
|
|
|
const url = `${WebComponentConfig.appUrl}?OV_URL=${OPENVIDU_CALL_SERVER}`;
|
|
|
|
|
|
|
|
//TODO: Uncomment when captions are implemented
|
|
|
|
// 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();
|
|
|
|
// }
|
|
|
|
|
|
|
|
// beforeEach(async () => {
|
|
|
|
// browser = await createChromeBrowser();
|
|
|
|
// utils = new OpenViduComponentsPO(browser);
|
|
|
|
// });
|
|
|
|
|
|
|
|
// afterEach(async () => {
|
|
|
|
// await browser.quit();
|
|
|
|
// });
|
|
|
|
|
|
|
|
// it('should OPEN the CAPTIONS container', 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('#more-options-menu');
|
2024-10-10 20:49:17 +02:00
|
|
|
// expect(await utils.isPresent('#more-options-menu')).toBeTrue();
|
2024-07-02 19:19:05 +02:00
|
|
|
|
|
|
|
// // Checking if captions button is present
|
|
|
|
// await utils.waitForElement('#captions-btn');
|
2024-10-10 20:49:17 +02:00
|
|
|
// expect(await utils.isPresent('#captions-btn')).toBeTrue();
|
2024-07-02 19:19:05 +02:00
|
|
|
// await utils.clickOn('#captions-btn');
|
|
|
|
|
|
|
|
// await utils.waitForElement('.captions-container');
|
|
|
|
// });
|
|
|
|
|
|
|
|
// it('should OPEN the SETTINGS panel from captions button', 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('#more-options-menu');
|
2024-10-10 20:49:17 +02:00
|
|
|
// expect(await utils.isPresent('#more-options-menu')).toBeTrue();
|
2024-07-02 19:19:05 +02:00
|
|
|
|
|
|
|
// // Checking if captions button is present
|
|
|
|
// await utils.waitForElement('#captions-btn');
|
2024-10-10 20:49:17 +02:00
|
|
|
// expect(await utils.isPresent('#captions-btn')).toBeTrue();
|
2024-07-02 19:19:05 +02:00
|
|
|
// 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');
|
2024-10-10 20:49:17 +02:00
|
|
|
// expect(await utils.isPresent('.settings-container')).toBeTrue();
|
2024-07-02 19:19:05 +02:00
|
|
|
|
|
|
|
// await utils.waitForElement('ov-captions-settings');
|
|
|
|
|
|
|
|
// // Expect caption button is not present
|
2024-10-10 20:49:17 +02:00
|
|
|
// expect(await utils.isPresent('#caption-settings-btn')).toBeFalse();
|
2024-07-02 19:19:05 +02:00
|
|
|
// });
|
|
|
|
|
|
|
|
// 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('#more-options-menu');
|
2024-10-10 20:49:17 +02:00
|
|
|
// expect(await utils.isPresent('#more-options-menu')).toBeTrue();
|
2024-07-02 19:19:05 +02:00
|
|
|
|
|
|
|
// // Checking if captions button is present
|
|
|
|
// await utils.waitForElement('#captions-btn');
|
2024-10-10 20:49:17 +02:00
|
|
|
// expect(await utils.isPresent('#captions-btn')).toBeTrue();
|
2024-07-02 19:19:05 +02:00
|
|
|
// 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');
|
2024-10-10 20:49:17 +02:00
|
|
|
// expect(await utils.isPresent('.settings-container')).toBeTrue();
|
2024-07-02 19:19:05 +02:00
|
|
|
|
|
|
|
// await utils.waitForElement('ov-captions-settings');
|
|
|
|
|
2024-10-10 20:49:17 +02:00
|
|
|
// expect(await utils.isPresent('.captions-container')).toBeTrue();
|
2024-07-02 19:19:05 +02:00
|
|
|
// await utils.clickOn('#captions-toggle-slide');
|
2024-10-10 20:49:17 +02:00
|
|
|
// expect(await utils.isPresent('.captions-container')).toBeFalse();
|
2024-07-02 19:19:05 +02:00
|
|
|
|
|
|
|
// await browser.sleep(200);
|
|
|
|
|
|
|
|
// await utils.clickOn('#captions-toggle-slide');
|
2024-10-10 20:49:17 +02:00
|
|
|
// expect(await utils.isPresent('.captions-container')).toBeTrue();
|
2024-07-02 19:19:05 +02:00
|
|
|
// });
|
|
|
|
|
|
|
|
// 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('#more-options-menu');
|
2024-10-10 20:49:17 +02:00
|
|
|
// expect(await utils.isPresent('#more-options-menu')).toBeTrue();
|
2024-07-02 19:19:05 +02:00
|
|
|
|
|
|
|
// // Checking if captions button is present
|
|
|
|
// await utils.waitForElement('#captions-btn');
|
2024-10-10 20:49:17 +02:00
|
|
|
// expect(await utils.isPresent('#captions-btn')).toBeTrue();
|
2024-07-02 19:19:05 +02:00
|
|
|
// 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');
|
2024-10-10 20:49:17 +02:00
|
|
|
// expect(await utils.isPresent('.settings-container')).toBeTrue();
|
2024-07-02 19:19:05 +02:00
|
|
|
|
|
|
|
// await utils.waitForElement('ov-captions-settings');
|
|
|
|
|
2024-10-10 20:49:17 +02:00
|
|
|
// expect(await utils.isPresent('.captions-container')).toBeTrue();
|
2024-07-02 19:19:05 +02:00
|
|
|
|
|
|
|
// 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');
|
2024-10-10 20:49:17 +02:00
|
|
|
// expect(await button.getText()).toEqual('settingsEspañol');
|
2024-07-02 19:19:05 +02:00
|
|
|
|
|
|
|
// });
|
|
|
|
// });
|