New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The Node method synchronize is not exposed in the Session #806
Comments
Technically yes. It's a deliberate decision not to expose |
Thank you for the clarification.. |
How can you decide not to expose this incredibly useful function based on a possible error which some people might make? Would you consider exposing it if I made a pull request? |
I'm open to a discussion certainly. I've seen so many people misuse wait_until though, and write silly stuff like wait_until { page.body.match /<h2>Foobar</h2>/ } I guess some people will always simply not RTFM and I shouldn't be bothered about that. So maybe I'm wrong, I just have a feeling that it's too hard to understand what the hell |
Hi jnicklas, Not that I'm any kind of expert in the semantics of wait_until and synchronize, but I'd say that (1) It's useful and (2) They're buried deep within the documentation/code, so you'd have to RTFM to even find them! |
Hi @jnicklas, A philosophical point: So I understand your arguments for why you want to hide A practical question: With #using capybara 1.x, wait for 30 seconds for something to appear in the DOM
Capybara.default_wait_time = 5
Capybara.using_wait_time 30 do
wait_until { has_selector? "div.title" }
end If I understand capybara 2.x's code right, shouldn't the following be what I want? #using capybara 2.x, is this how I'd wait for 30 seconds for something to appear in the DOM?
Capybara.default_wait_time = 5
Capybara.using_wait_time 30 do
has_selector? "div.title"
end Ie: just get rid of Regards, Nat Ritmeyer |
@natritmeyer: you're spot on in your second example. The wait_until call there was redundant even under Capybara 1.x. It would have worked just as well without it. It's not so much that you can't manually wait. It's trivial to implement wait_until yourself: https://gist.github.com/d8da686061f0a59ffdf7, but I would consider it a last resort. |
The
wait_until
method in theSession
is now removed and thewait_until
method for theNode
is renamed tosynchronize
According to this
https://github.com/jnicklas/capybara/blob/master/lib/capybara/node/base.rb#L15
synchronize
should be exposed inSession
But I could not find it. Is there any other way to access this method?
The text was updated successfully, but these errors were encountered: