Open davidvavra opened 6 years ago
Would this be a separate Kotlin implementation of Cucumber, or an addition to cucumber-jvm? I've only recently started using Kotlin myself, and we use it in combination with Java atm, so I'm not sure what would be needed to make this work. Thanks for the link; will have a look later!
@mlvandijk Imho separate Kotlin implementation. Normally Kotlin is built on top of JVM and normal Java version can be used. But it's different for multiplatform projects.
@davidvavra The link you provided states: "Multiplatform projects are a new experimental feature in Kotlin 1.2. All of the language and tooling features described in this document are subject to change in future Kotlin versions." So if someone were to create a pure Kotlin implementation of Cucumber, imho it might be best to wait until this is sorted out in Kotlin to prevent rework.
A Kotlin implementation of Cucumber would be fantastic!
Writing a new Cucumber implementation from scratch is a considerable amount of work. There are several libraries to implement:
Would you be interested in (and able to) kick this off @davidvavra?
That looks like a lot of work. I agree with @mlvandijk that the feature is still experimental and we should probably wait a while until it's more stable. But it's good to have an open issue and track progress/gather interest. I'm not interested in kicking off the implementation, but maybe I can help with some smaller tasks.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in a week if no further activity occurs.
This should get easiers when we get further through the roadmap.
Is anyone still interested in tackling this?
It might be easier to port instead of rewriting. If it is an independent implementation, then both implementations have to be maintained, but if the old is ported to Kotlin Multiplatform then it can be used for both Java (JVM) testing and Kotlin Multiplatform testing.
The approach I would take would be:
This could even be done would module at a time.
if the old is ported to Kotlin Multiplatform then it can be used for both Java (JVM) testing and Kotlin Multiplatform testing.
Unfortunately this adds a dependency on the Kotlin standard library.
This is a non-trivial piece of complexity added to every project that uses Cucumber.
Cucumber is used as a testing library. This additional complexity may make a test run less representative. So generally speaking we try to avoid introducing additional depencies (or at the very least shade then).
Kotlin now has support for multiplatform projects. Common code is written in pure Kotlin (no Java dependencies are possible) and then developer creates modules like
common-jvm
andcommon-js
which can contain JVM or JS dependencies. The code in the common module should be tested and Jetbrains created annotations inkotlin.test
package which are automatically translated into JUnit or JS tests. Then tests can run on all platforms with no work. More documentation here.So currently cucumber can be used only in
common-jvm
orcommon-js
modules, but not in the common module. Which means writing step definitions twice. It would be great if cucumber supportedkotlin.test
tests directly.