webdriver: Merge pull request #15 from AutomatedTester/update_endpoints
authorAutomatedTester <dburns@mozilla.com>
Fri, 28 Aug 2015 16:31:29 +0200
changeset 428040 f5cd13554948708d24ebc454a239023706f9a1eb
parent 428039 95cedfcaef6e614e0d65f05b16c55cea8ee9129d
child 428041 352e95a7fb931f97aea4cdac5bd8bc32795e5a5d
push id7761
push userjlund@mozilla.com
push dateFri, 15 Sep 2017 00:19:52 +0000
treeherdermozilla-beta@c38455951db4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
milestone57.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
webdriver: Merge pull request #15 from AutomatedTester/update_endpoints Update the HTTP Endpoints to match the current specification Source-Repo: https://github.com/mozilla/webdriver-rust Source-Revision: 7fd0a2aec5722f28a319595cba173e95367b99a7
testing/webdriver/src/httpapi.rs
--- a/testing/webdriver/src/httpapi.rs
+++ b/testing/webdriver/src/httpapi.rs
@@ -1,28 +1,28 @@
 use regex::{Regex, Captures};
 
 use hyper::method::Method;
 use hyper::method::Method::{Get, Post, Delete};
 
 use command::{WebDriverMessage};
 use error::{WebDriverResult, WebDriverError, ErrorStatus};
 
-static ROUTES: [(Method, &'static str, Route); 47] = [
+static ROUTES: [(Method, &'static str, Route); 56] = [
     (Post, "/session", Route::NewSession),
     (Delete, "/session/{sessionId}", Route::DeleteSession),
     (Post, "/session/{sessionId}/url", Route::Get),
     (Get, "/session/{sessionId}/url", Route::GetCurrentUrl),
     (Post, "/session/{sessionId}/back", Route::GoBack),
     (Post, "/session/{sessionId}/forward", Route::GoForward),
     (Post, "/session/{sessionId}/refresh", Route::Refresh),
     (Get, "/session/{sessionId}/title", Route::GetTitle),
-    (Get, "/session/{sessionId}/window_handle", Route::GetWindowHandle),
-    (Get, "/session/{sessionId}/window_handles", Route::GetWindowHandles),
-    (Delete, "/session/{sessionId}/window_handle", Route::Close),
+    (Get, "/session/{sessionId}/window", Route::GetWindowHandle),
+    (Get, "/session/{sessionId}/window/handles", Route::GetWindowHandles),
+    (Delete, "/session/{sessionId}/window", Route::Close),
     (Post, "/session/{sessionId}/window/size", Route::SetWindowSize),
     (Get, "/session/{sessionId}/window/size", Route::GetWindowSize),
     (Post, "/session/{sessionId}/window/maximize", Route::MaximizeWindow),
     (Post, "/session/{sessionId}/window", Route::SwitchToWindow),
     (Post, "/session/{sessionId}/frame", Route::SwitchToFrame),
     (Post, "/session/{sessionId}/frame/parent", Route::SwitchToParentFrame),
     (Post, "/session/{sessionId}/element", Route::FindElement),
     (Post, "/session/{sessionId}/elements", Route::FindElements),
@@ -32,34 +32,45 @@ static ROUTES: [(Method, &'static str, R
     (Get, "/session/{sessionId}/element/{elementId}/displayed", Route::IsDisplayed),
     (Get, "/session/{sessionId}/element/{elementId}/selected", Route::IsSelected),
     (Get, "/session/{sessionId}/element/{elementId}/attribute/{name}", Route::GetElementAttribute),
     (Get, "/session/{sessionId}/element/{elementId}/css/{propertyName}", Route::GetCSSValue),
     (Get, "/session/{sessionId}/element/{elementId}/text", Route::GetElementText),
     (Get, "/session/{sessionId}/element/{elementId}/name", Route::GetElementTagName),
     (Get, "/session/{sessionId}/element/{elementId}/rect", Route::GetElementRect),
     (Get, "/session/{sessionId}/element/{elementId}/enabled", Route::IsEnabled),
-    (Post, "/session/{sessionId}/execute", Route::ExecuteScript),
-    (Post, "/session/{sessionId}/execute_async", Route::ExecuteAsyncScript),
+    (Post, "/session/{sessionId}/execute/sync", Route::ExecuteScript),
+    (Post, "/session/{sessionId}/execute/async", Route::ExecuteAsyncScript),
     (Get, "/session/{sessionId}/cookie", Route::GetCookies),
     (Get, "/session/{sessionId}/cookie/{name}", Route::GetCookie),
     (Post, "/session/{sessionId}/cookie", Route::AddCookie),
     (Delete, "/session/{sessionId}/cookie", Route::DeleteCookies),
     (Delete, "/session/{sessionId}/cookie/{name}", Route::DeleteCookie),
     (Post, "/session/{sessionId}/timeouts", Route::SetTimeouts),
     //(Post, "/session/{sessionId}/actions", Route::Actions),
     (Post, "/session/{sessionId}/element/{elementId}/click", Route::ElementClick),
     (Post, "/session/{sessionId}/element/{elementId}/tap", Route::ElementTap),
     (Post, "/session/{sessionId}/element/{elementId}/clear", Route::ElementClear),
     (Post, "/session/{sessionId}/element/{elementId}/value", Route::ElementSendKeys),
-    (Post, "/session/{sessionId}/dismiss_alert", Route::DismissAlert),
-    (Post, "/session/{sessionId}/accept_alert", Route::AcceptAlert),
+    (Post, "/session/{sessionId}/alert/dismiss", Route::DismissAlert),
+    (Post, "/session/{sessionId}/alert/accept", Route::AcceptAlert),
+    (Get, "/session/{sessionId}/alert/text", Route::GetAlertText),
+    (Post, "/session/{sessionId}/alert/text", Route::SendAlertText),
+    (Get, "/session/{sessionId}/screenshot", Route::TakeScreenshot),
+    // TODO Remove this when > v0.5 is released. There for compatibility reasons with existing
+    //      Webdriver implementations.
     (Get, "/session/{sessionId}/alert_text", Route::GetAlertText),
     (Post, "/session/{sessionId}/alert_text", Route::SendAlertText),
-    (Get, "/session/{sessionId}/screenshot", Route::TakeScreenshot)
+    (Post, "/session/{sessionId}/accept_alert", Route::AcceptAlert),
+    (Post, "/session/{sessionId}/dismiss_alert", Route::DismissAlert),
+    (Get, "/session/{sessionId}/window_handle", Route::GetWindowHandle),
+    (Get, "/session/{sessionId}/window_handles", Route::GetWindowHandles),
+    (Delete, "/session/{sessionId}/window_handle", Route::Close),
+    (Post, "/session/{sessionId}/execute_async", Route::ExecuteAsyncScript),
+    (Post, "/session/{sessionId}/execute", Route::ExecuteScript),
 ];
 
 #[derive(Clone, Copy)]
 pub enum Route {
     NewSession,
     DeleteSession,
     Get,
     GetCurrentUrl,