From d52dc9b6cfd6265fecc4e06db1487a803dd01470 Mon Sep 17 00:00:00 2001 From: Carlos Santos <4a.santos@gmail.com> Date: Mon, 29 Jul 2024 13:20:07 +0200 Subject: [PATCH] ov-components: Remove old and unnecessary test and refactored code --- .../e2e/nested-components/directives.test.ts | 63 ++++++------------- .../e2e/nested-components/events.test.ts | 12 ++-- .../e2e/selenium.conf.ts | 2 +- 3 files changed, 25 insertions(+), 52 deletions(-) diff --git a/openvidu-components-angular/e2e/nested-components/directives.test.ts b/openvidu-components-angular/e2e/nested-components/directives.test.ts index 5c654224..6784b945 100644 --- a/openvidu-components-angular/e2e/nested-components/directives.test.ts +++ b/openvidu-components-angular/e2e/nested-components/directives.test.ts @@ -1,20 +1,20 @@ import { expect } from 'chai'; import { Builder, By, WebDriver } from 'selenium-webdriver'; -import { AngularConfig } from '../selenium.conf'; +import { NestedConfig } from '../selenium.conf'; import { OpenViduComponentsPO } from '../utils.po.test'; -const url = AngularConfig.appUrl; +const url = NestedConfig.appUrl; describe('Testing TOOLBAR STRUCTURAL DIRECTIVES', () => { let browser: WebDriver; let utils: OpenViduComponentsPO; async function createChromeBrowser(): Promise { return await new Builder() - .forBrowser(AngularConfig.browserName) - .withCapabilities(AngularConfig.browserCapabilities) - .setChromeOptions(AngularConfig.browserOptions) - .usingServer(AngularConfig.seleniumAddress) + .forBrowser(NestedConfig.browserName) + .withCapabilities(NestedConfig.browserCapabilities) + .setChromeOptions(NestedConfig.browserOptions) + .usingServer(NestedConfig.seleniumAddress) .build(); } @@ -147,10 +147,10 @@ describe('Testing PANEL STRUCTURAL DIRECTIVES', () => { async function createChromeBrowser(): Promise { return await new Builder() - .forBrowser(AngularConfig.browserName) - .withCapabilities(AngularConfig.browserCapabilities) - .setChromeOptions(AngularConfig.browserOptions) - .usingServer(AngularConfig.seleniumAddress) + .forBrowser(NestedConfig.browserName) + .withCapabilities(NestedConfig.browserCapabilities) + .setChromeOptions(NestedConfig.browserOptions) + .usingServer(NestedConfig.seleniumAddress) .build(); } @@ -669,10 +669,10 @@ describe('Testing LAYOUT STRUCTURAL DIRECTIVES', () => { async function createChromeBrowser(): Promise { return await new Builder() - .forBrowser(AngularConfig.browserName) - .withCapabilities(AngularConfig.browserCapabilities) - .setChromeOptions(AngularConfig.browserOptions) - .usingServer(AngularConfig.seleniumAddress) + .forBrowser(NestedConfig.browserName) + .withCapabilities(NestedConfig.browserCapabilities) + .setChromeOptions(NestedConfig.browserOptions) + .usingServer(NestedConfig.seleniumAddress) .build(); } @@ -767,10 +767,10 @@ describe('Testing ATTRIBUTE DIRECTIVES', () => { async function createChromeBrowser(): Promise { return await new Builder() - .forBrowser(AngularConfig.browserName) - .withCapabilities(AngularConfig.browserCapabilities) - .setChromeOptions(AngularConfig.browserOptions) - .usingServer(AngularConfig.seleniumAddress) + .forBrowser(NestedConfig.browserName) + .withCapabilities(NestedConfig.browserCapabilities) + .setChromeOptions(NestedConfig.browserOptions) + .usingServer(NestedConfig.seleniumAddress) .build(); } @@ -1049,31 +1049,4 @@ describe('Testing ATTRIBUTE DIRECTIVES', () => { expect(await utils.isPresent('ov-broadcasting-activity')).to.be.false; }); - - it('should SHOW STREAMING ERROR', async () => { - await browser.get(`${url}`); - - await utils.clickOn('#ovActivitiesPanel-checkbox'); - - await utils.clickOn('#broadcastingError-checkbox'); - - await utils.clickOn('#apply-btn'); - - await utils.checkToolbarIsPresent(); - - await utils.clickOn('#activities-panel-btn'); - - await browser.sleep(500); - - await utils.waitForElement('#custom-activities-panel'); - - const status = await utils.waitForElement('#broadcasting-status'); - - expect(await status.getAttribute('innerText')).equals('FAILED'); - - await utils.clickOn('#broadcasting-activity'); - await browser.sleep(500); - const error = await utils.waitForElement('#broadcasting-error'); - expect(await error.getAttribute('innerText')).equals('TEST_ERROR'); - }); }); diff --git a/openvidu-components-angular/e2e/nested-components/events.test.ts b/openvidu-components-angular/e2e/nested-components/events.test.ts index b4be7b71..1387300d 100644 --- a/openvidu-components-angular/e2e/nested-components/events.test.ts +++ b/openvidu-components-angular/e2e/nested-components/events.test.ts @@ -1,10 +1,10 @@ import { expect } from 'chai'; import { Builder, By, WebDriver } from 'selenium-webdriver'; -import { AngularConfig } from '../selenium.conf'; +import { NestedConfig } from '../selenium.conf'; import { OpenViduComponentsPO } from '../utils.po.test'; -const url = AngularConfig.appUrl; +const url = NestedConfig.appUrl; describe('Testing EVENTS', () => { let browser: WebDriver; @@ -12,10 +12,10 @@ describe('Testing EVENTS', () => { async function createChromeBrowser(): Promise { return await new Builder() - .forBrowser(AngularConfig.browserName) - .withCapabilities(AngularConfig.browserCapabilities) - .setChromeOptions(AngularConfig.browserOptions) - .usingServer(AngularConfig.seleniumAddress) + .forBrowser(NestedConfig.browserName) + .withCapabilities(NestedConfig.browserCapabilities) + .setChromeOptions(NestedConfig.browserOptions) + .usingServer(NestedConfig.seleniumAddress) .build(); } diff --git a/openvidu-components-angular/e2e/selenium.conf.ts b/openvidu-components-angular/e2e/selenium.conf.ts index 462da367..b86a871c 100644 --- a/openvidu-components-angular/e2e/selenium.conf.ts +++ b/openvidu-components-angular/e2e/selenium.conf.ts @@ -54,7 +54,7 @@ export const WebComponentConfig: BrowserConfig = { browserOptions: new chrome.Options().addArguments(...(LAUNCH_MODE === 'CI' ? chromeArgumentsCI : chromeArguments)) }; -export const AngularConfig: BrowserConfig = { +export const NestedConfig: BrowserConfig = { appUrl: 'http://localhost:4200/#/testing', seleniumAddress: LAUNCH_MODE === 'CI' ? 'http://localhost:3000/webdriver' : '', browserName: 'Chrome',