The Hover
class is an action class in the Screenplay pattern designed for use with the @testla/screenplay
library. This class enables actors to simulate hovering over an element specified by a selector string using the BrowseTheWeb
ability provided by Testla.
public async performAs(actor: Actor): Promise<void>;
- Description: Finds the specified selector and simulates hovering over it.
- Parameters:
actor
- The actor performing this action.
- Returns:
Promise<void>
- Returns when hovered over the element.
public static over(selector: Selector, options?: SelectorOptions & { modifiers?: ('Alt' | 'Control' | 'Meta' | 'Shift')[] }): Hover;
- Description: Creates a new instance of the
Hover
class specifically for hovering over an element. - Parameters:
selector
- The selector that should be hovered over.options
(optional) - Advanced selector lookup options + Modifier keys to press. Ensures that only these modifiers are pressed during the operation.
- Returns:
Hover
- Returns a newHover
instance.
public inFrame(frameSelector: FrameSelector): Hover;
- Description: Finds the specified frame selector using the
BrowseTheWeb
ability. - Parameters:
frameSelector
- The FrameSelector.
- Returns:
Hover
- Returns the current action.
public withAbilityAlias(alias: string): Hover;
- Description: Defines the ability alias to be used during execution.
- Parameters:
alias
- The alias.
- Returns:
Hover
- Returns the current action.
Introduced in: 1.6.0
public get orSkipOnFail(): Hover;
- Description: Allows to skip an action on fail.
- Returns:
Hover
- Returns the current action.