mirror of
https://github.com/httprunner/httprunner.git
synced 2026-06-28 02:51:42 +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) {
|
||||
log.Info().Str("baseUrl", baseUrl).Msg("set driver session base URL")
|
||||
s.baseUrl = baseUrl
|
||||
}
|
||||
|
||||
|
||||
@@ -146,6 +146,13 @@ func (wd *WDADriver) Setup() error {
|
||||
return err
|
||||
}
|
||||
|
||||
wdaStatus, err := wd.Status()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
log.Info().Interface("status", wdaStatus).
|
||||
Msg("check WDA status")
|
||||
|
||||
// create new session
|
||||
if err := wd.InitSession(nil); err != nil {
|
||||
return errors.Wrap(code.DeviceHTTPDriverError, err.Error())
|
||||
|
||||
@@ -29,6 +29,8 @@ import "fmt"
|
||||
type DeviceStatus struct {
|
||||
Message string `json:"message"`
|
||||
State string `json:"state"`
|
||||
Ready bool `json:"ready"`
|
||||
Device string `json:"device"`
|
||||
OS struct {
|
||||
TestmanagerdVersion int `json:"testmanagerdVersion"`
|
||||
Name string `json:"name"`
|
||||
@@ -39,10 +41,11 @@ type DeviceStatus struct {
|
||||
IP string `json:"ip"`
|
||||
SimulatorVersion string `json:"simulatorVersion"`
|
||||
} `json:"ios"`
|
||||
Ready bool `json:"ready"`
|
||||
Build struct {
|
||||
Time string `json:"time"`
|
||||
ProductBundleIdentifier string `json:"productBundleIdentifier"`
|
||||
Version string `json:"version"` // OpenSource WDA version
|
||||
GtfWDAVersion string `json:"gtfWDAVersion"` // GTF WDA version
|
||||
} `json:"build"`
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user