marekj / watirloo

Watir Helper as Page Objects

This URL has Read+Write access

name age message
file .gitignore Tue Dec 29 15:52:23 -0800 2009 ignore the irb history generated by console [marekj]
file History.txt Mon Oct 19 16:13:37 -0700 2009 remove locker.yml refs and bump gem version [marekj]
file Manifest.txt Mon Oct 19 16:13:37 -0700 2009 remove locker.yml refs and bump gem version [marekj]
file README.rdoc Thu Dec 24 08:55:08 -0800 2009 newgem no longer needed [marekj]
file Rakefile Wed Dec 30 22:07:31 -0800 2009 run spec with rcov [marekj]
file VERSION Wed Dec 30 14:59:30 -0800 2009 Version bump to 0.0.8 [marekj]
file _irbrc Tue Dec 29 15:51:49 -0800 2009 set custome irb loading current lib/watirloo in... [marekj]
directory lib/ Wed Dec 30 10:03:58 -0800 2009 drive greenshot screencapture with keyboard sends [marekj]
directory spec/ Tue Dec 29 19:04:24 -0800 2009 new results from ie and ff [marekj]
file watirloo.gemspec Wed Dec 30 15:01:30 -0800 2009 ready for 0.0.8 [marekj]
README.rdoc

Watirloo

DESCRIPTION:

Custom Extensions for Watir, Firewatir. Acceptance Test Helper based on semantic page objects modeling customer’s domain language It helps you write human readable and machine executable browser tests. Isolates GUI from Tests.

The Human Readable part helps you create interfaces to elements on the page and tags them with friendly names based on vocabulary of Business Domain. The Machine Executable parts talk to Watir API hooking into DOM elements. it helps you concentrate in your acceptance tests on the intention and the customer’s language and not on implementation of DOM. Write customer facing tests hence the metaphor of face for Page Objects of Significance to the Customer.

FEATURES/PROBLEMS:

  • Extensions to Watir and Firewatir gems to ease testing and joy with page objects
  • group radios in #radio_group and checkboxes in #checkbox_group and acts each group as page object
  • Maintains multiple browsers on the desktop and stores window handles so you can reattach to the browser under test later (see Watirloo::Locker)
  • Watches and maintains your desktop for browsers existence. (Watirloo::Desktop)
  • Browser is managed automatically with Watirloo::browser
  • Isolates GUI from tests with face methods that introduce customer facing friendly names for elements
  • add reflect method to generate scaffolding code for your page elements (reflect currently uses browser as container. Alter scaffodling if you use frames)
  • look at spec dir for examples of usage with rspec

SYNOPSIS:

By convention Watirloo::browser attaches itself to the existing IE browser instance on the desktop and maintains the handles to reattach later

Example:

    Given a page with text fields for last name and first name
    When I want to enter the name 'Kurt Vonnegut'
    And I don't want to talk to implementation
    But I want a friendly name of element on the page
    Then I use Watirloo shortcuts
    When I define an interface to watir implementation with a semantic key
    And I define my data as hash with the same semantic key
    Then I can automatically let watirloo enter my test data on a page

    # rspec as client

    describe "using watirloo page to isolate and bind gui view to data" do
      include Watirloo::Page
      face(:last_name) { text_field(:name, 'l_nm') }
      face(:first_name) { text_field(:name, 'f_nm') }

      it "enters data on the page" do
        first_name.set "Kurt"
        last_name.set "Vonnegut"
      end

      it "sprays data on elements defined" do
        spray :last_name => 'Vonnegut', :first_name => 'Kurt'
      end

      it "grabs data from elements and validates" do
        data = {:first_name => "Kurt", :last_name => 'Vonnegut'}
        spray data
        scrape(data.keys).should == data
      end

    end

REQUIREMENTS:

  • watir = 1.6.2
  • firewatir = 1.6.2 if you want to use Firefox
  • rspec gem if you want to run watirloo examples included

INSTALL:

  • Run the following if you haven’t already:
      gem sources -a http://gems.github.com
    
  • Install the gem(s): gem install marekj-watirloo
  • or download from : github.com/marekj/watirloo/downloads

ROADMAP

  • add Logging gem and log all actions for audit
  • provide UserStory type of container for exploratory testing (UseCase, Feature, TestScenario etc…)
  • provide examples for Cucumber
  • make specs run with firewatir

LICENSE

(The MIT License)

Copyright © 2008 marekj www.opensource.org/licenses/mit-license.php