码迷,mamicode.com
首页 > 移动开发 > 详细

AppUi自动化框架thread_page.py代码

时间:2018-10-06 23:06:41      阅读:236      评论:0      收藏:0      [点我收藏+]

标签:ini   ISE   set   com   app   login   btn   android   pad   

from lib.appController import driver_queue
import threading
from lib.pyapp import Pyapp
from lib.logger import logger

class BasePage(object):
def __init__(self, driver=None):
try:
self.driver = driver_queue.get()
self.pyapp = Pyapp(self.driver)
except Exception as e:
logger.error(‘获取Driver出错:%s‘ % e)

def reset_app(self):
self.pyapp.reset()

def quit(self):
self.pyapp.quit()
# class ThreadPage(BasePage):
# def content_web_view(self):
# self.pyapp.switch_web_view()
#
# def url(self):
# self.pyapp.type(‘id=>url‘, ‘http://ui.imdsx.cn/uitester/‘)
#
# def enter(self):
# self.pyapp.key_code(66)
#
# def i1(self):
# self.pyapp.type(‘css=>#i1‘, ‘1111111‘)
class QQLogin(BasePage):
def padf(self):
self.pyapp.click(‘id=>com.tencent.mobileqq:id/btn_login‘)
def username(self):
css=‘content=>请输入QQ号码或手机或邮箱‘
self.pyapp.type(css,1061982257)
def passwd(self):
css = ‘content=>密码 安全‘
self.pyapp.type(css,‘Yjbtest123‘)
def login(self):
css=‘android=>new UiSelector().text("登 录")‘
self.pyapp.click(css)

# class Page(ThreadPage):
class Page(QQLogin):
pass

AppUi自动化框架thread_page.py代码

标签:ini   ISE   set   com   app   login   btn   android   pad   

原文地址:https://www.cnblogs.com/laosun0204/p/9748861.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!