From 265838b36bf0f74a928d3424bb367882074294a4 Mon Sep 17 00:00:00 2001 From: naomi Date: Fri, 4 Feb 2022 07:39:10 +0200 Subject: [PATCH] Fixed pdf labels test Squashed commit of the following: commit 5a5ce83065be076623259c21ad4b6a7902236809 Author: naomi Date: Fri Feb 4 07:38:59 2022 +0200 mob next [ci-skip] [ci skip] [skip ci] --- civicrm_tester/base.py | 6 ++++-- civicrm_tester/test_steeringcommittee_print_labels.py | 2 +- main.py | 4 ++-- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/civicrm_tester/base.py b/civicrm_tester/base.py index 928b34f..95e7f16 100644 --- a/civicrm_tester/base.py +++ b/civicrm_tester/base.py @@ -10,6 +10,7 @@ from selenium import webdriver from selenium.webdriver.common.by import By from selenium.webdriver.support import expected_conditions as EC from selenium.webdriver.support.ui import WebDriverWait +from selenium.webdriver.common.action_chains import ActionChains from typing import Tuple, List @@ -192,8 +193,9 @@ class SearchExportTester(BaseTester): self.find_element_by_id(self.contact_selectall_id).click() self.find_element_by_id(self.contact_dropdown_id).click() self.wait_until_visible((By.XPATH, self.get_actions_dropdown_option_selector(option_label))) - contact_export_option = self.find_element(By.XPATH, self.get_actions_dropdown_option_selector(option_label)) - contact_export_option.click() + option = self.find_element(By.XPATH, self.get_actions_dropdown_option_selector(option_label)) + ActionChains(self.browser).move_to_element(option).perform() + option.click() def download_export(self, data: dict) -> requests.Response: """ diff --git a/civicrm_tester/test_steeringcommittee_print_labels.py b/civicrm_tester/test_steeringcommittee_print_labels.py index 0790d2a..5a463ec 100644 --- a/civicrm_tester/test_steeringcommittee_print_labels.py +++ b/civicrm_tester/test_steeringcommittee_print_labels.py @@ -33,7 +33,7 @@ class TestSteeringCommitteePrintLabels(SearchExportTester): self._wait_for_search_to_load() result_no = self._get_contact_search_number() self.debug("exporting results using the magic dropdown") - self._select_option_from_magic_dropdown(self.mail_label_option) + self._select_option_from_magic_dropdown_label("Mailing labels - print") # By omitting the field, we are effectively disabling the do not mail filter data = { "_qf_default": "Label:submit", diff --git a/main.py b/main.py index d1738e3..b23d88b 100644 --- a/main.py +++ b/main.py @@ -32,8 +32,8 @@ if __name__ == "__main__": arguments.user, arguments.passwd, arguments.dev, arguments.show_browser ) #TestActivitiesTab(*cl_arg).test_all_hardcoded_contacts() - TestContactExport(*cl_arg).test_hardcoded_search_terms() - #TestSteeringCommitteePrintLabels(*cl_arg).test() + #TestContactExport(*cl_arg).test_hardcoded_search_terms() + TestSteeringCommitteePrintLabels(*cl_arg).test() # Mailing list # Load mailing list test and enter test data