Configuration
@currents/playwright configuration reference
Configuration Sources
@currents/playwright
accepts configuration from the following sources:
⭐️ Preferred: reading
currents.config.ts
fileEnvironment variables, e.g.
CURRENTS_TAG=tagA,tagB
CLI command options, e.g.
npx pwc ---tag tagA --tag tagB
Inline configuration in
playwright.config.ts
e.g.reporters: [currentsReporter(options)]
We recommend using currents.config.ts
as the preferred method for defining the configution — the file is evaluated at runtime, i.e. you can make is smart.
For example:
Configuration Overrides
Configuration values will resolve as follows:
environment variable value if exists, otherwise
corresponding CLI parameter value if exists, otherwise
value from
playwright.config.ts
if exists, otherwisevalue from
currents.config.ts
if exists, otherwisethe default value, otherwise
throw if the value is mandatory
Example of using environment variables
Reference
ciBuildId *
Type:
string
Default:
undefined
Environment variable:
CURRENTS_CI_BUILD_ID
Required. The ID of the build to associate the test run with. See CI Build ID.
projectId *
Type:
string
Default:
undefined
Environment variable:
CURRENTS_PROJECT_ID
Required. The Currents project ID used for reporting. See Projects.
recordKey *
Type:
string
Default: Required
Environment variable:
CURRENTS_RECORD_KEY
Required. Secret key used to authenticate and upload results to Currents. See Record Key.
tag
Type:
string[]
Default:
[]
Environment variable:
CURRENTS_TAG=tagA,tagB
Tags added to the test run metadata. See Playwright Tags.
removeTitleTags
Type:
boolean
Default:
false
Environment variable: N/A
Remove inline tags like @smoke
from test titles when processing test results on Currents servers. Helps to keep the test title consistent and keep test history when tags change.
disableTitleTags
Type:
boolean
Default:
false
Environment variable:
CURRENTS_DISABLE_TITLE_TAGS
Prevent parsing tags like @smoke from test titles.
cancelAfterFailures
Type:
number | false
Default:
false
Environment variable:
CURRENTS_CANCEL_AFTER_FAILURES
Stop the run after a number of failures. The number of failures is determined from all the results reported to the associated run (i.e. from multiple machines). Pass false to disable. See Failing Fast.
testSuiteFile
Type:
string
Default:
undefined
Environment variable:
CURRENTS_TEST_SUITE_FILE
Full path to the test suite file used for orchestration and reporting. Mostly used internally.
machineId
Type:
string
Default:
CURRENTS_MACHINE_ID
Environment variable: N/A
Optional unique machine identifier. Mostly used internally.
orchestrationId
Type:
string
Default: Auto-generated
Environment variable:
CURRENTS_ORCHESTRATION_ID
Unique orchestration ID for the run. Mostly used internally.
outputFile
Type:
string
Default:
undefined
Environment variable:
CURRENTS_OUTPUT_FILE
File path for the JSON output summary. The TypeScript definition of the contents is available:
orchestration
Set of configuration items related to Orchestration Setup.
orchestration.resetSignal
Type:
SIGUSR1 | SIGUSR2
Default:
undefined
Environment variable: N/A
Signal used to reset the tests running on the machine. See Cloud Spot Instances.
orchestration.skipReporterInjection
Type:
boolean
Default:
false
Environment variable: N/A
Prevents pwc-p
from automatically configuring Playwright to use Currents reporter . If see, you must add Currents reporter manuall. See Orchestration Setup.
orchestration.onFinish
Type:
(status: OrchestrationStatus) => Promise<void>
Default:
undefined
Environment variable: N/A
Optional async callback called after orchestration completes. The callback runs on each machine that is part of an orchestrated run. The parameter status
contains aggregated results from all the participating machines. The TypeScript definition of the contents is available:
orchestration.batchSize
Type:
"auto" | number
Default:
auto
Environment variable:
CURRENTS_BATCH_SIZE
Sets the batch size for orchestration. Batch size defines how many parallel workers should be used for the orchestration.
auto
infers the batch size from Playwright workers.number
explicitly sets the batch size, must be greater than0
coverage
Set of configuration items related to Code Coverage for Playwright.
coverage.projects
Type:
boolean | string[]
Default:
false
Environment variable: N/A
Enable or disable coverage collection for Playwright projects
true | []
: enable for all projectsstring[]
: only enable for specified projectsfalse | undefined
: disabled
coverage.dir
Type:
string
Default:
.nyc_output
Environment variable: N/A
Directory path for reading coverage reports. See Code Coverage for Playwright.
Last updated
Was this helpful?