The Set
class is an action class in the Screenplay pattern designed for use with the @testla/screenplay
library. This class allows actors to set either Session Storage Items or Local Storage Items on the browser using the BrowseTheWeb
ability provided by Testla.
public performAs(actor: Actor): Promise<any>;
- Description: Sets the specified storage item in either Session Storage or Local Storage.
- Parameters:
actor
- The actor performing this action.
- Returns:
Promise<any>
- Returns the value of thepageFunction
invocation.
public static sessionStorageItem(key: string, value: any): Set;
- Description: Creates a new instance of the
Set
class specifically for setting a session storage item identified by the given key and value. - Parameters:
key
- The key that specifies the item.value
- The value of the item.
- Returns:
Set
- Returns a newSet
instance for session storage.
public static localStorageItem(key: string, value: any): Set;
- Description: Creates a new instance of the
Set
class specifically for setting a local storage item identified by the given key and value. - Parameters:
key
- The key that specifies the item.value
- The value of the item.
- Returns:
Set
- Returns a newSet
instance for local storage.
public withAbilityAlias(alias: string): Set;
- Description: Defines the ability alias to be used during execution.
- Parameters:
alias
- The alias.
- Returns:
Set
- Returns the current action.
Introduced in: 1.6.0
public get orSkipOnFail(): Set;
- Description: Allows to skip an action on fail.
- Returns:
Set
- Returns the current action.