protractor-uisref-locator

1.2.0 • Public • Published

protractor-uisref-locator

Adds a locator to a protractor instance that finds elements by their ui-sref attribute.

Installation

$ npm install protractor-uisref-locator

Usage

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

The locator will be available in your specs as by.uiSref(toState).

toState is a String that represents a ui-router state.

Examples

element(by.uiSref('users.show({id: 42})'));
 
element.all(by.uiSref('users.index')).then(function (elems) {
  // elems contains all the elements found that match the given ui-sref.
});
 
// Get elements that match the given ui-sref and that are within the element with id='users'.
element(by.css('#users')).element(by.uiSref('users.index'))

Tests

Run each command on a separate terminal window.

$ npm run start

$ npm run webdriver

$ npm run test

Package Sidebar

Install

npm i protractor-uisref-locator

Weekly Downloads

595

Version

1.2.0

License

MPL 2.0

Last publish

Collaborators

  • crzrcn