mirror of
https://github.com/httprunner/httprunner.git
synced 2026-05-12 02:21:29 +08:00
change: set debug logging for gwda
This commit is contained in:
@@ -383,6 +383,7 @@ func (r *HRPRunner) InitWDAClient(device WDADevice) (client *wdaClient, err erro
|
||||
}
|
||||
|
||||
// init WDA driver
|
||||
gwda.SetDebug(true)
|
||||
capabilities := gwda.NewCapabilities()
|
||||
capabilities.WithDefaultAlertAction(gwda.AlertActionAccept)
|
||||
driver, err := gwda.NewUSBDriver(capabilities, *targetDevice)
|
||||
@@ -728,7 +729,7 @@ func (w *wdaClient) findElement(param string) (ele gwda.WebElement, err error) {
|
||||
} else {
|
||||
// name
|
||||
selector = gwda.BySelector{
|
||||
Name: param,
|
||||
LinkText: gwda.NewElementAttribute().WithName(param),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -737,7 +738,7 @@ func (w *wdaClient) findElement(param string) (ele gwda.WebElement, err error) {
|
||||
|
||||
func (w *wdaClient) assertName(name string, exists bool) bool {
|
||||
selector := gwda.BySelector{
|
||||
Name: name,
|
||||
LinkText: gwda.NewElementAttribute().WithName(name),
|
||||
}
|
||||
_, err := w.Driver.FindElement(selector)
|
||||
return exists == (err == nil)
|
||||
|
||||
@@ -48,7 +48,8 @@ func TestIOSSearchApp(t *testing.T) {
|
||||
|
||||
func TestIOSAppLaunch(t *testing.T) {
|
||||
testCase := &TestCase{
|
||||
Config: NewConfig("启动 & 关闭 App"),
|
||||
Config: NewConfig("启动 & 关闭 App").
|
||||
SetIOS(WDADevice{Port: 8100, MjpegPort: 9100}),
|
||||
TestSteps: []IStep{
|
||||
NewStep("终止今日头条").
|
||||
IOS().AppTerminate("com.ss.iphone.article.News"),
|
||||
@@ -71,7 +72,7 @@ func TestIOSAppLaunch(t *testing.T) {
|
||||
func TestIOSWeixinLive(t *testing.T) {
|
||||
testCase := &TestCase{
|
||||
Config: NewConfig("ios ui action on 微信直播").
|
||||
SetIOS(WDADevice{Port: 8700, MjpegPort: 8800}),
|
||||
SetIOS(WDADevice{Port: 8100, MjpegPort: 9100}),
|
||||
TestSteps: []IStep{
|
||||
NewStep("启动微信").
|
||||
IOS().
|
||||
|
||||
Reference in New Issue
Block a user