-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
[RackTest] Page refresh does not update HTML in a within
block
#2157
Comments
Thanks for reporting this. As you stated the provided path is not a good fix because it would affect all drivers and there are plenty of valid situations where |
@spaghetticode Please try the |
@twalpole thank you for the fast feedback, I can confirm the branch works fine 👍🎉 |
Closed via PR #2159 |
Meta
Capybara Version:
3.13.2
Driver Information (and browser if relevant):
it's relevant, as the issue happens only with
rack_test
. With a JS capable driver (I actually tried only Chrome) the issue is not present.Expected Behavior
Spec should pass
Actual Behavior
Spec fails
Steps to reproduce
While working on this PR I encountered what I think is a rather rare situation where inside a
within
blockrack_test
fails to find a CSS selector that becomes present after clicking an element inside thewithin
HTML .What happens is that the node is stale and does not include the changes from the page refresh. This is the actual commit that explains and fixes the spec.
I haven't spent much time in investigating if this can be solved in other ways than splitting the
within
block in the spec, but I was able to fix the issue and keep the singlewithin
block by injecting this code in Capybara:I'm not confident this is a good fix, as it changes the behavior of
Capybara::Node::Base
, which I think is used by other drivers too, but I hope it can be useful in pointing someone to the right solution.The text was updated successfully, but these errors were encountered: