Skip to content

Automate browser based workflows with AI

Pass the required arguments in the adopted-session blob download tests (SKY-18972) (#9066)

Shuchang Zhenga228959efe86
diff --git a/tests/unit/test_adopted_session_blob_iframe_recovery_e2e.py b/tests/unit/test_adopted_session_blob_iframe_recovery_e2e.py
index e116d623e..9ed3d90f0 100644
--- a/tests/unit/test_adopted_session_blob_iframe_recovery_e2e.py
+++ b/tests/unit/test_adopted_session_blob_iframe_recovery_e2e.py
@@ -28,7 +28,8 @@ import pytest
import pytest_asyncio
from playwright.async_api import async_playwright
-from skyvern.webeye.actions.handler import _save_adopted_session_download
+from skyvern.forge.sdk.core.http_request_authorization import RunScopedRedirectHopAuthorizer
+from skyvern.webeye.actions.handler import _save_adopted_session_download as _save_adopted_session_download_impl
from skyvern.webeye.utils.page import (
SkyvernFrame,
install_blob_url_retention,
@@ -37,6 +38,22 @@ from skyvern.webeye.utils.page import (
)
+async def _save_adopted_session_download(
+ download: Any, page: Any, download_dir: Path, *, workflow_run_id: str
+) -> Path | None:
+ # Production passes the run-scoped authority rebound onto the adopted session's interceptor. Blob downloads
+ # return before the guarded URL re-fetch, the only reader of the authorizer, scope and headers.
+ return await _save_adopted_session_download_impl(
+ download,
+ page,
+ download_dir,
+ authorize_request_hop=RunScopedRedirectHopAuthorizer(workflow_run_id),
+ request_headers={},
+ download_scope=workflow_run_id,
+ workflow_run_id=workflow_run_id,
+ )
+
+
def _has_playwright_browser() -> bool:
try:
from playwright.sync_api import sync_playwright # noqa: PLC0415