File tree Expand file tree Collapse file tree 5 files changed +66
-3
lines changed Expand file tree Collapse file tree 5 files changed +66
-3
lines changed Original file line number Diff line number Diff line change @@ -169,7 +169,7 @@ jobs:
169169 - name : Get conda
170170 uses : conda-incubator/setup-miniconda@v3
171171 with :
172- python-version : 3.12
172+ python-version : 3.9
173173 channels : conda-forge
174174 miniconda-version : latest
175175 - name : Prepare
Original file line number Diff line number Diff line change 3131 - name : Get conda
3232 uses : conda-incubator/setup-miniconda@v3
3333 with :
34- python-version : 3.12
34+ python-version : 3.9
3535 channels : conda-forge
3636 miniconda-version : latest
3737 - name : Prepare
Original file line number Diff line number Diff line change 66 path : .
77
88build :
9- noarch : python
109 number : 0
1110 script : " {{ PYTHON }} -m pip install . --no-deps -vv"
1211 binary_relocation : False
@@ -32,6 +31,9 @@ requirements:
3231 - pyee>=13,<14
3332
3433test : # [build_platform == target_platform]
34+ files :
35+ - scripts/example_sync.py
36+ - scripts/example_async.py
3537 requires :
3638 - pip
3739 imports :
@@ -40,6 +42,9 @@ test: # [build_platform == target_platform]
4042 - playwright.async_api
4143 commands :
4244 - playwright --help
45+ - playwright install --with-deps
46+ - python scripts/example_sync.py
47+ - python scripts/example_async.py
4348
4449about :
4550 home : https://github.com/microsoft/playwright-python
Original file line number Diff line number Diff line change 1+ # Copyright (c) Microsoft Corporation.
2+ #
3+ # Licensed under the Apache License, Version 2.0 (the "License");
4+ # you may not use this file except in compliance with the License.
5+ # You may obtain a copy of the License at
6+ #
7+ # http://www.apache.org/licenses/LICENSE-2.0
8+ #
9+ # Unless required by applicable law or agreed to in writing, software
10+ # distributed under the License is distributed on an "AS IS" BASIS,
11+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+ # See the License for the specific language governing permissions and
13+ # limitations under the License.
14+
15+ import asyncio
16+
17+ from playwright .async_api import async_playwright
18+
19+
20+ async def main () -> None :
21+ async with async_playwright () as p :
22+ for browser_type in [p .chromium , p .firefox , p .webkit ]:
23+ browser = await browser_type .launch ()
24+ page = await browser .new_page ()
25+ assert await page .evaluate ("() => 11 * 11" ) == 121
26+ await browser .close ()
27+
28+
29+ if __name__ == "__main__" :
30+ asyncio .run (main ())
Original file line number Diff line number Diff line change 1+ # Copyright (c) Microsoft Corporation.
2+ #
3+ # Licensed under the Apache License, Version 2.0 (the "License");
4+ # you may not use this file except in compliance with the License.
5+ # You may obtain a copy of the License at
6+ #
7+ # http://www.apache.org/licenses/LICENSE-2.0
8+ #
9+ # Unless required by applicable law or agreed to in writing, software
10+ # distributed under the License is distributed on an "AS IS" BASIS,
11+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+ # See the License for the specific language governing permissions and
13+ # limitations under the License.
14+
15+ from playwright .sync_api import sync_playwright
16+
17+
18+ def main () -> None :
19+ with sync_playwright () as p :
20+ for browser_type in [p .chromium , p .firefox , p .webkit ]:
21+ browser = browser_type .launch ()
22+ page = browser .new_page ()
23+ assert page .evaluate ("() => 11 * 11" ) == 121
24+ browser .close ()
25+
26+
27+ if __name__ == "__main__" :
28+ main ()
You can’t perform that action at this time.
0 commit comments