Create isolated state
POST a synthetic customer, product, order, task, ticket, booking, employee, or user in your current Lab session.
APIRequestContext · Synthetic data
Exercise request lifecycles, negative responses, authentication, and API-assisted UI workflows against a versioned sandbox that is isolated from WordPress and from other learners.
Owned test data
A useful API test owns its setup and cleanup, asserts more than a 200 response, and makes cookie sharing with the browser explicit.
POST a synthetic customer, product, order, task, ticket, booking, employee, or user in your current Lab session.
Check status, headers, identifiers, types, error shape, and the business value that should change.
Use API setup to reach the user journey faster, then verify the visible behavior without hiding the action under test.
POST to the caller-only reset route and prove another browser context keeps its independent data.
Stable practice surface
Use Playwright’s isolated request fixture when the API test must own its own cookies. Use page.request only when the API call is meant to share the browser context’s session. Whichever path you choose, assert the expected identity boundary.
/practice/api/v1/users for basic CRUD and validation/practice/api/v1/auth/token for synthetic bearer flows/practice/api/v1/store/* for API-to-UI ecommerce work/practice/api/v1/lab/reset for caller-only cleanupLearning objective
Build one owned API lifecycle that creates synthetic state, checks the response contract, verifies the user-visible outcome, and resets cleanly.
Continue learning