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

Commit e3cda41

Browse files
authored
Fix reload & setContent to use navigation timeout (#1034)
These methods should work with the default navigation instead of the default timeout to match the behaviour in Playwright.
1 parent 9cd064e commit e3cda41

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

common/frame.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1428,7 +1428,9 @@ func (f *Frame) selectOption(selector string, values goja.Value, opts *FrameSele
14281428
func (f *Frame) SetContent(html string, opts goja.Value) {
14291429
f.log.Debugf("Frame:SetContent", "fid:%s furl:%q", f.ID(), f.URL())
14301430

1431-
parsedOpts := NewFrameSetContentOptions(f.defaultTimeout())
1431+
parsedOpts := NewFrameSetContentOptions(
1432+
f.manager.timeoutSettings.navigationTimeout(),
1433+
)
14321434
if err := parsedOpts.Parse(f.ctx, opts); err != nil {
14331435
k6ext.Panic(f.ctx, "parsing set content options: %w", err)
14341436
}

common/page.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -860,7 +860,10 @@ func (p *Page) QueryAll(selector string) ([]api.ElementHandle, error) {
860860
func (p *Page) Reload(opts goja.Value) api.Response {
861861
p.logger.Debugf("Page:Reload", "sid:%v", p.sessionID())
862862

863-
parsedOpts := NewPageReloadOptions(LifecycleEventLoad, p.defaultTimeout())
863+
parsedOpts := NewPageReloadOptions(
864+
LifecycleEventLoad,
865+
p.timeoutSettings.navigationTimeout(),
866+
)
864867
if err := parsedOpts.Parse(p.ctx, opts); err != nil {
865868
k6ext.Panic(p.ctx, "parsing reload options: %w", err)
866869
}

0 commit comments

Comments
 (0)