Skip to content

Commit

Permalink
test: Update the playwright config
Browse files Browse the repository at this point in the history
  • Loading branch information
gorzelinski committed Sep 24, 2024
1 parent 1a1c895 commit 35ccbab
Showing 1 changed file with 1 addition and 35 deletions.
36 changes: 1 addition & 35 deletions playwright.config.ts
Original file line number Diff line number Diff line change
@@ -1,39 +1,18 @@
import { defineConfig, devices } from '@playwright/test'
import { getAbsoluteURL } from './lib'

/**
* Read environment variables from file.
* https://github.com/motdotla/dotenv
*/
// import dotenv from 'dotenv';
// dotenv.config({ path: path.resolve(__dirname, '.env') });

/**
* See https://playwright.dev/docs/test-configuration.
*/
export default defineConfig({
testDir: './e2e',
/* Run tests in files in parallel */
fullyParallel: true,
/* Fail the build on CI if you accidentally left test.only in the source code. */
forbidOnly: !!process.env.CI,
/* Retry on CI only */
retries: process.env.CI ? 2 : 0,
/* Opt out of parallel tests on CI. */
workers: process.env.CI ? 1 : undefined,
/* Reporter to use. See https://playwright.dev/docs/test-reporters */
reporter: 'html',
/* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */
use: {
/* Base URL to use in actions like `await page.goto('/')`. */
baseURL: getAbsoluteURL('/'),

/* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */
trace: 'on-first-retry',
locale: 'en-US'
},

/* Configure projects for major browsers */
projects: [
{
name: 'chromium',
Expand All @@ -49,8 +28,6 @@ export default defineConfig({
name: 'webkit',
use: { ...devices['Desktop Safari'] }
},

/* Test against mobile viewports. */
{
name: 'Mobile Chrome',
use: { ...devices['Pixel 5'] }
Expand All @@ -59,22 +36,11 @@ export default defineConfig({
name: 'Mobile Safari',
use: { ...devices['iPhone 12'] }
}

/* Test against branded browsers. */
// {
// name: 'Microsoft Edge',
// use: { ...devices['Desktop Edge'], channel: 'msedge' },
// },
// {
// name: 'Google Chrome',
// use: { ...devices['Desktop Chrome'], channel: 'chrome' },
// },
],

/* Run your local dev server before starting the tests */
webServer: {
command: 'npm run build && npm run start',
url: getAbsoluteURL('/'),
timeout: 120 * 1000,
reuseExistingServer: !process.env.CI
}
})

0 comments on commit 35ccbab

Please sign in to comment.