ExpectSelector
Method allowing to assert a Selector status.
Parameter | Type | Description |
---|---|---|
actual | any | |
options | AssertOptions | Method options. |
AssertOptions
Parameter | Type | Description |
---|---|---|
interval | number | Time interval between retries in milliseconds. |
timeout | number | Timeout of the method. |
retries | number | Number of retries. |
backoff | FIXED / EXPONENTIAL / LINEAR | Value used to determine the wait time between successive retries. |
maxBackOff | number | Maximum value of the backoff. |
errorMessage | string | Error message. |
overrideErrorMessage | string | Override the Test Maker error message. |
retryMessage | string | Retry message. |
soft | boolean | Assertion 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();