packages feed

webdriver 0.10.0.0 → 0.10.0.1

raw patch · 25 files changed

+166/−111 lines, 25 files

Files

CHANGELOG.md view
@@ -1,5 +1,8 @@ # Change Log +## 0.10.0.1+* Update links to reflect this package's new home at https://github.com/haskell-webdriver/haskell-webdriver/+ ## 0.10.0.0 * Add Aeson 2 compatibility to support GHC 9.0 and 9.2 * Derive MonadMask instance for the WD monad
LICENSE view
@@ -1,5 +1,5 @@ Copyright (c) 2012-2015, Adam Curtis-Copyright (c) 2022, Tom McLaughlin+Copyright (c) 2022-2023, Tom McLaughlin All rights reserved.  Redistribution and use in source and binary forms, with or without
README.md view
@@ -1,10 +1,10 @@-[![Build Status](https://travis-ci.org/kallisti-dev/hs-webdriver.svg?branch=master)](https://travis-ci.org/kallisti-dev/hs-webdriver)  # Welcome to `webdriver`-[![Hackage](https://img.shields.io/hackage/v/webdriver.svg)](https://hackage.haskell.org/package/webdriver) ![webdriver](https://github.com/codedownio/hs-webdriver/workflows/ci/badge.svg) -hs-webdriver is a Selenium WebDriver client for the Haskell programming language. You can use it to automate browser sessions for testing, system administration, etc.+[![Hackage](https://img.shields.io/hackage/v/webdriver.svg)](https://hackage.haskell.org/package/webdriver) ![webdriver](https://github.com/haskell-webdriver/haskell-webdriver/workflows/ci/badge.svg) +haskell-webdriver is a Selenium WebDriver client for the Haskell programming language. You can use it to automate browser sessions for testing, system administration, etc.+ For more information about Selenium itself, see http://seleniumhq.org/  # Contents@@ -18,12 +18,12 @@ * [Documentation](#documentation)  # Installation-hs-webdriver uses the Cabal build system to configure, build, install, and generate documentation on multiple platforms.+haskell-webdriver uses the Cabal build system to configure, build, install, and generate documentation on multiple platforms.  For more information on using Cabal and its various installation options, see the Cabal User's Guide at http://www.haskell.org/cabal/users-guide/index.html  ## Installation from Hackage-hs-webdriver is hosted on Hackage under the name webdriver. Thus, the simplest way to download and install the most recent version of hs-webdriver is to run:+haskell-webdriver is hosted on Hackage under the name webdriver. Thus, the simplest way to download and install the most recent version of haskell-webdriver is to run:  ```sh cabal install webdriver@@ -57,16 +57,16 @@  # Getting Started -WebDriver is a client-server protocol. Since hs-webdriver only implements a WebDriver client, you must have a WebDriver server to which you can connect in order to make use of this library.+WebDriver is a client-server protocol. Since haskell-webdriver only implements a WebDriver client, you must have a WebDriver server to which you can connect in order to make use of this library.  ## Using the Selenium Server-While you can use any WebDriver server out there, probably the simplest server to use with hs-webdriver is [Selenium Server](http://docs.seleniumhq.org/download/). You'll need an installation of the Java runtime to use this server. Once you've downloaded Selenium Server to your current working directory, you can start the server with this shell command:+While you can use any WebDriver server out there, probably the simplest server to use with haskell-webdriver is [Selenium Server](http://docs.seleniumhq.org/download/). You'll need an installation of the Java runtime to use this server. Once you've downloaded Selenium Server to your current working directory, you can start the server with this shell command:      java -jar selenium-server-standalone-*.jar  The server should now be listening at localhost on port 4444. -Currently, `hs-webdriver` only supports selenium version 2.+Currently, `haskell-webdriver` only supports selenium version 2. The [beginner example](/examples/readme-example-beginner.md) was tested with `selenium-server-standalone-2.53.1`. @@ -85,7 +85,7 @@  # Documentation -Documentation for hs-webdriver is available on Hackage at <http://hackage.haskell.org/package/webdriver>. You can also generate local HTML documentation from this source revision with the following shell command:+Documentation for haskell-webdriver is available on Hackage at <http://hackage.haskell.org/package/webdriver>. You can also generate local HTML documentation from this source revision with the following shell command:  ```sh runhaskell Setup.hs haddock
src/Test/WebDriver/Capabilities.hs view
@@ -1,4 +1,6 @@-{-# LANGUAGE OverloadedStrings, RecordWildCards, ConstraintKinds, CPP #-}+{-# LANGUAGE ConstraintKinds #-}+{-# LANGUAGE CPP #-}+ module Test.WebDriver.Capabilities where  import Test.WebDriver.Chrome.Extension
src/Test/WebDriver/Chrome/Extension.hs view
@@ -1,5 +1,6 @@-{-# LANGUAGE GeneralizedNewtypeDeriving, FlexibleContexts #-}--- |Functions and types for working with Google Chrome extensions.+{-# LANGUAGE GeneralizedNewtypeDeriving #-}++-- | Functions and types for working with Google Chrome extensions. module Test.WebDriver.Chrome.Extension        ( ChromeExtension        , loadExtension
src/Test/WebDriver/Class.hs view
@@ -1,4 +1,3 @@-{-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE CPP #-} {-# LANGUAGE ConstraintKinds #-} 
src/Test/WebDriver/Commands.hs view
@@ -1,6 +1,7 @@-{-# LANGUAGE OverloadedStrings, ScopedTypeVariables, ExistentialQuantification,-             TemplateHaskell, RecordWildCards, FlexibleContexts #-}--- |This module exports basic WD actions that can be used to interact with a+{-# LANGUAGE ExistentialQuantification #-}+{-# LANGUAGE TemplateHaskell #-}++-- | This module exports basic WD actions that can be used to interact with a -- browser session. module Test.WebDriver.Commands        ( -- * Sessions
src/Test/WebDriver/Commands/Internal.hs view
@@ -1,7 +1,5 @@-{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-}-{-# LANGUAGE ScopedTypeVariables #-}  {-# OPTIONS_HADDOCK not-home #-} -- | Internal functions used to implement the functions exported by
src/Test/WebDriver/Commands/Wait.hs view
@@ -1,4 +1,7 @@-{-# LANGUAGE CPP, DeriveDataTypeable, ScopedTypeVariables, FlexibleContexts, ConstraintKinds #-}+{-# LANGUAGE CPP #-}+{-# LANGUAGE DeriveDataTypeable #-}+{-# LANGUAGE ConstraintKinds #-}+ module Test.WebDriver.Commands.Wait        ( -- * Wait on expected conditions          waitUntil, waitUntil'
src/Test/WebDriver/Common/Keys.hs view
@@ -1,6 +1,6 @@-{-# LANGUAGE OverloadedStrings #-}--- |This module contains named constants corresponding to the special characters recognized by 'sendKeys'.--- For more details on these special characters, consult the Selenium documentation at ++-- | This module contains named constants corresponding to the special characters recognized by 'sendKeys'.+-- For more details on these special characters, consult the Selenium documentation at -- <https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#sessionsessionidelementidvalue> module Test.WebDriver.Common.Keys where @@ -197,4 +197,3 @@  up :: Text up = "\xe013"-
src/Test/WebDriver/Common/Profile.hs view
@@ -1,7 +1,10 @@-{-# LANGUAGE CPP, TypeSynonymInstances, DeriveDataTypeable, FlexibleInstances,-             GeneralizedNewtypeDeriving, OverloadedStrings, FlexibleContexts #-}+{-# LANGUAGE CPP #-}+{-# LANGUAGE TypeSynonymInstances #-}+{-# LANGUAGE DeriveDataTypeable #-}+{-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# OPTIONS_HADDOCK not-home #-}--- |A type for profile preferences. These preference values are used by both++-- | A type for profile preferences. These preference values are used by both -- Firefox and Opera profiles. module Test.WebDriver.Common.Profile        ( -- *Profiles and profile preferences@@ -23,11 +26,11 @@        , ProfileParseError(..)        ) where -import System.Directory-import System.FilePath hiding (addExtension, hasExtension) import Codec.Archive.Zip import Data.Aeson import Data.Aeson.Types+import System.Directory+import System.FilePath hiding (addExtension, hasExtension)  #if MIN_VERSION_aeson(0,7,0) import Data.Scientific
src/Test/WebDriver/Config.hs view
@@ -1,4 +1,4 @@-{-# LANGUAGE OverloadedStrings, RecordWildCards, FlexibleContexts #-}+ module Test.WebDriver.Config(     -- * WebDriver configuration       WDConfig(..), defaultConfig
src/Test/WebDriver/Cookies.hs view
@@ -1,5 +1,4 @@ {-# LANGUAGE TemplateHaskell #-}-{-# LANGUAGE OverloadedStrings #-}  module Test.WebDriver.Cookies where 
src/Test/WebDriver/Exceptions.hs view
@@ -1,11 +1,25 @@-module Test.WebDriver.Exceptions-       ( InvalidURL(..), NoSessionId(..), BadJSON(..)-       , HTTPStatusUnknown(..), HTTPConnError(..)-       , UnknownCommand(..), ServerError(..)-       , FailedCommand(..), FailedCommandType(..)-       , FailedCommandInfo(..), StackFrame(..)-       , mkFailedCommandInfo, failedCommand-       ) where-import Test.WebDriver.JSON++module Test.WebDriver.Exceptions (+  InvalidURL(..)+  , NoSessionId(..)+  , BadJSON(..)++  , HTTPStatusUnknown(..)+  , HTTPConnError(..)++  , UnknownCommand(..)+  , ServerError(..)++  , FailedCommand(..)+  , FailedCommandType(..)++  , FailedCommandInfo(..)+  , StackFrame(..)++  , mkFailedCommandInfo+  , failedCommand+  ) where+ import Test.WebDriver.Commands.Internal import Test.WebDriver.Exceptions.Internal+import Test.WebDriver.JSON
src/Test/WebDriver/Exceptions/Internal.hs view
@@ -1,4 +1,6 @@-{-# LANGUAGE OverloadedStrings, RecordWildCards, DeriveDataTypeable, ConstraintKinds, FlexibleContexts, NamedFieldPuns #-}+{-# LANGUAGE DeriveDataTypeable #-}+{-# LANGUAGE ConstraintKinds #-}+ module Test.WebDriver.Exceptions.Internal        ( InvalidURL(..), HTTPStatusUnknown(..), HTTPConnError(..)        , UnknownCommand(..), ServerError(..)
src/Test/WebDriver/Firefox/Profile.hs view
@@ -1,9 +1,11 @@-{-# LANGUAGE CPP, OverloadedStrings, FlexibleContexts,-             GeneralizedNewtypeDeriving, EmptyDataDecls,-             ScopedTypeVariables #-}+{-# LANGUAGE CPP #-}+{-# LANGUAGE GeneralizedNewtypeDeriving #-}+{-# LANGUAGE EmptyDataDecls #-} {-# OPTIONS_GHC -fno-warn-unused-do-bind #-} -- suppress warnings from attoparsec--- |A module for working with Firefox profiles. Firefox profiles are manipulated++-- | A module for working with Firefox profiles. Firefox profiles are manipulated -- in pure code and then \"prepared\" for network transmission.+ module Test.WebDriver.Firefox.Profile        ( -- * Profiles          Firefox, Profile(..), PreparedProfile
src/Test/WebDriver/IO.hs view
@@ -1,3 +1,4 @@+ module Test.WebDriver.IO where  import Control.Concurrent (threadDelay)
src/Test/WebDriver/Internal.hs view
@@ -1,5 +1,8 @@-{-# LANGUAGE FlexibleContexts, OverloadedStrings, RecordWildCards, ScopedTypeVariables, ConstraintKinds, PatternGuards, CPP #-}--- |The HTTP/JSON plumbing used to implement the 'WD' monad.+{-# LANGUAGE ConstraintKinds #-}+{-# LANGUAGE PatternGuards #-}+{-# LANGUAGE CPP #-}++-- | The HTTP/JSON plumbing used to implement the 'WD' monad. -- -- These functions can be used to create your own 'WebDriver' instances, providing extra functionality for your application if desired. All exports -- of this module are subject to change at any point.
src/Test/WebDriver/JSON.hs view
@@ -1,4 +1,6 @@-{-# LANGUAGE OverloadedStrings, FlexibleContexts, DeriveDataTypeable, CPP #-}+{-# LANGUAGE DeriveDataTypeable #-}+{-# LANGUAGE CPP #-}+ -- |A collection of convenience functions for using and parsing JSON values -- within 'WD'. All monadic parse errors are converted to asynchronous -- 'BadJSON' exceptions.
src/Test/WebDriver/Monad.hs view
@@ -1,9 +1,20 @@-{-# LANGUAGE FlexibleContexts, TypeFamilies, GeneralizedNewtypeDeriving,-             MultiParamTypeClasses, CPP, UndecidableInstances, ConstraintKinds #-}-module Test.WebDriver.Monad-       ( WD(..), runWD, runSession, finallyClose, closeOnException, getSessionHistory, dumpSessionHistory-       ) where+{-# LANGUAGE CPP #-}+{-# LANGUAGE TypeFamilies #-}+{-# LANGUAGE GeneralizedNewtypeDeriving #-}+{-# LANGUAGE MultiParamTypeClasses #-}+{-# LANGUAGE UndecidableInstances #-}+{-# LANGUAGE ConstraintKinds #-} +module Test.WebDriver.Monad (+  WD(..)+  , runWD+  , runSession+  , finallyClose+  , closeOnException+  , getSessionHistory+  , dumpSessionHistory+  ) where+ import Test.WebDriver.Class import Test.WebDriver.Commands import Test.WebDriver.Config@@ -15,7 +26,6 @@ import Control.Monad.IO.Class import Control.Monad.Trans.Control (MonadBaseControl(..), StM) import Control.Monad.Trans.State.Strict (StateT, evalStateT, get, put)---import Control.Monad.IO.Class (MonadIO) import Control.Exception.Lifted import Control.Monad.Catch (MonadCatch, MonadMask, MonadThrow) import Control.Applicative@@ -23,8 +33,7 @@ import Prelude -- hides some "unused import" warnings  -{- |A state monad for WebDriver commands.--}+{- | A state monad for WebDriver commands. -} newtype WD a = WD (StateT WDSession IO a)   deriving (Functor, Applicative, Monad, MonadIO, MonadThrow, MonadCatch, MonadFix, MonadMask) 
src/Test/WebDriver/Session.hs view
@@ -1,17 +1,14 @@-{-# LANGUAGE FlexibleContexts #-}-{-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE ConstraintKinds #-}-{-# LANGUAGE CPP #-} -module Test.WebDriver.Session-  ( -- * WDSessionState class-    WDSessionState(..), WDSessionStateIO, WDSessionStateControl, modifySession, withSession-    -- ** WebDriver sessions+module Test.WebDriver.Session (+  -- * WDSessionState class+  WDSessionState(..), WDSessionStateIO, WDSessionStateControl, modifySession, withSession+  -- ** WebDriver sessions   , WDSession(..), mostRecentHistory, mostRecentHTTPRequest, SessionId(..), SessionHistory(..)-    -- * SessionHistoryConfig options+  -- * SessionHistoryConfig options   , SessionHistoryConfig, noHistory, unlimitedHistory, onlyMostRecentHistory-    -- * Using custom HTTP request headers+  -- * Using custom HTTP request headers   , withRequestHeaders, withAuthHeaders   ) where 
src/Test/WebDriver/Session/History.hs view
@@ -1,11 +1,12 @@+ module Test.WebDriver.Session.History where +import Control.Exception (SomeException) import Data.ByteString.Lazy (ByteString) import Network.HTTP.Client (Request, Response)-import Control.Exception (SomeException)  -data SessionHistory = SessionHistory +data SessionHistory = SessionHistory     { histRequest :: Request     , histResponse :: Either SomeException (Response ByteString)     , histRetryCount :: Int
src/Test/WebDriver/Types.hs view
@@ -1,41 +1,48 @@ {-# OPTIONS_HADDOCK not-home #-}-module Test.WebDriver.Types-       ( -- * WebDriver sessions-         WD(..), WDSession(..), SessionId(..), SessionHistory-         -- * WebDriver configuration-       , WDConfig(..), defaultConfig, SessionHistoryConfig-         -- * Capabilities-       , Capabilities(..), defaultCaps, allCaps-       , Platform(..), ProxyType(..), UnexpectedAlertBehavior(..)-         -- ** Browser-specific capabilities-       , Browser(..),-         -- ** Default settings for browsers-         firefox, chrome, ie, opera, iPhone, iPad, android-       , LogLevel(..), IELogLevel(..), IEElementScrollBehavior(..)-         -- * WebDriver objects and command-specific types-       , Element(..)-       , WindowHandle(..), currentWindow-       , Selector(..)-       , JSArg(..)-       , FrameSelector(..)-       , Cookie(..), mkCookie-       , Orientation(..)-       , MouseButton(..)-       , WebStorageType(..)-       , LogType, LogEntry(..)-       , ApplicationCacheStatus(..)-         -- * Exceptions-       , InvalidURL(..), NoSessionId(..), BadJSON(..)-       , HTTPStatusUnknown(..), HTTPConnError(..)-       , UnknownCommand(..), ServerError(..)-       , FailedCommand(..), FailedCommandType(..)-       , FailedCommandInfo(..), StackFrame(..)-       , mkFailedCommandInfo, failedCommand-       ) where -import Test.WebDriver.Monad-import Test.WebDriver.Session-import Test.WebDriver.Config+module Test.WebDriver.Types (+  -- * WebDriver sessions+  WD(..), WDSession(..), SessionId(..), SessionHistory++    -- * WebDriver configuration+  , WDConfig(..), defaultConfig, SessionHistoryConfig++    -- * Capabilities+  , Capabilities(..), defaultCaps, allCaps+  , Platform(..), ProxyType(..), UnexpectedAlertBehavior(..)++    -- ** Browser-specific capabilities+  , Browser(..),++    -- ** Default settings for browsers+    firefox, chrome, ie, opera, iPhone, iPad, android+  , LogLevel(..), IELogLevel(..), IEElementScrollBehavior(..)++    -- * WebDriver objects and command-specific types+  , Element(..)+  , WindowHandle(..), currentWindow+  , Selector(..)+  , JSArg(..)+  , FrameSelector(..)+  , Cookie(..), mkCookie+  , Orientation(..)+  , MouseButton(..)+  , WebStorageType(..)+  , LogType, LogEntry(..)+  , ApplicationCacheStatus(..)++    -- * Exceptions+  , InvalidURL(..), NoSessionId(..), BadJSON(..)+  , HTTPStatusUnknown(..), HTTPConnError(..)+  , UnknownCommand(..), ServerError(..)+  , FailedCommand(..), FailedCommandType(..)+  , FailedCommandInfo(..), StackFrame(..)+  , mkFailedCommandInfo, failedCommand+  ) where++import Test.WebDriver.Capabilities import Test.WebDriver.Commands+import Test.WebDriver.Config import Test.WebDriver.Exceptions-import Test.WebDriver.Capabilities+import Test.WebDriver.Monad+import Test.WebDriver.Session
src/Test/WebDriver/Utils.hs view
@@ -1,3 +1,4 @@+ module Test.WebDriver.Utils where  import Data.Text (Text)
webdriver.cabal view
@@ -1,11 +1,11 @@ cabal-version: 1.12 --- This file has been generated from package.yaml by hpack version 0.35.0.+-- This file has been generated from package.yaml by hpack version 0.35.1. -- -- see: https://github.com/sol/hpack  name:           webdriver-version:        0.10.0.0+version:        0.10.0.1 synopsis:       a Haskell client for the Selenium WebDriver protocol description:    A Selenium WebDriver client for Haskell.                 You can use it to automate browser sessions@@ -16,10 +16,10 @@                 .                 To find out what's been changed in this version and others,                 see the change log at-                <https://github.com/kallisti-dev/hs-webdriver/blob/master/CHANGELOG.md>+                <https://github.com/haskell-webdriver/haskell-webdriver/blob/master/CHANGELOG.md> category:       Web, Browser, Testing, WebDriver, Selenium-homepage:       https://github.com/codedownio/hs-webdriver#readme-bug-reports:    https://github.com/codedownio/hs-webdriver/issues+homepage:       https://github.com/haskell-webdriver/haskell-webdriver#readme+bug-reports:    https://github.com/haskell-webdriver/haskell-webdriver/issues author:         Adam Curtis <kallisti.dev@gmail.com> maintainer:     Tom McLaughlin <tom@codedown.io> license:        BSD3@@ -30,14 +30,15 @@   , GHC == 8.8.4   , GHC == 8.10.7   , GHC == 9.0.2-  , GHC == 9.2.5+  , GHC == 9.2.7+  , GHC == 9.4.4 extra-source-files:     README.md     CHANGELOG.md  source-repository head   type: git-  location: https://github.com/codedownio/hs-webdriver+  location: https://github.com/haskell-webdriver/haskell-webdriver  library   exposed-modules:@@ -66,6 +67,13 @@       Test.WebDriver.IO   hs-source-dirs:       src+  default-extensions:+      ScopedTypeVariables+      OverloadedStrings+      FlexibleContexts+      FlexibleInstances+      RecordWildCards+      NamedFieldPuns   ghc-options: -Wall   build-depends:       aeson >=0.6.2.0