The Select
class is an action class in the Screenplay pattern designed for use with the @testla/screenplay
library. This class allows actors to set the value of a Selector of type select to the given option using the BrowseTheWeb
ability provided by Testla.
public async performAs(actor: Actor): Promise<any>;
- Description: Sets the value of a Selector of type select to the given option.
- Parameters:
actor
- The actor performing this action.
- Returns:
Promise<any>
- This method checks, waits until all specified options are present in the<select>
element and selects these options.
public static option(selector: Selector, option: string | { value?: string, label?: string, index?: number }, selectorOptions?: SelectorOptions): Select;
- Description: Creates a new instance of the
Select
class specifically for setting the value of a Selector of type select to the given option. - Parameters:
selector
- The string representing the (select) selector.option
- The label of the option to be selected. It can be either a string or an object with optional properties:value
,label
, orindex
.selectorOptions
- (optional): Advanced selector lookup options.
- Returns:
Select
- Returns a newSelect
instance.
public inFrame(frameSelector: FrameSelector): Select;
- Description: Finds the specified frame selector using the
BrowseTheWeb
ability. - Parameters:
frameSelector
- The FrameSelector.
- Returns:
Select
- Returns the current action.
public withAbilityAlias(alias: string): Select;
- Description: Defines the ability alias to be used during execution.
- Parameters:
alias
- The alias.
- Returns:
Select
- Returns the current action.
Introduced in: 1.6.0
public get orSkipOnFail(): Select;
- Description: Allows to skip an action on fail.
- Returns:
Select
- Returns the current action.