~alcinnz/amphiarao

28b06502a102fd5bc132f6dc932c4463305e1b51 — Adrian Cochrane 3 years ago 58648b6
Add Webdriver noop for active element.
1 files changed, 6 insertions(+), 0 deletions(-)

M src/Webdriver.hs
M src/Webdriver.hs => src/Webdriver.hs +6 -0
@@ 57,6 57,7 @@ serveSession sessions = WD.withSession fail (\uuid session -> msum [
        ],
        dir "frame" $ msum [noSuchFrame, dir "parent" $ ok $ toResponse ()], -- Noops
        dir "element" $ findFromRoot session,
        dir "element" $ dir "active" noSuchEl,
        dir "element" $ path $ serveElement session,
        dir "elements" $ findAllFromRoot session
    ]) sessions


@@ 237,3 238,8 @@ findAllFromEl session el = do
            Left (True, msg) -> errJSON 400 "invalid selector" msg
            Left (False, msg) -> errJSON 400 "invalid argument" msg
        Nothing -> errJSON 400 "invalid argument" "Failed to parse JSON"

noSuchEl = do
    method GET
    nullDir
    errJSON 404 "no such element" "Rhapsode does not have active elements."