Now let's apply different delays based on location. Run the following to create and export a simulation.
delays-capture.sh
Edit the simulation.json
file so that the "globalActions"
property looks like this:
../../../../simulations/multiple-locations-delay-simulation.json
Now run the following to import the edited simulation.json
file and run the simulation:
delays-simulate.sh
You should notice a 2 second delay on responses from echo.jsontest.com/a/b
and echo.jsontest.com/b/c
, and a 3 second delay on the response from echo.jsontest.com/c/d
.
Note
When you use webserver
, you should replace or remove any original host pattern in the urlPattern
filter, because the endpoint URL is based on Hoverfly webserver address (eg. http://localhost:8888
).