fix: web ui test

This commit is contained in:
徐聪
2025-05-07 20:12:06 +08:00
parent 37fd2e900d
commit 6cce5e3c5b
14 changed files with 347 additions and 60 deletions
+13
View File
@@ -15,6 +15,19 @@ type BrowserDeviceOptions struct {
Height int `json:"height,omitempty" yaml:"height,omitempty"`
}
func (dev *BrowserDeviceOptions) Options() (deviceOptions []BrowserDeviceOption) {
if dev.BrowserID != "" {
deviceOptions = append(deviceOptions, WithBrowserID(dev.BrowserID))
}
if dev.LogOn {
deviceOptions = append(deviceOptions, WithBrowserLogOn(true))
}
if dev.Width > 0 && dev.Height > 0 {
deviceOptions = append(deviceOptions, WithBrowserPageSize(dev.Width, dev.Height))
}
return
}
type BrowserDeviceOption func(*BrowserDeviceOptions)
func WithBrowserID(serial string) BrowserDeviceOption {