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?
readonlyoptionaldismiss?: (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
readonlyname:string
Stable identifier, used in logs and report attachments.
selector
readonlyselector:string
Playwright selector locating the overlay. Prefer plain CSS — this is evaluated before every action.
times?
readonlyoptionaltimes?:number
Maximum times this rule may fire per test. Defaults to 5.