def test_flowCommodity(self): # 是否存在商品订单 guan_jia = mypage.GuanJia(driver) guan_jia.flowCommodity() logging.info('-------进入商品订单----------') try: assert guan_jia.try_find(mypage.GuanJia.mailList_loc) is True logging.info('商品订单正常') except: logging.warning("商品订单不正常") guan_jia.get_screenshot("商品订单不正常") raise finally: guan_jia.back()
def test_dayFlow(self): # 是否存在流量日包 guan_jia = mypage.GuanJia(driver) guan_jia.swipe_up() guan_jia.dayFlow() try: assert guan_jia.try_find(mypage.GuanJia.fiow_pan_loc) is True logging.info('无法进入流量日包') except: logging.warning("无法进入流量日包") guan_jia.get_screenshot("无法进入流量日包") raise finally: guan_jia.back()
def test_flowOrder(self): # 是否存在流量订单 guan_jia = mypage.GuanJia(driver) guan_jia.flowOrder() logging.info('-------进入流量订单----------') try: assert guan_jia.try_find(mypage.GuanJia.recharge_pan_loc) is True logging.info('流量订单正常') except: logging.warning("流量订单不正常") guan_jia.get_screenshot("流量订单不正常") raise finally: guan_jia.back()
def test_xiangDan(self): # 是否存在流量详单 guan_jia = mypage.GuanJia(driver) guan_jia.xiangDan() logging.info("进入流量详单") try: assert guan_jia.try_find(mypage.GuanJia.xiangDan_pan_loc) is True logging.info('流量详单正常') except: logging.warning("流量详单不正常") guan_jia.get_screenshot("流量详单不正常") raise finally: guan_jia.xiangDanBack() logging.info("返回到我的页面")
def test_seasonFlow(self): # 是否存在流量季包 guan_jia = mypage.GuanJia(driver) guan_jia.swipe_up() logging.info("向上滑动") guan_jia.seasonFlow() logging.info("点击流量季包") try: assert guan_jia.try_find(mypage.GuanJia.fiow_pan_loc) is True logging.info('进入季包') except: logging.warning("无法进入季包") guan_jia.get_screenshot("无法进入季包") raise finally: guan_jia.back()
def teardown(self): # 每次返回一次 guan_jia = mypage.GuanJia(driver) guan_jia.back() # logging.info("返回") logging.info('-------返回----------')
def setup(self): guan_jia = mypage.GuanJia(driver) guan_jia.guanJia() # logging.info("进入流量管家") logging.info('-------进入流量管家----------')