Search code examples
cucumbermappingbddgherkin

Cucumber - what's the difference between these two givens?


New to this whole BDD world, and I'm already experiencing weird behavior.

So in the three "Given" statements below, they all refer to the ints in the table, right? So I thought when mapping (see second pic), I just replace all the "<...>" tags with "{int}", but that's not the case. , , , stay the same and are not replaced by {int}, but is replaced by {int}.

Is this normal? If so, what's the rule? enter image description here

enter image description here


Solution

  • In your step definition, where you specify which text should be matched by your step, you need to specify which Cucumber expression should be matched.

    Change the first two step definitions to: @Given("An X is added at row {int}, {int}) and @Given("An O is added at row {int}, {int})

    (Sidenote on asking questions: next time please copy your feature file and code into your question. That makes it easier to answer using your snippets.)