wcp-library 1.3.5__tar.gz → 1.3.7__tar.gz

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.
Files changed (23) hide show
  1. {wcp_library-1.3.5 → wcp_library-1.3.7}/PKG-INFO +1 -1
  2. {wcp_library-1.3.5 → wcp_library-1.3.7}/pyproject.toml +1 -1
  3. {wcp_library-1.3.5 → wcp_library-1.3.7}/wcp_library/credentials/_credential_manager_asynchronous.py +2 -0
  4. {wcp_library-1.3.5 → wcp_library-1.3.7}/wcp_library/credentials/_credential_manager_synchronous.py +2 -0
  5. {wcp_library-1.3.5 → wcp_library-1.3.7}/wcp_library/selenium_helper.py +24 -4
  6. {wcp_library-1.3.5 → wcp_library-1.3.7}/README.md +0 -0
  7. {wcp_library-1.3.5 → wcp_library-1.3.7}/wcp_library/__init__.py +0 -0
  8. {wcp_library-1.3.5 → wcp_library-1.3.7}/wcp_library/credentials/__init__.py +0 -0
  9. {wcp_library-1.3.5 → wcp_library-1.3.7}/wcp_library/credentials/api.py +0 -0
  10. {wcp_library-1.3.5 → wcp_library-1.3.7}/wcp_library/credentials/ftp.py +0 -0
  11. {wcp_library-1.3.5 → wcp_library-1.3.7}/wcp_library/credentials/internet.py +0 -0
  12. {wcp_library-1.3.5 → wcp_library-1.3.7}/wcp_library/credentials/oracle.py +0 -0
  13. {wcp_library-1.3.5 → wcp_library-1.3.7}/wcp_library/credentials/postgres.py +0 -0
  14. {wcp_library-1.3.5 → wcp_library-1.3.7}/wcp_library/emailing.py +0 -0
  15. {wcp_library-1.3.5 → wcp_library-1.3.7}/wcp_library/ftp/__init__.py +0 -0
  16. {wcp_library-1.3.5 → wcp_library-1.3.7}/wcp_library/ftp/ftp.py +0 -0
  17. {wcp_library-1.3.5 → wcp_library-1.3.7}/wcp_library/ftp/sftp.py +0 -0
  18. {wcp_library-1.3.5 → wcp_library-1.3.7}/wcp_library/informatica.py +0 -0
  19. {wcp_library-1.3.5 → wcp_library-1.3.7}/wcp_library/logging.py +0 -0
  20. {wcp_library-1.3.5 → wcp_library-1.3.7}/wcp_library/sql/__init__.py +0 -0
  21. {wcp_library-1.3.5 → wcp_library-1.3.7}/wcp_library/sql/oracle.py +0 -0
  22. {wcp_library-1.3.5 → wcp_library-1.3.7}/wcp_library/sql/postgres.py +0 -0
  23. {wcp_library-1.3.5 → wcp_library-1.3.7}/wcp_library/time.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: wcp-library
3
- Version: 1.3.5
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
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "wcp-library"
3
- version = "1.3.5"
3
+ version = "1.3.7"
4
4
  description = "Common utilites for internal development at WCP"
5
5
  authors = ["Mitch-Petersen <mitch.petersen@wcap.ca>"]
6
6
  readme = "README.md"
@@ -64,6 +64,8 @@ class AsyncCredentialManager(ABC):
64
64
  password_info = {'PasswordID': password['PasswordID'], 'UserName': password['UserName'], 'Password': password['Password']}
65
65
  for field in password['GenericFieldInfo']:
66
66
  password_info[field['DisplayName']] = field['Value'].lower() if field['DisplayName'].lower() == 'username' else field['Value']
67
+ if password['OTP']:
68
+ password_info['OTP'] = password['OTP']
67
69
  return password_info
68
70
 
69
71
  async def _publish_new_password(self, data: dict) -> bool:
@@ -60,6 +60,8 @@ class CredentialManager(ABC):
60
60
  password_info = {'PasswordID': password['PasswordID'], 'UserName': password['UserName'], 'Password': password['Password']}
61
61
  for field in password['GenericFieldInfo']:
62
62
  password_info[field['DisplayName']] = field['Value'].lower() if field['DisplayName'].lower() == 'username' else field['Value']
63
+ if password['OTP']:
64
+ password_info['OTP'] = password['OTP']
63
65
  logger.debug("Credential retrieved")
64
66
  return password_info
65
67
 
@@ -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)))
File without changes