Skip to content

common_browser.actions

Shared action/event orchestration and explicit page convenience signatures.

Classes

ActionsAspect

Action algebra inherited by the one browser base; SDK invocation is a seam.

EventSubscription

A context-owned bounded observation queue, opened by an async scope.

Carries the owning browser/context, match configuration and one SDK listener set. Queue overflow is a visible partial result. It never awaits consumer callbacks while browser operation locks are held.

__init__

def __init__(browser: BaseBrowser, context: ContextRef, expectation: EventWait, *, page: PageRef | None = None) -> None

aclose

async def aclose() -> None

next

async def next(*, options: OperationConfig | None = None) -> BrowserResult[EventData]

PageActions

Full page action signatures; every convenience normalizes through perform.

back

async def back(*, options: OperationConfig | None = None) -> BrowserResult[EventData | None]

check

async def check(target: Target | ElementRef, *, checked: bool = True, options: OperationConfig | None = None) -> BrowserResult[EventData | None]

click

async def click(target: Target | ElementRef, *, button: Literal['left', 'middle', 'right'] = 'left', options: OperationConfig | None = None) -> BrowserResult[EventData | None]

double_click

async def double_click(target: Target | ElementRef, *, button: Literal['left', 'middle', 'right'] = 'left', options: OperationConfig | None = None) -> BrowserResult[EventData | None]

drag

async def drag(target: Target | ElementRef, destination: Target | ElementRef, *, options: OperationConfig | None = None) -> BrowserResult[EventData | None]

fill

async def fill(target: Target | ElementRef, value: str, *, options: OperationConfig | None = None) -> BrowserResult[EventData | None]

forward

async def forward(*, options: OperationConfig | None = None) -> BrowserResult[EventData | None]

goto

async def goto(url: str, *, wait_until: Literal['commit', 'domcontentloaded', 'load', 'networkidle'] = 'domcontentloaded', options: OperationConfig | None = None) -> BrowserResult[EventData | None]

hover

async def hover(target: Target | ElementRef, *, options: OperationConfig | None = None) -> BrowserResult[EventData | None]

perform

async def perform(action: Action, *, expect: EventWait | None = None, options: OperationConfig | None = None) -> BrowserResult[EventData | None]

Arm an optional expectation, invoke once and retain observed evidence.

press

async def press(target: Target | ElementRef, key: str, *, options: OperationConfig | None = None) -> BrowserResult[EventData | None]

reload

async def reload(*, options: OperationConfig | None = None) -> BrowserResult[EventData | None]

scroll

async def scroll(*, x: float = 0, y: float = 0, target: Target | ElementRef | None = None, options: OperationConfig | None = None) -> BrowserResult[EventData | None]

select

async def select(target: Target | ElementRef, values: str | tuple[str, ...] | None = None, *, labels: str | tuple[str, ...] | None = None, indices: int | tuple[int, ...] | None = None, options: OperationConfig | None = None) -> BrowserResult[EventData | None]

Select by exactly one option identity; an empty tuple clears selection.

type

async def type(target: Target | ElementRef, value: str, *, delay_ms: float = 0, options: OperationConfig | None = None) -> BrowserResult[EventData | None]

upload

async def upload(target: Target | ElementRef, files: tuple[Path | str | UploadFile, ...], *, options: OperationConfig | None = None) -> BrowserResult[EventData | None]

wait

async def wait(target: Target | ElementRef, *, state: Literal['visible', 'hidden', 'attached', 'detached'] = 'visible', options: OperationConfig | None = None) -> BrowserResult[EventData | None]

Observe the requested element state within the shared operation deadline.

wait_for_load

async def wait_for_load(state: Literal['load', 'domcontentloaded', 'networkidle'] = 'load', *, options: OperationConfig | None = None) -> BrowserResult[EventData | None]

Wait for one SDK load state; application readiness remains caller policy.