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

Function test_basic

webarena/tests/test_browser_env/test_playwright_actions.py:24–44  ·  view source on GitHub ↗
(script_browser_env: ScriptBrowserEnv)

Source from the content-addressed store, hash-verified

22
23
24def test_basic(script_browser_env: ScriptBrowserEnv) -> None:
25 # click, fill, press, check, goto
26 env = script_browser_env
27 seq = """page.goto("https://demo.playwright.dev/todomvc/")
28 page.get_by_placeholder("What needs to be done?").click()
29 page.get_by_placeholder("What needs to be done?").fill("hello")
30 page.get_by_placeholder("What needs to be done?").press("Enter")
31 page.get_by_placeholder("What needs to be done?").fill("world")
32 page.get_by_placeholder("What needs to be done?").press("Enter")
33 page.get_by_placeholder("What needs to be done?").fill("yes")
34 page.get_by_placeholder("What needs to be done?").press("Enter")
35 page.get_by_placeholder("What needs to be done?").fill("no")
36 page.get_by_placeholder("What needs to be done?").press("Enter")
37 page.get_by_role("listitem").filter(has_text="world").get_by_role("checkbox", name="Toggle Todo").check()
38 page.get_by_role("button", name="Clear completed").click()"""
39
40 env.reset()
41 for action in seq.split("\n"):
42 action = action.strip()
43 _, success, _, _, info = env.step(create_playwright_action(action))
44 assert success
45
46
47@pytest.mark.skip(reason="not important, but the site is flaky")

Callers

nothing calls this directly

Calls 3

create_playwright_actionFunction · 0.90
resetMethod · 0.45
stepMethod · 0.45

Tested by

no test coverage detected