API Reference - Models

This section documents the Pydantic models used throughout the framework.

Service Configuration

class socialseed_e2e.core.models.ServiceConfig(*, name: str, base_url: str, default_headers: Dict[str, str]=<factory>, timeout: int = 30000, extra: Dict[str, ~typing.Any]=<factory>)[source]

Bases: BaseModel

Configuration for a specific service.

name: str
base_url: str
default_headers: Dict[str, str]
timeout: int
extra: Dict[str, Any]
model_config = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

Test Context

class socialseed_e2e.core.models.TestContext(*, env: str = 'dev', services: Dict[str, ~socialseed_e2e.core.models.ServiceConfig]=<factory>, metadata: Dict[str, ~typing.Any]=<factory>)[source]

Bases: BaseModel

Generic context for test execution.

env: str
services: Dict[str, ServiceConfig]
metadata: Dict[str, Any]
get_service(name: str) ServiceConfig | None[source]
model_config = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

Retry Configuration

class socialseed_e2e.core.base_page.RetryConfig(max_retries: int = 3, backoff_factor: float = 1.0, max_backoff: float = 60.0, retry_on: List[int] | None = None, retry_exceptions: List[Type[Exception]] | None = None)[source]

Bases: object

Configuration for automatic retry mechanism.

max_retries

Maximum number of retry attempts (default: 3)

Type:

int

backoff_factor

Exponential backoff multiplier (default: 1.0)

Type:

float

max_backoff

Maximum backoff time in seconds (default: 60)

Type:

float

retry_on

List of HTTP status codes to retry on (default: [502, 503, 504, 429])

Type:

List[int] | None

retry_exceptions

List of exception types to retry on

Type:

List[Type[Exception]] | None

max_retries: int = 3
backoff_factor: float = 1.0
max_backoff: float = 60.0
retry_on: List[int] | None = None
retry_exceptions: List[Type[Exception]] | None = None
__post_init__()[source]

Initialize default retry configuration values.

__init__(max_retries: int = 3, backoff_factor: float = 1.0, max_backoff: float = 60.0, retry_on: List[int] | None = None, retry_exceptions: List[Type[Exception]] | None = None) None

Rate Limit Configuration

class socialseed_e2e.core.base_page.RateLimitConfig(enabled: bool = False, requests_per_second: float = 10.0, requests_per_minute: float = 600.0, burst_size: int = 5)[source]

Bases: object

Configuration for rate limiting.

enabled

Whether rate limiting is enabled (default: False)

Type:

bool

requests_per_second

Maximum requests per second (default: 10)

Type:

float

requests_per_minute

Maximum requests per minute (default: 600)

Type:

float

burst_size

Allow burst of requests (default: 5)

Type:

int

enabled: bool = False
requests_per_second: float = 10.0
requests_per_minute: float = 600.0
burst_size: int = 5
__init__(enabled: bool = False, requests_per_second: float = 10.0, requests_per_minute: float = 600.0, burst_size: int = 5) None

Request Log

class socialseed_e2e.core.base_page.RequestLog(method: str, url: str, headers: Dict[str, str], body: str | None, timestamp: float, duration_ms: float = 0.0, status: int | None = None, response_headers: Dict[str, str] | None = None, response_body: str | None = None, error: str | None = None)[source]

Bases: object

Log entry for a single request.

method

HTTP method

Type:

str

url

Full request URL

Type:

str

headers

Request headers (may be filtered)

Type:

Dict[str, str]

body

Request body (JSON string)

Type:

str | None

timestamp

When the request was made

Type:

float

duration_ms

Request duration in milliseconds

Type:

float

status

Response status code

Type:

int | None

response_headers

Response headers

Type:

Dict[str, str] | None

response_body

Response body (truncated if too large)

Type:

str | None

error

Error message if request failed

Type:

str | None

method: str
url: str
headers: Dict[str, str]
body: str | None
timestamp: float
duration_ms: float = 0.0
status: int | None = None
response_headers: Dict[str, str] | None = None
response_body: str | None = None
error: str | None = None
__init__(method: str, url: str, headers: Dict[str, str], body: str | None, timestamp: float, duration_ms: float = 0.0, status: int | None = None, response_headers: Dict[str, str] | None = None, response_body: str | None = None, error: str | None = None) None

Exceptions

class socialseed_e2e.core.base_page.BasePageError(message: str, url: str | None = None, method: str | None = None, status: int | None = None, response_text: str | None = None, request_log: RequestLog | None = None)[source]

Bases: Exception

Enhanced exception with request context.

__init__(message: str, url: str | None = None, method: str | None = None, status: int | None = None, response_text: str | None = None, request_log: RequestLog | None = None)[source]

Initialize exception with request context.

__str__() str[source]

Return formatted error message with context.

class socialseed_e2e.core.config_loader.ConfigError[source]

Bases: Exception

Custom exception for configuration errors.