API testing with cucumber
Performing API testing with cucumber it’s such a simple process , in general to me API testing is much simpler than GUI. Doing API testing you care about what the API is returning back to you, despite the UI that can have such complex UI.
So lets try to create a cucumber project from scratch :
Create the gem file:
Run bundle install :
You should see something like this as an output :
Require rest client and json into env.rb:
We can actually use a sample api endpoint to write our test from jsonplaceholder .
Lets write our feature file :
And our step definition :
Run your first cucumber API test:
You can see the entire sample project pushed in gitlab here :
Remember this is just a sample cucumber project more articles will follow on this topic , API testing and we will improve the project structure as we go .