Skip to content

Selenium Tests

Selenium Tests #103

Workflow file for this run

name: Selenium Tests
on:
workflow_dispatch: # Allows running manually
schedule:
- cron: '0 0 * * *' # Run each day at 00:00 UTC
jobs:
selenium-tests:
runs-on: macos-latest
env:
DEV_URL: ${{ vars.DEV_URL }}
STAG_URL: ${{ vars.STAG_URL }}
permissions:
checks: write
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Setup Python
uses: actions/setup-python@v3
with:
python-version: "3.10"
- name: Install Chrome and WebDriver if not already installed
run: |
if ! command -v google-chrome &>/dev/null; then
echo "Installing Chrome"
brew install --cask google-chrome
else
echo "Chrome is already installed"
fi
- name: Install Poetry
run: |
python -m pip install --upgrade pip
pip install poetry
- name: Install dependencies with Poetry
run: |
poetry install
- name: Run tests
run: |
poetry run pytest --verbose --junit-xml=test-results.xml --capture=tee-sys
- name: Publish Test Report
uses: mikepenz/action-junit-report@v3
if: success() || failure()
with:
report_paths: '**/test-results.xml'
detailed_summary: true
include_passed: true
- name: Upload Screenshots
if: failure()
uses: actions/upload-artifact@v3
with:
name: screenshots
path: reports/screenshots/*