mirror of
https://github.com/httprunner/httprunner.git
synced 2026-05-12 02:21:29 +08:00
feat: 支持卸载忽略不存在
This commit is contained in:
@@ -569,7 +569,7 @@ func (dExt *DriverExt) DoAction(action MobileAction) (err error) {
|
||||
}
|
||||
case ACTION_AppUninstall:
|
||||
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")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -222,8 +222,16 @@ func (dExt *DriverExt) InstallByUrl(url string, opts *InstallOptions) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (dExt *DriverExt) Uninstall(packageName string) error {
|
||||
return dExt.Device.Uninstall(packageName)
|
||||
func (dExt *DriverExt) Uninstall(packageName string, options ...ActionOption) error {
|
||||
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 {
|
||||
|
||||
Reference in New Issue
Block a user