When running my Cucumber Acceptance tests from Intellij, the Test Results don't display the scenario name, just <no name>
- making it difficult/impossible to determine which Scenario actually failed!
e.g.
I'm using JDK8 with Intellij IDEA 15 Community Edition (Build #IC-143.2287) with the following Intellij IDEA plugins:
The following Cucumber libraries (gradle):
testCompile "info.cukes:cucumber-junit:1.2.4"
testCompile "info.cukes:cucumber-java8:1.2.4"
testCompile "info.cukes:cucumber-spring:1.2.4"
This is my AcceptanceTests.groovy
file:
import cucumber.api.CucumberOptions
import cucumber.api.junit.Cucumber
import org.junit.runner.RunWith
@RunWith(Cucumber.class)
@CucumberOptions(
strict = false,
plugin = ["pretty", "html:build/reports/cucumber"],
tags = ['~@ignore']
)
public class AcceptanceTests {}
I've forwarded my question to the author (Andrey Vokin) and raised an issue - https://youtrack.jetbrains.com/issue/IDEA-153338 .
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.
Tag starts with “@”. After “@” you can have any relevant text to define your tag like @SmokeTests just above the scenarios you like to mark. Then to target these tagged scenarios just specify the tags names in the CucumberOptions as tags = {"@SmokeTests"}.
Enable plugins In the Settings/Preferences dialog ( Ctrl+Alt+S ), select Plugins. Switch to the Installed tab and make sure that the following plugins are enabled (the plugins must be enabled in the specified order): Gherkin. Cucumber for Java.
Parametrization in Cucumber Cucumber supports Data Driven Testing using Scenario Outline and Examples keywords. Creating a feature file with Scenario Outline and Example keywords will help to reduce the code and testing multiple scenarios with different values.
I have same problem, and found where it's coming from in my case. For "scenario" at least, it seems to come from dots (".") : remove them from your scenario description and see what happens.
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