mirror of
https://github.com/httprunner/httprunner.git
synced 2026-09-05 23:51:25 +08:00
feat: add device status logging and extend DeviceStatus struct with new fields
This commit is contained in:
@@ -1 +1 @@
|
|||||||
v5.0.0-beta-2506261942
|
v5.0.0-beta-2506262009
|
||||||
|
|||||||
@@ -87,6 +87,7 @@ func (s *DriverSession) GetData(withReset bool) SessionData {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (s *DriverSession) SetBaseURL(baseUrl string) {
|
func (s *DriverSession) SetBaseURL(baseUrl string) {
|
||||||
|
log.Info().Str("baseUrl", baseUrl).Msg("set driver session base URL")
|
||||||
s.baseUrl = baseUrl
|
s.baseUrl = baseUrl
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -146,6 +146,13 @@ func (wd *WDADriver) Setup() error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
wdaStatus, err := wd.Status()
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
log.Info().Interface("status", wdaStatus).
|
||||||
|
Msg("check WDA status")
|
||||||
|
|
||||||
// create new session
|
// create new session
|
||||||
if err := wd.InitSession(nil); err != nil {
|
if err := wd.InitSession(nil); err != nil {
|
||||||
return errors.Wrap(code.DeviceHTTPDriverError, err.Error())
|
return errors.Wrap(code.DeviceHTTPDriverError, err.Error())
|
||||||
|
|||||||
@@ -29,6 +29,8 @@ import "fmt"
|
|||||||
type DeviceStatus struct {
|
type DeviceStatus struct {
|
||||||
Message string `json:"message"`
|
Message string `json:"message"`
|
||||||
State string `json:"state"`
|
State string `json:"state"`
|
||||||
|
Ready bool `json:"ready"`
|
||||||
|
Device string `json:"device"`
|
||||||
OS struct {
|
OS struct {
|
||||||
TestmanagerdVersion int `json:"testmanagerdVersion"`
|
TestmanagerdVersion int `json:"testmanagerdVersion"`
|
||||||
Name string `json:"name"`
|
Name string `json:"name"`
|
||||||
@@ -39,10 +41,11 @@ type DeviceStatus struct {
|
|||||||
IP string `json:"ip"`
|
IP string `json:"ip"`
|
||||||
SimulatorVersion string `json:"simulatorVersion"`
|
SimulatorVersion string `json:"simulatorVersion"`
|
||||||
} `json:"ios"`
|
} `json:"ios"`
|
||||||
Ready bool `json:"ready"`
|
|
||||||
Build struct {
|
Build struct {
|
||||||
Time string `json:"time"`
|
Time string `json:"time"`
|
||||||
ProductBundleIdentifier string `json:"productBundleIdentifier"`
|
ProductBundleIdentifier string `json:"productBundleIdentifier"`
|
||||||
|
Version string `json:"version"` // OpenSource WDA version
|
||||||
|
GtfWDAVersion string `json:"gtfWDAVersion"` // GTF WDA version
|
||||||
} `json:"build"`
|
} `json:"build"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user