-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREST-Project-1-soapui-project.xml
15 lines (13 loc) · 5.67 KB
/
REST-Project-1-soapui-project.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
<?xml version="1.0" encoding="UTF-8"?>
<con:soapui-project id="8b2225f7-a7e1-4907-be9d-ff20e9ad6967" activeEnvironment="Default" name="REST Project 1" resourceRoot="" soapui-version="5.5.0" abortOnError="false" runType="SEQUENTIAL" xmlns:con="http://eviware.com/soapui/config"><con:settings/><con:interface xsi:type="con:RestService" id="0eeaad0c-7063-452f-9113-f6c25a53b904" wadlVersion="http://wadl.dev.java.net/2009/02" name="https://restcountries.eu" type="rest" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><con:settings/><con:definitionCache/><con:endpoints><con:endpoint>https://restcountries.eu</con:endpoint></con:endpoints><con:resource name="" path="/" id="acdae794-78bb-4042-824b-9440fc8bdd58"><con:settings/><con:parameters/><con:method name="1" id="791c3f1d-61f3-4d21-b189-4130b6aff91a" method="GET"><con:settings/><con:parameters/><con:request name="Request 1" id="983c6f74-1d80-43a2-8301-b742ff8af08c" mediaType="application/json"><con:settings/><con:endpoint>https://restcountries.eu</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="0e354ac2-ffa1-409f-a084-87c76e8ae09c" name="TestSuite1"><con:settings/><con:runType>SEQUENTIAL</con:runType><con:testCase id="e97f5970-bff4-4ea4-b21e-dfefdfaa1809" failOnError="true" failTestCaseOnErrors="true" keepSession="false" maxResults="0" name="TestCase1" searchProperties="true"><con:settings/><con:testStep type="httprequest" name="Countries" id="bb97f5f9-e74b-421e-ad85-a593e4e9a407"><con:settings/><con:config method="GET" xsi:type="con:HttpRequest" id="a7867913-0e42-47b7-8539-787c0ce12f49" name="Countries" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><con:settings><con:setting id="com.eviware.soapui.impl.wsdl.WsdlRequest@request-headers"><xml-fragment/></con:setting></con:settings><con:endpoint>https://restcountries.eu/rest/v2/all</con:endpoint><con:request/><con:assertion type="Simple Contains" id="5c6474fd-d89d-4ccd-b5e4-6283e078d102" name="Contains"><con:configuration><token>Barbadian</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:config></con:testStep><con:testStep type="httprequest" name="CapitalCities" id="06dfd98b-1eb9-4b72-851a-de5781f73938"><con:settings/><con:config method="GET" xsi:type="con:HttpRequest" id="db4da251-ee42-4cba-bf79-315ae8bbd767" name="CapitalCities" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><con:settings><con:setting id="com.eviware.soapui.impl.wsdl.WsdlRequest@request-headers"><xml-fragment/></con:setting></con:settings><con:endpoint>https://restcountries.eu/rest/v2/capital/ankara</con:endpoint><con:request/><con:assertion type="Simple Contains" id="44f55d37-1ffd-4d4f-bdd0-38c0fddb1d8f" name="Contains"><con:configuration><token>Turkey</token><ignoreCase>false</ignoreCase><useRegEx>false</useRegEx></con:configuration></con:assertion><con:assertion type="JsonPath Count" id="28901f99-6811-4e67-aeeb-58f88a94225d" name="JsonPath Count"><con:configuration><path>[0].currencies[0].name</path><content>1</content><allowWildcards>false</allowWildcards><ignoreNamspaceDifferences>false</ignoreNamspaceDifferences><ignoreComments>false</ignoreComments></con:configuration></con:assertion><con:assertion type="JsonPath Count" id="7cad0778-3f4a-42bf-8a09-0b4e8e89660a"><con:configuration/></con:assertion><con:assertion type="Valid HTTP Status Codes" id="9f08467b-0872-43ff-a50f-edbff97d7ef5" name="Valid HTTP Status Codes"><con:configuration><codes>200</codes></con:configuration></con:assertion><con:assertion type="Response SLA Assertion" id="6f4c92a4-e92a-4ea6-89d1-44e682147bd0" name="Response SLA"><con:configuration><SLA>200</SLA></con:configuration></con:assertion><con:assertion type="GroovyScriptAssertion" id="2fa90d99-7894-4645-80bd-93741e99c7d5" name="Script Assertion"><con:configuration><scriptText>//get json response
import groovy.json.JsonSlurper
def responseMessage = messageExchange.response.responseContent
def json = new JsonSlurper().parseText(responseMessage)
</scriptText></con:configuration></con:assertion><con:assertion type="GroovyScriptAssertion" id="379e7625-1dee-4455-8ca5-e475fcb37272" name="Script Assertion"><con:configuration><scriptText>//get json response
import groovy.json.JsonSlurper
def responseMessage = messageExchange.response.responseContent
def json = new JsonSlurper().parseText(responseMessage)
//assert node values
log.info json.name
assert json.capital.toString() != null
assert json.name.toString() == "[Turkey]"</scriptText></con:configuration></con:assertion><con:credentials><con:authType>No Authorization</con:authType></con:credentials><con:jmsConfig JMSDeliveryMode="PERSISTENT"/><con:jmsPropertyConfig/><con:parameters/></con:config></con:testStep><con:setupScript>log.info("Setup method before testcase1")</con:setupScript><con:tearDownScript>log.info("Setup method after testcase1")</con:tearDownScript><con:properties/></con:testCase><con:properties/><con:setupScript>log.info("Setup method before testsuite1")</con:setupScript><con:tearDownScript>log.info("Setup method after testsuite1")</con:tearDownScript></con:testSuite><con:properties/><con:afterLoadScript/><con:wssContainer/><con:oAuth2ProfileContainer/><con:oAuth1ProfileContainer/><con:beforeRunScript>log.info("Setup method before testsuite")</con:beforeRunScript><con:afterRunScript>log.info("Setup method after testsuite")</con:afterRunScript><con:sensitiveInformation/></con:soapui-project>