Compare commits
	
		
			5 Commits
		
	
	
		
			cas_typehi
			...
			98ec8e0e3d
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 98ec8e0e3d | |||
| 104eab4e90 | |||
| 3bd09a9ef4 | |||
| f228527c65 | |||
| b91c04774d | 
@ -36,7 +36,7 @@ class BaseTester:
 | 
			
		||||
        self.user = user
 | 
			
		||||
        self.passwd = passwd
 | 
			
		||||
        if dev:
 | 
			
		||||
            self.base_url = "https://crm.staging.caat.org.uk"
 | 
			
		||||
            self.base_url = "https://crm.dev.caat.org.uk"
 | 
			
		||||
        else:
 | 
			
		||||
            self.base_url = "https://crm.staging.caat.org.uk"
 | 
			
		||||
 | 
			
		||||
@ -128,6 +128,10 @@ class BaseTester:
 | 
			
		||||
            self.logout()
 | 
			
		||||
            self.browser.close()
 | 
			
		||||
 | 
			
		||||
    def find_element(self, *args, **kwargs):
 | 
			
		||||
        """Alias for browser.find_element"""
 | 
			
		||||
        return self.browser.find_element(*args, **kwargs)
 | 
			
		||||
 | 
			
		||||
    def find_element_by_id(self, *args, **kwargs):
 | 
			
		||||
        """Alias for browser.find_element_by_id"""
 | 
			
		||||
        return self.browser.find_element_by_id(*args, **kwargs)
 | 
			
		||||
@ -144,6 +148,10 @@ class BaseTester:
 | 
			
		||||
        """Alias for using inbuilt wait object for wait.until(EC.element_to_be_clickable)"""
 | 
			
		||||
        return self.wait.until(EC.element_to_be_clickable(locator))
 | 
			
		||||
 | 
			
		||||
    def get_tab_selector(self, tabtitle):
 | 
			
		||||
        """Return an XPATH string to the tab labelled `tablabel`."""
 | 
			
		||||
        return "//li/a[@title='{label}']/..".format(label=tabtitle)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
class SearchExportTester(BaseTester):
 | 
			
		||||
    def __init__(self, *args, **kwargs):
 | 
			
		||||
 | 
			
		||||
@ -14,10 +14,10 @@ class TestActivitiesTab(BaseTester):
 | 
			
		||||
    def _test(self, cid: str):
 | 
			
		||||
        self.debug("loading contact page for CID %s" % cid)
 | 
			
		||||
        self.browser.get(self.contact_page.format(cid))
 | 
			
		||||
        self.wait_until_visible((By.ID, "ui-id-10"))
 | 
			
		||||
        self.wait_until_visible((By.XPATH, self.get_tab_selector("Activities")))
 | 
			
		||||
        # Contact page as loaded
 | 
			
		||||
        activities_tab_button = self.find_element_by_id("ui-id-10")
 | 
			
		||||
        num_element = activities_tab_button.find_element_by_tag_name("em")
 | 
			
		||||
        activities_tab_button = self.find_element(By.XPATH, self.get_tab_selector("Activities"))
 | 
			
		||||
        num_element = activities_tab_button.find_element(By.TAG_NAME, "em")
 | 
			
		||||
        num_of_activ = int(num_element.text)
 | 
			
		||||
        activities_tab_button.click()
 | 
			
		||||
        table_row_selector = (
 | 
			
		||||
@ -65,4 +65,4 @@ class TestActivitiesTab(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)
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user