()
| 45 | env = AsyncScriptBrowserEnv() |
| 46 | |
| 47 | async def _test() -> None: |
| 48 | await env.areset() |
| 49 | _, reward, _, _, info = await env.astep( |
| 50 | create_goto_url_action("https://www.saucedemo.com/inventory.html"), |
| 51 | ) |
| 52 | assert reward == 1 |
| 53 | assert "page" in info and isinstance(info["page"], DetachedPage) |
| 54 | assert info["page"].url == "https://www.saucedemo.com/" |
| 55 | json.dump(auth_json, open("/tmp/auth.json", "w")) |
| 56 | instance_config = {"storage_state": "/tmp/auth.json"} |
| 57 | json.dump(instance_config, open("/tmp/config.json", "w")) |
| 58 | await env.areset(options={"config_file": "/tmp/config.json"}) |
| 59 | _, reward, _, _, info = await env.astep( |
| 60 | create_goto_url_action("https://www.saucedemo.com/inventory.html"), |
| 61 | ) |
| 62 | assert reward == 1 |
| 63 | assert "page" in info and isinstance(info["page"], DetachedPage) |
| 64 | assert info["page"].url == "https://www.saucedemo.com/inventory.html" |
| 65 | await env.aclose() |
| 66 | |
| 67 | asyncio.run(_test()) |
no test coverage detected