steps.api.then ============== .. py:module:: steps.api.then Functions --------- .. autoapisummary:: steps.api.then.status_code_validation steps.api.then.check_response_from_table steps.api.then.check_empty_response steps.api.then.check_not_empty_response steps.api.then.response_match_defined_schema Module Contents --------------- .. py:function:: status_code_validation(context, expected_http_status_code) Validate that the response has the expected HTTP status code. :param context: The Behave context :param expected_http_status_code: Expected HTTP status code as string :raises MissingEndpoint: If 404 wasn't expected but was received with the standard message .. py:function:: check_response_from_table(context) Check that the response contains the expected key-value pairs from a table. Expects a Gherkin table with 'key' and 'value' columns, and validates each key-value pair against the response JSON. :param context: The Behave context containing a table of keys and values .. py:function:: check_empty_response(context) Check that the response body is empty (empty JSON object or array). :param context: The Behave context .. py:function:: check_not_empty_response(context) Check that the response body is not empty (has content). :param context: The Behave context .. py:function:: response_match_defined_schema(context) Validate that the response JSON matches the defined schema. Performs schema validation against the defined schema for the current endpoint, checking for various schema-related issues including default schemas, forbidden keywords, and data validation errors. :param context: The Behave context