有没有办法将参数组合成一个参数,例如传递一个产生所有参数的数据结构?
例如,我想避免使用带有太多参数的方法:
Scenario Outline: My scenario has too many parameters
When I perform my request with these inputs: <param1>, <param2>, <param3>, <param4>, <param5>, <param6>, <param7>, <param8>, <param9>, <param10>, <param11>
Examples:
| param1 | param2 | param3 | param4 | param5 | param6 | param7 | param8 | param9 | param10 | param11 |
| dummy | dummy | dummy | dummy | dummy | dummy | dummy | dummy | dummy | dummy | dummy |
| dummy | dummy | dummy | dummy | dummy | dummy | dummy | dummy | dummy | dummy | dummy |
然后是方法:
@Given("^When I perform my request with these inputs: (.+), (.+), (.+), (.+), (.+), (.+), (.+), (.+), (.+), (.+), (.+)$")
public void tooMany(String param1, String param2, String param3, String param4, String param5, String param6, String param7, String param8, String param9, String param10, String param11) {
...
有没有更好的方法来传输那么多输入?
Helenr
慕莱坞森
相关分类