Conformity

Created mainly for use with the contact-congress project. Uses capybara with the addition of a Form class and a #field method that lets you fill out a form with different inputs each time.

Installation

Add this line to your application's Gemfile:

gem 'conformity'

And then execute:

$ bundle

Or install it yourself as:

$ gem install conformity

Usage

include Conformity

form = Form.new('http://www.google.com/') do
  visit '/'
  fill_in 'q', with: field(:query)
  click_on 'Google Search'
end

form.field_names
# => [:query]

# returns Capybara::Session on success and raises FillError on failure
form.fill_with('ruby')
form.fill_with('rails')
form.fill_with('news')

Contributing

  1. Fork it ( http://github.com//conformity/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request