Movee api test timeout into CLI args

This commit is contained in:
Daniel Imms
2020-02-15 04:29:04 -08:00
parent 93026bcae0
commit f3eb9f79a1
8 changed files with 6 additions and 30 deletions
@@ -16,7 +16,6 @@ const height = 600;
describe('AttachAddon', () => {
before(async function(): Promise<any> {
this.timeout(20000);
browser = await getBrowserType().launch({
headless: process.argv.indexOf('--headless') !== -1,
args: [`--window-size=${width},${height}`, `--no-sandbox`]
@@ -29,13 +28,9 @@ describe('AttachAddon', () => {
await browser.close();
});
beforeEach(async function(): Promise<any> {
this.timeout(20000);
await page.goto(APP);
});
beforeEach(async () => await page.goto(APP));
it('string', async function(): Promise<any> {
this.timeout(20000);
await openTerminal(page, { rendererType: 'dom' });
const port = 8080;
const server = new WebSocket.Server({ port });
@@ -46,7 +41,6 @@ describe('AttachAddon', () => {
});
it('utf8', async function(): Promise<any> {
this.timeout(20000);
await openTerminal(page, { rendererType: 'dom' });
const port = 8080;
const server = new WebSocket.Server({ port });
@@ -18,7 +18,6 @@ let isFirefox = false;
describe('FitAddon', () => {
before(async function(): Promise<any> {
this.timeout(20000);
browser = await getBrowserType().launch({
headless: process.argv.indexOf('--headless') !== -1,
args: [`--window-size=${width},${height}`, `--no-sandbox`]
@@ -17,8 +17,6 @@ const width = 800;
const height = 600;
describe('Search Tests', function(): void {
this.timeout(20000);
before(async function(): Promise<any> {
browser = await getBrowserType().launch({
headless: process.argv.indexOf('--headless') !== -1,
@@ -16,7 +16,6 @@ const height = 600;
describe('SerializeAddon', () => {
before(async function(): Promise<any> {
this.timeout(20000);
browser = await getBrowserType().launch({
headless: process.argv.indexOf('--headless') !== -1,
args: [`--window-size=${width},${height}`]
@@ -16,7 +16,6 @@ const height = 600;
describe('Unicode11Addon', () => {
before(async function(): Promise<any> {
this.timeout(20000);
browser = await getBrowserType().launch({
headless: process.argv.indexOf('--headless') !== -1,
args: [`--window-size=${width},${height}`, `--no-sandbox`]
@@ -30,7 +29,6 @@ describe('Unicode11Addon', () => {
});
beforeEach(async function(): Promise<any> {
this.timeout(20000);
await page.goto(APP);
await openTerminal(page);
});
@@ -16,7 +16,6 @@ const height = 600;
describe('WebLinksAddon', () => {
before(async function(): Promise<any> {
this.timeout(10000);
browser = await getBrowserType().launch({
headless: process.argv.indexOf('--headless') !== -1,
args: [`--window-size=${width},${height}`, `--no-sandbox`]
@@ -25,27 +24,18 @@ describe('WebLinksAddon', () => {
await page.setViewport({ width, height });
});
after(async () => {
await browser.close();
});
beforeEach(async function(): Promise<any> {
this.timeout(5000);
await page.goto(APP);
});
after(async () => await browser.close());
beforeEach(async () => await page.goto(APP));
it('.com', async function(): Promise<any> {
this.timeout(20000);
await testHostName('foo.com');
});
it('.com.au', async function(): Promise<any> {
this.timeout(20000);
await testHostName('foo.com.au');
});
it('.io', async function(): Promise<any> {
this.timeout(20000);
await testHostName('foo.io');
});
});
@@ -17,8 +17,6 @@ const width = 800;
const height = 600;
describe('WebGL Renderer Integration Tests', function(): void {
this.timeout(20000);
const browserType = getBrowserType();
const isHeadless = process.argv.indexOf('--headless') !== -1;
const areTestsEnabled = browserType.name() === 'chromium' || (browserType.name() === 'firefox' && !isHeadless);
+3 -3
View File
@@ -15,9 +15,9 @@
"test": "npm run test-unit",
"posttest": "npm run lint",
"test-api": "npm run test-api-chromium",
"test-api-chromium": "mocha \"**/*.api.js\" --browser chromium",
"test-api-firefox": "mocha \"**/*.api.js\" --browser firefox",
"test-api-webkit": "mocha \"**/*.api.js\" --browser webkit",
"test-api-chromium": "mocha \"**/*.api.js\" --browser chromium --timeout 10000",
"test-api-firefox": "mocha \"**/*.api.js\" --browser firefox --timeout 10000",
"test-api-webkit": "mocha \"**/*.api.js\" --browser webkit --timeout 10000",
"test-unit": "node ./bin/test.js",
"test-unit-coverage": "node ./bin/test.js --coverage",
"build": "tsc -b ./tsconfig.all.json",