Skip to main content

PageElements <Native_Element_Type>

Uses the actor’s ability to BrowseTheWeb to identify a group of Web elements located by Selector.

Learn more

Hierarchy

Index

Constructors

constructor

  • new PageElements<Native_Element_Type>(collection: Object): PageElements<Native_Element_Type>
  • Type parameters

    • Native_Element_Type = any

    Parameters

    • collection: Object

    Returns PageElements<Native_Element_Type>

Methods

staticlocated

as

  • as<O>(mapping: (answer: PageElement<Native_Element_Type>[]) => O | Promise<O>): QuestionAdapter<O>
  • Maps this question to one of a different type.

    Question.about('number returned as string', actor => '42')   // returns: QuestionAdapter<string>
    .as(Number) // returns: QuestionAdapter<number>

    Type parameters

    • O

    Parameters

    • mapping: (answer: PageElement<Native_Element_Type>[]) => O | Promise<O>

    Returns QuestionAdapter<O>

forEach

  • forEach(callback: (current: CurrentItem<PageElement<Native_Element_Type>>, index: number, items: PageElement<Native_Element_Type>[]) => void | Promise<void>): Task
  • Parameters

    • callback: (current: CurrentItem<PageElement<Native_Element_Type>>, index: number, items: PageElement<Native_Element_Type>[]) => void | Promise<void>

    Returns Task

answeredBy

  • answeredBy(actor: AnswersQuestions & UsesAbilities): Promise<PageElement<Native_Element_Type>[]>
  • Parameters

    • actor: AnswersQuestions & UsesAbilities

    Returns Promise<PageElement<Native_Element_Type>[]>

describedAs

  • describedAs(subject: string): PageElements<Native_Element_Type>
  • Parameters

    • subject: string

    Returns PageElements<Native_Element_Type>

toString

  • toString(): string
  • Returns string

of

  • Parameters

    Returns MetaList<PageElement<Native_Element_Type>, PageElement<Native_Element_Type>>

eachMappedTo

  • eachMappedTo<Mapped_Item_Type>(question: MetaQuestion<PageElement<Native_Element_Type>, Question<Mapped_Item_Type | Promise<Mapped_Item_Type>>>): MetaList<PageElement<Native_Element_Type>, Mapped_Item_Type>
  • Type parameters

    • Mapped_Item_Type

    Parameters

    • question: MetaQuestion<PageElement<Native_Element_Type>, Question<Mapped_Item_Type | Promise<Mapped_Item_Type>>>

    Returns MetaList<PageElement<Native_Element_Type>, Mapped_Item_Type>

where

  • where<Answer_Type>(question: MetaQuestion<PageElement<Native_Element_Type>, Question<Answer_Type | Promise<Answer_Type>>>, expectation: Expectation<Answer_Type>): MetaList<PageElement<Native_Element_Type>, PageElement<Native_Element_Type>>
  • Type parameters

    • Answer_Type

    Parameters

    • question: MetaQuestion<PageElement<Native_Element_Type>, Question<Answer_Type | Promise<Answer_Type>>>
    • expectation: Expectation<Answer_Type>

    Returns MetaList<PageElement<Native_Element_Type>, PageElement<Native_Element_Type>>

count

  • count(): MetaQuestionAdapter<PageElement<Native_Element_Type>, number>
  • Returns MetaQuestionAdapter<PageElement<Native_Element_Type>, number>

first

  • Returns MetaQuestionAdapter<PageElement<Native_Element_Type>, PageElement<Native_Element_Type>>

last

  • Returns MetaQuestionAdapter<PageElement<Native_Element_Type>, PageElement<Native_Element_Type>>

nth

  • Parameters

    • index: number

    Returns MetaQuestionAdapter<PageElement<Native_Element_Type>, PageElement<Native_Element_Type>>