Skip to main content
Version: 1.x

Interface: NativeDialogRule

A policy for answering one kind of native dialog.

Example​

const rule: NativeDialogRule = {
name: 'discard-unsaved',
types: ['beforeunload'],
action: 'accept',
};

Properties​

action​

readonly action: NativeDialogAction

Whether to accept or dismiss.


name​

readonly name: string

Stable identifier, used in logs and records.


promptText?​

readonly optional promptText?: string

Text supplied when accepting a prompt. Ignored for other types.


times?​

readonly optional times?: number

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


types​

readonly types: readonly NativeDialogType[]

Dialog types this rule answers. Must not be empty.