From 842fb0e1040228c33bf28f7486e57050eb6d229f Mon Sep 17 00:00:00 2001 From: chibimagic Date: Wed, 4 Mar 2015 15:53:22 -0800 Subject: [PATCH] Shrinkwrapped support for BrowserStack (http://www.browserstack.com/) --- WebDriver/Driver.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/WebDriver/Driver.php b/WebDriver/Driver.php index 1fab920..7dd4760 100644 --- a/WebDriver/Driver.php +++ b/WebDriver/Driver.php @@ -74,6 +74,18 @@ public static function InitAtSauce($sauce_username, $sauce_key, $os, $browser, $ } return new WebDriver_Driver("http://" . $sauce_username . ":" . $sauce_key . "@ondemand.saucelabs.com:80/wd/hub", $capabilities); } + + public static function InitAtBrowserStack($browserstack_username, $browserstack_value, $os, $browser, $version = false, $additional_options = array()) { + $capabilities = array_merge(array( + 'browserstack.debug' => true, + 'platform' => strtoupper($os), + 'browserName' => $browser + ), $additional_options); + if ($version) { + $capabilities["version"] = $version; + } + return new WebDriver_Driver("http://" . $browserstack_username . ":" . $browserstack_value . "@hub.browserstack.com/wd/hub", $capabilities); + } public static function InitAtHost($host, $port, $browser, $additional_options = array()) { $capabilities = array_merge(array(