change: convert StepResult Attachments to interface, for screenshots saving

This commit is contained in:
debugtalk
2022-08-31 23:16:46 +08:00
parent cf5761836a
commit 5fba76e6e3
8 changed files with 53 additions and 22 deletions

View File

@@ -31,13 +31,16 @@ func TestIOSWeixinLive(t *testing.T) {
hrp.NewStep("向上滑动,等待 10s").
IOS().
SwipeUp().Sleep(10).ScreenShot(). // 上划 1 次,等待 10s截图保存
SwipeUp().Times(10).ScreenShot(), // 再上划 1 次,等待 10s截图保存
SwipeUp().Sleep(10).ScreenShot(), // 再上划 1 次,等待 10s截图保存
},
}
fmt.Println(testCase)
err := hrp.NewRunner(t).Run(testCase)
if err != nil {
t.Fatal(err)
runner := hrp.NewRunner(t)
sessionRunner, _ := runner.NewSessionRunner(testCase)
if err := sessionRunner.Start(nil); err != nil {
t.Fatal()
}
summary := sessionRunner.GetSummary()
fmt.Println(summary)
}