Share State Between Cucumber Steps Without Static Fields
Use Cucumber JVM dependency injection to share objects across step definitions within a scenario while keeping scenarios isolated.
ReadMeFeed / Community knowledge
Real questions. Useful conversations. Find the people who know your stack.
Use Cucumber JVM dependency injection to share objects across step definitions within a scenario while keeping scenarios isolated.
Run one Gherkin template against multiple data rows in Cucumber JVM using Scenario Outline and Examples tables.
Cucumber JVM's default formatters (pretty, json, html, JUnit) serialize step arguments, data-table cells, and scenario-outline examples verbatim into report output, including any embedded credentials, tokens, or secrets. The core runtime provides no automatic detection or masking of sensitive values, and no first-party configuration flag exists as of Cucumbe
Cucumber JVM JUnit 4 runner deprecation and JUnit 5 platform engine migration A Cucumber JVM test suite is being upgraded from version 6.x to 7.x. The goal is to keep existing feature files and step definitions running while moving off the deprecated JUnit 4 runner. Cucumber JVM 7.x assumes Java 11 or higher and marks `cucumber-junit` as deprecated in favor
Evaluating the interoperability boundary between Cucumber JVM version upgrades and the associated testing framework runtime remains ambiguous when step definitions fail to load. Glue-code compatibility between Cucumber JVM 6.x and 7.x frequently introduces silent failures and version mismatches with JUnit or TestNG can exacerbate detection gaps. The --dry-ru
Thread-affinity uncertainty for scenario hooks When running Cucumber JVM scenarios in parallel via JUnit 5's parallel execution or Cucumber's --threads option, reliable management of thread-local resources such as WebDriver instances or database connections depends on whether @Before and @After hooks execute on the same thread as their associated scenario. T
Goal: confirm whether a Cucumber JVM suite selected by a tag expression such as @smoke and not @regression should return scenarios in the same sequence on every run, and whether shared state can survive between those scenarios. Cucumber JVM does not guarantee declaration order, especially under parallel execution or repeated runs. Step definitions may be ins
In multi-module JVM projects using Cucumber JVM 7.x, step definition methods must be public for the glue backend to discover them, whether they use Cucumber Expressions or regular expressions. Package-private or private step methods are ignored during discovery, and the affected steps surface as undefined at runtime rather than as compile-time errors. The de
State Sharing Across Step Definitions When integrating Cucumber-JVM with the JUnit 5 platform, managing state between multiple step definition classes within a single scenario requires a Dependency Injection (DI) container. While Cucumber supports various containers such as PicoContainer and Spring, the behavior of object lifecycles differs across these impl