2021-09-13 22:05:38 +02:00
import { PlaywrightTestConfig , devices } from '@playwright/test' ;
import path from 'path' ;
// Reference: https://playwright.dev/docs/test-configuration
const config : PlaywrightTestConfig = {
2021-11-11 18:29:57 +01:00
testDir : path.join ( __dirname , '{{testDir}}' ) , /* Test directory */
// timeout: 30 * 1000, /* Timeout per test */
// retries: process.env.CI ? 2 : 0, /* If a test fails on CI, retry it additional 2 times */
// outputDir: 'test-results/', /* Artifacts folder where screenshots, videos, and traces are stored. */
2021-09-13 22:05:38 +02:00
2021-11-11 18:29:57 +01:00
// webServer: { /* Run your local dev server before starting the tests: */
// command: 'npm run start', /* https://playwright.dev/docs/test-advanced#launching-a-development-web-server-during-the-tests */
2021-09-13 22:05:38 +02:00
// port: 3000,
// },
2021-09-15 22:07:50 +02:00
use : {
2021-11-11 18:29:57 +01:00
trace : 'on-first-retry' , /* Retry a test if its failing with enabled tracing (analyse the DOM, console logs, network traffic): https://playwright.dev/docs/trace-viewer */
contextOptions : { /* All available context options: https://playwright.dev/docs/api/class-browser#browser-new-context */
2021-09-15 22:07:50 +02:00
ignoreHTTPSErrors : true ,
} ,
} ,
2021-09-13 22:05:38 +02:00
projects : [
{
2021-11-11 18:29:57 +01:00
name : 'chromium' ,
2021-09-13 22:05:38 +02:00
use : {
2021-09-14 13:14:43 +02:00
. . . devices [ 'Desktop Chrome' ] ,
2021-09-15 22:07:50 +02:00
} ,
} ,
{
2021-11-11 18:29:57 +01:00
name : 'firefox' ,
2021-09-15 22:07:50 +02:00
use : {
. . . devices [ 'Desktop Firefox' ] ,
2021-09-13 22:05:38 +02:00
} ,
} ,
{
2021-11-11 18:29:57 +01:00
name : 'webkit' ,
2021-09-13 22:05:38 +02:00
use : {
2021-09-15 22:07:50 +02:00
. . . devices [ 'Desktop Safari' ] ,
} ,
2021-09-13 22:05:38 +02:00
} ,
2021-11-11 18:29:57 +01:00
/* Test against mobile viewports. */
// {
// name: 'Mobile Chrome',
// use: {
// ...devices['Pixel 5'],
// },
// },
// {
// name: 'Mobile Safari',
// use: devices['iPhone 12'],
// },
2021-09-13 22:05:38 +02:00
] ,
} ;
2021-09-14 13:14:43 +02:00
export default config ;