When I run a cucumber test feature in IntelliJ, all it shows is an IncompatibleClassChangeError with stack trace:
Testing started at 12:55 ...
/Library/Java/JavaVirtualMachines/jdk1.8.0_20.jdk/Contents/Home/bin/java ...
Exception in thread "main" java.lang.IncompatibleClassChangeError: Found interface cucumber.api.TestCase, but class was expected
at org.jetbrains.plugins.cucumber.java.run.CucumberJvm2SMFormatter.handleTestCaseStarted(CucumberJvm2SMFormatter.java:80)
at org.jetbrains.plugins.cucumber.java.run.CucumberJvm2SMFormatter.access$000(CucumberJvm2SMFormatter.java:17)
at org.jetbrains.plugins.cucumber.java.run.CucumberJvm2SMFormatter$1.receive(CucumberJvm2SMFormatter.java:32)
at org.jetbrains.plugins.cucumber.java.run.CucumberJvm2SMFormatter$1.receive(CucumberJvm2SMFormatter.java:30)
at cucumber.runner.EventBus.send(EventBus.java:28)
at cucumber.runner.TestCase.run(TestCase.java:37)
at cucumber.runner.Runner.runPickle(Runner.java:44)
at cucumber.runtime.Runtime.runFeature(Runtime.java:120)
at cucumber.runtime.Runtime.run(Runtime.java:106)
at cucumber.api.cli.Main.run(Main.java:35)
at cucumber.api.cli.Main.main(Main.java:18)
Process finished with exit code 1
Empty test suite.
This is IntelliJ IDEA 2018.1.4 (Ultimate Edition), Build #IU-181.5087.20
, with Cucumber for Java version 181.5087.20
From the main menu, select Run | Edit Configurations. or press Alt+Insert and select Cucumber Java from the list. After that, you can complete the configuration using the options on the right. For the description of each option, refer to Run/Debug Configuration: Cucumber Java.
Maven can automatically run Cucumber-JVM tests as part of the build process.
As explained in issue #1392
This is caused by IDEA's CucumberJvm2SMFormatter. It being the formatter for Cucumber2, runs into a breaking change in Cucumber 3.
The simplest workaround is removing --plugin org.jetbrains.plugins.cucumber.java.run.CucumberJvm2SMFormatter
from program arguments in the run configuration.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With