Skip to main content

UseBatch

The UseBatch class is part of a testing library built on top of AWS Batch, implementing the Screenplay pattern.

Extends

This class extends the abstract Ability class from Core.

Methods

getClient

Introduced in: 1.0.0

public getClient(): BatchClient
  • Description: Get the batch client associated with this instance.
  • Returns: BatchClient - The AWS batch client.

Usage:

// inside an actions performAs method
const batchClient = UseBatch.as(actor, this.abilityAlias).getClient();
// now you can use the client

using

public static using(settings: AwsSettings): UseBatch
  • Description: Initialize the UseBatch ability by passing an AwsSettings object.
  • Parameters:
    • settings - The AWS Settings.
  • Returns: UseBatch - The initialized UseBatch object.

Usage:

actor.can(UseBatch.using(settings))

as

public static as(actor: Actor, alias?: string): UseBatch
  • Description: Use this ability as an actor.
  • Parameters:
    • actor - The actor object.
    • alias - (Optional) The alias for the ability
  • Returns: UseBatch - The ability to use batch as the actor, optionally with an alias name.

Methods inherited from Core Ability

withAlias

Introduced in core: 0.3.0

public withAlias(alias: string): Ability;
  • Description: Defines the ability's alias.
  • Parameters:
    • alias - The alias.
  • Returns: Ability - Returns the current ability.

Usage:

Actor.can(Ability.withAlias('aliased'));