TestRunner orchestrates test execution:
- Executor: sends HTTP requests
- Extractor: extracts data from responses
- Validator: checks assertions
- Returns TestResult with pass/fail status
AsserrtModel needs for checking answer
class AssertModel:
type: str # What to check: "status" / "json" / "header"
path: str # Where to look: "$.user.id"
operator: str # How to check: "equals" / "exists" / "gt"
value: Any # What to check against: 200 / true
ExtractModel helps to extract data from the server response
class ExtractModel:
name: str # Name of data
json_path: str # Name of field in data
source: str # Source of data
RequestModel consists of http response data
class RequestModel:
method: str # http method
path: str # url path
headers: dict # type of info to send
body: dict # request body data
timeout: int # timeout
StepModel is model for 1 step in all test.
class StepModel:
name: str # Step name
request: RequestModel # What to send
extract: list[ExtractModel] # What to extract from the response
assert: list[AssertModel] # What to verify
TestModel is a test structure
class TestModel:
name: str # Test name
base_url: str # App URL
variables: dict # Variables for test steps
auth: AuthModel | None # How to authenticate
steps: list[StepModel] # Test steps