File tree 3 files changed +17
-19
lines changed 3 files changed +17
-19
lines changed Original file line number Diff line number Diff line change @@ -60,19 +60,19 @@ jobs:
60
60
run : python build_package.py
61
61
- name : Install
62
62
run : python -m playwright install
63
- - name : Test
63
+ - name : Test Sync API
64
64
if : matrix.os != 'ubuntu-latest'
65
- run : pytest -vv --browser=${{ matrix.browser }} --junitxml=junit/test-results-${{ matrix.os }}-${{ matrix.python-version }}-${{ matrix.browser }}.xml --timeout 90
66
- - name : Test
65
+ run : pytest -vv tests/sync --browser=${{ matrix.browser }} --timeout 90
66
+ - name : Test Sync API
67
67
if : matrix.os == 'ubuntu-latest'
68
- run : xvfb-run pytest -vv --browser=${{ matrix.browser }} --junitxml=junit/test-results-${{ matrix.os }}-${{ matrix.python-version }}-${{ matrix.browser }}.xml --timeout 90
69
- - name : Upload pytest test results
70
- uses : actions/upload-artifact@v1
71
- with :
72
- name : pytest-results-${{ matrix.os }}-${{ matrix.python-version }}-${{ matrix.browser }}.xml
73
- path : junit/test-results-${{ matrix.os }}-${{ matrix.python-version }}-${{ matrix.browser }}.xml
74
- # Use always() to always run this step to publish test results when there are test failures
75
- if : ${{ always() }}
68
+ run : xvfb-run pytest -vv tests/sync --browser=${{ matrix.browser }} --timeout 90
69
+ - name : Test Async API
70
+ if : matrix.os != 'ubuntu-latest'
71
+ run : pytest -vv tests/async --browser=${{ matrix.browser }} --timeout 90
72
+ - name : Test Async API
73
+ if : matrix.os == 'ubuntu-latest'
74
+ run : xvfb- run pytest -vv tests/async --browser=${{ matrix.browser }} --timeout 90
75
+
76
76
test-package-installations :
77
77
name : Test package installations
78
78
runs-on : ubuntu-latest
Original file line number Diff line number Diff line change 18
18
from playwright import sync_playwright
19
19
20
20
21
- @pytest .fixture
21
+ @pytest .fixture ( scope = "session" )
22
22
def playwright ():
23
23
with sync_playwright () as p :
24
24
yield p
25
25
26
26
27
- @pytest .fixture
27
+ @pytest .fixture ( scope = "session" )
28
28
def browser (playwright , browser_name , launch_arguments ):
29
29
browser_type = None
30
30
if browser_name == "chromium" :
Original file line number Diff line number Diff line change @@ -174,12 +174,10 @@ def test_sync_workers_page_workers(page: Page, server):
174
174
175
175
176
176
def test_sync_playwright_multiple_times ():
177
- with sync_playwright () as pw1 :
178
- assert pw1 .chromium
179
- with pytest .raises (Error ) as exc :
180
- with sync_playwright () as pw2 :
181
- assert pw1 .chromium == pw2 .chromium
182
- assert "Can only run one Playwright at a time." in exc .value .message
177
+ with pytest .raises (Error ) as exc :
178
+ with sync_playwright () as pw :
179
+ assert pw .chromium
180
+ assert "Can only run one Playwright at a time." in exc .value .message
183
181
184
182
185
183
def test_sync_set_default_timeout (page ):
You can’t perform that action at this time.
0 commit comments