Skip to content

fix(scaletest/dashboard): increase viewport size and handle deadlines #10197

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

Merged
merged 10 commits into from
Oct 11, 2023
Prev Previous commit
Next Next commit
force viewport size to avoid responsive mode
  • Loading branch information
johnstcn committed Oct 11, 2023
commit e284d8c49feb739bf9c4b7ddcb681d74c39e6dd0
7 changes: 7 additions & 0 deletions scaletest/dashboard/chromedp.go
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,13 @@ func initChromeDPCtx(ctx context.Context, log slog.Logger, u *url.URL, sessionTo
}
}

// force a viewport size of 1024x768 so we don't go into mobile mode
if err := chromedp.Run(cdpCtx, chromedp.EmulateViewport(1024, 768)); err != nil {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Glad you found this! I totally forgot about the default screen size of headless. 😮‍💨

cancelFunc()
allocCtxCancel()
return nil, nil, xerrors.Errorf("set viewport size: %w", err)
}

// set cookies
if err := setSessionTokenCookie(cdpCtx, sessionToken, u.Host); err != nil {
cancelFunc()
Expand Down