h$SQ       !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvw Safe-Inferred   yesod-testParses a query into an intermediate format which is easy to feed to HXTThe top-level lists represent the top level comma separated queries.SelectorGroup is a group of qualifiers which are separated with spaces or > like these three: table.main.odd tr.even > td.bigA SelectorGroup as a list of Selector items, following the above example the selectors in the group are: table, .main and .odd   None   yesod-testHelper function to get the first 1024 characters of the body, assuming it is UTF-8. This function is used to preview the body in case of an assertion failure.  yesod-testHelper function to determine if we can print a body as plain text, for debugging purposes.  yesod-test?List of Content-Types that are assumed to be UTF-8 (e.g. JSON).None #$->?  yesod-test State + IO  yesod-test"Retrieve the current state in the  type.Equivalent to x  yesod-testPut the given s into the  state for later retrieval.Equivalent to y7, but the value is evaluated to weak head normal form.  yesod-testModify the underlying s state.:This is strict in the function used, and is equivalent to z.  yesod-testRun an  action with the intial state s> provided, returning the result, and discard the final state.  yesod-testRun an  action with the initial state s provided, returning the final state, and discarding the result.  yesod-testRun an  action with the initial state provided, returning both the result of the computation as well as the final state.None N% yesod-testPerform a css $ on Html. Returns EitherLeft: Query parse error.'Right: List of matching Html fragments.& yesod-testPerform a css $ on Html. Returns EitherLeft: Query parse error.Right: List of matching Cursors #$%&'%&#$ ' None #$->?Pg* yesod-testThe * state monad constructs a URL encoded string of arguments to send with your requests. Some of the functions that run on it use the current response to analyze the forms that the server is expecting to receive.+ yesod-test2Internal data structure, corresponding to hspec's SpecTree. Since 1.2.0. yesod-testCorresponds to hspec's Spec. Since 1.2.0/ yesod-test#A single test case, to be run with =. Since 1.2.00 yesod-test3The state used in a single test case defined using = Since 1.2.46 yesod-test3Get the foundation value used for the current test. Since 1.2.07 yesod-test yesod-testModifies the site (3*) of the test, and creates a new WAI app (2 ) for it.yesod-test allows sending requests to your application to test that it handles them correctly. In rare cases, you may wish to modify that application in the middle of a test. This may be useful if you wish to, for example, test your application under a certain configuration, then change that configuration to see if your app responds differently.Examples post SendEmailR -- Assert email not created in database testModifySite (\site -> pure (site { siteSettingsStoreEmail = True }, id)) post SendEmailR -- Assert email created in database testModifySite (\site -> do middleware <- makeLogware site pure (site { appRedisConnection = Nothing }, middleware) )? yesod-test Sets a cookieExamples import qualified Web.Cookie as Cookie :set -XOverloadedStrings testSetCookie Cookie.defaultSetCookie { Cookie.setCookieName = "name" }@ yesod-test$Deletes the cookie of the given nameExamples 0:set -XOverloadedStrings testDeleteCookie "name"A yesod-test:Modify the current cookies with the given mapping functionB yesod-testClears the current cookiesC yesod-testPerforms a given action using the last response. Use this to create response-level assertionsD yesod-testUse HXT to parse a value from an HTML tag. Check for usage examples in this module's source.E yesod-testQuery the last response using CSS selectors, returns a list of matched fragmentsF yesod-test,Asserts that the two given values are equal.In case they are not equal, the error message includes the two values.G yesod-test0Asserts that the two given values are not equal.>In case they are equal, the error message includes the values.I yesod-test,Asserts that the two given values are equal.J yesod-testAssert the last response status is as expected. If the status code doesn't match, a portion of the body is also printed to aid in debugging.Examples get HomeR statusIs 200K yesod-test4Assert the given header key/value pair was returned.Examples {-# LANGUAGE OverloadedStrings #-} get HomeR assertHeader "key" "value" import qualified Data.CaseInsensitive as CI import qualified Data.ByteString.Char8 as BS8 getHomeR assertHeader (CI.mk (BS8.pack "key")) (BS8.pack "value")L yesod-test9Assert the given header was not included in the response.Examples {-# LANGUAGE OverloadedStrings #-} get HomeR assertNoHeader "key" import qualified Data.CaseInsensitive as CI import qualified Data.ByteString.Char8 as BS8 getHomeR assertNoHeader (CI.mk (BS8.pack "key"))M yesod-testAssert the last response is exactly equal to the given text. This is useful for testing API responses.Examples get HomeR bodyEquals "

Hello, World

"N yesod-testAssert the last response has the given text. The check is performed using the response body in full text form.Examples %get HomeR bodyContains "

Foo

"O yesod-testAssert the last response doesn't have the given text. The check is performed using the response body in full text form.Examples 'get HomeR bodyNotContains "

Foo

P yesod-testQueries the HTML using a CSS selector, and all matched elements must contain the given string.Examples {-# LANGUAGE OverloadedStrings #-} get HomeR htmlAllContain "p" "Hello" -- Every

tag contains the string "Hello" import qualified Data.Text as T get HomeR htmlAllContain (T.pack "h1#mainTitle") "Sign Up Now!" -- All

tags with the ID mainTitle contain the string "Sign Up Now!"Q yesod-testQueries the HTML using a CSS selector, and passes if any matched element contains the given string.Examples {-# LANGUAGE OverloadedStrings #-} get HomeR htmlAnyContain "p" "Hello" -- At least one

tag contains the string "Hello" Since 0.3.5R yesod-testQueries the HTML using a CSS selector, and fails if any matched element contains the given string (in other words, it is the logical inverse of htmlAnyContain).Examples {-# LANGUAGE OverloadedStrings #-} get HomeR htmlNoneContain ".my-class" "Hello" -- No tags with the class "my-class" contain the string "Hello" Since 1.2.2S yesod-testPerforms a CSS query on the last response and asserts the matched elements are as many as expected.Examples {-# LANGUAGE OverloadedStrings #-} get HomeR htmlCount "p" 3 -- There are exactly 3

tags in the responseT  yesod-testParses the response body from JSON into a Haskell value, throwing an error if parsing fails.#This function also checks that the  Content-Type of the response is application/json.Examples 8get CommentR (comment :: Comment) <- requireJSONResponse 1post UserR (json :: Value) <- requireJSONResponseU yesod-testOutputs the last response body to stderr (So it doesn't get captured by HSpec). Useful for debugging.Examples get HomeR printBodyV yesod-test5Performs a CSS query and print the matches to stderr.Examples {-# LANGUAGE OverloadedStrings #-} get HomeR printMatches "h1" -- Prints all h1 tagsW yesod-testAdd a parameter with the given name and value to the request body. This function can be called multiple times to add multiple parameters, and be mixed with calls to Y."Post parameter" is an informal description of what is submitted by making an HTTP POST with an HTML 

 . Like HTML  s, yesod-test will default to a  Content-Type of !application/x-www-form-urlencoded' if no files are added, and switch to multipart/form-data if files are added."Calling this function after using r will raise an error.Examples {-# LANGUAGE OverloadedStrings #-} post $ do addPostParam "key" "value"X yesod-testAdd a parameter with the given name and value to the query string.Examples {-# LANGUAGE OverloadedStrings #-} request $ do addGetParam "key" "value" -- Adds ?key=value to the URLY yesod-test1Add a file to be posted with the current request.Adding a file will automatically change your request content-type to be multipart/form-data.Examples request $ do addFile "profile_picture" "static/img/picture.png" "img/png"Z yesod-test Finds the