feat: add device status logging and extend DeviceStatus struct with new fields

This commit is contained in:
lilong.129
2025-06-26 20:05:23 +08:00
parent eb0d184d6d
commit b188d6b29b
4 changed files with 13 additions and 2 deletions

View File

@@ -1 +1 @@
v5.0.0-beta-2506261942
v5.0.0-beta-2506262009

View File

@@ -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
}

View File

@@ -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())

View File

@@ -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"`
}