def accreditation_user(self, value, solution=1): LoginPage(self.driver).login(value) self.prepare_docs_for_accreditation(value) LoginPage(self.driver).logout() LoginPage(self.driver).login(Members().ADMIN_ETP) self.accept_register_contragents(value) self.search_new_accreditation_company(value) self.confirm_registration(value, solution) LoginPage(self.driver).logout()
def registration_page(self, value): LoginPage(self.driver).registration() self.choose_resident_status(value) self.fill_user_info(value) self.choose_role_in_system(value["role"]) self.fill_organizator_info(value) LoginPage(self.driver).logout() LoginPage(self.driver).login(Members().ADMIN_ETP) MainPage(self.driver).admin_confirm_email_new_user(value["user_mail"]) self.button('Закрыть').click() LoginPage(self.driver).logout()
def setup(self, browser): self.link = "http://selenium1py.pythonanywhere.com/catalogue/coders-at-work_207/" self.browser = browser email = str(time.time()) + "@fakemail.org" password = str(time.time()) page_login = LoginPage( browser, "http://selenium1py.pythonanywhere.com/accounts/login/") page_login.open() page_login.register_new_user(email, password)
def get_login_page(cls): """登录""" return LoginPage()
def __init__(self, driver, section): self.login_page = LoginPage(driver, section)
def test_reg_form(browser): page = LoginPage(browser, loginLink) page.open() page.should_be_register_form()
def test_login_form(browser): page = LoginPage(browser, loginLink) page.open() page.should_be_login_form()
def test_login_link(browser): page = LoginPage(browser, sLink) page.open() page.should_be_login_url()
def test_guest_can_go_to_login_page(browser): page = MainPage(browser, sLink) page.open() page.go_to_login_page() login_page = LoginPage(browser, browser.current_url) login_page.should_be_login_page()
def get_login_page(self): """返回登录页面对象""" return LoginPage(self.driver)
def setup_class(self): self.login_page = LoginPage(get_driver())