jlagerweij / cucumber-kotlin

Jetbrains plugin for Cucumber step definitions written in Kotlin
https://plugins.jetbrains.com/plugin/10527-cucumber-for-kotlin
Other
20 stars 16 forks source link

Step recognition is instable #23

Closed uron86 closed 3 years ago

uron86 commented 4 years ago

In IDEA 2020.1.3 with kotlin for cucumber plugin 1.1.4 enabled, the recognition of step definition between a feature file and step definitions doesn't always give the same result.

Here is my scenario :

Scenario: A scenario
Given a condition
When I do an action
Then I have a result

When I write these two steps on a same kotlin class, ther is no problem :

Given("a condition") {
    // Write code here that turns the phrase above into concrete actions
    throw cucumber.api.PendingException()
}

Given("another condition") {
    // Write code here that turns the phrase above into concrete actions
    throw cucumber.api.PendingException()
}

The given is recognized and the others are not recognized => OK

But when I write the two conditions in two different kotlin classes, the Given Step is sometimes recongized (more often) and sometimes not recognized. I notice that with step highlightinh or code inspection.

This is a real problem because we have a lot of steps in our projects and we are unable to know which steps are missing or not.

boris779 commented 3 years ago

I can confirm that. since the upgrade to 2020.3 the step recognition does not work at all. Steps are in the code and runnable when starting cucumber, this is the ESSENTIAL feature of this plugin!

jlagerweij commented 3 years ago

Testing using https://github.com/cucumber/cucumber-jvm/tree/main/kotlin-java8 I found everything working. Can you provide me with a sample project just like https://github.com/cucumber/cucumber-jvm/tree/main/kotlin-java8 with code that is not working? There might be something in the way the files are setup at your end that is different.

boris779 commented 3 years ago

The project where the plugin stopped working is confidential, but I found a really strange behaviour in a small sample project, where I delete a single line in the step class and the the linking will stop working.

I made a screencast video of that. vokoscreenNG-2020-12-14_11-48-30.zip

jlagerweij commented 3 years ago

The screencast is showing steps in Java, so that is a problem of the Cucumber for Java plugin. This is the Cucumber for Kotlin plugin. It only works with steps written in Kotlin.

boris779 commented 3 years ago

Sorry my fault. I preparing a project in kotlin. When I got it right the problem is when not having English (En) Gherkin files.

boris779 commented 3 years ago

Here we go https://github.com/boris779/german_cucumber_kotlin_plugin

I also added a branch with the English usage of gherkin and there it works.

boris779 commented 3 years ago

Is there a possibility to install this "unreleased" Version (at my own risk)?

boris779 commented 3 years ago

I tried to download the zip and tried install from disk but ..... 2020-12-15_08h03_26

jlagerweij commented 3 years ago

They are usually quite quick in their reviews. Using this URL you should be able to download the 2020.3.1 version: https://plugins.jetbrains.com/plugin/download?rel=true&updateId=105453 If that doesn't work you always have the option to download an older version of the plugin from the plugins.jetbrains.com website and install that.

boris779 commented 3 years ago

@jlagerweij Thank you so much, it works now (with German Gherkin)