wcp-library 1.3.6__py3-none-any.whl → 1.3.7__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -65,24 +65,44 @@ class SeleniumHelper:
65
65
  if b.text == text:
66
66
  return b
67
67
 
68
- def wait_until_element_visible(self, css_element: str, timeout: int = 30) -> None:
68
+ def wait_until_element_visible(self, css_element: Optional[str] = None, link_text: Optional[str] = None,
69
+ timeout: int = 30) -> None:
69
70
  """
70
71
  Wait until an element is visible
71
72
 
73
+ Must pass one of: css_element or link_text
74
+
72
75
  :param css_element:
76
+ :param link_text:
73
77
  :param timeout:
74
78
  :return:
75
79
  """
76
80
 
77
- WebDriverWait(self.driver, timeout).until(expected_conditions.presence_of_element_located((By.CSS_SELECTOR, css_element)))
81
+ if not css_element and not link_text:
82
+ raise ValueError("Must pass one of: css_element or link_text")
83
+
84
+ if css_element:
85
+ WebDriverWait(self.driver, timeout).until(expected_conditions.presence_of_element_located((By.CSS_SELECTOR, css_element)))
86
+ elif link_text:
87
+ WebDriverWait(self.driver, timeout).until(expected_conditions.presence_of_element_located((By.LINK_TEXT, link_text)))
78
88
 
79
- def wait_until_clickable(self, css_element: str, timeout: int = 30) -> None:
89
+ def wait_until_clickable(self, css_element: Optional[str] = None, link_text: Optional[str] = None,
90
+ timeout: int = 30) -> None:
80
91
  """
81
92
  Wait until an element is clickable
82
93
 
94
+ Must pass one of: css_element or link_text
95
+
83
96
  :param css_element:
97
+ :param link_text:
84
98
  :param timeout:
85
99
  :return:
86
100
  """
87
101
 
88
- WebDriverWait(self.driver, timeout).until(expected_conditions.element_to_be_clickable((By.CSS_SELECTOR, css_element)))
102
+ if not css_element and not link_text:
103
+ raise ValueError("Must pass one of: css_element or link_text")
104
+
105
+ if css_element:
106
+ WebDriverWait(self.driver, timeout).until(expected_conditions.element_to_be_clickable((By.CSS_SELECTOR, css_element)))
107
+ elif link_text:
108
+ WebDriverWait(self.driver, timeout).until(expected_conditions.element_to_be_clickable((By.LINK_TEXT, link_text)))
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: wcp-library
3
- Version: 1.3.6
3
+ Version: 1.3.7
4
4
  Summary: Common utilites for internal development at WCP
5
5
  Home-page: https://github.com/Whitecap-DNA/WCP-Library
6
6
  Author: Mitch-Petersen
@@ -13,11 +13,11 @@ wcp_library/ftp/ftp.py,sha256=EpyW0J2QIGxP8zVGD4VarA0hi4C2XAPDPF-0j2sRdpI,4350
13
13
  wcp_library/ftp/sftp.py,sha256=hykXGLGdxe7DYAxFdTwjPjTEOYuIpSMyK3NOiTQNUK0,4176
14
14
  wcp_library/informatica.py,sha256=_g9lzSd-JLsY4e5_g6YcxQtOxP6fkg4sGfvNJaAN7jY,8123
15
15
  wcp_library/logging.py,sha256=e6gG7HFgUrMajUZs4Gs0atFfOJJmdmxN0GerfynNWlY,2061
16
- wcp_library/selenium_helper.py,sha256=2PENUH8bgpyzovbLjP8a4Oyd7c3yOwoyQJt-a8-zq0c,2855
16
+ wcp_library/selenium_helper.py,sha256=w8YUC0pq7TkWiobc2ri4QR5fcHrrZgB5RAEfAdxZiuk,3780
17
17
  wcp_library/sql/__init__.py,sha256=s2psmwkq_ZU23iGWvXjJrLu0hD1fB6CDv6RHcK7y828,1917
18
18
  wcp_library/sql/oracle.py,sha256=TGiTC5L5UcM5QcHFajgn43NI8HygOGIEAtLmLbVFp2I,15772
19
19
  wcp_library/sql/postgres.py,sha256=GElSjLDworrRlzA7DLrbcQlW7BqvhgMbvW89v-yZejk,14533
20
20
  wcp_library/time.py,sha256=ktSzhK7SZnGPNXobFexnhFGQAcriLCJQKxnO0fed8fQ,1740
21
- wcp_library-1.3.6.dist-info/METADATA,sha256=4AtGuuDkPHngl78hTA_sOGk4haucvL2HKzmh3w6TKMc,1552
22
- wcp_library-1.3.6.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
23
- wcp_library-1.3.6.dist-info/RECORD,,
21
+ wcp_library-1.3.7.dist-info/METADATA,sha256=sRMU9aoSGlB9-kA3qNgSU6DFtcUey0ogHGmIqEPUCg4,1552
22
+ wcp_library-1.3.7.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
23
+ wcp_library-1.3.7.dist-info/RECORD,,