protractor-linkuisref-locator
Adds a locator to a protractor instance that finds anchor
elements by their ui-sref
attribute.
Need a general (not just anchors) ui-sref
locator? See protractor-uisref-locator.
Installation
$ npm install protractor-linkuisref-locator
Usage
{ // Your other stuff. protractor;}
The locator will be available in your specs as by.linkUiSref(toState, [parentElement])
.
toState
is a String
that represents a ui-router state. Also supports data-
prefix.
parentElement
represents an HTML element
. It is optional and defaults to the document
element.
The locator returns:
null
if no anchor is found.- An
anchor
element if only one is found. - An
Array
of anchor elements if more than one is found.
Example Calls
by;
by;
Tests
You will run each command on a separate terminal window.
$ npm run start
$ npm run webdriver
$ npm run test