taxi-toolkit
taxi-toolkit copied to clipboard
adjusting webdriver-timeout
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?
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?
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
Sounds good :)
excellent, I will make a PR then