feat: DisableAutoPopupHandler

This commit is contained in:
lilong.129
2024-11-14 14:41:13 +08:00
parent 2a84335910
commit 41de802c18
6 changed files with 16 additions and 17 deletions

View File

@@ -169,7 +169,6 @@ type AndroidDevice struct {
UIA2IP string `json:"uia2_ip,omitempty" yaml:"uia2_ip,omitempty"` // uiautomator2 server ip
UIA2Port int `json:"uia2_port,omitempty" yaml:"uia2_port,omitempty"` // uiautomator2 server port
LogOn bool `json:"log_on,omitempty" yaml:"log_on,omitempty"`
IgnorePopup bool `json:"ignore_popup,omitempty" yaml:"ignore_popup,omitempty"`
}
func (dev *AndroidDevice) Options() (deviceOptions []AndroidDeviceOption) {

View File

@@ -16,19 +16,15 @@ var (
)
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"`
d *ghdc.Device
ConnectKey string `json:"connect_key,omitempty" yaml:"connect_key,omitempty"`
LogOn bool `json:"log_on,omitempty" yaml:"log_on,omitempty"`
}
func (dev *HarmonyDevice) Options() (deviceOptions []HarmonyDeviceOption) {
if dev.ConnectKey != "" {
deviceOptions = append(deviceOptions, WithConnectKey(dev.ConnectKey))
}
if dev.IgnorePopup {
deviceOptions = append(deviceOptions, WithIgnorePopup(true))
}
if dev.LogOn {
deviceOptions = append(deviceOptions, WithLogOn(true))
}
@@ -43,12 +39,6 @@ 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

View File

@@ -240,7 +240,6 @@ type IOSDevice struct {
MjpegPort int `json:"mjpeg_port,omitempty" yaml:"mjpeg_port,omitempty"` // WDA remote MJPEG port
LogOn bool `json:"log_on,omitempty" yaml:"log_on,omitempty"`
XCTestBundleID string `json:"xctest_bundle_id,omitempty" yaml:"xctest_bundle_id,omitempty"`
IgnorePopup bool `json:"ignore_popup,omitempty" yaml:"ignore_popup,omitempty"`
// switch to iOS springboard before init WDA session
ResetHomeOnStartup bool `json:"reset_home_on_startup,omitempty" yaml:"reset_home_on_startup,omitempty"`