Last active
December 14, 2015 15:19
-
-
Save testingbot/5107065 to your computer and use it in GitHub Desktop.
phpunit example with testingbot
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 | |
require_once 'PHPUnit/Extensions/Selenium2TestCase.php'; | |
classGUITest extends \PHPUnit_Extensions_Selenium2TestCase { | |
public function __construct() { | |
$key = '[your api key]'; | |
$secret = '[your api secret]'; | |
$this->setHost("$key:[email protected]"); | |
$this->setPort(80); | |
} | |
protected function setUp() { | |
$this->setBrowser('firefox'); | |
$this->setBrowserUrl('http://[your link]/'); | |
} | |
public function testLoginLinkOnStartpage() { | |
$this->url('http://[your link]/'); | |
$link = $this->byId('link-login'); | |
$link->click(); | |
$this->assertEquals('Anmelden', $this->title()); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment