Skip to content

Instantly share code, notes, and snippets.

View meatnordrink's full-sized avatar

Andrew meatnordrink

View GitHub Profile
@meatnordrink
meatnordrink / playwright_cheatsheet_public.md
Created December 15, 2022 16:37
Playwright Cheatsheet

Playwright

Suggested patterns

Try observing Codegen patterns to get a sense of how you'll actually need to write your awaits.

Playwright can be finicky about how you wait for things (perhaps why Cypress auto-waits). A good pattern:

const myElement = page.locator(someSelector); // note the lack of `await` here; you don't need the await until you're actually trying to assert or perform an action.