Skip to content

Identify watir-webdriver elements with ng directives

License

Notifications You must be signed in to change notification settings

aaron-zipnosis/watir-ng

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

41 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!

# 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 (@jpdenen), gitter (@jdenen) or write up an issue.

About

Identify watir-webdriver elements with ng directives

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Ruby 88.4%
  • Gherkin 8.7%
  • HTML 2.9%