@@ 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."