import {TargetElements} from '@serenity-js/protractor/lib/screenplay/questions/targets'
public class | source

TargetElements

Locates a group of WebElements.

Instead of using this class directly, please use Target.all instead.

Extends:

Question → TargetElements

Implements:

Tests:

See also:

Constructor Summary

Public Constructor
public

constructor(description: string, locator: Locator)

Method Summary

Public Methods
public

answeredBy(actor: AnswersQuestions & UsesAbilities): Promise<void>

Makes the provided Actor answer this Question.

public

count(): Question<Promise<number>>

Returns the number of ElementFinders matched by the locator

public

Returns the first of ElementFinders matched by the locator

public

get(index: number): Question<ElementFinder>

Returns an ElementFinder at index for locator

public

Returns the last of ElementFinders matched by the locator

public

of(parent: Question<ElementFinder> | ElementFinder): TargetNestedElements

Retrieves a group of WebElements located by locator, resolved in the context of a parent WebElement.

public

where(question: MetaQuestion<ElementFinder, Promise<Answer_Type>|Answer_Type>, expectation: Expectation<any, Answer_type>): List<ElementArrayFinderListAdapter, ElementFinder, ElementArrayFinder>

Filters the list of ElementFinders matched by locator to those that meet the additional Expectations.

Public Constructors

public constructor(description: string, locator: Locator) source

Params:

NameTypeAttributeDescription
description string

A human-readable description to be used in the report

locator Locator

A locator to be used when locating the element

Public Methods

public answeredBy(actor: AnswersQuestions & UsesAbilities): Promise<void> source

Makes the provided Actor answer this Question.

Params:

NameTypeAttributeDescription
actor AnswersQuestions & UsesAbilities

Returns:

Promise<void>

public where(question: MetaQuestion<ElementFinder, Promise<Answer_Type>|Answer_Type>, expectation: Expectation<any, Answer_type>): List<ElementArrayFinderListAdapter, ElementFinder, ElementArrayFinder> source

Filters the list of ElementFinders matched by locator to those that meet the additional Expectations.

Params:

NameTypeAttributeDescription
question MetaQuestion<ElementFinder, Promise<Answer_Type>|Answer_Type>
expectation Expectation<any, Answer_type>

See: