diff --git a/hrp/internal/uixt/ios_device.go b/hrp/internal/uixt/ios_device.go index 3c4a189e..b5f37268 100644 --- a/hrp/internal/uixt/ios_device.go +++ b/hrp/internal/uixt/ios_device.go @@ -11,7 +11,9 @@ import ( "net" "net/http" "net/url" + "os" "regexp" + "strconv" "strings" giDevice "github.com/electricbubble/gidevice" @@ -46,6 +48,27 @@ func InitWDAClient(device *IOSDevice) (*DriverExt, error) { if device.UDID != "" { deviceOptions = append(deviceOptions, WithUDID(device.UDID)) } + + wda_port := os.Getenv("WDA_PORT") + if wda_port != "" { + if port, err := strconv.Atoi(wda_port); err == nil { + log.Info().Str("WDA_PORT", wda_port). + Msg("override with environment variable") + device.Port = port + } else { + log.Error().Err(err).Msg("invalid WDA_PORT, ignored") + } + } + wda_mjpeg_port := os.Getenv("WDA_MJPEG_PORT") + if wda_mjpeg_port != "" { + if mjpeg_port, err := strconv.Atoi(wda_mjpeg_port); err == nil { + log.Info().Str("WDA_MJPEG_PORT", wda_mjpeg_port). + Msg("override with environment variable") + device.MjpegPort = mjpeg_port + } else { + log.Error().Err(err).Msg("invalid WDA_MJPEG_PORT, ignored") + } + } if device.Port != 0 { deviceOptions = append(deviceOptions, WithPort(device.Port)) } diff --git a/hrp/internal/version/VERSION b/hrp/internal/version/VERSION index 42e4bb31..710e0281 100644 --- a/hrp/internal/version/VERSION +++ b/hrp/internal/version/VERSION @@ -1 +1 @@ -v4.3.0-beta-09291727 \ No newline at end of file +v4.3.0-beta-09292020 \ No newline at end of file diff --git a/httprunner/__init__.py b/httprunner/__init__.py index 80a9948b..415278d7 100644 --- a/httprunner/__init__.py +++ b/httprunner/__init__.py @@ -1,4 +1,4 @@ -__version__ = "v4.3.0-beta-09291727" +__version__ = "v4.3.0-beta-09292020" __description__ = "One-stop solution for HTTP(S) testing." diff --git a/pyproject.toml b/pyproject.toml index b8213141..adbe2bde 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "httprunner" -version = "v4.3.0-beta-09291727" +version = "v4.3.0-beta-09292020" description = "One-stop solution for HTTP(S) testing." license = "Apache-2.0" readme = "README.md"