Skip to content

Commit

Permalink
webdriver: Merge pull request mozilla#15 from AutomatedTester/update_…
Browse files Browse the repository at this point in the history
…endpoints

Update the HTTP Endpoints to match the current specification

Source-Repo: https://github.com/mozilla/webdriver-rust
Source-Revision: 7fd0a2aec5722f28a319595cba173e95367b99a7
  • Loading branch information
AutomatedTester committed Aug 28, 2015
1 parent 8cbd392 commit 55c9f9d
Showing 1 changed file with 20 additions and 9 deletions.
29 changes: 20 additions & 9 deletions testing/webdriver/src/httpapi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ 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),
Expand All @@ -15,9 +15,9 @@ static ROUTES: [(Method, &'static str, Route); 47] = [
(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),
Expand All @@ -37,8 +37,8 @@ static ROUTES: [(Method, &'static str, Route); 47] = [
(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),
Expand All @@ -50,11 +50,22 @@ static ROUTES: [(Method, &'static str, Route); 47] = [
(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)]
Expand Down

0 comments on commit 55c9f9d

Please sign in to comment.