【发布时间】:2018-05-22 08:24:37
【问题描述】:
我正在尝试使用空手道在特定的松弛通道上上传图像,但没有运气,我尝试了多次不同的步骤,但仍然有 200 响应,并且图像未显示在通道中。 尝试发布文字内容,成功找到频道上的文字。
下面是我按照空手道文档进行的 2 次尝试:
@post
Feature: Post images
Background:
* url 'https://slack.com/api/files.upload'
* def req_params= {token: 'xxxxxxx',channels:'team',filename:'from Karate',pretty:'1'}
Scenario: upload image
Given path 'api','files'
And params req_headers
And multipart file myFile = { read: 'thumb.jpg', filename:
'upload-name.jpg', contentType: 'image/jpg' }
And multipart field message = 'image upload test'
And request req_headers
When method post
Then status 200
或
Given path 'files','binary'
And param req_params
And request read('thumb.jpg')
When method post
Then status 200
我错过了什么吗?尝试了在上传 pdf 和 jpg 的空手道演示 GitHub 存储库中找到的相同示例,但没有成功。
注意:使用 Slack API UI 工作。
【问题讨论】:
标签: rest cucumber-jvm karate