diff --git a/examples/uitest/demo_android_douyin_test.go b/examples/uitest/demo_android_douyin_test.go index 4bf95693..9e5f2477 100644 --- a/examples/uitest/demo_android_douyin_test.go +++ b/examples/uitest/demo_android_douyin_test.go @@ -11,9 +11,16 @@ func TestIOSDouYinLive(t *testing.T) { Config: hrp.NewConfig("通过 feed 头像进入抖音直播间"). SetAndroid(hrp.WithAdbLogOn(true), hrp.WithMjpegPortA(9100)), TestSteps: []hrp.IStep{ + hrp.NewStep("打开网页"). + Android(). + Home(). + AppTerminate("com.google.android.apps.chrome.Main").Sleep(1). // 关闭已运行的抖音,确保启动抖音后在「抖音」首页 + SwipeToTapApp("Chrome", hrp.WithMaxRetryTimes(5)).TapByOCR("Search").Input("https://gtftask.bytedance.com/local-time").TapByOCR("前往").Sleep(5). + Validate(). + AssertOCRExists("1664", "网页打开失败"), hrp.NewStep("启动抖音"). Android(). - Home().StartCamera().Sleep(10).StopCamera(). + Home(). AppTerminate("com.ss.android.ugc.aweme"). // 关闭已运行的抖音,确保启动抖音后在「抖音」首页 SwipeToTapApp("抖音", hrp.WithMaxRetryTimes(5)). Sleep(10), @@ -33,10 +40,10 @@ func TestIOSDouYinLive(t *testing.T) { }, } - if err := testCase.Dump2JSON("android_demo_douyin_live.json"); err != nil { + if err := testCase.Dump2JSON("demo_android_douyin_live.json"); err != nil { t.Fatal(err) } - if err := testCase.Dump2YAML("android_demo_douyin_live.yaml"); err != nil { + if err := testCase.Dump2YAML("demo_android_douyin_live.yaml"); err != nil { t.Fatal(err) } diff --git a/hrp/internal/uixt/ext.go b/hrp/internal/uixt/ext.go index 41dea6d9..b2daad9c 100644 --- a/hrp/internal/uixt/ext.go +++ b/hrp/internal/uixt/ext.go @@ -304,7 +304,7 @@ func (dExt *DriverExt) IsImageExist(text string) bool { var errActionNotImplemented = errors.New("UI action not implemented") func (dExt *DriverExt) DoAction(action MobileAction) error { - log.Info().Str("method", string(action.Method)).Interface("params", action.Params).Msg("start iOS UI action") + log.Info().Str("method", string(action.Method)).Interface("params", action.Params).Msg("start UI action") switch action.Method { case AppInstall: diff --git a/hrp/internal/uixt/ios_device.go b/hrp/internal/uixt/ios_device.go index da9de53e..9a5f6272 100644 --- a/hrp/internal/uixt/ios_device.go +++ b/hrp/internal/uixt/ios_device.go @@ -240,7 +240,7 @@ func (dExt *DriverExt) StartLogRecording(identifier string) error { } func (dExt *DriverExt) GetLogs() (interface{}, error) { - log.Info().Msg("stop WDA log recording") + log.Info().Msg("stop log recording") if _, ok := dExt.Driver.(*wdaDriver); ok { data := map[string]interface{}{"action": "stop"} reply, err := dExt.triggerWDALog(data)