feat: setup e2e

This commit is contained in:
a.bouhuolia
2023-04-13 02:31:56 +02:00
parent bca3e51fdf
commit 7b4b50cf4b
6 changed files with 202 additions and 6 deletions

38
playwright.config.ts Normal file
View File

@@ -0,0 +1,38 @@
import path from 'path';
import { PlaywrightTestConfig, devices } from '@playwright/test';
import dotenv from 'dotenv';
dotenv.config();
// Reference: https://playwright.dev/docs/test-configuration
const config: PlaywrightTestConfig = {
// Timeout per test
timeout: 60 * 1000,
workers: 1,
// Test directory
testDir: path.join(__dirname, 'e2e'),
// If a test fails, retry it additional 2 times
retries: 0,
// Artifacts folder where screenshots, videos, and traces are stored.
outputDir: 'test-results/',
use: {
// Retry a test if its failing with enabled tracing. This allows you to analyse the DOM, console logs, network traffic etc.
// More information: https://playwright.dev/docs/trace-viewer
trace: 'retain-on-failure',
// All available context options: https://playwright.dev/docs/api/class-browser#browser-new-context
// contextOptions: {
// ignoreHTTPSErrors: true,
// },
baseURL: 'http://localhost:4000',
},
projects: [
{
name: 'Desktop Chrome',
use: {
...devices['Desktop Chrome'],
},
},
],
};
export default config;