This document will help you learn about available options to automate your tests:
The Assertions are used to verify that global statistics like response time or a number of failed requests match expectations for the whole simulation. After the test finished NBomberRunner returns Statistic data that you can use to apply assertions.
Test runner integration
NBomber doesn't have any dependency on a test runner or assertions API therefore feel free to use your favorite test libs to integrate with NBomber tests.
Here you can find a list of popular test libs to integrate with NBomber tests:
- Test runners & assertions: xUnit, NUnit
- Advanced test assertions: Fluent Assertions, Unquote (F# only)
For F# example we will use XUnit and Unquote therefore we need to install dependencies.
In terms of integration, NBomber test should be treated like any other piece of code that you can run using a test framework like xUnit or NUnit. Here is an example that you can run/debug from your IDE:
An important benefit that load testing brings is the certainty that your system does not degrade with the addition of new features or refactoring of old ones. In the worst case, you would like to be notified as quickly as possible that after certain changes your system began to degrade. These days it is much more widely accepted that load testing should start on the system as early as is feasibly possible, even when it is still in the early stages of development. It's why load testing should be build into the CI/CD pipeline.
In order to get integration you need:
- Integrate NBomber test with your current or favorite test runner (in terms of execution, your NBomber test will behave like a simple unit test).
- Find an appropriate plugin for your test automation server to run your test (for example, if you use Jenkins for test automation server then you can use xUnit or NUnit integration plugins).