1

I am new to Python, pytest-bdd but have been creating frameworks in Java, TestNG, cucumber for a long time. So here in pytest-bdd I am creating the feature file and then on top of that, we are creating the step definitions and then running the tests. Whats the purpose of creating the feature file in pytest-bdd, if we are still running the tests from step definitions.. Is it just to check the coverage ??

1 Answers1

0

Well, unfortunately we are not at that AI level, wherein you type "I don't want to write code" and the system interprets, "Ok! Alright! Lemme do it for you" . So just writing the feature files won't work :)

The purpose of BDD feature files in any framework is to act as a scenario document understandable by all stakeholders. Internally it also helps in reusability, since if a step is available, you know that the code is available somewhere to achieve the step.

Even in testng, cucumber, Java, ultimately, you are running tests from the xml/maven which calls a Java runner file and tests run. You do not run a feature file, so to say.

niharika_neo
  • 8,441
  • 1
  • 19
  • 31