- How to add assertions and expectations to HTTP scenarios with
artillery-plugin-expect plugin can be used to add expectations/assertions to your HTTP scenarios to allow for the same scenarios to be re-used forrunning both load tests and functional/acceptance tests.
npm install -g artillery-plugin-expect
Check that the response status code equals the code given.
Check the value of
When the response is JSON, check that the response object has a property (or does not in case of
notHasProperty). Same behavior as
Check that two or more values are the same. NOTE only primitive values (e.g. booleans, strings and numbers) are currently supported.
Check that the response contains a header.
Check that the response contains a header and its value matches some string.
Check that response body matches a regular expression. The regular expression provided must be a string which is a valid argument to the RegExp constructor.
The source code for
artillery-plugin-expect is available on Github at https://github.com/shoreditch-ops/artillery-plugin-expect. It’s an officially supported plugin and we’d love to hear your feedback and ideas for improvement.