diora-web/playwright.config.js

38 lines
1.1 KiB
JavaScript
Raw Permalink Normal View History

// Playwright config for diora's e2e smoke tests.
//
// Tests run against a real `manage.py runserver` instance backed by its own
// throwaway SQLite database (DIORA_DB_NAME), so they never touch the dev
// database at data/db.sqlite3. See e2e/global-setup.js for how that DB is
// migrated and seeded with a test user.
const path = require('path');
const { defineConfig, devices } = require('@playwright/test');
const { BASE_URL, SERVER_ENV } = require('./e2e/env');
module.exports = defineConfig({
testDir: './e2e',
fullyParallel: false,
workers: 1,
reporter: [['list']],
timeout: 30_000,
use: {
baseURL: BASE_URL,
trace: 'retain-on-failure',
screenshot: 'only-on-failure',
},
projects: [
{
name: 'chromium',
use: { ...devices['Desktop Chrome'] },
},
],
globalSetup: require.resolve('./e2e/global-setup.js'),
webServer: {
command: 'python3 manage.py runserver 127.0.0.1:8000 --noreload',
url: BASE_URL + '/accounts/login/',
reuseExistingServer: !process.env.CI,
timeout: 30_000,
cwd: path.join(__dirname),
env: SERVER_ENV,
},
});