import {ElementArrayListAdapter} from '@serenity-js/webdriverio/lib/screenplay/questions'
public class | source

ElementArrayListAdapter

Adapts ElementArray so that it can be used with List.

You most likely won't need to use this class directly. Instead, check out Target and Target.all.

Implements:

See also:

Constructor Summary

Public Constructor
public

Method Summary

Public Methods
public

async count(actor: AnswersQuestions & UsesAbilities): Promise<number>

Returns the number of Elements that the underlying ElementArray contains, left after applying any filters.

public

async first(actor: AnswersQuestions & UsesAbilities): Element<'async'>

Returns the first of Elements that the underlying ElementArray contains, left after applying any filters

public

async get(actor: AnswersQuestions & UsesAbilities, index: number): Element<'async'>

Returns the nth of Elements that the underlying ElementArray contains, left after applying any filters

public

items(actor: AnswersQuestions & UsesAbilities): Element<'async'>

Returns the underlying ElementArray, with any filters applied.

public

async last(actor: AnswersQuestions & UsesAbilities): Element<'async'>

Returns the last of Elements that the underlying ElementArray contains, left after applying any filters

public

toString(): string

Returns a human-readable description of the underlying ElementArray.

public

withFilter(question: MetaQuestion<Answerable<Element<'async'>>, Promise<Answer_Type>|Answer_Type>, expectation: Expectation<any, Answer_Type>): ListAdapter<Element<'async'>, ElementArrayFinder>

Filters the underlying ElementArray so that the result contains only those {@link Element<'async'>}s that meet the Expectation

Public Constructors

public constructor() source

Public Methods

public async count(actor: AnswersQuestions & UsesAbilities): Promise<number> source

Returns the number of Elements that the underlying ElementArray contains, left after applying any filters.

Params:

NameTypeAttributeDescription
actor AnswersQuestions & UsesAbilities

Returns:

Promise<number>

public async first(actor: AnswersQuestions & UsesAbilities): Element<'async'> source

Returns the first of Elements that the underlying ElementArray contains, left after applying any filters

Params:

NameTypeAttributeDescription
actor AnswersQuestions & UsesAbilities

Returns:

Element<'async'>

public async get(actor: AnswersQuestions & UsesAbilities, index: number): Element<'async'> source

Returns the nth of Elements that the underlying ElementArray contains, left after applying any filters

Params:

NameTypeAttributeDescription
actor AnswersQuestions & UsesAbilities
index number

Zero-based index of the item to return

Returns:

Element<'async'>

public items(actor: AnswersQuestions & UsesAbilities): Element<'async'> source

Returns the underlying ElementArray, with any filters applied.

Params:

NameTypeAttributeDescription
actor AnswersQuestions & UsesAbilities

Returns:

Element<'async'>

public async last(actor: AnswersQuestions & UsesAbilities): Element<'async'> source

Returns the last of Elements that the underlying ElementArray contains, left after applying any filters

Params:

NameTypeAttributeDescription
actor AnswersQuestions & UsesAbilities

Returns:

Element<'async'>

public toString(): string source

Returns a human-readable description of the underlying ElementArray.

Returns:

string

public withFilter(question: MetaQuestion<Answerable<Element<'async'>>, Promise<Answer_Type>|Answer_Type>, expectation: Expectation<any, Answer_Type>): ListAdapter<Element<'async'>, ElementArrayFinder> source

Filters the underlying ElementArray so that the result contains only those {@link Element<'async'>}s that meet the Expectation

Params:

NameTypeAttributeDescription
question MetaQuestion<Answerable<Element<'async'>>, Promise<Answer_Type>|Answer_Type>
expectation Expectation<any, Answer_Type>

Returns:

ListAdapter<Element<'async'>, ElementArrayFinder>