From 282d1a32abd9a65869f177037c994b3fbc154699 Mon Sep 17 00:00:00 2001 From: jcernea Date: Thu, 8 Jul 2021 10:59:40 +0100 Subject: [PATCH] W3c option, up-to-date timeout values --- lib/application.js | 17 ++++++++++------- lib/spectron.d.ts | 4 ++++ 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/lib/application.js b/lib/application.js index 912267100..95a18bf62 100644 --- a/lib/application.js +++ b/lib/application.js @@ -31,6 +31,7 @@ function Application(options) { this.webdriverLogPath = options.webdriverLogPath; this.webdriverOptions = options.webdriverOptions || {}; this.requireName = options.requireName || 'require'; + this.w3c = options.w3c; this.api = new Api(this, this.requireName); this.setupPromiseness(); @@ -57,11 +58,11 @@ Application.prototype.start = function () { return self.api.initialize(); }) .then(function () { - return self.client.setTimeouts( - self.waitTimeout, - self.waitTimeout, - self.waitTimeout - ); + return self.client.setTimeout({ + "implicit": self.waitTimeout, + "page load": self.waitTimeout, + "script": self.waitTimeout + }); }) .then(function () { self.running = true; @@ -130,7 +131,8 @@ Application.prototype.getSettings = function () { chromeDriverLogPath: this.chromeDriverLogPath, webdriverLogPath: this.webdriverLogPath, webdriverOptions: this.webdriverOptions, - requireName: this.requireName + requireName: this.requireName, + w3c: this.w3c }; }; @@ -205,7 +207,8 @@ Application.prototype.createClient = function () { binary: launcherPath, args: args, debuggerAddress: self.debuggerAddress, - windowTypes: ['app', 'webview'] + windowTypes: ['app', 'webview'], + w3c: self.w3c } }, logOutput: DevNull() diff --git a/lib/spectron.d.ts b/lib/spectron.d.ts index 2fbeed8a2..a97c63585 100644 --- a/lib/spectron.d.ts +++ b/lib/spectron.d.ts @@ -224,6 +224,10 @@ declare module 'spectron' { * and assigns it to another property name on window. */ requireName?: string; + /** + * W3C Compliance - Chrome Options + */ + w3c?: boolean; }; type AppConstructorOptions = BasicAppSettings & { /**