public/phpmyadmin/test/selenium/TestBase.php
/**
     * Lists browsers to test
     *
     * @return Array of browsers to test
     */
Lists browsers to test
@return Array of browsers to test
Lists browsers to test @return Array of browsers to test
public static function browsers()
    {
        if (! empty($GLOBALS['CI_MODE'] && $GLOBALS['CI_MODE'] != 'selenium')) {
            return;
        }
        if (! empty($GLOBALS['TESTSUITE_BROWSERSTACK_USER'])
            && ! empty($GLOBALS['TESTSUITE_BROWSERSTACK_KEY'])
        ) {
            self::$_selenium_enabled = true;
            $strategy = 'shared';
            $build_local = true;
            $build_id = 'Manual';
            $project_name = 'phpMyAdmin';
            if (getenv('BUILD_TAG')) {
                $build_id = getenv('BUILD_TAG');
                $build_local = false;
                $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' => array_merge(
                    $capabilities,
                    array(
                        'os' => 'Windows',
                    )
                )
            );
            if (empty($GLOBALS['TESTSUITE_FULL'])) {
                return $result;
            }
            $result[] = array(
                'browserName' => 'firefox',
                'host' => 'hub.browserstack.com',
                'port' => 80,
                'timeout' => 30000,
                'sessionStrategy' => $strategy,
                'desiredCapabilities' => $capabilities,
            );
            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();
        }
    }
public static function browsers ( ) { if ( ! empty ( $ GLOBALS [ 'CI_MODE' ] && $ GLOBALS [ 'CI_MODE' ] != 'selenium' ) ) { return ; } if ( ! empty ( $ GLOBALS [ 'TESTSUITE_BROWSERSTACK_USER' ] ) && ! empty ( $ GLOBALS [ 'TESTSUITE_BROWSERSTACK_KEY' ] ) ) { self :: $ _selenium_enabled = true ; $ strategy = 'shared' ; $ build_local = true ; $ build_id = 'Manual' ; $ project_name = 'phpMyAdmin' ; if ( getenv ( 'BUILD_TAG' ) ) { $ build_id = getenv ( 'BUILD_TAG' ) ; $ build_local = false ; $ 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' => array_merge ( $ capabilities , array ( 'os' => 'Windows' , ) ) ) ; if ( empty ( $ GLOBALS [ 'TESTSUITE_FULL' ] ) ) { return $ result ; } $ result [ ] = array ( 'browserName' => 'firefox' , 'host' => 'hub.browserstack.com' , 'port' => 80 , 'timeout' => 30000 , 'sessionStrategy' => $ strategy , 'desiredCapabilities' => $ capabilities , ) ; 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 ( ) ; } }
Lists browsers to test
 @return Array of browsers to test
Lists browsers to test @return Array of browsers to test
/* BrowserStack integration */ /* Only one browser for continuous integration for speed */ /*
            $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',
                    )
                )
            );
            */ /* 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',
                    )
                )
            );
            */