Skip to content

Comments

fix: update deprecated Playwright API usage in running-code docs#277

Closed
willcoliveira wants to merge 1 commit intomicrosoft:mainfrom
willcoliveira:fix/update-deprecated-playwright-apis
Closed

fix: update deprecated Playwright API usage in running-code docs#277
willcoliveira wants to merge 1 commit intomicrosoft:mainfrom
willcoliveira:fix/update-deprecated-playwright-apis

Conversation

@willcoliveira
Copy link

Summary

  • Replace deprecated page.click(), page.fill(), page.waitForSelector() with modern page.locator() equivalents in running-code.md
  • Fix Promise.all race condition anti-pattern in file download example

Test plan

  • Verify all code examples in running-code.md use current Playwright APIs
  • Confirm no deprecated methods remain (page.click, page.fill, page.waitForSelector)

@willcoliveira
Copy link
Author

@microsoft-github-policy-service agree

playwright-cli run-code "async page => {
try {
await page.click('.maybe-missing', { timeout: 1000 });
await page.locator('.maybe-missing').click({ timeout: 1000 });
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be even better to instruct it to use role locators

Copy link
Member

@yury-s yury-s left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@yury-s
Copy link
Member

yury-s commented Feb 24, 2026

Feel free to open a PR in the main repo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants