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

Commit

Permalink
Add timeout to WaitForNavigation
Browse files Browse the repository at this point in the history
  • Loading branch information
ankur22 committed Aug 11, 2022
1 parent b27f684 commit 1e9fda0
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion tests/frame_manager_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,13 @@ func TestWaitForFrameNavigation(t *testing.T) {
Timeout: common.DefaultTimeout,
})))

var timeout time.Duration = 5000 // interpreted as ms

var wfnPromise, cPromise *goja.Promise
err := tb.await(func() error {
wfnPromise = p.WaitForNavigation(nil)
wfnPromise = p.WaitForNavigation(tb.toGojaValue(&common.FrameWaitForNavigationOptions{
Timeout: timeout, // interpreted as ms
}))
cPromise = p.Click(`a`, nil)

assert.Equal(t, goja.PromiseStatePending, wfnPromise.State())
Expand Down

0 comments on commit 1e9fda0

Please sign in to comment.