Skip to content

Commit

Permalink
Merge pull request #8 from Tencent/bugfix/browser-init
Browse files Browse the repository at this point in the history
Bugfix/browser init
  • Loading branch information
drunkdream committed Jan 16, 2019
2 parents 3d2b323 + eba7f7f commit 3852e1a
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
Binary file modified qt4a/androiddriver/tools/QT4AHelper.apk
Binary file not shown.
2 changes: 1 addition & 1 deletion qt4a/androiddriver/tools/version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
181
182
13 changes: 11 additions & 2 deletions qt4a/browser.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import time
from androidapp import AndroidApp
from andrcontrols import Window, TextView, WebView
from qt4a.device import Device
from qpath import QPath
from qt4w.browser import IBrowser
from qt4w.webcontrols import WebPage
Expand All @@ -30,8 +31,16 @@ class QT4ABrowser(AndroidApp, IBrowser):
package_name = 'com.test.androidspy'
process_name = package_name + ':browser'

def __init__(self):
super(QT4ABrowser, self).__init__(self.process_name)
def __init__(self, device=None):
if not device:
from testbase import context
tc = context.current_testcase()
if tc:
device = tc.acquire_device()
else:
# 使用本地设备
device = Device()
super(QT4ABrowser, self).__init__(self.process_name, device)

def open_url(self, url, page_cls=None):
'''打开一个url,返回page_cls类的实例
Expand Down

0 comments on commit 3852e1a

Please sign in to comment.