fitnesse

FitNesse: Slim test with no assertions fails after getting 4xx/5xx response code


I'm using hsac-fitnesse-fixtures for FitNesse tests.

When I started working on negative API tests I noticed FitNesse test suite fails if JSON HTTP Test fixture receives 4xx/5xx response, while no assertions were made in the actual test:

![example 1](https://imgur.com/a/Kl7yqch)

Adding assertions where we're actually waiting for 4xx/5xx response code does not make the difference: the assertion passes, but the test still fails.

enter image description here

I'm trying to find out how to make such negative tests pass. Any thoughts?


Solution

  • It turns out that it's necessary to add |reject| keyword before |get from| or any other HTTP action in hsac-fitnesse-fixtures to perform a negative test.

    More details can be found in project's GitHub Issues and FitNesse Script Table Keywords.