Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import scala.concurrent.duration._
- import io.gatling.core.Predef._
- import io.gatling.http.Predef._
- import io.gatling.jdbc.Predef._
- class logingood extends Simulation {
- val httpProtocol = http
- .baseUrl("https://webapi.wage.iteodev.com")
- .inferHtmlResources()
- .userAgentHeader("Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.120 Safari/537.36")
- .proxy(Proxy("localhost", 8888).httpsPort(8888))
- val headers_0 = Map(
- "Accept" -> "application/json, text/plain, */*",
- "Origin" -> "https://frontend.iteodev.com",
- "Sec-Fetch-Mode" -> "cors")
- val headers_1 = Map(
- "Access-Control-Request-Headers" -> "authorization",
- "Access-Control-Request-Method" -> "GET",
- "Origin" -> "https://frontend.iteodev.com",
- "Sec-Fetch-Mode" -> "cors")
- val headers_2 = Map(
- "Accept" -> "application/json, text/plain, */*",
- "Origin" -> "https://frontend.iteodev.com",
- "Sec-Fetch-Mode" -> "cors",
- "authorization" -> "Bearer ${authToken}")
- val headers_3 = Map("Sec-Fetch-Mode" -> "no-cors")
- val headers_7 = Map(
- "Origin" -> "https://frontend.iteodev.com",
- "Sec-Fetch-Mode" -> "cors",
- "content-type" -> "application/x-www-form-urlencoded; charset=UTF-8")
- val uri1 = "https://api.wage.iteodev.com/signalr"
- val uri2 = "https://frontend.iteodev.com/static/media/download-app-headline.a2c2b312.svg"
- val scn = scenario("logingood")
- .exec(http("request_0")
- .post("/api/oauth/token")
- .headers(headers_0)
- .formParam("username", "[email protected]")
- .formParam("password", "Zaq1@wsx")
- .formParam("grant_type", "password")
- .check(jsonPath("$..access_token").exists.saveAs("authToken"))
- .resources(http("request_1")
- .options("/api/account")
- .headers(headers_1),
- http("request_2")
- .get("/api/account")
- .headers(headers_2),
- http("request_3")
- .get(uri2)
- .headers(headers_3),
- http("request_4")
- .options("/api/conversations/")
- .headers(headers_1),
- http("request_5")
- .get("/api/conversations/")
- .headers(headers_2),
- http("request_6")
- .options("/api/notifications")
- .headers(headers_1)))
- .exec(http("request_7")
- .get(uri1 + "/negotiate?clientProtocol=1.5&Authorization=Bearer%20${authToken}&connectionData=%5B%7B%22name%22%3A%22livechat%22%7D%5D")
- .headers(headers_7),
- http("request_8")
- .get("/api/notifications")
- .headers(headers_2),
- http("request_9")
- .get(uri1 + "/start?transport=serverSentEvents&clientProtocol=1.5&Authorization=Bearer%20${authToken}&connectionToken=${MyConnectionToken}&connectionData=%5B%7B%22name%22%3A%22livechat%22%7D%5D")
- .headers(headers_7))
- setUp(scn.inject(atOnceUsers(1))).protocols(httpProtocol)
- }
Advertisement
Add Comment
Please, Sign In to add comment