Exemplo n.º 1
0
 def test_contacts(self):  # 判断登录页面有联系人
     login = loginpage.Login(driver)
     login.denglu()
     try:
         assert login.try_find(loginpage.Login.contact_loc) is True
         logging.info("联系人")
     except:
         logging.warning("未找到联系人按钮")
         login.get_screenshot("联系人按钮")
         raise
Exemplo n.º 2
0
 def test_logonbutton(self):  # 我的页面判断有登录按钮
     denglu = loginpage.Login(driver)
     denglu.wode()
     try:
         assert denglu.try_find(loginpage.Login.denglu_loc) is True
         logging.info("登录按钮")
     except:
         logging.warning("未找到登录按钮")
         denglu.get_screenshot("登录按钮")
         raise
Exemplo n.º 3
0
 def test_automaticlogon(self):  # 判断登录页面有自动登录
     login = loginpage.Login(driver)
     login.denglu()
     try:
         assert login.try_find(loginpage.Login.setlogin_loc) is True
         logging.info("自动登录")
     except:
         logging.warning("未找到自动登录按钮")
         login.get_screenshot("自动登录按钮")
         raise
Exemplo n.º 4
0
 def test_verificationcode(self):  # 判断输入账号可以点击验证码
     login = loginpage.Login(driver)
     login.denglu()
     login.zhanghao("13715307043")
     try:
         assert login.try_find(loginpage.Login.captcha_loc) is True
         logging.info("不能输入验证码")
     except:
         logging.warning("不能输入验证码")
         login.get_screenshot("不能输入验证码")
         raise
Exemplo n.º 5
0
 def test_delete(self):  # 判断输入账号有删除按钮
     login = loginpage.Login(driver)
     login.denglu()
     login.zhanghao('13715307043')
     try:
         assert login.try_find(loginpage.Login.delete_button_loc) is True
         logging.info("删除按钮")
     except:
         logging.warning("未找到删除按钮")
         login.get_screenshot("删除按钮")
         raise
Exemplo n.º 6
0
 def test_suslogin(self):  # 判断登录成功
     login = loginpage.Login(driver)
     login.denglu()
     login.login("15012761017")
     try:
         assert login.try_find(loginpage.Login.wode_loc) is True
         logging.info("登录失败")
     except:
         logging.warning("登录失败")
         login.get_screenshot("登录失败")
         raise
Exemplo n.º 7
0
 def test_entercontacts(self):  # 判断进入联系人成功
     login = loginpage.Login(driver)
     login.denglu()
     login.lxr()
     try:
         assert login.try_find(loginpage.Login.search_loc) is True
         login.L_back()
         logging.info("联系人进入")
     except:
         logging.warning("联系人进入")
         login.get_screenshot("联系人进入失败")
         raise
Exemplo n.º 8
0
 def test_006(self):  # 流量详单跳转是否正确
     traffic = shouyepage.Traffic(driver)
     traffic.xiangdan()
     try:
         assert traffic.try_find(shouyepage.Traffic.shenfen_loc) is True
         logging.info('流量详单跳转正确')
     except:
         logging.error("流量详单跳转错误")
         traffic.get_screenshot("流量订单跳转错误")
         raise
     finally:
         traffic = loginpage.Login(driver)
         traffic.close()
Exemplo n.º 9
0
 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()
Exemplo n.º 10
0
 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
Exemplo n.º 11
0
 def teardown(self):  # 每个用例结束返回
     login = loginpage.Login(driver)
     login.close()
Exemplo n.º 12
0
        try:
            assert chajian.try_find(mypage.ChaJian.pan_chajian_loc) is True
            logging.info('进入插件中心正常')
        except:
            logging.warning("进入插件中心不正常")
            chajian.get_screenshot("进入插件中心不正常")
            raise

    def test_FenXiang(self):  # 是否成功进入分享页面
        chajian = mypage.ChaJian(driver)
        chajian.FenXiang()
        try:
            assert chajian.try_find(mypage.ChaJian.pan_fenxiang_loc) is True
            logging.info('进入分享正常')
        except:
            logging.warning("进入分享不正常")
            chajian.get_screenshot("进入分享不正常")
            raise
        finally:
            chajian.QuXiao()


if __name__ == '__main__':
    #    driver = appium_desired()
    driver = appium_desired('emulator-5554', 4723)
    ba = loginpage.Login(driver)
    #    ba.start()
    ba.login('13501585305')
    wodea = mypage.My(driver)
    wodea.wode()
Exemplo n.º 13
0
def setup_module():  # 整个.py模块启动一次客户端
    base = loginpage.Login(driver)
    base.start()
    base = shouyepage.Shouye(driver)
    base.check_guide_know()