Skip to content

jdenen/watir-ng

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

48 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

watir-ng

Gem Version Build Status

Identify watir-webdriver elements with AngularJS ng directives.

Usage

When identifying elements, use the ng directives like you would id, class, etc. Be sure to use underscores instead of dashes though!

As of version 2.1.0, this gem requires Ruby >= 2.0.

# To find and click this HTML element:
#     <button ng-click="foo">Submit</button>

submit_button = @browser.button(ng_click: "foo")
submit_button.click

To ensure your browser objects have access to the ng identifiers, run patch! before instantiating.

require 'watir-ng'

WatirNg.patch!

@browser = Watir::Browser.new

You can identify elements with custom directives by registering them before patching the browser.

require 'watir-ng'

WatirNg.register(:ng_foo, :ng_bar).patch!

@browser = Watir::Browser.new

Installation

Add this line to your application's Gemfile:

gem 'watir-ng'

And then execute:

$ bundle

Or install it yourself with:

$ gem install watir-ng

Contributing

  1. Fork it ( http://github.com/jdenen/watir-ng/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

Questions, Comments, Concerns

Find me on Twitter (@metaxjohnson), gitter (@jdenen), or write up an issue.