I would like to have the ability to pass in checks to a method that makes a gatling post. I am having some issue doing so. I tried using a few different types on the checks but had no luck. I would like to something like the below on a “page” object that would be used elsewhere in the app. I think I briefly saw there are other types of checks beyond status based checks. I would like the method to be flexible enough to handle such things if possible.
protected val commonChecks = Seq(status.not(404),status.not(503))
def login(checks:HttpCheck = commonChecks) = {
exec(http("post login")
.post("/login")
.headers(someheader)
.formParam("login", "${userName}")
.formParam("password", "${password}")
.check(commonChecks)
)
}