Interface IProtractorLocatorStrategy

Hierarchy

Index

Methods

Methods

public addLocator(name: string, script: any)

Add a locator to this instance of ProtractorBy. This locator can then be used with element(by.()).

Parameters

  • name: string
  • script: any

    A script to be run in the context of the browser. This script will be passed an array of arguments that begins with the element scoping the search, and then contains any args passed into the locator. It should return an array of elements.

public binding(bindingDescriptor: string): Locator

Usage: {{status}} var status = element(by.binding('{{status}}'));

Parameters

  • bindingDescriptor: string

Returns

Locator

public buttonText(searchText: string): Locator

Parameters

  • searchText: string

Returns

Locator

public class name(value: string): Locator

Parameters

  • value: string

Returns

Locator

public className(value: string): Locator

Parameters

  • value: string

Returns

Locator

public css(value: string): Locator

Parameters

  • value: string

Returns

Locator

public id(value: string): Locator

Parameters

  • value: string

Returns

Locator

public input(model: string): Locator

deprecated
  • use 'model' instead. Usage: element(by.input('user'));

Parameters

  • model: string

Returns

Locator

public js(value: string): Locator

Parameters

  • value: string

Returns

Locator

public link text(value: string): Locator

Parameters

  • value: string

Returns

Locator

public linkText(value: string): Locator

Parameters

  • value: string

Returns

Locator

public model(model: string): Locator

Usage: element(by.model('user'));

Parameters

  • model: string

Returns

Locator

public name(value: string): Locator

Parameters

  • value: string

Returns

Locator

public partial link text(value: string): Locator

Parameters

  • value: string

Returns

Locator

public partialButtonText(searchText: string): Locator

Parameters

  • searchText: string

Returns

Locator

public partialLinkText(value: string): Locator

Parameters

  • value: string

Returns

Locator

public repeater(repeatDescriptor: string): Locator

Usage:

{{cat.name}} {{cat.age}}

// Returns the DIV for the second cat. var secondCat = element(by.repeater("cat in pets").row(2)); // Returns the SPAN for the first cat's name. var firstCatName = element( by.repeater("cat in pets").row(1).column("{{cat.name}}")); // Returns a promise that resolves to an array of WebElements from a column var ages = element( by.repeater("cat in pets").column("{{cat.age}}")); // Returns a promise that resolves to an array of WebElements containing // all rows of the repeater. var rows = element(by.repeater("cat in pets"));

Parameters

  • repeatDescriptor: string

Returns

Locator

public select(model: string): Locator

Usage: element(by.select("user"));

Parameters

  • model: string

Returns

Locator

public selectedOption(model: string): Locator

Usage: element(by.selectedOption("user"));

Parameters

  • model: string

Returns

Locator

public tag name(value: string): Locator

Parameters

  • value: string

Returns

Locator

public tagName(value: string): Locator

Parameters

  • value: string

Returns

Locator

public textarea(model: string): Locator

Usage: element(by.textarea("user"));

Parameters

  • model: string

Returns

Locator

public xpath(value: string): Locator

Parameters

  • value: string

Returns

Locator