package computerdatabase
import io.gatling.core.Predef._
import io.gatling.http.Predef._
import scala.concurrent.duration._
class Applications extends Simulation {
val httpConf = http
.baseURL("<ip>") // Here is the root for all relative URLs
.acceptHeader("text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8") // Here are the common headers
.doNotTrackHeader("1")
.acceptLanguageHeader("en-US,en;q=0.5")
.acceptEncodingHeader("gzip, deflate")
.userAgentHeader("Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2272.89 Safari/537.36")
val headers_10 = Map("Content-Type" -> """application/x-www-form-urlencoded""") // Note the headers specific to a given request
val scn = scenario("Adams") // A scenario is a chain of requests and pauses
.exec(http("connexion")
.post("/auth/login")
.headers(headers_10)
.formParam("""email""", """login""") // Note the triple double quotes: used in Scala for protecting a whole chain of characters (no need for backslash)
.formParam("""password""", """azerty123""")
.formParam("""callBack""", """<ip>"""))
.pause(5) // Note that Gatling has recorded real time pauses
.exec(http("Wiki")
.get("/wiki"))
.pause(5)
.exec(http("Mes Applis")
.get("/welcome"))
.pause(5)
.exec(http("actualiteslités")
.get("/actualites"))
.pause(5)
.exec(http("Mes Applis")
.get("/welcome"))
.pause(5)
.exec(http("Export")
.get("/archive"))
.pause(5)
.exec(http("Mes Applis")
.get("/welcome"))
.pause(5)
.exec(http("Espace documentaire")
.get("/workspace/workspace"))
.pause(5)
.exec(http("Mes Applis")
.get("/welcome"))
.pause(5)
.exec(http("Forum")
.get("/forum"))
.pause(5)
.exec(http("Mes Applis")
.get("/welcome"))
.pause(5)
.exec(http("Gestion de ressources")
.get("/rbs"))
.pause(5)
setUp(scn.inject(rampUsersPerSec(1) to 5000 during(60 minutes)).protocols(httpConf))
}