Project

watir-ng

0.01
No commit activity in last 3 years
No release in over 3 years
Use AngularJS ng directives as element identifiers with watir-webdriver
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 2.0
~> 10.0
~> 3.2

Runtime

~> 6.0
 Project Readme

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.