mirror of
https://github.com/httprunner/httprunner.git
synced 2026-09-05 07:26:55 +08:00
feat: run last action with given times
This commit is contained in:
+25
-2
@@ -52,7 +52,7 @@ func TestIOSSearchApp(t *testing.T) {
|
||||
Config: NewConfig("ios ui action on Search App 资源库"),
|
||||
TestSteps: []IStep{
|
||||
NewStep("进入 App 资源库 搜索框").
|
||||
IOS().Home().SwipeLeft().SwipeLeft().Click("dewey-search-field").
|
||||
IOS().Home().SwipeLeft().Times(2).Click("dewey-search-field").
|
||||
Validate().
|
||||
AssertNameExists("取消", "「取消」不存在"),
|
||||
NewStep("搜索抖音").
|
||||
@@ -66,6 +66,29 @@ func TestIOSSearchApp(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestIOSWeixin(t *testing.T) {
|
||||
testCase := &TestCase{
|
||||
Config: NewConfig("ios ui action on 微信"),
|
||||
TestSteps: []IStep{
|
||||
NewStep("启动微信").
|
||||
IOS().Home().Click("微信").
|
||||
Validate().
|
||||
AssertNameExists("通讯录", "微信启动失败,「通讯录」不存在"),
|
||||
NewStep("进入直播页").
|
||||
IOS().Click("发现").Click([]float64{0.5, 0.3}).
|
||||
Validate().
|
||||
AssertNameExists("直播", "「直播」不存在"),
|
||||
NewStep("向上滑动 5 次").
|
||||
IOS().SwipeUp().Times(5),
|
||||
},
|
||||
}
|
||||
|
||||
err := NewRunner(t).Run(testCase)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestIOSDouyinAction(t *testing.T) {
|
||||
testCase := &TestCase{
|
||||
Config: NewConfig("ios ui action on 抖音"),
|
||||
@@ -76,7 +99,7 @@ func TestIOSDouyinAction(t *testing.T) {
|
||||
AssertNameExists("首页", "首页 tab 不存在").
|
||||
AssertNameExists("消息", "消息 tab 不存在"),
|
||||
NewStep("swipe up and down").
|
||||
IOS().SwipeUp().SwipeUp().SwipeDown(),
|
||||
IOS().SwipeUp().Times(3).SwipeDown(),
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user