Skip to main content
Version: 9.0.0

ExpectSelector

Method allowing to assert a Selector status.

ParameterTypeDescription
actualany
optionsAssertOptionsMethod options.

AssertOptions

ParameterTypeDescription
intervalnumberTime interval between retries in milliseconds.
timeoutnumberTimeout of the method.
retriesnumberNumber of retries.
backoffFIXED / EXPONENTIAL / LINEARValue used to determine the wait time between successive retries.
maxBackOffnumberMaximum value of the backoff.
errorMessagestringError message.
overrideErrorMessagestringOverride the Test Maker error message.
retryMessagestringRetry message.
softbooleanAssertion is soft assertion (does not stop test execution).

How to use the expect selector method to assert:

const xpath = `//*[@id="hello world"]`;
const css = `[id="hello-world"]`


await I.expectSelector(Selector(xpath)).toBeVisible();
await I.expectSelector(Selector(css)).toBeVisible();