User provided chromium path

This commit is contained in:
Tom Smalley 2020-06-03 16:05:12 +01:00
parent ebb6d2c08b
commit 2266870cb6
2 changed files with 4 additions and 40 deletions

View File

@ -14,47 +14,17 @@ Build-type: Simple
library
hs-source-dirs: src
build-depends:
-- aeson >= 0.8 && < 1.5,
async,
base >= 4.7 && < 4.14,
-- bifunctors >= 4.2 && < 6,
-- bimap >= 0.3 && < 0.4,
-- blaze-builder >= 0.4.1 && < 0.5,
bytestring == 0.10.*,
chrome-test-utils,
-- case-insensitive < 1.3,
-- containers >= 0.6 && < 0.7,
-- constraints >= 0.9 && < 0.12,
-- contravariant >= 1.4 && < 1.6,
-- data-default >= 0.5 && < 0.8,
-- dependent-map >= 0.3 && < 0.4,
-- dependent-sum >= 0.6 && < 0.7,
-- dependent-sum-template >= 0.1 && < 0.2,
-- directory >= 1.2 && < 1.4,
exceptions,
-- exception-transformers == 0.4.*
-- ghcjs-dom >= 0.9.1.0 && < 0.10,
jsaddle >= 0.9.0.0 && < 0.10,
jsaddle-warp,
http-types,
network,
-- process,
-- chrome-test-utils,
-- async,
-- -- keycode-0.2 has a bug on firefox
-- keycode >= 0.2.1 && < 0.3,
-- lens >= 4.7 && < 5,
-- monad-control >= 1.0.1 && < 1.1,
-- mtl >= 2.1 && < 2.3,
-- primitive >= 0.5 && < 0.8,
-- random >= 1.1 && < 1.2,
-- ref-tf == 0.4.*,
-- reflex >= 0.6.2 && < 0.8,
reflex-dom-core,
process,
which,
-- semigroups >= 0.16 && < 0.20,
-- stm >= 2.4 && < 2.6,
silently,
wai,
warp,
@ -62,10 +32,6 @@ library
websockets,
hspec-webdriver,
webdriver
-- transformers >= 0.3 && < 0.6,
-- network-uri >= 2.6.1 && < 2.7,
-- webdriver,
-- zenc == 0.1.*
exposed-modules:
Reflex.Dom.Test.Screenshot

View File

@ -32,7 +32,6 @@ import Reflex.Dom.Core
import System.IO (stderr)
import System.IO.Silently (hSilence)
import System.Process (std_in, std_out, std_err, createProcess, proc, StdStream (..), terminateProcess)
import System.Which (staticWhich)
import qualified Data.Text as T
import qualified Control.Concurrent.Async as Async
@ -50,13 +49,15 @@ import qualified Test.WebDriver.Capabilities as WD
deriving instance MonadMask WD
testWithSelenium
:: Bool
:: FilePath
-- ^ Path to the chromium executable
-> Bool
-- ^ True means that the browser is invoked in headless mode, False means that
-- the user can see the interaction happening on the browser (useful for debugging).
-> SpecWith (WdTestSession a)
-- ^ The tests we want to write in the selenium session
-> IO ()
testWithSelenium isHeadless actualTests = do
testWithSelenium chromium isHeadless actualTests = do
handle (\(_ :: IOError) -> return ()) $ unshareNetork -- If we run into an exception with sandboxing, just don't bother
withSandboxedChromeFlags isHeadless $ \chromeFlags -> do
withSeleniumServer $ \selenium -> do
@ -93,9 +94,6 @@ withSeleniumServer f = do
, _selenium_stopServer = stopServer
}
chromium :: FilePath
chromium = $(staticWhich "chromium")
chromeConfig :: Text -> [Text] -> WD.WDConfig
chromeConfig fp flags =
WD.useBrowser