Acceptance or UI tests for Joomla are present in the acceptance
folder, there are two major categories of tests
at the moment
- Installation Tests, inside the
acceptance/01-install
folder - Administrator Tests, inside the
acceptance/administrator
folder
Here are the steps that are needed to setup UI tests execution on localhost
- Checkout the Project in your document root folder, and follow the setup guide.
- Navigate to
tests/Codeception
folder and edit configuration fileacceptance.suite.yml
file.- Within the JoomlaBrowser config section change
url
point it to your localhost url - update
database host
database user
&database password
as per your localhost installed DB, these values will be used by installation tests - change
database name
make sure you have a database with this name created on your localhost DB, this will help you avoid errors withJoomlaDb
helper as well. - Within the
Helper/JoomlaDb
section, update the values forhost
dbname
user
password
as per the previous section in the config - Within the
Helper/Acceptance
section, update the values forurl
cmsPath
, point them as per your localhost setup.
- Within the JoomlaBrowser config section change
- Run
./node_modules/.bin/selenium-standalone install
in project to install selenium-standalone server in localhost - Run
./node_modules/.bin/selenium-standalone start
and wait for the messageSelenium Started
- Run the following in project root:
libraries/vendor/bin/codecept run acceptance tests/Codeception/acceptance/install
this will start Chrome in headless mode, to view the test execution in Chrome UI, removeheadless
from capabilities in configuration file
These are the Joomla 4 API (webservices) tests. To run these tests on OSX you will need to install the GNU Sed package with brew install gnu-sed
- Checkout the Project in your document root folder, and follow the [setup guide}(https://docs.joomla.org/Special:MyLanguage/J4.x:Setting_Up_Your_Local_Environment).
- Copy the file
tests/Codeception/api.suite.dist.yml
totests/Codeception/api.suite.yml
. Then edit the REST url in the new file to point it to your localhost url. - Edit the file configuration.php. Set
$secret
='tEstValue'
- see drone-api-run.sh.
Tests with authentication always use the super user credentials for now.
libraries/vendor/bin/codecept run api
You can also run the command with
--debug
to get some extended information.--steps
to print step-by-step execution.--fail-fast
to stop after first failure.