Skip to content
Merged
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
6 changes: 6 additions & 0 deletions internal/js/modules/k6/browser/tests/page_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -685,6 +685,12 @@ func TestPageScreenshotFullpage(t *testing.T) {
}`)
require.NoError(t, err)

// Wait for the browser to commit a frame so the gradient div is painted
// before the screenshot is captured. Without this, on slow CI runners the
// screenshot can race the first paint and capture the still-white background.
_, err = p.Evaluate(`() => new Promise(r => requestAnimationFrame(() => requestAnimationFrame(r)))`)
require.NoError(t, err)

opts := common.NewPageScreenshotOptions()
opts.FullPage = true
buf, err := p.Screenshot(opts, &mockPersister{})
Expand Down
Loading