Skip to content

johnmorrisQADeveloper/demo_restassured_api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build Status - Build Status

RestAssured API Automation via Cucumber

As per Swagger Definition, only GET endpoint is defined. The scope of the automation only covers GET method.

Endpoint Expect Actual
/swagger.json Swagger Definition Swagger Definition
/instructions todo Object todo Object
/user/{id} userid Object userid Object
/city/cityname/users users within city users within city
/users all users all users

Test Observation

  1. Invalid user/{id} - Since id are integers, it would be good for API to return something like please enter a valid number instead of the output below.
Actual
curl --location --request GET 'http://bpdts-test-app-v2.herokuapp.com/user/we'
{"message": "Id we doesn't exist. You have requested this URI [/user/we] but did you mean /user/<string:id> or /users ?"}

On the above premise

Feature:
  Verify userid endpoint with invalid entries

  Scenario: Verify /user/1001 endpoint returns no user
    When I perform GET operation for "/user/we"
    Then I should see property "message" to be "please enter a valid number"
    And I should get "404" status code
  1. Invalid /city/{city}/users city or city with no users, returns an empty array []
curl --location --request GET 'http://bpdts-test-app-v2.herokuapp.com/city/$a/users'
[]

This should return a friendly message indicating there are no users in a particular location.

Run all feature files via terminal

mvn clean install

mvn exec:java                                  \
    -Dexec.classpathScope=test                 \
    -Dexec.mainClass=io.cucumber.core.cli.Main \
    -Dexec.args="src/test/java/features --glue steps"

Releases

No releases published

Packages

No packages published