Skip to main content

Cumulative asserts

there should be no accumulated errors

Checks that no errors were raised prior to this been called and raises all accumulated error messages (if any) in one assertion error.

Example

  Then @Soft x should not be blank
And @Soft y should be "1"
And @Soft z should be true
And there should be no accumulated errors

Line 4 will pass if all the preceeding assertions pass. If however, the assertions on line 1 and 3 fail (and the one on line 2 passes), then it will raise an assertion error containing the two messages as follows:

2 errors:
(1) x should not be blank
(2) z should be true but got false
I reset accumulated errors

Resets (clears) any previously accumulated errors.

Example

  When I reset accumulated errors
Then @Soft x should not be blank
And @Soft y should be "1"
And @Soft z should be true
And there should be no accumulated errors

Line 1 will clear any previously accumulated errors from the currently executing context.

So only the messages of all failed assertions leading up to line 4 will be included.