#coding=utf-8
from page.login_page import LoginPage
class LoginHandle():
def __init__(self,driver):
self.login_p = LoginPage(driver)
#输入邮箱
def send_user_email(self,email):
self.login_p.get_email_element().send_keys(email)
#输入用户名
def send_user_name(self,username):
self.login_p.get_username_element().send_keys(username)
#输入密码
def send_user_password(self,password):
self.login_p.get_password_element().send_keys(password)
#点击注册按钮
def click_login_button(self):
self.login_p.get_login_button().click()
#输入验证码
def send_user_code(self,code):
self.login_p.get_user_text(code)
#获取文字信息
def get_user_text(self,info,user_info):
if info == "email_error":
text = self.login_p.get_email_error_element().get_attribute("value")
elif info == "name_error":
text = self.login_p.get_name_error_element().get_attribute("value")
elif info == "password_error":
text = self.login_p.get_password_error_element().get_attribute("value")
else:
text = self.login_p.get_code_error_element().get_attribute("value")
return text
login_handle
最新推荐文章于 2023-09-12 14:23:33 发布