e2e_tests/README.md
Daniel 2dd765a974 various (#16)
* add full integration test of cli / pytest_abra with all tests

* save path of runner_*.py in runner subclass to improve test discovery -> allows for same test name in two different runners

* reorganize output dir names

* use URL fixture everywhere

* rework coordinator interface

* add --session_id to cli args

* add log results table

* plenty of refactoring

* add assert messages

* add plenty of tests

* add /docs dir with plenty of documentation

* fix authentik setup

* add authentik cleanup, remove test user

* add random test user credential generation and integrate into test routine. random creds are saved to STATES

Reviewed-on: local-it-infrastructure/e2e_tests#16
Co-authored-by: Daniel <d.brummerloh@gmail.com>
Co-committed-by: Daniel <d.brummerloh@gmail.com>
2023-12-14 14:03:58 +01:00

69 lines
1.7 KiB
Markdown

# pytest-abra
Pytest-Abra is an installable python package baed on pytest, designed to test instances created with [abra](https://docs.coopcloud.tech/abra/). After installation, you will have two things:
- `abratest` CLI command. *Used to initialize the testing.*
- `pytest-abra` Pytest plugin. *Automatically loads custom fixtures in any pytest run (see `pytest_abra/custom_fixtures.py`)*
# Usage
Pytest-abra can easily be installed on any system but also offers a Docker image. To use pytest-abra, follow these steps:
## Usage [without Docker]
### Installation [without Docker]
To clone with submodules, use these git commands:
```bash
git clone --recurse-submodules <repository>
// optional:
git submodule update --init // add submodule after normal cloning
git submodule update --remote // update submodules
```
Create a python environment and install all dependencies via
```bash
pip install -e .
playwright install
```
### Run [without Docker]
Run the helper script or directly use the cli command (see docs)
```bash
python main.py # run pytest-abra
abratest [options]
```
## Usage [with docker]
### Installation [with docker]
To clone with submodules, use these git commands:
```bash
git clone --recurse-submodules <repository>
// optional:
git submodule update --init // add submodule after normal cloning
git submodule update --remote // update submodules
```
Build the image
```bash
docker compose build # build the image
docker compose build --no-cache # Force rebuild without cache
```
### Run [with docker]
Run the script
```bash
docker compose run --rm app python main.py # run pytest-abra
docker compose run --rm -it app /bin/bash # use the container interactively
```