DataSift\Storyplayer\DeviceLib\SauceLabsWebDriverAdapter::start PHP Method

start() public method

public start ( StoryTeller $st ) : void
$st DataSift\Storyplayer\PlayerLib\StoryTeller
return void
    public function start(StoryTeller $st)
    {
        // Sauce Labs handles proxying for us (if required)
        // via the Sauce Connect app
        // build the Sauce Labs url
        $url = "http://" . urlencode($this->browserDetails->saucelabs->username) . ':' . urlencode($this->browserDetails->saucelabs->accesskey) . '@ondemand.saucelabs.com/wd/hub';
        // build the Sauce Labs capabilities array
        $desiredCapabilities = $this->browserDetails->desiredCapabilities;
        // add the story's name, so that someone looking at the Sauce Labs
        // list of jobs can see what this browser was used for
        //
        // due to encoding errors at SauceLabs, we can't use '>' as a
        // delimiter in the story's name
        $story = $st->getStory();
        $desiredCapabilities['name'] = $st->getTestEnvironmentName() . ' / ' . $st->getCurrentPhase() . ': ' . $st->getCurrentPhaseName() . ' / ' . $story->getName();
        // create the browser session
        $webDriver = new WebDriverClient($url);
        $this->browserSession = $webDriver->newSession($this->browserDetails->browser, $desiredCapabilities);
    }