@@ -154,13 +154,13 @@ main = do
154154 withDebugging <- isNothing <$> lookupEnv "NO_DEBUG"
155155 let wdConfig = WD.defaultConfig { WD.wdPort = fromIntegral $ _selenium_portNumber selenium }
156156 chromeCaps' = WD.getCaps $ chromeConfig browserPath chromeFlags
157− hspec (tests withDebugging wdConfig [chromeCaps'] selenium) `finally` _selenium_stopServer selenium
157+ hspec (tests withDebugging wdConfig [(chromeCaps', "chrome")] selenium) `finally` _selenium_stopServer selenium
158158
159−tests :: Bool -> WD.WDConfig -> [Capabilities] -> Selenium -> Spec
159+tests :: Bool -> WD.WDConfig -> [(Capabilities, String)] -> Selenium -> Spec
160160tests withDebugging wdConfig caps _selenium = do
161161 let putStrLnDebug :: MonadIO m => Text -> m ()
162162 putStrLnDebug m = when withDebugging $ liftIO $ putStrLn $ T.unpack m
163− session' = sessionWith wdConfig "" . using (map (,"") caps)
163+ session' t = sessionWith wdConfig t . using caps
164164 runWD m = runWDOptions (WdOptions False) $ do
165165 putStrLnDebug "before"
166166 r <- m
@@ -172,7 +172,7 @@ tests withDebugging wdConfig caps _selenium = do
172172 testWidget = testWidgetDebug True withDebugging
173173 testWidget' :: WD a -> (a -> WD b) -> (forall m js. TestWidget js (SpiderTimeline Global) m => m ()) -> WD b
174174 testWidget' = testWidgetDebug' True withDebugging
175− describe "text" $ session' $ do
175+ session' "text" $ do
176176 it "works" $ runWD $ do
177177 testWidgetStatic (checkBodyText "hello world") $ do
178178 text "hello world"
@@ -233,7 +233,7 @@ tests withDebugging wdConfig caps _selenium = do
233233 click <- button ""
234234 void $ textNode $ TextNodeConfig "initial" $ Just $ "after" <$ click
235235
236− describe "element" $ session' $ do
236+ session' "element" $ do
237237 it "works with domEvent Click" $ runWD $ do
238238 clickedRef <- liftIO $ newRef False
239239 testWidget' (findElemWithRetry $ WD.ByTag "div") WD.click $ do
@@ -297,8 +297,8 @@ tests withDebugging wdConfig caps _selenium = do
297297 let click = domEvent Click e
298298 return ()
299299
300− describe "inputElement" $ do
301− describe "static renderer" $ session' $ do
300+ session' "inputElement" $ do
301+ describe "static renderer" $ do
302302 it "sets value attribute" $ runWD $ do
303303 let checkStatic = do
304304 e <- findElemWithRetry $ WD.ByTag "input"
@@ -355,7 +355,7 @@ tests withDebugging wdConfig caps _selenium = do
355355 & inputElementConfig_initialChecked .~ False
356356 & inputElementConfig_setChecked .~ (True <$ pb)
357357 pure ()
358− describe "hydration" $ session' $ do
358+ describe "hydration" $ do
359359 it "doesn't wipe user input when switching over" $ runWD $ do
360360 inputRef <- newRef ("hello " :: Text)
361361 testWidget'
@@ -593,8 +593,7 @@ tests withDebugging wdConfig caps _selenium = do
593593 el "p" $ dynText $ _inputElement_value e
594594 performEvent_ $ consRef valRef <$> updated (_inputElement_value e)
595595 performEvent_ $ consRef inputRef <$> _inputElement_input e
596−
597− describe "hydration/immediate" $ session' $ do
596+ describe "hydration/immediate" $ do
598597 it "captures user input after switchover" $ runWD $ do
599598 inputRef :: IORef Text <- newRef ""
600599 let checkValue = do
@@ -674,8 +673,8 @@ tests withDebugging wdConfig caps _selenium = do
674673 names <- liftJSM $ traverse File.getName fs
675674 liftIO $ writeRef filesRef names
676675
677− describe "textAreaElement" $ do
678− describe "static renderer" $ session' $ do
676+ session' "textAreaElement" $ do
677+ describe "static renderer" $ do
679678 it "sets value attribute" $ runWD $ do
680679 let checkStatic = do
681680 e <- findElemWithRetry $ WD.ByTag "textarea"
@@ -698,7 +697,7 @@ tests withDebugging wdConfig caps _selenium = do
698697 & textAreaElementConfig_initialValue .~ "test"
699698 & textAreaElementConfig_setValue .~ ("test-updated" <$ pb)
700699 pure ()
701− describe "hydration" $ session' $ do
700+ describe "hydration" $ do
702701 it "doesn't wipe user input when switching over" $ runWD $ do
703702 inputRef <- newRef ("" :: Text)
704703 testWidget'
@@ -847,7 +846,7 @@ tests withDebugging wdConfig caps _selenium = do
847846 e <- textAreaElement $ def & textAreaElementConfig_setValue .~ ("pb" <$ pb)
848847 el "p" $ dynText $ _textAreaElement_value e
849848
850− describe "hydration/immediate" $ session' $ do
849+ describe "hydration/immediate" $ do
851850 it "captures user input after switchover" $ runWD $ do
852851 inputRef :: IORef Text <- newRef ""
853852 let checkValue = do
@@ -889,13 +888,13 @@ tests withDebugging wdConfig caps _selenium = do
889888 performEvent_ $ liftIO . writeRef valueByUIRef <$> _textAreaElement_input e
890889 performEvent_ $ liftIO . writeRef valueRef <$> updated (value e)
891890
892− describe "selectElement" $ do
891+ session' "selectElement" $ do
893892 let options :: DomBuilder t m => m ()
894893 options = do
895894 elAttr "option" ("value" =: "one" <> "id" =: "one") $ text "one"
896895 elAttr "option" ("value" =: "two" <> "id" =: "two") $ text "two"
897896 elAttr "option" ("value" =: "three" <> "id" =: "three") $ text "three"
898− describe "hydration" $ session' $ do
897+ describe "hydration" $ do
899898 it "sets initial value correctly" $ runWD $ do
900899 inputRef <- newRef ("" :: Text)
901900 let setup = do
@@ -969,7 +968,7 @@ tests withDebugging wdConfig caps _selenium = do
969968 performEvent_ $ liftIO . writeRef valueByUIRef <$> _selectElement_change e
970969 performEvent_ $ liftIO . writeRef valueRef <$> updated (_selectElement_value e)
971970
972− describe "hydration/immediate" $ session' $ do
971+ describe "hydration/immediate" $ do
973972 it "captures user input after switchover" $ runWD $ do
974973 inputRef :: IORef Text <- newRef ""
975974 let checkValue = do
@@ -1015,7 +1014,7 @@ tests withDebugging wdConfig caps _selenium = do
10151014 performEvent_ $ liftIO . writeRef valueByUIRef <$> _selectElement_change e
10161015 performEvent_ $ liftIO . writeRef valueRef <$> updated (_selectElement_value e)
10171016
1018− describe "prerender" $ session' $ do
1017+ session' "prerender" $ do
10191018 it "works in simple case" $ runWD $ do
10201019 testWidget (checkBodyText "One") (checkBodyText "Two") $ do
10211020 prerender_ (text "One") (text "Two")
@@ -1084,7 +1083,7 @@ tests withDebugging wdConfig caps _selenium = do
10841083 prerender_ (pure ()) (liftIO $ trigger "Client")
10851084 textNode $ TextNodeConfig "Initial" $ Just e
10861085
1087− describe "namespaces" $ session' $ do
1086+ session' "namespaces" $ do
10881087 it "dyn can be nested in namespaced widget" $ runWD $ do
10891088 testWidget (pure ()) (checkTextInTag "svg" "one") $ do
10901089 let svgRootCfg = def
@@ -1093,7 +1092,7 @@ tests withDebugging wdConfig caps _selenium = do
10931092 void $ element "svg" svgRootCfg $ do
10941093 dyn_ $ text "one" <$ pure ()
10951094
1096− describe "runWithReplace" $ session' $ do
1095+ session' "runWithReplace" $ do
10971096 it "works" $ runWD $ do
10981097 replaceChan :: Chan Text <- liftIO newChan
10991098 let setup = findElemWithRetry $ WD.ByTag "div"
@@ -1291,7 +1290,7 @@ tests withDebugging wdConfig caps _selenium = do
12911290 _ <- runWithReplace (text "inner1") $ el "p" (text "inner2") <$ replace
12921291 text "|after"
12931292
1294− describe "traverseDMapWithKeyWithAdjust" $ session' $ do
1293+ session' "traverseDMapWithKeyWithAdjust" $ do
12951294 let widget :: DomBuilder t m => DKey a -> Identity a -> m (Identity a)
12961295 widget k (Identity v) = elAttr "li" ("id" =: textKey k) $ do
12971296 elClass "span" "key" $ text $ textKey k
@@ -1394,7 +1393,7 @@ tests withDebugging wdConfig caps _selenium = do
13941393 (dmap, _evt) <- traverseDMapWithKeyWithAdjust widget keyMap $ leftmost [postBuildPatch <$ pb, replace]
13951394 liftIO $ dmap `H.shouldBe` keyMap
13961395
1397− describe "traverseIntMapWithKeyWithAdjust" $ session' $ do
1396+ session' "traverseIntMapWithKeyWithAdjust" $ do
13981397 let textKeyInt k = "key" <> T.pack (show k)
13991398 intMap = IntMap.fromList
14001399 [ (1, "one")
@@ -1501,7 +1500,7 @@ tests withDebugging wdConfig caps _selenium = do
15011500 (dmap, _evt) <- traverseIntMapWithKeyWithAdjust widget intMap $ leftmost [postBuildPatch <$ pb, replace]
15021501 liftIO $ dmap `H.shouldBe` intMap
15031502
1504− describe "traverseDMapWithKeyWithAdjustWithMove" $ session' $ do
1503+ session' "traverseDMapWithKeyWithAdjustWithMove" $ do
15051504 let widget :: DomBuilder t m => Key2 a -> Identity a -> m (Identity a)
15061505 widget k (Identity v) = elAttr "li" ("id" =: textKey2 k) $ do
15071506 elClass "span" "key" $ text $ textKey2 k
@@ -1581,8 +1580,8 @@ tests withDebugging wdConfig caps _selenium = do
15811580 (dmap, _evt) <- traverseDMapWithKeyWithAdjustWithMove widget initMap =<< triggerEventWithChan chan
15821581 liftIO $ assertEqual "DMap" initMap dmap
15831582
1584− describe "hydrating invalid HTML" $ session' $ do
1585− it "can hydrate list in paragraph" $ runWD $ do
1583+ session' "hydrating invalid HTML" $ do
1584+ xit "can hydrate list in paragraph" $ runWD $ do
15861585 let preSwitchover = do
15871586 checkBodyText "before\ninner\nafter"
15881587 -- Two <p> tags should be present
@@ -1611,7 +1610,7 @@ tests withDebugging wdConfig caps _selenium = do
16111610 -- TODO: This test presupposes the exact set of labels that "dropdown" places in the "value" fields to distinguish options.
16121611 -- This dependence on internal implementation details is undesirable in a test case, but seems fairly tricky to avoid.
16131612 -- It seems expedient for the time being to expect this test case to be updated, should those implementation details ever change.
1614− describe "dropdown" $ session' $ do
1613+ session' "dropdown" $ do
16151614 let doTest expectedOpts (initialValue :: Text) = do
16161615 let doCheck = do
16171616 es <- findElemsWithRetry $ WD.ByTag "option"