Skip to content
masterclass Buddy

Playwright · Function

test.beforeAll

test.beforeAll registers setup that runs once per worker before the applicable tests. Use it for file-level or describe-group setup, and pair it with test.afterAll for cleanup.

Last updated

Since
v1.10

Syntax

test.beforeAll(hookFunction)
test.beforeAll(title, hookFunction)

In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.

Subscribe
  • test.afterAll
  • test.beforeEach
  • test.describe
  • test.use
  • TestInfo

Source: Playwright Test. Checked 2026-11-03.