Skip to content

Commit

Permalink
ov-components: Remove old and unnecessary test and refactored code
Browse files Browse the repository at this point in the history
  • Loading branch information
CSantosM committed Jul 29, 2024
1 parent b2e50aa commit d52dc9b
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 52 deletions.
Original file line number Diff line number Diff line change
@@ -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<WebDriver> {
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();
}

Expand Down Expand Up @@ -147,10 +147,10 @@ describe('Testing PANEL STRUCTURAL DIRECTIVES', () => {

async function createChromeBrowser(): Promise<WebDriver> {
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();
}

Expand Down Expand Up @@ -669,10 +669,10 @@ describe('Testing LAYOUT STRUCTURAL DIRECTIVES', () => {

async function createChromeBrowser(): Promise<WebDriver> {
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();
}

Expand Down Expand Up @@ -767,10 +767,10 @@ describe('Testing ATTRIBUTE DIRECTIVES', () => {

async function createChromeBrowser(): Promise<WebDriver> {
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();
}

Expand Down Expand Up @@ -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');
});
});
12 changes: 6 additions & 6 deletions openvidu-components-angular/e2e/nested-components/events.test.ts
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
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;
let utils: OpenViduComponentsPO;

async function createChromeBrowser(): Promise<WebDriver> {
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();
}

Expand Down
2 changes: 1 addition & 1 deletion openvidu-components-angular/e2e/selenium.conf.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down

0 comments on commit d52dc9b

Please sign in to comment.