Skip to content

Instantly share code, notes, and snippets.

@testingbot
Last active December 14, 2015 15:19
Show Gist options
  • Save testingbot/5107065 to your computer and use it in GitHub Desktop.
Save testingbot/5107065 to your computer and use it in GitHub Desktop.
phpunit example with testingbot
<?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