@@ -23,11 +23,10 @@ pip install pytest-playwright
23
23
Basic example for more see the [ examples sections] ( #examples ) as a reference.
24
24
25
25
``` py
26
- def test_is_chromium (page ):
27
- page.goto(" https://www.google.com" )
28
- page.type(" input[name=q]" , " Playwright GitHub" )
29
- page.click(" input[type=submit]" )
30
- page.waitForSelector(" text=microsoft/Playwright" )
26
+ def test_example_is_working (page ):
27
+ page.goto(" https://example.com" )
28
+ page.waitForSelector(" text=Example Domain" )
29
+ page.click(" text=More information" )
31
30
```
32
31
33
32
## Fixtures
@@ -80,8 +79,8 @@ By default, the tests run in headless mode. You can pass the `--headful` CLI fla
80
79
import pytest
81
80
82
81
@pytest.mark.skip_browser (" firefox" )
83
- def test_is_chromium (page ):
84
- page.goto(" https://www.google .com" )
82
+ def test_visit_example (page ):
83
+ page.goto(" https://example .com" )
85
84
# ...
86
85
```
87
86
@@ -91,8 +90,8 @@ def test_is_chromium(page):
91
90
import pytest
92
91
93
92
@pytest.mark.only_browser (" chromium" )
94
- def test_is_chromium (page ):
95
- page.goto(" https://www.google .com" )
93
+ def test_visit_example (page ):
94
+ page.goto(" https://example .com" )
96
95
# ...
97
96
```
98
97
@@ -101,7 +100,7 @@ def test_is_chromium(page):
101
100
Start Pytest with the ` base-url ` argument. Example: ` pytest --base-url http://localhost:8080 `
102
101
103
102
``` py
104
- def test_is_chromium (page ):
103
+ def test_visit_example (page ):
105
104
page.goto(" /admin" )
106
105
# -> Will result in http://localhost:8080/admin
107
106
```
@@ -111,7 +110,7 @@ def test_is_chromium(page):
111
110
``` py
112
111
from playwright.sync_api import Page
113
112
114
- def test_my_test (page : Page):
113
+ def test_visit_admin_dashboard (page : Page):
115
114
page.goto(" /admin" )
116
115
# ...
117
116
```
@@ -132,4 +131,4 @@ provided by the bot. You will only need to do this once across all repos using o
132
131
133
132
This project has adopted the [ Microsoft Open Source Code of Conduct] ( https://opensource.microsoft.com/codeofconduct/ ) .
134
133
For more information see the [ Code of Conduct FAQ] ( https://opensource.microsoft.com/codeofconduct/faq/ ) or
135
- contact [ opencode@microsoft.com ] ( mailto:opencode@microsoft.com ) with any additional questions or comments.
134
+ contact [ opencode@microsoft.com ] ( mailto:opencode@microsoft.com ) with any additional questions or comments.
0 commit comments