Title: [225387] trunk/Source/WebDriver
- Revision
- 225387
- Author
- [email protected]
- Date
- 2017-12-01 01:49:10 -0800 (Fri, 01 Dec 2017)
Log Message
WebDriver: implement status command
https://bugs.webkit.org/show_bug.cgi?id=180133
Reviewed by Brian Burg.
8.3 Status
https://w3c.github.io/webdriver/webdriver-spec.html#status
Fixes: imported/w3c/webdriver/tests/sessions/status.py::test_get_status_no_session
imported/w3c/webdriver/tests/sessions/status.py::test_status_with_session_running_on_endpoint_node
* WebDriverService.cpp:
(WebDriver::WebDriverService::status):
* WebDriverService.h:
Modified Paths
Diff
Modified: trunk/Source/WebDriver/ChangeLog (225386 => 225387)
--- trunk/Source/WebDriver/ChangeLog 2017-12-01 09:47:15 UTC (rev 225386)
+++ trunk/Source/WebDriver/ChangeLog 2017-12-01 09:49:10 UTC (rev 225387)
@@ -1,5 +1,22 @@
2017-12-01 Carlos Garcia Campos <[email protected]>
+ WebDriver: implement status command
+ https://bugs.webkit.org/show_bug.cgi?id=180133
+
+ Reviewed by Brian Burg.
+
+ 8.3 Status
+ https://w3c.github.io/webdriver/webdriver-spec.html#status
+
+ Fixes: imported/w3c/webdriver/tests/sessions/status.py::test_get_status_no_session
+ imported/w3c/webdriver/tests/sessions/status.py::test_status_with_session_running_on_endpoint_node
+
+ * WebDriverService.cpp:
+ (WebDriver::WebDriverService::status):
+ * WebDriverService.h:
+
+2017-12-01 Carlos Garcia Campos <[email protected]>
+
WebDriver: end point nodes are only allowed to have one session
https://bugs.webkit.org/show_bug.cgi?id=180131
Modified: trunk/Source/WebDriver/WebDriverService.cpp (225386 => 225387)
--- trunk/Source/WebDriver/WebDriverService.cpp 2017-12-01 09:47:15 UTC (rev 225386)
+++ trunk/Source/WebDriver/WebDriverService.cpp 2017-12-01 09:49:10 UTC (rev 225387)
@@ -100,6 +100,7 @@
const WebDriverService::Command WebDriverService::s_commands[] = {
{ HTTPMethod::Post, "/session", &WebDriverService::newSession },
{ HTTPMethod::Delete, "/session/$sessionId", &WebDriverService::deleteSession },
+ { HTTPMethod::Get, "/status", &WebDriverService::status },
{ HTTPMethod::Post, "/session/$sessionId/timeouts", &WebDriverService::setTimeouts },
{ HTTPMethod::Post, "/session/$sessionId/url", &WebDriverService::go },
@@ -681,6 +682,16 @@
});
}
+void WebDriverService::status(RefPtr<JSON::Object>&&, Function<void (CommandResult&&)>&& completionHandler)
+{
+ // §8.3 Status
+ // https://w3c.github.io/webdriver/webdriver-spec.html#status
+ auto body = JSON::Object::create();
+ body->setBoolean(ASCIILiteral("ready"), !m_session);
+ body->setString(ASCIILiteral("message"), m_session ? ASCIILiteral("A session already exists") : ASCIILiteral("No sessions"));
+ completionHandler(CommandResult::success(WTFMove(body)));
+}
+
void WebDriverService::setTimeouts(RefPtr<JSON::Object>&& parameters, Function<void (CommandResult&&)>&& completionHandler)
{
// §8.5 Set Timeouts.
Modified: trunk/Source/WebDriver/WebDriverService.h (225386 => 225387)
--- trunk/Source/WebDriver/WebDriverService.h 2017-12-01 09:47:15 UTC (rev 225386)
+++ trunk/Source/WebDriver/WebDriverService.h 2017-12-01 09:49:10 UTC (rev 225387)
@@ -62,6 +62,7 @@
void newSession(RefPtr<JSON::Object>&&, Function<void (CommandResult&&)>&&);
void deleteSession(RefPtr<JSON::Object>&&, Function<void (CommandResult&&)>&&);
+ void status(RefPtr<JSON::Object>&&, Function<void (CommandResult&&)>&&);
void setTimeouts(RefPtr<JSON::Object>&&, Function<void (CommandResult&&)>&&);
void go(RefPtr<JSON::Object>&&, Function<void (CommandResult&&)>&&);
void getCurrentURL(RefPtr<JSON::Object>&&, Function<void (CommandResult&&)>&&);
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes