Skip to content

Remove Hyperbrowser sponsorship #31

Remove Hyperbrowser sponsorship

Remove Hyperbrowser sponsorship #31

name: Patchright Chromium Tests
on:
workflow_dispatch:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
run-patchright-tests:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v6
- name: Install uv
uses: astral-sh/setup-uv@v7
- name: Set up Python
run: |
uv python install
- name: Install Playwright-Python Package
run: |
uv sync --all-groups
git clone https://github.com/microsoft/playwright-python --branch $(curl --silent "https://api.github.com/repos/Kaliiiiiiiiii-Vinyzu/patchright-python/releases/latest" | grep '"tag_name"' | sed -E 's/.*"([^"]+)".*/\1/')
cd playwright-python
uv add -r local-requirements.txt
- name: Patch Playwright-Python Package
run: |
uv run patch_python_package.py
uvx ruff format playwright-python
- name: Build Patchright-Python Package
run: |
cd playwright-python
uv pip install -e .
for wheel in $(python setup.py --list-wheels); do
PLAYWRIGHT_TARGET_WHEEL=$wheel uv build --wheel
done
- name: Install Local Patchright Package
run: |
cd playwright-python
uv pip install dist/patchright-*-manylinux1_x86_64.whl
- name: Install Chromium with Patchright
run: |
uv run patchright install --with-deps chromium
- name: Clone Playwright-Python Tests
run: |
cp -r playwright-python/tests ./tests
- name: Modify Tests
run: |
uv run utils/modify_tests.py
- name: Run Chromium Tests
run: |
xvfb-run -a uv run pytest --browser=chromium --disable-warnings --timeout 90 tests/sync/
xvfb-run -a uv run pytest --browser=chromium --disable-warnings --timeout 90 tests/async/