def test_002(self): # 未登录数值是否正确 card = shouyepage.Card(driver) try: assert card.try_find(shouyepage.Card.jine_loc) is True logging.info('码表未登录数值') except: logging.error("码表未登录数值不正确") card.get_screenshot("未登录数值不正确") raise
def test_001(self): # 未登录提示语是否正确 card = shouyepage.Card(driver) try: assert card.try_find(shouyepage.Card.tishi_loc) is True logging.info('卡片码表登录提示') except: logging.error("码表无未登录提示语") card.get_screenshot("无未登录提示语") raise
def test_014(self): # 话费余额是否有可用余额 card = shouyepage.Card(driver) card.huafei() try: assert card.try_find(shouyepage.Card.keyong_loc) is True logging.info('话费余额有可用余额') except: logging.error("话费余额无可用余额") card.get_screenshot("话费余额无可用余额") raise
def test_013(self): # 话费余额跳转是否正确 card = shouyepage.Card(driver) card.huafei() try: assert card.try_find(shouyepage.Card.yue_loc) is True logging.info('跳转话费余额') except: logging.error("话费余额跳转错误") card.get_screenshot("话费余额跳转错误") raise
def test_011(self): # 语音查询页面分享 card = shouyepage.Card(driver) card.yuyin() try: assert card.try_find(shouyepage.Card.fenxiang_loc) is True logging.info('语音页面分享') except: logging.error("语音页面无分享") card.get_screenshot("语音页面无分享") raise
def test_010(self): # 语音剩余跳转是否正确 card = shouyepage.Card(driver) card.yuyin() try: assert card.try_find(shouyepage.Card.shengyu_loc) is True logging.info('语音跳转语音查询') except: logging.error("语音剩余跳转错误") card.get_screenshot("语音剩余跳转错误") raise
def test_009(self): # 流量剩余跳转是否正确 card = shouyepage.Card(driver) card.liuliang() try: assert card.try_text(shouyepage.Shouye.title_loc) == "流量查询" logging.info('跳转流量查询') except: logging.error("流量剩余跳转错误") card.get_screenshot("流量剩余跳转错误") raise
def test_003(self): # 未登录拉起登录是否正确 card = shouyepage.Card(driver) card.look() login = loginpage.Login(driver) try: assert login.try_text(loginpage.Login.title_loc) == "欢迎登录" logging.info('跳转登录页面') except: logging.error("拉起登录错误") login.get_screenshot("拉起登录错误") raise finally: login.close()
def test_015(self): # 话费去充值 card = shouyepage.Card(driver) card.huafei() card.gopay() try: assert card.try_find(shouyepage.Recharge.content2_loc) is True logging.info('去充值跳转') except: logging.error("去充值跳转错误") card.get_screenshot("去充值跳转错误") raise finally: card.back()
def test_008(self): # 未登录是否可登录 card = shouyepage.Card(driver) card.look() login = loginpage.Login(driver) login.login('13715307043') card = shouyepage.Shouye(driver) card.close_c() try: assert card.try_find(shouyepage.Card.tishi_loc) is False logging.info('登录成功') except: logging.error("登录失败") card.get_screenshot("登录失败") raise
def teardown(self): # 每个用例结束返回 card = shouyepage.Card(driver) card.back()