def test_yue(self): # 是否显示可用余额 yue = mypage.Balance(driver) try: assert yue.try_find(yue.keyong_loc) is True logging.info('显示可用余额') except: logging.warning("不显示可用余额") yue.get_screenshot("不显示可用余额") raise
def test_xiaofei(self): # 是否显示当前消费 yue = mypage.Balance(driver) try: assert yue.try_find(yue.xiaofei_loc) is True logging.info('显示当前消费') except: logging.warning("不显示当前消费") yue.get_screenshot("不显示当前消费") raise
def test_qu_chongzhi(self): # 去充值按钮是否可用 yue = mypage.Balance(driver) yue.quchongzhi() try: assert yue.try_find(yue.chongzhi_pan_loc) is True logging.info('进入到去充值页面') except: logging.warning("无法进入到去充值页面") yue.get_screenshot("无法进入到去充值页面") raise finally: yue.back()
def test_zhangdan(self): # 能否进入我的账单 yue = mypage.Balance(driver) yue.zhangdan() try: assert yue.try_find(mypage.Balance.pan_zhangdan_loc) is True logging.info('无法进入我的账单') except: logging.warning("无法进入我的账单") yue.get_screenshot("无法进入我的账单") raise finally: yue.back()
def test_taocan_banli(self): # 是否进入套餐办理 yue = mypage.Balance(driver) yue.taocan() try: assert yue.try_find(mypage.Balance.pan_taocan_loc) is True logging.info('进入套餐办理') except: logging.warning("无法进入套餐办理") yue.get_screenshot("无法进入套餐办理") raise finally: yue.back()
def test_taocan_yuliang(self): # 是否进入套餐余量 yue = mypage.Balance(driver) yue.yuliang() try: assert yue.try_find(mypage.Balance.pan_yuliang_loc) is True logging.info('进入套餐余量') except: logging.warning("无法进入套餐余量") yue.get_screenshot("无法进入套餐余量") raise finally: yue.yuliang_back()
def test_chongzhi_jiaofei(self): # 是否进入充值交费 yue = mypage.Balance(driver) yue.chongzhi() try: assert yue.try_find(mypage.Balance.pan_chongzhi_loc) is True logging.info('进入充值交费') except: logging.warning("无法进入充值交费") yue.get_screenshot("无法进入充值交费") raise finally: yue.back()
def teardown(self): # 每次返回 yue = mypage.Balance(driver) yue.balance_back() logging.info('-------返回----------')
def setup(self): # 每次进入话费余额 yue = mypage.Balance(driver) yue.balance() logging.info('-------进入话费余额----------')