Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Intellij IDEA > Cucumber Test Results don't display Scenario name

Problem:

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.

enter image description here

I'm using JDK8 with Intellij IDEA 15 Community Edition (Build #IC-143.2287) with the following Intellij IDEA plugins:

  • Cucumber for Java (v 143.382) - github.com / plugins.jetbrains.com
  • Cucumber for Groovy (v 143.382) - github.com / plugins.jetbrains.com

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 {}

Just wondering:

  • Is there anyway to display the scenario name?
  • Is it something I'm doing OR is it just not implemented yet? (OR does it exist in the Intellij IDEA Ultimate Edition?)
  • Who can I suggest this feature to, if it doesn't exist yet?

Update - 21/03/2016

I've forwarded my question to the author (Andrey Vokin) and raised an issue - https://youtrack.jetbrains.com/issue/IDEA-153338 .

like image 910
Nick Grealy Avatar asked Mar 19 '16 23:03

Nick Grealy


People also ask

How do I view Cucumber reports in Intellij?

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.

How do you tag scenarios in Cucumber?

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"}.

How do I enable Cucumber in Intellij?

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.

Can we parameterize scenario name in Cucumber?

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.


Video Answer


1 Answers

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.

like image 88
Vincent F Avatar answered Sep 27 '22 23:09

Vincent F