phpmyadmin/test
Maurício Meneghini Fauth de250fbae3 Fix MariaDB 10.2 current_timestamp()
Fixes #13968 and fixes #13999. Closes #14177.

Signed-off-by: Maurício Meneghini Fauth <mauriciofauth@gmail.com>
2018-05-08 07:39:53 -03:00
..
classes Fix MariaDB 10.2 current_timestamp() 2018-05-08 07:39:53 -03:00
libraries Fixed displaying of formatted numeric values for some locales 2017-12-15 11:05:54 +01:00
selenium Fix TableCreateTest::testCreateTable Selenium test 2018-05-06 22:15:27 -03:00
test_data Remove connect_type setting 2017-02-02 16:08:44 +01:00
bootstrap-dist.php Always define PMA_Config in tests 2017-10-25 10:21:18 +02:00
ci-apidocs Build apidocs in Travis 2017-10-02 13:26:21 +02:00
ci-docs Add documentation checks to be executed in Travis CI 2016-10-18 10:26:33 +02:00
ci-install-apidocs Build apidocs in Travis 2017-10-02 13:26:21 +02:00
ci-install-docs Install packages in virtualenv 2017-12-14 13:13:15 +01:00
ci-install-lint Separate install phase per CI modes 2016-02-22 08:05:49 +01:00
ci-install-release Leverage pip cache instead of using apt packages 2017-03-01 16:57:26 +01:00
ci-install-selenium Fix Import-related selenium tests 2017-07-26 20:24:22 +05:30
ci-install-test Add u2f/2fa deps to require-dev 2017-11-23 16:56:52 +01:00
ci-lint Avoid linting removed files 2017-05-15 09:46:45 +02:00
ci-release Rewrite Travis setup 2016-02-22 08:05:49 +01:00
ci-selenium Do not use ant on Travis 2017-03-01 16:51:06 +01:00
ci-test Do not use ant on Travis 2017-03-01 16:51:06 +01:00
Environment_test.php Use PSR-1 for PHPUnit TestCase 2017-11-06 06:29:04 -02:00
install-browserstack Merge branch 'QA_4_6' 2016-12-08 11:42:07 +01:00
install-runkit Avoid using runkit7 for now 2017-08-01 13:49:51 +02:00
nginx.conf Use nginx for running Selenium tests 2017-09-06 19:19:07 +02:00
php-fpm.conf Use nginx for running Selenium tests 2017-09-06 19:19:07 +02:00
php-noprofile.ini Improve Travis setup 2016-01-25 09:01:48 +01:00
php-runkit.ini Do not load runkit extension twice in tests 2016-01-25 09:47:49 +01:00
php.ini Use nginx for running Selenium tests 2017-09-06 19:19:07 +02:00
README.rst Document how to test locally with BrowserStack 2017-07-17 13:39:48 +02:00
start-local-server Use nginx for running Selenium tests 2017-09-06 19:19:07 +02:00

PhpMyAdmin test suite
=====================

This directory is protected from web visitors by a .htaccess file.

For more information on allowing http access to this directory see:
https://httpd.apache.org/docs/current/mod/mod_authz_host.html#allow

Please visit the wiki for more information on unit testing:
https://wiki.phpmyadmin.net/pma/UnitTesting

Selenium tests
--------------

To be able to run Selenium tests, you need to have webserver, database
and Selenium running. Following environment variables configure where
testsuite connects:

TESTSUITE_SERVER
    Database server to use.
TESTSUITE_USER
    Username for connecting to database.
TESTSUITE_PASSWORD
    Password for connecting to database.
TESTSUITE_DATABASE
    Database to use for testing.
TESTSUITE_URL
    URL where tested phpMyAdmin is available.

Additionally you need to configure link to Selenium and browsers. You
can either setup Selenium locally or use BrowserStack automated testing.

For local setup, define following:

TESTSUITE_SELENIUM_HOST
    Host where Selenium is running.
TESTSUITE_SELENIUM_PORT
    Port where to connect.
TESTSUITE_SELENIUM_BROWSER
    Browser to use for testing inside Selenium.

With BrowserStack, set following:

TESTSUITE_BROWSERSTACK_USER
    BrowserStack username.
TESTSUITE_BROWSERSTACK_KEY
    BrowserStack access key.

For example you can use following setup in ``phpunit.xml``::

    <php>
        <env name="TESTSUITE_SERVER" value="localhost"/>
        <env name="TESTSUITE_USER" value="root"/>
        <env name="TESTSUITE_PASSWORD" value="root"/>
        <env name="TESTSUITE_DATABASE" value="test"/>
        <env name="TESTSUITE_URL" value="http://localhost/phpmyadmin/" />
        <env name="TESTSUITE_SELENIUM_HOST" value="127.0.0.1" />
        <env name="TESTSUITE_SELENIUM_PORT" value="4444" />
    </php>

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 &