class TestProfile: def setup(self): self.xueqiu = XueqiuPage() # 用户名错误 def test_login_wrong_phone(self): assert "用户名或密码错误" in self.xueqiu.goto_profile().phone_login().phone_password().import_phone_and_password( "18292045414", "aiba1234").login_click() # 密码错误 def test_login_wrong_password(self): assert "用户名或密码错误" in self.xueqiu.goto_profile().phone_login().phone_password().import_phone_and_password( "18292045410", "aiba1234").login_click()
class TestProfile: def setup(self): self.xueqiu = XueqiuPage() self.profile = self.xueqiu.goto_profile() def test_login_by_phone(self): source = self.profile.login_by_phone("15600534761", "1234").get_msg() print(source) assert '验证码已过期' in source def test_login_by_wechat(self): self.profile.login_by_wechat() print(self.profile.get_toast()) assert "请先安装微信" in self.profile.get_toast() def test_login_by_weibo(self): self.fail() def test_login_by_qq(self): self.fail()
class TestProfile(): def setup(self): self.xueqiu = XueqiuPage() self.profile = self.xueqiu.goto_profile() #手机登录 def test_login_by_phone(self): assert "验证码已过期" in self.profile.login_by_phone("15901273161", "1234").get_tips() #微信登录 def test_login_by_wechat(self): self.profile.login_by_wechat() assert "请先安装微信" in self.profile.get_toast() #微博登录 def test_login_by_weigo(self): self.fail() #QQ登录 def test_login_by_qq(self): self.fail()