protractor-custom-locators

3.0.0 • Public • Published

protractor-custom-locators

This module adds a custom locators to a protractor instance that finds elements by their attribute using addLocator method.

list of currently available locators:

  • locator that finds element by data-test-id attribute
    • locator name - dataTestId
  • locator that finds element by data-reactid attribute
    • locator name - dataReactId

Installation

$ npm install protractor-custom-locators

Usage

that you should put in your protractor.config.js:

import AddCustomLocators from "protractor-custom-locators/index";

onPrepare() {
   AddCustomLocators.addDataTestId(protractor);
   AddCustomLocators.addDataReactId(protractor);
}

The locator can then be used with element(by.locatorName(args)).

Package Sidebar

Install

npm i protractor-custom-locators

Weekly Downloads

41

Version

3.0.0

License

MIT

Last publish

Collaborators

  • crispusdh