Skip to content

Commit

Permalink
feat: add readme and allure report
Browse files Browse the repository at this point in the history
  • Loading branch information
f-necas committed Nov 29, 2024
1 parent 93f3bd4 commit a952a60
Show file tree
Hide file tree
Showing 2 changed files with 84 additions and 0 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/playwright.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
55 changes: 55 additions & 0 deletions README.md
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
```

0 comments on commit a952a60

Please sign in to comment.