def del_user(self, user): # deletes user self.driver.find_element_by_link_text(user).click() self.get_sett_button.click() self.get_delete_user_button.click() AjaxHelper.suspend(1) self.driver.switch_to_alert().accept()
def change_user_nickname(self, user, nickname): # changes user nickname self.driver.find_element_by_link_text(user).click() self.get_sett_button.click() self.get_edit_user_button.click() self.get_add_users_nickname_field.clear() self.get_add_users_nickname_field.send_keys(nickname) self.get_new_user_save.click() AjaxHelper.suspend(2)
def change_user_empl_code(self, user, empl_code): # change user employee code self.driver.find_element_by_link_text(user).click() self.get_sett_button.click() self.get_edit_user_button.click() self.get_add_users_empl_code_field.clear() self.get_add_users_empl_code_field.send_keys(empl_code) self.get_new_user_save.click() AjaxHelper.suspend(2)
def testDeleteDepartment(self): # login with admin login_with_admin = LoginPage(self.driver) login_with_admin.log_in_with_user('*****@*****.**', 'password') # click Departments link depart = DepartmentsPage(self.driver) depart.click_departments_link() # click Departments settings icon depart.click_settings_icon() # click Delete department depart.click_depart_delete() AjaxHelper.suspend(2) Alert(self.driver).accept() # assert department is deleted depart.refresh() self.assertFalse('Awesome departments_new' in self.driver.page_source)
def go_to_oauth(self): self.get_oauth_link.click() AjaxHelper.suspend(2) from Pages.OAuthPage import OAuthPage return OAuthPage(self.driver)
def go_to_reports(self): self.get_reports_link.click() AjaxHelper.suspend(2) from Pages.ReportsPage import ReportsPage return ReportsPage(self.driver)
def go_to_users(self): self.get_users_link.click() AjaxHelper.suspend(2) from Pages.UsersPage import UsersPage return UsersPage(self.driver)
def go_to_team(self): self.get_team_link.click() AjaxHelper.suspend(2) from Pages.TeamPage import TeamPage return TeamPage(self.driver)
def go_to_depart(self): self.get_dep_link.click() AjaxHelper.suspend(2) from Pages.DepartmentsPage import DepartmentsPage return DepartmentsPage(self.driver)
def refresh(self): self.driver.refresh() AjaxHelper.suspend(2)
def click_edit_link(self): edit_link = DepartmentsPage(self.driver) AjaxHelper.suspend(2) edit_link.click_depart_edit()
def click_settings_icon(self): settings_icon = DepartmentsPage(self.driver) AjaxHelper.suspend(2) settings_icon.click_icon_settings()
def click_save_btn(self): save_depart = DepartmentsPage(self.driver) AjaxHelper.suspend(2) save_depart.click_create_depart_save_btn()