-
-
Notifications
You must be signed in to change notification settings - Fork 95
70 lines (57 loc) · 2.03 KB
/
patchright_tests.yml
File metadata and controls
70 lines (57 loc) · 2.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
name: Patchright Chromium Tests
on:
workflow_dispatch:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
run-playwright-tests:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Install Dependencies
run: |
python -m pip install --upgrade pip
pip install pytest
- name: Install Playwright-Python Package
run: |
git clone https://github.com/microsoft/playwright-python --branch $(curl --silent "https://api.github.com/repos/Kaliiiiiiiiii-Vinyzu/patchright/releases/latest" | grep '"tag_name"' | sed -E 's/.*"([^"]+)".*/\1/')
cd playwright-python
python -m pip install --upgrade pip
pip install -r local-requirements.txt
pip install -e .
pip install black toml
- name: Patch Playwright-Python Package
run: |
python patch_python_package.py
python -m black playwright-python
- name: Build Patchright-Python Package
run: |
cd playwright-python
pip install -e .
for wheel in $(python setup.py --list-wheels); do
PLAYWRIGHT_TARGET_WHEEL=$wheel python -m build --wheel
done
- name: Install Local Patchright Package
run: |
cd playwright-python
pip install dist/patchright-*-manylinux1_x86_64.whl
- name: Install Playwright Browsers
run: |
python -m patchright install --with-deps chromium
- name: Clone Playwright-Python Tests
run: |
cp -r playwright-python/tests ./tests
- name: Modify Tests
run: |
python utils/modify_tests.py
- name: Run Chromium Tests
run: |
xvfb-run pytest --browser=chromium --disable-warnings --timeout 90 tests/sync/
xvfb-run pytest --browser=chromium --disable-warnings --timeout 90 tests/async/