Implementation:Getgauge Taiko Gauge Run
Appearance
| Knowledge Sources | |
|---|---|
| Domains | Testing, CI_CD, Test_Execution |
| Last Updated | 2026-02-12 00:00 GMT |
Overview
External tool procedure for running Gauge test suites with Taiko browser automation, including reporting, parallel execution, and containerized deployment.
Description
gauge run is the Gauge CLI command that orchestrates the full test execution lifecycle. The Taiko repository's functional test suite defines its execution in test/functional-tests/package.json:
{
"scripts": {
"test": "gauge run -v --tags=\\!knownIssue --simple-console"
}
}
Execution Lifecycle:
- Suite Initialization — Executes
@BeforeSuite()hooks (starts test server, callssetConfig()). - Specification Discovery — Scans
specs/for.specfiles, filtered by tags. - Per Scenario:
- Execute
@BeforeScenario()(opens browser). - Execute steps by matching step text to
@Step()methods. - On failure: invoke
@CustomScreenshotWriter(). - Execute
@AfterScenario()(closes browser).
- Execute
- Suite Teardown — Executes
@AfterSuite()(stops server). - Report Generation — HTML reports in
gauge_reports_dir.
Key features:
- Tag filtering —
gauge run --tags "smoke"or--tags "\!knownIssue" - Parallel execution —
gauge run --parallelorgauge run -p -n=4 - Environment selection —
gauge run --env ci - Containerized execution — Docker with
--no-sandbox,--disable-dev-shm-usageflags
Usage
This implementation is used when executing the test suite locally, in CI/CD pipelines, or in Docker containers.
Code Reference
Source Location
- Repository: Taiko
- Reference Files:
test/functional-tests/package.json— npm test scriptdocs/integrating_with_test_runners.md— Runner integration guidedocs/taiko_in_docker.md— Docker execution guide
CLI Commands
# Run all specs
gauge run specs/
# Run with tag filter
gauge run --tags "smoke" specs/
# Run in parallel (4 streams)
gauge run --parallel -n=4 specs/
# Run specific spec
gauge run specs/ElementsAPI.spec
# Run with specific environment
gauge run --env ci specs/
# Run via npm
npm test
I/O Contract
Inputs
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
| specs directory | Path | No | specs/ |
Directory containing .spec files to execute.
|
| --tags | string | No | — | Tag expression for filtering scenarios (e.g., "smoke", "\!knownIssue").
|
| --parallel / -p | flag | No | false | Enable parallel execution across specifications. |
| -n | number | No | CPU cores | Number of parallel execution streams. |
| --env | string | No | default |
Environment directory name under env/.
|
Outputs
| Name | Type | Description |
|---|---|---|
| Exit code | number | 0 if all scenarios pass, non-zero on failures.
|
| HTML report | Directory | Generated in gauge_reports_dir with pass/fail details and failure screenshots.
|
| Console output | Text | Scenario-level pass/fail results with step details. |
Related Pages
Implements Principle
Requires Environment
See Also
- Getgauge_Taiko_Gauge_Init — Project setup that the runner operates on
- Getgauge_Taiko_Gauge_Spec_Format — Specifications that the runner discovers and executes
- Getgauge_Taiko_Gauge_Step_Decorators — Step implementations that the runner invokes
- Getgauge_Taiko_Gauge_Env_Properties — Configuration controlling execution behavior
Page Connections
Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment