packages feed

webdriver 0.8.0.1 → 0.8.0.2

raw patch · 6 files changed

+37/−20 lines, 6 filesdep −conddep ~aeson

Dependencies removed: cond

Dependency ranges changed: aeson

Files

CHANGELOG.md view
@@ -1,4 +1,9 @@ #Change Log+##0.8.0.2+* Fixed issue introduced in 0.8 that caused build failure when using aeson < 0.10++##0.8.0.1+* findElems and and findElemsFrom were accidentally changed to return a single Element in the last release. This has been fixed.   ##0.8 
LICENSE view
@@ -1,4 +1,4 @@-Copyright (c) 2012, Adam Curtis+Copyright (c) 2012-2015, Adam Curtis All rights reserved.  Redistribution and use in source and binary forms, with or without
src/Test/WebDriver/Commands.hs view
@@ -213,7 +213,7 @@ executeJS :: (Foldable f, FromJSON a, WebDriver wd) => f JSArg -> Text -> wd a executeJS a s = fromJSON' =<< getResult   where-    getResult = doSessCommand methodPost "/execute" . pair ("args", "script") $ (a,s)+    getResult = doSessCommand methodPost "/execute" . pair ("args", "script") $ (toList a,s)  {- |Executes a snippet of Javascript code asynchronously. This function works similarly to 'executeJS', except that the Javascript is passed a callback@@ -226,7 +226,7 @@ asyncJS a s = handle timeout $ Just <$> (fromJSON' =<< getResult)   where     getResult = doSessCommand methodPost "/execute_async" . pair ("args", "script")-                $ (a,s)+                $ (toList a,s)     timeout (FailedCommand Timeout _)       = return Nothing     timeout (FailedCommand ScriptTimeout _) = return Nothing     timeout err = throwIO err
src/Test/WebDriver/Commands/Wait.hs view
@@ -10,7 +10,6 @@        , catchFailedCommand          -- ** Convenience functions        , onTimeout-       , ifM, (<||>), (<&&>), notM        ) where import Test.WebDriver.Commands import Test.WebDriver.Class@@ -21,7 +20,6 @@ import Control.Monad.Trans.Control import Control.Exception.Lifted import Control.Concurrent-import Control.Conditional (ifM, (<||>), (<&&>), notM)  import Data.Time.Clock import Data.Typeable
test/search-baidu.hs view
@@ -1,36 +1,50 @@ {-# LANGUAGE OverloadedStrings #-} module Main where -import           Control.Monad (void)-import           Data.List-import qualified Data.Text                    as T-import           Test.WebDriver-import           Test.WebDriver.Commands.Wait+import Control.Monad+import Control.Applicative+import Data.List+import qualified Data.Text as T+import Test.WebDriver+import Test.WebDriver.Commands.Wait +import Prelude+ chromeConf = useBrowser chrome defaultConfig ffConf = defaultConfig  -- Have no fun with baidu but only cause it is loading fast than google in China. -- baidu :: WD ()-baidu = openPage "http://www.baidu.com/"+baidu = do +  openPage "http://www.baidu.com/"+  waitUntil 15 $+    expect . (== "http://www.baidu.com/") =<< getCurrentURL -searchBaidu :: WD Bool+searchBaidu :: WD () searchBaidu = do   searchBox <- findElem (ById "kw")   sendKeys "Cheese!" searchBox   submit searchBox-  setImplicitWait 50-  waitUntil 2000 $ do+  waitUntil 15 $ do     title <- getTitle-    return ("cheese!" `T.isSuffixOf` title)+    expect ("Cheese!" `T.isInfixOf` title) +  container <- findElem (ById "container")+  eList1 <- findElems (ByCSS "c-container")+  eList2 <- findElems (ByClass "c-container")+  expect =<< (fmap and $ zipWithM (<==>) eList1 eList2)++  forM_ eList1 $ \e -> findElemsFrom e (ByTag "a")+++ testCase c = void . runSession c . finallyClose $ (baidu >> searchBaidu) -testSuits = mapM_ testCase  [ffConf, chromeConf]+testSuites = mapM_ testCase  [ffConf, chromeConf]  main = do   --testCase capsChrome `seq` testCase capsFF   --mapM_ (forkOS . testCase) [capsFF, capsChrome]-  testSuits+  testSuites   print "done"
webdriver.cabal view
@@ -1,11 +1,12 @@ Name: webdriver-Version: 0.8.0.1+Version: 0.8.0.2 Cabal-Version: >= 1.8 License: BSD3 License-File: LICENSE Author: Adam Curtis Maintainer: kallisti.dev@gmail.com Homepage: https://github.com/kallisti-dev/hs-webdriver+Bug-reports: https://github.com/kallisti-dev/hs-webdriver/issues Category: Web, Browser, Testing Synopsis: a Haskell client for the Selenium WebDriver protocol Build-type: Simple@@ -63,7 +64,6 @@                  , exceptions >= 0.4 && < 0.9                  , scientific >= 0.2 && < 0.4                  , data-default-class < 0.1-                 , cond >= 0.3 && < 0.5                     if flag(network-uri)       build-depends: network-uri >= 2.6, network >= 2.6@@ -91,7 +91,7 @@   other-modules:   Test.WebDriver.Internal                    Test.WebDriver.Exceptions.Internal -Test-Suite test-search-baidu+Test-Suite search-baidu   type: exitcode-stdio-1.0   main-is: test/search-baidu.hs   ghc-options: -threaded