mirror of
https://github.com/httprunner/httprunner.git
synced 2026-07-12 16:01:27 +08:00
feat: 加入打点支持
This commit is contained in:
@@ -19,6 +19,7 @@ type HarmonyDevice struct {
|
||||
d *ghdc.Device
|
||||
ConnectKey string `json:"connect_key,omitempty" yaml:"connect_key,omitempty"`
|
||||
IgnorePopup bool `json:"ignore_popup,omitempty" yaml:"ignore_popup,omitempty"`
|
||||
LogOn bool `json:"log_on,omitempty" yaml:"log_on,omitempty"`
|
||||
}
|
||||
|
||||
type HarmonyDeviceOption func(*HarmonyDevice)
|
||||
@@ -29,6 +30,18 @@ func WithConnectKey(connectKey string) HarmonyDeviceOption {
|
||||
}
|
||||
}
|
||||
|
||||
func WithIgnorePopup(ignorePopup bool) HarmonyDeviceOption {
|
||||
return func(device *HarmonyDevice) {
|
||||
device.IgnorePopup = ignorePopup
|
||||
}
|
||||
}
|
||||
|
||||
func WithLogOn(logOn bool) HarmonyDeviceOption {
|
||||
return func(device *HarmonyDevice) {
|
||||
device.LogOn = logOn
|
||||
}
|
||||
}
|
||||
|
||||
func NewHarmonyDevice(options ...HarmonyDeviceOption) (device *HarmonyDevice, err error) {
|
||||
device = &HarmonyDevice{}
|
||||
for _, option := range options {
|
||||
@@ -101,7 +114,7 @@ func (dev *HarmonyDevice) UUID() string {
|
||||
}
|
||||
|
||||
func (dev *HarmonyDevice) LogEnabled() bool {
|
||||
return false
|
||||
return dev.LogOn
|
||||
}
|
||||
|
||||
func (dev *HarmonyDevice) NewDriver(options ...DriverOption) (driverExt *DriverExt, err error) {
|
||||
|
||||
Reference in New Issue
Block a user