mirror of
https://github.com/httprunner/httprunner.git
synced 2026-09-05 07:26:55 +08:00
fix: 修复浏览器驱动的一些问题
This commit is contained in:
@@ -11,6 +11,8 @@ func NewBrowserDeviceOptions(opts ...BrowserDeviceOption) *BrowserDeviceOptions
|
||||
type BrowserDeviceOptions struct {
|
||||
BrowserID string `json:"browser_id,omitempty" yaml:"browser_id,omitempty"`
|
||||
LogOn bool `json:"log_on,omitempty" yaml:"log_on,omitempty"`
|
||||
Width int `json:"width,omitempty" yaml:"width,omitempty"`
|
||||
Height int `json:"height,omitempty" yaml:"height,omitempty"`
|
||||
}
|
||||
|
||||
type BrowserDeviceOption func(*BrowserDeviceOptions)
|
||||
@@ -20,3 +22,16 @@ func WithBrowserID(serial string) BrowserDeviceOption {
|
||||
device.BrowserID = serial
|
||||
}
|
||||
}
|
||||
|
||||
func WithBrowserLogOn(logOn bool) BrowserDeviceOption {
|
||||
return func(device *BrowserDeviceOptions) {
|
||||
device.LogOn = logOn
|
||||
}
|
||||
}
|
||||
|
||||
func WithBrowserPageSize(width, height int) BrowserDeviceOption {
|
||||
return func(device *BrowserDeviceOptions) {
|
||||
device.Width = width
|
||||
device.Height = height
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user