webdriver-w3c icon indicating copy to clipboard operation
webdriver-w3c copied to clipboard

Tutorial issues

Open georgefst opened this issue 2 years ago • 1 comments

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 with app/Main.lhs. For example, it has do_a_barrel_roll :: WebDriver IO (), which should presumably be do_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.

georgefst avatar Apr 15 '22 19:04 georgefst

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.

apraga avatar Oct 31 '22 08:10 apraga