Assistive-Webdriver

Home > assistive-playwright-client > ScreenReaderClient > waitForMessage

ScreenReaderClient.waitForMessage() method

Waits for a specific message from the screen reader.

Signature:

waitForMessage(expectedText: ExpectedText, options?: {
        clean?: boolean;
        includeCurrent?: boolean;
        timeout?: number;
    }): Promise<string[]>;

Parameters

Parameter Type Description
expectedText ExpectedText expectation about the message to receive
options { clean?: boolean; includeCurrent?: boolean; timeout?: number; } clean: if true (the default), once the expected message is found, all messages up to (and including) the expected message are removed from the messages array. includeCurrent: if true (the default), the expected message is also searched for in the already received messages (in the current messages array). Otherwise, it is only searched for in the future messages. timeout: the time in milliseconds to wait before the promise returned by waitForMessage is rejected (if the expected message is not found during that time). Defaults to 10000ms (10s).

Returns:

Promise<string[]>

The array of messages up to (and including) the message matching the expectations.