Hi I know that BDD with selenium can be used to test user interfaces.
I also know that APIs could be tested using Gherkin.
My question is, should APIs be tested using Gherkin? Is it the right tool for the job?
Hi I know that BDD with selenium can be used to test user interfaces.
I also know that APIs could be tested using Gherkin.
My question is, should APIs be tested using Gherkin? Is it the right tool for the job?
BDD aims to create a shared understanding of how an application should behave by discovering new features based on concrete examples. Key examples are then formalized with natural language following a Given/When/Then structure
For that you use Gherkin. On which layer you then automate is another decision.
This can be the UI layer, or some API service layer below.
So yes, Gherkin is the right tool for the job.
Source: https://specflow.org/bdd/