Filling out text, select, radio & check fields with capybara and cucumber

by Anton Zolotov · 0 comments

Using capybara’s standard web steps.rb often times isn’t very dry. For a scenario where a user completes a lengthy form, with text & select fields as well as radio and check buttons, I refactored the code, leading to a much cleaner scenario:

Before:

After:

And here’s the step definition:

Share
  • Print
  • Digg
  • del.icio.us
  • Facebook
  • email
  • HackerNews
  • StumbleUpon

Leave a Comment

Previous post:

Next post: