integration-0.1.0
Safe HaskellSafe-Inferred
LanguageGHC2021

Testlib.Cannon

Synopsis

Documentation

data WebSocket Source #

Constructors

WebSocket 

Instances

Instances details
HasField "user" WebSocket Value Source # 
Instance details

Defined in Testlib.Cannon

Methods

getField :: WebSocket -> Value #

HasField "client" WebSocket (Maybe ClientIdentity) Source # 
Instance details

Defined in Testlib.Cannon

data WSConnect Source #

Constructors

WSConnect 

Fields

Instances

Instances details
ToWSConnect WSConnect Source # 
Instance details

Defined in Testlib.Cannon

class ToWSConnect a where Source #

Instances

Instances details
ToWSConnect WSConnect Source # 
Instance details

Defined in Testlib.Cannon

MakesValue user => ToWSConnect user Source # 
Instance details

Defined in Testlib.Cannon

Methods

toWSConnect :: user -> App WSConnect Source #

(MakesValue user, MakesValue conn) => ToWSConnect (user, conn) Source # 
Instance details

Defined in Testlib.Cannon

Methods

toWSConnect :: (user, conn) -> App WSConnect Source #

(MakesValue user, MakesValue conn, MakesValue client) => ToWSConnect (user, conn, client) Source # 
Instance details

Defined in Testlib.Cannon

Methods

toWSConnect :: (user, conn, client) -> App WSConnect Source #

withWebSockets :: forall a w. (HasCallStack, ToWSConnect w) => [w] -> ([WebSocket] -> App a) -> App a Source #

awaitNMatchesResult Source #

Arguments

:: HasCallStack 
=> Int

Number of matches

-> (Value -> App Bool)

Selection function. Exceptions are *not* caught.

-> WebSocket 
-> App AwaitResult 

await an expected number of notification events on the websocket that satisfy the provided predicate. If there isn't any new event (matching or non-matching) for a tSecs seconds then AwaitResult is a failure. This function will never terminate if there is a constant stream of events received. When this functions returns it will push any non-matching events back to the websocket.

awaitNMatches Source #

Arguments

:: HasCallStack 
=> Int

Number of matches

-> (Value -> App Bool)

Selection function. Should not throw any exceptions

-> WebSocket 
-> App [Value] 

awaitMatch Source #

Arguments

:: HasCallStack 
=> (Value -> App Bool)

Selection function. Should not throw any exceptions

-> WebSocket 
-> App Value 

awaitAtLeastNMatchesResult Source #

Arguments

:: HasCallStack 
=> Int

Minimum number of matches

-> (Value -> App Bool)

Selection function. Exceptions are *not* caught.

-> WebSocket 
-> App AwaitAtLeastResult 

awaitAtLeastNMatches Source #

Arguments

:: HasCallStack 
=> Int

Minumum number of matches

-> (Value -> App Bool)

Selection function. Should not throw any exceptions

-> WebSocket 
-> App [Value] 

awaitNToMMatchesResult Source #

Arguments

:: HasCallStack 
=> Int

Minimum number of matches

-> Int

Maximum number of matches

-> (Value -> App Bool)

Selection function. Exceptions are *not* caught.

-> WebSocket 
-> App AwaitAtLeastResult 

awaitNToMMatches Source #

Arguments

:: HasCallStack 
=> Int

Minimum Number of matches

-> Int

Maximum Number of matches

-> (Value -> App Bool)

Selection function. Should not throw any exceptions

-> WebSocket 
-> App [Value] 

printAwaitAtLeastResult :: AwaitAtLeastResult -> App () Source #

waitForResponse :: HasCallStack => App Response -> (Response -> App r) -> App r Source #

waits for an http response to satisfy a predicate