You write five tests for the contacts page. Every one begins with the same two lines. Copying them is tedious, and when the flow changes you edit five places.
A hook is code that runs around your tests automatically.
beforeEach, afterEach, beforeAll and afterAll. Choosing between them is a decision about test independence.
You write five tests for the contacts page. Every one begins with the same two lines. Copying them is tedious, and when the flow changes you edit five places.
A hook is code that runs around your tests automatically.
full course
The Foundations track and the first lessons in each framework are free. This lesson needs full course access. A course plan includes all lessons for Playwright, Cypress and Selenium.
See course plans →