对于一个场景,我想检查响应的状态码是否属于200-209或304或404。
我尝试了以下操作,但显然不支持。而且我在文档中找不到我的用例。
scenario("Scenario example").exec(httpRequest
.check(status.in(200 to 209, 304, 404)))
是否有更好的解决方案除了清单代码手动?
.check(status.in(200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 304, 404))
.check(
status.in((200 to 209) ++ List(304, 404))
)
您传递了与Seq
和Int
混合的东西
in
取Seq[Int]
的方法:
.check(
status.in((201 to 209) :+ 303 :+ 304)
)