Cucumber/Capybara: tests fail randomly under PhantomJS
问题 When I run cucumber scenarios under PhantomJS I get Capybara::ElementNotFound: Unable to find css ".given_class" exceptions in random places it looks like driver does not wait for element appearance I'm using: Ruby 2.0 Cucumber 1.3.6 Capybara 2.1.0 Selenium-webdriver 2.35.1 PhantomJS 1.9.1 回答1: Capybara, particularly with PhantomJS will load a page really quickly, and perform checks for elements. As such, some elements may not have loaded and tests fail. By default capybara has a wait time of