1

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

n0krashy
  • 51
  • 7

2 Answers2

2

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

quickfix
  • 376
  • 2
  • 6
0

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"

  • It is in the correct stated place + the other column is read without any problem, the idea here is about using that examples column data in the "scenario outline" line ONLY. – n0krashy Aug 29 '22 at 19:16
  • 1
    ah, got it, you want to parametrize the title of scenario. Don't think it is possible. Well, I would say it contradicts the idea of "Scenario outline". It means: the same scenario with different data. The same means: the same name – Danny Briskin Aug 29 '22 at 19:22
  • 1
    I understand that, but in my case, I have the same scenario steps inputs and outputs (given, when, then) for some data, it would be pointless for me to create different scenarios instead of the scenario outline and repeat the same scenario for every example I have, just to have a different "scenario outline" title. – n0krashy Aug 29 '22 at 19:32