Then the API response should not contain "text"

This step definition is used to verify that the API response body does not contain specific text. It helps ensure that certain error messages, unwanted values, or sensitive information are not present in the response.

 

Then (?:the )?API response should not contain "([^"]*)"$

Checks that the response from the last API request does not include the specified text.

Example #1: Then the API response should not contain "error"
Example #2: Then API response should not contain "failed"