当我尝试使用以下功能时,我收到必需的请求部分“文件”不存在
功能:验证 API 是否正确返回产品
Background:
* url 'http://localhost:8080'
Scenario: Products are returned on post
Given path 'upload'
And multipart field files = read('test.txt')
When method post
Then status 200
And match $ == {error: false, bytesUploaded:'#notnull'}
请为文件上传 api 测试建议正确的解决方案或替代方案
请参阅multipart file
文档:https://github.com/intuit/karate#multipart-file
Given path 'upload'
And multipart file files = { read: 'test.txt', filename: 'test.txt', contentType: 'text/plain' }
When method post
Then status 200
And match $ == { error: false, bytesUploaded: '#notnull' }
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)