spectron icon indicating copy to clipboard operation
spectron copied to clipboard

Spectron makes ill-advised use of webdriverio's `implicit` timeouts

Open starpit opened this issue 5 years ago • 0 comments

Spectron, when initializing the Application, calls to webdriverio's client.setTimeouts. In doing so, it sets the "implicit" timeout to the value of waitTimeout. https://github.com/electron-userland/spectron/blob/master/lib/application.js#L61

I have talked with the webdriverio team, and their response was:

Yes, this is very bad. The implicit timeout should be set to 0 so that WebdriverIO can handle it using explicit waiting strategies. Ideally these values should be configurable by the user.

ref: https://github.com/webdriverio/webdriverio/issues/6092

This referenced issue describes the bad consequences of using an implicit timeout. Prior to webdriverio v5, it was advisable to use an implicit timeout; this is no longer the case with v5 and higher. Since Spectron now uses v6, their suggestion is for Spectron to update its call to client.setTimeouts.

My suggestion: allow users of spectron to provide an implicit timeout value.

There is a workaround for this, in that users of spectron can always call the app.client.setTimeout(...) API.

So you may deem this non-critical, but I thought it would be useful to advise the Spectron community as to the danger of using a non-zero value for implicit timeout, now that Spectron is using webdriverio v6.

starpit avatar Nov 11 '20 17:11 starpit