One of the things I love about Gatling is that it is built on Scala. As such, I can build up my automation using a real programming language, and employ design patterns in my code.
One of the best things about Scala, it being a functional language, is that we can build functions that take in snippets of Gatling DSL, and either wrap them or decorate them or whatever.
Sadly, the way things are right now, I have to dig into the internals in order to write such functions, and down the line my code is likely to break because I’m depending on internals of Gatling.
My requested feature is that you define a type name that is an alias for the internal type, defined in .Predef, which we as script developers can use to declare things. Treat those types as part of the API, and allow us to write functions that take in or return those types. As you re-factor the internals, the API types remain, so our code doesn’t have to be changed.
Some of the things I’d like to see predefined include:
An HTTP request
A Chain
A Scenario
A PopulationBuilder
A Body
Really, anything that one might want to take in to a function and do stuff with.