visualwebarena icon indicating copy to clipboard operation
visualwebarena copied to clipboard

pytest -x failed

Open payphone131 opened this issue 9 months ago • 0 comments

def test_id_click(
    accessibility_tree_current_viewport_script_browser_env: ScriptBrowserEnv,
) -> None:
    env = accessibility_tree_current_viewport_script_browser_env
    env.reset()

    obs, success, _, _, info = env.step(
        create_playwright_action(
            'page.goto("https://russmaxdesign.github.io/exercise/")'
        )
    )
    assert success
    assert "link 'McKenna/Bell'" in obs["text"]
    # get the id of the link
    element_id = re.search(r"\[(\d+)\] link 'McKenna/Bell'", obs["text"]).group(1)  # type: ignore

    obs, success, _, _, info = env.step(
        create_id_based_action(f"click [{element_id}]")
    )
    assert success
    assert (
        info["page"].url
        == "https://russmaxdesign.github.io/exercise/#link-four"
    )

    obs, success, _, _, info = env.step(create_scroll_action("down"))
    assert "link 'Classification'" in obs["text"]
    element_id = re.search(r"\[(\d+)\] link 'Classification'", obs["text"]).group(1)  # type: ignore

    obs, success, _, _, info = env.step(
        create_id_based_action(f"click [{element_id}]")
    )
    assert success
    assert (
        info["page"].url
        == "https://russmaxdesign.github.io/exercise/#link-two"
    )
  assert "radio 'Weekly'" in obs["text"]

E assert "radio 'Weekly'" in "Tab 0 (current): Exercise page for keyboard and screen reader use\n\n[255] RootWebArea 'Exercise page for keyboard an...'' checked: false\n\t\t\t[497] radio '' checked: false\n\t\t\t[499] radio '' checked: false\n\t\t[439] button 'Submit'"

tests\test_browser_env\test_action_functionalities.py:166: AssertionError

payphone131 avatar Mar 21 '25 11:03 payphone131