当我尝试使用以下功能时,我将获得所需的请求部分'文件'不存在功能:验证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' }