Guest User

Untitled

a guest
Mar 29th, 2023
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import { defineConfig, devices } from "@playwright/experimental-ct-react";
  2. import includePaths from "rollup-plugin-includepaths";
  3. import tsconfigPaths from "vite-tsconfig-paths";
  4.  
  5. const includePathOptions = {
  6.   include: { "~shared": "./src/shared" },
  7.   paths: ["src", "~/*", "~shared/*", "./", "src/shared"],
  8. };
  9.  
  10. /**
  11.  * See https://playwright.dev/docs/test-configuration.
  12.  */
  13. export default defineConfig({
  14.   testDir: "./",
  15.   /* The base directory, relative to the config file, for snapshot files created with toMatchSnapshot and toHaveScreenshot. */
  16.   snapshotDir: "./__snapshots__",
  17.   /* Maximum time one test can run for. */
  18.   timeout: 10 * 1000,
  19.   /* Run tests in files in parallel */
  20.   fullyParallel: true,
  21.   /* Fail the build on CI if you accidentally left test.only in the source code. */
  22.   forbidOnly: !!process.env.CI,
  23.   /* Retry on CI only */
  24.   retries: process.env.CI ? 2 : 0,
  25.   /* Opt out of parallel tests on CI. */
  26.   workers: process.env.CI ? 1 : undefined,
  27.   /* Reporter to use. See https://playwright.dev/docs/test-reporters */
  28.   reporter: "html",
  29.   /* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */
  30.   use: {
  31.     /* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */
  32.     trace: "on-first-retry",
  33.  
  34.     /* Port to use for Playwright component endpoint. */
  35.     ctPort: 3100,
  36.     ctViteConfig: {
  37.       plugins: [includePaths(includePathOptions), tsconfigPaths()],
  38.     },
  39.   },
  40.  
  41.   /* Configure projects for major browsers */
  42.   projects: [
  43.     {
  44.       name: "chromium",
  45.       use: { ...devices["Desktop Chrome"] },
  46.     },
  47.     {
  48.       name: "firefox",
  49.       use: { ...devices["Desktop Firefox"] },
  50.     },
  51.     {
  52.       name: "webkit",
  53.       use: { ...devices["Desktop Safari"] },
  54.     },
  55.   ],
  56. });
  57.  
Advertisement
Add Comment
Please, Sign In to add comment