0.0
No commit activity in last 3 years
No release in over 3 years
Page object maintenance made easier
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.3
~> 0.9.2
>= 0
>= 2.12.0
~> 3.1.1

Runtime

~> 1.6.0
 Project Readme

PageObjectPal

Gem Version

PageObjectPal keeps an eye on your page-object classes, alerting you to outdated element information. Unit test your page classes with PageObjectPal, and don't wait for your acceptance tests to fail!

Installation

Add this line to your application's Gemfile:

gem 'page-object-pal'

And then execute:

$ bundle

Or install it yourself as:

$ gem install page-object-pal

Usage

PageObjectPal is a self-extending module and needs only one method call. PageObjectPal#examine takes three arguments: a class, a filepath, and a URL. It returns true if your page objects pass, and raises a PageObjectInvalid error if they fail.

Call PageObjectPal#examine from your specs:

require 'page-object-pal'
describe Page do
  it "should reference valid elements in its methods" do
    PageObjectPal.examine(Page, '/path/to/Page', 'http://www.page.com').should be_true
  end
end

Or wrap PageObjectPal#examine in a class method to be called in your specs:

require 'page-object'
require 'page-object-pal'
class Page
  include 'PageObject'
  def self.examine
    PageObjectPal.examine(self, __FILE__, 'http://www.page.com')
  end
end

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Write tests for your feature
  4. Code until your tests pass (rake)
  5. Commit your changes (git commit -am 'Add some feature')
  6. Push to the branch (git push origin my-new-feature)
  7. Create new Pull Request

Testing

I'm partial to the rspec-given syntax and use it in my unit tests. Please do the same. If you're unfamiliar with rspec-given, you should check it out!

Issues/Comments/Questions?

Write something up in the Issues Tracker. Or contact me via twitter, @jpdenen!