A BDD testing framework integrating Gherkin-style tests with ZIO’s effect system
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.
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.
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] {
// ...
}
.feature files."pretty", "junitxml")."debug", "info").You can override @Suite settings or provide additional filters via command-line arguments when running tests.
sbt "testOnly * -- --include-tags smoke"
sbt "testOnly * -- --exclude-tags ignore"
sbt "testOnly * -- --include-tags positive --exclude-tags flaky"
sbt "testOnly * -- --feature-file src/test/resources/features/greeting.feature"
sbt "testOnly * -- --reporters pretty,junitxml"
sbt "testOnly * -- --log-level debug"
zio-bdd supports multiple reporters for test output:
You can specify multiple reporters in the @Suite annotation or via the command line.
Control the number of scenarios running concurrently:
parallelism to a positive integer.--parallelism N.Use parallelism to speed up test execution, but ensure your tests are isolated to avoid interference.
@smoke, @integration)."debug" for detailed step execution logs.