mirror of
https://github.com/httprunner/httprunner.git
synced 2026-06-06 00:09:37 +08:00
feat: add ClearFiles(paths ...string)
This commit is contained in:
@@ -1 +1 @@
|
|||||||
v5.0.0-beta-2503261906
|
v5.0.0-beta-2503271937
|
||||||
|
|||||||
@@ -961,6 +961,14 @@ func (ad *ADBDriver) ClearImages() error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (ad *ADBDriver) ClearFiles(paths ...string) error {
|
||||||
|
log.Info().Strs("paths", paths).Msg("ADBDriver.ClearFiles")
|
||||||
|
for _, path := range paths {
|
||||||
|
_, _ = ad.Device.RunShellCommand("rm", "-rf", path)
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
// PullImages pulls all images from device's DCIM/Camera directory to local directory
|
// PullImages pulls all images from device's DCIM/Camera directory to local directory
|
||||||
func (ad *ADBDriver) PullImages(localDir string) error {
|
func (ad *ADBDriver) PullImages(localDir string) error {
|
||||||
log.Info().Str("localDir", localDir).Msg("ADBDriver.PullImages")
|
log.Info().Str("localDir", localDir).Msg("ADBDriver.PullImages")
|
||||||
|
|||||||
@@ -448,6 +448,10 @@ func (wd *BrowserDriver) ClearImages() error {
|
|||||||
return errors.New("not support")
|
return errors.New("not support")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (wd *BrowserDriver) ClearFiles(paths ...string) error {
|
||||||
|
return errors.New("not support")
|
||||||
|
}
|
||||||
|
|
||||||
func (wd *BrowserDriver) PushImage(localPath string) error {
|
func (wd *BrowserDriver) PushImage(localPath string) error {
|
||||||
return errors.New("not support")
|
return errors.New("not support")
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -71,6 +71,9 @@ type IDriver interface {
|
|||||||
PullImages(localDir string) error
|
PullImages(localDir string) error
|
||||||
ClearImages() error
|
ClearImages() error
|
||||||
|
|
||||||
|
// files related
|
||||||
|
ClearFiles(paths ...string) error
|
||||||
|
|
||||||
// triggers the log capture and returns the log entries
|
// triggers the log capture and returns the log entries
|
||||||
StartCaptureLog(identifier ...string) error
|
StartCaptureLog(identifier ...string) error
|
||||||
StopCaptureLog() (result interface{}, err error)
|
StopCaptureLog() (result interface{}, err error)
|
||||||
|
|||||||
@@ -297,3 +297,8 @@ func (hd *HDCDriver) ClearImages() error {
|
|||||||
log.Warn().Msg("ClearImages not implemented in HDCDriver")
|
log.Warn().Msg("ClearImages not implemented in HDCDriver")
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (hd *HDCDriver) ClearFiles(paths ...string) error {
|
||||||
|
log.Warn().Msg("ClearFiles not implemented in HDCDriver")
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|||||||
@@ -1002,6 +1002,11 @@ func (wd *WDADriver) ClearImages() error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (wd *WDADriver) ClearFiles(paths ...string) error {
|
||||||
|
log.Warn().Msg("ClearFiles not implemented in WDADriver")
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
type wdaResponse struct {
|
type wdaResponse struct {
|
||||||
Status int `json:"status"`
|
Status int `json:"status"`
|
||||||
SessionID string `json:"sessionId"`
|
SessionID string `json:"sessionId"`
|
||||||
|
|||||||
Reference in New Issue
Block a user