Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/3zcurdia/capybara-pagemap
Simple object mapper for page objects with capybara
https://github.com/3zcurdia/capybara-pagemap
capybara gem pageobject pageobject-pattern ruby
Last synced: about 1 month ago
JSON representation
Simple object mapper for page objects with capybara
- Host: GitHub
- URL: https://github.com/3zcurdia/capybara-pagemap
- Owner: 3zcurdia
- License: mit
- Created: 2016-07-01T21:00:42.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2020-03-23T18:15:17.000Z (almost 5 years ago)
- Last Synced: 2024-10-31T13:15:38.625Z (2 months ago)
- Topics: capybara, gem, pageobject, pageobject-pattern, ruby
- Language: Ruby
- Homepage:
- Size: 49.8 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: changelog.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# Capybara Pagemap
[![Build Status](https://travis-ci.org/3zcurdia/capybara-pagemap.svg?branch=master)](https://travis-ci.org/3zcurdia/capybara-pagemap)
[![Maintainability](https://api.codeclimate.com/v1/badges/19084f69bfee063ec218/maintainability)](https://codeclimate.com/github/3zcurdia/capybara-pagemap/maintainability)
[![Test Coverage](https://api.codeclimate.com/v1/badges/19084f69bfee063ec218/test_coverage)](https://codeclimate.com/github/3zcurdia/capybara-pagemap/test_coverage)
[![Gem Version](https://badge.fury.io/rb/capybara-pagemap.svg)](https://badge.fury.io/rb/capybara-pagemap)Simple object mapper for page objects with capybara
## Installation
Add this line to your application's Gemfile:
```ruby
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
```ruby
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```ruby
login_page = LoginPage.new
login_page.email = "[email protected]"
login_page.email
# => "[email protected]"
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.