mirror of
https://github.com/httprunner/httprunner.git
synced 2026-06-02 22:39:42 +08:00
fix test
This commit is contained in:
@@ -602,41 +602,3 @@ func TestStepMultipleSIMActions(t *testing.T) {
|
|||||||
|
|
||||||
t.Logf("Successfully executed multiple SIM actions test")
|
t.Logf("Successfully executed multiple SIM actions test")
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestStepMultipleSIMAIOSctions(t *testing.T) {
|
|
||||||
// 创建包含多个SIM操作的测试用例
|
|
||||||
testCase := &hrp.TestCase{
|
|
||||||
Config: hrp.NewConfig("多个SIM操作组合测试").SetIOS(option.WithUDID("")),
|
|
||||||
TestSteps: []hrp.IStep{
|
|
||||||
hrp.NewStep("组合SIM操作测试").
|
|
||||||
Android().
|
|
||||||
SIMClickAtPoint(0.3, 0.3). // 点击屏幕中心
|
|
||||||
Sleep(1). // 等待1秒
|
|
||||||
SIMSwipeWithDirection("up", 0.5, 0.7, 200.0, 400.0). // 向上滑动
|
|
||||||
Sleep(0.5). // 等待0.5秒
|
|
||||||
SIMSwipeInArea("up", 0.2, 0.2, 0.6, 0.6, 350.0, 500.0). // 在区域内向下滑动
|
|
||||||
Sleep(0.5). // 等待0.5秒
|
|
||||||
SIMSwipeFromPointToPoint(0.1, 0.2, 0.9, 0.5). // 从左到右滑动
|
|
||||||
Sleep(0.5). // 等待0.5秒
|
|
||||||
SIMInput("测试组合操作 Test Combination 123"), // 仿真输入
|
|
||||||
},
|
|
||||||
}
|
|
||||||
|
|
||||||
// 运行测试用例
|
|
||||||
err := testCase.Dump2JSON("TestStepMultipleSIMActions.json")
|
|
||||||
if err != nil {
|
|
||||||
t.Fatalf("Failed to dump test case: %v", err)
|
|
||||||
}
|
|
||||||
defer func() {
|
|
||||||
// 清理生成的文件
|
|
||||||
_ = os.Remove("TestStepMultipleSIMActions.json")
|
|
||||||
}()
|
|
||||||
|
|
||||||
// 执行测试用例
|
|
||||||
err = hrp.NewRunner(t).Run(testCase)
|
|
||||||
if err != nil {
|
|
||||||
t.Errorf("Test case failed: %v", err)
|
|
||||||
}
|
|
||||||
|
|
||||||
t.Logf("Successfully executed multiple SIM actions test")
|
|
||||||
}
|
|
||||||
|
|||||||
Reference in New Issue
Block a user