change: set debug logging for gwda

This commit is contained in:
debugtalk
2022-08-25 20:50:28 +08:00
parent df50b8ff87
commit 624b70ea83
2 changed files with 6 additions and 4 deletions
+3 -2
View File
@@ -383,6 +383,7 @@ func (r *HRPRunner) InitWDAClient(device WDADevice) (client *wdaClient, err erro
} }
// init WDA driver // init WDA driver
gwda.SetDebug(true)
capabilities := gwda.NewCapabilities() capabilities := gwda.NewCapabilities()
capabilities.WithDefaultAlertAction(gwda.AlertActionAccept) capabilities.WithDefaultAlertAction(gwda.AlertActionAccept)
driver, err := gwda.NewUSBDriver(capabilities, *targetDevice) driver, err := gwda.NewUSBDriver(capabilities, *targetDevice)
@@ -728,7 +729,7 @@ func (w *wdaClient) findElement(param string) (ele gwda.WebElement, err error) {
} else { } else {
// name // name
selector = gwda.BySelector{ 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 { func (w *wdaClient) assertName(name string, exists bool) bool {
selector := gwda.BySelector{ selector := gwda.BySelector{
Name: name, LinkText: gwda.NewElementAttribute().WithName(name),
} }
_, err := w.Driver.FindElement(selector) _, err := w.Driver.FindElement(selector)
return exists == (err == nil) return exists == (err == nil)
+3 -2
View File
@@ -48,7 +48,8 @@ func TestIOSSearchApp(t *testing.T) {
func TestIOSAppLaunch(t *testing.T) { func TestIOSAppLaunch(t *testing.T) {
testCase := &TestCase{ testCase := &TestCase{
Config: NewConfig("启动 & 关闭 App"), Config: NewConfig("启动 & 关闭 App").
SetIOS(WDADevice{Port: 8100, MjpegPort: 9100}),
TestSteps: []IStep{ TestSteps: []IStep{
NewStep("终止今日头条"). NewStep("终止今日头条").
IOS().AppTerminate("com.ss.iphone.article.News"), IOS().AppTerminate("com.ss.iphone.article.News"),
@@ -71,7 +72,7 @@ func TestIOSAppLaunch(t *testing.T) {
func TestIOSWeixinLive(t *testing.T) { func TestIOSWeixinLive(t *testing.T) {
testCase := &TestCase{ testCase := &TestCase{
Config: NewConfig("ios ui action on 微信直播"). Config: NewConfig("ios ui action on 微信直播").
SetIOS(WDADevice{Port: 8700, MjpegPort: 8800}), SetIOS(WDADevice{Port: 8100, MjpegPort: 9100}),
TestSteps: []IStep{ TestSteps: []IStep{
NewStep("启动微信"). NewStep("启动微信").
IOS(). IOS().