diff --git a/civicrm_tester/base.py b/civicrm_tester/base.py index f27c3ac..57b26a3 100644 --- a/civicrm_tester/base.py +++ b/civicrm_tester/base.py @@ -117,7 +117,7 @@ class BaseTester: def _test(self, *args): """Placeholder to be overwritten by overloading classes""" - def _test_all(self, test_strings: tuple[str]): + def _test_all(self, test_strings: tuple[str, str, str]): """Loops testing over the given terms""" try: self.login() @@ -151,7 +151,7 @@ class SearchExportTester(BaseTester): self.contact_selectall_id = "CIVICRM_QFID_ts_all_4" self.contact_dropdown_id = "select2-chosen-4" - def _get_export_id(self) -> str: + def _get_export_id(self) -> list[str]: """Parses url to get the param used to ID what search we are currently doing""" export_page_url = self.browser.current_url parsed = urlparse.urlparse(export_page_url) diff --git a/civicrm_tester/activities_tab.py b/civicrm_tester/test_activities_tab.py similarity index 97% rename from civicrm_tester/activities_tab.py rename to civicrm_tester/test_activities_tab.py index 4ef4357..cefe2a6 100644 --- a/civicrm_tester/activities_tab.py +++ b/civicrm_tester/test_activities_tab.py @@ -4,7 +4,7 @@ from selenium.webdriver.support.select import Select from .base import BaseTester -class ActivitiesTab(BaseTester): +class TestActivitiesTab(BaseTester): def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) self.title("Activities Tab") @@ -65,4 +65,4 @@ class ActivitiesTab(BaseTester): cid_na = "42269" # Nigel Addams #cid_db = "43193" Use to test 100 max limit cid_tuple = (cid_da, cid_kh, cid_na) - self._test_all(cid_tuple) + self._test_all(cid_tuple) \ No newline at end of file diff --git a/civicrm_tester/contact_export.py b/civicrm_tester/test_contact_export.py similarity index 98% rename from civicrm_tester/contact_export.py rename to civicrm_tester/test_contact_export.py index 94c814c..89c7ec1 100644 --- a/civicrm_tester/contact_export.py +++ b/civicrm_tester/test_contact_export.py @@ -6,7 +6,7 @@ from selenium.webdriver.common.keys import Keys from .base import SearchExportTester -class ContactExport(SearchExportTester): +class TestContactExport(SearchExportTester): """Tests if exporting contacts from a search returns a CSV file with all contacts.""" def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) diff --git a/civicrm_tester/steeringcommittee_print_labels.py b/civicrm_tester/test_steeringcommittee_print_labels.py similarity index 97% rename from civicrm_tester/steeringcommittee_print_labels.py rename to civicrm_tester/test_steeringcommittee_print_labels.py index 73421ba..0790d2a 100644 --- a/civicrm_tester/steeringcommittee_print_labels.py +++ b/civicrm_tester/test_steeringcommittee_print_labels.py @@ -6,7 +6,7 @@ from selenium.webdriver.common.keys import Keys from .base import SearchExportTester -class SteeringCommitteePrintLabels(SearchExportTester): +class TestSteeringCommitteePrintLabels(SearchExportTester): """Tests the pdf labels for the SteeringCommitee show all contacts names""" def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) diff --git a/main.py b/main.py index c010097..c1c0a43 100644 --- a/main.py +++ b/main.py @@ -1,9 +1,8 @@ import argparse -from civicrm_tester.activities_tab import ActivitiesTab -from civicrm_tester.contact_export import ContactExport -from civicrm_tester.steeringcommittee_print_labels import \ - SteeringCommitteePrintLabels +from civicrm_tester.test_activities_tab import TestActivitiesTab +from civicrm_tester.test_contact_export import TestContactExport +from civicrm_tester.test_steeringcommittee_print_labels import TestSteeringCommitteePrintLabels if __name__ == "__main__": parser = argparse.ArgumentParser(description="") @@ -32,9 +31,9 @@ if __name__ == "__main__": cl_arg = ( arguments.user, arguments.passwd, arguments.dev, arguments.show_browser ) - ActivitiesTab(*cl_arg).test_all_hardcoded_contacts() - ContactExport(*cl_arg).test_hardcoded_search_terms() - SteeringCommitteePrintLabels(*cl_arg).test() + TestActivitiesTab(*cl_arg).test_all_hardcoded_contacts() + TestContactExport(*cl_arg).test_hardcoded_search_terms() + TestSteeringCommitteePrintLabels(*cl_arg).test() # Mailing list # Load mailing list test and enter test data