Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.
TypeScript automationchromechromiume2e-testingelectronend-to-end-testingfirefoxjavascriptplaywrighttesttest-automationtestingtesting-toolswebwebkit
docs(fixtures): add rules of thumb for fixture usage (#33472)
Simon Knottae10d56836d3
diff --git a/docs/src/test-fixtures-js.md b/docs/src/test-fixtures-js.mdindex 69c080297f..1d19d0acdb 100644--- a/docs/src/test-fixtures-js.md+++ b/docs/src/test-fixtures-js.md@@ -115,8 +115,8 @@ test.describe('todo tests', () => {### With fixturesFixtures have a number of advantages over before/after hooks:-- Fixtures **encapsulate** setup and teardown in the same place so it is easier to write.-- Fixtures are **reusable** between test files - you can define them once and use in all your tests. That's how Playwright's built-in `page` fixture works.+- Fixtures **encapsulate** setup and teardown in the same place so it is easier to write. So if you have an after hook that tears down what was created in a before hook, consider turning them into a fixture.+- Fixtures are **reusable** between test files - you can define them once and use in all your tests. That's how Playwright's built-in `page` fixture works. So if you have a helper function that is used in multiple tests, consider turning it into a fixture.- Fixtures are **on-demand** - you can define as many fixtures as you'd like, and Playwright Test will setup only the ones needed by your test and nothing else.- Fixtures are **composable** - they can depend on each other to provide complex behaviors.- Fixtures are **flexible**. Tests can use any combinations of the fixtures to tailor precise environment they need, without affecting other tests.