zio-bdd

A BDD testing framework integrating Gherkin-style tests with ZIO’s effect system

View the Project on GitHub EtaCassiopeia/zio-bdd

Running Tests in zio-bdd

This page explains how to run your zio-bdd tests, including configuration options, command-line arguments, and reporting formats. Understanding these options will help you integrate zio-bdd into your development and CI/CD workflows effectively.

Basic Test Execution

To run all tests defined in your @Suite-annotated specs, use the standard SBT test command:

sbt test

This command discovers and executes all scenarios in the feature files specified in your @Suite configurations.

Configuring the Test Suite

The @Suite annotation on your ZIOSteps subclass allows you to configure various aspects of test execution:

@Suite(
  featureDir = "src/test/resources/features",
  reporters = Array("pretty", "junitxml"),
  parallelism = 1,
  includeTags = Array("positive"),
  excludeTags = Array("ignore"),
  logLevel = "debug"
)
object MySpec extends ZIOSteps[Env, State] {
  // ...
}

Command-Line Options

You can override @Suite settings or provide additional filters via command-line arguments when running tests.

Tag Filters

Feature File Selection

Reporting

Logging

Reporters

zio-bdd supports multiple reporters for test output:

You can specify multiple reporters in the @Suite annotation or via the command line.

Parallelism

Control the number of scenarios running concurrently:

Use parallelism to speed up test execution, but ensure your tests are isolated to avoid interference.

Best Practices

Next Steps