API Request
A typed, flexible HTTP client with schema validation support (JSON Schema, Zod, OpenAPI).
A collection of production-ready utilities from SEON Technologies, designed to make Playwright testing more efficient and maintainable.
Every utility follows the same design: functional core, fixture shell.
// Direct function - explicit dependencies
import { apiRequest } from '@seontechnologies/playwright-utils/api-request'
const result = await apiRequest({ request, method: 'GET', path: '/api/users' })
// Playwright fixture - injected, ready to use
test('example', async ({ apiRequest }) => {
const result = await apiRequest({ method: 'GET', path: '/api/users' })
})Use functions for scripts and simple cases. Use fixtures for test suites.
import { test } from '@seontechnologies/playwright-utils/fixtures'
test('API request with schema validation', async ({ apiRequest }) => {
const { status, body } = await apiRequest({
method: 'GET',
path: '/api/users/123'
}).validateSchema(userSchema)
expect(status).toBe(200)
})import { test } from '@seontechnologies/playwright-utils/network-recorder/fixtures'
test('offline CRUD testing', async ({ page, context, networkRecorder }) => {
await networkRecorder.setup(context)
// First run: records network traffic
// Subsequent runs: plays back from HAR (no backend needed!)
await page.goto('/')
await page.fill('#name', 'Test User')
await page.click('#submit')
})Fixture Import Options
You can import fixtures in multiple ways:
import { test } from '@seontechnologies/playwright-utils/fixtures' - includes all fixturesimport { test } from '@seontechnologies/playwright-utils/network-recorder/fixtures' - specific utility onlymergeTests() to combine fixtures from multiple sources (see Installation)