Skip to content

Instantly share code, notes, and snippets.

View raul-gracia's full-sized avatar
👨‍💻
Coding....

Raul Gracia raul-gracia

👨‍💻
Coding....
View GitHub Profile

PageObject + SimpleDelegator = Awesome Capybara Helpers

I've always liked using the Page Object pattern to write concise, namespaced, and composeable capybara helpers:

When /^I register as a new user$/ do
  NewUserPage.new(self).tap do |page|
    page.visit!
    page.form.fill

page.form.submit!