class MenuAttendancePage(MenuMasterPage): def __init__(self, driver): self.driver = driver self.menu = menu['attendance'] self.main = self.driver.find_element(*self.fill_tuple( MenuAttendancePageLocators.main, self.menu['main'])) self.waiter = Waiter(self.driver, locator=self.fill_tuple( MenuAttendancePageLocators.main, self.menu['main'])) def __call__(self): self.__init__(self.driver) return self def start(self): self.main.click() self.waiter.wait_attribute_to_be_open() def click_link_plan(self): self.start() self.main.find_element( *self.fill_tuple(MenuAttendancePageLocators.link_plan, self.menu['plan']['link'])).click() super().verify_page(self.driver, self.menu['plan']) def click_link_closing(self): self.start() self.main.find_element( *self.fill_tuple(MenuAttendancePageLocators.link_closing, self.menu['closing']['link'])).click() super().verify_page(self.driver, self.menu['closing'])
class SearchPage: def __init__(self, driver): self.driver = driver self.button_show_search_form = self.driver.find_element(*SearchPageLocators.button_show_search_form) self.field_search = self.driver.find_element(*SearchPageLocators.field_search) self.button_search = self.driver.find_element(*SearchPageLocators.button_search) self.waiter = Waiter(self.driver, locator=SearchPageLocators.wrap) def __call__(self): self.radio_scope_users = self.driver.find_element(*SearchPageLocators.radio_scope_users) def fill_field_search(self, value): time.sleep(0.5) self.field_search.clear() self.field_search.send_keys(value) def find_user(self, value): self.__call__() self.button_show_search_form.click() self.waiter.wait_attribute_to_be_open() self.radio_scope_users.click() self.fill_field_search(value) self.button_search.click() def find_user_basic(self, value): self.button_show_search_form.click() self.waiter.wait_attribute_to_be_open() self.fill_field_search(value) self.button_search.click()
class MenuEmployeesPage(MenuMasterPage): def __init__(self, driver): self.driver = driver self.menu = menu['employees'] self.main = self.driver.find_element(*self.fill_tuple( MenuEmployeesPageLocators.main, self.menu['main'])) self.waiter = Waiter(self.driver, locator=self.fill_tuple( MenuEmployeesPageLocators.main, self.menu['main'])) def __call__(self): self.__init__(self.driver) return self def start(self): self.main.click() self.waiter.wait_attribute_to_be_open() def click_link_employees(self): self.start() self.main.find_element( *self.fill_tuple(MenuEmployeesPageLocators.link_employees, self.menu['employees']['link'])).click() super().verify_page(self.driver, self.menu['employees']) def click_link_document_definitions(self): self.start() self.main.find_element(*self.fill_tuple( MenuEmployeesPageLocators.link_document_definitions, self.menu['documentDefinition']['link'])).click() super().verify_page(self.driver, self.menu['documentDefinition']) def click_link_changes(self): self.start() self.main.find_element( *self.fill_tuple(MenuEmployeesPageLocators.link_changes, self.menu['changes']['link'])).click() super().verify_page(self.driver, self.menu['changes']) def click_link_changes_new(self): self.start() self.main.find_element( *self.fill_tuple(MenuEmployeesPageLocators.link_changes_new, self.menu['changesNew']['link'])).click() super().verify_page(self.driver, self.menu['changesNew']) def click_link_documents_overview(self): self.start() self.main.find_element( *self.fill_tuple(MenuEmployeesPageLocators.link_documents_overview, self.menu['documentOverview']['link'])).click() super().verify_page(self.driver, self.menu['documentOverview'])
class MenuSystemPage(MenuMasterPage): def __init__(self, driver): self.driver = driver self.menu = menu['system'] self.waiter = Waiter(self.driver, locator=self.fill_tuple( MenuSystemPageLocators.main, self.menu['main'])) self.main = self.driver.find_element( *self.fill_tuple(MenuSystemPageLocators.main, self.menu['main'])) def __call__(self): self.__init__(self.driver) return self def start(self): self.main.click() self.waiter.wait_attribute_to_be_open() def click_link_users(self): self.start() self.main.find_element( *self.fill_tuple(MenuSystemPageLocators.link_users, self.menu['users']['link'])).click() super().verify_page(self.driver, self.menu['users']) def click_link_roles(self): self.start() self.main.find_element( *self.fill_tuple(MenuSystemPageLocators.link_roles, self.menu['roles']['link'])).click() super().verify_page(self.driver, self.menu['roles']) def click_link_companies(self): self.start() self.main.find_element( *self.fill_tuple(MenuSystemPageLocators.link_companies, self.menu['companies']['link'])).click() super().verify_page(self.driver, self.menu['companies']) def click_link_system_settings(self): self.start() self.main.find_element( *self.fill_tuple(MenuSystemPageLocators.link_system_settings, self.menu['systemSettings']['link'])).click() super().verify_page(self.driver, self.menu['systemSettings']) def click_link_licence(self): self.start() self.main.find_element( *self.fill_tuple(MenuSystemPageLocators.link_licence, self.menu['licence']['link'])).click() super().verify_page(self.driver, self.menu['licence'])