如何创建空手道测试以验证WSDL文件
我想确保我的WSDL合同没有变化,但是它对
Scenario: Get demo.wsdl
Given path '/demo'
And param wsdl = 'demoLookup.wsdl'
When method get
Then status 200
# note how we focus only on the relevant part of the payload and read expected XML from a file
# And print 'response: ', response
* def expected = read('expected-demo.wsdl')
And match response contains expected
我收到
match failed: CONTAINS
/ | data types don't match (XML:LIST)
[60,119,115,100,108,58,100,101,10....
的文件的响应匹配,我假设这不是一个支持的功能,是否有任何解决方法,例如在RAW文件上匹配?
I'd like to ensure my WSDL contract is unchanged but matching on its response to a file
Scenario: Get demo.wsdl
Given path '/demo'
And param wsdl = 'demoLookup.wsdl'
When method get
Then status 200
# note how we focus only on the relevant part of the payload and read expected XML from a file
# And print 'response: ', response
* def expected = read('expected-demo.wsdl')
And match response contains expected
I get
match failed: CONTAINS
/ | data types don't match (XML:LIST)
[60,119,115,100,108,58,100,101,10....
I'm assuming this is not a supported feature, is there any workarounds like matching on a raw file?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
空手道对WSDL文件没有直接的支持。我个人的看法是,出于API端到端测试的目的,您不需要它。只需获取示例XML有效载荷并进行比较即可。这就是大多数团队所做的。
我还要补充说,根据我的经验,团队正在寻找捷径,例如期望WSDL或某种“模式”为他们进行所有辛勤工作。这总是很糟糕。您需要测试数据库状态,业务逻辑等。只是我的2 c。
Karate has no direct support for WSDL files. My personal opinion is that for the purposes of API end-to-end testing, you don't need it. Just get a sample XML payload and do a comparison. This is what most teams do.
I'll also add that in my experience teams look for short-cuts, like expecting a WSDL or some kind of "schema" to do all the hard work of testing for them. This always ends badly. You need to test for things like database state, business logic and so on. Just my 2 c.
如果其他人正在尝试类似的需求。
chksum.java
功能
In case someone else is attempting a similar need.
ChkSum.java
Feature