jonhoo / fantoccini

A high-level API for programmatically interacting with web pages through WebDriver.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

wait_* methods deprecated with no alternative

MolotovCherry opened this issue · comments

The wait_for* methods are deprecated, and offer client.wait().on(...) as a solution, but this on() function does not exist, making it impossible to achieve a custom wait condition without using deprecated code

(Of course, naturally, one could custom implement this, but it would be nice if it was part of the library again)

Edit: This message has come to my attention:

I actually ended up removing the generic interface, and stuck with just the concrete methods for Url and Locator. My thinking is that for those we may be able to provide smarter retries over time (e.g., using JavaScript event observers). The same isn't true for general-purpose asynchronous closures, so I'd rather not give users that impression. It's pretty easy to implement one's own loop (it's really just a loop with a tokio::time::sleep), so I'd rather keep that in the caller's code.

Could we update the deprecation notices on the functions? It gave me a false expectation/impression that this functionality was supposed to be here but is missing

Ah, yes, you're entirely right. The history here is that #134 landed the .wait().on() interface, and then in 8ac0f90 I got rid of the general-purpose variant because it gave the illusion that we'd be handling these calls in some kind of efficient way. Totally agree with you that the deprecation notices are wrong. Will update shortly!