Summary| Tags| Feature: examples/tests/test.feature| sample karate test script
Scenario: [1:3] test
ms: 2042
# create a resource at https://hookbin.com/ and paste down here if you want to
# * def myUrl = "https://hookb.in/jezmJOQYokFeBB23yn2b"
7
* def myUrl = "https://httpbin.org/post"
5
16:38:04.184 karate.env system property was: null
8
* def requestBody =
59
<?xml version="1.0" encoding="UTF-8"?><S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Header/> <S:Body> <create-request-request xmlns="https://id.signicat.com/definitions/wsdl/Document-v3"> <service>123456789</service> <password>123456789</password> <request> <language>en</language> <task bundle="no" id="12321234"> <document-action optional="ok" send-result-to-archive="maybe" type="type"> <document xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" id="1233445" ref-sds-id="1234567890" send-to-archive="false" xsi:type="sds-document"> <sign-text-entry /> <description>description</description> </document> </document-action> <signature responsive="false"> <method handwritten="false" signed-statement="false">something</method> </signature> </task> </request> </create-request-request> </S:Body> </S:Envelope>
34
Given url myUrl
0
35
And request requestBody
0
36
When method post
1931
16:38:05.432 request: 1 > POST https://httpbin.org/post 1 > Content-Type: application/xml; charset=UTF-8 1 > Content-Length: 1222 1 > Host: httpbin.org 1 > Connection: Keep-Alive 1 > User-Agent: Apache-HttpClient/4.5.13 (Java/11.0.11) 1 > Accept-Encoding: gzip,deflate <S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Header/> <S:Body> <create-request-request xmlns="https://id.signicat.com/definitions/wsdl/Document-v3"> <service xmlns="">123456789</service> <password xmlns="">123456789</password> <request xmlns=""> <language>en</language> <task bundle="no" id="12321234"> <document-action optional="ok" send-result-to-archive="maybe" type="type"> <document xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" id="1233445" ref-sds-id="1234567890" send-to-archive="false" xsi:type="sds-document"> <sign-text-entry/> <description>description</description> </document> </document-action> <signature responsive="false"> <method handwritten="false" signed-statement="false">something</method> </signature> </task> </request> </create-request-request> </S:Body> </S:Envelope> 16:38:06.270 response time in milliseconds: 811 1 < 200 1 < Date: Wed, 05 May 2021 14:38:06 GMT 1 < Content-Type: application/json 1 < Content-Length: 1733 1 < Connection: keep-alive 1 < Server: gunicorn/19.9.0 1 < Access-Control-Allow-Origin: * 1 < Access-Control-Allow-Credentials: true {"args":{},"headers":{"User-Agent":"Apache-HttpClient\/4.5.13 (Java\/11.0.11)","Host":"httpbin.org","Accept-Encoding":"gzip,deflate","Content-Length":"1222","X-Amzn-Trace-Id":"Root=1-6092adce-50320f0b5e5723fb70cc3d2a","Content-Type":"application\/xml; charset=UTF-8"},"data":"<S:Envelope xmlns:S=\"http:\/\/schemas.xmlsoap.org\/soap\/envelope\/\" xmlns:SOAP-ENV=\"http:\/\/schemas.xmlsoap.org\/soap\/envelope\/\">\n <SOAP-ENV:Header\/>\n <S:Body>\n <create-request-request xmlns=\"https:\/\/id.signicat.com\/definitions\/wsdl\/Document-v3\">\n <service xmlns=\"\">123456789<\/service>\n <password xmlns=\"\">123456789<\/password>\n <request xmlns=\"\">\n <language>en<\/language>\n <task bundle=\"no\" id=\"12321234\">\n <document-action optional=\"ok\" send-result-to-archive=\"maybe\" type=\"type\">\n <document xmlns:xsi=\"http:\/\/www.w3.org\/2001\/XMLSchema-instance\" id=\"1233445\" ref-sds-id=\"1234567890\" send-to-archive=\"false\" xsi:type=\"sds-document\">\n <sign-text-entry\/>\n <description>description<\/description>\n <\/document>\n <\/document-action>\n <signature responsive=\"false\">\n <method handwritten=\"false\" signed-statement=\"false\">something<\/method>\n <\/signature>\n <\/task>\n <\/request>\n <\/create-request-request>\n <\/S:Body>\n<\/S:Envelope>","form":{},"origin":"217.144.77.60","files":{},"json":null,"url":"https:\/\/httpbin.org\/post"}
37
Then status 200
0
38
And match response.data !contains '<service xmlns="">123456789</service>'
47
16:38:06.322 classpath:examples/tests/test.feature:38 And match response.data !contains '<service xmlns="">123456789</service>' match failed: NOT_CONTAINS $ | actual contains expected (STRING:STRING) '<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Header/> <S:Body> <create-request-request xmlns="https://id.signicat.com/definitions/wsdl/Document-v3"> <service xmlns="">123456789</service> <password xmlns="">123456789</password> <request xmlns=""> <language>en</language> <task bundle="no" id="12321234"> <document-action optional="ok" send-result-to-archive="maybe" type="type"> <document xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" id="1233445" ref-sds-id="1234567890" send-to-archive="false" xsi:type="sds-document"> <sign-text-entry/> <description>description</description> </document> </document-action> <signature responsive="false"> <method handwritten="false" signed-statement="false">something</method> </signature> </task> </request> </create-request-request> </S:Body> </S:Envelope>' '<service xmlns="">123456789</service>' classpath:examples/tests/test.feature:38
39
And match response.data !contains '<password xmlns="">123456789</password>'
0