mirror of
https://github.com/httprunner/httprunner.git
synced 2026-09-06 07:57:27 +08:00
feat: 支持卸载忽略不存在
This commit is contained in:
@@ -569,7 +569,7 @@ func (dExt *DriverExt) DoAction(action MobileAction) (err error) {
|
|||||||
}
|
}
|
||||||
case ACTION_AppUninstall:
|
case ACTION_AppUninstall:
|
||||||
if packageName, ok := action.Params.(string); ok {
|
if packageName, ok := action.Params.(string); ok {
|
||||||
if err = dExt.Uninstall(packageName); err != nil {
|
if err = dExt.Uninstall(packageName, action.GetOptions()...); err != nil {
|
||||||
return errors.Wrap(err, "failed to uninstall app")
|
return errors.Wrap(err, "failed to uninstall app")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+10
-2
@@ -222,8 +222,16 @@ func (dExt *DriverExt) InstallByUrl(url string, opts *InstallOptions) error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (dExt *DriverExt) Uninstall(packageName string) error {
|
func (dExt *DriverExt) Uninstall(packageName string, options ...ActionOption) error {
|
||||||
return dExt.Device.Uninstall(packageName)
|
actionOptions := NewActionOptions(options...)
|
||||||
|
err := dExt.Device.Uninstall(packageName)
|
||||||
|
if err != nil {
|
||||||
|
log.Warn().Err(err).Msg("failed to uninstall")
|
||||||
|
}
|
||||||
|
if actionOptions.IgnoreNotFoundError {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
func (dExt *DriverExt) Install(filePath string, opts *InstallOptions) error {
|
func (dExt *DriverExt) Install(filePath string, opts *InstallOptions) error {
|
||||||
|
|||||||
Reference in New Issue
Block a user