New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for pure Kotlin tests (needed for Kotlin Multiplatform) #331

Open
davidvavra opened this Issue Feb 7, 2018 · 7 comments

Comments

Projects
None yet
3 participants
@davidvavra

davidvavra commented Feb 7, 2018

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 and common-js which can contain JVM or JS dependencies. The code in the common module should be tested and Jetbrains created annotations in kotlin.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 or common-js modules, but not in the common module. Which means writing step definitions twice. It would be great if cucumber supported kotlin.test tests directly.

@mlvandijk

This comment has been minimized.

Member

mlvandijk commented Feb 8, 2018

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!

@davidvavra

This comment has been minimized.

davidvavra commented Feb 8, 2018

@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.

@mlvandijk

This comment has been minimized.

Member

mlvandijk commented Feb 9, 2018

@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.

@aslakhellesoy

This comment has been minimized.

Contributor

aslakhellesoy commented Feb 10, 2018

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:

  • Gherkin Parser (unless you run an existing gherkin cli/exe)
  • Cucumber Expressions (unless you only want to support RegExp)
  • Tag Expressions
  • Language-specific DSL for step definitions and hooks
  • Runtime/execution engine

Would you be interested in (and able to) kick this off @davidvavra?

@davidvavra

This comment has been minimized.

davidvavra commented Feb 12, 2018

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.

@stale

This comment has been minimized.

stale bot commented Apr 13, 2018

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.

@stale stale bot added the Stale label Apr 13, 2018

@mlvandijk mlvandijk added Slow Burner and removed Stale labels Apr 16, 2018

@aslakhellesoy

This comment has been minimized.

Contributor

aslakhellesoy commented Jul 5, 2018

This should get easiers when we get further through the roadmap.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment