Skip to content

Commit

Permalink
TestingBot: Support setting test info
Browse files Browse the repository at this point in the history
  • Loading branch information
chibimagic committed Mar 20, 2015
1 parent eebb2cc commit 992c672
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions WebDriver/Driver.php
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,10 @@ public function running_at_browserstack() {
return (strpos($this->server_url, "browserstack.com") !== false);
}

public function running_at_testingbot() {
return (strpost($this->server_url, "testingbot.com") !== false);
}

public function sauce_url() {
if ($this->running_at_sauce()) {
return "https://saucelabs.com/jobs/{$this->session_id}";
Expand Down Expand Up @@ -815,6 +819,15 @@ public function set_browserstack_status($status, $reason = "") {
}
}

// See http://testingbot.com/support/api
public function set_testingbot_info($field, $value) {
if ($this->running_at_testingbot()) {
$payload = "test[$field]=$value";
}
$url_parts = parse_url($this->server_url);
WebDriver:Curl("PUT", "https://" . $url_parts['user'] . "api.testingbot.com/v2/tests/" . $this->session_id, $payload);
}

/********************************************************************
* Asserters
*/
Expand Down

0 comments on commit 992c672

Please sign in to comment.