def test_TaiTou(self): # 进入发票抬头是否正常 fapiao = mypage.FaPiao(driver) fapiao.TaiTou() try: assert fapiao.try_find(mypage.FaPiao.pan_taitou_loc) is True logging.info("成功进入发票抬头") except: logging.warning("找不到发票抬头") fapiao.get_screenshot("找不到发票抬头") raise
def test_YouTui(self): # 修改邮箱推送是否正常 fapiao = mypage.FaPiao(driver) fapiao.YouTui() try: assert fapiao.try_find(mypage.FaPiao.pan_tuisong_loc) is True logging.info("进入邮箱推送") except: logging.warning("找不到邮箱推送") fapiao.get_screenshot("找不到邮箱推送") raise
def test_YueJie(self): # 进入月结发票是否正常 fapiao = mypage.FaPiao(driver) fapiao.YueJie() try: assert fapiao.try_find(mypage.FaPiao.pan_yuejie_loc) is True logging.info("成功进入月结发票") except: logging.warning("找不到月结发票") fapiao.get_screenshot("找不到月结发票") raise
def test_KuanDai(self): # 进入宽带发票是否正常 fapiao = mypage.FaPiao(driver) fapiao.KuanDai() try: assert fapiao.try_find(mypage.FaPiao.pan_kuandai_loc) is True logging.info("成功进入宽带发票") except: logging.warning("找不到宽带发票") fapiao.get_screenshot("找不到宽带发票") raise
def test_LiuLiang(self): # 进入流量直充发票是否正常 fapiao = mypage.FaPiao(driver) fapiao.LiuLiang() try: assert fapiao.try_find(mypage.FaPiao.pan_liuliang_loc) is True logging.info("成功进入流量直充") except: logging.warning("找不到流量直充") fapiao.get_screenshot("找不到流量直充") raise
def test_XinZengTaiTou(self): # 进入发票抬头是否正常 fapiao = mypage.FaPiao(driver) fapiao.TaiTou() fapiao.XinZeng() try: assert fapiao.try_find(mypage.FaPiao.pan_xinzeng_loc) is True logging.info("成功进入新增发票") except: logging.warning("找不到新增发票") fapiao.get_screenshot("找不到新增发票") raise
def test_Mail_TuiSong(self): # 进入邮箱推送是否正常 fapiao = mypage.FaPiao(driver) fapiao.YouTui() fapiao.mail("*****@*****.**") fapiao.save() try: assert fapiao.try_find(mypage.FaPiao.pan_youxiang_loc) is True logging.info("修改成功") except: logging.warning("修改失败") fapiao.get_screenshot("修改失败") raise
def test_TingKai(self): fapiao = mypage.FaPiao(driver) logging.info("上滑成功") fapiao.YueJie() fapiao.KaiJu() fapiao.TingKai() try: assert fapiao.try_find(mypage.FaPiao.kaiju_loc) is True logging.info("停止开具") except: logging.warning("找不到停止开具") fapiao.get_screenshot("找不到停止开具") raise finally: fapiao.close()
def test_HuaFei(self): # 进入话费充值发票是否正常 fapiao = mypage.FaPiao(driver) fapiao.swipe_up(t=1000, n=1) logging.info("上滑成功") time.sleep(5) fapiao.fapiao() time.sleep(5) fapiao.HuaFei() try: assert fapiao.try_find(mypage.FaPiao.pan_huafei_loc) is True logging.info('成功进入话费充值') except: logging.warning("找不到话费充值") fapiao.get_screenshot("找不到话费充值") raise
def test_XinZengFaPiao(self): # 新增发票 fapiao = mypage.FaPiao(driver) fapiao.XinZeng() fapiao.RiseInput("cddast") fapiao.ShiBieHao("530369868208019") fapiao.MoRen() fapiao.BaoCun() fapiao.close() fapiao.TaiTou() try: assert fapiao.try_find(mypage.FaPiao.danwei_loc) is True logging.info("保存") except: logging.warning("保存失败") fapiao.get_screenshot("保存失败") raise
def teardown(self): # 每个用例结束返回 fapiao = mypage.FaPiao(driver) time.sleep(5) fapiao.back() logging.info("返回成功")