Can I write assertions for the Artillery Load Test results?

I am using Artillery to load test my other APIs. I want to write a statement for artillery results using mocha. Is it possible?

+3


source to share


1 answer


You can do it with javascript.

In artillery script, use afterResponce: and write your confirmation code there.

"get": {"url": "host/path",
                                    "headers": {
                                        "Content-Type":"application/json"
                                    },
                                    "afterResponse": "function_name"
                                }   

      



write function_name in a separate js file and add a statement to that function.

Import this js file into your artillery script as shown below

"processor": "./my_function.js"

      

+1


source







All Articles