Skip to content

Commit 5888d91

Browse files
Converted page calls to locator calls
1 parent 19799c2 commit 5888d91

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

tests/test_github_project.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,9 @@ def test_move_project_card(
6363

6464
# Log in via UI
6565
page.goto(f'https://github.com/login')
66-
page.fill('id=login_field', gh_username)
67-
page.fill('id=password', gh_password)
68-
page.click('input[name="commit"]')
66+
page.locator('id=login_field').fill(gh_username)
67+
page.locator('id=password').fill(gh_password)
68+
page.locator('input[name="commit"]').click()
6969

7070
# Load the project page
7171
page.goto(f'https://github.com/users/{gh_username}/projects/{gh_project["number"]}')

tutorial/6-api-testing.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -441,9 +441,9 @@ Log into GitHub like this, using fixtures for username and password:
441441

442442
```python
443443
page.goto(f'https://github.com/login')
444-
page.fill('id=login_field', gh_username)
445-
page.fill('id=password', gh_password)
446-
page.click('input[name="commit"]')
444+
page.locator('id=login_field').fill(gh_username)
445+
page.locator('id=password').fill(gh_password)
446+
page.locator('input[name="commit"]').click()
447447
```
448448

449449
These interactions use `Page` methods we saw before in our DuckDuckGo search test.
@@ -543,9 +543,9 @@ def test_move_project_card(
543543

544544
# Log in via UI
545545
page.goto(f'https://github.com/login')
546-
page.fill('id=login_field', gh_username)
547-
page.fill('id=password', gh_password)
548-
page.click('input[name="commit"]')
546+
page.locator('id=login_field').fill(gh_username)
547+
page.locator('id=password').fill(gh_password)
548+
page.locator('input[name="commit"]').click()
549549

550550
# Load the project page
551551
page.goto(f'https://github.com/users/{gh_username}/projects/{gh_project["number"]}')

0 commit comments

Comments
 (0)