There are two ways to run the integration tests. In docker containers or on the host machine.
- build the required docker images with
docker compose build
- have the QHAna docker compose running
- start the docker compose of the integration tests with
docker compose up
To see what is going on inside the Firefox container, open the URL http://localhost:7900 in your browser, click on connect and login with the password secret
.
- install poetry
- install dependencies with
poetry install
- have the QHAna docker compose running
- run integration tests on Firefox or Chrome
- Firefox:
poetry run python -m unittest src.plugin_tests
- Chrome:
INTEGRATION_TEST_BROWSER=chrome poetry run python -m unittest src.plugin_tests
- Firefox:
The first run can take a while to start, because it needs to download the driver for the browser.
The last output of the integration-tests
container or the command on the host machine should look like this:
----------------------------------------------------------------------
Ran 2 tests in 116.572s
OK
If you get timeout errors or errors indicating that an element could not be found, one possible solution could be that you need to increase the sleep time.
To do that change the environment variable INTEGRATION_TEST_SLEEP_TIME
to a higher value.
For the integration-tests
container you can do that in the docker-compose.yml
file and for the command on the host machine you can prepend e.g. INTEGRATION_TEST_SLEEP_TIME=5
.