Perform OR logic in API tests assertions

Perform OR logic in API tests assertions

You can perform OR logic on your API test assertions to define several different expected values for the same assertion type. For example, you may want your HTTP test status code assertion to succeed in case your server responds with a 200 or with a 302.

To do this, you can use the matches regex comparator and define a regex like (200|302). With such an assertion, your test result is successful if the status code returned by the server is 200 or 302.

Further Reading