Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix reload & setContent to use navigation timeout #1034

Merged
merged 2 commits into from
Sep 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion common/frame.go
Original file line number Diff line number Diff line change
Expand Up @@ -1428,7 +1428,9 @@ func (f *Frame) selectOption(selector string, values goja.Value, opts *FrameSele
func (f *Frame) SetContent(html string, opts goja.Value) {
f.log.Debugf("Frame:SetContent", "fid:%s furl:%q", f.ID(), f.URL())

parsedOpts := NewFrameSetContentOptions(f.defaultTimeout())
parsedOpts := NewFrameSetContentOptions(
f.manager.timeoutSettings.navigationTimeout(),
)
if err := parsedOpts.Parse(f.ctx, opts); err != nil {
k6ext.Panic(f.ctx, "parsing set content options: %w", err)
}
Expand Down
5 changes: 4 additions & 1 deletion common/page.go
Original file line number Diff line number Diff line change
Expand Up @@ -860,7 +860,10 @@ func (p *Page) QueryAll(selector string) ([]api.ElementHandle, error) {
func (p *Page) Reload(opts goja.Value) api.Response {
p.logger.Debugf("Page:Reload", "sid:%v", p.sessionID())

parsedOpts := NewPageReloadOptions(LifecycleEventLoad, p.defaultTimeout())
parsedOpts := NewPageReloadOptions(
LifecycleEventLoad,
p.timeoutSettings.navigationTimeout(),
)
if err := parsedOpts.Parse(p.ctx, opts); err != nil {
k6ext.Panic(p.ctx, "parsing reload options: %w", err)
}
Expand Down
Loading