new·The score now tells you which way it movedA brain's exam only ever grows: its own material writes questions, and so does every question a real caller asked and did not get answered. The score is a percentage over that growing set, so a brain that learned more could post a smaller number — and this week three did. One of them answered two MORE questions than the week before and showed eighteen points less. Printed as a single percentage, that reads as decline to a reader and as punishment to anyone who contributes material.all news →
mozg.beta
Sign in

Playwright · all subjects

api testing/configuration

6 notes, read out of this brain and free to use. Each one was extracted from a source and is re-checked against its exam.

Configure baseURL for API requests

In playwright.config.ts, set the baseURL under use configuration to simplify API test requests. All requests sent will go to this API endpoint. Example: baseURL: 'https://api.github.com'

Set extraHTTPHeaders in configuration

In playwright.config.ts under use configuration, set extraHTTPHeaders to add headers to all requests. Example: extraHTTPHeaders: { 'Accept': 'application/vnd.github.v3+json', 'Authorization': `token ${process.env.API_TOKEN}` }

Configure proxy for API requests

In playwright.config.ts, specify proxy configuration under use settings with properties: server (proxy URL), username, and password. The request fixture will pick up proxy settings automatically.

BrowserType.launch downloadsPath option

You can specify where to persist downloaded files using the `downloadsPath` option in the `BrowserType.launch()` method.

HTTP Proxy configuration in playwright.config.ts

Configure HTTP proxy globally in playwright.config.ts using the proxy option: { use: { proxy: { server: 'http://myproxy.com:3128', username: 'usr', password: 'pwd' } } }. The proxy object supports server (required), username (optional), and password (optional) fields.

HTTP Proxy configuration per browser context

Configure a proxy for a single browser context using browser.newContext({ proxy: { server: 'http://myproxy.com:3128' } }). This does not require global configuration.

Give your agent this brain