address review comments
This commit is contained in:
parent
1bc30deee7
commit
7cd37db7c6
@ -1,6 +1,7 @@
|
||||
## 1.5.7
|
||||
|
||||
* Add clickOn
|
||||
* Add clickOn.
|
||||
[#1408](https://github.com/yesodweb/yesod/pull/1408)
|
||||
|
||||
## 1.5.6
|
||||
|
||||
|
||||
@ -831,6 +831,13 @@ setUrl url' = do
|
||||
, rbdGets = rbdGets rbd ++ H.parseQuery (TE.encodeUtf8 urlQuery)
|
||||
}
|
||||
|
||||
|
||||
-- | Click on a link defined by a CSS query
|
||||
--
|
||||
-- ==== __ Examples__
|
||||
--
|
||||
-- > get "/foobar"
|
||||
-- > clickOn "a#idofthelink"
|
||||
clickOn :: Yesod site => Query -> YesodExample site ()
|
||||
clickOn query = do
|
||||
withResponse' yedResponse ["Tried to invoke clickOn in order to read HTML of a previous response."] $ \ res ->
|
||||
|
||||
@ -174,6 +174,7 @@ main = hspec $ do
|
||||
get ("/htmlWithLink" :: Text)
|
||||
clickOn "a#thelink"
|
||||
statusIs 200
|
||||
bodyEquals "<html><head><title>Hello</title></head><body><p>Hello World</p><p>Hello Moon</p></body></html>"
|
||||
|
||||
get ("/htmlWithLink" :: Text)
|
||||
(bad :: Either SomeException ()) <- try (clickOn "a#nonexistentlink")
|
||||
|
||||
Loading…
Reference in New Issue
Block a user