0.01
No commit activity in last 3 years
No release in over 3 years
See https://github.com/mojotech/cucumber-salad/README.md
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

Runtime

 Project Readme

Capybara-UI

Code Climate Test Coverage

Docs here. Check out the wiki for more ideas and tips.

Overview

Capybara-UI (formerly called Dill) is a Capybara abstraction that makes it easy to define reuseable DOM "widgets", aka page objects, and introduces the concept of "roles" to allow you to easily organize your testing methods and widgets. Capybara-UI also introduces some helpers and syntactic sugar to make your testing even easier.

Before Capybara-UI

feature 'Admin new user page' 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 Capybara-UI

feature 'Admin new user page' 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 Capybara-UI, read the Capybara-UI walkthrough. You can also get more ideas and tips from the wiki.

Install

Add the following line to your gemfile

gem 'capybara-ui'

If using with Cucumber, add the following to your support/env.rb.

require 'capybara/ui/cucumber'

If you are using with RSpec, add the following to your spec_helper.rb or support/env.rb file.

require 'capybara/ui/rspec'

Contributing

We welcome pull requests. Please make sure tests accompany any PRs.


Curated by the good people at MojoTech.

(psst, we're hiring)