Forum Discussion

TestQA1's avatar
TestQA1
Frequent Contributor
3 years ago
Solved

Duplicate gherkin statements

Hi All,

 

In my BDD tests, I need perform same actions in different place, the problem is that each scenario should only have Given before When and Then.

 

For example.

Given close the file

Now if I need to close the file after Then... I need to create a duplicate statement with Then close the file, which doesn't make sense and create duplicate code

 

Is there any way we can link 'close the file' to both Given and Then so it gets linked to the same code.

 

Thank you!