2021-09-13 22:05:38 +02:00
// @ts-check
const { devices } = require ( '@playwright/test' ) ;
2021-10-13 17:33:44 -04:00
const path = require ( 'path' ) ;
2021-09-13 22:05:38 +02:00
/ * *
* @ see https : //playwright.dev/docs/test-configuration
2021-10-13 17:33:44 -04:00
* @ type { import ( '@playwright/test' ) . PlaywrightTestConfig }
2021-09-15 22:07:50 +02:00
* /
2021-09-13 22:05:38 +02:00
const config = {
2021-11-11 18:29:57 +01:00
testDir : path . join ( _ _dirname , '{{testDir}}' ) , /* Test directory */
2021-11-11 22:45:07 +01:00
forbidOnly : ! ! process . env . CI , /* Whether to exit with an error if any tests or groups are marked as test.only() or test.describe.only(). Useful on CI. */
retries : process . env . CI ? 2 : 0 , /* If a test fails on CI, retry it additional 2 times */
2021-11-11 18:29:57 +01:00
// timeout: 30 * 1000, /* Timeout per test */
// 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. This allows you to analyse the DOM, console logs, network traffic etc. */
2021-11-11 22:45:07 +01:00
// contextOptions: { /* All available context options: https://playwright.dev/docs/api/class-browser#browser-new-context */
// ignoreHTTPSErrors: true,
// },
2021-09-15 22:07:50 +02:00
} ,
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
module . exports = config ;