mirror of
https://github.com/httprunner/httprunner.git
synced 2026-07-12 16:01:27 +08:00
fix: ResetHomeOnStartup
This commit is contained in:
@@ -25,9 +25,8 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
defaultWDAPort = 8100
|
defaultWDAPort = 8100
|
||||||
defaultMjpegPort = 9100
|
defaultMjpegPort = 9100
|
||||||
defaultResetHomeOnStartup = true
|
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
@@ -132,7 +131,6 @@ func NewIOSDevice(options ...IOSDeviceOption) (device *IOSDevice, err error) {
|
|||||||
device = &IOSDevice{
|
device = &IOSDevice{
|
||||||
Port: defaultWDAPort,
|
Port: defaultWDAPort,
|
||||||
MjpegPort: defaultMjpegPort,
|
MjpegPort: defaultMjpegPort,
|
||||||
ResetHomeOnStartup: defaultResetHomeOnStartup,
|
|
||||||
SnapshotMaxDepth: snapshotMaxDepth,
|
SnapshotMaxDepth: snapshotMaxDepth,
|
||||||
AcceptAlertButtonSelector: acceptAlertButtonSelector,
|
AcceptAlertButtonSelector: acceptAlertButtonSelector,
|
||||||
DismissAlertButtonSelector: dismissAlertButtonSelector,
|
DismissAlertButtonSelector: dismissAlertButtonSelector,
|
||||||
@@ -163,9 +161,11 @@ type IOSDevice struct {
|
|||||||
Port int `json:"port,omitempty" yaml:"port,omitempty"` // WDA remote port
|
Port int `json:"port,omitempty" yaml:"port,omitempty"` // WDA remote port
|
||||||
MjpegPort int `json:"mjpeg_port,omitempty" yaml:"mjpeg_port,omitempty"` // WDA remote MJPEG port
|
MjpegPort int `json:"mjpeg_port,omitempty" yaml:"mjpeg_port,omitempty"` // WDA remote MJPEG port
|
||||||
LogOn bool `json:"log_on,omitempty" yaml:"log_on,omitempty"`
|
LogOn bool `json:"log_on,omitempty" yaml:"log_on,omitempty"`
|
||||||
|
|
||||||
// switch to iOS springboard before init WDA session
|
// switch to iOS springboard before init WDA session
|
||||||
// avoid getting stuck when some super app is activate such as douyin or wexin
|
ResetHomeOnStartup bool `json:"reset_home_on_startup,omitempty" yaml:"reset_home_on_startup,omitempty"`
|
||||||
ResetHomeOnStartup bool `json:"reset_home_on_startup,omitempty" yaml:"reset_home_on_startup,omitempty"`
|
|
||||||
|
// config appium settings
|
||||||
SnapshotMaxDepth int `json:"snapshot_max_depth,omitempty" yaml:"snapshot_max_depth,omitempty"`
|
SnapshotMaxDepth int `json:"snapshot_max_depth,omitempty" yaml:"snapshot_max_depth,omitempty"`
|
||||||
AcceptAlertButtonSelector string `json:"accept_alert_button_selector,omitempty" yaml:"accept_alert_button_selector,omitempty"`
|
AcceptAlertButtonSelector string `json:"accept_alert_button_selector,omitempty" yaml:"accept_alert_button_selector,omitempty"`
|
||||||
DismissAlertButtonSelector string `json:"dismiss_alert_button_selector,omitempty" yaml:"dismiss_alert_button_selector,omitempty"`
|
DismissAlertButtonSelector string `json:"dismiss_alert_button_selector,omitempty" yaml:"dismiss_alert_button_selector,omitempty"`
|
||||||
|
|||||||
@@ -397,6 +397,9 @@ func (r *testCaseRunner) parseConfig() error {
|
|||||||
}
|
}
|
||||||
iosDeviceConfig.UDID = udid.(string)
|
iosDeviceConfig.UDID = udid.(string)
|
||||||
}
|
}
|
||||||
|
// switch to iOS springboard before init WDA session
|
||||||
|
// avoid getting stuck when some super app is activate such as douyin or wexin
|
||||||
|
iosDeviceConfig.ResetHomeOnStartup = true
|
||||||
_, err := r.hrpRunner.initUIClient(iosDeviceConfig)
|
_, err := r.hrpRunner.initUIClient(iosDeviceConfig)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return errors.Wrap(err, "init iOS WDA client failed")
|
return errors.Wrap(err, "init iOS WDA client failed")
|
||||||
|
|||||||
Reference in New Issue
Block a user