Skip to main content


Configuration options for the SerenityBDDReporter.





specDirectory?: string

The root directory that SerenityBDDReporter should recursively scan for test scenario files to determine the requirements hierarchy, relative to the current working directory.

If not specified, specDirectory defaults to the first one of the following subdirectories that’s present in the current working directory:

If not specified and none of the above subdirectories are present, specDirectory defaults to the current working directory.

If specDirectory is specified, but the directory doesn’t exist, SerenityBDDReporter throws a ConfigurationError.

IMPORTANT: For the Serenity BDD CLI Reporter to correctly parse the requirements hierarchy and recognise your test scenarios, your test scenario files must be named using either:

  • <feature name>.feature naming convention for Cucumber.js projects
  • <feature name>.<suffix>.<extension> naming convention for non-Cucumber.js projects

In the naming conventions above:

  • <feature name> is the name of the feature or component the scenario exercises; e.g. checkout.feature, checkout.spec.ts, LoginForm.spec.ts
  • <suffix> is one of the following: spec, test, integration, it, e2e, spec.e2e, spec-e2e; e.g. checkout.spec.ts, payments.spec-e2e.ts, user_registration.integration.ts
  • <extension> is one of the following: js, jsx, mjs, mjsx, cjs, cjsx, ts, tsx, mts, mtsx, cts, ctxs; e.g. authentication.spec.ts, FormValidator.spec.mtsx

To find out more about how Serenity BDD CLI parses the requirements hierarchy, see the SpecFileFilters class.