Enhance POM structure and improve page object methods (#6) #42
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 | |
jobs: | |
ui-tests: | |
runs-on: ubuntu-latest | |
steps: | |
# Checkout the repository | |
- uses: actions/checkout@v3 | |
# Install dependencies and Playwright browsers | |
- name: Install dependencies and Playwright | |
run: | | |
pip install pdm && pdm install --prod --no-self --no-editable | |
pdm run playwright install chromium | |
# Set environment variable to headless mode | |
- name: Set headless mode | |
run: echo "HEADLESS=true" >> $GITHUB_ENV | |
# Install Allure | |
- name: Install Allure | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y openjdk-17-jre | |
curl -o allure.tgz -Ls https://repo.maven.apache.org/maven2/io/qameta/allure/allure-commandline/2.30.0/allure-commandline-2.30.0.tgz | |
tar -zxvf allure.tgz -C /opt/ | |
sudo ln -s /opt/allure-2.30.0/bin/allure /usr/bin/allure | |
rm allure.tgz | |
# Run UI tests with Playwright and Allure | |
- name: Run UI tests | |
env: | |
LOGIN: ${{ secrets.LOGIN }} | |
PASSWORD: ${{ secrets.PASSWORD }} | |
run: | | |
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 |