Test Configuration
Run your tests against multiple device configurations
The Appetize session configuration lives under use.config in playwright.config.ts. It accepts the same values you can set per session anywhere else. See the JavaScript SDK configuration reference for the full list.
use: {
config: {
buildId: '<your build id>',
device: 'iphone15pro',
osVersion: '18.2',
language: 'fr',
},
}Changing configuration for a suite
test.use overrides the config for a file or a describe block. Changing config starts a new session, so keep it at the top of the suite rather than inside individual tests.
import { test, expect } from '@appetize/playwright'
test.use({
config: {
device: 'nexus5',
},
});
test('app works on nexus5', async ({ session }) => {
// ...
})Unlike projects, test.use merges onto the config it inherits, so you only need to name what changes.
See the Playwright documentation for more on test.use.
Reading the configuration
The resolved config for the current test is available as an argument:
You can also use it to skip tests:
Running against several configurations
To run your suite against more than one device, OS version or app, see Projects.
Last updated
Was this helpful?