|
| 1 | +// Copyright (C) 2024 Intel Corporation |
| 2 | +// SPDX-License-Identifier: Apache-2.0 |
| 3 | + |
| 4 | +import { defineConfig, devices } from "@playwright/test"; |
| 5 | + |
| 6 | +/** |
| 7 | + * Read environment variables from file. |
| 8 | + * https://github.com/motdotla/dotenv |
| 9 | + */ |
| 10 | +// require('dotenv').config(); |
| 11 | + |
| 12 | +/** |
| 13 | + * See https://playwright.dev/docs/test-configuration. |
| 14 | + */ |
| 15 | +export default defineConfig({ |
| 16 | + testDir: "./tests", |
| 17 | + /* Maximum time one test can run for. */ |
| 18 | + timeout: 30 * 1000, |
| 19 | + expect: { |
| 20 | + /** |
| 21 | + * Maximum time expect() should wait for the condition to be met. |
| 22 | + * For example in `await expect(locator).toHaveText();` |
| 23 | + */ |
| 24 | + timeout: 5000, |
| 25 | + }, |
| 26 | + /* Run tests in files in parallel */ |
| 27 | + fullyParallel: true, |
| 28 | + /* Fail the build on CI if you accidentally left test.only in the source code. */ |
| 29 | + forbidOnly: !!process.env.CI, |
| 30 | + /* Retry on CI only */ |
| 31 | + retries: process.env.CI ? 2 : 0, |
| 32 | + /* Opt out of parallel tests on CI. */ |
| 33 | + workers: process.env.CI ? 1 : undefined, |
| 34 | + /* Reporter to use. See https://playwright.dev/docs/test-reporters */ |
| 35 | + reporter: [["html", { open: "never" }]], |
| 36 | + /* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */ |
| 37 | + use: { |
| 38 | + /* Maximum time each action such as `click()` can take. Defaults to 0 (no limit). */ |
| 39 | + actionTimeout: 0, |
| 40 | + /* Base URL to use in actions like `await page.goto('/')`. */ |
| 41 | + baseURL: "http://localhost:5173", |
| 42 | + |
| 43 | + /* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */ |
| 44 | + trace: "on-first-retry", |
| 45 | + }, |
| 46 | + |
| 47 | + /* Configure projects for major browsers */ |
| 48 | + projects: [ |
| 49 | + { |
| 50 | + name: "webkit", |
| 51 | + use: { ...devices["Desktop Safari"] }, |
| 52 | + }, |
| 53 | + ], |
| 54 | +}); |
0 commit comments