on develop help sign in
User provided chromium path
commit2266870cb6fe4d2ed011a79d95528fcfbcb9ae8a authorTom Smalley <tfsmalley@gmail.com> dateWed 3 Jun 2020, 16:05 (6 years ago) parentebb6d2c
2 files changed+4−40
reflex-dom-test-selenium/reflex-dom-test-selenium.cabal−34 reflex-dom-test-selenium/src/Reflex/Dom/Test/Screenshot.hs+4−6
reflex-dom-test-selenium/reflex-dom-test-selenium.cabal−34
@@ -14,47 +14,17 @@ Build-type: Simple
1414library
1515 hs-source-dirs: src
1616 build-depends:
17− -- aeson >= 0.8 && < 1.5,
1817 async,
1918 base >= 4.7 && < 4.14,
20− -- bifunctors >= 4.2 && < 6,
21− -- bimap >= 0.3 && < 0.4,
22− -- blaze-builder >= 0.4.1 && < 0.5,
2319 bytestring == 0.10.*,
2420 chrome-test-utils,
25− -- case-insensitive < 1.3,
26− -- containers >= 0.6 && < 0.7,
27− -- constraints >= 0.9 && < 0.12,
28− -- contravariant >= 1.4 && < 1.6,
29− -- data-default >= 0.5 && < 0.8,
30− -- dependent-map >= 0.3 && < 0.4,
31− -- dependent-sum >= 0.6 && < 0.7,
32− -- dependent-sum-template >= 0.1 && < 0.2,
33− -- directory >= 1.2 && < 1.4,
3421 exceptions,
35− -- exception-transformers == 0.4.*
36− -- ghcjs-dom >= 0.9.1.0 && < 0.10,
3722 jsaddle >= 0.9.0.0 && < 0.10,
3823 jsaddle-warp,
3924 http-types,
4025 network,
41− -- process,
42− -- chrome-test-utils,
43− -- async,
44− -- -- keycode-0.2 has a bug on firefox
45− -- keycode >= 0.2.1 && < 0.3,
46− -- lens >= 4.7 && < 5,
47− -- monad-control >= 1.0.1 && < 1.1,
48− -- mtl >= 2.1 && < 2.3,
49− -- primitive >= 0.5 && < 0.8,
50− -- random >= 1.1 && < 1.2,
51− -- ref-tf == 0.4.*,
52− -- reflex >= 0.6.2 && < 0.8,
5326 reflex-dom-core,
5427 process,
55− which,
56− -- semigroups >= 0.16 && < 0.20,
57− -- stm >= 2.4 && < 2.6,
5828 silently,
5929 wai,
6030 warp,
@@ -62,10 +32,6 @@ library
6232 websockets,
6333 hspec-webdriver,
6434 webdriver
65− -- transformers >= 0.3 && < 0.6,
66− -- network-uri >= 2.6.1 && < 2.7,
67− -- webdriver,
68− -- zenc == 0.1.*
6935
7036 exposed-modules:
7137 Reflex.Dom.Test.Screenshot
reflex-dom-test-selenium/src/Reflex/Dom/Test/Screenshot.hs+4−6
@@ -32,7 +32,6 @@ import Reflex.Dom.Core
3232import System.IO (stderr)
3333import System.IO.Silently (hSilence)
3434import System.Process (std_in, std_out, std_err, createProcess, proc, StdStream (..), terminateProcess)
35−import System.Which (staticWhich)
3635import qualified Data.Text as T
3736
3837import qualified Control.Concurrent.Async as Async
@@ -50,13 +49,15 @@ import qualified Test.WebDriver.Capabilities as WD
5049deriving instance MonadMask WD
5150
5251testWithSelenium
53− :: Bool
52+ :: FilePath
53+ -- ^ Path to the chromium executable
54+ -> Bool
5455 -- ^ True means that the browser is invoked in headless mode, False means that
5556 -- the user can see the interaction happening on the browser (useful for debugging).
5657 -> SpecWith (WdTestSession a)
5758 -- ^ The tests we want to write in the selenium session
5859 -> IO ()
59−testWithSelenium isHeadless actualTests = do
60+testWithSelenium chromium isHeadless actualTests = do
6061 handle (\(_ :: IOError) -> return ()) $ unshareNetork -- If we run into an exception with sandboxing, just don't bother
6162 withSandboxedChromeFlags isHeadless $ \chromeFlags -> do
6263 withSeleniumServer $ \selenium -> do
@@ -93,9 +94,6 @@ withSeleniumServer f = do
9394 , _selenium_stopServer = stopServer
9495 }
9596
96−chromium :: FilePath
97−chromium = $(staticWhich "chromium")
98−
9997chromeConfig :: Text -> [Text] -> WD.WDConfig
10098chromeConfig fp flags =
10199 WD.useBrowser