Skip to content

Lupa API Reference / commands/locator / ClickOptions

Interface: ClickOptions

Defined in: src/commands/locator.ts:240

Options that can be passed to locator actions.

Extends

Properties

button?

optional button?: "right" | "left" | "middle"

Defined in: src/commands/locator.ts:245

Defaults to left.


clickCount?

optional clickCount?: number

Defined in: src/commands/locator.ts:250

defaults to 1. See [UIEvent.detail].


delay?

optional delay?: number

Defined in: src/commands/locator.ts:255

Time to wait between mousedown and mouseup in milliseconds. Defaults to 0.


force?

optional force?: boolean

Defined in: src/commands/locator.ts:171

Whether to bypass the actionability checks. Defaults to false.

Inherited from

ForceOption.force


modifiers?

optional modifiers?: ("Alt" | "Control" | "ControlOrMeta" | "Meta" | "Shift")[]

Defined in: src/commands/locator.ts:205

Modifier keys to press. Ensures that only these modifiers are pressed during the operation, and then restores current modifiers back. If not specified, currently pressed modifiers are used. "ControlOrMeta" resolves to "Control" on Windows and Linux and to "Meta" on macOS.

Inherited from

ModifiersOption.modifiers


position?

optional position?: object

Defined in: src/commands/locator.ts:216

A point to use relative to the top-left corner of element padding box. If not specified, uses some visible point of the element.

x

x: number

X coordinate

y

y: number

Y coordinate

Inherited from

PositionOption.position


strict?

optional strict?: boolean

Defined in: src/commands/locator.ts:182

When true, the call requires selector to resolve to a single element. If given selector resolves to more than one element, the call throws an exception.

Inherited from

StrictOption.strict


timeout?

optional timeout?: number

Defined in: src/commands/locator.ts:161

Maximum time in milliseconds. Defaults to 0 - no timeout. The default value can be changed via actionTimeout option in the config, or by using the browserContext.setDefaultTimeout(timeout) or page.setDefaultTimeout(timeout) methods.

Inherited from

TimeoutOption.timeout


trial?

optional trial?: boolean

Defined in: src/commands/locator.ts:193

When set, this method only performs the actionability checks and skips the action. Defaults to false. Useful to wait until the element is ready for the action without performing it.

Inherited from

TrialOption.trial