Skip to main content
Version: 1.x

Interface: OverlayRule

A rule describing one overlay that may interrupt an action.

Remarks​

Omit dismiss to detect and report only — the recommended default. Supply dismiss only when answering the overlay cannot change the meaning of the test.

Example​

const rule: OverlayRule = {
name: 'product-tour',
selector: '.myTourPopover',
dismiss: async (overlay) => overlay.getByRole('button', { name: 'Skip' }).click(),
};

Properties​

dismiss?​

readonly optional dismiss?: (overlay) => Promise<void>

How to dismiss the overlay. When omitted the overlay is recorded and reported but never touched.

Parameters​

overlay​

Locator

Returns​

Promise<void>


name​

readonly name: string

Stable identifier, used in logs and report attachments.


selector​

readonly selector: string

Playwright selector locating the overlay. Prefer plain CSS — this is evaluated before every action.


times?​

readonly optional times?: number

Maximum times this rule may fire per test. Defaults to 5.