0
我怎樣才能創建一個加特林腳本create account
?創建帳戶腳本
我不覺得我怎麼可以訪問代碼的post
響應波紋管創建另一個請求的任何實例。
val httpConf = http
.baseURL("http://localhost:3030") // Here is the root for all relative URLs
.acceptHeader("application/json") // Here are the common headers
val orderRefs = Iterator.continually(
// Random number will be accessible in session under variable "OrderRef"
Map("OrderRef" -> Random.nextInt(Integer.MAX_VALUE))
)
val scn = scenario("Create Account") // A scenario is a chain of requests and pauses
.feed(orderRefs)
.exec(http("Create Account Request")
.post("/account-request")
.body(StringBody("""{"password":"pw${OrderRef}","email":"email${OrderRef}@test.com","firstName":"Name${OrderRef}"}""")).asJSON)
setUp(scn.inject(atOnceUsers(10)).protocols(httpConf))
在我的例子我想打電話/activate-accont/:token
與呼叫上述