Translated using Weblate.
[phpmyadmin.git] / test / selenium / PmaSeleniumTestCase.php
blob669dc8dbb791b3e99fd56f340e5584a374237c22
1 <?php
2 /* vim: set expandtab sw=4 ts=4 sts=4: */
3 /**
4 * Selenium parent class for TestCases
6 * @package PhpMyAdmin-test
7 * @group Selenium
8 */
10 // Optionally add the php-client-driver to your include path
11 //set_include_path(get_include_path() . PATH_SEPARATOR . '/opt/selenium-remote-control-1.0.1/selenium-php-client-driver-1.0.1/PEAR/');
13 // Include the main phpMyAdmin user config
14 // currently only $cfg['Test'] is used
15 require_once 'config.sample.inc.php';
19 class PmaSeleniumTestCase extends PHPUnit_Extensions_SeleniumTestCase
21 protected $selenium;
22 protected $cfg;
24 protected $captureScreenshotOnFailure = true;
25 protected $screenshotPath = '/var/www/screenshots';
26 protected $screenshotUrl = 'http://localhost/screenshots';
28 public function setUp()
30 global $cfg;
31 $this->cfg =& $cfg;
32 //PHPUnit_Extensions_SeleniumTestCase::$browsers = $this->cfg['Test']['broswers'];
34 $this->setBrowserUrl(TESTSUITE_PHPMYADMIN_HOST . TESTSUITE_PHPMYADMIN_URL);
36 $this->start();
39 public function tearDown()
41 $this->stop();
44 /**
45 * perform a login
47 public function doLogin()
49 $this->open(TESTSUITE_PHPMYADMIN_URL);
50 // Somehow selenium does not like the language selection on the cookie login page, forced English in the config for now.
51 //$this->select("lang", "label=English");
53 $this->waitForPageToLoad("30000");
54 $this->type("input_username", TESTSUITE_USER);
55 $this->type("input_password", TESTSUITE_PASSWORD);
56 $this->click("input_go");
57 $this->waitForPageToLoad("30001");
61 * Just a dummy to show some example statements
63 public function mockTest()
65 // Slow down the testing speed, ideal for debugging
66 //$this->setSpeed(4000);