Module

Ctl.Internal.Test.E2E.Types

Common types for E2E tests.

#Browser

type Browser = FilePath

Browser binary path or short name

#TmpDir

type TmpDir = FilePath

Temporary directory prefix

#SettingsArchive

type SettingsArchive = FilePath

.tar.gz archive containing the runtime settings for all the extensions used in E2E.

#SettingsArchiveUrl

#ChromeUserDataDir

type ChromeUserDataDir = FilePath

Chrome user data directory

#CrxFilePath

type CrxFilePath = FilePath

Path to a .crx chrome extension file.

#ExtensionId

newtype ExtensionId

Chrome Extension ID. Use mkExtensionId to construct.

Instances

#BrowserArg

type BrowserArg = String

Browser CLI interface argument

#mkExtensionId

mkExtensionId :: String -> Maybe ExtensionId

A smart constructor for ExtensionId

#unExtensionId

#WalletPassword

type WalletPassword = String

Password for some wallet extension.

#ExtensionParams

type ExtensionParams = { crx :: CrxFilePath, extensionId :: ExtensionId, password :: WalletPassword }

A record containing everything needed to use a Chrome extension in the E2E test suite.

#WalletExt

#Extensions

type Extensions = Map WalletExt ExtensionParams

Extension parameters for some set of known extensions.

#E2ETestRuntime

type E2ETestRuntime = { browser :: Browser, chromeUserDataDir :: ChromeUserDataDir, settingsArchive :: SettingsArchive, tmpDir :: TmpDir, wallets :: Map WalletExt ExtensionParams }

Contains everything needed to run E2E tests.

#SettingsRuntime

type SettingsRuntime = { chromeUserDataDir :: ChromeUserDataDir, settingsArchive :: SettingsArchive }

Contains everything needed to pack and unpack settings.

#E2ETest

type E2ETest = { specString :: String, url :: String, wallet :: E2EWallet }

A particular test instance.

#mkE2ETest

mkE2ETest :: String -> Maybe E2ETest

Construct an E2ETest from a spec (wallet:url)

#RunningE2ETest

type RunningE2ETest = { browser :: Browser, jQuery :: Maybe String, page :: Page }

Represents a connection to a running E2E test.

#SomeWallet

type SomeWallet = { confirmAccess :: ExtensionId -> RunningE2ETest -> Aff Unit, extensionId :: ExtensionId, name :: String, sign :: ExtensionId -> WalletPassword -> RunningE2ETest -> Aff Unit, wallet :: WalletExt }

Provides an interface to interact with a wallet running in a headless browser.

#getE2EWalletExtension

Modules