qa-wolf/playwright.config.js

79 lines
2.1 KiB
JavaScript
Raw Normal View History

2024-09-09 16:34:06 -04:00
// @ts-check
2024-09-10 14:37:26 -04:00
const { defineConfig, devices } = require("@playwright/test");
2024-09-09 16:34:06 -04:00
/**
* Read environment variables from file.
* https://github.com/motdotla/dotenv
*/
// require('dotenv').config();
/**
* @see https://playwright.dev/docs/test-configuration
*/
module.exports = defineConfig({
2024-09-10 14:37:26 -04:00
testDir: "./tests",
2024-09-09 16:34:06 -04:00
/* 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 */
2024-09-10 14:37:26 -04:00
reporter: "html",
2024-09-09 16:34:06 -04:00
/* 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: 'http://127.0.0.1:3000',
/* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */
2024-09-10 14:37:26 -04:00
trace: "on-first-retry",
2024-09-09 16:34:06 -04:00
},
/* Configure projects for major browsers */
projects: [
{
2024-09-10 14:37:26 -04:00
name: "chromium",
use: { ...devices["Desktop Chrome"], headless: false },
2024-09-09 16:34:06 -04:00
},
2024-09-10 14:37:26 -04:00
// {
// name: 'firefox',
// use: { ...devices['Desktop Firefox'] },
// },
2024-09-09 16:34:06 -04:00
2024-09-10 14:37:26 -04:00
// {
// name: 'webkit',
// use: { ...devices['Desktop Safari'] },
// },
2024-09-09 16:34:06 -04:00
/* Test against mobile viewports. */
// {
// name: 'Mobile Chrome',
// use: { ...devices['Pixel 5'] },
// },
// {
// 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 start',
// url: 'http://127.0.0.1:3000',
// reuseExistingServer: !process.env.CI,
// },
});