Extract Session.wait into a Runner

This is done for a couple reasons. The first is just to have things a little
more self-contained for eventually supporting more advanced "wait" logic, e.g.
waiting for a selector.

The other is to provide callers with more fine-grained controlled. Specifically
the ability to manually "tick", so that they can [presumably] do something
after every tick. This is needed by the test runner to support more advanced
cases (cases that need to test beyond 'load') and it also improves (and fixes
potential use-after-free, the lp.waitForSelector)
This commit is contained in:
Karl Seguin
2026-03-23 12:15:53 +08:00
parent a69a22ccd7
commit c9bc370d6a
15 changed files with 315 additions and 241 deletions

View File

@@ -136,7 +136,8 @@ const TestContext = struct {
0,
);
try page.navigate(full_url, .{});
_ = bc.session.wait(.{});
var runner = try bc.session.runner(.{});
try runner.wait(.{ .ms = 2000 });
}
return bc;
}