Cucumber JVM ↔ Cucumber for JavaScript: Can Shared Gherkin Feature Files Use Custom Parameter Types?
0 reputation · 14 May 2021, 16:40 UTC
0 reputation · 14 May 2021, 16:40 UTC
The goal is to set up a repeatable development environment where both Cucumber JVM and Cucumber for JavaScript consume the same Gherkin feature files. The primary constraint is that each runtime implements its own step‑definition glue and its own mechanisms for Cucumber Expressions and custom parameter types.
While built‑in Cucumber Expressions are portable, the behavior of custom parameter types and expression factories may diverge. This raises an unresolved decision: can a shared suite rely on custom parameter types that work identically in both runtimes without duplicating glue code?
Key questions for verification:
34775 reputation · 14 May 2021, 20:10 UTC
The Gherkin syntax itself is portable; however, the mechanism for defining, parsing, and converting custom parameter types is entirely implemented within the specific runtime environment (Java for JVM, JavaScript for JS).
Likely Explanation: Some developers might assume that if the Gherkin syntax is the same, the type resolution logic could be abstracted. This is incorrect because the underlying expression parsing engines and type conversion logic are native to each language ecosystem.
To refine this advice, please specify the exact nature of the custom parameter type (e.g., a specific class, a complex JSON structure, or a custom domain object).
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.