Add contact_details_test and Refactor personal_details_naming #61
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
name: UI Tests | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
workflow_dispatch: | |
jobs: | |
ui-tests: | |
runs-on: ubuntu-latest | |
steps: | |
# Checkout the repository | |
- uses: actions/checkout@v3 | |
# Setup Python version | |
- name: Set up Python 3.13 | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.13' | |
# Set up virtual environment | |
- name: Set up virtual environment | |
run: | | |
python -m venv .venv | |
source .venv/bin/activate | |
# Install greenlet via pip | |
- name: Install greenlet via pip | |
run: | | |
source .venv/bin/activate | |
pip install greenlet==3.1.1 | |
# Install dependencies via PDM and Playwright Chromium | |
- name: Install dependencies and Playwright | |
run: | | |
source .venv/bin/activate | |
pip install pdm | |
pdm install --prod --no-self --no-editable | |
pdm run playwright install chromium | |
# Install Allure | |
- name: Install Allure | |
run: | | |
sudo apt-get update && sudo apt-get install -y openjdk-17-jre | |
curl -Ls https://repo.maven.apache.org/maven2/io/qameta/allure/allure-commandline/2.30.0/allure-commandline-2.30.0.tgz | tar -xz -C /opt/ | |
sudo ln -s /opt/allure-2.30.0/bin/allure /usr/bin/allure | |
# Run UI tests with Playwright and Allure | |
- name: Run UI tests | |
env: | |
LOGIN: ${{ secrets.LOGIN }} | |
PASSWORD: ${{ secrets.PASSWORD }} | |
run: | | |
source .venv/bin/activate | |
pdm run pytest -sv --alluredir=allure-results | |
continue-on-error: true | |
# List Allure results | |
- name: List Allure results | |
run: ls -la allure-results | |
# Generate Allure report | |
- name: Generate Allure report | |
run: allure generate allure-results --clean -o allure-report | |
# Deploy to GitHub Pages | |
- name: Deploy to GitHub Pages | |
uses: JamesIves/github-pages-deploy-action@v4 | |
with: | |
token: ${{ secrets.CI_TOKEN }} | |
branch: gh-pages | |
folder: allure-report |