sandwich-webdriver 0.2.1.0 → 0.2.2.0
raw patch · 19 files changed
+59/−93 lines, 19 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- CHANGELOG.md +4/−0
- app/Main.hs +1/−3
- app/Simple.hs +1/−1
- darwin-src/Test/Sandwich/WebDriver/Resolution.hs +0/−3
- linux-src/Test/Sandwich/WebDriver/Resolution.hs +0/−3
- sandwich-webdriver.cabal +26/−14
- src/Test/Sandwich/WebDriver.hs +14/−12
- src/Test/Sandwich/WebDriver/Internal/Action.hs +1/−1
- src/Test/Sandwich/WebDriver/Internal/Binaries.hs +0/−3
- src/Test/Sandwich/WebDriver/Internal/Binaries/Util.hs +0/−5
- src/Test/Sandwich/WebDriver/Internal/Capabilities.hs +11/−13
- src/Test/Sandwich/WebDriver/Internal/StartWebDriver.hs +0/−8
- src/Test/Sandwich/WebDriver/Internal/Types.hs +0/−4
- src/Test/Sandwich/WebDriver/Internal/Util.hs +0/−5
- src/Test/Sandwich/WebDriver/Internal/Video.hs +1/−1
- src/Test/Sandwich/WebDriver/Video.hs +0/−6
- src/Test/Sandwich/WebDriver/Windows.hs +0/−1
- unix-src/Test/Sandwich/WebDriver/Internal/StartWebDriver/Xvfb.hs +0/−7
- windows-src/Test/Sandwich/WebDriver/Resolution.hsc +0/−3
CHANGELOG.md view
@@ -2,6 +2,10 @@ # Unreleased +# 0.2.2.0++* Fix browser path calculation in addCommandLineOptionsToWdOptions+ # 0.2.1.0 * Pass `--headless=new` instead of `--headless` for Chrome >= 110, to address https://www.selenium.dev/blog/2023/headless-is-going-away/.
app/Main.hs view
@@ -1,7 +1,5 @@ {-# LANGUAGE TypeOperators #-} {-# LANGUAGE DataKinds #-}-{-# LANGUAGE OverloadedStrings #-}-{-# LANGUAGE QuasiQuotes #-} {-# LANGUAGE CPP #-} module Main where@@ -27,7 +25,7 @@ it "does the thing 1" $ withSession1 $ do openPage "http://www.google.com" setWindowLeftSide- search <- findElem (ByCSS [i|input[title="Search"]|])+ search <- findElem (ByCSS [i|*[title="Search"]|]) click search sendKeys "asdf" search liftIO $ threadDelay 1000000
app/Simple.hs view
@@ -14,7 +14,7 @@ spec = introduceWebDriver wdOptions $ do it "opens Google and searches" $ withSession1 $ do openPage "http://www.google.com"- search <- findElem (ByCSS "input[title='Search']")+ search <- findElem (ByCSS "*[title='Search']") click search sendKeys "asdf\n" search
darwin-src/Test/Sandwich/WebDriver/Resolution.hs view
@@ -1,6 +1,3 @@-{-# LANGUAGE QuasiQuotes #-}-{-# LANGUAGE MultiWayIf #-}-{-# LANGUAGE ViewPatterns #-} module Test.Sandwich.WebDriver.Resolution ( getResolution
linux-src/Test/Sandwich/WebDriver/Resolution.hs view
@@ -1,6 +1,3 @@-{-# LANGUAGE QuasiQuotes #-}-{-# LANGUAGE MultiWayIf #-}-{-# LANGUAGE ViewPatterns #-} module Test.Sandwich.WebDriver.Resolution ( getResolution
sandwich-webdriver.cabal view
@@ -1,11 +1,11 @@ cabal-version: 1.12 --- This file has been generated from package.yaml by hpack version 0.35.1.+-- This file has been generated from package.yaml by hpack version 0.35.2. -- -- see: https://github.com/sol/hpack name: sandwich-webdriver-version: 0.2.1.0+version: 0.2.2.0 synopsis: Sandwich integration with Selenium WebDriver description: Please see the <https://codedownio.github.io/sandwich/docs/extensions/sandwich-webdriver documentation>. category: Testing@@ -47,14 +47,18 @@ hs-source-dirs: src default-extensions:+ FlexibleContexts+ FlexibleInstances+ LambdaCase+ MultiParamTypeClasses+ MultiWayIf+ NamedFieldPuns+ NumericUnderscores OverloadedStrings QuasiQuotes- NamedFieldPuns RecordWildCards ScopedTypeVariables- FlexibleContexts- FlexibleInstances- LambdaCase+ ViewPatterns ghc-options: -W build-depends: aeson@@ -119,14 +123,18 @@ hs-source-dirs: app default-extensions:+ FlexibleContexts+ FlexibleInstances+ LambdaCase+ MultiParamTypeClasses+ MultiWayIf+ NamedFieldPuns+ NumericUnderscores OverloadedStrings QuasiQuotes- NamedFieldPuns RecordWildCards ScopedTypeVariables- FlexibleContexts- FlexibleInstances- LambdaCase+ ViewPatterns ghc-options: -threaded -rtsopts -with-rtsopts=-N build-depends: aeson@@ -193,14 +201,18 @@ hs-source-dirs: test default-extensions:+ FlexibleContexts+ FlexibleInstances+ LambdaCase+ MultiParamTypeClasses+ MultiWayIf+ NamedFieldPuns+ NumericUnderscores OverloadedStrings QuasiQuotes- NamedFieldPuns RecordWildCards ScopedTypeVariables- FlexibleContexts- FlexibleInstances- LambdaCase+ ViewPatterns ghc-options: -threaded -rtsopts -with-rtsopts=-N build-depends: aeson
src/Test/Sandwich/WebDriver.hs view
@@ -1,12 +1,5 @@-{-# LANGUAGE QuasiQuotes #-}-{-# LANGUAGE ScopedTypeVariables #-}-{-# LANGUAGE NamedFieldPuns #-} {-# LANGUAGE TypeOperators #-}-{-# LANGUAGE LambdaCase #-} {-# LANGUAGE DataKinds #-}-{-# LANGUAGE MultiParamTypeClasses #-}-{-# LANGUAGE RecordWildCards #-}-{-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE AllowAmbiguousTypes #-} {-# LANGUAGE TypeApplications #-} @@ -140,9 +133,14 @@ addCommandLineOptionsToWdOptions :: CommandLineOptions a -> WdOptions -> WdOptions addCommandLineOptionsToWdOptions (CommandLineOptions {optWebdriverOptions=(CommandLineWebdriverOptions {..})}) wdOptions@(WdOptions {..}) = wdOptions { capabilities = case optFirefox of- Nothing -> capabilities- Just UseFirefox -> firefoxCapabilities firefoxBinaryPath- Just UseChrome -> chromeCapabilities chromeBinaryPath+ Just UseFirefox -> firefoxCapabilities fbp+ Just UseChrome -> chromeCapabilities cbp+ Nothing -> case cbp of+ Just p -> chromeCapabilities (Just p)+ Nothing -> case fbp of+ Just p -> firefoxCapabilities (Just p)+ Nothing -> capabilities+ , runMode = case optDisplay of Nothing -> runMode Just Headless -> RunHeadless defaultHeadlessConfig@@ -151,9 +149,13 @@ , seleniumToUse = maybe seleniumToUse UseSeleniumAt optSeleniumJar - , chromeBinaryPath = optChromeBinary <|> chromeBinaryPath+ , chromeBinaryPath = cbp , chromeDriverToUse = maybe chromeDriverToUse UseChromeDriverAt optChromeDriver - , firefoxBinaryPath = optFirefoxBinary <|> firefoxBinaryPath+ , firefoxBinaryPath = fbp , geckoDriverToUse = maybe geckoDriverToUse UseGeckoDriverAt optGeckoDriver }++ where+ cbp = optChromeBinary <|> chromeBinaryPath+ fbp = optFirefoxBinary <|> firefoxBinaryPath
src/Test/Sandwich/WebDriver/Internal/Action.hs view
@@ -1,4 +1,4 @@-{-# LANGUAGE ViewPatterns, LambdaCase, QuasiQuotes, RecordWildCards, NamedFieldPuns, ScopedTypeVariables, DataKinds #-}+{-# LANGUAGE DataKinds #-} module Test.Sandwich.WebDriver.Internal.Action where
src/Test/Sandwich/WebDriver/Internal/Binaries.hs view
@@ -1,8 +1,5 @@ {-# LANGUAGE ConstraintKinds #-} {-# LANGUAGE CPP #-}-{-# LANGUAGE QuasiQuotes #-}-{-# LANGUAGE ScopedTypeVariables #-}-{-# LANGUAGE NamedFieldPuns #-} {-# LANGUAGE Rank2Types #-} module Test.Sandwich.WebDriver.Internal.Binaries (
src/Test/Sandwich/WebDriver/Internal/Binaries/Util.hs view
@@ -1,9 +1,4 @@ {-# LANGUAGE CPP #-}-{-# LANGUAGE QuasiQuotes #-}-{-# LANGUAGE ScopedTypeVariables #-}-{-# LANGUAGE NamedFieldPuns #-}-{-# LANGUAGE OverloadedStrings #-}-{-# LANGUAGE ViewPatterns #-} module Test.Sandwich.WebDriver.Internal.Binaries.Util ( detectPlatform
src/Test/Sandwich/WebDriver/Internal/Capabilities.hs view
@@ -32,21 +32,19 @@ -- | Default capabilities for regular Chrome. -- Has the "browser" log level to "ALL" so that tests can collect browser logs. chromeCapabilities :: Maybe FilePath -> Capabilities-chromeCapabilities maybeChromePath =- def {browser=Chrome Nothing maybeChromePath args [] mempty- , additionalCaps=[("loggingPrefs", loggingPrefs)- , ("goog:loggingPrefs", loggingPrefs)]- }- where args = ["--verbose"]+chromeCapabilities maybeChromePath = def {+ browser = Chrome Nothing maybeChromePath ["--verbose"] [] mempty+ , additionalCaps=[("loggingPrefs", loggingPrefs)+ , ("goog:loggingPrefs", loggingPrefs)]+ } -- | Default capabilities for headless Chrome. headlessChromeCapabilities :: Maybe FilePath -> Capabilities-headlessChromeCapabilities maybeChromePath =- def {browser=Chrome Nothing maybeChromePath args [] mempty- , additionalCaps=[("loggingPrefs", loggingPrefs)- , ("goog:loggingPrefs", loggingPrefs)]- }- where args = ["--verbose", "--headless"]+headlessChromeCapabilities maybeChromePath = def {+ browser = Chrome Nothing maybeChromePath ["--verbose", "--headless"] [] mempty+ , additionalCaps=[("loggingPrefs", loggingPrefs)+ , ("goog:loggingPrefs", loggingPrefs)]+ } -- * Firefox @@ -61,7 +59,7 @@ -- | Default capabilities for regular Firefox. firefoxCapabilities :: Maybe FilePath -> Capabilities-firefoxCapabilities maybeFirefoxPath = def { browser=ff }+firefoxCapabilities maybeFirefoxPath = def { browser = ff } where ff = Firefox { ffProfile = Nothing , ffLogPref = LogAll
src/Test/Sandwich/WebDriver/Internal/StartWebDriver.hs view
@@ -1,17 +1,9 @@ {-# LANGUAGE ConstraintKinds #-} {-# LANGUAGE CPP #-}-{-# LANGUAGE QuasiQuotes #-}-{-# LANGUAGE ScopedTypeVariables #-}-{-# LANGUAGE NamedFieldPuns #-} {-# LANGUAGE TypeOperators #-}-{-# LANGUAGE LambdaCase #-} {-# LANGUAGE DataKinds #-} {-# LANGUAGE UndecidableInstances #-}-{-# LANGUAGE MultiParamTypeClasses #-}-{-# LANGUAGE RecordWildCards #-}-{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE OverloadedLists #-}-{-# LANGUAGE ViewPatterns #-} module Test.Sandwich.WebDriver.Internal.StartWebDriver where
src/Test/Sandwich/WebDriver/Internal/Types.hs view
@@ -1,10 +1,6 @@ {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE InstanceSigs #-}-{-# LANGUAGE RecordWildCards #-}-{-# LANGUAGE ScopedTypeVariables #-}-{-# LANGUAGE QuasiQuotes #-} {-# LANGUAGE Rank2Types #-}-{-# LANGUAGE NamedFieldPuns #-} {-# LANGUAGE DataKinds #-} {-# LANGUAGE ConstraintKinds #-}
src/Test/Sandwich/WebDriver/Internal/Util.hs view
@@ -1,9 +1,4 @@ {-# LANGUAGE CPP #-}-{-# LANGUAGE QuasiQuotes #-}-{-# LANGUAGE ScopedTypeVariables #-}-{-# LANGUAGE NamedFieldPuns #-}-{-# LANGUAGE FlexibleContexts #-}-{-# LANGUAGE NumericUnderscores #-} module Test.Sandwich.WebDriver.Internal.Util where
src/Test/Sandwich/WebDriver/Internal/Video.hs view
@@ -1,4 +1,4 @@-{-# LANGUAGE CPP, QuasiQuotes, ScopedTypeVariables, FlexibleContexts, OverloadedStrings, NamedFieldPuns, ViewPatterns #-}+{-# LANGUAGE CPP #-} module Test.Sandwich.WebDriver.Internal.Video where
src/Test/Sandwich/WebDriver/Video.hs view
@@ -1,10 +1,4 @@ {-# LANGUAGE CPP #-}-{-# LANGUAGE QuasiQuotes #-}-{-# LANGUAGE ScopedTypeVariables #-}-{-# LANGUAGE FlexibleContexts #-}-{-# LANGUAGE OverloadedStrings #-}-{-# LANGUAGE NamedFieldPuns #-}-{-# LANGUAGE ViewPatterns #-} {-# LANGUAGE ConstraintKinds #-} module Test.Sandwich.WebDriver.Video (
src/Test/Sandwich/WebDriver/Windows.hs view
@@ -1,6 +1,5 @@ -- | Functions for manipulating browser windows. -{-# LANGUAGE QuasiQuotes #-} module Test.Sandwich.WebDriver.Windows ( -- * Window positioning
unix-src/Test/Sandwich/WebDriver/Internal/StartWebDriver/Xvfb.hs view
@@ -1,15 +1,8 @@ {-# LANGUAGE ConstraintKinds #-} {-# LANGUAGE CPP #-}-{-# LANGUAGE QuasiQuotes #-}-{-# LANGUAGE ScopedTypeVariables #-}-{-# LANGUAGE NamedFieldPuns #-} {-# LANGUAGE TypeOperators #-}-{-# LANGUAGE LambdaCase #-} {-# LANGUAGE DataKinds #-} {-# LANGUAGE UndecidableInstances #-}-{-# LANGUAGE MultiParamTypeClasses #-}-{-# LANGUAGE RecordWildCards #-}-{-# LANGUAGE OverloadedStrings #-} module Test.Sandwich.WebDriver.Internal.StartWebDriver.Xvfb ( makeXvfbSession
windows-src/Test/Sandwich/WebDriver/Resolution.hsc view
@@ -1,6 +1,3 @@-{-# LANGUAGE QuasiQuotes #-}-{-# LANGUAGE MultiWayIf #-}-{-# LANGUAGE ViewPatterns #-} module Test.Sandwich.WebDriver.Resolution ( getResolution