docs: python installation code block update (#26818)
This commit is contained in:
parent
6629b31a97
commit
0bada4b31b
|
|
@ -47,9 +47,9 @@ playwright install
|
||||||
|
|
||||||
## Add Example Test
|
## Add Example Test
|
||||||
|
|
||||||
Create a `test_my_application.py` file inside the current working directory or in a sub-directory with the code below:
|
Create a file that follows the `test_` prefix convention, such as `test_my_application.py`, inside the current working directory or in a sub-directory with the code below:
|
||||||
|
|
||||||
```py
|
```py title="test_my_application.py"
|
||||||
import re
|
import re
|
||||||
from playwright.sync_api import Page, expect
|
from playwright.sync_api import Page, expect
|
||||||
|
|
||||||
|
|
@ -69,8 +69,8 @@ def test_homepage_has_Playwright_in_title_and_get_started_link_linking_to_the_in
|
||||||
# Click the get started link.
|
# Click the get started link.
|
||||||
get_started.click()
|
get_started.click()
|
||||||
|
|
||||||
# Expects the URL to contain intro.
|
# Expects page to have a heading with the name of Installation.
|
||||||
expect(page).to_have_url(re.compile(".*intro"))
|
expect(page.get_by_role("heading", name="Installation")).to_be_visible()
|
||||||
```
|
```
|
||||||
|
|
||||||
## Running the Example Test
|
## Running the Example Test
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue