sandwich-webdriver 0.4.0.1 → 0.4.0.2
raw patch · 4 files changed
+24/−17 lines, 4 filesdep −data-defaultdep −microlens-aesondep −monad-controlPVP ok
version bump matches the API change (PVP)
Dependencies removed: data-default, microlens-aeson, monad-control, network, vector
API changes (from Hackage documentation)
Files
- CHANGELOG.md +4/−0
- sandwich-webdriver.cabal +1/−11
- src/Test/Sandwich/WebDriver.hs +9/−0
- test/Spec.hs +10/−6
CHANGELOG.md view
@@ -1,5 +1,9 @@ # Changelog for sandwich-webdriver +# 0.4.0.2++* Support `webdriver-0.14.0.0`.+ # 0.4.0.1 * Fix accidental mismatch in a couple fields with base sandwich package.
sandwich-webdriver.cabal view
@@ -5,7 +5,7 @@ -- see: https://github.com/sol/hpack name: sandwich-webdriver-version: 0.4.0.1+version: 0.4.0.2 synopsis: Sandwich integration with Selenium WebDriver description: Please see the <https://codedownio.github.io/sandwich/docs/extensions/sandwich-webdriver documentation>. category: Testing@@ -79,7 +79,6 @@ , base <5 , bytestring , containers- , data-default , directory , exceptions , filepath@@ -88,11 +87,8 @@ , http-conduit , http-types , microlens- , microlens-aeson- , monad-control , monad-logger , mtl- , network , process , random , retry@@ -107,7 +103,6 @@ , unliftio , unliftio-core , unordered-containers- , vector , webdriver >=0.13.0.0 default-language: Haskell2010 if os(darwin)@@ -164,7 +159,6 @@ , base <5 , bytestring , containers- , data-default , directory , exceptions , filepath@@ -173,11 +167,8 @@ , http-conduit , http-types , microlens- , microlens-aeson- , monad-control , monad-logger , mtl- , network , process , random , retry@@ -193,7 +184,6 @@ , unliftio , unliftio-core , unordered-containers- , vector , webdriver >=0.13.0.0 default-language: Haskell2010 if os(darwin)
src/Test/Sandwich/WebDriver.hs view
@@ -1,3 +1,4 @@+{-# LANGUAGE CPP #-} {-# LANGUAGE DataKinds #-} {-# LANGUAGE TypeApplications #-} {-# LANGUAGE TypeOperators #-}@@ -201,7 +202,11 @@ let driverConfig = W.DriverConfigChromedriver { driverConfigChromedriver = browserDependenciesChromeChromedriver , driverConfigChrome = browserDependenciesChromeChrome+#if MIN_VERSION_webdriver(0,14,0)+ , driverConfigLogDir = Just runRoot+#else , driverConfigLogDir = runRoot+#endif , driverConfigChromedriverFlags = chromedriverExtraFlags wdOptions } return (caps, driverConfig)@@ -219,7 +224,11 @@ let driverConfig = W.DriverConfigGeckodriver { driverConfigGeckodriver = browserDependenciesFirefoxGeckodriver , driverConfigFirefox = browserDependenciesFirefoxFirefox+#if MIN_VERSION_webdriver(0,14,0)+ , driverConfigLogDir = Just runRoot+#else , driverConfigLogDir = runRoot+#endif , driverConfigGeckodriverFlags = "--profile-root" : profileRootDir : geckodriverExtraFlags wdOptions -- , driverConfigGeckodriverFlags = geckodriverExtraFlags wdOptions }
test/Spec.hs view
@@ -10,6 +10,7 @@ import System.FilePath import Test.WebDriver.Commands import Test.Sandwich.WebDriver+import Test.Sandwich.Waits import Control.Monad.IO.Class import qualified Data.ByteString.Lazy as BL @@ -22,12 +23,15 @@ spec :: TopSpecWithOptions spec = introduceNixContext (nixpkgsRelease2405 { nixpkgsDerivationAllowUnfree = True }) $ introduceWebDriverViaNix defaultWdOptions $ do- it "opens Google and searches" $ withSession1 $ do- openPage [i|https://www.google.com|]- search <- findElem (ByCSS [i|*[title="Search"]|])- click search- sendKeys "Haskell Sandwich" search- findElem (ByCSS [i|input[type="submit"]|]) >>= click+ it "opens Xkcd and presses the prev button" $ withSession1 $ do+ openPage [i|https://www.xkcd.com|]+ origUrl <- getCurrentURL+ prev <- findElem (ByCSS [i|a[rel=prev]|])+ click prev++ waitUntil 30 $ do+ url <- getCurrentURL+ url `shouldNotBe` origUrl Just dir <- getCurrentFolder screenshot >>= liftIO . BL.writeFile (dir </> "screenshot.png")