Skip to main content

Assertion Modes

Since v2.30.0

Hard, Soft, and Sustained Assertions

Hard, soft, and sustained assertions are supported through the following setting:

  • gwen.assertion.mode
    • This setting controls whether or not hard, soft or sustained assertions are enabled. Valid values include:
      • hard to halt execution on first assertion error and report failure (default)
      • soft to collect all assertion errors and continue execution whilst reporting them as failures
      • sustained to collect all assertion errors and continue execution without reporting them as failures

Assertion modes only apply to steps that perform actual assertions. Step that do not perform assertions will continue to report failure and terminate execution as usual regardless of the settings above.

Hard assertions (default)

gwen.assertion.mode=hard

With hard assertions, the first assertion error to be detected will be reported as a failure and execution will halt.

Hard assertions report

Soft assertions

gwen.assertion.mode=soft

With soft assertions, every assertion error that is detected is collected and reported as a failure without halting execution.

Soft assertions report

Sustained assertions

gwen.assertion.mode=sustained

With sustained assertions, every assertion error that is detected is collected and reported as a sustained error without halting execution or raising failure.

Sustained assertions report