@@ -1,12 +1,11 @@
1−{-# language OverloadedStrings #-}
1+{-# LANGUAGE OverloadedStrings #-}
2+{-# LANGUAGE ScopedTypeVariables #-}
3module Servant.ReflexSpec where
4module Servant.ReflexSpec where
5import Control.Concurrent (threadDelay)
6import Control.Concurrent (threadDelay)
6import Control.Monad.IO.Class (liftIO)
7import Control.Monad.IO.Class (liftIO)
7−import Data.Monoid ((<>))
8import qualified Data.Text as T
8import qualified Data.Text as T
10import Test.WebDriver.Commands.Wait
9import Test.WebDriver.Commands.Wait
11import Test.Hspec.WebDriver
10import Test.Hspec.WebDriver
@@ -48,9 +47,9 @@ spec = do
48 it "can get an int or unit from the API" $ runWD $ do
47 it "can get an int or unit from the API" $ runWD $ do
49 let outEl = ByCSS "div.unit-int-response p"
48 let outEl = ByCSS "div.unit-int-response p"
50 clickingShouldCause (ByCSS "div.int-button > button") outEl 0.1
49 clickingShouldCause (ByCSS "div.int-button > button") outEl 0.1
51− (\i o -> o `hasInfixText` "Just \"100\"")
50+ (\_ o -> o `hasInfixText` "Just \"100\"")
52 clickingShouldCause (ByCSS "div.unit-button > button") outEl 0.1
51 clickingShouldCause (ByCSS "div.unit-button > button") outEl 0.1
53− (\i o -> o `hasInfixText` "Just \"[[]]\"")
52+ (\_ o -> o `hasInfixText` "Just \"[[]]\"")
55 let setupGreeting = do
54 let setupGreeting = do
56 iName <- findElem $ ByCSS ".name-input input"
55 iName <- findElem $ ByCSS ".name-input input"
@@ -61,14 +60,14 @@ spec = do
61 return (iName, iGreetings, bGusto, goBtn, greetingRes)
60 return (iName, iGreetings, bGusto, goBtn, greetingRes)
63 it "handle query params" $ runWD $ do
62 it "handle query params" $ runWD $ do
64− (iName, iGreetings, bGusto, goBtn, greetingRes) <- setupGreeting
63+ (iName, iGreetings, _bGusto, goBtn, greetingRes) <- setupGreeting
65 sendKeys "Haskell" iName
64 sendKeys "Haskell" iName
66 sendKeys "Hello Hi" iGreetings
65 sendKeys "Hello Hi" iGreetings
67 click goBtn
66 click goBtn
68 greetingRes `shouldHaveText` "Hello, and Hi, Haskell"
67 greetingRes `shouldHaveText` "Hello, and Hi, Haskell"
70 it "handles queryflag" $ runWD $ do
69 it "handles queryflag" $ runWD $ do
71− (iName, iGreetings, bGusto, goBtn, greetingRes) <- setupGreeting
70+ (_iName, _iGreetings, bGusto, goBtn, greetingRes) <- setupGreeting
72 click bGusto
71 click bGusto
73 click goBtn
72 click goBtn
74 greetingRes `shouldHaveText` "HELLO, AND HI, HASKELL"
73 greetingRes `shouldHaveText` "HELLO, AND HI, HASKELL"