Created
August 4, 2016 17:03
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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