-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbpdts-tech-test-soapui-project.xml
39 lines (30 loc) · 14.3 KB
/
bpdts-tech-test-soapui-project.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<?xml version="1.0" encoding="UTF-8"?>
<con:soapui-project id="c109293e-3861-425d-84a6-d5545493bba5" activeEnvironment="Default" name="bpdts-tech-test-project" resourceRoot="" soapui-version="5.5.0" xmlns:con="http://eviware.com/soapui/config"><con:settings/><con:interface xsi:type="con:RestService" id="e3c13375-1512-4838-83a1-207e0ff20519" wadlVersion="http://wadl.dev.java.net/2009/02" name="API" type="rest" basePath="" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><con:description xsi:nil="true"/><con:settings/><con:definitionCache type="TEXT" rootPart=""/><con:endpoints><con:endpoint>http://bpdts-test-app-v2.herokuapp.com</con:endpoint></con:endpoints><con:resource name="/city/{city}/users" path="/city/{city}/users" id="aefa19bc-bc8b-4e6c-9a28-b9fd08637382"><con:settings/><con:parameters><con:parameter required="true"><con:name>city</con:name><con:value/><con:style>TEMPLATE</con:style><con:default/><con:description xsi:nil="true"/></con:parameter><con:parameter><con:name>city</con:name><con:style>TEMPLATE</con:style></con:parameter></con:parameters><con:method name="get_users" id="68b1f391-0a6d-4e1c-9143-83721f6c5871" method="GET"><con:description>
</con:description><con:settings/><con:parameters/><con:representation type="RESPONSE"><con:mediaType>application/json</con:mediaType><con:status>200</con:status><con:params/></con:representation><con:representation type="RESPONSE"><con:mediaType>text/html; charset=utf-8</con:mediaType><con:status>200</con:status><con:params/><con:element>html</con:element></con:representation><con:representation type="FAULT"><con:mediaType>text/html</con:mediaType><con:status>404</con:status><con:params/><con:element>html</con:element></con:representation><con:request name="Request 1" id="633ae690-1f55-4e8a-9aa9-caa2b3156580" mediaType="application/json"><con:settings><con:setting id="com.eviware.soapui.impl.wsdl.WsdlRequest@request-headers"><xml-fragment/></con:setting></con:settings><con:endpoint>http://bpdts-test-app-v2.herokuapp.com</con:endpoint><con:request/><con:originalUri>http://bpdts-test-app-v2.herokuapp.com/</con:originalUri><con:credentials><con:authType>No Authorization</con:authType></con:credentials><con:jmsConfig JMSDeliveryMode="PERSISTENT"/><con:jmsPropertyConfig/><con:parameters><entry key="city" value="London" xmlns="http://eviware.com/soapui/config"/></con:parameters><con:parameterOrder><con:entry>city</con:entry><con:entry/></con:parameterOrder></con:request></con:method></con:resource><con:resource name="/instructions" path="/instructions" id="f25b250a-0531-4450-9f84-7e578a1c2743"><con:settings/><con:parameters><con:parameter required="true"><con:name>city</con:name><con:value/><con:style>TEMPLATE</con:style><con:default/><con:description xsi:nil="true"/></con:parameter></con:parameters><con:method name="get_users" id="2f673111-b57c-4e9f-8430-7a0735d40157" method="GET"><con:description>
</con:description><con:settings/><con:parameters/><con:representation type="RESPONSE"><con:mediaType>application/json</con:mediaType><con:status>200</con:status><con:params/></con:representation><con:representation type="RESPONSE"><con:mediaType>text/html; charset=utf-8</con:mediaType><con:status>200</con:status><con:params/><con:element>html</con:element></con:representation><con:representation type="FAULT"><con:mediaType>text/html</con:mediaType><con:status>404</con:status><con:params/><con:element>html</con:element></con:representation><con:request name="Request 1" id="fdfea791-b87d-4abe-a9c7-03068d596759" mediaType="application/json"><con:settings><con:setting id="com.eviware.soapui.impl.wsdl.WsdlRequest@request-headers"><xml-fragment/></con:setting></con:settings><con:endpoint>http://bpdts-test-app-v2.herokuapp.com</con:endpoint><con:request/><con:originalUri>http://bpdts-test-app-v2.herokuapp.com/</con:originalUri><con:credentials><con:authType>No Authorization</con:authType></con:credentials><con:jmsConfig JMSDeliveryMode="PERSISTENT"/><con:jmsPropertyConfig/><con:parameters><entry key="city" value="London" xmlns="http://eviware.com/soapui/config"/></con:parameters><con:parameterOrder><con:entry>city</con:entry></con:parameterOrder></con:request></con:method></con:resource><con:resource name="/user/{id}" path="/user/{id}" id="5e053d34-4767-45a4-9f76-5fbb734c6e67"><con:settings/><con:parameters><con:parameter required="true"><con:name>id</con:name><con:value/><con:style>TEMPLATE</con:style><con:default/><con:description xsi:nil="true"/></con:parameter></con:parameters><con:method name="get_users" id="740806fa-77d4-4a03-9e45-70cea3a9e5c6" method="GET"><con:description>
</con:description><con:settings/><con:parameters/><con:representation type="RESPONSE"><con:mediaType>application/json</con:mediaType><con:status>404 200</con:status><con:params/></con:representation><con:representation type="RESPONSE"><con:mediaType>application/json</con:mediaType><con:status>200</con:status><con:params/></con:representation><con:representation type="FAULT"><con:mediaType>text/html</con:mediaType><con:status>404</con:status><con:params/><con:element>html</con:element></con:representation><con:representation type="FAULT"><con:mediaType>application/json</con:mediaType><con:status>404</con:status><con:params/><con:element xmlns:user="http://bpdts-test-app-v2.herokuapp.com/user/">user:Fault</con:element></con:representation><con:request name="Request 1" id="9db6a185-b2fc-4ebe-86c0-6c02d4b4577f" mediaType="application/json"><con:settings><con:setting id="com.eviware.soapui.impl.wsdl.WsdlRequest@request-headers"><xml-fragment/></con:setting></con:settings><con:endpoint>http://bpdts-test-app-v2.herokuapp.com</con:endpoint><con:request/><con:originalUri>http://bpdts-test-app-v2.herokuapp.com/user/</con:originalUri><con:credentials><con:authType>No Authorization</con:authType></con:credentials><con:jmsConfig JMSDeliveryMode="PERSISTENT"/><con:jmsPropertyConfig/><con:parameters/><con:parameterOrder><con:entry>id</con:entry></con:parameterOrder></con:request></con:method></con:resource><con:resource name="/users" path="/users" id="aeaa8130-00ae-4ae8-a4b6-1370b8604ad0"><con:settings/><con:parameters/><con:method name="get_users" id="8e0f64d2-9216-4c78-b3e5-f150d28b6f3f" method="GET"><con:description>
</con:description><con:settings/><con:parameters/><con:representation type="RESPONSE"><con:mediaType>application/json</con:mediaType><con:status>200</con:status><con:params/></con:representation><con:request name="Request 1" id="70ddf360-675e-4ab0-9ee0-f294b151e38e" mediaType="application/json"><con:settings/><con:endpoint>http://bpdts-test-app-v2.herokuapp.com</con:endpoint><con:request/><con:credentials><con:authType>No Authorization</con:authType></con:credentials><con:jmsConfig JMSDeliveryMode="PERSISTENT"/><con:jmsPropertyConfig/><con:parameters/></con:request></con:method></con:resource></con:interface><con:testSuite id="876d1cf6-f613-44b2-8e28-657d3cdb9807" name="API TestSuite"><con:description>TestSuite generated for REST Service [API]</con:description><con:settings/><con:runType>SEQUENTIAL</con:runType><con:testCase id="4d2db561-3861-4a4e-a48b-94a60543fe9f" failOnError="true" failTestCaseOnErrors="true" keepSession="false" maxResults="0" name="happy path test case" searchProperties="true"><con:settings/><con:testStep type="restrequest" name="get users in London" id="341b7368-64de-4496-8d42-628c6fb3abc1"><con:settings/><con:config service="API" resourcePath="/city/{city}/users" methodName="get_users" xsi:type="con:RestRequestStep" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><con:restRequest name="get_users - Request 1" id="633ae690-1f55-4e8a-9aa9-caa2b3156580" mediaType="application/json"><con:settings><con:setting id="com.eviware.soapui.impl.wsdl.WsdlRequest@request-headers"><xml-fragment/></con:setting></con:settings><con:endpoint>http://bpdts-test-app-v2.herokuapp.com</con:endpoint><con:request/><con:originalUri>http://bpdts-test-app-v2.herokuapp.com/</con:originalUri><con:assertion type="Valid HTTP Status Codes" id="612ebf26-3cfd-4161-bc10-0e0e4c37c030" name="Valid HTTP Status Codes"><con:configuration><codes>200</codes></con:configuration></con:assertion><con:credentials><con:authType>No Authorization</con:authType></con:credentials><con:jmsConfig JMSDeliveryMode="PERSISTENT"/><con:jmsPropertyConfig/><con:parameters><entry key="city" value="London" xmlns="http://eviware.com/soapui/config"/></con:parameters><con:parameterOrder><con:entry>city</con:entry><con:entry/></con:parameterOrder></con:restRequest></con:config></con:testStep><con:testStep type="groovy" name="set userID" id="a8e2d162-17b0-45f4-a1c8-cd805284ab13"><con:settings/><con:config><script>import groovy.json.JsonSlurper
//Check the response is not empty
assert context.response, 'Response is empty or null'
//get id
responseContent = testRunner.testCase.getTestStepByName("get users in London").getPropertyValue("response")
slurperresponse = new JsonSlurper().parseText(responseContent)
//set userID property
testRunner.testCase.setPropertyValue("userID", slurperresponse.id[0].toString())
def userID = testRunner.testCase.testSuite.project.getPropertyValue("userID")
//log userID for debugging
log.info(userID)</script></con:config></con:testStep><con:testStep type="restrequest" name="get user" id="133b82f2-6760-4035-8026-d067de17d39a"><con:settings/><con:config service="API" resourcePath="/user/{id}" methodName="get_users" xsi:type="con:RestRequestStep" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><con:restRequest name="get user" id="9db6a185-b2fc-4ebe-86c0-6c02d4b4577f" mediaType="application/json"><con:settings><con:setting id="com.eviware.soapui.impl.wsdl.WsdlRequest@request-headers"><xml-fragment/></con:setting></con:settings><con:endpoint>http://bpdts-test-app-v2.herokuapp.com</con:endpoint><con:request/><con:originalUri>http://bpdts-test-app-v2.herokuapp.com/user/</con:originalUri><con:assertion type="Valid HTTP Status Codes" id="60cb2028-41c3-405d-92fc-d2151303c601" name="Valid HTTP Status Codes"><con:configuration><codes>200</codes></con:configuration></con:assertion><con:assertion type="Simple Contains" id="a47bb5f3-809b-4d85-933c-ff28a6732ff7" name="Contains London"><con:configuration><token>London</token><ignoreCase>false</ignoreCase><useRegEx>false</useRegEx></con:configuration></con:assertion><con:credentials><con:authType>No Authorization</con:authType></con:credentials><con:jmsConfig JMSDeliveryMode="PERSISTENT"/><con:jmsPropertyConfig/><con:parameters><entry key="id" value="${#TestCase#userID}" xmlns="http://eviware.com/soapui/config"/></con:parameters><con:parameterOrder><con:entry>id</con:entry></con:parameterOrder></con:restRequest></con:config></con:testStep><con:testStep type="groovy" name="set user properties" id="43c4783a-1597-48d8-9c1a-24fab2dc3e8b"><con:settings/><con:config><script>import groovy.json.JsonSlurper
//Check the response is not empty
assert context.response, 'Response is empty or null'
//get user details
responseContent = testRunner.testCase.getTestStepByName("get user").getPropertyValue("response")
slurperresponse = new JsonSlurper().parseText(responseContent)
//set firstName property
testRunner.testCase.setPropertyValue("firstName", slurperresponse.first_name.toString())
def firstName2 = testRunner.testCase.testSuite.project.getPropertyValue("firstName")
//set lastName property
testRunner.testCase.setPropertyValue("lastName", slurperresponse.last_name.toString())
def lastName = testRunner.testCase.testSuite.project.getPropertyValue("lastName")
//set email property
testRunner.testCase.setPropertyValue("email", slurperresponse.email.toString())
def email = testRunner.testCase.testSuite.project.getPropertyValue("email")</script></con:config></con:testStep><con:testStep type="restrequest" name="get all users" id="dc708094-eb1a-4f4a-96f7-8760dc80ae80"><con:settings/><con:config service="API" resourcePath="/users" methodName="get_users" xsi:type="con:RestRequestStep" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><con:restRequest name="get all users" id="70ddf360-675e-4ab0-9ee0-f294b151e38e" mediaType="application/json"><con:settings><con:setting id="com.eviware.soapui.impl.wsdl.WsdlRequest@request-headers"><xml-fragment/></con:setting></con:settings><con:endpoint>http://bpdts-test-app-v2.herokuapp.com</con:endpoint><con:request/><con:originalUri>http://bpdts-test-app-v2.herokuapp.com/users</con:originalUri><con:assertion type="Valid HTTP Status Codes" id="1e19e91c-1ba5-49b0-96bc-fd6ac22de488" name="Valid HTTP Status Codes"><con:configuration><codes>200</codes></con:configuration></con:assertion><con:assertion type="Simple Contains" id="612085d1-baec-469d-b309-d7f600d9621b" name="Contains id"><con:configuration><token>${#TestCase#userID}</token><ignoreCase>false</ignoreCase><useRegEx>false</useRegEx></con:configuration></con:assertion><con:assertion type="Simple Contains" id="612085d1-baec-469d-b309-d7f600d9621b" name="Contains"><con:configuration><token/><ignoreCase>false</ignoreCase><useRegEx>false</useRegEx></con:configuration></con:assertion><con:assertion type="Simple Contains" id="612085d1-baec-469d-b309-d7f600d9621b" name="Contains lastName"><con:configuration><token>${#TestCase#lastName}</token><ignoreCase>false</ignoreCase><useRegEx>false</useRegEx></con:configuration></con:assertion><con:assertion type="Simple Contains" id="612085d1-baec-469d-b309-d7f600d9621b" name="Contains email"><con:configuration><token>${#TestCase#email}</token><ignoreCase>false</ignoreCase><useRegEx>false</useRegEx></con:configuration></con:assertion><con:credentials><con:authType>No Authorization</con:authType></con:credentials><con:jmsConfig JMSDeliveryMode="PERSISTENT"/><con:jmsPropertyConfig/><con:parameters/></con:restRequest></con:config></con:testStep><con:properties><con:property><con:name>userID</con:name><con:value>135</con:value></con:property><con:property><con:name>firstName</con:name><con:value>Mechelle</con:value></con:property><con:property><con:name>lastName</con:name><con:value>Boam</con:value></con:property><con:property><con:name>email</con:name><con:value>[email protected]</con:value></con:property></con:properties></con:testCase><con:properties><con:property><con:name>id</con:name></con:property></con:properties></con:testSuite><con:properties><con:property><con:name>city</con:name><con:value>London</con:value></con:property><con:property><con:name>a</con:name><con:value>135</con:value></con:property><con:property><con:name>userID</con:name><con:value>135</con:value></con:property></con:properties><con:wssContainer/><con:oAuth2ProfileContainer/><con:oAuth1ProfileContainer/><con:sensitiveInformation/></con:soapui-project>