robo_appian 0.0.16__tar.gz → 0.0.18__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.
Potentially problematic release.
This version of robo_appian might be problematic. Click here for more details.
- {robo_appian-0.0.16 → robo_appian-0.0.18}/PKG-INFO +1 -1
- {robo_appian-0.0.16 → robo_appian-0.0.18}/pyproject.toml +1 -1
- {robo_appian-0.0.16 → robo_appian-0.0.18}/robo_appian/components/ButtonUtils.py +9 -3
- {robo_appian-0.0.16 → robo_appian-0.0.18}/robo_appian/components/DateUtils.py +1 -1
- {robo_appian-0.0.16 → robo_appian-0.0.18}/robo_appian/components/InputUtils.py +4 -3
- {robo_appian-0.0.16 → robo_appian-0.0.18}/robo_appian/components/LinkUtils.py +0 -2
- {robo_appian-0.0.16 → robo_appian-0.0.18}/robo_appian/components/SearchDropdownUtils.py +3 -3
- {robo_appian-0.0.16 → robo_appian-0.0.18}/robo_appian/components/SearchInputUtils.py +1 -5
- {robo_appian-0.0.16 → robo_appian-0.0.18}/robo_appian/components/TabUtils.py +13 -8
- {robo_appian-0.0.16 → robo_appian-0.0.18}/robo_appian/utils/ComponentUtils.py +1 -1
- {robo_appian-0.0.16 → robo_appian-0.0.18}/LICENSE +0 -0
- {robo_appian-0.0.16 → robo_appian-0.0.18}/README.md +0 -0
- {robo_appian-0.0.16 → robo_appian-0.0.18}/robo_appian/__init__.py +0 -0
- {robo_appian-0.0.16 → robo_appian-0.0.18}/robo_appian/components/DropdownUtils.py +0 -0
- {robo_appian-0.0.16 → robo_appian-0.0.18}/robo_appian/components/LabelUtils.py +0 -0
- {robo_appian-0.0.16 → robo_appian-0.0.18}/robo_appian/components/TableUtils.py +0 -0
- {robo_appian-0.0.16 → robo_appian-0.0.18}/robo_appian/components/__init__.py +0 -0
- {robo_appian-0.0.16 → robo_appian-0.0.18}/robo_appian/controllers/ComponentDriver.py +0 -0
- {robo_appian-0.0.16 → robo_appian-0.0.18}/robo_appian/controllers/__init__.py +0 -0
- {robo_appian-0.0.16 → robo_appian-0.0.18}/robo_appian/exceptions/MyCustomError.py +0 -0
- {robo_appian-0.0.16 → robo_appian-0.0.18}/robo_appian/exceptions/__init__.py +0 -0
- {robo_appian-0.0.16 → robo_appian-0.0.18}/robo_appian/utils/__init__.py +0 -0
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
from selenium.webdriver.common.by import By
|
|
2
2
|
from selenium.webdriver.support import expected_conditions as EC
|
|
3
3
|
from selenium.webdriver.support.ui import WebDriverWait
|
|
4
|
+
from selenium.webdriver.remote.webelement import WebElement
|
|
4
5
|
|
|
5
6
|
|
|
6
7
|
class ButtonUtils:
|
|
@@ -12,6 +13,11 @@ class ButtonUtils:
|
|
|
12
13
|
ButtonUtils.clickByLabelText(wait, "Submit")
|
|
13
14
|
"""
|
|
14
15
|
|
|
16
|
+
@staticmethod
|
|
17
|
+
def __click(wait: WebDriverWait, component: WebElement):
|
|
18
|
+
wait.until(EC.element_to_be_clickable(component))
|
|
19
|
+
component.click()
|
|
20
|
+
|
|
15
21
|
@staticmethod
|
|
16
22
|
def _findByPartialLabelText(wait: WebDriverWait, label: str):
|
|
17
23
|
"""
|
|
@@ -69,7 +75,7 @@ class ButtonUtils:
|
|
|
69
75
|
ButtonUtils.clickByPartialLabelText(wait, "Button Label")
|
|
70
76
|
"""
|
|
71
77
|
component = ButtonUtils._findByPartialLabelText(wait, label)
|
|
72
|
-
|
|
78
|
+
ButtonUtils.__click(wait, component)
|
|
73
79
|
|
|
74
80
|
@staticmethod
|
|
75
81
|
def clickByLabelText(wait: WebDriverWait, label: str):
|
|
@@ -82,7 +88,7 @@ class ButtonUtils:
|
|
|
82
88
|
ButtonUtils.clickByLabelText(wait, "Button Label")
|
|
83
89
|
"""
|
|
84
90
|
component = ButtonUtils._findByLabelText(wait, label)
|
|
85
|
-
|
|
91
|
+
ButtonUtils.__click(wait, component)
|
|
86
92
|
|
|
87
93
|
@staticmethod
|
|
88
94
|
def clickById(wait: WebDriverWait, id: str):
|
|
@@ -102,4 +108,4 @@ class ButtonUtils:
|
|
|
102
108
|
except Exception as e:
|
|
103
109
|
raise RuntimeError(f"Input button with id '{id}' not found or not clickable.") from e
|
|
104
110
|
|
|
105
|
-
|
|
111
|
+
ButtonUtils.__click(wait, component)
|
|
@@ -59,7 +59,7 @@ class DateUtils:
|
|
|
59
59
|
DateUtils.setValueByLabelText(wait, "Start Date", "2023-10-01")
|
|
60
60
|
"""
|
|
61
61
|
component = DateUtils.__findComponent(wait, label)
|
|
62
|
-
InputUtils._setValueByComponent(component, value)
|
|
62
|
+
InputUtils._setValueByComponent(wait, component, value)
|
|
63
63
|
return component
|
|
64
64
|
|
|
65
65
|
@staticmethod
|
|
@@ -85,7 +85,7 @@ class InputUtils:
|
|
|
85
85
|
return components
|
|
86
86
|
|
|
87
87
|
@staticmethod
|
|
88
|
-
def _setValueByComponent(component: WebElement, value: str):
|
|
88
|
+
def _setValueByComponent(wait: WebDriverWait, component: WebElement, value: str):
|
|
89
89
|
"""
|
|
90
90
|
Sets a value in an input component.
|
|
91
91
|
Parameters:
|
|
@@ -96,6 +96,7 @@ class InputUtils:
|
|
|
96
96
|
Example:
|
|
97
97
|
InputUtils._setValueByComponent(component, "test_value")
|
|
98
98
|
"""
|
|
99
|
+
wait.until(EC.element_to_be_clickable(component))
|
|
99
100
|
component.clear()
|
|
100
101
|
component.send_keys(value)
|
|
101
102
|
return component
|
|
@@ -115,7 +116,7 @@ class InputUtils:
|
|
|
115
116
|
"""
|
|
116
117
|
|
|
117
118
|
for component in input_components:
|
|
118
|
-
InputUtils._setValueByComponent(component, value)
|
|
119
|
+
InputUtils._setValueByComponent(wait, component, value)
|
|
119
120
|
|
|
120
121
|
@staticmethod
|
|
121
122
|
def setValueByPartialLabelText(wait: WebDriverWait, label: str, value: str):
|
|
@@ -161,5 +162,5 @@ class InputUtils:
|
|
|
161
162
|
component = wait.until(EC.element_to_be_clickable((By.ID, component_id)))
|
|
162
163
|
except Exception as e:
|
|
163
164
|
raise Exception(f"Timeout or error finding input component with id '{component_id}': {e}")
|
|
164
|
-
InputUtils._setValueByComponent(component, value)
|
|
165
|
+
InputUtils._setValueByComponent(wait, component, value)
|
|
165
166
|
return component
|
|
@@ -22,8 +22,6 @@ class LinkUtils:
|
|
|
22
22
|
xpath = f'.//a[normalize-space(.)="{label}"]'
|
|
23
23
|
try:
|
|
24
24
|
component = wait.until(EC.element_to_be_clickable((By.XPATH, xpath)))
|
|
25
|
-
except TimeoutError as e:
|
|
26
|
-
raise TimeoutError(f"Could not find clickable link with label '{label}': {e}")
|
|
27
25
|
except Exception as e:
|
|
28
26
|
raise Exception(f"Could not find clickable link with label '{label}': {e}")
|
|
29
27
|
return component
|
|
@@ -15,17 +15,17 @@ class SearchDropdownUtils:
|
|
|
15
15
|
"""
|
|
16
16
|
|
|
17
17
|
@staticmethod
|
|
18
|
-
def __selectSearchDropdownValueByDropdownId(wait, component_id, value):
|
|
18
|
+
def __selectSearchDropdownValueByDropdownId(wait: WebDriverWait, component_id: str, value: str):
|
|
19
19
|
if not component_id:
|
|
20
20
|
raise ValueError("Invalid component_id provided.")
|
|
21
21
|
|
|
22
|
+
input_component_id = str(component_id) + "_searchInput"
|
|
22
23
|
try:
|
|
23
|
-
input_component_id = str(component_id) + "_searchInput"
|
|
24
24
|
wait.until(EC.presence_of_element_located((By.ID, input_component_id)))
|
|
25
25
|
input_component = wait.until(EC.element_to_be_clickable((By.ID, input_component_id)))
|
|
26
26
|
except Exception as e:
|
|
27
27
|
raise RuntimeError(f"Failed to locate or click input component with ID '{input_component_id}': {e}")
|
|
28
|
-
InputUtils._setValueByComponent(input_component, value)
|
|
28
|
+
InputUtils._setValueByComponent(wait, input_component, value)
|
|
29
29
|
|
|
30
30
|
dropdown_option_id = str(component_id) + "_list"
|
|
31
31
|
|
|
@@ -27,15 +27,11 @@ class SearchInputUtils:
|
|
|
27
27
|
attribute: str = "aria-controls"
|
|
28
28
|
dropdown_list_id = search_input_component.get_attribute(attribute)
|
|
29
29
|
if dropdown_list_id:
|
|
30
|
-
InputUtils._setValueByComponent(search_input_component, value)
|
|
30
|
+
InputUtils._setValueByComponent(wait, search_input_component, value)
|
|
31
31
|
xpath = f'.//ul[@id="{dropdown_list_id}" and @role="listbox" ]/li[@role="option" and @tabindex="-1" and ./div/div/div/div/div/div/p[normalize-space(.)="{value}"][1]]'
|
|
32
32
|
try:
|
|
33
33
|
drop_down_item = wait.until(EC.presence_of_element_located((By.XPATH, xpath)))
|
|
34
34
|
drop_down_item = wait.until(EC.element_to_be_clickable((By.XPATH, xpath)))
|
|
35
|
-
except TimeoutError as e:
|
|
36
|
-
raise TimeoutError(
|
|
37
|
-
f"Dropdown item with value '{value}' not found for component '{search_input_component.text}'."
|
|
38
|
-
) from e
|
|
39
35
|
except Exception as e:
|
|
40
36
|
raise RuntimeError(
|
|
41
37
|
f"Dropdown item with value '{value}' not found for component '{search_input_component.text}'."
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
from selenium.webdriver.common.by import By
|
|
2
2
|
from selenium.webdriver.support import expected_conditions as EC
|
|
3
|
+
from selenium.webdriver.support.ui import WebDriverWait
|
|
4
|
+
from selenium.webdriver.remote.webelement import WebElement
|
|
3
5
|
from robo_appian.utils.ComponentUtils import ComponentUtils
|
|
4
6
|
|
|
5
7
|
|
|
@@ -22,9 +24,16 @@ class TabUtils:
|
|
|
22
24
|
|
|
23
25
|
driver.quit()
|
|
24
26
|
"""
|
|
27
|
+
@staticmethod
|
|
28
|
+
def __click(wait: WebDriverWait, component: WebElement, label: str):
|
|
29
|
+
try:
|
|
30
|
+
component = wait.until(EC.element_to_be_clickable(component))
|
|
31
|
+
component.click()
|
|
32
|
+
except Exception:
|
|
33
|
+
raise Exception(f"Tab with label '{label}' is not clickable.")
|
|
25
34
|
|
|
26
35
|
@staticmethod
|
|
27
|
-
def findTabByLabelText(wait, label):
|
|
36
|
+
def findTabByLabelText(wait: WebDriverWait, label: str) -> WebElement:
|
|
28
37
|
xpath = f'//div/div[@role="link" ]/div/div/div/div/div/p[normalize-space(.)="{label}"]'
|
|
29
38
|
try:
|
|
30
39
|
component = wait.until(EC.visibility_of_element_located((By.XPATH, xpath)))
|
|
@@ -33,16 +42,12 @@ class TabUtils:
|
|
|
33
42
|
return component
|
|
34
43
|
|
|
35
44
|
@staticmethod
|
|
36
|
-
def selectTabByLabelText(wait, label):
|
|
45
|
+
def selectTabByLabelText(wait: WebDriverWait, label: str):
|
|
37
46
|
component = TabUtils.findTabByLabelText(wait, label)
|
|
38
|
-
|
|
39
|
-
component = wait.until(EC.element_to_be_clickable(component))
|
|
40
|
-
except Exception:
|
|
41
|
-
raise Exception(f"Tab with label '{label}' is not clickable.")
|
|
42
|
-
component.click()
|
|
47
|
+
TabUtils.__click(wait, component, label)
|
|
43
48
|
|
|
44
49
|
@staticmethod
|
|
45
|
-
def checkTabSelectedByLabelText(wait, label):
|
|
50
|
+
def checkTabSelectedByLabelText(wait: WebDriverWait, label: str):
|
|
46
51
|
component = TabUtils.findTabByLabelText(wait, label)
|
|
47
52
|
|
|
48
53
|
select_text = "Selected Tab."
|
|
@@ -52,7 +52,7 @@ class ComponentUtils:
|
|
|
52
52
|
child_component = ComponentUtils.findChildComponentByXpath(wait, parent_component, xpath)
|
|
53
53
|
"""
|
|
54
54
|
try:
|
|
55
|
-
component = component.find_element(By.XPATH, xpath)
|
|
55
|
+
component = wait.until(lambda comp: component.find_element(By.XPATH, xpath))
|
|
56
56
|
except Exception:
|
|
57
57
|
raise Exception(f"Child component with XPath '{xpath}' not found within the given parent component.")
|
|
58
58
|
return component
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|