Adds a locators to a protractor instance that find Ionic specific elements, such as collection-repeat
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
tests
.gitignore
.travis.yml
CHANGELOG.md
LICENSE.md
README.md
index.js
package.json
protractor.conf.js

README.md

protractor-ionic-locator

Adds a locators to a protractor instance that find Ionic specific elements, such as collection-repeat.

Build Status

Installation

$ npm install protractor-ionic-locator

Usage

onPrepare: function () {
  // Your other stuff.
  require('protractor-ionic-locator')(protractor);
}

The following locators will be availble in your specs;

by.collRepeater

Find elements inside an ng-repeat.

Example

View

<div collection-repeat="cat in pets">
  <span>{{cat.name}}</span>
  <span>{{cat.age}}</span>
</div>

Code

// Returns a promise that resolves to an array of WebElements containing
// all top level elements repeated by the Ionic collection-repeat repeater. 
// For 2 pets rows resolves to an array of 2 elements.
var rows = element.all(by.collRepeater('cat in pets'));

Params

Param Type
repeatDescriptor string

Testing

If you want to contribute to the package please write tests... these commands run the tests.

$ npm run webdriver

$ npm run test

Credit

Base code for adding locators to Protractor was taken from Fernando Martinez's great protractor-uisref-locator package... thanks man!