feat: fetch add wait_until parameter for page loads options

Add `--wait_until` and `--wait_ms` CLI arguments to configure session wait behavior. Updates `Session.wait` to evaluate specific page load states (`load`, `domcontentloaded`, `networkidle`, `fixed`) before completing the wait loop.
This commit is contained in:
shaewe180
2026-03-18 15:02:00 +08:00
parent bd2406f803
commit 09327c3897
10 changed files with 85 additions and 37 deletions

View File

@@ -106,7 +106,7 @@ pub fn run(allocator: Allocator, file: []const u8, session: *lp.Session) !void {
defer try_catch.deinit();
try page.navigate(url, .{});
_ = session.wait(2000);
_ = session.wait(2000, .load);
ls.local.eval("testing.assertOk()", "testing.assertOk()") catch |err| {
const caught = try_catch.caughtOrError(allocator, err);