change: set debug logging for gwda

This commit is contained in:
debugtalk
2022-08-25 20:14:56 +08:00
parent 271f143433
commit e491f3c08d
2 changed files with 6 additions and 4 deletions

View File

@@ -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)

View File

@@ -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().