Report : https://www.georchestra.org/e2e-tests
This project contains automated tests for the geOrchestra web applications using Playwright and pytest.
- Python 3.11
- pip (Python package installer)
- Docker
-
Install the dependencies:
python -m pip install --upgrade pip pip install -r requirements.txt
-
Ensure Playwright browsers are installed:
python -m playwright install --with-deps
-
(If georchestra/docker isn't already cloned) Start the geOrchestra services using Docker:
git clone https://github.com/georchestra/docker.git cd docker docker compose up -d --wait cd .. wget "https://caddyserver.com/api/download?os=linux&arch=amd64" -O caddy chmod +x caddy ./caddy trust
-
Change base url in
pytest.ini
file to match your local geOrchestra instance:
[pytest]
addopts = --base-url=https://georchestra-127-0-0-1.nip.io
To help generate a new test, you can use the following command:
python -m playwright codegen https://<your-sdi>
It will open a browser and you can interact with the website. At the end, it will generate a Python script with the interactions you made.
To run the tests locally, use the following command:
pytest tests --alluredir=allure-results --headed
Remove the --headed
flag to run the tests in headless mode.
To generate the allure report, use the following command:
allure serve allure-results
Create a folder where you put your specific tests and create a Dockerfile with the following content:
FROM georchestra/e2e-tests:latest
COPY mytests /app/tests/mytests