Esempio n. 1
0
 def __init__(self, demoapp):
     super(LoginPanel, self).__init__(demoapp)
     self.update_locator({'帐号': {'type': EditText, 'root': self, 'locator': QPath('/Id="editAcc"')},
                         '密码': {'type': EditText, 'root': self, 'locator': QPath('/Id="editPwd"')},
                         '登录': {'type': Button, 'root': self, 'locator': QPath('/Id="btnLogin"')},
                   
                         })
Esempio n. 2
0
 def __init__(self, weixinapp):
     super(LoginPanel, self).__init__(weixinapp)
     self.update_locator({'帐号': {'type': EditText, 'root': self, 'locator': QPath('/Type="MMClearEditText" && Visible="True" && Instance=0' )},
                         '密码': {'type': EditText, 'root': self, 'locator': QPath('/Type="MMClearEditText" && Visible="True" && Instance=-1')},
                         '登录': {'type': Button, 'root': self, 'locator': QPath('/Text="登录"')},
                         '否': {'type': TextView, 'root': self, 'locator': QPath('/Text="否"')}, #不看通讯录谁在用微信
                         })
Esempio n. 3
0
 def __init__(self, app):
     super(ScanPanel, self).__init__(app)
     self.update_locator({
         '更多': {
             'type':
             ImageView,
             'root':
             self,
             'locator':
             QPath(
                 '/Type="ActionMenuView" /Type="ImageButton" && Visible="True" && MaxDepth=4'
             )
         },
         '相册': {
             'type':
             ImageView,
             'root':
             self,
             'locator':
             QPath(
                 '/Type="ScanSharedMaskView" /Type="WeImageView" && Visible="True" && MaxDepth=3'
             )
         },
         '扫描完成': {
             'type': TextView,
             'root': self,
             'locator': QPath('/Text="扫描完成\n正在准备打开"')
         }
     })
Esempio n. 4
0
 def __init__(self, wxapp):
     super(MainPanel, self).__init__(wxapp)
     self.update_locator({
         '左上角微信': {
             'type':
             TextView,
             'root':
             self,
             'locator':
             QPath('/Type="RelativeLayout" /Id="text1" && Visible="True"')
         },
         '搜索': {
             'type': ActionMenuItemView,
             'root': self,
             'locator': QPath('/Desc="搜索"')
         },
         '更多': {
             'type':
             ImageView,
             'root':
             self,
             'locator':
             QPath(
                 '/Type="AppBrandDesktopContainer" /Type="FrameLayout" && MaxDepth=2 /Type="RelativeLayout" && MaxDepth=3 && Instance=1 /Type="ImageView" && Visible="True"'
             )
         },
         '发现': {
             'type': TextView,
             'root': self,
             'locator': QPath('/Text="发现"')
         },
     })
Esempio n. 5
0
 def login_phone(self, acc, pwd):
     LoginPanel.Activity = "com.tencent.mm.plugin.account.ui.MobileInputUI"
     self.update_locator({
         '手机号': {
             'type': EditText,
             'root': self,
             'locator': QPath('/Id="bem"')
         },
         '下一步': {
             'type': Button,
             'root': self,
             'locator': QPath('/Id="dw1"')
         },
         '我知道了': {
             'type': Button,
             'root': self,
             'locator': QPath('/Id="dj6"')
         },
         '密码': {
             'type': EditText,
             'root': self,
             'locator': QPath('/Id="f5b" /Id="bem"')
         },
         '登录': {
             'type': Button,
             'root': self,
             'locator': QPath('/Id="dw1"')
         },
     })
     self.Controls["手机号"].text = acc
     self.Controls["下一步"].click()
     if self.Controls["我知道了"].wait_for_exist():
         self.Controls["我知道了"].click()
     self.Controls["手机号"].text = pwd
     self.Controls["下一步"].click()
Esempio n. 6
0
 def __init__(self, app):
     self.app = app
     super(LoginPanel, self).__init__(app)
     self.update_locator({
         '密码登录': {
             'type': Button,
             'root': self,
             'locator': QPath('/Id="login_mobile_passward_text"')
         },
         '登录即同意': {
             'type': Button,
             'root': self,
             'locator': QPath('/Id="icon_agree"')
         },
         '手机号': {
             'type': EditText,
             'root': self,
             'locator': QPath('/Id="login_phone_edit_text"')
         },
         '密码': {
             'type': EditText,
             'root': self,
             'locator': QPath('/Id="login_password_edit_text"')
         },
         '登录': {
             'type': Button,
             'root': self,
             'locator': QPath('/Id="login_mobile_btn"')
         },
     })
Esempio n. 7
0
 def __init__(self, app):
     super(MiniProgramPanel, self).__init__(app)
     self.update_locator({'标题': {'type': TextView, 'root': self, 'locator': QPath('/Type="RelativeLayout" /Type="RelativeLayout" /Type="LinearLayout" /Type="TextView" && Visible="True"')},
                          '菜单': {'type': ImageButton, 'root': self, 'locator': QPath('/Type="AppBrandOptionButton" /Type="ImageButton" && Visible="True"')},
                          '返回': {'type': ImageButton, 'root': self, 'locator': QPath('/Type="AppBrandCapsuleHomeButton" /Type="ImageButton" && Visible="True"')},
                          '加载中': {'type': View, 'root': self, 'locator': QPath('/Type="ThreeDotsLoadingView"')},
                          })
     self._wait_for_window = True  # 是否等待窗口标题变化
Esempio n. 8
0
 def __init__(self, browser):
     super(QT4ABrowserWindow, self).__init__(browser)
     self.updateLocator({
         '标题': {
             'type': TextView,
             'root': self,
             'locator': QPath('/Id="text_title"')
         },
         'WebView': {
             'type': WebView,
             'root': self,
             'locator': QPath('/Id="webView1"')
         },
     })
Esempio n. 9
0
 def __init__(self, app):
     super(TBSDownloadDialog, self).__init__(app)
     self.update_locator({
         '取消': {
             'type': Button,
             'root': self,
             'locator': QPath('/Text="取消"')
         },
         '升级': {
             'type': Button,
             'root': self,
             'locator': QPath('/Text="升级"')
         },
     })
Esempio n. 10
0
 def __init__(self, app):
     super(CrashWindow, self).__init__(app)
     self.updateLocator({
         '提示': {
             'type': TextView,
             'root': self,
             'locator': QPath('/Id="message"')
         },
         '确定': {
             'type': Button,
             'root': self,
             'locator': QPath('/Id="button1"')
         },
     })
Esempio n. 11
0
 def __init__(self, app, wait_activity=False):
     super(MyWindow, self).__init__(app, wait_activity=wait_activity)
     self.update_locator({
         '标题': {
             'type': TextView,
             'root': self,
             'locator': QPath('/Id="title"')
         },
         '输入框': {
             'type': EditText,
             'root': self,
             'locator': QPath('/Id="edit"')
         },
     })
Esempio n. 12
0
 def __init__(self, app):
     super(WebAuthorizeDialog, self).__init__(app)
     self.update_locator({
         '微信登录': {
             'type': TextView,
             'root': self,
             'locator': QPath('/Text="微信登录"')
         },
         '允许': {
             'type': Button,
             'root': self,
             'locator': QPath('/Text="允许"')
         },
     })
Esempio n. 13
0
 def __init__(self, app):
     super(DiscoverPanel, self).__init__(app)
     self.update_locator({
         '入口列表': {
             'type': ListView,
             'root': self,
             'locator': QPath('/Id="list" && Instance=0')
         },
         '入口名': {
             'type': TextView,
             'root': '@入口列表',
             'locator': QPath('/Type="LinearLayout" /Id="title"')
         },
         #'小程序': {'type': TextView, 'root': '@入口列表', 'locator': QPath('/Text="小程序"')},
     })
Esempio n. 14
0
 def test_instance(self):
     self.assertEqual(
         QPath('/Text="标题" /Instance=1').parsed_qpath, [{
             'Text': ['=', '标题']
         }, {
             'Instance': ['=', 1]
         }])
Esempio n. 15
0
 def __init__(self, app):
     super(MiniProgramLauncherPanel, self).__init__(app)
     self.update_locator({'搜索': {'type': ImageButton, 'root': self, 'locator': QPath('/Desc="搜索"')},
                          'FrameLayout': {'type': FrameLayout, 'root': self, 'locator': QPath('/Id="content" /Type="FrameLayout" && MaxDepth=2 /Type="FrameLayout"')},
                          '小程序列表1': {'type': NoScrollListView, 'root': self, 'locator': QPath(r'/Type~="AppBrandLauncherRecentsList\$\d+"')},
                          '小程序列表2': {'type': NoScrollListView, 'root': '@FrameLayout', 'locator': QPath('/Instance=0')},
                          '小程序名称': {'type': TextView, 'root': '@小程序列表', 'locator': QPath('/Type="LinearLayout" /Type="TextView" && Visible="True"')},
                          })
Esempio n. 16
0
 def __init__(self, app):
     super(PastePopup, self).__init__(app, False)
     self.updateLocator({
         '粘贴': {
             'type':
             TextView,
             'root':
             self,
             'locator':
             QPath('/Text="%s"' % self._app.get_string_resource('paste'))
         },  # 粘贴
         '替换': {
             'type': TextView,
             'root': self,
             'locator': QPath('/Text="替换..."')
         },
     })
Esempio n. 17
0
 def test_maxdepth(self):
     self.assertEqual(
         QPath('/Type="TextView" /Text="消息" && MaxDepth=3').parsed_qpath, [{
             'Type': ['=', 'TextView']
         }, {
             'MaxDepth': ['=', 3],
             'Text': ['=', '消息']
         }])
Esempio n. 18
0
 def __init__(self, app):
     super(AlbumListDialog, self).__init__(app)
     self.update_locator({
         '相册列表': {
             'type': ListView,
             'root': self,
             'locator': QPath('/Type="ListView"')
         },
         '相册名': {
             'type':
             TextView,
             'root':
             '@相册列表',
             'locator':
             QPath('/Type="LinearLayout" /Type="TextView" && Instance=0')
         }
     })
Esempio n. 19
0
 def __init__(self, app):
     super(PopupMenu, self).__init__(app)
     self.update_locator({
         '扫一扫': {
             'type': TextView,
             'root': self,
             'locator': QPath('/Text="扫一扫"')
         }
     })
Esempio n. 20
0
 def __init__(self, demoapp):
     super(HomePanel, self).__init__(demoapp)
     self.update_locator({
         '进入网页视图': {
             'type': Button,
             'root': self,
             'locator': QPath('/Id="goToWebview"')
         },
     })
Esempio n. 21
0
 def __init__(self, demoapp):
     super(DemoWebPanel, self).__init__(demoapp)
     self.update_locator({
         'webview': {
             'type': WebView,
             'root': self,
             'locator': QPath('/Id="sampleWebView"')
         },
     })
Esempio n. 22
0
 def __init__(self, app):
     super(PrivacyAgreementPanel, self).__init__(app)
     self.update_locator({
         '同意': {
             'type': TextView,
             'root': self,
             'locator': QPath('/Text="同意"')
         },
     })
Esempio n. 23
0
 def __init__(self, driver):
     super(Toast, self).__init__(driver, False)
     self.updateLocator({
         '消息': {
             'type': TextView,
             'root': self,
             'locator': QPath('/Id="message"')
         },
     })
Esempio n. 24
0
 def __init__(self, app):
     super(PrivacyDialog, self).__init__(app)
     self.update_locator({
         '了解更多': {
             'type': Button,
             'root': self,
             'locator': QPath('/Text="了解更多"')
         },
     })
Esempio n. 25
0
 def __init__(self, app):
     super(ScanPopupDialog, self).__init__(app)
     self.update_locator({
         '从相册选取二维码': {
             'type': TextView,
             'root': self,
             'locator': QPath('/Text="从相册选取二维码"')
         }
     })
Esempio n. 26
0
 def __init__(self, app):
     super(ExtDeviceLoginPanel, self).__init__(app)
     self.update_locator({
         '登录': {
             'type': Button,
             'root': self,
             'locator': QPath('/Text="登录"')
         }
     })
Esempio n. 27
0
 def __init__(self, app):
     super(AlbumPreviewPanel, self).__init__(app)
     self.update_locator({
         '所有图片': {
             'type': TextView,
             'root': self,
             'locator': QPath('/Text="所有图片"')
         },
         '图片列表1': {
             'type': GridView,
             'root': self,
             'locator': QPath('/Type="GridView"')
         },
         '图片列表2': {
             'type': NoScrollListView,
             'root': self,
             'locator': QPath('/Type="RecyclerView"')
         },
     })
Esempio n. 28
0
 def __init__(self, app):
     super(ClosePopUps, self).__init__(app)
     self.update_locator({
         '同意': {
             'type': EditText,
             'root': self,
             'locator': QPath('/Id="agreeTv"')
         },
         '已满14岁': {
             'type': EditText,
             'root': self,
             'locator': QPath('/Id="dialog_right_btn"')
         },
         '登录': {
             'type': Button,
             'root': self,
             'locator': QPath('/Id="btnLogin"')
         },
     })
Esempio n. 29
0
 def __init__(self, app):
     super(WXUpdateDialog, self).__init__(app)
     self.update_locator({
         '标题': {
             'type': TextView,
             'root': self,
             'locator': QPath('/Text="更新"')
         },
         '取消': {
             'type': Button,
             'root': self,
             'locator': QPath(r'/Text~="\s*取消\s*"')
         },
         '立即安装': {
             'type': Button,
             'root': self,
             'locator': QPath('/Text="立即安装"')
         },
     })
Esempio n. 30
0
 def __init__(self, app):
     super(WXCancelUpdateConfirmDialog, self).__init__(app)
     self.update_locator({
         '标题': {
             'type': TextView,
             'root': self,
             'locator': QPath('/Text="提示"')
         },
         '否': {
             'type': Button,
             'root': self,
             'locator': QPath('/Text="否"')
         },
         '是': {
             'type': Button,
             'root': self,
             'locator': QPath('/Text="是"')
         },
     })