change: remove unused methods

This commit is contained in:
lilong.129
2025-02-11 14:44:40 +08:00
parent 6651b52517
commit b35116fdf7
14 changed files with 52 additions and 467 deletions

View File

@@ -674,7 +674,7 @@ func (wd *WDADriver) Input(text string, opts ...option.ActionOption) (err error)
return wd.SendKeys(text, opts...)
}
func (wd *WDADriver) Clear(packageName string) error {
func (wd *WDADriver) AppClear(packageName string) error {
return types.ErrDriverNotImplemented
}
@@ -722,23 +722,6 @@ func (wd *WDADriver) PressButton(devBtn types.DeviceButton) (err error) {
return
}
func (wd *WDADriver) StartCamera() (err error) {
// start camera, alias for app_launch com.apple.camera
return wd.AppLaunch("com.apple.camera")
}
func (wd *WDADriver) StopCamera() (err error) {
// stop camera, alias for app_terminate com.apple.camera
success, err := wd.AppTerminate("com.apple.camera")
if err != nil {
return errors.Wrap(err, "failed to terminate camera")
}
if !success {
log.Warn().Msg("camera was not running")
}
return nil
}
func (wd *WDADriver) Orientation() (orientation types.Orientation, err error) {
// [[FBRoute GET:@"/orientation"] respondWithTarget:self action:@selector(handleGetOrientation:)]
var rawResp DriverRawResponse
@@ -859,6 +842,17 @@ func (wd *WDADriver) HealthCheck() (err error) {
return
}
func (wd *WDADriver) IsHealthy() (healthy bool, err error) {
var rawResp DriverRawResponse
if rawResp, err = wd.httpGET("/health"); err != nil {
return false, err
}
if string(rawResp) != "I-AM-ALIVE" {
return false, nil
}
return true, nil
}
func (wd *WDADriver) GetAppiumSettings() (settings map[string]interface{}, err error) {
// [[FBRoute GET:@"/appium/settings"] respondWithTarget:self action:@selector(handleGetSettings:)]
var rawResp DriverRawResponse
@@ -888,17 +882,6 @@ func (wd *WDADriver) SetAppiumSettings(settings map[string]interface{}) (ret map
return
}
func (wd *WDADriver) IsHealthy() (healthy bool, err error) {
var rawResp DriverRawResponse
if rawResp, err = wd.httpGET("/health"); err != nil {
return false, err
}
if string(rawResp) != "I-AM-ALIVE" {
return false, nil
}
return true, nil
}
func (wd *WDADriver) WdaShutdown() (err error) {
_, err = wd.httpGET("/wda/shutdown")
return