git.iko.soy/rowtype-yoga/purescript-lunapark
on main help sign in
git clone https://git.iko.soy/rowtype-yoga/purescript-lunapark.git

purescript-lunapark

Latest release Build Status

Disclaimer

Webdriver/JsonWire bindings for PureScript

Purescript W3C webdriver protocol bindings

The main purpose of this library is to provide purescript webdriver/json-wire protocol bindings, such that won't involve any JavaScript dependencies.

Architecture

main = launchAff do
  interpreterOrError ← init "http://localhost:4444/wd/hub" { alwaysMatch: [], firstMatch: [[BrowserName Chrome]] }
  case intepreterOrError of
    Left err → throwError $ error "An error during selenium session initialization occured"
    Right interpret → Run.runBaseAff' $ Run.runExcept $ interpret do
      go "http://my-site.com"
      el ← findElement $ ByCss $ CSS.fromString ".my-class"
      clickEl el
      login ← findElement $ ByCss $ CSS.fromString "#login"
      password ← findElement $ ByCss $ CSS.fromString "#password"
      moveTo { origin: login, x: 0, y: 0, duration: Milliseconds 1000.0 }
      click
      sendKeys "login"
      moveTo { origin: password, x: 0, y: 0, duration: Milliseconds 100.0 }
      sendKeys "secret"
      sendKeys "\\xE007"