Using Cucumber examples data in "scenario outline" line, not in a step, data isn't read and column marked as unused

892 Views Asked by At

When I use table column in "scenario outline" line in cucumber feature file, not in any step, using java and intellij-idea such as the following:

Scenario Outline: my test <lastname>
    Given Customer Ask Chatbot "My name is <fname>"
    When Verify Chatbot responses contain
    """
    Hello <fname>!
    """
    Then Customer clicks on "Yes"
    Examples:
      | fname   | lastname |
      | ahmed   | amir  |
      | saad    | sameh |
      | mohamed | morad |

enter image description here

"fname" is acting normal, but "lastname" column is marked as unused, as it is only used in the "scenario outline" line and not in any step.

My question is, does this happen with you? and if so, is this the intended behavior? or is it an issue that needs to be reported and fixed? and if so, is it a problem within intellij or cucumber or something else?

Thank you

2

There are 2 best solutions below

3
Danny Briskin On

Most likely, the feature file is not placed in "expected" (by Intellij) place. Put it under resources folder.

To have a correct display in Intellij, sometimes it is needed to mark that directory as "test resources root"

there is also a small timeout to display the column as "used"

0
quickfix On

There's an open ticket for this issue in IDEA: https://youtrack.jetbrains.com/issue/IDEA-261249, you can vote for it