robo_appian 0.0.10__py3-none-any.whl → 0.0.11__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.
Potentially problematic release.
This version of robo_appian might be problematic. Click here for more details.
- robo_appian/components/ButtonUtils.py +3 -43
- robo_appian/components/DropdownUtils.py +91 -136
- robo_appian/components/SearchDropdownUtils.py +75 -0
- robo_appian/controllers/ComponentDriver.py +3 -6
- robo_appian/utils/ComponentUtils.py +6 -3
- {robo_appian-0.0.10.dist-info → robo_appian-0.0.11.dist-info}/METADATA +1 -1
- {robo_appian-0.0.10.dist-info → robo_appian-0.0.11.dist-info}/RECORD +9 -8
- {robo_appian-0.0.10.dist-info → robo_appian-0.0.11.dist-info}/LICENSE +0 -0
- {robo_appian-0.0.10.dist-info → robo_appian-0.0.11.dist-info}/WHEEL +0 -0
|
@@ -4,49 +4,13 @@ from selenium.webdriver.support.ui import WebDriverWait
|
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
class ButtonUtils:
|
|
7
|
-
"""
|
|
8
|
-
Utility class for interacting with button elements in Selenium-based Appian UI automation.
|
|
9
|
-
|
|
10
|
-
Usage Example:
|
|
11
|
-
|
|
12
|
-
from selenium.webdriver.support.ui import WebDriverWait
|
|
13
|
-
from robo_appian.components.ButtonUtils import ButtonUtils
|
|
14
|
-
|
|
15
|
-
wait = WebDriverWait(driver, 10)
|
|
16
|
-
ButtonUtils.click(wait, "Login")
|
|
17
|
-
|
|
18
|
-
"""
|
|
19
|
-
|
|
20
7
|
@staticmethod
|
|
21
8
|
def find(wait: WebDriverWait, label: str):
|
|
22
|
-
"""
|
|
23
|
-
Finds a button element by its label.
|
|
24
|
-
|
|
25
|
-
Parameters:
|
|
26
|
-
wait: Selenium WebDriverWait instance.
|
|
27
|
-
label: The visible text label of the button.
|
|
28
|
-
|
|
29
|
-
Returns:
|
|
30
|
-
The Selenium WebElement for the button.
|
|
31
|
-
|
|
32
|
-
Example:
|
|
33
|
-
ButtonUtils.find(wait, "Submit")
|
|
34
|
-
|
|
35
|
-
"""
|
|
36
|
-
|
|
37
|
-
# This method locates a button that contains a span with the specified label text.
|
|
38
|
-
|
|
39
9
|
xpath = f".//button[./span[contains(translate(normalize-space(.), '\u00a0', ' '), '{label}')]]"
|
|
40
10
|
try:
|
|
41
11
|
component = wait.until(EC.element_to_be_clickable((By.XPATH, xpath)))
|
|
42
|
-
except TimeoutError as e:
|
|
43
|
-
raise TimeoutError(
|
|
44
|
-
f"Button with label '{label}' not found or not clickable."
|
|
45
|
-
) from e
|
|
46
12
|
except Exception as e:
|
|
47
|
-
raise RuntimeError(
|
|
48
|
-
f"Button with label '{label}' not found or not clickable."
|
|
49
|
-
) from e
|
|
13
|
+
raise RuntimeError(f"Button with label '{label}' not found or not clickable.") from e
|
|
50
14
|
return component
|
|
51
15
|
|
|
52
16
|
@staticmethod
|
|
@@ -80,12 +44,8 @@ class ButtonUtils:
|
|
|
80
44
|
try:
|
|
81
45
|
component = wait.until(EC.element_to_be_clickable((By.ID, id)))
|
|
82
46
|
except TimeoutError as e:
|
|
83
|
-
raise TimeoutError(
|
|
84
|
-
f"Input button with id '{id}' not found or not clickable."
|
|
85
|
-
) from e
|
|
47
|
+
raise TimeoutError(f"Input button with id '{id}' not found or not clickable.") from e
|
|
86
48
|
except Exception as e:
|
|
87
|
-
raise RuntimeError(
|
|
88
|
-
f"Input button with id '{id}' not found or not clickable."
|
|
89
|
-
) from e
|
|
49
|
+
raise RuntimeError(f"Input button with id '{id}' not found or not clickable.") from e
|
|
90
50
|
|
|
91
51
|
component.click()
|
|
@@ -2,176 +2,131 @@ 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
4
|
from selenium.webdriver.remote.webelement import WebElement
|
|
5
|
-
|
|
6
|
-
from robo_appian.components.InputUtils import InputUtils
|
|
5
|
+
from selenium.common.exceptions import NoSuchElementException
|
|
7
6
|
|
|
8
7
|
|
|
9
8
|
class DropdownUtils:
|
|
10
9
|
"""
|
|
11
10
|
Utility class for interacting with dropdown components in Appian UI.
|
|
12
|
-
|
|
13
|
-
Usage Example:
|
|
14
|
-
|
|
11
|
+
Usage Example:
|
|
15
12
|
# Select a value from a dropdown
|
|
16
13
|
from robo_appian.components.DropdownUtils import DropdownUtils
|
|
17
14
|
DropdownUtils.selectDropdownValueByLabelText(wait, "Status", "Approved")
|
|
18
|
-
|
|
19
|
-
# Select a value from a search dropdown
|
|
20
|
-
from robo_appian.components.DropdownUtils import DropdownUtils
|
|
21
|
-
DropdownUtils.selectSearchDropdownValueByLabelText(wait, "Category", "Finance")
|
|
22
15
|
"""
|
|
23
16
|
|
|
24
17
|
@staticmethod
|
|
25
|
-
def
|
|
18
|
+
def __findComboboxByPartialLabelText(wait: WebDriverWait, label: str):
|
|
19
|
+
xpath = f'.//div[./div/span[contains(normalize-space(text()), "{label}")]]/div/div/div/div[@role="combobox" and not(@aria-disabled="true")]'
|
|
26
20
|
try:
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
except TimeoutError as e:
|
|
31
|
-
raise TimeoutError(
|
|
32
|
-
f'No clickable dropdown component found for xpath "{xpath}": {str(e)}'
|
|
33
|
-
)
|
|
34
|
-
except Exception as e:
|
|
35
|
-
raise Exception(
|
|
36
|
-
f'No clickable dropdown component found for xpath "{xpath}": {str(e)}'
|
|
37
|
-
)
|
|
21
|
+
component = wait.until(EC.element_to_be_clickable((By.XPATH, xpath)))
|
|
22
|
+
except Exception as e:
|
|
23
|
+
raise Exception(f'Could not find combobox with partial label "{label}" : {str(e)}')
|
|
38
24
|
|
|
39
|
-
|
|
40
|
-
driver = wait._driver
|
|
41
|
-
components = driver.find_elements(By.XPATH, xpath)
|
|
25
|
+
return component
|
|
42
26
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
continue
|
|
27
|
+
@staticmethod
|
|
28
|
+
def __findComboboxByLabelText(wait: WebDriverWait, label: str):
|
|
29
|
+
xpath = f'.//div[./div/span[normalize-space(text())="{label}"]]/div/div/div/div[@role="combobox" and not(@aria-disabled="true")]'
|
|
30
|
+
try:
|
|
31
|
+
component = wait.until(EC.element_to_be_clickable((By.XPATH, xpath)))
|
|
32
|
+
except Exception as e:
|
|
33
|
+
raise Exception(f'Could not find combobox with label "{label}" : {str(e)}')
|
|
51
34
|
|
|
52
|
-
|
|
53
|
-
raise Exception(
|
|
54
|
-
f'No valid dropdown components with xpath "{xpath}" found.'
|
|
55
|
-
)
|
|
35
|
+
return component
|
|
56
36
|
|
|
57
|
-
|
|
58
|
-
|
|
37
|
+
@staticmethod
|
|
38
|
+
def __clickCombobox(wait: WebDriverWait, combobox: WebElement):
|
|
39
|
+
combobox.click()
|
|
59
40
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
41
|
+
@staticmethod
|
|
42
|
+
def __findDropdownOptionId(wait: WebDriverWait, combobox: WebElement):
|
|
43
|
+
dropdown_option_id = combobox.get_attribute("aria-controls")
|
|
44
|
+
if dropdown_option_id is None:
|
|
45
|
+
raise Exception('Dropdown component does not have a valid "aria-controls" attribute.')
|
|
46
|
+
return dropdown_option_id
|
|
64
47
|
|
|
65
48
|
@staticmethod
|
|
66
|
-
def
|
|
67
|
-
|
|
68
|
-
|
|
49
|
+
def __checkDropdownOptionValueExistsByDropdownOptionId(wait: WebDriverWait, dropdown_option_id: str, value: str):
|
|
50
|
+
option_xpath = f'.//div/ul[@id="{dropdown_option_id}"]/li[./div[normalize-space(text())="{value}"]]'
|
|
51
|
+
try:
|
|
52
|
+
wait.until(EC.element_to_be_clickable((By.XPATH, option_xpath)))
|
|
53
|
+
return True
|
|
54
|
+
except NoSuchElementException:
|
|
55
|
+
return False
|
|
56
|
+
except Exception as e:
|
|
57
|
+
raise Exception(f'Could not find dropdown option "{value}" with dropdown option id "{dropdown_option_id}": {str(e)}')
|
|
69
58
|
|
|
70
|
-
|
|
59
|
+
@staticmethod
|
|
60
|
+
def __selectDropdownValueByDropdownOptionId(wait: WebDriverWait, dropdown_option_id: str, value: str):
|
|
61
|
+
option_xpath = f'.//div/ul[@id="{dropdown_option_id}"]/li[./div[normalize-space(text())="{value}"]]'
|
|
71
62
|
try:
|
|
72
|
-
|
|
73
|
-
EC.presence_of_element_located((By.XPATH, option_xpath))
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
)
|
|
63
|
+
try:
|
|
64
|
+
component = wait.until(EC.presence_of_element_located((By.XPATH, option_xpath)))
|
|
65
|
+
component = wait.until(EC.element_to_be_clickable((By.XPATH, option_xpath)))
|
|
66
|
+
except Exception as e:
|
|
67
|
+
raise Exception(
|
|
68
|
+
f'Could not locate or click dropdown option "{value}" with dropdown option id "{dropdown_option_id}": {str(e)}'
|
|
69
|
+
)
|
|
80
70
|
except Exception as e:
|
|
81
|
-
raise Exception(
|
|
82
|
-
f'Could not find or click dropdown option "{value}" with xpath "{option_xpath}": {str(e)}'
|
|
83
|
-
)
|
|
71
|
+
raise Exception(f'Could not find or click dropdown option "{value}" with xpath "{option_xpath}": {str(e)}')
|
|
84
72
|
component.click()
|
|
85
73
|
|
|
86
74
|
@staticmethod
|
|
87
|
-
def
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
75
|
+
def __selectDropdownValueByPartialLabelText(wait: WebDriverWait, label: str, value: str):
|
|
76
|
+
"""
|
|
77
|
+
Selects a value from a dropdown by its label text.
|
|
78
|
+
|
|
79
|
+
:param wait: WebDriverWait instance to wait for elements.
|
|
80
|
+
:param label: The label of the dropdown.
|
|
81
|
+
:param value: The value to select from the dropdown.
|
|
82
|
+
"""
|
|
83
|
+
combobox = DropdownUtils.__findComboboxByPartialLabelText(wait, label)
|
|
84
|
+
DropdownUtils.__clickCombobox(wait, combobox)
|
|
85
|
+
dropdown_option_id = DropdownUtils.__findDropdownOptionId(wait, combobox)
|
|
86
|
+
DropdownUtils.__selectDropdownValueByDropdownOptionId(wait, dropdown_option_id, value)
|
|
92
87
|
|
|
93
88
|
@staticmethod
|
|
94
|
-
def
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
89
|
+
def __selectDropdownValueByLabelText(wait: WebDriverWait, label: str, value: str):
|
|
90
|
+
"""
|
|
91
|
+
Selects a value from a dropdown by its label text.
|
|
92
|
+
|
|
93
|
+
:param wait: WebDriverWait instance to wait for elements.
|
|
94
|
+
:param label: The label of the dropdown.
|
|
95
|
+
:param value: The value to select from the dropdown.
|
|
96
|
+
"""
|
|
97
|
+
combobox = DropdownUtils.__findComboboxByLabelText(wait, label)
|
|
98
|
+
DropdownUtils.__clickCombobox(wait, combobox)
|
|
99
|
+
dropdown_option_id = DropdownUtils.__findDropdownOptionId(wait, combobox)
|
|
100
|
+
DropdownUtils.__selectDropdownValueByDropdownOptionId(wait, dropdown_option_id, value)
|
|
99
101
|
|
|
100
102
|
@staticmethod
|
|
101
|
-
def
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
103
|
+
def checkReadOnlyStatusByLabelText(wait: WebDriverWait, label: str):
|
|
104
|
+
xpath = f'.//div[./div/span[normalize-space(text())="{label}"]]/div/div/p[text()]'
|
|
105
|
+
try:
|
|
106
|
+
wait._driver.find_element(By.XPATH, xpath)
|
|
107
|
+
return True
|
|
108
|
+
except NoSuchElementException:
|
|
109
|
+
return False
|
|
110
|
+
except Exception:
|
|
111
|
+
raise Exception(f'Error checking read-only status for label "{label}"')
|
|
106
112
|
|
|
107
113
|
@staticmethod
|
|
108
|
-
def
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
if component.is_displayed() and component.is_enabled():
|
|
113
|
-
component_id = component.get_attribute("aria-labelledby") # type: ignore[reportUnknownMemberType]
|
|
114
|
-
dropdown_id = component.get_attribute("aria-controls") # type: ignore[reportUnknownMemberType]
|
|
115
|
-
component.click()
|
|
116
|
-
|
|
117
|
-
input_component_id = str(component_id) + "_searchInput"
|
|
118
|
-
try:
|
|
119
|
-
input_component = wait.until(
|
|
120
|
-
EC.element_to_be_clickable((By.ID, input_component_id))
|
|
121
|
-
)
|
|
122
|
-
except TimeoutError as e:
|
|
123
|
-
raise TimeoutError(
|
|
124
|
-
f'Could not find or click search input component with id "{input_component_id}": {str(e)}'
|
|
125
|
-
)
|
|
126
|
-
except Exception as e:
|
|
127
|
-
raise Exception(
|
|
128
|
-
f'Could not find or click search input component with id "{input_component_id}": {str(e)}'
|
|
129
|
-
)
|
|
130
|
-
InputUtils._setComponentValue(input_component, value)
|
|
131
|
-
|
|
132
|
-
xpath = f'.//ul[@id="{dropdown_id}"]/li[./div[normalize-space(text())="{value}"]][1]'
|
|
133
|
-
try:
|
|
134
|
-
component = wait.until(
|
|
135
|
-
EC.element_to_be_clickable((By.XPATH, xpath))
|
|
136
|
-
)
|
|
137
|
-
except TimeoutError as e:
|
|
138
|
-
raise TimeoutError(
|
|
139
|
-
f'Could not find or click search dropdown option "{value}" with xpath "{xpath}": {str(e)}'
|
|
140
|
-
)
|
|
141
|
-
except Exception as e:
|
|
142
|
-
raise Exception(
|
|
143
|
-
f'Could not find or click search dropdown option "{value}" with xpath "{xpath}": {str(e)}'
|
|
144
|
-
)
|
|
145
|
-
component.click()
|
|
114
|
+
def selectDropdownValueByComboboxComponent(wait: WebDriverWait, combobox: WebElement, value: str):
|
|
115
|
+
dropdown_option_id = DropdownUtils.__findDropdownOptionId(wait, combobox)
|
|
116
|
+
DropdownUtils.__clickCombobox(wait, combobox)
|
|
117
|
+
DropdownUtils.__selectDropdownValueByDropdownOptionId(wait, dropdown_option_id, value)
|
|
146
118
|
|
|
147
119
|
@staticmethod
|
|
148
|
-
def
|
|
149
|
-
wait
|
|
150
|
-
):
|
|
151
|
-
xpath = f'.//div[./div/span[normalize-space(text())="{dropdown_label}"]]/div/div/div/div[@role="combobox" and @tabindex="0"]'
|
|
152
|
-
DropdownUtils.__selectSearchDropdownValueByXpath(wait, xpath, value)
|
|
120
|
+
def selectDropdownValueByLabelText(wait: WebDriverWait, dropdown_label: str, value: str):
|
|
121
|
+
DropdownUtils.__selectDropdownValueByLabelText(wait, dropdown_label, value)
|
|
153
122
|
|
|
154
123
|
@staticmethod
|
|
155
|
-
def
|
|
156
|
-
wait
|
|
157
|
-
):
|
|
158
|
-
xpath = f'.//div[./div/span[contains(normalize-space(text()), "{dropdown_label}")]]/div/div/div/div[@role="combobox" and @tabindex="0"]'
|
|
159
|
-
DropdownUtils.__selectSearchDropdownValueByXpath(wait, xpath, value)
|
|
124
|
+
def selectDropdownValueByPartialLabelText(wait: WebDriverWait, dropdown_label: str, value: str):
|
|
125
|
+
DropdownUtils.__selectDropdownValueByPartialLabelText(wait, dropdown_label, value)
|
|
160
126
|
|
|
161
127
|
@staticmethod
|
|
162
|
-
def
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
combobox = component.find_element(By.XPATH, xpath)
|
|
168
|
-
except TimeoutError as e:
|
|
169
|
-
raise TimeoutError(
|
|
170
|
-
f'Could not find combobox element with xpath "{xpath}" in the provided component: {str(e)}'
|
|
171
|
-
)
|
|
172
|
-
except Exception as e:
|
|
173
|
-
raise Exception(
|
|
174
|
-
f'Could not find combobox element with xpath "{xpath}" in the provided component: {str(e)}'
|
|
175
|
-
)
|
|
176
|
-
DropdownUtils.selectDropdownValueByComponent(wait, combobox, value)
|
|
177
|
-
return combobox
|
|
128
|
+
def checkDropdownOptionValueExists(wait: WebDriverWait, dropdown_label: str, value: str):
|
|
129
|
+
combobox = DropdownUtils.__findComboboxByLabelText(wait, dropdown_label)
|
|
130
|
+
DropdownUtils.__clickCombobox(wait, combobox)
|
|
131
|
+
dropdown_option_id = DropdownUtils.__findDropdownOptionId(wait, combobox)
|
|
132
|
+
return DropdownUtils.__checkDropdownOptionValueExistsByDropdownOptionId(wait, dropdown_option_id, value)
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
from selenium.webdriver.support.ui import WebDriverWait
|
|
2
|
+
from selenium.webdriver.support import expected_conditions as EC
|
|
3
|
+
from selenium.webdriver.common.by import By
|
|
4
|
+
from robo_appian.components.InputUtils import InputUtils
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
class SearchDropdownUtils:
|
|
8
|
+
"""
|
|
9
|
+
Utility class for interacting with search dropdown components in Appian UI.
|
|
10
|
+
Usage Example:
|
|
11
|
+
# Select a value from a search dropdown
|
|
12
|
+
from robo_appian.components.SearchDropdownUtils import SearchDropdownUtils
|
|
13
|
+
SearchDropdownUtils.selectSearchDropdownValueByLabelText(wait, "Status", "Approved")
|
|
14
|
+
"""
|
|
15
|
+
|
|
16
|
+
@staticmethod
|
|
17
|
+
def __selectSearchDropdownValueByDropdownOptionId(wait, component_id, dropdown_option_id, value):
|
|
18
|
+
input_component_id = str(component_id) + "_searchInput"
|
|
19
|
+
try:
|
|
20
|
+
input_component = wait.until(EC.element_to_be_clickable((By.ID, input_component_id)))
|
|
21
|
+
except Exception as e:
|
|
22
|
+
raise RuntimeError(f"Failed to locate or click input component with ID '{input_component_id}': {e}")
|
|
23
|
+
InputUtils._setComponentValue(input_component, value)
|
|
24
|
+
|
|
25
|
+
xpath = f'.//ul[@id="{dropdown_option_id}"]/li[./div[normalize-space(text())="{value}"]][1]'
|
|
26
|
+
try:
|
|
27
|
+
component = wait.until(EC.element_to_be_clickable((By.XPATH, xpath)))
|
|
28
|
+
except Exception as e:
|
|
29
|
+
raise RuntimeError(f"Failed to locate or click dropdown option with XPath '{xpath}': {e}")
|
|
30
|
+
component.click()
|
|
31
|
+
|
|
32
|
+
@staticmethod
|
|
33
|
+
def __selectSearchDropdownValueByPartialLabelText(wait: WebDriverWait, label: str, value: str):
|
|
34
|
+
xpath = f'.//div[./div/span[contains(normalize-space(text()), "{label}")]]/div/div/div/div[@role="combobox" and not(@aria-disabled="true")]'
|
|
35
|
+
try:
|
|
36
|
+
component = wait.until(EC.element_to_be_clickable((By.XPATH, xpath)))
|
|
37
|
+
except Exception as e:
|
|
38
|
+
raise RuntimeError(f"Failed to locate or click dropdown component with XPath '{xpath}': {e}")
|
|
39
|
+
component_id = component.get_attribute("aria-labelledby")
|
|
40
|
+
dropdown_id = component.get_attribute("aria-controls")
|
|
41
|
+
component.click()
|
|
42
|
+
|
|
43
|
+
SearchDropdownUtils.__selectSearchDropdownValueByDropdownOptionId(wait, component_id, dropdown_id, value)
|
|
44
|
+
|
|
45
|
+
@staticmethod
|
|
46
|
+
def __selectSearchDropdownValueByLabelText(wait: WebDriverWait, label: str, value: str):
|
|
47
|
+
xpath = f'.//div[./div/span[normalize-space(text())="{label}"]]/div/div/div/div[@role="combobox" and not(@aria-disabled="true")]'
|
|
48
|
+
try:
|
|
49
|
+
component = wait.until(EC.element_to_be_clickable((By.XPATH, xpath)))
|
|
50
|
+
except Exception as e:
|
|
51
|
+
raise RuntimeError(f"Failed to locate or click dropdown component with XPath '{xpath}': {e}")
|
|
52
|
+
component_id = component.get_attribute("aria-labelledby")
|
|
53
|
+
dropdown_option_id = component.get_attribute("aria-controls")
|
|
54
|
+
component.click()
|
|
55
|
+
SearchDropdownUtils.__selectSearchDropdownValueByDropdownOptionId(wait, component_id, dropdown_option_id, value)
|
|
56
|
+
|
|
57
|
+
@staticmethod
|
|
58
|
+
def selectSearchDropdownValueByLabelText(wait: WebDriverWait, dropdown_label: str, value: str):
|
|
59
|
+
"""Selects a value from a search dropdown by label text.
|
|
60
|
+
Args:
|
|
61
|
+
wait (WebDriverWait): The WebDriverWait instance to use for waiting.
|
|
62
|
+
dropdown_label (str): The label text of the dropdown.
|
|
63
|
+
value (str): The value to select from the dropdown.
|
|
64
|
+
"""
|
|
65
|
+
SearchDropdownUtils.__selectSearchDropdownValueByLabelText(wait, dropdown_label, value)
|
|
66
|
+
|
|
67
|
+
@staticmethod
|
|
68
|
+
def selectSearchDropdownValueByPartialLabelText(wait: WebDriverWait, dropdown_label: str, value: str):
|
|
69
|
+
"""Selects a value from a search dropdown by partial label text.
|
|
70
|
+
Args:
|
|
71
|
+
wait (WebDriverWait): The WebDriverWait instance to use for waiting.
|
|
72
|
+
dropdown_label (str): The label text of the dropdown.
|
|
73
|
+
value (str): The value to select from the dropdown.
|
|
74
|
+
"""
|
|
75
|
+
SearchDropdownUtils.__selectSearchDropdownValueByPartialLabelText(wait, dropdown_label, value)
|
|
@@ -7,6 +7,7 @@ from robo_appian.components.LabelUtils import LabelUtils
|
|
|
7
7
|
from robo_appian.components.LinkUtils import LinkUtils
|
|
8
8
|
from robo_appian.components.TabUtils import TabUtils
|
|
9
9
|
from robo_appian.components.SearchInputUtils import SearchInputUtils
|
|
10
|
+
from robo_appian.components.SearchDropdownUtils import SearchDropdownUtils
|
|
10
11
|
|
|
11
12
|
|
|
12
13
|
class ComponentDriver:
|
|
@@ -49,9 +50,7 @@ class ComponentDriver:
|
|
|
49
50
|
case "Search Input Text":
|
|
50
51
|
match action:
|
|
51
52
|
case "Select":
|
|
52
|
-
SearchInputUtils.selectSearchDropdownByLabelText(
|
|
53
|
-
wait, label, value
|
|
54
|
-
)
|
|
53
|
+
SearchInputUtils.selectSearchDropdownByLabelText(wait, label, value)
|
|
55
54
|
case _:
|
|
56
55
|
raise ValueError(f"Unsupported action for {type}: {action}")
|
|
57
56
|
case "Label":
|
|
@@ -75,9 +74,7 @@ class ComponentDriver:
|
|
|
75
74
|
case "Search Drop Down":
|
|
76
75
|
match action:
|
|
77
76
|
case "Select":
|
|
78
|
-
|
|
79
|
-
wait, label, value
|
|
80
|
-
)
|
|
77
|
+
SearchDropdownUtils.selectSearchDropdownValueByLabelText(wait, label, value)
|
|
81
78
|
case _:
|
|
82
79
|
raise ValueError(f"Unsupported action for {type}: {action}")
|
|
83
80
|
case "Button":
|
|
@@ -4,6 +4,7 @@ from selenium.webdriver.common.by import By
|
|
|
4
4
|
from selenium.webdriver.common.keys import Keys
|
|
5
5
|
from selenium.webdriver.support import expected_conditions as EC
|
|
6
6
|
from selenium.webdriver.remote.webdriver import WebDriver
|
|
7
|
+
from selenium.webdriver.remote.webelement import WebElement
|
|
7
8
|
from selenium.webdriver.support.ui import WebDriverWait
|
|
8
9
|
|
|
9
10
|
|
|
@@ -37,6 +38,10 @@ class ComponentUtils:
|
|
|
37
38
|
yesterday_formatted = yesterday.strftime("%m/%d/%Y")
|
|
38
39
|
return yesterday_formatted
|
|
39
40
|
|
|
41
|
+
@staticmethod
|
|
42
|
+
def findChildComponent(wait: WebDriverWait, component: WebElement, xpath: str):
|
|
43
|
+
return component.find_element(By.XPATH, xpath)
|
|
44
|
+
|
|
40
45
|
@staticmethod
|
|
41
46
|
def findSuccessMessage(wait: WebDriverWait, message: str):
|
|
42
47
|
"""
|
|
@@ -161,9 +166,7 @@ class ComponentUtils:
|
|
|
161
166
|
length = 0
|
|
162
167
|
|
|
163
168
|
try:
|
|
164
|
-
component = wait.until(
|
|
165
|
-
EC.presence_of_all_elements_located((By.XPATH, xpath))
|
|
166
|
-
)
|
|
169
|
+
component = wait.until(EC.presence_of_all_elements_located((By.XPATH, xpath)))
|
|
167
170
|
length = len(component)
|
|
168
171
|
except NoSuchElementException:
|
|
169
172
|
pass
|
|
@@ -1,21 +1,22 @@
|
|
|
1
1
|
robo_appian/__init__.py,sha256=6u9n2W7P1IKSSr5IPGsg7LhVR1o1uYv424mXDjJLgb0,720
|
|
2
|
-
robo_appian/components/ButtonUtils.py,sha256=
|
|
2
|
+
robo_appian/components/ButtonUtils.py,sha256=cNCQ21BCbSIqO8gaz0CxBaGx_uQf4Cbrw-YpDEpWfYo,1764
|
|
3
3
|
robo_appian/components/DateUtils.py,sha256=yewRjKarXj6xMA0RtiXu_ZshGXEkkhAu1bmq01uug74,5117
|
|
4
|
-
robo_appian/components/DropdownUtils.py,sha256=
|
|
4
|
+
robo_appian/components/DropdownUtils.py,sha256=11XJ96n1ZcoUaH157Y1I35FaZ53ZmlJnYnPSzy7L1k0,6454
|
|
5
5
|
robo_appian/components/InputUtils.py,sha256=GDLn3ZZ8YrO6NfNgiRH9q1qaHdsE8v1nZTSH4jc3tgw,5102
|
|
6
6
|
robo_appian/components/LabelUtils.py,sha256=bhMM2_lTyx8839ia__8qXVqAhTvnsgPCe7AIcEFYEN0,1654
|
|
7
7
|
robo_appian/components/LinkUtils.py,sha256=R8B4xj7V6agyz9m2GFt_jQQE8yjHPd6R5T3Pn8YRxCk,1397
|
|
8
|
+
robo_appian/components/SearchDropdownUtils.py,sha256=6Rsw3PiJZ6UnPWimNGZeHIwYDPGiuACjlx0_2VBwVbs,4040
|
|
8
9
|
robo_appian/components/SearchInputUtils.py,sha256=EKajPjmeuEHwY4aswHXAEhO8I4igS3icWovK_rZV6K8,3064
|
|
9
10
|
robo_appian/components/TabUtils.py,sha256=e3zk9hPXwynyA0aEIr5DEm2wpSvT8yewqKAUyWYUjzw,2575
|
|
10
11
|
robo_appian/components/TableUtils.py,sha256=X0iA7saWm72Qgz_oZ4dnE3wp8-44Xdj16zzUnazGUIQ,6062
|
|
11
12
|
robo_appian/components/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
12
|
-
robo_appian/controllers/ComponentDriver.py,sha256=
|
|
13
|
+
robo_appian/controllers/ComponentDriver.py,sha256=QD2tEIJnl0bLwx9Vt7UQMnQVkg5Ke9287kOjQGSXY8g,4318
|
|
13
14
|
robo_appian/controllers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
14
15
|
robo_appian/exceptions/MyCustomError.py,sha256=DVAkytXNNQNjqyTyCjk6FFd6fr3AsBe57Y19erDSqVs,222
|
|
15
16
|
robo_appian/exceptions/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
16
|
-
robo_appian/utils/ComponentUtils.py,sha256=
|
|
17
|
+
robo_appian/utils/ComponentUtils.py,sha256=Oa4XMey0Gm9lLF0bumrNBB0Z3BKljjwe9Zq3BSNm4Vk,8578
|
|
17
18
|
robo_appian/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
18
|
-
robo_appian-0.0.
|
|
19
|
-
robo_appian-0.0.
|
|
20
|
-
robo_appian-0.0.
|
|
21
|
-
robo_appian-0.0.
|
|
19
|
+
robo_appian-0.0.11.dist-info/LICENSE,sha256=g-xR4dRa9_4iFkMoJmED-wE-J5hoxbk3105Knhfpjm0,1068
|
|
20
|
+
robo_appian-0.0.11.dist-info/METADATA,sha256=URLQoo4GP1ZYNqhrHidlKlIup_yk56igJHaA407Otp4,4105
|
|
21
|
+
robo_appian-0.0.11.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
|
|
22
|
+
robo_appian-0.0.11.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|