def open_admin_page(self): """ Open admin page panel.""" self.driver.get(PathUrl().ADMIN_PAGE) WebDriverWait(self.driver, TIME_TO_WAIT) \ .until(EC.visibility_of_element_located(AdminPageLocators. BUTTON_ESCAPE)) return AdminPage(self.driver)
def setUpClass(cls): """ Create 8 users for tests.""" cls.driver = webdriver.Chrome( executable_path=GetDriver().CHROME_DRIVER) cls.driver.get(PathUrl().SITE_URL) cls.login_page = LogInPage(cls.driver) cls.login_page.set_login_field_text(first_admin.login) cls.login_page.set_password_field_text(first_admin.password) cls.group_page = cls.login_page.click_submit_button() cls.group_page.open_admin_page() create_8_users_for_tests(cls.driver) cls.driver.quit()
def setUpClass(cls): """ Create group to delete in 25th test.""" driver = webdriver.Chrome( executable_path=GetDriver().CHROME_DRIVER) driver.get(PathUrl().SITE_URL) driver.maximize_window() login_page = LogInPage(driver) group_page = login_page.auto_login(first_admin) left_menu = group_page.open_left_menu() left_menu.create_group_button().click() group_page.CreateGroupWindow().auto_fill_all_fields( group_to_delete_name, first_admin.location, TEST_DIRECTION) driver.quit()
def setUpClass(cls, user=""): """ Log in as specified user, open top menu,select button 'students' and select specified group.""" cls.driver = webdriver.Chrome( executable_path=GetDriver().CHROME_DRIVER) cls.driver.get(PathUrl().SITE_URL) cls.driver.maximize_window() cls.login_page = LogInPage(cls.driver) cls.login_page.auto_login(user) cls.main_page = GroupsPage(cls.driver) cls.top_menu = cls.main_page.open_top_menu() cls.top_menu.click_students_button() cls.main_page.select_group_by_name(data['group_name']) cls.students_page = StudentsPage(cls.driver)
def setUp(self): self.driver = webdriver.Chrome( executable_path=GetDriver().DRIVER_CHROME) self.login_page = LogInPage(self.driver) self.login_page.get(PathUrl().URL_SITE)