Skip to content

Commit 5a7593f

Browse files
committed
Update playwright post
1 parent 0ac064c commit 5a7593f

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

content-org/playwright.org

+5-4
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ To begin, create =flake.nix= file with the following content:
4949
};
5050
}
5151
#+end_src
52-
then enter the development shell and create new virtual env:
52+
then enter the development shell:
5353
#+begin_src bash :no-expand :noeval
5454
nix develop
5555
#+end_src
@@ -75,9 +75,10 @@ We are now ready to start writing tests with Python. Create a new test file with
7575
import re
7676
from playwright.sync_api import Page, expect
7777

78-
page.goto("https://google.co.uk/about")
79-
# Expect a title "to contain" a substring.
80-
expect(page).to_have_title(re.compile("About Google"))
78+
def test_has_title(page: Page):
79+
page.goto("https://google.co.uk/about")
80+
# Expect a title "to contain" a substring.
81+
expect(page).to_have_title(re.compile("About Google"))
8182
#+end_src
8283

8384
** Run test(s)

content/posts/playwright.md

+5-4
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ To begin, create `flake.nix` file with the following content:
5050
}
5151
```
5252

53-
then enter the development shell and create new virtual env:
53+
then enter the development shell:
5454

5555
```bash
5656
nix develop
@@ -85,9 +85,10 @@ We are now ready to start writing tests with Python. Create a new test file with
8585
import re
8686
from playwright.sync_api import Page, expect
8787

88-
page.goto("https://google.co.uk/about")
89-
# Expect a title "to contain" a substring.
90-
expect(page).to_have_title(re.compile("About Google"))
88+
def test_has_title(page: Page):
89+
page.goto("https://google.co.uk/about")
90+
# Expect a title "to contain" a substring.
91+
expect(page).to_have_title(re.compile("About Google"))
9192
```
9293

9394

0 commit comments

Comments
 (0)