Skip to content

Instantly share code, notes, and snippets.

@MarcusFelling
Created September 19, 2023 14:49
Show Gist options
  • Save MarcusFelling/dbb6b893676b181ed849308bed707fbc to your computer and use it in GitHub Desktop.
Save MarcusFelling/dbb6b893676b181ed849308bed707fbc to your computer and use it in GitHub Desktop.
import { defineConfig, devices } from '@playwright/test';
export default defineConfig({
use: {
baseURL: 'http://localhost:3000/',
},
projects: [
// Setup project
{
name: 'setup',
testMatch: /.*\.setup\.ts/
},
// Test project that requires authentication
{
name: 'authenticated',
testMatch: /.account\.ts/,
use: {
...devices['Desktop Chrome'],
// Use prepared auth state.
storageState: '.auth/user.json',
},
dependencies: ['setup'],
},
// Test projects that don't require authentication
{
name: 'chromium',
use: {
...devices['Desktop Chrome']
},
},
],
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment