def test_login_password_10(self): BasePage(driver).click_element(loc_l.loginWechatLocator_Quxiao, '登录页-第三方-退出微信第三方') BasePage(driver).click_element(loc_l.loginWeiBoLocator, '登录页-选择第三方登录-微博') assert BasePage(driver).get_element_text(loc_l.loginWeiBoLocator_jg, '登录页-选择第三方登录-QQ') == "微博登录"
def test_login_password_07(self, user, password): BasePage(driver).input_element(user, loc_l.userLocator, "登录页-输入账号") BasePage(driver).input_element(password, loc_l.passwordLocator, '登录页-密码为空') BasePage(driver).click_element(loc_l.loginButtonLocator, "登录页-点击登录") assert BasePage(driver).get_element_toast( loc_l.passwordNoneLocator, "登录页-输入账号,密码为空不能登录") == "请输入密码"
def test_login_password_09(self): BasePage(driver).click_element(loc_l.loginQQLocator_Quxiao, '登录页-第三方-退出微信第三方') BasePage(driver).click_element(loc_l.loginWechatLocator, '登录页-选择第三方登录-微信') assert BasePage(driver).get_element_text(loc_l.loginWechatLocator_jg, '登录页-选择第三方登录-微信') == "绑定手机号"
def test_login_password_06(self, user, password): BasePage(driver).input_element(user, loc_l.userLocator, "登录页-账号/密码错误不能登录-输入账号") BasePage(driver).input_element(password, loc_l.passwordLocator, "登录页-账号/密码错误不能登录-输入账号") BasePage(driver).click_element(loc_l.loginButtonLocator, "登录页-点击登录") assert BasePage(driver).get_element_toast( loc_l.userNoneLocator, "登录页-账号/密码错误不能登录toast") == "请输入手机号"
def test_login_sucess(self, user, password): BasePage(driver).input_element(user, loc_l.userLocator, "登录页-输入账号") BasePage(driver).input_element(password, loc_l.passwordLocator, "登录页-输入密码") BasePage(driver).click_element(loc_l.loginButtonLocator, "登录页-点击登录") # 5,断言获取用户名和预期结果是否相同 assert BasePage(driver).get_element_text(loc_m.userTextLocator, "我的页面-获取登录用户名") == "ZYSLL"
def login(): # 1,进入首页 BasePage(driver).click_element(loc_h.downXinRenLocator, "首页—关闭新人福利") BasePage(driver).click_element(loc_h.tongYiLocator, "首页-同意协议") BasePage(driver).click_element(loc_h.tongYiQuanXianLocator, "首页-同意电话权限") BasePage(driver).click_element(loc_h.tongYiQuanXianLocator, "首页-同意存储权限") # 2,进入我的页面 BasePage(driver).click_element(loc_h.myLocator, "首页-点击我的") # 3,进入登录页面 BasePage(driver).click_element(loc_m.loginLocator, "我的页面—点击立即登录") yield driver.close_app()
def test_login_password_04(self): BasePage(driver).input_element('1234abc@#', loc_l.passwordLocator, "登录页-密码框输入字母,特殊字符,数字") assert BasePage(driver).get_element_text(loc_l.passwordLocator, "登录页-密码框输入汉字") == "•••••••••"
def test_login_password_03(self): BasePage(driver).input_element('中国', loc_l.passwordLocator, "登录页-密码框输入汉字") assert BasePage(driver).get_element_text(loc_l.passwordLocator, "登录页-密码框输入汉字") == "请输入密码"
def test_login_user_02(self, jg, user): BasePage(driver).input_element(user, loc_l.userLocator, f"登录页-输入数字账号为: {user}") assert BasePage(driver).get_element_text(loc_l.userLocator, "登录页-账号输入框能输入数字") == jg
def test_login_user_01(self, title, user): BasePage(driver).input_element(user, loc_l.userLocator, f"登录页-输入 {title}") # 断言输入框输不进去汉字,默认字符是 请输入手机号 assert BasePage(driver).get_element_toast( loc_l.userLocator, "登录页-输入汉字,英文,特殊字符") == "请输入手机号"
def test_login_password_11(self): BasePage(driver).click_element(loc_l.loginWeiBoLocator_Quxiao, '登录页-第三方-退出微博第三方')
def test_login_password_08(self): BasePage(driver).click_element(loc_l.loginQQLocator, '登录页-选择第三方登录-QQ') # 543 1453 assert BasePage(driver).get_element_text(loc_l.loginQQLocator_jg, '登录页-选择第三方登录-QQ') == "QQ授权登录"