상속: extends PHPUnit_Extensions_Selenium2TestCase
 /**
  * Setup the browser environment to run the selenium test case
  *
  * @return void
  */
 public function setUp()
 {
     parent::setUp();
     $this->dbQuery("CREATE TABLE `test_table` (" . " `id` int(11) NOT NULL AUTO_INCREMENT," . " `val` int(11) NOT NULL," . " `val2` int(11) NOT NULL," . " PRIMARY KEY (`id`)" . ")");
     $this->dbQuery("INSERT INTO test_table (val) VALUES (22)");
     $this->dbQuery("INSERT INTO test_table (val) VALUES (33)");
 }
 /**
  * Setup the browser environment to run the selenium test case
  *
  * @return void
  */
 public function setUp()
 {
     parent::setUp();
     $this->skipIfNotSuperUser();
     $this->_txtUsername = '******';
     $this->_txtPassword = '******';
 }
예제 #3
0
 /**
  * Lists browsers to test
  *
  * @return Array of browsers to test
  */
 public static function browsers()
 {
     if (!empty($GLOBALS['TESTSUITE_BROWSERSTACK_USER']) && !empty($GLOBALS['TESTSUITE_BROWSERSTACK_KEY'])) {
         /* BrowserStack integration */
         self::$_selenium_enabled = true;
         $strategy = 'shared';
         $build_local = false;
         $build_id = 'Manual';
         $project_name = 'phpMyAdmin';
         if (getenv('BUILD_TAG')) {
             $build_id = getenv('BUILD_TAG');
             $strategy = 'isolated';
             $project_name = 'phpMyAdmin (Jenkins)';
         } elseif (getenv('TRAVIS_JOB_NUMBER')) {
             $build_id = 'travis-' . getenv('TRAVIS_JOB_NUMBER');
             $build_local = true;
             $strategy = 'isolated';
             $project_name = 'phpMyAdmin (Travis)';
         }
         $capabilities = array('browserstack.user' => $GLOBALS['TESTSUITE_BROWSERSTACK_USER'], 'browserstack.key' => $GLOBALS['TESTSUITE_BROWSERSTACK_KEY'], 'browserstack.debug' => false, 'project' => $project_name, 'build' => $build_id);
         if ($build_local) {
             $capabilities['browserstack.local'] = $build_local;
             $capabilities['browserstack.localIdentifier'] = $build_id;
             $capabilities['browserstack.debug'] = true;
         }
         $result = array();
         $result[] = array('browserName' => 'chrome', 'host' => 'hub.browserstack.com', 'port' => 80, 'timeout' => 30000, 'sessionStrategy' => $strategy, 'desiredCapabilities' => $capabilities);
         /* Only one browser for continuous integration for speed */
         if (empty($GLOBALS['TESTSUITE_FULL'])) {
             return $result;
         }
         /*
         $result[] = array(
             'browserName' => 'Safari',
             'host' => 'hub.browserstack.com',
             'port' => 80,
             'timeout' => 30000,
             'sessionStrategy' => $strategy,
             'desiredCapabilities' => array_merge(
                 $capabilities,
                 array(
                     'os' => 'OS X',
                     'os_version' => 'Mavericks',
                 )
             )
         );
         */
         $result[] = array('browserName' => 'firefox', 'host' => 'hub.browserstack.com', 'port' => 80, 'timeout' => 30000, 'sessionStrategy' => $strategy, 'desiredCapabilities' => $capabilities);
         /* TODO: testing is MSIE is currently broken, so disabled
            $result[] = array(
                'browserName' => 'internet explorer',
                'host' => 'hub.browserstack.com',
                'port' => 80,
                'timeout' => 30000,
                'sessionStrategy' => $strategy,
                'desiredCapabilities' => array_merge(
                    $capabilities,
                    array(
                        'os' => 'windows',
                        'os_version' => '7',
                    )
                )
            );
            */
         return $result;
     } elseif (!empty($GLOBALS['TESTSUITE_SELENIUM_HOST'])) {
         self::$_selenium_enabled = true;
         return array(array('browserName' => $GLOBALS['TESTSUITE_SELENIUM_BROWSER'], 'host' => $GLOBALS['TESTSUITE_SELENIUM_HOST'], 'port' => intval($GLOBALS['TESTSUITE_SELENIUM_PORT'])));
     } else {
         return array();
     }
 }
 /**
  * Setup the browser environment to run the selenium test case
  *
  * @return void
  */
 public function setUp()
 {
     parent::setUp();
     /* TODO: For now this tests needs superuser for deleting database */
     $this->skipIfNotSuperUser();
 }
 /**
  * Setup the browser environment to run the selenium test case
  *
  * @return void
  */
 public function setUp()
 {
     parent::setUp();
     $this->dbQuery("CREATE TABLE `test_table` (" . " `id` int(11) NOT NULL AUTO_INCREMENT," . " `name` varchar(20) NOT NULL," . " `datetimefield` datetime NOT NULL," . " PRIMARY KEY (`id`)" . ")");
 }
 /**
  * Setup the browser environment to run the selenium test case
  *
  * @return void
  */
 public function setUp()
 {
     parent::setUp();
     $this->dbQuery("CREATE TABLE `test_table` (" . " `id` int(11) NOT NULL AUTO_INCREMENT," . " `name` varchar(20) NOT NULL," . " `datetimefield` datetime NOT NULL," . " PRIMARY KEY (`id`)" . ")");
     $this->dbQuery("INSERT INTO `test_table` (`id`, `name`, `datetimefield`) VALUES" . " (1, 'abcd', '2011-01-20 02:00:02')," . " (2, 'foo', '2010-01-20 02:00:02')," . " (3, 'Abcd', '2012-01-20 02:00:02')");
 }
 /**
  * Setup the browser environment to run the selenium test case
  *
  * @return void
  */
 public function setUp()
 {
     parent::setUp();
     $this->dbQuery("CREATE TABLE `test_table` (" . " `id` int(11) NOT NULL AUTO_INCREMENT," . " `val` int(11) NOT NULL," . " `val2` varchar(64) NOT NULL," . "PRIMARY KEY(id)" . ")");
 }