I'm trying to demonstrate serenity with Restassured in my workplace and show them how amazing and easy it is to use compared to using jasmine.js No matter how I get stuck in the basic tests I'm trying to do My test says
Given we have valid credentials for the client using this test When we try to serach for a medicine '<medicine>' Then we get a valid '<perfLabel>' response with search results |medicine|perflabel| |Salbutamol|perflabel1| |Panadol|perflabel2| |Salbutamol (GA)|perflabel3|
When will I go to the next step
@When("we try to serach for a medicine '(.*)' ") public void tryToSearchUsingEquals(String medicine) { tsApiActions.requestServiceSearchWhichEquals(medicine); } In my Step method @Step public void requestServiceSearchWhichEquals(String medicine) { host = "http://www.int.abc.com.au/api/cs/v1/terminology-service/trade-product/search-summary?offset=0&limit=20&prefLabel=eq "+medicine+"&sort=prefLabel DESC&cache=false"; requestSend(host); }
The questions I have
- How do I insert variables (Salbutamol, Panadol) in uri?
- How to put this URI in a separate properties file and call it in the Step method?
Any help really appreciated Thanks
source share