#ifndef CABAL_BUILD_DEVELOPER
#endif
module Test.WebDriver.Class
(
WebDriver(..), Method, methodDelete, methodGet, methodPost,
) where
import Test.WebDriver.Session
import Data.Aeson
import Data.Text (Text)
import Network.HTTP.Types.Method (methodDelete, methodGet, methodPost, Method)
import Control.Monad.Trans.Class
import Control.Monad.Trans.Maybe
import Control.Monad.Trans.Identity
import Control.Monad.Trans.List
import Control.Monad.Trans.Reader
import Control.Monad.Trans.Error
import Control.Monad.Trans.Writer.Strict as SW
import Control.Monad.Trans.Writer.Lazy as LW
import Control.Monad.Trans.State.Strict as SS
import Control.Monad.Trans.State.Lazy as LS
import Control.Monad.Trans.RWS.Strict as SRWS
import Control.Monad.Trans.RWS.Lazy as LRWS
class (WDSessionStateControl wd) => WebDriver wd where
doCommand :: (ToJSON a, FromJSON b) =>
Method
-> Text
-> a
-> wd b
instance WebDriver wd => WebDriver (SS.StateT s wd) where
doCommand rm t a = lift (doCommand rm t a)
instance WebDriver wd => WebDriver (LS.StateT s wd) where
doCommand rm t a = lift (doCommand rm t a)
instance WebDriver wd => WebDriver (MaybeT wd) where
doCommand rm t a = lift (doCommand rm t a)
instance WebDriver wd => WebDriver (IdentityT wd) where
doCommand rm t a = lift (doCommand rm t a)
instance WebDriver wd => WebDriver (ListT wd) where
doCommand rm t a = lift (doCommand rm t a)
instance (Monoid w, WebDriver wd) => WebDriver (LW.WriterT w wd) where
doCommand rm t a = lift (doCommand rm t a)
instance (Monoid w, WebDriver wd) => WebDriver (SW.WriterT w wd) where
doCommand rm t a = lift (doCommand rm t a)
instance WebDriver wd => WebDriver (ReaderT r wd) where
doCommand rm t a = lift (doCommand rm t a)
instance (Error e, WebDriver wd) => WebDriver (ErrorT e wd) where
doCommand rm t a = lift (doCommand rm t a)
instance (Monoid w, WebDriver wd) => WebDriver (SRWS.RWST r w s wd) where
doCommand rm t a = lift (doCommand rm t a)
instance (Monoid w, WebDriver wd) => WebDriver (LRWS.RWST r w s wd) where
doCommand rm t a = lift (doCommand rm t a)