CapybaraUI

Travis Build Status Code Climate Test Coverage

Docs here. Check out the wiki for more tips.

Overview

CapybaraUI (formerly called Dill)is a Capybara abstraction that helps to bring your testing language closer to your business language.

Before CapybaraUI

describe 'Admin' do
  it 'should be able to create a new user' do
    visit('/users/new')

    within(:css, "#new_user") do
      fill_in('Name', :with => 'Example Name')
      fill_in('Password', :with => 'Password')
      select('Blue', :from => 'Favorite Color')
      click_button('Submit')
    end

    within(:css, '.alert-success') do
      expect(page).to have_content('Example Name')
    end
  end
end

After CapybaraUI

describe 'Admin' do
  let(:role) { roles.admin }

  it 'should be able to create a new user' do
    role.navigate_to_new_user
    role.create_user(name: 'Example Name', password: 'Password', color: 'Blue')

    expect(role).to see :successfully_created_user, 'Example Name'
  end
end

For a more in depth tour of CapybaraUI, read the CapybaraUI walkthrough.

Documentation

Learn all about how to use CapybaraUI in the official documentation or get real-world ideas and tips from the wiki.

Install

Add the following line to your gemfile

gem 'capybara-ui'

Contributing

We welcome pull requests. Please make sure tests accompany any PRs. Email Adam at ags@mojotech.com if you have questions.


Curated by the good people at MojoTech.

(psst, we're hiring)