Jump to content

Connect SuperML | Leeroopedia MCP: Equip your AI agents with best practices, code verification, and debugging knowledge. Powered by Leeroo — building Organizational Superintelligence. Contact us at founders@leeroo.com.

Implementation:Getgauge Taiko Gauge Env Properties

From Leeroopedia
Knowledge Sources
Domains Testing, Configuration, Environment
Last Updated 2026-02-12 00:00 GMT

Overview

Concrete mechanism for managing environment-specific test settings through Gauge property files and Taiko's setConfig() runtime API.

Description

Gauge uses .properties files in the env/ directory to configure test execution behavior. The Taiko repository's functional test suite demonstrates this with three property files under test/functional-tests/env/default/:

  • default.properties — Framework configuration: report directory, screenshot behavior, spec directory, log directory.
  • headless.properties — Browser display mode: headless = true.
  • js.properties — Runner settings: test_timeout = 240000, DEBUG = false.

All properties become environment variables at runtime. The hooks.ts lifecycle hooks read these values:

const headless = process.env.headless.toLowerCase() === "true";

Additionally, Taiko's own environment variables control browser behavior:

  • TAIKO_BROWSER_ARGS — Browser launch arguments
  • TAIKO_BROWSER_PATH — Custom browser binary path
  • TAIKO_NAVIGATION_TIMEOUT — Navigation timeout in ms
  • TAIKO_RETRY_TIMEOUT — Element retry timeout in ms

The setConfig() API in @BeforeSuite() hooks provides programmatic runtime configuration:

@BeforeSuite()
public async beforeSuite() {
    await startServer();
    setConfig({ navigationTimeout: 60000 });
}

Usage

This implementation is used when configuring different test execution environments (local development, CI/CD, Docker). Create additional environment directories (e.g., env/ci/) and select them with gauge run --env ci.

Code Reference

Source Location

  • Repository: Taiko
  • Reference Files:
    • test/functional-tests/env/default/ — Property files
    • test/functional-tests/tests/hooks.ts (L53-56) — BeforeSuite with setConfig
    • test/functional-tests/manifest.json — Gauge manifest
    • lib/config.js (L1-47) — Taiko config defaults reading env vars

I/O Contract

Inputs

Name Type Required Default Description
.properties files Key-value text Yes — Gauge property files in env/{envName}/ directories.
Environment variables System env No — TAIKO_* environment variables overriding Taiko defaults.
setConfig options Object No — Runtime config object passed to setConfig() in lifecycle hooks.

Outputs

Name Type Description
Runtime configuration Environment state Properties loaded as environment variables; Taiko config object updated with specified values.

Related Pages

Implements Principle

Requires Environment

See Also

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment