openvidu-components: Parametrized selenium server url in E2E tests

pull/707/head
csantosm 2022-03-17 10:41:48 +01:00
parent 55d9abe2b8
commit f6d014bef6
4 changed files with 701 additions and 12 deletions

View File

@ -0,0 +1 @@
export const SELENIUM_SERVER_URL = process.env.SELENIUM_SERVER_URL || '';

File diff suppressed because it is too large Load Diff

View File

@ -4,8 +4,9 @@
"description": "E2E webcomponent test",
"main": "test.ts",
"scripts": {
"serve": "http-server web/",
"test": "tsc && mocha --recursive --timeout 30000 ./dist/test.js"
"serve": "npx http-server web/",
"test": "tsc && mocha --recursive --timeout 30000 ./dist/test.js",
"test-ci": "cross-env SELENIUM_SERVER_URL=http://localhost:4444/wd/hub npm run test"
},
"author": "Carlos Santos Morales",
"license": "Apache-2.0",
@ -17,6 +18,8 @@
"@types/chai": "4.3.0",
"@types/mocha": "9.1.0",
"chai": "4.3.6",
"cross-env": "^7.0.3",
"http-server": "14.1.0",
"mocha": "9.2.2"
}
}

View File

@ -1,8 +1,9 @@
import { Builder, By, Capabilities, until, WebDriver, logging } from 'selenium-webdriver';
import * as chrome from 'selenium-webdriver/chrome';
import { expect } from 'chai';
import { SELENIUM_SERVER_URL } from './config';
const url = 'http://127.0.0.1:8080/';
const url = 'http://localhost:8080/';
const FIVE_SECONDS = 5000;
const ONE_SECONDS = 5000;
@ -25,7 +26,13 @@ describe('Checkout localhost app', () => {
// firefoxCapabilities.setAcceptInsecureCerts(true);
async function createChromeBrowser(name: string): Promise<WebDriver> {
return await new Builder().forBrowser(name).withCapabilities(chromeCapabilities).setChromeOptions(chromeOptions).build();
return await new Builder()
.forBrowser(name)
.withCapabilities(chromeCapabilities)
.setChromeOptions(chromeOptions)
.usingServer(SELENIUM_SERVER_URL)
.build();
}
// async function createFirefoxBrowser() {