Closed reidcooper closed 7 years ago
Where are you pausing the test that changes the result? If it's right after the find
line - then it's probably because the action click
triggers hasn't completed before you're evaluating the script. You either need to check for some visible change that occurs on the page before running your evaluate_script or better yet, just use the Capybara rspec matchers provided, instead of using evaluate_script, since they will wait/retry until the condition becomes true
expect(page).to have_css('div.mfp-container.mfp-image-holder', count: 1)
Capybara Poltergeist
I am trying to process a jQuery script within an iFrame to locate an element, or count it. However, the script results 0. When I pause the rspec test, it results in 1, as well as in development.
capybara 2.7.1 poltergeist (1.10.0) phantomjs: stable 2.1.1