Skip to content
This repository has been archived by the owner on Jun 15, 2023. It is now read-only.

Commit

Permalink
Merge pull request #5 from garyb/interpreter-type
Browse files Browse the repository at this point in the history
Interpreter type
  • Loading branch information
garyb authored Dec 6, 2018
2 parents 780f320 + fc225a0 commit 0f2e689
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
3 changes: 2 additions & 1 deletion bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@
"node_modules",
"bower_components",
"output",
"test"
"test",
"vendor"
],
"dependencies": {
"purescript-xpath": "cryogenian/purescript-xpath#compiler/0.12",
Expand Down
2 changes: 1 addition & 1 deletion src/Lunapark.purs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ module Lunapark
) where


import Lunapark.API (BaseRun, HandleLunaparkInput, Lunapark, handleLunapark, init, interpret, interpretW3CActions, jsonWireActions, runLunapark, runLunaparkActions, w3cActions)
import Lunapark.API (Interpreter(..), runInterpreter, BaseRun, HandleLunaparkInput, Lunapark, handleLunapark, init, interpret, interpretW3CActions, jsonWireActions, runLunapark, runLunaparkActions, w3cActions)
import Lunapark.Error (Error, ErrorType(..), fromJson, fromStringCode, toStringCode, unknownError)
import Lunapark.ActionF (ActionF(..), LUNAPARK_ACTIONS, TouchF(..), WithAction, _lunaparkActions, buttonDown, buttonUp, click, doubleClick, doubleTap, flick, liftAction, longTap, moveTo, pause, scroll, sendKeys, tap, touchDown, touchUp)
import Lunapark.LunaparkF (ElementF(..), LUNAPARK, LunaparkF(..), WithLunapark, _lunapark, acceptAlert, addCookie, back, childElement, childElements, clearElement, clickElement, closeWindow, deleteAllCookies, deleteCookie, dismissAlert, elementScreenshot, executeScript, executeScriptAsync, findElement, findElements, forward, fullscreenWindow, getAlertText, getAllCookies, getAttribute, getCookie, getCss, getProperty, getRectangle, getTagName, getText, getTimeouts, getTitle, getUrl, getWindowHandle, getWindowHandles, getWindowRectangle, go, isDisplayed, isEnabled, isSelected, liftLunapark, maximizeWindow, minimizeWindow, performActions, quit, refresh, releaseActions, screenshot, sendAlertText, sendKeysElement, setTimeouts, setWindowRectangle, status, submitElement, switchToFrame, switchToParentFrame, switchToWindow)
11 changes: 8 additions & 3 deletions src/Lunapark/API.purs
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,18 @@ import Node.FS.Aff as FS
import Run as R
import Run.Except (EXCEPT)

newtype Interpreter r = Interpreter (Lunapark r ~> BaseRun r)

runInterpreter r. Interpreter r Lunapark r ~> BaseRun r
runInterpreter (Interpreter f) = f

init
m r a
m r
. MonadAff m
MonadRec m
String
LT.CapabilitiesRequest
m (Either LE.Error (Lunapark r a BaseRun r a))
m (Either LE.Error (Interpreter r))
init uri caps = do
res ←
liftAff
Expand Down Expand Up @@ -78,7 +83,7 @@ init uri caps = do
, actionsEnabled
}

pure $ interpret input
pure $ Interpreter (interpret input)

interpret
r
Expand Down

0 comments on commit 0f2e689

Please sign in to comment.