-
Notifications
You must be signed in to change notification settings - Fork 50
/
E2E.purs
52 lines (47 loc) · 1.66 KB
/
E2E.purs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
-- | This module is used to serve the E2E tests to the headless browser.
module Scaffold.Test.E2E.Serve where
import Contract.Prelude
import Contract.Config
( ContractParams
, KnownWallet(Nami, Gero, Flint, Eternl, Lode)
, WalletSpec(ConnectToGenericCip30)
, testnetConfig
, walletName
)
import Contract.Monad (Contract)
import Contract.Test.E2E (E2EConfigName, E2ETestName, addLinks, route)
import Data.Map (Map)
import Data.Map as Map
import Scaffold as Scaffold
main :: Effect Unit
main = do
addLinks configs tests
route configs tests
configs :: Map E2EConfigName (ContractParams /\ Maybe String)
configs = map (map walletName) <$> Map.fromFoldable
[ "nami" /\ testnetConfig' Nami /\ Nothing
, "gero" /\ testnetConfig' Gero /\ Nothing
, "flint" /\ testnetConfig' Flint /\ Nothing
, "eternl" /\ testnetConfig' Eternl /\ Nothing
, "lode" /\ testnetConfig' Lode /\ Nothing
, "nami-mock" /\ testnetConfig' Nami /\ Just Nami
, "gero-mock" /\ testnetConfig' Gero /\ Just Gero
, "flint-mock" /\ testnetConfig' Flint /\ Just Flint
, "lode-mock" /\ testnetConfig' Lode /\ Just Lode
, "plutip-nami-mock" /\ testnetConfig' Nami /\ Just Nami
, "plutip-gero-mock" /\ testnetConfig' Gero /\ Just Gero
, "plutip-flint-mock" /\ testnetConfig' Flint /\ Just Flint
, "plutip-lode-mock" /\ testnetConfig' Lode /\ Just Lode
]
where
testnetConfig' :: KnownWallet -> ContractParams
testnetConfig' wallet =
testnetConfig
{ walletSpec =
Just $ ConnectToGenericCip30 (walletName wallet) { cip95: false }
}
tests :: Map E2ETestName (Contract Unit)
tests = Map.fromFoldable
[ "Contract" /\ Scaffold.contract
-- Add more `Contract`s here
]