def test_creatrooms(self): u'创建房间' getdev = ChangeDev() getdev.changedev() set_current(0) poco = StdPoco() if poco("img_yuanbao").exists(): poco("closeBtn").click() if poco("btn_new").exists(): poco("btn_new").click() if poco("pan_newer_ddz").exists(): poco("Layout")[6].offspring("Image_bg").click() poco("Layout")[6].offspring("list_view_select").offspring( "btn_select1").click() poco("Layout")[7].offspring("btn_sure").click() assert (poco("cancleBtn").get_text() == "解散房间") print('测试通过') else: poco("btn_select2").child("label_name").click() poco("btn_sure").click() assert (poco("cancleBtn").get_text() == "解散房间") print('测试通过') else: assert_equal(1, 2, msg='没找元素,测试失败') else: if poco("btn_new").exists(): poco("btn_new").click() poco("btn_select2").child("label_name").click() poco("btn_sure").click() assert (poco("cancleBtn").get_text() == "解散房间") print('测试通过')
def get_id(self): from until.ChangeDevs import ChangeDev selectDev = ChangeDev() selectDev.changedev() set_current(1) poco = StdPoco() userid = poco("lb_id").get_text().split(':')[1] return userid
def Logout(self): time.sleep(1) dev=ChangeDev() dev.changedev() set_current(1) poco = StdPoco() keyevent("BACK") poco("btn_yes").click()
def test_inputroomNumber(self): u'输入房间号' getdev = ChangeDev() getdev.changedev() set_current(0) poco = StdPoco() time.sleep(1) poco("btn_join").click() assert (poco("Label_90_0").get_text() == "请输入房间号") print('加入房间界面弹出正常,测试通过') time.sleep(0.5)
def test_joinroom(self): u'加入房间' getdev = ChangeDev() getdev.changedev() time.sleep(1) roomNumber = other_login() set_current(0) poco = StdPoco() for i in range(len(roomNumber)): j = roomNumber[i] if j: poco("btn_code%s" % j).click() assert (poco("cancleBtn").get_text() == '退出房间') print('加入房间功能测试通过')
def other_login(): odev = ChangeDev() o = odev.changedev() set_current(1) start_app('com.dashengzhangyou.pykf.lailaiguangdong') time.sleep(5) poco = StdPoco() poco("<Node | Tag = -1").child("Button")[1].click() #点击进入openid界面 poco("<Node | Tag = -1").child("<LayerColor | Tag = -1>")[1].child( "Widget")[1].click() #点击openid输入框,方便输入openid text(id) #随机输入5位id poco("<Node | Tag = -1").child("<LayerColor | Tag = -1>")[1].child( "Button").click() #点击下方按钮 time.sleep(3) poco("Layout")[1].offspring("city_list").child("root")[0].offspring( "btn_1").click() #选择城市 poco("Layout")[1].offspring("btn_yes_city").click() #点击“确定” poco("yes").click() #确认选择城市 time.sleep(5) yzm = poco("lab_regist_verify") if yzm.exists(): poco("closeBtn").click() else: print('not found') poco("btn_new").click() poco("btn_select2").child("label_name").click() poco("btn_sure").click() assert poco("cancleBtn").get_text() == "解散房间" roomNumbers = (poco("roomNum").get_text()) return roomNumbers
def test_quitroom(self): u'退出房间' getdev = ChangeDev() getdev.changedev() set_current(0) poco = StdPoco() poco("cancleBtn").click() poco("btn_yes").click() assert (poco("btn_new")) print('退出房间功能测试通过') set_current(1) keyevent('BACK') poco = StdPoco() poco("btn_yes").click() keyevent('BACK') poco("btn_yes").click() set_current(0) poco = StdPoco()
def test_qinyouclub(self): u'亲友俱乐部' sta = ChangeDev() sta.changedev() set_current(0) start_app('com.dashengzhangyou.pykf.lailaiguangdong') time.sleep(6) poco = StdPoco() poco("<Node | Tag = -1").child("<LayerColor | Tag = -1>")[0].child( "Button")[0].click() time.sleep(5) bind = poco("Label_20") if bind.exists(): poco("closeBtn").click() time.sleep(1) tip = poco("root").offspring("txt_load") time.sleep(15) if not tip.exists(): from until.qinyouhoutai import qinyouhoutai callhoutai = qinyouhoutai() callhoutai.open_qinyouhoutai() poco("btn_club").click() assert (poco("Label_60_0").get_text() == '亲友列表') print('我的亲友圈界面正常--测试通过')
def setUp(self): redpak = ChangeDev() redpak.changedev() set_current(0)
def setUp(self): enterdev = ChangeDev() enterdev.changedev() set_current(0)
def setUp(self): kefDev = ChangeDev() kefDev.changedev() set_current(0)
def setUp(self): getdev = ChangeDev() getdev.changedev() print('创建房间模块用例')
def setUp(self): qinyouinfo = ChangeDev() qinyouinfo.changedev() set_current(0)
def setUp(self): chongzhi = ChangeDev() chongzhi.changedev() set_current(0)
def setUp(self): zhDev=ChangeDev() zhDev.changedev() set_current(0)
def setUp(self): notDev = ChangeDev() notDev.changedev() set_current(0)
def setUp(self): reslut = ChangeDev() reslut.changedev() set_current(0)
def setUp(self): xianliao=ChangeDev() xianliao.changedev() set_current(0)
def setUp(self): mainfeiDev = ChangeDev() mainfeiDev.changedev() set_current(0)
def setUp(self): bdDev = ChangeDev() bdDev.changedev() set_current(0)
def setUp(self): qinyougetdev=ChangeDev() qinyougetdev.changedev() set_current(0)
def setUp(self): print('登录模块用例') getdev = ChangeDev() getdev.changedev()
def setUp(self): sharDev = ChangeDev() sharDev.changedev() set_current(0)
def setUp(self): getDiamondDev = ChangeDev() getDiamondDev.changedev() set_current(0)
def setUp(self): u'测试创建亲友房' qinyouroom=ChangeDev() qinyouroom.changedev() set_current(0)
def setUp(self): joinqinyou = ChangeDev() joinqinyou.changedev() set_current(0)
def setUp(self): moreDev=ChangeDev() moreDev.changedev() set_current(0)