This project contains the end-to-end tests for the atoolo suite. Two containers are provided for the tests via docker-compose.yaml.
solr- Solr server for the searchesphp- PHP container with Apache web server in which the test project runsmailer- Mailpit email testing tool
All containers are recreated for each test run. See run.sh.
The tests run a Symfony project that uses the Atoolo suite. This project is rebuilt for each test run. See install-app.sh.
The Solr index is also recreated for each test run, using the resources stored in the resources directory.
The tests themselves are not executed in the container but on the host system. All tests are stored in the tests directory.
Host entries are required
/etc/hosts:
127.0.1.1 atoolo-e2e-test www-atoolo-e2e-test ies-atoolo-e2e-test
- Solr: http://localhost:9091/solr/
- Mailpit: http://localhost:8025/
- Atoolo GraphQL project: http://localhost:9090/api/graphql/
- Atoolo Form API project: http://localhost:9090/api/form/
To run the tests, the command bin/run.sh must be executed.
The GraphQL tests are stored in the directory test/GraphQL. Only one test class Test.php exists here. This test reads all *.graphql files below the directory test/GraphQL/resources and executes them. In addition to the *.graphql file, there must always be a *.result.json file in which the expected results are stored.
To test functions that access the IES server, a fake IES server is required. This runs in the directory ies-faker and provides the required routes via a simple PHP script (index.php). The IES faker can be accessed internally via the host ies-atoolo-e2e-test.
The Symfony project created for the tests can, for example, be extended with your own resources that are required for the tests. After installing and setting up the Symfony project, the 'docker/php/app' directory is copied to the Symfony project and the Symfony cache is updated.
The project against which the tests are executed can also be reached from outside the container via http. For this purpose, the port 9090 is mapped to the host in docker-compose.yaml. The project runs under the VirtualHost atoolo-e2e-test.
The project can be reached with e.g. via curl
url -H "Host: atoolo-e2e-test" http://localhost:9090The Solr server can also be reached from outside. The port 9091 is mapped to the host. The Solr GUI can be reached with
In the php container xdebug is set up. The application path in the container is /apps/atoolo-e2e-test. The application can be reached via port 9090 (if not changed in docker-compose.yaml) via the host atoolo-e2e-test.
xdebug can be activated by setting the environment variables XDEBUG_MODE and XDEBUG_SESSION in docker-compose.yaml for the php service.
php:
environment:
XDEBUG_MODE: debug,develop,profile
XDEBUG_SESSION: PHPSTORMTo set up debugging with PHPStorm, a new server with the host atoolo-e2e-test and the port 9090 must be set up in the settings for an Atoolo project (e.g. atoolo/graphql-search-bundle) in PHP / Servers. The path mapping must be activated. And e.g. the path /home/user/git/atoolo-graph-serach-bundle must be mapped to the server path /apps/atoolo-e2e-test/vendor/atoolo/graphql-search-bundle.