fix: preserve cross-device evidence and render recorded reports

This commit is contained in:
chenmingxuan committed 2026-10-17 16:05:58 +08:00
1 parent a66803651a
commit 1440a1f508
28 files changed
+759 -128

No files matched your search

@@ -149,6 +149,28 @@ async def test_explicit_refresh_executes_wait_once_but_defers_same_turn_click(cr
capture.assert_not_awaited() # The wait result already contains a fresh phone observation.
@pytest.mark.asyncio
async def test_pc_loading_wait_keeps_phone_stale_and_next_phone_click_is_deferred(
cross_target, monkeypatch
):
runner, state, capture = cross_target
sleep = AsyncMock()
monkeypatch.setattr(flash.asyncio, "sleep", sleep)
await _dispatch(runner, state, [_call(PC, "pc")])
result, messages, turn = await _dispatch(
runner, state, [_call("wait_for_delay", "wait", time_in_ms=5000)]
)
sleep.assert_awaited_once_with(5)
assert runner._android_observation_stale and result[1] is None
assert "未采集新画面" in messages[-1].content
assert turn.actions[0][0] == "wait_for_delay"
capture.assert_not_awaited()
assert runner.executor.execute.await_count == 1
await _dispatch(runner, state, [_call("click", "tap", target=1)])
capture.assert_awaited_once()
assert runner.executor.execute.await_count == 1
@pytest.mark.asyncio
async def test_failed_pc_call_also_invalidates_the_phone_without_a_capture(cross_target):
runner, state, capture = cross_target