Package com.privalia.qa.specs
Class SoapServiceGSpec
- java.lang.Object
-
- com.privalia.qa.specs.BaseGSpec
-
- com.privalia.qa.specs.SoapServiceGSpec
-
public class SoapServiceGSpec extends BaseGSpec
Steps definitions for working with SOAP web services- Author:
- Jose Fernandez
-
-
Field Summary
-
Fields inherited from class com.privalia.qa.specs.BaseGSpec
commonspec
-
-
Constructor Summary
Constructors Constructor Description SoapServiceGSpec(CommonG spec)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
iExecuteTheMethodAddBasedOnSchemasAddRequestWith(String actionName, String requestFile, String foo, io.cucumber.datatable.DataTable modifications)
Executes the remote method in the webservice.void
theResponseMatchesTheFollowingCases(io.cucumber.datatable.DataTable results)
Evaluates the response of the remote websevice against a set of conditions provided by a datatablevoid
theWebserviceWSDLIsLocatedIn(String remoteWsdlAddress)
Indicates the library the location of the remote WSDL (descriptor of the remote webservice) This is an initialization step and must be provided before executing any other steps-
Methods inherited from class com.privalia.qa.specs.BaseGSpec
getCommonSpec
-
-
-
-
Constructor Detail
-
SoapServiceGSpec
public SoapServiceGSpec(CommonG spec)
-
-
Method Detail
-
theWebserviceWSDLIsLocatedIn
@Given("^The webservice WSDL is located in \'(.+?)\'$") public void theWebserviceWSDLIsLocatedIn(String remoteWsdlAddress) throws Throwable
Indicates the library the location of the remote WSDL (descriptor of the remote webservice) This is an initialization step and must be provided before executing any other steps- Parameters:
remoteWsdlAddress
- Remote URL of the WSDL document- Throws:
Throwable
- Throwable
-
iExecuteTheMethodAddBasedOnSchemasAddRequestWith
@When("^I execute the method \'(.+?)\' based on \'([^:]+?)\'( with:)?$") public void iExecuteTheMethodAddBasedOnSchemasAddRequestWith(String actionName, String requestFile, String foo, io.cucumber.datatable.DataTable modifications) throws Throwable
Executes the remote method in the webservice. A request body must be provided for this operation. There is also the possibility of altering values of the request body before sending providing a datatable- Parameters:
actionName
- Remote method to execute. The method name will be translated to the corresponding SOAPActionrequestFile
- File containing the request (XML)foo
- parameter generated by cucumber because of the optional expressionmodifications
- (Optional) a datatable with modifications to perform on the request before sending Example: Assuming the request XML body contains the following tags: <intA>int<intA/> <intB>int<intB/> To alter the value of intA and intB, a datatable like the following should be provided: | intA | 1 | | intB | 1 | And the corresponding values for the given tags in the body will be <intA>1<intA/> <intB>1<intB/>- Throws:
Throwable
- Throwable
-
theResponseMatchesTheFollowingCases
@Then("^The response matches the following cases:$") public void theResponseMatchesTheFollowingCases(io.cucumber.datatable.DataTable results) throws Throwable
Evaluates the response of the remote websevice against a set of conditions provided by a datatable- Parameters:
results
- Expected results in a datatable Example: Assuming the response from the webservice (XML response), contains the following XML tag: <AddResult>2<AddResult/> To verify that AddResult tag equals "2", a datatable like the following should be provided: | AddResult | equal | 2 | Suported operations: - equal - not equal - contains - does not contain - length- Throws:
Throwable
- Throwable
-
-