I have recently attempted to use:
Then(/^I should see "(.*?)"$/) do |arg1|
page.should have_content(arg1)
end
To query the page and see if a text exists on the page.
This worked fine with the default Capybara driver, but after setting the javascript driver to capybara-webkit and running the tests again I get:
undefined method `find_xpath' for #<Capybara::Webkit::Driver:0x007fa3f00152e8> (NoMethodError)
./features/step_definitions/customer_steps.rb:12:in `/^I should see "(.*?)"$/'
features/manage_customers.feature:10:in `Then I should see "ABC XYZ"'
I am using the javascript driver since I am also using AngularJS to populate my data.
My questions:
- Are have_content() and page.has_content?() not implemented in capybara-webkit?
- What could be the source of the problem?