Skip to content
This repository was archived by the owner on Jan 30, 2025. It is now read-only.

Commit a526dd9

Browse files
author
Ivan Mirić
committed
Fix defaulting to load in WaitForLoadState
1 parent 62fa217 commit a526dd9

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

common/frame.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1583,9 +1583,11 @@ func (f *Frame) WaitForLoadState(state string, opts goja.Value) {
15831583
k6Throw(f.ctx, "cannot parse waitForLoadState options: %v", err)
15841584
}
15851585

1586-
var waitUntil LifecycleEvent
1587-
if err = waitUntil.UnmarshalText([]byte(state)); err != nil {
1588-
k6Throw(f.ctx, "waitForLoadState error: %v", err)
1586+
waitUntil := LifecycleEventLoad
1587+
if state != "" {
1588+
if err = waitUntil.UnmarshalText([]byte(state)); err != nil {
1589+
k6Throw(f.ctx, "waitForLoadState error: %v", err)
1590+
}
15891591
}
15901592

15911593
if f.hasLifecycleEventFired(waitUntil) {

0 commit comments

Comments
 (0)