@@ -46,9 +46,9 @@ However, the `pytest-playwright` plugin takes care of these things automatically
46
46
* The ` context ` fixture provides a new browser context for a test.
47
47
* The ` page ` fixture provides a new browser page for a test.
48
48
49
- All of the Playwright calls with ` pytest-playwright ` use the synchronous API instead of the async API.
50
- The ` browser ` fixture has session scope, meaning all tests will share one browser instance.
51
- The ` context ` and ` page ` fixtures have function scope, meaning each test gets new ones.
49
+ All the Playwright calls with ` pytest-playwright ` use the synchronous API instead of the async API.
50
+ The ` browser ` fixture has * session* scope, meaning all tests will share one browser instance.
51
+ The ` context ` and ` page ` fixtures have * function* scope, meaning each test gets new ones.
52
52
Typically, a test will only need to call the ` page ` fixture directly.
53
53
These fixtures will also automatically clean up everything after testing is complete.
54
54
You do not need to explicitly close the browser.
@@ -66,13 +66,13 @@ To this:
66
66
def test_basic_duckduckgo_search (page ):
67
67
```
68
68
69
-
70
- ## Navigating to a web page
71
-
72
69
Now the test has access to a fresh page in a new browser context.
73
70
If we write multiple tests, each test will get its own page and context,
74
71
but they will all share the same browser instance.
75
72
73
+
74
+ ## Navigating to a web page
75
+
76
76
Now that we have a page, let's do something on it!
77
77
Our first test step is, "Given the DuckDuckGo home page is displayed".
78
78
Let's [ navigate] ( https://playwright.dev/python/docs/navigations ) to the DuckDuckGo home page like this:
0 commit comments