def test_login_user_pawd_null(self): '''用户名、密码为空登录''' po = LoginPage(self.driver) po.open() po.login_action("", "") sleep(2) self.assertEqual(po.login_error_hint(), '请输入帐号')
def test_login_pawd_null(self): '''密码为空登录''' po = LoginPage(self.driver) po.open() po.login_action("testaaa", "") sleep(2) self.assertEqual(po.login_error_hint(), '请输入密码')
def test_login_pawd_null(self): '''密码为空登录''' po = LoginPage(self.driver) po.open() po.login_action("testaaa","") sleep(2) self.assertEqual(po.login_error_hint(), '登录失败,请检查您的用户名或密码是否填写正确。')
def test_login_success(self): '''用户名、密码正确,登录成功''' po = LoginPage(self.driver) po.open() user = "******" po.login_action(user, "password") sleep(2) po2 = MailPage(self.driver) self.assertEqual(po2.login_success_user(), user + "@163.com")
def test_login_user_pawd_error(self): '''用户名、密码为错误''' po = LoginPage(self.driver) po.open() character = random.choice('zyxwvutsrqponmlkjihgfedcba') username = "******" + character po.login_action(username, "@#$%") sleep(2) self.assertEqual(po.login_error_hint(), '帐号或密码错误')
def test_login_success(self): '''用户名、密码正确,登录成功''' po = LoginPage(self.driver) po.open() user = "******" po.login_action(user,"123456") sleep(2) po2 = homePage(self.driver) self.assertEqual(po2.login_success_user(),'何美建')
def test_login_user_pawd_error(self): '''用户名、密码为错误''' po = LoginPage(self.driver) po.open() character = random.choice('登录失败,请检查您的用户名或密码是否填写正确。') username = "******" + character po.login_action(username,"@#$%") sleep(2) self.assertEqual(po.login_error_hint(), '登录失败,请检查您的用户名或密码是否填写正确。')
def setUp(self): # super(LoginTest, self).setUp() self.driver = AppiumDriver().start_appium('4723', 0) # 如果有系统更新的话,直接取消更新 self.cancle_dialog = CancleDialog(self.driver) self.cancle_dialog.cancle_update() # 用户名密码登陆的实例 self.lp = LoginPage(self.driver) # 三方登陆的实例 self.tp = ThirdLogin(self.driver)
def test_create_post(self): username = '******' password = '******' login_page = LoginPage(self.dr) dashboard_page = login_page.login_success(username, password) post_detail_page = dashboard_page.click_create_new_post() title = content = time.strftime("%Y%m%d%H%M%S") post_detail_page.update_post_title(title) post_detail_page.update_post_content(content) post_detail_page.publish_post() post_page = PostPage(self.dr) post_page.click_all_post() self.assertTrue(title, post_page.first_post().text)
def __init__(self, driver): self.driver = driver self.login_p = LoginPage(self.driver)
def test_login_success(self): username = '******' password = '******' login_page = LoginPage(self.dr) dashboard_page = login_page.login_success(username, password) self.assertTrue("mini2019" in dashboard_page.greeting_link().text)