Skip to content


Subversion checkout URL

You can clone with
Download ZIP
capybara building blocks for acceptance tests.
Branch: master

Merge pull request #38 from jone/master

raise OptionNotFound when filling a select with a text for which there is no option.
latest commit 3cd048296c
@senny authored
Failed to load latest commit information.
lib raise OptionNotFound when filling a select with a text for which ther…
spec raise OptionNotFound when filling a select with a text for which ther…
tasks initial corner_stones import
.travis.yml add contribution guidelines
Gemfile `Table#values` returns an Array of values for a given column.

Corner Stones

Build Status Code Climate

assists you in building PageObjects to make your acceptance tests more object oriented.


$ gem install corner_stones

or in your Gemfile

gem 'corner_stones'


a lot of examples can be found in the integration specs. Some features of corner_stones are listed below.


tabs ='.tab-navigation')'Details') # open a tab
tabs ='.tab-navigation')
tabs.extend(CornerStones::Tabs::ActiveTracking)'About') # open a tab and verify that the opened tab is active
tabs.assert_current_tab_is('Main') # verify that the tab 'Main' is active

Flash Messages

flash =
flash.assert_flash_is_present(:notice, 'Article saved') # verify that a given flash message is present


table ='.articles')
table.rows # returns an array of rows. Each row is represented as a row object.
table.row('Title' => 'Management') # returns the row object for the row with 'Management' in the 'Title' column

A row object has two primary methods: #node is a reference to the capybara node of the row and #attributes is a hash with the following structure: ({Table Header} => {Cell Value})

The following extensions are available for the Table:

table ='.articles')

table.row('Created at' => '01.12.2001').select # select the row, which has '01.12.2001' in the 'Created at' column
table.row('ID' => '9').delete # delete the row, which contains '9' in the 'ID' column
table.values("ID") # => ["1", "7", "9"]


form ='.new-article')
form.fill_in_with('Title' => 'Some Article', 'Author' => 'C. J.') # fill out the form
form.submit # submit the form using the 'Save' button
form.submit(:button => 'Save Article') # submit the form using the 'Save Article' button

form.process(:fill_in => {'Title' => 'Some Article', 'Author' => 'C. J.'},
             :button => 'Save Article') # fill out + submit
form ='.update-article')

form.errors # returns an Array of form errors
form.assert_has_no_errors # verify that the form was submitted correctly
form.submit # verifies that the form has no errors
form.submit(:assert_valid => false) # do not veirfy that no errors were present


If you want to help out, please start by reading the contribution guidelines. alpha

Something went wrong with that request. Please try again.