Skip to content

Latest commit

 

History

History
279 lines (122 loc) · 3.76 KB

tryorama.trycpscenario.md

File metadata and controls

279 lines (122 loc) · 3.76 KB

Home > @holochain/tryorama > TryCpScenario

TryCpScenario class

A test scenario abstraction with convenience functions to manage TryCP clients and players (agent + conductor).

Clients in turn help manage conductors on TryCP servers. Clients can be added to a scenario to keep track of all server connections. When finishing a test scenario, all conductors of all clients can be easily cleaned up and the client connections closed.

Signature:

export declare class TryCpScenario 

Constructors

Constructor

Modifiers

Description

(constructor)()

Constructs a new instance of the TryCpScenario class

Properties

Property

Modifiers

Type

Description

bootstrapServerUrl

URL | undefined

clients

TryCpClient[]

network_seed

string

servicesProcess

ChildProcessWithoutNullStreams | undefined

signalingServerUrl

URL | undefined

Methods

Method

Modifiers

Description

addClient(serverUrl, timeout)

Creates a TryCP client connection and add it to the scenario.

addClientsPlayers(serverUrls, options)

Creates client connections for all passed in URLs and, depending on the options, creates multiple players with apps. Adds all clients to the scenario.

If no number of agents per conductor is specified, it defaults to 1.

addPlayersWithApps(tryCpClient, playersApps)

Creates and adds multiple players with an installed app to the scenario.

addPlayerWithApp(tryCpClient, appBundleSource, options)

Creates and adds a single player with an installed app to the scenario,

cleanUp()

Shut down and delete all conductors and close all client connections in the scenario.

shareAllAgents()

Registers 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 of all clients in the scenario.