Posted about 9 years ago. Visible to the public.

Reload the page in your Cucumber features

Both these approaches will keep your GET parameters – and will only work for GET requests.

  • Capybara:

    When /^I reload the page$/ do visit [ current_path, page.driver.request.env['QUERY_STRING'] ].reject(&:blank?).join('?') end
  • Webrat:

    When /^I reload the page$/ do visit url_for(request.params) end

For a step that distinguishes between drivers (Selenium, Rack::Test, Culerity), check

By refactoring problematic code and creating automated tests, makandra can vastly improve the maintainability of your Rails application.

Owner of this card:

Arne Hartherz
Last edit:
over 6 years ago
step, definition, trigger
About this deck:
We are makandra and do test-driven, agile Ruby on Rails software development.
License for source code
Posted by Arne Hartherz to makandra dev
This website uses cookies to improve usability and analyze traffic.
Accept or learn more