Principle:Nightwatchjs Nightwatch Client Configuration
| Knowledge Sources | |
|---|---|
| Domains | Testing, API, Configuration |
| Last Updated | 2026-02-12 00:00 GMT |
Overview
A programmatic configuration pattern that defines browser, execution, and environment settings as a JavaScript options object.
Description
Client Configuration provides a programmatic alternative to file-based configuration. Instead of reading from nightwatch.conf.js, settings are passed directly as an object to the createClient() factory method. This enables dynamic configuration at runtime based on environment variables, CI/CD parameters, or application state.
Usage
Use programmatic configuration when test execution parameters need to be determined at runtime, such as in CI/CD pipelines, multi-environment deployments, or custom orchestration scripts.
Theoretical Basis
Programmatic configuration follows the builder pattern:
- Construct options object with desired settings
- Pass to createClient() factory
- Factory merges with defaults from config file
- Resulting configuration drives client behavior