mirror of
https://github.com/httprunner/httprunner.git
synced 2026-08-28 19:47:14 +08:00
change: set debug logging for gwda
This commit is contained in:
+3
-2
@@ -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)
|
||||||
|
|||||||
@@ -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().
|
||||||
|
|||||||
Reference in New Issue
Block a user