File tree Expand file tree Collapse file tree 3 files changed +17
-19
lines changed
Expand file tree Collapse file tree 3 files changed +17
-19
lines changed Original file line number Diff line number Diff line change @@ -60,19 +60,19 @@ jobs:
6060 run : python build_package.py
6161 - name : Install
6262 run : python -m playwright install
63- - name : Test
63+ - name : Test Sync API
6464 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
6767 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+
7676 test-package-installations :
7777 name : Test package installations
7878 runs-on : ubuntu-latest
Original file line number Diff line number Diff line change 1818from playwright import sync_playwright
1919
2020
21- @pytest .fixture
21+ @pytest .fixture ( scope = "session" )
2222def playwright ():
2323 with sync_playwright () as p :
2424 yield p
2525
2626
27- @pytest .fixture
27+ @pytest .fixture ( scope = "session" )
2828def browser (playwright , browser_name , launch_arguments ):
2929 browser_type = None
3030 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):
174174
175175
176176def 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
183181
184182
185183def test_sync_set_default_timeout (page ):
You can’t perform that action at this time.
0 commit comments