webdriver-w3c
webdriver-w3c copied to clipboard
Tutorial issues
There are a few things which could be improved about the tutorial:
- It doesn't compile. This is seemingly because
Tutorial.md
isn't up to date withapp/Main.lhs
. For example, it hasdo_a_barrel_roll :: WebDriver IO ()
, which should presumably bedo_a_barrel_roll :: WebDriverT IO ()
. - When modifications are made to make it compile, there are still a lot of warnings.
- Google's barrel roll isn't a good example anymore, at least without some modification, as it gets blocked by an "accept cookies" popup.
- It would be great to have Cabal instructions as well as Stack.
I can go to google.com using this code :
{-# LANGUAGE OverloadedStrings #-}
module Main where
import Web.Api.WebDriver
do_a_barrel_roll :: WebDriverT IO ()
do_a_barrel_roll = do
fullscreenWindow
navigateTo "https://www.google.com"
wait 5000000
return ()
main :: IO ()
main = do
execWebDriverT defaultWebDriverConfig
(runIsolated_ defaultFirefoxCapabilities do_a_barrel_roll)
return ()
With a simple cabal file (cabal 3.4.1.0)
executable quilt
main-is: Main.hs
build-depends: base
, webdriver-w3c
hs-source-dirs: app
default-language: Haskell2010
It does not solve the issue of the popup on Google though.