-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
84 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,31 +16,60 @@ jobs: | |
uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.11' | ||
|
||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install -r tests/requirements.txt | ||
- name: Ensure browsers are installed | ||
run: python -m playwright install --with-deps | ||
|
||
- name: Checkout geOrchestra/docker | ||
uses: actions/checkout@v4 | ||
with: | ||
repository: georchestra/docker | ||
submodules: 'recursive' | ||
ref: 'rbmq-limited' | ||
path: 'docker' | ||
|
||
- name: Launch docker-compose | ||
run: | | ||
cd docker | ||
docker compose up -d --wait --quiet-pull | ||
cd .. | ||
- name: Caddy trust | ||
run: | | ||
wget "https://caddyserver.com/api/download?os=linux&arch=amd64" -O caddy | ||
chmod +x caddy | ||
./caddy trust | ||
- name: Run your tests | ||
run: pytest tests --tracing=retain-on-failure --alluredir=allure-results | ||
|
||
- name: Load test report history | ||
uses: actions/checkout@v3 | ||
continue-on-error: true | ||
with: | ||
ref: gh-pages | ||
path: gh-pages | ||
|
||
- name: Build test report | ||
uses: simple-elf/[email protected] | ||
with: | ||
gh_pages: gh-pages | ||
allure_history: allure-history | ||
allure_results: build/allure-results | ||
|
||
- name: Publish test report | ||
uses: peaceiris/actions-gh-pages@v3 | ||
if: always() | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
publish_branch: gh-pages | ||
publish_dir: allure-history | ||
|
||
- uses: actions/upload-artifact@v4 | ||
if: ${{ !cancelled() }} | ||
with: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
# geOrchestra Playwright Tests | ||
|
||
This project contains automated tests for the geOrchestra web applications using Playwright and pytest. | ||
|
||
## Project Structure | ||
|
||
- `tests/`: Contains the test files. | ||
- `conftest.py`: Configuration file for pytest fixtures. | ||
- `.github/workflows/playwright.yml`: GitHub Actions workflow for running the tests. | ||
|
||
## Prerequisites | ||
|
||
- Python 3.11 | ||
- pip (Python package installer) | ||
- Docker | ||
|
||
## Setup | ||
|
||
1. Install the dependencies: | ||
```sh | ||
python -m pip install --upgrade pip | ||
pip install -r tests/requirements.txt | ||
``` | ||
|
||
2. Ensure Playwright browsers are installed: | ||
```sh | ||
python -m playwright install --with-deps | ||
``` | ||
|
||
3. (If georchestra/docker isn't already cloned) Start the geOrchestra services using Docker: | ||
```sh | ||
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 | ||
``` | ||
## Running Tests | ||
To run the tests locally, use the following command: | ||
```sh | ||
pytest tests --alluredir=allure-results --headed | ||
``` | ||
Remove the `--headed` flag to run the tests in headless mode. | ||
## Generate allure report | ||
To generate the allure report, use the following command: | ||
```sh | ||
allure serve allure-results | ||
``` |