taxi-toolkit icon indicating copy to clipboard operation
taxi-toolkit copied to clipboard

adjusting webdriver-timeout

Open tlipski opened this issue 9 years ago • 4 comments

Right now the webdriver-timeout is bound to a symbol in a namespace and set to (* 15 1000). There are some cases, where the wait time should be longer (e.g. waiting for response from an external service).

One suggestion is to use (atom) just like with ui-maps to follow the convention.

Another is to use :^dynamic variable (I know, evil, but we're using atoms bound to symbols anyway). It has an advantage of self-cleanup when we need to adjust the timeout just for one operation.

What do you think?

tlipski avatar Oct 27 '15 13:10 tlipski

Atom sounds fine I suppose. We could also create some helper fn/macro that would make it easier to temporarily change the timeout value, something like:

(with-timeout
  60000
  (wait-for ...)
  ...)

Or a bit more unorthodox:

(with-timeout
  :60-sec
  (wait-for ...)
  ...)

Where we would accept keywords or strings like :60-sec, :2-min etc. Would that read better?

kamituel avatar Oct 27 '15 15:10 kamituel

yes, macro+function taking function as arg would be good too. I would refrain from :60-sec stuff, but rather rename the function to indicate the unit - e.g. with-webdriver-timeout-ms

tlipski avatar Oct 27 '15 15:10 tlipski

Sounds good :)

kamituel avatar Oct 27 '15 15:10 kamituel

excellent, I will make a PR then

tlipski avatar Oct 27 '15 15:10 tlipski