From 020bc6cf345bb4239e091437de6271c3682023e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?= Date: Mon, 17 Jul 2017 13:39:24 +0200 Subject: [PATCH 1/2] Default BrowserStack tests to use local testing MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It is needed in most cases when doing manual tests. Signed-off-by: Michal Čihař --- test/selenium/TestBase.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/selenium/TestBase.php b/test/selenium/TestBase.php index b52e1617f8..d0f7989bad 100644 --- a/test/selenium/TestBase.php +++ b/test/selenium/TestBase.php @@ -57,11 +57,12 @@ abstract class PMA_SeleniumBase extends PHPUnit_Extensions_Selenium2TestCase self::$_selenium_enabled = true; $strategy = 'shared'; - $build_local = false; + $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')) { From 58c2e7208fc951213420e7a7c223347b44af6a55 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?= Date: Mon, 17 Jul 2017 13:39:38 +0200 Subject: [PATCH 2/2] Document how to test locally with BrowserStack MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Michal Čihař --- test/README.rst | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/test/README.rst b/test/README.rst index b4fffc97d1..0913c347bd 100644 --- a/test/README.rst +++ b/test/README.rst @@ -57,3 +57,31 @@ For example you can use following setup in ``phpunit.xml``:: + +Using BrowserStack +------------------ + +We're using BrowserStack to run our tests on the Travis CI. If you are a team +member, you can be granted access to the team account, but you can register own +account there as well. + +To run tests locally, you need to install BrowserStack tool to enable local +testing, see their website for instructions: + +https://www.browserstack.com/local-testing#command-line + +Following instructions use PHP's built in server for the testing:: + + # Export BrowserStack credentials in the environment: + export TESTSUITE_BROWSERSTACK_USER=your_username + export TESTSUITE_BROWSERSTACK_KEY=your_key + + # Port where tests will be running + export TESTSUITE_PORT=9000 + export TESTSUITE_URL=http://127.0.0.1:$TESTSUITE_PORT/ + + # Start PHP built in server + php --server 127.0.0.1:$TESTSUITE_PORT > php.log & + + # Start BrowserStack Local client to forward the traffic + ~/browserstack/BrowserStackLocal -localIdentifier Manual "$TESTSUITE_BROWSERSTACK_KEY" 127.0.0.1,$TESTSUITE_PORT,0 &