feat: create scaffold for mobile UI test

This commit is contained in:
debugtalk
2022-07-26 18:25:17 +08:00
parent 7a94a7860c
commit aa4d5faa12
5 changed files with 444 additions and 0 deletions
+44
View File
@@ -0,0 +1,44 @@
package hrp
import (
"fmt"
"testing"
)
func TestAndroidAction(t *testing.T) {
testCase := &TestCase{
Config: NewConfig("android ui action"),
TestSteps: []IStep{
NewStep("launch douyin").
Android().Serial("xxx").Click("抖音"),
NewStep("swipe up and down").
Android().Serial("xxx").SwipeUp().SwipeUp().SwipeDown(),
},
}
tCase := testCase.ToTCase()
fmt.Println(tCase)
err := NewRunner(t).Run(testCase)
if err != nil {
t.Fatal(err)
}
}
func TestIOSAction(t *testing.T) {
testCase := &TestCase{
Config: NewConfig("ios ui action"),
TestSteps: []IStep{
NewStep("launch douyin").
IOS().UDID("xxx").Click("抖音"),
NewStep("swipe up and down").
IOS().UDID("xxx").SwipeUp().SwipeUp().SwipeDown(),
},
}
tCase := testCase.ToTCase()
fmt.Println(tCase)
err := NewRunner(t).Run(testCase)
if err != nil {
t.Fatal(err)
}
}