http-test-0.1.1: Test framework for HTTP APIs

Safe HaskellNone

Test.HTTP

Synopsis

Documentation

httpTest :: Program () -> IO ()Source

Run one or more test sessions. httpTest will exit when done, with exit code 1 if there were failures

sessionSource

Arguments

:: String

Session name (used for logging failures)

-> String

Base URL

-> Session ()

the actions and assertions that define the session

-> Program () 

Define a single test session based on session name and base url

getSource

Arguments

:: String

URL

-> Session String 

GET a web page as a String

getJSONSource

Arguments

:: FromJSON a 
=> String

URL

-> Session a 

GET a JSON value

postFormSource

Arguments

:: String

URL

-> [(String, String)]

form fields

-> Session String 

POST a form

assertSource

Arguments

:: String

assertion name (used for reporting failures

-> Bool

Boolean of which we are asserting truth

-> Session () 

make an assertion

type Program = ReaderT (TVar [Results]) IOSource

type Session = StateT SessionState IOSource