Then the response status code should be {number}

This step definition is used after making a request to the web service under test. Once the response is received, this step definition asserts HTTP status code returned by the server matches the expected code.

 

Then the response status code should( not)* be (\d+)

 

Example:

Then the response status code should be 200

The status code 200 refers to a successful request. Meaning that the server has processed the request and returned the appropriate response.
 

Example:

Then the response status code should not be 404

 

The status code 404 refers to that the requested resource not found on the server. Meaning a possible error or invalid URL. So that it should not be 404.