Skip to content

Instantly share code, notes, and snippets.

@pboethig
Created August 4, 2016 17:03
<?php
/**
* Created by PhpStorm.
* User: root
* Date: 04.08.16
* Time: 16:04
*/
use Facebook\WebDriver\Remote\RemoteWebDriver;
use Facebook\WebDriver\Remote\WebDriverBrowserType;
use Facebook\WebDriver\Remote\WebDriverCapabilityType;
class GitHubTest extends PHPUnit_Framework_TestCase {
protected $url = 'http://github.com';
/**
* @var \RemoteWebDriver
*/
protected $webDriver;
protected function setUp() {
$this->webDriver = RemoteWebDriver::create(
'http://localhost:4443/wd/hub',
array(
WebDriverCapabilityType::BROWSER_NAME
=> WebDriverBrowserType::CHROME,
)
);
}
protected function tearDown() {
if ($this->webDriver) {
$this->webDriver->quit();
}
}
public function testGitHubHome()
{
$this->webDriver->get($this->url);
// checking that page title contains word 'GitHub'
$this->assertContains('GitHub', $this->webDriver->getTitle());
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment