robo_appian 0.0.9__tar.gz → 0.0.10__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.9 → robo_appian-0.0.10}/PKG-INFO +1 -1
- {robo_appian-0.0.9 → robo_appian-0.0.10}/pyproject.toml +1 -1
- {robo_appian-0.0.9 → robo_appian-0.0.10}/robo_appian/components/DateUtils.py +1 -1
- {robo_appian-0.0.9 → robo_appian-0.0.10}/robo_appian/components/InputUtils.py +5 -5
- {robo_appian-0.0.9 → robo_appian-0.0.10}/robo_appian/components/TabUtils.py +6 -6
- {robo_appian-0.0.9 → robo_appian-0.0.10}/robo_appian/components/TableUtils.py +9 -94
- {robo_appian-0.0.9 → robo_appian-0.0.10}/robo_appian/controllers/ComponentDriver.py +4 -4
- {robo_appian-0.0.9 → robo_appian-0.0.10}/robo_appian/utils/ComponentUtils.py +1 -1
- {robo_appian-0.0.9 → robo_appian-0.0.10}/LICENSE +0 -0
- {robo_appian-0.0.9 → robo_appian-0.0.10}/README.md +0 -0
- {robo_appian-0.0.9 → robo_appian-0.0.10}/robo_appian/__init__.py +0 -0
- {robo_appian-0.0.9 → robo_appian-0.0.10}/robo_appian/components/ButtonUtils.py +0 -0
- {robo_appian-0.0.9 → robo_appian-0.0.10}/robo_appian/components/DropdownUtils.py +0 -0
- {robo_appian-0.0.9 → robo_appian-0.0.10}/robo_appian/components/LabelUtils.py +0 -0
- {robo_appian-0.0.9 → robo_appian-0.0.10}/robo_appian/components/LinkUtils.py +0 -0
- {robo_appian-0.0.9 → robo_appian-0.0.10}/robo_appian/components/SearchInputUtils.py +0 -0
- {robo_appian-0.0.9 → robo_appian-0.0.10}/robo_appian/components/__init__.py +0 -0
- {robo_appian-0.0.9 → robo_appian-0.0.10}/robo_appian/controllers/__init__.py +0 -0
- {robo_appian-0.0.9 → robo_appian-0.0.10}/robo_appian/exceptions/MyCustomError.py +0 -0
- {robo_appian-0.0.9 → robo_appian-0.0.10}/robo_appian/exceptions/__init__.py +0 -0
- {robo_appian-0.0.9 → robo_appian-0.0.10}/robo_appian/utils/__init__.py +0 -0
|
@@ -116,7 +116,7 @@ class DateUtils:
|
|
|
116
116
|
# It sets the value of the input element and submits it.
|
|
117
117
|
|
|
118
118
|
component = DateUtils.findComponent(wait, label)
|
|
119
|
-
InputUtils.
|
|
119
|
+
InputUtils.setValueAndSubmitByComponent(component, value)
|
|
120
120
|
|
|
121
121
|
return component
|
|
122
122
|
|
|
@@ -19,7 +19,7 @@ class InputUtils:
|
|
|
19
19
|
"""
|
|
20
20
|
|
|
21
21
|
@staticmethod
|
|
22
|
-
def
|
|
22
|
+
def setValueAndSubmitByComponent(component: WebElement, value: str):
|
|
23
23
|
"""
|
|
24
24
|
Sets a value in an input component and submits it using the provided component element.
|
|
25
25
|
|
|
@@ -31,7 +31,7 @@ class InputUtils:
|
|
|
31
31
|
The Selenium WebElement for the input component after setting the value and submitting.
|
|
32
32
|
|
|
33
33
|
Example:
|
|
34
|
-
InputUtils.
|
|
34
|
+
InputUtils.setValueAndSubmitByComponent(component, "test_user")
|
|
35
35
|
|
|
36
36
|
"""
|
|
37
37
|
# This method assumes that the component is already found and passed as an argument.
|
|
@@ -46,7 +46,7 @@ class InputUtils:
|
|
|
46
46
|
return component
|
|
47
47
|
|
|
48
48
|
@staticmethod
|
|
49
|
-
def
|
|
49
|
+
def __findInputComponentsByXpath(wait: WebDriverWait, xpath: str):
|
|
50
50
|
label_components = ComponentUtils.findComponentsByXPath(wait, xpath)
|
|
51
51
|
input_components = []
|
|
52
52
|
for label_component in label_components:
|
|
@@ -71,13 +71,13 @@ class InputUtils:
|
|
|
71
71
|
@staticmethod
|
|
72
72
|
def __findInputComponentsByPartialLabel(wait: WebDriverWait, label: str):
|
|
73
73
|
xpath = f'.//div/label[contains(normalize-space(text()), "{label}")]'
|
|
74
|
-
components = InputUtils.
|
|
74
|
+
components = InputUtils.__findInputComponentsByXpath(wait, xpath)
|
|
75
75
|
return components
|
|
76
76
|
|
|
77
77
|
@staticmethod
|
|
78
78
|
def __findInputComponentsByLabel(wait: WebDriverWait, label: str):
|
|
79
79
|
xpath = f'.//div/label[normalize-space(text())="{label}"]'
|
|
80
|
-
components = InputUtils.
|
|
80
|
+
components = InputUtils.__findInputComponentsByXpath(wait, xpath)
|
|
81
81
|
return components
|
|
82
82
|
|
|
83
83
|
@staticmethod
|
|
@@ -10,15 +10,15 @@ class TabUtils:
|
|
|
10
10
|
|
|
11
11
|
# Select a tab by its label
|
|
12
12
|
from robo_appian.components.TabUtils import TabUtils
|
|
13
|
-
TabUtils.
|
|
13
|
+
TabUtils.selectInactiveTab(wait, "Settings")
|
|
14
14
|
|
|
15
15
|
# Find the currently selected tab by its label
|
|
16
16
|
from robo_appian.components.TabUtils import TabUtils
|
|
17
|
-
selected_tab = TabUtils.
|
|
17
|
+
selected_tab = TabUtils.findSelectedTab(wait, "Settings")
|
|
18
18
|
"""
|
|
19
19
|
|
|
20
20
|
@staticmethod
|
|
21
|
-
def
|
|
21
|
+
def findSelectedTab(wait, label):
|
|
22
22
|
"""
|
|
23
23
|
Finds the currently selected tab by its label.
|
|
24
24
|
|
|
@@ -30,7 +30,7 @@ class TabUtils:
|
|
|
30
30
|
The Selenium WebElement for the selected tab.
|
|
31
31
|
|
|
32
32
|
Example:
|
|
33
|
-
TabUtils.
|
|
33
|
+
TabUtils.findSelectedTab(wait, "Settings")
|
|
34
34
|
"""
|
|
35
35
|
# This method locates a tab that is currently selected and contains the specified label.
|
|
36
36
|
|
|
@@ -44,7 +44,7 @@ class TabUtils:
|
|
|
44
44
|
return component
|
|
45
45
|
|
|
46
46
|
@staticmethod
|
|
47
|
-
def
|
|
47
|
+
def selectInactiveTab(wait, label):
|
|
48
48
|
"""
|
|
49
49
|
Selects a tab by its label.
|
|
50
50
|
|
|
@@ -53,7 +53,7 @@ class TabUtils:
|
|
|
53
53
|
label: The visible text label of the tab to select.
|
|
54
54
|
|
|
55
55
|
Example:
|
|
56
|
-
TabUtils.
|
|
56
|
+
TabUtils.selectInactiveTab(wait, "Settings")
|
|
57
57
|
"""
|
|
58
58
|
# This method locates a tab that contains a label with the specified text.
|
|
59
59
|
|
|
@@ -11,12 +11,12 @@ class TableUtils:
|
|
|
11
11
|
|
|
12
12
|
# Find a table using a column name
|
|
13
13
|
from robo_appian.components.TableUtils import TableUtils
|
|
14
|
-
table = TableUtils.
|
|
14
|
+
table = TableUtils.findTableByColumnName(wait, "Status")
|
|
15
15
|
|
|
16
16
|
"""
|
|
17
17
|
|
|
18
18
|
@staticmethod
|
|
19
|
-
def
|
|
19
|
+
def findTableByColumnName(wait: WebDriverWait, columnName: str):
|
|
20
20
|
"""
|
|
21
21
|
Finds a table component that contains a column with the specified name.
|
|
22
22
|
|
|
@@ -28,7 +28,7 @@ class TableUtils:
|
|
|
28
28
|
The Selenium WebElement for the table component.
|
|
29
29
|
|
|
30
30
|
Example:
|
|
31
|
-
table = TableUtils.
|
|
31
|
+
table = TableUtils.findTableByColumnName(wait, "Status")
|
|
32
32
|
|
|
33
33
|
"""
|
|
34
34
|
# This method locates a table that contains a header cell with the specified column name.
|
|
@@ -49,89 +49,6 @@ class TableUtils:
|
|
|
49
49
|
)
|
|
50
50
|
return component
|
|
51
51
|
|
|
52
|
-
@staticmethod
|
|
53
|
-
def clickOnLinkUsingHoverText(wait, columnName, rowNumber, hoverText):
|
|
54
|
-
"""
|
|
55
|
-
Clicks on a link in a table cell identified by its column name, row number, and the hover text of the link.
|
|
56
|
-
|
|
57
|
-
Parameters:
|
|
58
|
-
wait: Selenium WebDriverWait instance.
|
|
59
|
-
columnName: The name of the column where the link is located.
|
|
60
|
-
rowNumber: The row number (0-based index) where the link is located.
|
|
61
|
-
hoverText: The text that appears when hovering over the link.
|
|
62
|
-
|
|
63
|
-
Example:
|
|
64
|
-
TableUtils.clickOnLinkUsingHoverText(wait, "Status", 2, "View Details")
|
|
65
|
-
|
|
66
|
-
"""
|
|
67
|
-
|
|
68
|
-
# This method locates a link within a specific table cell based on the column name and row number.
|
|
69
|
-
# It constructs an XPath that targets the table cell containing the link with the specified hover text.
|
|
70
|
-
# The XPath first identifies the table by the column name, then finds the specific row and cell,
|
|
71
|
-
# and finally looks for the link with the specified hover text.
|
|
72
|
-
|
|
73
|
-
xpath = f".//table[./thead/tr/th[@abbr='{columnName}']]/tbody/tr[@data-dnd-name='row {rowNumber + 1}']/td[not (@data-empty-grid-message)]/div/p/a[./span[text()='{hoverText}']]"
|
|
74
|
-
# xpath=f".//table[./thead/tr/th/div[text()='{columnName}']][1]/tbody/tr[@data-dnd-name='row {rowNumber}']/td/div/p/a[./span[text()='{hoverText}']]"
|
|
75
|
-
try:
|
|
76
|
-
component = wait.until(EC.element_to_be_clickable((By.XPATH, xpath)))
|
|
77
|
-
except TimeoutError as e:
|
|
78
|
-
raise TimeoutError(
|
|
79
|
-
f"Could not find link with hover text '{hoverText}' in column '{columnName}', row {rowNumber}: {e}"
|
|
80
|
-
)
|
|
81
|
-
except Exception as e:
|
|
82
|
-
raise RuntimeError(
|
|
83
|
-
f"Could not find link with hover text '{hoverText}' in column '{columnName}', row {rowNumber}: {e}"
|
|
84
|
-
)
|
|
85
|
-
component.click()
|
|
86
|
-
|
|
87
|
-
@staticmethod
|
|
88
|
-
def clickOnButtonUsingHoverText(wait, columnName, rowNumber, hoverText):
|
|
89
|
-
"""
|
|
90
|
-
Clicks on a button in a table cell identified by its column name, row number, and the hover text of the button.
|
|
91
|
-
|
|
92
|
-
Parameters:
|
|
93
|
-
wait: Selenium WebDriverWait instance.
|
|
94
|
-
columnName: The name of the column where the button is located.
|
|
95
|
-
rowNumber: The row number (0-based index) where the button is located.
|
|
96
|
-
hoverText: The text that appears when hovering over the button.
|
|
97
|
-
|
|
98
|
-
Example:
|
|
99
|
-
TableUtils.clickOnButtonUsingHoverText(wait, "Actions", 2, "Delete")
|
|
100
|
-
|
|
101
|
-
"""
|
|
102
|
-
# This method locates a button within a specific table cell based on the column name and row number.
|
|
103
|
-
# It constructs an XPath that targets the table cell containing the button with the specified hover text.
|
|
104
|
-
# The XPath first identifies the table by the column name, then finds the specific row and cell,
|
|
105
|
-
# and finally looks for the button with the specified hover text.
|
|
106
|
-
|
|
107
|
-
# TODO rowNumber = rowNumber + 1 # Adjusting for 1-based index in XPath
|
|
108
|
-
|
|
109
|
-
xpath = f".//table[./thead/tr/th[@abbr='{columnName}']]/tbody/tr[@data-dnd-name='row {rowNumber}']/td[not (@data-empty-grid-message)]"
|
|
110
|
-
try:
|
|
111
|
-
component = wait.until(EC.element_to_be_clickable((By.XPATH, xpath)))
|
|
112
|
-
except TimeoutError as e:
|
|
113
|
-
raise TimeoutError(
|
|
114
|
-
f"Could not find button with hover text '{hoverText}' in column '{columnName}', row {rowNumber}: {e}"
|
|
115
|
-
)
|
|
116
|
-
except Exception as e:
|
|
117
|
-
raise RuntimeError(
|
|
118
|
-
f"Could not find button with hover text '{hoverText}' in column '{columnName}', row {rowNumber}: {e}"
|
|
119
|
-
)
|
|
120
|
-
component.click()
|
|
121
|
-
|
|
122
|
-
xpath = f".//table[./thead/tr/th[@abbr='{columnName}']]/tbody/tr[@data-dnd-name='row {rowNumber}']/td[not (@data-empty-grid-message)]/div/div/button[./span[text()='{hoverText}']]"
|
|
123
|
-
try:
|
|
124
|
-
component = wait.until(EC.element_to_be_clickable((By.XPATH, xpath)))
|
|
125
|
-
except TimeoutError as e:
|
|
126
|
-
raise TimeoutError(
|
|
127
|
-
f"Could not find button with hover text '{hoverText}' in column '{columnName}', row {rowNumber}: {e}"
|
|
128
|
-
)
|
|
129
|
-
except Exception as e:
|
|
130
|
-
raise RuntimeError(
|
|
131
|
-
f"Could not find button with hover text '{hoverText}' in column '{columnName}', row {rowNumber}: {e}"
|
|
132
|
-
)
|
|
133
|
-
component.click()
|
|
134
|
-
|
|
135
52
|
@staticmethod
|
|
136
53
|
def rowCount(tableObject):
|
|
137
54
|
"""
|
|
@@ -155,7 +72,7 @@ class TableUtils:
|
|
|
155
72
|
return len(rows)
|
|
156
73
|
|
|
157
74
|
@staticmethod
|
|
158
|
-
def
|
|
75
|
+
def findColumNumberByColumnName(tableObject, columnName):
|
|
159
76
|
"""
|
|
160
77
|
Finds the column number in a table based on the column name.
|
|
161
78
|
|
|
@@ -167,7 +84,7 @@ class TableUtils:
|
|
|
167
84
|
The index of the column (0-based).
|
|
168
85
|
|
|
169
86
|
Example:
|
|
170
|
-
column_number = TableUtils.
|
|
87
|
+
column_number = TableUtils.findColumNumberByColumnName(table, "Status")
|
|
171
88
|
|
|
172
89
|
"""
|
|
173
90
|
# This method locates the column header cell with the specified column name
|
|
@@ -199,7 +116,7 @@ class TableUtils:
|
|
|
199
116
|
return int(data[1])
|
|
200
117
|
|
|
201
118
|
@staticmethod
|
|
202
|
-
def
|
|
119
|
+
def findComponentFromTableCell(wait, rowNumber, columnName):
|
|
203
120
|
"""
|
|
204
121
|
Finds a component within a specific table cell based on the row number and column name.
|
|
205
122
|
|
|
@@ -212,17 +129,15 @@ class TableUtils:
|
|
|
212
129
|
The Selenium WebElement for the component within the specified table cell.
|
|
213
130
|
|
|
214
131
|
Example:
|
|
215
|
-
component = TableUtils.
|
|
132
|
+
component = TableUtils.findComponentFromTableCell(wait, 2, "Status")
|
|
216
133
|
|
|
217
134
|
"""
|
|
218
135
|
# This method locates a specific component within a table cell based on the provided row number
|
|
219
136
|
# and column name. It constructs an XPath that targets the table cell containing the specified column
|
|
220
137
|
# and row, and then retrieves the component within that cell.
|
|
221
138
|
|
|
222
|
-
tableObject = TableUtils.
|
|
223
|
-
columnNumber = TableUtils.
|
|
224
|
-
tableObject, columnName
|
|
225
|
-
)
|
|
139
|
+
tableObject = TableUtils.findTableByColumnName(wait, columnName)
|
|
140
|
+
columnNumber = TableUtils.findColumNumberByColumnName(tableObject, columnName)
|
|
226
141
|
# xpath=f'./tbody/tr[@data-dnd-name="row {rowNumber+1}"]/td[not (@data-empty-grid-message)][{columnNumber}]'
|
|
227
142
|
# component = tableObject.find_elements(By.XPATH, xpath)
|
|
228
143
|
rowNumber = rowNumber + 1
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
from robo_appian.components.ButtonUtils import ButtonUtils
|
|
2
2
|
from selenium.webdriver.support.ui import WebDriverWait
|
|
3
|
-
from robo_appian.utils.ComponentUtils import ComponentUtils
|
|
4
3
|
from robo_appian.components.DateUtils import DateUtils
|
|
5
4
|
from robo_appian.components.DropdownUtils import DropdownUtils
|
|
6
5
|
from robo_appian.components.InputUtils import InputUtils
|
|
@@ -35,7 +34,6 @@ class ComponentDriver:
|
|
|
35
34
|
# This method executes an action on a specified component type based on the provided parameters.
|
|
36
35
|
|
|
37
36
|
match type:
|
|
38
|
-
|
|
39
37
|
case "Date":
|
|
40
38
|
match action:
|
|
41
39
|
case "Set Value":
|
|
@@ -77,7 +75,9 @@ class ComponentDriver:
|
|
|
77
75
|
case "Search Drop Down":
|
|
78
76
|
match action:
|
|
79
77
|
case "Select":
|
|
80
|
-
DropdownUtils.selectSearchDropdownValueByLabelText(
|
|
78
|
+
DropdownUtils.selectSearchDropdownValueByLabelText(
|
|
79
|
+
wait, label, value
|
|
80
|
+
)
|
|
81
81
|
case _:
|
|
82
82
|
raise ValueError(f"Unsupported action for {type}: {action}")
|
|
83
83
|
case "Button":
|
|
@@ -89,7 +89,7 @@ class ComponentDriver:
|
|
|
89
89
|
case "Tab":
|
|
90
90
|
match action:
|
|
91
91
|
case "Find":
|
|
92
|
-
TabUtils.
|
|
92
|
+
TabUtils.findSelectedTab(wait, label)
|
|
93
93
|
case _:
|
|
94
94
|
raise ValueError(f"Unsupported action for {type}: {action}")
|
|
95
95
|
case _:
|
|
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
|
|
File without changes
|