Skip to content

Configuration

Every setting is an option of the formatter under the probara key of formatOptions, and most have a PROBARA_* variable too. Keep the token in the environment, the project in the configuration (or in the environment), and set the rest where it fits your pipeline.

An option in formatOptions wins over its PROBARA_* variable, and the variable wins over the default. The same options work on the command line:

Terminal window
npx cucumber-js --format-options '{"probara":{"projectId":"SHOP"}}'
  1. Create an app token from the Cucumber card in Integrations (get a token) and store it as a CI secret named PROBARA_API_TOKEN.
  2. Set the project code: projectId in the formatter options, or PROBARA_PROJECT. A project code is a capital letter, then capital letters or digits (SHOP, E2E). Any other value turns reporting off, with an error.
  3. Everything else has a default. The run is named after the CI build, and its branch, commit and build URL come from the CI on their own.
OptionVariableTypeDefaultWhat it does
enabledPROBARA_ENABLEDbooleantruefalse turns reporting off: nothing is sent, and nothing is logged
apiTokenPROBARA_API_TOKENstringnone (required)The app token. Keep it in the environment
projectIdPROBARA_PROJECTstringnone (required)The project code, such as SHOP
baseUrlPROBARA_BASE_URLstringhttps://app.probara.netThe Probara to report to (network)
projectsPROBARA_PROJECTSstring[]noneOther projects results may go to (WEB,API), by the case of each result (linking)
OptionVariableTypeDefaultWhat it does
run.ulidPROBARA_RUN_ULIDstringnone: a new runReport into an existing run. It is not closed by default
run.namePROBARA_RUN_NAMEstringthe CI build name, else Automated run <date>Name of a new run
run.descriptionPROBARA_RUN_DESCRIPTIONstringnoneDescription of a new run
run.environmentPROBARA_ENVIRONMENTstringnoneEnvironment of a new run by name, created when none matches
run.environmentIdPROBARA_ENVIRONMENT_IDstringnoneEnvironment of a new run by ULID
run.milestonePROBARA_MILESTONEstringnoneMilestone of a new run by display id (M-3) or name
run.milestoneIdPROBARA_MILESTONE_IDstringnoneMilestone of a new run by ULID
run.planPROBARA_PLANstringnoneTest plan of a new run by display id (PLAN-2) or name: the run starts with its cases
run.configurationsPROBARA_CONFIGURATIONS{ group, name }[]noneConfigurations of a new run by name (Browser=Chrome,OS=Linux), each group once
run.configurationUlidsPROBARA_CONFIGURATION_ULIDSstring[]noneConfigurations of a new run by ULID
run.tagsPROBARA_RUN_TAGSstring[]noneTags of a new run
run.ulidsPROBARA_RUN_ULIDSRecord<string, string>noneThe run to reuse in each project (WEB=<ulid>,API=<ulid>)
closeRunPROBARA_CLOSE_RUNbooleantrue for a new run, false for a reused oneClose the run at the end
closeRunsnoneRecord<string, boolean>noneClose the run of each project ({ SHOP: true, WEB: false }) when closeRun is not set
OptionVariableTypeDefaultWhat it does
sourcenonefalse | object (GitHub fields below)detected from the CIfalse sends no source. An object overrides the detected fields one by one
source.branchPROBARA_BRANCHstringdetected from the CIBranch of the run source
source.commitPROBARA_COMMITstringdetected from the CICommit of the run source
source.buildUrlPROBARA_BUILD_URLstringdetected from the CICI build URL of the run source

In GitHub Actions the source also gets these fields, detected from GITHUB_* variables:

OptionVariableTypeDefaultWhat it does
source.providernonestringdetected from GitHub Actionsgithub_actions (detected) or other
source.repositorynonestringdetected from GitHub ActionsRepository of the run source, owner/name
source.commitAuthornonestringdetected from GitHub ActionsWho triggered the build
source.pullRequestNumbernonenumberdetected from GitHub ActionsPull request of the build
source.workflownonestringdetected from GitHub ActionsCI workflow of the run source
source.ciRunIdnonestringdetected from GitHub ActionsCI run id: the jobs of one GitHub Actions run share one run
source.ciRunAttemptnonenumberdetected from GitHub ActionsAttempt of the CI run: a re-run reports into a run of its own
source.ciJobnonestringdetected from GitHub ActionsCI job of the run source
OptionVariableTypeDefaultWhat it does
createMissingCasesPROBARA_CREATE_MISSING_CASESbooleantrueCreate a case for a scenario that matches none (linking)
suiteUlidPROBARA_SUITE_ULIDstringthe project rootSuite that created cases go under
OptionVariableTypeDefaultWhat it does
statusMappingPROBARA_STATUS_MAPPING{ passed, failed, skipped, blocked }noneSend a status as another (failed=blocked) (statuses)
statusFilterPROBARA_STATUS_FILTERstring[]noneSend no result with these statuses, after the mapping (skipped)
assignFailedToPROBARA_ASSIGN_FAILED_TOstring[]noneAssign each failed result without an assignee to one of these members, in turn (ana@example.com,bo@example.com)
uploadAttachmentsPROBARA_UPLOAD_ATTACHMENTSbooleantruefalse uploads no file (steps and attachments)
resultsFilePROBARA_RESULTS_FILEstringnoneJSON file for what could not be sent (results file)
rootDirnonestringthe directory cucumber-js runs inDirectory the feature paths of automation keys are relative to (linking)
debugPROBARA_DEBUGbooleanfalseLog every request, without the token (troubleshooting)
OptionVariableTypeDefaultWhat it does
chunkSizenonenumber500Results per report request, 1 to 500
timeoutMsnonenumber30000Timeout of one HTTP attempt, in milliseconds, 1 to 600000
maxRetriesnonenumber4Retries of a failed request, 0 to 10
attachmentConcurrencynonenumber2Results whose attachments upload at the same time, 1 to 8

The results go out at the end of the run, in reports of up to chunkSize results: a run with more results sends each full report during the run, and the rest when it ends.

A failed request is retried with a backoff. A request that still fails is logged and counted in the summary, and the run goes on. Set maxRetries to 0 to fail fast when Probara is unreachable: the results are then kept in the results file, when one is set. A proxy or a self-hosted Probara works the same way: set baseUrl to its address.

The formatter also takes the seams of @probara/core for code and tests: logger, env, fetch, sleep, random and now. They have no variable, and a cucumber.js rarely needs them.

cucumber-js gives stdout to one formatter only: the last --format without a path. With no --format at all, that is its own progress formatter. So --format @probara/cucumber-reporter on its own prints nothing on stdout, and the [probara] lines go to stderr.

To keep the progress output, give the formatter a path:

Terminal window
npx cucumber-js --format progress --format @probara/cucumber-reporter:reports/probara.txt

The reporter writes nothing to that file (its logs go to stderr), so the file stays empty. Two formatters without a path do not both print: cucumber-js keeps the last one and drops the other, without a message.

Only the probara key of formatOptions is read by this formatter. An option under probara that the reporter does not know is ignored, with a warning in the log that names it.

Report with an app token. It belongs to your organization, not to a person:

  1. As an owner or admin, open Workspace › Integrations in Probara and select the Cucumber card.
  2. Enter a Token name after what uses it (the repository or the pipeline) and select Create token.
  3. Select Copy token. It is shown once: store it as the CI secret PROBARA_API_TOKEN right away.

An app token uses no seat, keeps working when the person who created it leaves, and shows the app and its name (such as Cucumber · e2e-ci) on its runs and results. It can only report and sync: create automated runs, send reports (which can create cases and suites), sync feature files, add attachments to results and close runs. Revoke it from the same card when it may have leaked.

The formatter creates one run per cucumber-js run, named after the CI build (or Automated run <date> outside CI), and closes it when the run ends. To report into a run that already exists, set run.ulid: it is not closed unless you set closeRun.

In GitHub Actions the jobs of one workflow run share one run, and a final job closes it (parallel jobs).

A new run can start with its environment, milestone, test plan, configurations and tags. For example, PROBARA_PLAN=PLAN-2 starts the run with that plan’s cases.