Skip to content

Latest commit

 

History

History
386 lines (168 loc) · 5.04 KB

File metadata and controls

386 lines (168 loc) · 5.04 KB

Home > @holochain/tryorama > Scenario

Scenario class

An abstraction of a test scenario to write tests against Holochain hApps, running on a local conductor.

Signature:

export declare class Scenario 

Constructors

Constructor

Modifiers

Description

(constructor)(options)

Scenario constructor.

Properties

Property

Modifiers

Type

Description

bootstrapServerUrl

URL | undefined

conductors

Conductor[]

disableLocalServices

boolean | undefined

dpkiNetworkSeed

string

networkSeed

string

noDpki

boolean

serviceProcess

ChildProcessWithoutNullStreams | undefined

signalingServerUrl

URL | undefined

Methods

Method

Modifiers

Description

addConductor(networkConfig, label)

Create and add a conductor to the scenario.

addPlayers(amount, networkConfig)

Create conductors with agents and add them to the scenario.

The specified number of conductors is created and one agent is generated on each conductor.

Each conductor is created sequentially, once the previous has completed startup.

addPlayersWithApps(appsWithOptions)

Create and add multiple players to the scenario, with an app installed for each player.

addPlayersWithSameApp(appWithOptions, amount)

Create and add multiple players to the scenario, with the same app installed for each player.

Each conductor is created sequentially, once the previous has completed startup.

addPlayerWithApp(appWithOptions)

Create and add a single player with an app installed to the scenario.

This should not be called multiple times in parallel. Instead use addPlayersWithApps or addPlayersWithSameApp.

cleanUp()

Shut down and delete all conductors in the scenario.

installAppsForPlayers(appsWithOptions, players)

Installs the provided apps for the provided players.

The number of players must be at least as high as the number of apps.

Each app is installed sequentially, once the previous has completed installation.

# Errors

If any of the app options contains an agent pub key, an error is thrown, because the agent pub keys of the players will be used for app installation.

installSameAppForPlayers(appWithOptions, players)

Installs the same provided app for the provided players.

The app is installed into each player's conductor sequentially, once the previous has completed installation.

shareAllAgents()

Register all agents of all passed in conductors to each other. This skips peer discovery through gossip and thus accelerates test runs.

shutDown()

Shut down all conductors in the scenario.