Skip to content

[Feature Branch] Playwright Migration by Nikhil #417

[Feature Branch] Playwright Migration by Nikhil

[Feature Branch] Playwright Migration by Nikhil #417

Workflow file for this run

name: tests
on:
push:
branches:
- feature-playwright
# - main
pull_request:
types: ["opened", "synchronize", "reopened"]
create:
jobs:
setup-browsers:
name: 🌐 Setup Playwright Browsers
runs-on: ubuntu-latest
timeout-minutes: 15
outputs:
playwright-version: ${{ steps.playwright-version.outputs.version }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install Playwright
run: pip install playwright
- name: Get Playwright version
id: playwright-version
run: echo "version=$(pip show playwright | grep Version | cut -d' ' -f2)" >> $GITHUB_OUTPUT
- name: Cache Playwright browsers
uses: actions/cache@v4
id: playwright-cache
with:
path: ~/.cache/ms-playwright
key: playwright-${{ runner.os }}-${{ steps.playwright-version.outputs.version }}-browsers
restore-keys: |
playwright-${{ runner.os }}-${{ steps.playwright-version.outputs.version }}-
- name: Install browsers
if: steps.playwright-cache.outputs.cache-hit != 'true'
run: |
playwright install chromium firefox
playwright install-deps
test:
name: pf-${{ matrix.pf-version }} (🐍 ${{ matrix.python-version }}, ${{ matrix.browser }})
runs-on: ubuntu-latest
needs: setup-browsers
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
browser: [chromium, firefox]
python-version: ["3.12", "3.13"]
pf-version: ["v5", "v6"]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install Playwright
run: pip install playwright
- name: Restore Playwright browsers cache
uses: actions/cache/restore@v4
with:
path: ~/.cache/ms-playwright
key: playwright-${{ runner.os }}-${{ needs.setup-browsers.outputs.playwright-version }}-browsers
fail-on-cache-miss: true
- name: Install dependencies
run: |
pip install -U pip wheel
pip install .[dev]
- name: Test with pytest
run: |
pytest -v -n 3 --headless --browser=${{ matrix.browser }} --pf-version=${{ matrix.pf-version }} --cov=./ --cov-report=xml --ignore=testing/components/test_slider.py --ignore=testing/components/test_table.py --ignore=testing/components/test_switch.py --ignore=testing/components/test_title.py --ignore=testing/ouia
# - name: Upload coverage to Codecov
# uses: codecov/codecov-action@v4
# with:
# token: ${{ secrets.CODECOV_TOKEN }}
# file: coverage.xml
# flags: unittests
# name: ${{ github.run_id }}-py-${{ matrix.python-version }}-${{ matrix.browser }}