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

Text

Resolves to the visible (i.e. not hidden by CSS) innerText of:

  • a given WebElement, represented by ElementFinder or Question<ElementFinder>,
  • a group of WebElements, represented by ElementArrayFinder or Question<ElementArrayFinder>.

    The result includes the visible text of any sub-elements, without any leading or trailing whitespace.

Extends:

Question → Text

Implements:

Static Method Summary

Static Public Methods
public static

of(target: Question<ElementFinder> | ElementFinder): Question<Promise<string>> & MetaQuestion<Question<ElementFinder>|ElementFinder, Promise<string>>

Retrieves text of a single WebElement, represented by ElementFinder or Question<ElementFinder>.

public static

ofAll(target: Question<ElementArrayFinder> | ElementArrayFinder): Question<Promise<string[]>> & MetaQuestion<Question<ElementFinder>|ElementFinder, Promise<string[]>>

Retrieves text of a group of WebElements, represented by ElementArrayFinder or Question<ElementArrayFinder>

Static Public Methods

public static of(target: Question<ElementFinder> | ElementFinder): Question<Promise<string>> & MetaQuestion<Question<ElementFinder>|ElementFinder, Promise<string>> source

Retrieves text of a single WebElement, represented by ElementFinder or Question<ElementFinder>.

Params:

NameTypeAttributeDescription
target Question<ElementFinder> | ElementFinder

Returns:

Question<Promise<string>> & MetaQuestion<Question<ElementFinder>|ElementFinder, Promise<string>>

public static ofAll(target: Question<ElementArrayFinder> | ElementArrayFinder): Question<Promise<string[]>> & MetaQuestion<Question<ElementFinder>|ElementFinder, Promise<string[]>> source

Retrieves text of a group of WebElements, represented by ElementArrayFinder or Question<ElementArrayFinder>

Params:

NameTypeAttributeDescription
target Question<ElementArrayFinder> | ElementArrayFinder

Returns:

Question<Promise<string[]>> & MetaQuestion<Question<ElementFinder>|ElementFinder, Promise<string[]>>