No commit activity in last 3 years
No release in over 3 years
Simple object mapper for page objects with capybara
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.11
~> 5.0
~> 0.10.3
~> 10.0
>= 0.13

Runtime

>= 2.2.0
 Project Readme

Capybara Pagemap

Build Status Maintainability Test Coverage Gem Version

Simple object mapper for page objects with capybara

Installation

Add this line to your application's Gemfile:

gem 'capybara-pagemap'

And then execute:

$ bundle

Or install it yourself as:

$ gem install capybara-pagemap

Usage

Inherit from Capybara::Pagemap::Base and define the input fields as the following example

class LoginPage
  include Capybara::Pagemap
  define_input :email, '//*[@id="user_email"]'
  define_input :password, '//*[@id="user_password"]'
  define_button :log_in, '//*[@id="log_in"]'
end

Once you have define your input you will have access to the getters setters

login_page = LoginPage.new
login_page.email = "test@example.org"
login_page.email
# => "test@example.org"
login_page.email_input
# => Capybara::Node
login_page.log_in_button.click if login_page.valid?

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/3zcurdia/capybara-pagemap.