Search code examples
restcucumberbddweb-api-testing

Using BDD in API automation testing is a good aproach?


I'm writing a framework for RESTful API test automation, I already decided to go with REST Assured, I'm not 100% sure about add a layer to allow define tests using a domain specific language like Gherkin, therefore adding a BDD framework like Cucumber. What is your opinion?
Is a good approach to use BDD in API automation testing?


Solution

  • I am currently using BDD for RestAPI Testing. Here is pros and cons for BDD RestAPI Automation framework.

    Technology We used: Cucumber,Java,Rest-Assured and junit

    Following pros and cons are my own comment or personal view. It is based on my experience.

    Pros:

    • Easy to write feature file using Gherkin language
    • It is very easy to cover Acceptance criteria
    • Everyone in team (Including team ) Can help you to write feature file
    • Very good reporting format and debug failures
    • Easy to execute during nightly or regular build
    • Integration testing is very easy as You can use Background or Given and other feature of Gherkin language

    Cons:

    • When other team member in company need test case or any documentation than your answer will be "We have scenario in Gherkin Language" and it is sometime hard to understand/explain scenario as there is no clear step like traditional step definition or big documentation

    • Higher management have high time to understand converge of testing product like HP ALM Coverage report.

    • It is little hard to write for few sprint specially for those who write test case for years.

    Please free to edit or suggest anything need to add or remove. I hope it will help you.