Getting started with Playwright
Installation
# Install Playwright
npm install --save-dev @playwright/test
# Install browser drivers
npx playwright installProject Setup
1. Configuration File
const { defineConfig } = require('@playwright/test');
module.exports = defineConfig({
// Test directory
testDir: './tests/e2e',
// Browser configurations
use: {
baseURL: 'http://localhost:9000', // Typical Aurelia dev server
trace: 'on-first-retry',
screenshot: 'only-on-failure'
},
// Optional: Run in headless or headed mode
headless: true,
// Reporters
reporter: [
['html', { open: 'never' }],
['line']
],
// Timeout settings
timeout: 30000,
expect: {
timeout: 5000
}
});2. Project Structure
Basic Concepts
Writing Your First Test
Running Tests
Aurelia-Specific Considerations
Browser Support
Recommended Next Steps
Last updated
Was this helpful?