from typing import Any, Pattern from playwright.async_api import Locator class SkyvernLocator: """Locator for finding and interacting with elements on a page. Provides methods for performing actions (click, fill, type), querying element state, and chaining locators to find specific elements. Compatible with Playwright's locator API. """ def __init__(self, locator: Locator): self._locator = locator # Action methods async def click(self, **kwargs: Any) -> None: """Click the element.""" await self._locator.click(**kwargs) async def fill(self, value: str, **kwargs: Any) -> None: """Fill an input element with text.""" await self._locator.fill(value, **kwargs) async def type(self, text: str, **kwargs: Any) -> None: """Type text into the element character by character.""" await self._locator.type(text, **kwargs) async def select_option( self, value: str | list[str] | None = None, **kwargs: Any, ) -> list[str]: """Select an option in a