Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
This is a helper module for Webdriver
to let you use Yesod
routes to define webdriver tests.
Synopsis
- webdriverYesodSpec :: YesodDispatch app => (Manager -> SetupFunc app) -> WebdriverSpec app -> Spec
- openRoute :: RenderRoute app => Route app -> WebdriverTestM app ()
- openRouteWithParams :: RenderRoute app => Route app -> [(Text, Text)] -> WebdriverTestM app ()
- getCurrentRoute :: ParseRoute app => WebdriverTestM app (Route app)
- currentRouteShouldBe :: (Show (Route app), ParseRoute app) => Route app -> WebdriverTestM app ()
- getLinkTextI :: RenderMessage app message => message -> WebdriverTestM app Text
- findElemByLinkTextI :: RenderMessage app message => message -> WebdriverTestM app Element
- findElemByPartialLinkTextI :: RenderMessage app message => message -> WebdriverTestM app Element
- findElemByButtonTextI :: RenderMessage app message => message -> WebdriverTestM app Element
Defining webdriver tests with yesod
webdriverYesodSpec :: YesodDispatch app => (Manager -> SetupFunc app) -> WebdriverSpec app -> Spec Source #
Run webdriver tests given a SetupFunc
for your app.
Implementing webdriver tests with yesod
openRoute :: RenderRoute app => Route app -> WebdriverTestM app () Source #
Open a given yesod Route
openRouteWithParams :: RenderRoute app => Route app -> [(Text, Text)] -> WebdriverTestM app () Source #
Open a given yesod Route
with parameters
getCurrentRoute :: ParseRoute app => WebdriverTestM app (Route app) Source #
Get the current Route
currentRouteShouldBe :: (Show (Route app), ParseRoute app) => Route app -> WebdriverTestM app () Source #
Get the current Route
and check that it equals the given route
Finding elements by I18N Messages
getLinkTextI :: RenderMessage app message => message -> WebdriverTestM app Text Source #
Get the link text for a given I18N message.
This will only work if the language hasn't been set.
findElemByLinkTextI :: RenderMessage app message => message -> WebdriverTestM app Element Source #
Find an Element
, ByLinkText
the text obtained by getLinkTextI
findElemByPartialLinkTextI :: RenderMessage app message => message -> WebdriverTestM app Element Source #
Find an Element
, ByPartialLinkText
the text obtained by getLinkTextI
findElemByButtonTextI :: RenderMessage app message => message -> WebdriverTestM app Element Source #
Find an Element
, ByLinkText
the text obtained by getLinkTextI