From 141136a3ef1aee04e8b822301487b2a5b11d2b43 Mon Sep 17 00:00:00 2001 From: Akira Koyasu Date: Sun, 4 Dec 2016 16:40:35 +0900 Subject: [PATCH] feat add seleniumServerStartTimeout --- lib/config.ts | 7 +++++++ lib/driverProviders/local.ts | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/config.ts b/lib/config.ts index 65811aa9a..37db785cc 100644 --- a/lib/config.ts +++ b/lib/config.ts @@ -28,6 +28,13 @@ export interface Config { */ seleniumServerJar?: string; + /** + * The timeout milliseconds waiting for a local standalone Selenium Server to start. + * + * default: 30000ms + */ + seleniumServerStartTimeout?: number; + /** * Can be an object which will be passed to the SeleniumServer class as args. * See a full list of options at diff --git a/lib/driverProviders/local.ts b/lib/driverProviders/local.ts index c3c389be7..740e759df 100644 --- a/lib/driverProviders/local.ts +++ b/lib/driverProviders/local.ts @@ -103,7 +103,7 @@ export class Local extends DriverProvider { this.server_ = new remote.SeleniumServer(this.config_.seleniumServerJar, serverConf); // start local server, grab hosted address, and resolve promise - this.server_.start().then((url: string) => { + this.server_.start(this.config_.seleniumServerStartTimeout).then((url: string) => { logger.info('Selenium standalone server started at ' + url); this.server_.address().then((address: string) => { this.config_.seleniumAddress = address;