Skip to content

Appian Runtime

The runtime API provides Appian-level browser/session services without exposing lower-level robo-automation classes to application projects.

Most normal tests do not need to create these objects directly. They are primarily useful for framework integration, custom fixtures, authentication setup, and advanced diagnostics.

AppianRuntime

AppianRuntime creates Appian contexts/pages, records runtime measurements, and closes resources through the Appian boundary.

AppianRuntime

Appian runtime service for browser/session mechanics.

CORE and other Appian consumers can use this class without knowing about BrowserSession, RoboBrowserContext, or PerformanceMonitor.

measure

measure(
    action: str,
    *,
    metadata: Optional[Mapping[str, Any]] = None
)

Measure an Appian consumer operation when monitoring is enabled.

record_duration

record_duration(
    action: str,
    duration_ms: float,
    *,
    ok: bool = True,
    error_type: str | None = None,
    metadata: Optional[Mapping[str, Any]] = None
) -> None

Record a framework duration without exposing the monitor class.

attach_page

attach_page(page: AppianPage) -> None

Attach performance monitoring to an Appian page when enabled.

create_context

create_context(
    *,
    context_options: Optional[dict[str, Any]] = None,
    wait_time_seconds: int | None = None
) -> AppianContext

Create a configured Appian browser context.

create_page

create_page(context: AppianContext) -> AppianPage

Create an Appian page inside context.

close

close(resource: Any, label: str) -> None

Close a runtime resource without masking an earlier failure.

AppianContext

AppianContext wraps a browser context for Appian consumers.

AppianContext

Appian-facing browser-context wrapper.

The lower-layer robo-automation context remains private to robo-appian.

storage_state

storage_state() -> dict[str, Any]

Return the current browser storage state.

close

close() -> None

Close this context.

AutomationContext

AutomationContext exposes stable test correlation values such as testcase, process, attempt, and worker IDs without requiring a consumer to import robo-automation.

AutomationContext dataclass

Correlation metadata for the currently executing automation test.

to_dict

to_dict() -> dict[str, str]

Return the context in log/evidence friendly form.

Runtime helpers

current_automation_context

current_automation_context(
    *, worker_id: str = ""
) -> AutomationContext

Return current testcase correlation without exposing robo-automation.

automation_context_for

automation_context_for(
    value: Any, *, nodeid: str = ""
) -> AutomationContext

Return correlation metadata stored on a pytest item/report-like object.

automation_test_case_id

automation_test_case_id(nodeid: str) -> str

Build the stable automation testcase ID for nodeid.

automation_test_log_path

automation_test_log_path(value: Any) -> str

Return the testcase log path attached by the lower pytest runtime.

measure_appian_runtime

measure_appian_runtime(
    config: Any,
    action: str,
    *,
    metadata: Mapping[str, Any] | None = None
)

Measure a pytest lifecycle operation through the lower runtime if available.

resolve_appian_page

resolve_appian_page(value: object) -> AppianPage | None

Return value as an AppianPage when it is a framework page wrapper.