phpmyadmin/test
Maurício Meneghini Fauth f9ab9d15ac
Revert "Change icons to use SVG sprite instead of individual images"
This reverts commit d2d416e0cc.

This does not work correctly on Chromium browsers.

Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2023-11-12 18:40:11 -03:00
..
classes Revert "Change icons to use SVG sprite instead of individual images" 2023-11-12 18:40:11 -03:00
javascript Move ./js directory to ./resources/js 2023-10-25 11:24:14 -03:00
selenium Revert "Change icons to use SVG sprite instead of individual images" 2023-11-12 18:40:11 -03:00
stubs Remove SqlParser\Utils\Query::getAll() stub 2023-09-28 12:57:03 -03:00
test_data Allow GIS tests to test against different TCPDF versions 2023-09-06 19:23:17 -03:00
bootstrap-dist.php Rename ./libraries directory to ./app 2023-10-24 16:58:48 -03:00
bootstrap-static.php Rename ./libraries directory to ./app 2023-10-24 16:58:48 -03:00
ci-phplint Return linter exit code in test/ci-phplint 2022-03-06 11:47:05 -03:00
config.e2e.inc.php Always expand Console in Selenium tests 2023-02-26 12:05:55 -03:00
doctum-config.php Rename ./libraries directory to ./app 2023-10-24 16:58:48 -03:00
nginx.conf Update server directory for Selenium CI tests 2023-02-26 21:08:55 +01:00
php-fpm.conf Fix logs system and temp dir for tests 2021-02-09 02:01:23 +01:00
php.ini Update server directory for Selenium CI tests 2023-02-26 21:08:55 +01:00
phpstan-constants.php Move ./cache directory to ./app/cache 2023-10-24 17:24:06 -03:00
README.rst Fix server login and documentation 2021-02-08 22:26:21 +01:00
start-local-server Fix logs system and temp dir for tests 2021-02-09 02:01:23 +01:00
stop-local-server Fix logs system and temp dir for tests 2021-02-09 02:01:23 +01: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/Unit_Testing

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_USER
    Username to connect on the interface located at TESTSUITE_URL
TESTSUITE_PASSWORD
    Password to connect on the interface located at TESTSUITE_URL
TESTSUITE_DATABASE_PREFIX
    Database prefix to use for testing (Avoid database grouping characters like _).
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_USER" value="root"/>
        <env name="TESTSUITE_PASSWORD" value="root"/>
        <env name="TESTSUITE_DATABASE_PREFIX" 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 our selenium tests on the GitHub CI.

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 &

    # Stop BrowserStack Local
    ~/browserstack/BrowserStackLocal --daemon stop