MCPcopy Create free account
hub / github.com/THUDM/AutoWebGLM / _test

Function _test

webarena/tests/test_browser_env/test_auth_cookie.py:47–65  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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())

Callers 1

test_async_auth_cookieFunction · 0.85

Calls 4

create_goto_url_actionFunction · 0.85
aresetMethod · 0.80
astepMethod · 0.80
acloseMethod · 0.80

Tested by

no test coverage detected