Merge pull request #12 from hbkandhi12/e2e_test #22
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: Playwright - Pytest automation suite | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: [3.11] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install Poetry | |
run: pip install poetry | |
- name: Cache Poetry Virtualenv | |
id: cache-poetry | |
uses: actions/cache@v4 | |
with: | |
path: .venv | |
key: poetry-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }} | |
restore-keys: | | |
poetry-${{ runner.os }}- | |
- name: Install Dependencies | |
run: poetry install --no-interaction | |
- name: Install Playwright Browsers | |
run: poetry run playwright install --with-deps | |
- name: Run tests and generate allure reports | |
run: poetry run pytest --alluredir=allure-results | |
- name: Generate Allure Report | |
run: | | |
mkdir -p allure-report | |
allure generate allure-results -o allure-report --clean | |
- name: Deploy Allure Report to GitHub Pages | |
uses: peaceiris/actions-gh-pages@v3 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_branch: gh-pages | |
publish_dir: ./allure-report | |
keep_files: true # Keeps old files instead of deleting them |