【发布时间】:2019-03-15 11:03:52
【问题描述】:
我正在使用 Rest Assured,结合 Cucumber 来测试具有多个查询参数的 API。比方说,API 是
http://dev.abcd.com/mainpath?param1=value1¶m2=value2¶m3=value3
我想根据 Cucumber 场景改变参数值
Scenario Outline: API returns successfull response on different parameters
Given Main path API is hit
When "<param1>","<param2>","<param3>" are passed
Then the response returns a status code of 200
Examples:
|param1|param2|param3|
|value1|value2|value3|
|value4|value5|value6|
我浏览了文档和另一个示例here,但现在不推荐使用参数方法,而且我不确定是否可以这样做。
大部分教程和文档直接指定以given().queryParam().then() 格式传递参数,我将不得不硬编码参数,这是我不想要的。
关于这方面的任何指示都会有所帮助。
【问题讨论】:
标签: cucumber rest-assured web-api-testing