From 59112b79fad0e6b81bd00fe508b14dcd632e7647 Mon Sep 17 00:00:00 2001 From: Carlos Santos <4a.santos@gmail.com> Date: Wed, 21 May 2025 13:26:34 +0200 Subject: [PATCH] ov-components: add initial E2E tests for captions functionality --- .../e2e/captions.test.ts | 179 ++++++++++++++++++ 1 file changed, 179 insertions(+) create mode 100644 openvidu-components-angular/e2e/captions.test.ts diff --git a/openvidu-components-angular/e2e/captions.test.ts b/openvidu-components-angular/e2e/captions.test.ts new file mode 100644 index 00000000..51967b77 --- /dev/null +++ b/openvidu-components-angular/e2e/captions.test.ts @@ -0,0 +1,179 @@ +import { Builder, Key, WebDriver } from 'selenium-webdriver'; +import { TestAppConfig } from './selenium.conf'; +import { OpenViduComponentsPO } from './utils.po.test'; + +const url = TestAppConfig.appUrl; + +//TODO: Uncomment when captions are implemented +// describe('Testing captions features', () => { +// let browser: WebDriver; +// let utils: OpenViduComponentsPO; +// async function createChromeBrowser(): Promise { +// return await new Builder() +// .forBrowser(TestAppConfig.browserName) +// .withCapabilities(TestAppConfig.browserCapabilities) +// .setChromeOptions(TestAppConfig.browserOptions) +// .usingServer(TestAppConfig.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'); +// expect(await utils.isPresent('#more-options-menu')).toBeTrue(); + +// // Checking if captions button is present +// await utils.waitForElement('#captions-btn'); +// expect(await utils.isPresent('#captions-btn')).toBeTrue(); +// 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'); +// expect(await utils.isPresent('#more-options-menu')).toBeTrue(); + +// // Checking if captions button is present +// await utils.waitForElement('#captions-btn'); +// expect(await utils.isPresent('#captions-btn')).toBeTrue(); +// 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')).toBeTrue(); + +// await utils.waitForElement('ov-captions-settings'); + +// // Expect caption button is not present +// expect(await utils.isPresent('#caption-settings-btn')).toBeFalse(); +// }); + +// 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'); +// expect(await utils.isPresent('#more-options-menu')).toBeTrue(); + +// // Checking if captions button is present +// await utils.waitForElement('#captions-btn'); +// expect(await utils.isPresent('#captions-btn')).toBeTrue(); +// 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')).toBeTrue(); + +// await utils.waitForElement('ov-captions-settings'); + +// expect(await utils.isPresent('.captions-container')).toBeTrue(); +// await utils.clickOn('#captions-toggle-slide'); +// expect(await utils.isPresent('.captions-container')).toBeFalse(); + +// await browser.sleep(200); + +// await utils.clickOn('#captions-toggle-slide'); +// expect(await utils.isPresent('.captions-container')).toBeTrue(); +// }); + +// 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'); +// expect(await utils.isPresent('#more-options-menu')).toBeTrue(); + +// // Checking if captions button is present +// await utils.waitForElement('#captions-btn'); +// expect(await utils.isPresent('#captions-btn')).toBeTrue(); +// 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')).toBeTrue(); + +// await utils.waitForElement('ov-captions-settings'); + +// expect(await utils.isPresent('.captions-container')).toBeTrue(); + +// 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()).toEqual('settingsEspañol'); + +// }); +// });