Open coryhouse opened 1 year ago
Locators can be chained to narrow down the search to a particular part of the page.
Use codegen to quickly write tests
const product = page.getByRole('listitem').filter({ hasText: 'Product 2' });
Set up watch mode to rerun the associated test upon save (this assumes the test file and the test are in the same dir)
Playwright automatically traverses the shadow DOM.
NOTE: If you call expect, but forget to import expect, it will fail the test, but won't tell you why. 🤬
expect
Use project dependencies for running login once
Fail test if there's a console log
"start:codegen": "concurrently npm:start-mocked npm:codegen", "codegen": "playwright codegen --load-storage=storageState.json http://localhost:3000",
Locators can be chained to narrow down the search to a particular part of the page.
Use codegen to quickly write tests
const product = page.getByRole('listitem').filter({ hasText: 'Product 2' });
Set up watch mode to rerun the associated test upon save (this assumes the test file and the test are in the same dir)
Playwright automatically traverses the shadow DOM.
NOTE: If you call expect, but forget to import
expect
, it will fail the test, but won't tell you why. 🤬Use project dependencies for running login once
Fail test if there's a console log
npm scripts