public class BaseStepDefinition extends Object
| Constructor and Description |
|---|
BaseStepDefinition() |
| Modifier and Type | Method and Description |
|---|---|
void |
addVariable(String responseValue,
String key)
Add variable.
|
void |
auth(String username,
String password)
Read request by path param.
|
void |
bearer(String auth,
String token)
Read request by path param.
|
void |
before(io.cucumber.java.Scenario scenario) |
void |
cert(String identifier,
String value)
Read request by path param.
|
void |
createFileRequest(String fileBody,
String contentType)
Create request.
|
void |
createInlineRequest(String fileBody,
String contentType,
List<String> input)
Create request.
|
void |
createRequest(String nameIgnore,
Map<String,String> parameterMap)
Create request.
|
void |
createRequest(String body,
String contentType)
Create request.
|
void |
createRequest(String nameIgnore,
String contentType,
Map<String,String> parameterMap)
Create request.
|
void |
createRequest(String dummyString,
String acceptContentType,
String resource,
String system)
Create request.
|
void |
deleteById(String dummyString,
String acceptContentType,
String resource,
String system)
Delete by id.
|
void |
loadAsGlobalParam(String responseKey,
String key)
Load as global param.
|
void |
loadGlobalParam(Map<String,String> globalParams)
Load global param.
|
void |
loadGlobalParamFromFile()
Load global param.
|
void |
loadRequest(String nameIgnore,
Map<String,String> parameterMap)
Load request.
|
void |
loadRequest(String nameIgnore,
String contentType,
Map<String,String> parameterMap)
Load request.
|
static void |
loadStandardProcessors()
Load action processors.
|
void |
modifyBooleanVariable(String responseValue,
String key)
Modify variable.
|
void |
modifyDecimalVariable(String responseValue,
String key)
Modify variable.
|
void |
modifyIntVariable(String responseValue,
String key)
Modify variable.
|
void |
modifyRequest(String dummyString,
String acceptContentType,
String resource,
String system)
Modify request.
|
void |
modifyStringVariable(String responseValue,
String key)
Modify variable.
|
void |
patchRequest(String dummyString,
String acceptContentType,
String resource,
String system)
Pathch request.
|
void |
readAllCookieParams(String nameIgnore,
Map<String,String> parameterMap)
Read request.
|
void |
readAllHeaderParams(String nameIgnore,
Map<String,String> parameterMap)
Read request.
|
void |
readMultiParamsRequest(String nameIgnore,
String contentType,
Map<String,String> parameterMap)
Read request.
|
void |
readParamsRequest(String nameIgnore,
Map<String,String> parameterMap)
Read request.
|
void |
readPathParamsRequest(String nameIgnore,
String contentType,
Map<String,String> parameterMap)
Read request.
|
void |
readRequest(String nameIgnore,
Map<String,String> parameterMap)
Read request.
|
void |
readRequest(String nameIgnore,
String contentType,
Map<String,String> parameterMap)
Read request.
|
void |
readRequest(String dummyString,
String acceptContentType,
String resource,
String system)
Read request.
|
void |
readRequestByHeaderParam(String dummy,
String identifier,
String value)
Read request by header param.
|
void |
readRequestByPathParam(String dummy)
Read request by path param.
|
void |
readRequestByPathParam(String dummy,
String identifier,
String value)
Read request by path param.
|
void |
readRequestByQueryParam(String dummy,
String identifier,
String value)
Read request by query param.
|
void |
updateRequest(String nameIgnore,
Map<String,String> parameterMap)
Update request.
|
void |
updateRequest(String nameIgnore,
String contentType,
Map<String,String> parameterMap)
Update request.
|
void |
validateGlobalParam()
Validate global param.
|
void |
verifyFileResponse(String resource,
List<String> xmlString)
Mock single response.
|
void |
verifyFormatedMapson(String type,
String resource,
List<String> readData)
Verify response.
|
void |
verifyFormatedMapson(String type,
String file,
String resource)
Verify response.
|
void |
verifyResponse(String dummyString,
io.cucumber.datatable.DataTable data)
Verify response.
|
void |
verifyResponseMapson(String resource,
io.cucumber.datatable.DataTable data)
Verify response.
|
void |
verifySingleResponse(String resource,
String context)
Mock single response.
|
void |
verifyStatusCode(int statusCode)
Verify status code
|
void |
verifyXMLByPathResponse(String resource,
String contentType,
String fileBody,
List<String> xpaths)
Mock single response.
|
void |
verifyXMLResponse(String resource,
String fileBody)
Mock single response.
|
public static void loadStandardProcessors()
@Given(value="^(.*) with an path param (.*) of (.*)") public void readRequestByPathParam(String dummy, String identifier, String value)
dummy - the dummyidentifier - the identifiervalue - the value@Given(value="^enable cert for (.*) of (.*)") public void cert(String identifier, String value)
identifier - the identifiervalue - the value@Given(value="^basic authentication with (.*) and (.*)") public void auth(String username, String password)
username - the identifierpassword - the value@Given(value="^(.*) auth with (.*) token$") public void bearer(String auth, String token)
auth - the identifiertoken - the value@Given(value="^(.*) perform a api action") public void readRequestByPathParam(String dummy)
dummy - the dummy@Given(value="^(.*) with an header param (.*) of (.*)") public void readRequestByHeaderParam(String dummy, String identifier, String value)
dummy - the dummyidentifier - the identifiervalue - the value@Given(value="add (.*) with given header params$") public void readAllHeaderParams(String nameIgnore, Map<String,String> parameterMap)
nameIgnore - the name ignoreparameterMap - the parameter map@Given(value="add (.*) with given cookie params$") public void readAllCookieParams(String nameIgnore, Map<String,String> parameterMap)
nameIgnore - the name ignoreparameterMap - the parameter map@Given(value="^(.*) with an query param (.*) of (.*)") public void readRequestByQueryParam(String dummy, String identifier, String value)
dummy - the dummyidentifier - the identifiervalue - the value@Given(value="^Provided all the feature level parameters$") public void loadGlobalParam(Map<String,String> globalParams) throws IOException
globalParams - the global paramsIOException - the io exception@Given(value="^Provided all the feature level parameters from file$")
public void loadGlobalParamFromFile()
throws IOException
IOException - the io exception@Then(value="^Verify all the feature level parameters exists") public void validateGlobalParam()
@Given(value="^Add the (.*) value of the key as (.*)") public void addVariable(String responseValue, String key)
responseValue - the response valuekey - the key@Given(value="^evaluate the (.*) decimal value of the key as (.*)") public void modifyDecimalVariable(String responseValue, String key) throws IOException
responseValue - the response valuekey - the keyIOException - the io exception@Given(value="^evaluate the (.*) integer value of the key as (.*)") public void modifyIntVariable(String responseValue, String key) throws IOException
responseValue - the response valuekey - the keyIOException - the io exception@Given(value="^evaluate the (.*) boolean value of the key as (.*)") public void modifyBooleanVariable(String responseValue, String key) throws IOException
responseValue - the response valuekey - the keyIOException - the io exception@Given(value="^Modify the (.*) value of the key as (.*)") public void modifyStringVariable(String responseValue, String key) throws IOException
responseValue - the response valuekey - the keyIOException - the io exception@Given(value="^Store the (.*) value of the key as (.*)") public void loadAsGlobalParam(String responseKey, String key)
responseKey - the response keykey - the key@Given(value="^add (.*) with given path params$") public void readParamsRequest(String nameIgnore, Map<String,String> parameterMap)
nameIgnore - the name ignoreparameterMap - the parameter map@Given(value="^add (.*) with (.*) given form params$") public void readMultiParamsRequest(String nameIgnore, String contentType, Map<String,String> parameterMap)
nameIgnore - the name ignoreparameterMap - the parameter map@Given(value="^add (.*) with (.*) given multipart-form params$") public void readPathParamsRequest(String nameIgnore, String contentType, Map<String,String> parameterMap)
nameIgnore - the name ignoreparameterMap - the parameter map@Given(value="add (.*) with given query params$") public void readRequest(String nameIgnore, Map<String,String> parameterMap)
nameIgnore - the name ignoreparameterMap - the parameter map@Given(value="add (.*) with contentType (.*) given query params$") public void readRequest(String nameIgnore, String contentType, Map<String,String> parameterMap)
nameIgnore - the name ignorecontentType - the content typeparameterMap - the parameter map@Given(value="^Populate (.*) with contentType(.*) given input$") public void loadRequest(String nameIgnore, String contentType, Map<String,String> parameterMap)
nameIgnore - the name ignorecontentType - the content typeparameterMap - the parameter map@Given(value="^Populate (.*) with given input$") public void loadRequest(String nameIgnore, Map<String,String> parameterMap)
nameIgnore - the name ignoreparameterMap - the parameter map@Given(value="^add (.*) data with (.*) given input$") public void createRequest(String body, String contentType)
body - the bodycontentType - the content type@Given(value="add (.*) data file with (.*) given input$") public void createFileRequest(String fileBody, String contentType) throws IOException
fileBody - the bodycontentType - the content typeIOException - the io exception@Given(value="add (.*) data inline with (.*) given input$") public void createInlineRequest(String fileBody, String contentType, List<String> input) throws IOException
fileBody - the bodycontentType - the content typeinput - the inputIOException - the io exception@Given(value="^Create (.*) with contentType (.*) given input$") public void createRequest(String nameIgnore, String contentType, Map<String,String> parameterMap) throws Exception
nameIgnore - the name ignorecontentType - the content typeparameterMap - the parameter mapException - the exception@Given(value="^Create (.*) with given input$") public void createRequest(String nameIgnore, Map<String,String> parameterMap) throws Exception
nameIgnore - the name ignoreparameterMap - the parameter mapException - the exception@Given(value="^Update (.*) with given input$") public void updateRequest(String nameIgnore, Map<String,String> parameterMap) throws Exception
nameIgnore - the name ignoreparameterMap - the parameter mapException - the exception@Given(value="^Update (.*) with contentType (.*) given input$") public void updateRequest(String nameIgnore, String contentType, Map<String,String> parameterMap) throws Exception
nameIgnore - the name ignorecontentType - the content typeparameterMap - the parameter mapException - the exception@When(value="^(.*) post (.*) in (.*) resource on (.*)") public void createRequest(String dummyString, String acceptContentType, String resource, String system)
dummyString - the dummy stringacceptContentType - the accept content typeresource - the resourcesystem - the system@When(value="^(.*) get (.*) in (.*) resource on (.*)") public void readRequest(String dummyString, String acceptContentType, String resource, String system)
dummyString - the dummy stringacceptContentType - the accept content typeresource - the resourcesystem - the system@When(value="^(.*) put (.*) in (.*) resource on (.*)") public void modifyRequest(String dummyString, String acceptContentType, String resource, String system)
dummyString - the dummy stringacceptContentType - the accept content typeresource - the resourcesystem - the system@When(value="^(.*) patch (.*) in (.*) resource on (.*)") public void patchRequest(String dummyString, String acceptContentType, String resource, String system)
dummyString - the dummy stringacceptContentType - the accept content typeresource - the resourcesystem - the system@When(value="^(.*) delete (.*) in (.*) resource on (.*)") public void deleteById(String dummyString, String acceptContentType, String resource, String system)
dummyString - the dummy stringacceptContentType - the accept content typeresource - the resourcesystem - the systempublic void before(io.cucumber.java.Scenario scenario)
@Then(value="^Verify the status code is (\\d+)") public void verifyStatusCode(int statusCode)
statusCode - the status code@And(value="^Verify-standard (.*) all inline (.*) api includes following in the response$") public void verifyFormatedMapson(String type, String resource, List<String> readData) throws Throwable
resource - the resourcetype - the datareadData - the dataThrowable - the throwable@Given(value="^Verify-standard (.*) all (.*) file (.*) api includes following in the response$") public void verifyFormatedMapson(String type, String file, String resource) throws Throwable
type - the datafile - the dataresource - the resourceThrowable - the throwable@And(value="^Verify-all (.*) api includes following in the response$") public void verifyResponseMapson(String resource, io.cucumber.datatable.DataTable data) throws Throwable
resource - the resourcedata - the dataThrowable - the throwable@And(value="^Verify (.*) response inline includes in the response$") public void verifyFileResponse(String resource, List<String> xmlString) throws Throwable
resource - the resourcexmlString - the xml stringThrowable - the throwable@And(value="^Verify (.*) response XML File (.*) includes in the response$") public void verifyXMLResponse(String resource, String fileBody) throws Throwable
resource - the resourcefileBody - the file bodyThrowable - the throwable@And(value="^Verify (.*) response (.*) include byPath (.*) includes in the response$") public void verifyXMLByPathResponse(String resource, String contentType, String fileBody, List<String> xpaths) throws Exception
resource - the resourcefileBody - the file bodyException@And(value="^Verify (.*) response with (.*) includes in the response$") public void verifySingleResponse(String resource, String context)
resource - the resourcecontext - the contextCopyright © 2021. All rights reserved.