def test_table_sort(self): driver = self.driver sleep(1) driver.find_element_by_id("menu_pim_viewPimModule").click() driver.find_element_by_xpath("//th[3]/a").click() self.wait.until( EC.presence_of_element_located( (By.XPATH, "//th[3]/a[@class='ASC']"))) previous_name = '' while True: all_name_elements = driver.find_elements_by_xpath("//td[3]/a") for name_element in all_name_elements: current_name = name_element.text self.assertGreaterEqual(current_name, previous_name) previous_name = current_name if not is_element_present( driver, By.CSS_SELECTOR, "#frmList_ohrmListComponent > div.top > ul > li.desc"): break paging = driver.find_element_by_css_selector( ".paging.top .desc").text paging_parts = paging.split(' of ') if paging_parts[-1] in paging_parts[0]: break driver.find_element_by_css_selector(".paging.top .next a").click()
def test_create_and_remove_report(self): driver = self.driver report_name = ("rep" + str(randint(1, 3))) self.wait = WebDriverWait(driver, 2) login(driver) # click on the report tab driver.find_element_by_id("menu_pim_viewPimModule").click() driver.find_element_by_id("menu_core_viewDefinedPredefinedReports").click() # click on the Add button driver.find_element_by_css_selector('input[value="Add"]').click() # enter unique Report name self.wait.until( EC.presence_of_element_located((By.ID, "report_report_name"))).send_keys(report_name) # select Criteria = Job Title Select(driver.find_element_by_id("report_criteria_list")).select_by_visible_text("Job Title") driver.find_element_by_id("btnAddConstraint").click() # select display field group = Personal Select(driver.find_element_by_id("report_display_groups")).select_by_visible_text("Personal") driver.find_element_by_id("btnAddDisplayGroup").click() # make sure to check the checkbox and save self.wait.until(EC.visibility_of_element_located((By.ID, 'display_group_1'))).click() driver.find_element_by_id("btnSave").click() # verify that report was created self.assertTrue(is_element_present(driver, By.XPATH, "//td[text()='{0}']/../td[3]/a".format(report_name))) # report was created self.report_name = report_name # run the report driver.find_element_by_xpath("//td[text()='{0}']/../td[3]/a".format(report_name)).click() # verify the report report_header = self.wait.until(EC.presence_of_element_located((By.CSS_SELECTOR, '.head h1'))).text self.assertEqual('Report Name : {0}'.format(report_name), report_header)
def test_create_report(self): report_name = 'EY Report #' + str(random.randint(1, 100)) # self.login_page.login() # is part of super().setUp() self.pim.goto_reports() self.reports.add() self.new_report.set_name(report_name) self.new_report.select_selection_criteria("Job Title") self.new_report.select_display_field_groups("Personal") self.new_report.enable_display_fields() self.new_report.save() self.report_name = report_name # just an example of using a locator inside a page object module print RL["search_button"][0], RL["search_button"][1] button_label = self.driver.find_element(RL["search_button"][0], RL["search_button"][1]).get_attribute('value') self.assertEqual('Search', button_label) ################# self.reports.search(report_name) self.assertTrue(is_element_present(self.driver, By.XPATH, "//td[text()='{0}']".format(report_name))) self.reports.run(report_name) report_header = self.report_run.get_report_header() self.assertEqual('Report Name : {0}'.format(report_name), report_header)
def test_create_report(self): report_name = 'EY Report #' + str(random.randint(1, 100)) driver = self.driver login(driver) # go to the reports tab driver.find_element_by_id("menu_pim_viewPimModule").click() driver.find_element_by_id( "menu_core_viewDefinedPredefinedReports").click() # click on the Add button # Enter unique Report Name driver.find_element_by_id("btnAdd").click() self.wait.until( EC.presence_of_element_located( (By.ID, "report_report_name"))).send_keys(report_name) # Select Criteria = Job Title Select(driver.find_element_by_id( "report_criteria_list")).select_by_visible_text("Job Title") driver.find_element_by_id("btnAddConstraint").click() # Select Display Fields Group = Personal Select(driver.find_element_by_id( "report_display_groups")).select_by_visible_text("Personal") driver.find_element_by_id("btnAddDisplayGroup").click() # make sure to check the checkbox and Save driver.find_element_by_id("display_group_1").click() driver.find_element_by_id("btnSave").click() # verify the report was created self.assertTrue( is_element_present(driver, By.XPATH, "//td[text()='{0}']".format(report_name))) # yes a report was created and will require cleanup self.report_name = report_name # Run the report driver.find_element_by_xpath( "//td[text()='{0}']/../td[3]/a".format(report_name)).click() # verify the report works report_header = self.wait.until( EC.presence_of_element_located((By.CSS_SELECTOR, '.head h1'))).text self.assertEqual('Report Name : {0}'.format(report_name), report_header)
def test_create_report(self): report_name = "Rprt" + str(randint(1, 99)) self.reports.goto_page() self.reports.add() self.new_report.set_name(report_name) self.new_report.select_selection_criteria("Job Title") self.new_report.select_display_field_groups("Personal") self.new_report.enable_display_fields() self.new_report.save() self.report_name = report_name self.reports.search(report_name) self.assertTrue( is_element_present(self.driver, By.XPATH, "//td[text()='{0}']".format(report_name))) self.reports.run(report_name) report_header = self.report_run.get_report_header() self.assertEqual('Report Name : {0}'.format(report_name), report_header) print('Report Name : {0}'.format(report_name), report_header)