https://github.com/jdenen/watir-ng
Identify watir-webdriver elements with ng directives
https://github.com/jdenen/watir-ng
angular ruby testing watir webdriver
Last synced: 9 months ago
JSON representation
Identify watir-webdriver elements with ng directives
- Host: GitHub
- URL: https://github.com/jdenen/watir-ng
- Owner: jdenen
- License: mit
- Created: 2015-04-18T03:57:21.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2017-08-31T17:42:24.000Z (almost 9 years ago)
- Last Synced: 2025-08-01T11:57:45.209Z (11 months ago)
- Topics: angular, ruby, testing, watir, webdriver
- Language: Ruby
- Size: 30.3 KB
- Stars: 5
- Watchers: 2
- Forks: 6
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# watir-ng
[](http://badge.fury.io/rb/watir-ng)
[](https://travis-ci.org/jdenen/watir-ng)
Identify [watir-webdriver](http://github.com/watir/watir-webdriver) elements with AngularJS [ng](https://docs.angularjs.org/api/ng/directive) 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.
```ruby
# To find and click this HTML element:
# Submit
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.
```ruby
require 'watir-ng'
WatirNg.patch!
@browser = Watir::Browser.new
```
You can identify elements with custom directives by registering them before patching the browser.
```ruby
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](http://twitter.com/metaxjohnson)), gitter ([@jdenen](http://gitter.im/jdenen)), or write up an [issue](https://github.com/jdenen/watir-ng/issues/new).