4 This directory is protected from web visitors by a .htaccess file.
6 For more information on allowing http access to this directory see:
7 https://httpd.apache.org/docs/current/mod/mod_authz_host.html#allow
9 Please visit the wiki for more information on unit testing:
10 https://wiki.phpmyadmin.net/pma/Unit_Testing
15 To be able to run Selenium tests, you need to have webserver, database
16 and Selenium running. Following environment variables configure where
20 Username to connect on the interface located at TESTSUITE_URL
22 Password to connect on the interface located at TESTSUITE_URL
23 TESTSUITE_DATABASE_PREFIX
24 Database prefix to use for testing (Avoid database grouping characters like _).
26 URL where tested phpMyAdmin is available.
28 Additionally you need to configure link to Selenium and browsers. You
29 can either setup Selenium locally or use BrowserStack automated testing.
31 For local setup, define following:
33 TESTSUITE_SELENIUM_HOST
34 Host where Selenium is running.
35 TESTSUITE_SELENIUM_PORT
36 Port where to connect.
37 TESTSUITE_SELENIUM_BROWSER
38 Browser to use for testing inside Selenium.
40 With BrowserStack, set following:
42 TESTSUITE_BROWSERSTACK_USER
43 BrowserStack username.
44 TESTSUITE_BROWSERSTACK_KEY
45 BrowserStack access key.
47 For example you can use following setup in ``phpunit.xml``::
50 <env name="TESTSUITE_USER" value="root"/>
51 <env name="TESTSUITE_PASSWORD" value="root"/>
52 <env name="TESTSUITE_DATABASE_PREFIX" value="test"/>
53 <env name="TESTSUITE_URL" value="http://localhost/phpmyadmin/" />
54 <env name="TESTSUITE_SELENIUM_HOST" value="127.0.0.1" />
55 <env name="TESTSUITE_SELENIUM_PORT" value="4444" />
61 We're using our selenium tests on the GitHub CI.
63 To run tests locally, you need to install BrowserStack tool to enable local
64 testing, see their website for instructions:
66 https://www.browserstack.com/local-testing#command-line
68 Following instructions use PHP's built in server for the testing::
70 # Export BrowserStack credentials in the environment:
71 export TESTSUITE_BROWSERSTACK_USER=your_username
72 export TESTSUITE_BROWSERSTACK_KEY=your_key
74 # Port where tests will be running
75 export TESTSUITE_PORT=9000
76 export TESTSUITE_URL=http://127.0.0.1:$TESTSUITE_PORT/
78 # Start PHP built in server
79 php --server 127.0.0.1:$TESTSUITE_PORT > php.log &
81 # Start BrowserStack Local client to forward the traffic
82 ~/browserstack/BrowserStackLocal -localIdentifier Manual "$TESTSUITE_BROWSERSTACK_KEY" 127.0.0.1,$TESTSUITE_PORT,0 &
84 # Stop BrowserStack Local
85 ~/browserstack/BrowserStackLocal --daemon stop