~alcinnz/amphiarao

86bfb71d981383978879c527f49f1f170636e6f7 — Adrian Cochrane 3 years ago d647a0f
Add WebDriver noops for frames.
1 files changed, 6 insertions(+), 2 deletions(-)

M src/Webdriver.hs
M src/Webdriver.hs => src/Webdriver.hs +6 -2
@@ 46,7 46,8 @@ serveSession sessions = WD.withSession fail (\uuid session -> msum [
            delSession sessions uuid, -- Closing the only window closes the session.
            switchWindowHandle uuid,
            dir "handles" $ getWindowHandles uuid
        ]
        ],
        dir "frame" $ msum [noSuchFrame, dir "parent" $ ok $ toResponse ()] -- Noops
    ]) sessions
  where
    fail uuid'| Just _ <- ID.fromString uuid' = errJSON 404 "invalid session ID" $ (


@@ 148,4 149,7 @@ getWindowHandles uuid = do
    nullDir
    okJSON ["window-" ++ ID.toString uuid]


noSuchFrame = do
    method POST
    nullDir
    errJSON 404 "no such frame" "Rhapsode doesn't support frames"