def logout(d): '''退出''' HomePage().mine_view.click() d(text='先去逛逛').click_exists(timeout=4) MinePage().setting_view.click() scroll('up').click(text='安全退出') d(text='确定').click()
def test_06_check_shopping(self): """ 检查会员商城页面 """ time.sleep(3) HomePage().discover_view.click(timeout=20) scroll('up').click(text='会员商城') scroll('up').click(text='查看更多') assert Driver.d(text='会员商城').exists(timeout=3) assert Driver.d(text='兑换记录').exists(timeout=3) assert Driver.d(text='会员专区').exists(timeout=3)
def test_05_debt_transfer_records(self): """债权转让记录""" global debt_transfer_reason HomePage().click_mine_view() # MinePage().debt_text_view.click() scroll('up').click(text='债转') Driver.d(text=u"转让记录").click() assert Driver.d(text=u"3天后下架").exists(timeout=5) assert Driver.d(text=debt_transfer_reason).exists(timeout=5) Driver.screenshot()
def test_04_debt_transfer(self, reason="低价贱卖", discount="90"): """ 债权转让 """ global debt_transfer_reason debt_transfer_reason = reason HomePage().click_mine_view() scroll('up').click(text="债转") Driver.d(text=u"收款中").click() Driver.d(text=u"转让").click() Driver.d(resourceId="com.nonoapp:id/et_creditor_right_transfer_reason").set_text(reason) Driver.d(resourceId="com.nonoapp:id/et_creditor_right_transfer_discount").set_text(discount) Driver.d.press("back") Driver.d(text=u"确定转让").click() Driver.d(text=u"确定").click() time.sleep(3)
def test_05_check_my_task(self): """ 检查我的任务页面 """ time.sleep(3) #显式的等待... HomePage().discover_view.click(timeout=20) # Driver.d(resourceId='com.nonoapp:id/ll_home_welfare_my_task').click(timeout=5) scroll('up').click(text='我的任务') if Driver.d(description='去邀请').exists(timeout=3): assert True elif Driver.d(text='去邀请').exists(timeout=3): assert True else: assert False if Driver.d(description='我的福利').exists(timeout=3): Driver.d(description='我的福利').click() else: Driver.d(text='我的福利').click() # assert self.d(description='去出借').exists(timeout=3) assert Driver.d(text='抵用券').exists(timeout=3) assert Driver.d(text='补贴券').exists(timeout=3) assert Driver.d(text='特权本金').exists(timeout=3) Driver.screenshot()