Skip to main content

playwright.config.ts

playwright.config.ts - Overview

  1. Overview This file configures Playwright tests for the Signoz frontend. It sets options such as base URL, retries, and reporting.

  2. Detailed Documentation

config object

  • Purpose: Configuration object for Playwright tests.
  • Type: PlaywrightTestConfig
  • Properties:
    • forbidOnly:
      • Purpose: Forbids the use of .only in tests if running in CI.
      • Type: boolean
      • Value: !!process.env.CI (coerces to boolean)
    • retries:
      • Purpose: Sets the number of retries for failed tests.
      • Type: number
      • Value: process.env.CI ? 2 : 0 (2 retries in CI, 0 otherwise)
    • preserveOutput:
      • Purpose: Preserves test output.
      • Type: string
      • Value: 'always'
    • name:
      • Purpose: Sets the name of the project.
      • Type: string
      • Value: 'Signoz'
    • testDir:
      • Purpose: Specifies the directory containing the tests.
      • Type: string
      • Value: './tests'
    • use:
      • Purpose: Configures options to be used by all tests.
      • Type: object
      • Properties:
        • trace:
          • Purpose: Sets the tracing mode.
          • Type: string
          • Value: 'retain-on-failure'
        • baseURL:
          • Purpose: Sets the base URL for tests.
          • Type: string
          • Value: process.env.PLAYWRIGHT_TEST_BASE_URL || 'http://localhost:3301' (uses environment variable or defaults to http://localhost:3301)
    • updateSnapshots:
      • Purpose: Specifies how snapshots should be updated.
      • Type: string
      • Value: 'all'
    • fullyParallel:
      • Purpose: Runs tests in fully parallel mode if in CI.
      • Type: boolean
      • Value: !!process.env.CI
    • quiet:
      • Purpose: Sets whether to run Playwright in quiet mode.
      • Type: boolean
      • Value: false
    • testMatch:
      • Purpose: Specifies the pattern to match test files.
      • Type: string[]
      • Value: ['**/*.spec.ts']
    • reporter:
      • Purpose: Configures the test reporter.
      • Type: string
      • Value: process.env.CI ? 'github' : 'list' (uses GitHub reporter in CI, list reporter otherwise)

dotenv.config()

  • Purpose: Loads environment variables from a .env file.
  • Parameters: None
  • Returns: Void. Modifies process.env.
  1. Code Examples None

  2. Clarity and Accuracy Documentation reflects the code accurately.

  3. Markdown & MDX Perfection Markdown is valid and well-formatted.

  4. Edge Cases To Avoid Breaking MDX No issues identified.

  5. Getting Started Relevance Include in Getting Started: YES