25 private $displayWidths = array(
35 private $width = 1024;
37 private $databaseTester;
40 return "http://".SERVER_HOST.
":".SERVER_PORT;
49 $conn = new \PHPUnit_Extensions_Database_DB_DefaultDatabaseConnection($params[
'connection'], $params[
'dbName']);
50 $this->databaseTester = new \PHPUnit_Extensions_Database_DefaultTester($conn);
51 $this->databaseTester->setSetUpOperation(\PHPUnit_Extensions_Database_Operation_Factory::CLEAN_INSERT());
52 $this->databaseTester->setTearDownOperation(\PHPUnit_Extensions_Database_Operation_Factory::NONE());
53 $this->databaseTester->setDataSet($this->getDataSet());
54 $this->databaseTester->onSetUp();
57 $this->setBrowser(
'firefox');
58 $this->setBrowserUrl(self::getAppUrl());
63 if ($this->databaseTester) {
64 $this->databaseTester->onTearDown();
65 $this->databaseTester = NULL;
74 $window = $this->currentWindow();
78 'width' => $this->width,
84 if (isset($this->displayWidths[$size])) {
85 $this->width = $this->displayWidths[$size];
97 for ($i=0; $i <= $wait; $i++) {
99 $x = $this->byXPath($xpath);
114 protected function login($user, $password) {
115 $this->url(self::getAppUrl());
116 $this->timeouts()->implicitWait(5000);
117 $this->byName(
'user')->value($user);
118 $this->byName(
'password')->value($password);
119 $btn = $this->byXPath(
"//span[contains(text(),'Sign in')]");
login($user, $password)
Log into the application.
SeleniumTestCase is the base class for test cases that run with Selenium.
static createDatabase()
Create the test database, if sqlite is configured.
waitForXpath($xpath, $wait=30)
Wait for a DOM element matching the given xpath.
static initFramework($configPath)
Set up the wcmf framework.