UNPKG

@appetize/create-playwright

Version:

CLI tool to set up Playwright with Appetize

43 lines (37 loc) 1.11 kB
import { defineConfig } from '@playwright/test'; import { AppetizeTestOptions } from '@appetize/playwright'; /** * Read environment variables from file. * https://github.com/motdotla/dotenv */ // require('dotenv').config(); /** * See https://playwright.dev/docs/test-configuration. */ export default defineConfig<AppetizeTestOptions>({ testDir: './tests', outputDir: 'test-results/', timeout: 120 * 1000, expect: { // recommended ratio for screenshot testing toMatchSnapshot: { maxDiffPixelRatio: 0.05, }, }, forbidOnly: !!process.env.CI, retries: process.env.CI ? 3 : 0, reporter: 'line', // correlates to the number of concurrent Appetize sessions at a time workers: 1, fullyParallel: false, use: { trace: 'retain-on-failure', baseURL: 'https://appetize.io', // Appetize session configuration // can be overridden per test suite with test.use({ config: { ... } }) config: { device: '${answers.device}', buildId: '${answers.buildId}' }, }, });