robo_appian 0.0.11__py3-none-any.whl → 0.0.12__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.

@@ -4,8 +4,30 @@ from selenium.webdriver.support.ui import WebDriverWait
4
4
 
5
5
 
6
6
  class ButtonUtils:
7
+ """
8
+ Utility class for interacting with button components in Appian UI.
9
+ Usage Example:
10
+ # Click a button by its label
11
+ from robo_appian.components.ButtonUtils import ButtonUtils
12
+ ButtonUtils.clickByLabelText(wait, "Submit")
13
+ """
14
+
7
15
  @staticmethod
8
- def find(wait: WebDriverWait, label: str):
16
+ def __findByLabelText(wait: WebDriverWait, label: str):
17
+ """
18
+ Finds a button by its label.
19
+
20
+ Parameters:
21
+ wait: Selenium WebDriverWait instance.
22
+ label: The label of the button to find.
23
+ label: The label of the button to find.
24
+
25
+ Returns:
26
+ WebElement representing the button.
27
+
28
+ Example:
29
+ component = ButtonUtils.__findByLabelText(wait, "Submit")
30
+ """
9
31
  xpath = f".//button[./span[contains(translate(normalize-space(.), '\u00a0', ' '), '{label}')]]"
10
32
  try:
11
33
  component = wait.until(EC.element_to_be_clickable((By.XPATH, xpath)))
@@ -14,22 +36,20 @@ class ButtonUtils:
14
36
  return component
15
37
 
16
38
  @staticmethod
17
- def click(wait: WebDriverWait, label: str):
18
- """
19
- Clicks a button identified by its label.
39
+ def clickByLabelText(wait: WebDriverWait, label: str):
40
+ """Finds a button by its label and clicks it.
20
41
 
21
42
  Parameters:
22
43
  wait: Selenium WebDriverWait instance.
23
- label: The visible text label of the button.
24
- Example:
25
- ButtonUtils.click(wait, "Submit")
26
-
44
+ label: The label of the button to click.
45
+ Example:
46
+ ButtonUtils.clickByLabelText(wait, "Button Label")
27
47
  """
28
- component = ButtonUtils.find(wait, label)
48
+ component = ButtonUtils.__findByLabelText(wait, label)
29
49
  component.click()
30
50
 
31
51
  @staticmethod
32
- def clickInputButtonById(wait: WebDriverWait, id: str):
52
+ def clickById(wait: WebDriverWait, id: str):
33
53
  """
34
54
  Finds and clicks an input button by its HTML id attribute.
35
55
 
@@ -38,13 +58,11 @@ class ButtonUtils:
38
58
  id: The HTML id of the input button.
39
59
 
40
60
  Example:
41
- ButtonUtils.clickInputButtonById(wait, "button_id")
61
+ ButtonUtils.clickById(wait, "button_id")
42
62
 
43
63
  """
44
64
  try:
45
65
  component = wait.until(EC.element_to_be_clickable((By.ID, id)))
46
- except TimeoutError as e:
47
- raise TimeoutError(f"Input button with id '{id}' not found or not clickable.") from e
48
66
  except Exception as e:
49
67
  raise RuntimeError(f"Input button with id '{id}' not found or not clickable.") from e
50
68
 
@@ -1,7 +1,6 @@
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
5
4
 
6
5
  from robo_appian.components.InputUtils import InputUtils
7
6
 
@@ -9,137 +8,70 @@ from robo_appian.components.InputUtils import InputUtils
9
8
  class DateUtils:
10
9
  """
11
10
  Utility class for interacting with date components in Appian UI.
12
-
13
- Usage Example:
14
-
15
- # Set a date value
11
+ Usage Example:
12
+ # Set a date value in a date component
16
13
  from robo_appian.components.DateUtils import DateUtils
17
- DateUtils.setDateValue(wait, "Start Date", "01/01/2024")
18
-
14
+ DateUtils.setValueByLabelText(wait, "Start Date", "2023-10-01")
19
15
  """
20
16
 
21
17
  @staticmethod
22
- def findComponent(wait: WebDriverWait, label: str):
18
+ def __findComponent(wait: WebDriverWait, label: str):
23
19
  """
24
20
  Finds a date component by its label.
25
-
26
- Parameters:
27
- wait: Selenium WebDriverWait instance.
28
- label: The visible text label of the date component.
29
-
30
- Returns:
31
- The Selenium WebElement for the date component.
32
-
21
+ :param wait: WebDriverWait instance to wait for elements.
22
+ :param label: The label of the date component.
23
+ :return: The WebElement representing the date component.
33
24
  Example:
34
- DateUtils.findComponent(wait, "Start Date")
35
-
25
+ DateUtils.__findComponent(wait, "Start Date")
36
26
  """
37
-
38
- xpath = f".//div/label[text()='{label}']"
39
- try:
40
- component: WebElement = wait.until(
41
- EC.element_to_be_clickable((By.XPATH, xpath))
42
- )
43
- except TimeoutError as e:
44
- raise TimeoutError(
45
- f"Could not find clickable date component with label '{label}': {e}"
46
- )
47
- except Exception as e:
48
- raise Exception(
49
- f"Could not find clickable date component with label '{label}': {e}"
50
- )
51
-
52
- attribute: str = "for"
53
- component_id = component.get_attribute(attribute) # type: ignore[reportUnknownMemberType]
54
- if component_id is None:
55
- raise ValueError(
56
- f"Could not find component using {attribute} attribute for label '{label}'."
57
- )
58
-
27
+ # xpath = f".//div/label[text()='{label}']"
28
+ # try:
29
+ # component: WebElement = wait.until(EC.element_to_be_clickable((By.XPATH, xpath)))
30
+ # except Exception as e:
31
+ # raise Exception(f"Could not find clickable date component with label '{label}': {e}")
32
+
33
+ # attribute: str = "for"
34
+ # component_id = component.get_attribute(attribute) # type: ignore[reportUnknownMemberType]
35
+ # if component_id is None:
36
+ # raise ValueError(f"Could not find component using {attribute} attribute for label '{label}'.")
37
+
38
+ # try:
39
+ # component = wait.until(EC.element_to_be_clickable((By.ID, component_id)))
40
+ # except Exception as e:
41
+ # raise Exception(f"Could not find clickable date input with id '{component_id}': {e}")
42
+
43
+ xpath = f'.//div[./div/label[text()="{label}"]]/div/div/div/input'
59
44
  try:
60
- component = wait.until(EC.element_to_be_clickable((By.ID, component_id)))
61
- except TimeoutError as e:
62
- raise TimeoutError(
63
- f"Could not find clickable date input with id '{component_id}': {e}"
64
- )
45
+ component = wait.until(EC.element_to_be_clickable((By.XPATH, xpath)))
65
46
  except Exception as e:
66
- raise Exception(
67
- f"Could not find clickable date input with id '{component_id}': {e}"
68
- )
47
+ raise Exception(f"Could not find clickable date component with label '{label}': {e}")
69
48
  return component
70
49
 
71
50
  @staticmethod
72
- def setDateValue(wait: WebDriverWait, label: str, value: str):
51
+ def setValueByLabelText(wait: WebDriverWait, label: str, value: str):
73
52
  """
74
- Sets a date value in a date component identified by its label.
75
-
76
- Parameters:
77
- wait: Selenium WebDriverWait instance.
78
- label: The visible text label of the date component.
79
- value: The date value to set (e.g., "01/01/2024").
80
-
81
- Returns:
82
- The Selenium WebElement for the date component after setting the value.
83
-
53
+ Sets the value of a date component.
54
+ :param wait: WebDriverWait instance to wait for elements.
55
+ :param label: The label of the date component.
56
+ :param value: The value to set in the date component.
57
+ :return: The WebElement representing the date component.
84
58
  Example:
85
- DateUtils.setDateValue(wait, "Start Date", "01/01/2024")
86
-
59
+ DateUtils.setValueByLabelText(wait, "Start Date", "2023-10-01")
87
60
  """
88
- # This method locates a date component that contains a label with the specified text.
89
- # It then retrieves the component's ID and uses it to find the actual input element.
90
- # component = wait.until(EC.element_to_be_clickable((By.XPATH, f".//div/label[text()='{label}']/following-sibling::input")))
91
-
92
- component = DateUtils.findComponent(wait, label)
93
- InputUtils._setComponentValue(component, value)
61
+ component = DateUtils.__findComponent(wait, label)
62
+ InputUtils._setValueByComponent(component, value)
94
63
  return component
95
64
 
96
65
  @staticmethod
97
- def setDateValueAndSubmit(wait: WebDriverWait, label: str, value: str):
66
+ def clickByLabelText(wait: WebDriverWait, label: str):
98
67
  """
99
- Sets a date value in a date component identified by its label and submits the form.
100
-
101
- Parameters:
102
- wait: Selenium WebDriverWait instance.
103
- label: The visible text label of the date component.
104
- value: The date value to set (e.g., "01/01/2024").
105
-
106
- Returns:
107
- The Selenium WebElement for the date component after setting the value.
108
-
68
+ Clicks on the date component to open the date picker.
69
+ :param wait: WebDriverWait instance to wait for elements.
70
+ :param label: The label of the date component.
71
+ :return: The WebElement representing the date component.
109
72
  Example:
110
- DateUtils.setDateValueAndSubmit(wait, "Start Date", "01/01/2024")
111
-
73
+ DateUtils.clickByLabelText(wait, "Start Date")
112
74
  """
113
-
114
- # This method locates a date component that contains a label with the specified text.
115
- # It then retrieves the component's ID and uses it to find the actual input element.
116
- # It sets the value of the input element and submits it.
117
-
118
- component = DateUtils.findComponent(wait, label)
119
- InputUtils.setValueAndSubmitByComponent(component, value)
120
-
121
- return component
122
-
123
- @staticmethod
124
- def click(wait: WebDriverWait, label: str):
125
- """
126
- Clicks on a date component identified by its label.
127
-
128
- Parameters:
129
- wait: Selenium WebDriverWait instance.
130
- label: The visible text label of the date component.
131
-
132
- Returns:
133
- The Selenium WebElement for the date component after clicking.
134
-
135
- Example:
136
- DateUtils.click(wait, "Start Date")
137
- """
138
- # This method locates a date component that contains a label with the specified text.
139
- # It then retrieves the component's ID and uses it to find the actual input element.
140
- # It clicks on the input element to open the date picker.
141
-
142
- component = DateUtils.findComponent(wait, label)
75
+ component = DateUtils.__findComponent(wait, label)
143
76
  component.click()
144
-
145
77
  return component
@@ -16,7 +16,16 @@ class DropdownUtils:
16
16
 
17
17
  @staticmethod
18
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")]'
19
+ """
20
+ Finds a combobox by its partial label text.
21
+
22
+ :param wait: Selenium WebDriverWait instance.
23
+ :param label: The partial label of the combobox to find.
24
+ :return: WebElement representing the combobox.
25
+ Example:
26
+ component = DropdownUtils.__findComboboxByPartialLabelText(wait, "Dropdown Label")
27
+ """
28
+ xpath = f'.//div[./div/span[contains(normalize-space(text()), "{label}")]]/div/div/div/div[@role="combobox" and not(@aria-disabled="true")]' # noqa: E501
20
29
  try:
21
30
  component = wait.until(EC.element_to_be_clickable((By.XPATH, xpath)))
22
31
  except Exception as e:
@@ -26,7 +35,16 @@ class DropdownUtils:
26
35
 
27
36
  @staticmethod
28
37
  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")]'
38
+ """
39
+ Finds a combobox by its label text.
40
+
41
+ :param wait: Selenium WebDriverWait instance.
42
+ :param label: The label of the combobox to find.
43
+ :return: WebElement representing the combobox.
44
+ Example:
45
+ component = DropdownUtils.__findComboboxByLabelText(wait, "Dropdown Label")
46
+ """
47
+ xpath = f'.//div[./div/span[normalize-space(text())="{label}"]]/div/div/div/div[@role="combobox" and not(@aria-disabled="true")]' # noqa: E501
30
48
  try:
31
49
  component = wait.until(EC.element_to_be_clickable((By.XPATH, xpath)))
32
50
  except Exception as e:
@@ -36,10 +54,27 @@ class DropdownUtils:
36
54
 
37
55
  @staticmethod
38
56
  def __clickCombobox(wait: WebDriverWait, combobox: WebElement):
57
+ """
58
+ Clicks the combobox to open the dropdown options.
59
+
60
+ :param wait: WebDriverWait instance to wait for elements.
61
+ :param combobox: The combobox WebElement.
62
+ Example:
63
+ DropdownUtils.__clickCombobox(wait, combobox)
64
+ """
39
65
  combobox.click()
40
66
 
41
67
  @staticmethod
42
68
  def __findDropdownOptionId(wait: WebDriverWait, combobox: WebElement):
69
+ """
70
+ Finds the dropdown option id from the combobox.
71
+
72
+ :param wait: WebDriverWait instance to wait for elements.
73
+ :param combobox: The combobox WebElement.
74
+ :return: The id of the dropdown options list.
75
+ Example:
76
+ dropdown_option_id = DropdownUtils.__findDropdownOptionId(wait, combobox)
77
+ """
43
78
  dropdown_option_id = combobox.get_attribute("aria-controls")
44
79
  if dropdown_option_id is None:
45
80
  raise Exception('Dropdown component does not have a valid "aria-controls" attribute.')
@@ -47,9 +82,23 @@ class DropdownUtils:
47
82
 
48
83
  @staticmethod
49
84
  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}"]]'
85
+ """
86
+ Checks if a dropdown option value exists by its option id and value.
87
+
88
+ :param wait: WebDriverWait instance to wait for elements.
89
+ :param dropdown_option_id: The id of the dropdown options list.
90
+ :param value: The value to check in the dropdown.
91
+ Example:
92
+ exists = DropdownUtils.checkDropdownOptionValueExistsByDropdownOptionId(wait, "dropdown_option_id", "Option Value")
93
+ if exists:
94
+ print("The value exists in the dropdown.")
95
+ else:
96
+ print("The value does not exist in the dropdown.")
97
+ """
98
+
99
+ xpath = f'.//div/ul[@id="{dropdown_option_id}"]/li[./div[normalize-space(text())="{value}"]]'
51
100
  try:
52
- wait.until(EC.element_to_be_clickable((By.XPATH, option_xpath)))
101
+ wait.until(EC.element_to_be_clickable((By.XPATH, xpath)))
53
102
  return True
54
103
  except NoSuchElementException:
55
104
  return False
@@ -58,6 +107,15 @@ class DropdownUtils:
58
107
 
59
108
  @staticmethod
60
109
  def __selectDropdownValueByDropdownOptionId(wait: WebDriverWait, dropdown_option_id: str, value: str):
110
+ """
111
+ Selects a value from a dropdown by its option id and value.
112
+
113
+ :param wait: WebDriverWait instance to wait for elements.
114
+ :param dropdown_option_id: The id of the dropdown options list.
115
+ :param value: The value to select from the dropdown.
116
+ Example:
117
+ DropdownUtils.selectDropdownValueByDropdownOptionId(wait, "dropdown_option_id", "Option Value")
118
+ """
61
119
  option_xpath = f'.//div/ul[@id="{dropdown_option_id}"]/li[./div[normalize-space(text())="{value}"]]'
62
120
  try:
63
121
  try:
@@ -65,7 +123,7 @@ class DropdownUtils:
65
123
  component = wait.until(EC.element_to_be_clickable((By.XPATH, option_xpath)))
66
124
  except Exception as e:
67
125
  raise Exception(
68
- f'Could not locate or click dropdown option "{value}" with dropdown option id "{dropdown_option_id}": {str(e)}'
126
+ f'Could not locate or click dropdown option "{value}" with dropdown option id "{dropdown_option_id}": {str(e)}' # noqa: E501
69
127
  )
70
128
  except Exception as e:
71
129
  raise Exception(f'Could not find or click dropdown option "{value}" with xpath "{option_xpath}": {str(e)}')
@@ -101,6 +159,19 @@ class DropdownUtils:
101
159
 
102
160
  @staticmethod
103
161
  def checkReadOnlyStatusByLabelText(wait: WebDriverWait, label: str):
162
+ """
163
+ Checks if a dropdown is read-only by its label text.
164
+
165
+ :param wait: WebDriverWait instance to wait for elements.
166
+ :param label: The label of the dropdown.
167
+ :return: True if the dropdown is read-only, False otherwise.
168
+ Example:
169
+ is_read_only = DropdownUtils.checkReadOnlyStatusByLabelText(wait, "Dropdown Label")
170
+ if is_read_only:
171
+ print("The dropdown is read-only.")
172
+ else:
173
+ print("The dropdown is editable.")
174
+ """
104
175
  xpath = f'.//div[./div/span[normalize-space(text())="{label}"]]/div/div/p[text()]'
105
176
  try:
106
177
  wait._driver.find_element(By.XPATH, xpath)
@@ -112,20 +183,61 @@ class DropdownUtils:
112
183
 
113
184
  @staticmethod
114
185
  def selectDropdownValueByComboboxComponent(wait: WebDriverWait, combobox: WebElement, value: str):
186
+ """
187
+ Selects a value from a dropdown using the combobox component.
188
+
189
+ :param wait: WebDriverWait instance to wait for elements.
190
+ :param combobox: The combobox WebElement.
191
+ :param value: The value to select from the dropdown.
192
+ Example:
193
+ DropdownUtils.selectDropdownValueByComboboxComponent(wait, combobox, "Option Value")
194
+ """
115
195
  dropdown_option_id = DropdownUtils.__findDropdownOptionId(wait, combobox)
116
196
  DropdownUtils.__clickCombobox(wait, combobox)
117
197
  DropdownUtils.__selectDropdownValueByDropdownOptionId(wait, dropdown_option_id, value)
118
198
 
119
199
  @staticmethod
120
200
  def selectDropdownValueByLabelText(wait: WebDriverWait, dropdown_label: str, value: str):
201
+ """
202
+ Selects a value from a dropdown by its label text.
203
+
204
+ :param wait: WebDriverWait instance to wait for elements.
205
+ :param dropdown_label: The label of the dropdown.
206
+ :param value: The value to select from the dropdown.
207
+ Example:
208
+ DropdownUtils.selectDropdownValueByLabelText(wait, "Dropdown Label", "Option Value")
209
+ """
121
210
  DropdownUtils.__selectDropdownValueByLabelText(wait, dropdown_label, value)
122
211
 
123
212
  @staticmethod
124
213
  def selectDropdownValueByPartialLabelText(wait: WebDriverWait, dropdown_label: str, value: str):
214
+ """
215
+ Selects a value from a dropdown by its partial label text.
216
+
217
+ :param wait: WebDriverWait instance to wait for elements.
218
+ :param dropdown_label: The partial label of the dropdown.
219
+ :param value: The value to select from the dropdown.
220
+ Example:
221
+ DropdownUtils.selectDropdownValueByPartialLabelText(wait, "Dropdown Label", "Option Value")
222
+ """
125
223
  DropdownUtils.__selectDropdownValueByPartialLabelText(wait, dropdown_label, value)
126
224
 
127
225
  @staticmethod
128
226
  def checkDropdownOptionValueExists(wait: WebDriverWait, dropdown_label: str, value: str):
227
+ """
228
+ Checks if a dropdown option value exists by its label text.
229
+
230
+ :param wait: WebDriverWait instance to wait for elements.
231
+ :param dropdown_label: The label of the dropdown.
232
+ :param value: The value to check in the dropdown.
233
+ :return: True if the value exists, False otherwise.
234
+ Example:
235
+ exists = DropdownUtils.checkDropdownOptionValueExists(wait, "Dropdown Label", "Option Value")
236
+ if exists:
237
+ print("The value exists in the dropdown.")
238
+ else:
239
+ print("The value does not exist in the dropdown.")
240
+ """
129
241
  combobox = DropdownUtils.__findComboboxByLabelText(wait, dropdown_label)
130
242
  DropdownUtils.__clickCombobox(wait, combobox)
131
243
  dropdown_option_id = DropdownUtils.__findDropdownOptionId(wait, combobox)
@@ -1,6 +1,5 @@
1
1
  from robo_appian.utils.ComponentUtils import ComponentUtils
2
2
  from selenium.webdriver.common.by import By
3
- from selenium.webdriver.common.keys import Keys
4
3
  from selenium.webdriver.support import expected_conditions as EC
5
4
  from selenium.webdriver.support.ui import WebDriverWait
6
5
  from selenium.webdriver.remote.webelement import WebElement
@@ -9,44 +8,31 @@ from selenium.webdriver.remote.webelement import WebElement
9
8
  class InputUtils:
10
9
  """
11
10
  Utility class for interacting with input components in Appian UI.
12
-
13
- Usage Example:
14
-
15
- # Set a value in an input field
11
+ Usage Example:
16
12
  from robo_appian.components.InputUtils import InputUtils
13
+
14
+ # Set a value in an input component by its label
17
15
  InputUtils.setValueByLabelText(wait, "Username", "test_user")
18
16
 
17
+ # Set a value in an input component by its ID
18
+ InputUtils.setValueById(wait, "inputComponentId", "test_value")
19
19
  """
20
20
 
21
21
  @staticmethod
22
- def setValueAndSubmitByComponent(component: WebElement, value: str):
22
+ def __findInputComponentsByXpath(wait: WebDriverWait, xpath: str):
23
23
  """
24
- Sets a value in an input component and submits it using the provided component element.
24
+ Finds input components by their XPath.
25
25
 
26
26
  Parameters:
27
- component: The Selenium WebElement for the input component.
28
- value: The value to set in the input field.
27
+ wait: Selenium WebDriverWait instance.
28
+ xpath: The XPath expression to locate the input components.
29
29
 
30
30
  Returns:
31
- The Selenium WebElement for the input component after setting the value and submitting.
31
+ A list of Selenium WebElement representing the input components.
32
32
 
33
33
  Example:
34
- InputUtils.setValueAndSubmitByComponent(component, "test_user")
35
-
34
+ InputUtils.__findInputComponentsByXpath(wait, './/div/label[normalize-space(text())="Username"]')
36
35
  """
37
- # This method assumes that the component is already found and passed as an argument.
38
-
39
- if not component.is_displayed():
40
- raise Exception(
41
- f"Component with label '{component.text}' is not displayed."
42
- )
43
-
44
- component = InputUtils._setComponentValue(component, value)
45
- component.send_keys(Keys.ENTER)
46
- return component
47
-
48
- @staticmethod
49
- def __findInputComponentsByXpath(wait: WebDriverWait, xpath: str):
50
36
  label_components = ComponentUtils.findComponentsByXPath(wait, xpath)
51
37
  input_components = []
52
38
  for label_component in label_components:
@@ -54,34 +40,62 @@ class InputUtils:
54
40
  component_id = label_component.get_attribute(attribute) # type: ignore[reportUnknownMemberType]
55
41
  if component_id:
56
42
  try:
57
- component = wait.until(
58
- EC.element_to_be_clickable((By.ID, component_id))
59
- )
43
+ component = wait.until(EC.element_to_be_clickable((By.ID, component_id)))
60
44
  input_components.append(component)
61
- except TimeoutError as e:
62
- raise TimeoutError(
63
- f"Timeout or error finding input component with id '{component_id}': {e}"
64
- )
65
45
  except Exception as e:
66
- raise Exception(
67
- f"Timeout or error finding input component with id '{component_id}': {e}"
68
- )
46
+ raise Exception(f"Could not find clickable input component with id '{component_id}': {e}")
47
+ else:
48
+ raise ValueError(f"Input component with label '{label_component.text}' does not have 'for' attribute.")
69
49
  return input_components
70
50
 
71
51
  @staticmethod
72
52
  def __findInputComponentsByPartialLabel(wait: WebDriverWait, label: str):
53
+ """Finds input components by their label text, allowing for partial matches.
54
+
55
+ Parameters:
56
+ wait: Selenium WebDriverWait instance.
57
+ label: The visible text label of the input component, allowing for partial matches.
58
+
59
+ Returns:
60
+ A list of Selenium WebElement representing the input components.
61
+
62
+ Example:
63
+ InputUtils.__findInputComponentsByPartialLabel(wait, "Username")
64
+ """
73
65
  xpath = f'.//div/label[contains(normalize-space(text()), "{label}")]'
74
66
  components = InputUtils.__findInputComponentsByXpath(wait, xpath)
75
67
  return components
76
68
 
77
69
  @staticmethod
78
- def __findInputComponentsByLabel(wait: WebDriverWait, label: str):
70
+ def __findComponentsByLabel(wait: WebDriverWait, label: str):
71
+ """Finds input components by their label text.
72
+
73
+ Parameters:
74
+ wait: Selenium WebDriverWait instance.
75
+ label: The visible text label of the input component.
76
+
77
+ Returns:
78
+ A list of Selenium WebElement representing the input components.
79
+
80
+ Example:
81
+ InputUtils.__findComponentsByLabel(wait, "Username")
82
+ """
79
83
  xpath = f'.//div/label[normalize-space(text())="{label}"]'
80
84
  components = InputUtils.__findInputComponentsByXpath(wait, xpath)
81
85
  return components
82
86
 
83
87
  @staticmethod
84
- def _setComponentValue(component: WebElement, value: str):
88
+ def _setValueByComponent(component: WebElement, value: str):
89
+ """
90
+ Sets a value in an input component.
91
+ Parameters:
92
+ component: The Selenium WebElement for the input component.
93
+ value: The value to set in the input field.
94
+ Returns:
95
+ The Selenium WebElement for the input component after setting the value.
96
+ Example:
97
+ InputUtils._setValueByComponent(component, "test_value")
98
+ """
85
99
  component.clear()
86
100
  component.send_keys(value)
87
101
  return component
@@ -101,7 +115,7 @@ class InputUtils:
101
115
  """
102
116
 
103
117
  for component in input_components:
104
- InputUtils._setComponentValue(component, value)
118
+ InputUtils._setValueByComponent(component, value)
105
119
 
106
120
  @staticmethod
107
121
  def setValueByPartialLabelText(wait: WebDriverWait, label: str, value: str):
@@ -110,20 +124,42 @@ class InputUtils:
110
124
 
111
125
  @staticmethod
112
126
  def setValueByLabelText(wait: WebDriverWait, label: str, value: str):
113
- input_components = InputUtils.__findInputComponentsByLabel(wait, label)
127
+ """
128
+ Sets a value in an input component identified by its label text.
129
+
130
+ Parameters:
131
+ wait: Selenium WebDriverWait instance.
132
+ label: The visible text label of the input component.
133
+ value: The value to set in the input field.
134
+
135
+ Returns:
136
+ None
137
+
138
+ Example:
139
+ InputUtils.setValueByLabelText(wait, "Username", "test_user")
140
+ """
141
+ input_components = InputUtils.__findComponentsByLabel(wait, label)
114
142
  InputUtils.__setValueByComponents(wait, input_components, value)
115
143
 
116
144
  @staticmethod
117
145
  def setValueById(wait: WebDriverWait, component_id: str, value: str):
146
+ """
147
+ Sets a value in an input component identified by its ID.
148
+
149
+ Parameters:
150
+ wait: Selenium WebDriverWait instance.
151
+ component_id: The ID of the input component.
152
+ value: The value to set in the input field.
153
+
154
+ Returns:
155
+ The Selenium WebElement for the input component after setting the value.
156
+
157
+ Example:
158
+ InputUtils.setValueById(wait, "inputComponentId", "test_value")
159
+ """
118
160
  try:
119
161
  component = wait.until(EC.element_to_be_clickable((By.ID, component_id)))
120
- except TimeoutError as e:
121
- raise TimeoutError(
122
- f"Timeout or error finding input component with id '{component_id}': {e}"
123
- )
124
162
  except Exception as e:
125
- raise Exception(
126
- f"Timeout or error finding input component with id '{component_id}': {e}"
127
- )
128
- InputUtils._setComponentValue(component, value)
163
+ raise Exception(f"Timeout or error finding input component with id '{component_id}': {e}")
164
+ InputUtils._setValueByComponent(component, value)
129
165
  return component
@@ -6,49 +6,41 @@ from selenium.webdriver.support.ui import WebDriverWait
6
6
  class LabelUtils:
7
7
  """
8
8
  Utility class for interacting with label components in Appian UI.
9
-
10
- Usage Example:
11
-
12
- # Find a label component
13
- from robo_appian.components.LabelUtils import LabelUtils
14
- label_component = LabelUtils.find(wait, "Username")
15
-
9
+ Usage Example:
10
+ # Find a label by its text
11
+ component = LabelUtils.findByLabelText(wait, "Submit")
12
+ # Click a label by its text
13
+ LabelUtils.clickByLabelText(wait, "Submit")
16
14
  """
17
15
 
18
16
  @staticmethod
19
- def find(wait: WebDriverWait, label: str):
17
+ def findByLabelText(wait: WebDriverWait, label: str):
20
18
  """
21
- Finds a label component by its text.
22
-
23
- Parameters:
24
- wait: Selenium WebDriverWait instance.
25
- label: The visible text label of the component.
26
-
27
- Returns:
28
- The Selenium WebElement for the label component.
19
+ Finds a label element by its text.
29
20
 
21
+ :param wait: Selenium WebDriverWait instance.
22
+ :param label: The text of the label to find.
23
+ :return: WebElement representing the label.
30
24
  Example:
31
- LabelUtils.find(wait, "Username")
32
-
25
+ component = LabelUtils.findByLabelText(wait, "Submit")
33
26
  """
34
- # This method locates a label component that contains the specified text.
35
- # It uses XPath to find the element that matches the text.
36
-
37
27
  xpath = f".//*[normalize-space(text())='{label}']"
38
28
  try:
39
29
  component = wait.until(EC.presence_of_element_located((By.XPATH, xpath)))
40
- except TimeoutError as e:
41
- raise TimeoutError(
42
- f"Label '{label}' not found within the timeout period."
43
- ) from e
44
30
  except Exception as e:
45
- raise Exception(
46
- f"Label '{label}' not found within the timeout period."
47
- ) from e
31
+ raise RuntimeError(f"Label with text '{label}' not found.") from e
48
32
 
49
33
  return component
50
34
 
51
35
  @staticmethod
52
- def click(wait: WebDriverWait, label: str):
53
- component = LabelUtils.find(wait, label)
36
+ def clickByLabelText(wait: WebDriverWait, label: str):
37
+ """
38
+ Clicks a label element identified by its text.
39
+
40
+ :param wait: Selenium WebDriverWait instance.
41
+ :param label: The text of the label to click.
42
+ Example:
43
+ LabelUtils.clickByLabelText(wait, "Submit")
44
+ """
45
+ component = LabelUtils.findByLabelText(wait, label)
54
46
  component.click()
@@ -5,14 +5,16 @@ from selenium.webdriver.support.ui import WebDriverWait
5
5
 
6
6
  class LinkUtils:
7
7
  """
8
- Utility class for interacting with link components in Appian UI.
9
-
10
- Usage Example:
11
-
12
- # Click a link with a specific label
8
+ Utility class for handling link operations in Selenium WebDriver.
9
+ Example usage:
10
+ from selenium import webdriver
11
+ from selenium.webdriver.support.ui import WebDriverWait
13
12
  from robo_appian.components.LinkUtils import LinkUtils
14
- LinkUtils.click(wait, "Learn More")
15
13
 
14
+ driver = webdriver.Chrome()
15
+ wait = WebDriverWait(driver, 10)
16
+ LinkUtils.click(wait, "Learn More")
17
+ driver.quit()
16
18
  """
17
19
 
18
20
  @staticmethod
@@ -21,9 +23,7 @@ class LinkUtils:
21
23
  try:
22
24
  component = wait.until(EC.element_to_be_clickable((By.XPATH, xpath)))
23
25
  except TimeoutError as e:
24
- raise TimeoutError(
25
- f"Could not find clickable link with label '{label}': {e}"
26
- )
26
+ raise TimeoutError(f"Could not find clickable link with label '{label}': {e}")
27
27
  except Exception as e:
28
28
  raise Exception(f"Could not find clickable link with label '{label}': {e}")
29
29
  return component
@@ -20,7 +20,7 @@ class SearchDropdownUtils:
20
20
  input_component = wait.until(EC.element_to_be_clickable((By.ID, input_component_id)))
21
21
  except Exception as e:
22
22
  raise RuntimeError(f"Failed to locate or click input component with ID '{input_component_id}': {e}")
23
- InputUtils._setComponentValue(input_component, value)
23
+ InputUtils._setValueByComponent(input_component, value)
24
24
 
25
25
  xpath = f'.//ul[@id="{dropdown_option_id}"]/li[./div[normalize-space(text())="{value}"]][1]'
26
26
  try:
@@ -6,22 +6,31 @@ from robo_appian.utils.ComponentUtils import ComponentUtils
6
6
 
7
7
 
8
8
  class SearchInputUtils:
9
+ """
10
+ Utility class for handling search input operations in Selenium WebDriver.
11
+ Example usage:
12
+ from selenium import webdriver
13
+ from selenium.webdriver.support.ui import WebDriverWait
14
+ from robo_appian.components.SearchInputUtils import SearchInputUtils
15
+
16
+ driver = webdriver.Chrome()
17
+ wait = WebDriverWait(driver, 10)
18
+ SearchInputUtils.selectSearchDropdownByLabelText(wait, "Search Label", "Value")
19
+ driver.quit()
20
+ """
21
+
9
22
  @staticmethod
10
- def __findSearchInputComponentsByLabelPathAndSelectValue(
11
- wait: WebDriverWait, xpath: str, value: str
12
- ):
23
+ def __findSearchInputComponentsByLabelPathAndSelectValue(wait: WebDriverWait, xpath: str, value: str):
13
24
  search_input_components = ComponentUtils.findComponentsByXPath(wait, xpath)
14
25
  input_components = []
15
26
  for search_input_component in search_input_components:
16
27
  attribute: str = "aria-controls"
17
28
  dropdown_list_id = search_input_component.get_attribute(attribute)
18
29
  if dropdown_list_id:
19
- InputUtils._setComponentValue(search_input_component, value)
30
+ InputUtils._setValueByComponent(search_input_component, value)
20
31
  xpath = f".//ul[@id='{dropdown_list_id}' and @role='listbox' ]/li[@role='option']/div/div/div/div/div/div/p[text()='{value}'][1]"
21
32
  try:
22
- drop_down_item = wait.until(
23
- EC.element_to_be_clickable((By.XPATH, xpath))
24
- )
33
+ drop_down_item = wait.until(EC.element_to_be_clickable((By.XPATH, xpath)))
25
34
  except TimeoutError as e:
26
35
  raise TimeoutError(
27
36
  f"Dropdown item with value '{value}' not found for component '{search_input_component.text}'."
@@ -39,33 +48,19 @@ class SearchInputUtils:
39
48
  return input_components
40
49
 
41
50
  @staticmethod
42
- def __selectSearchInputComponentsByPartialLabelText(
43
- wait: WebDriverWait, label: str, value: str
44
- ):
51
+ def __selectSearchInputComponentsByPartialLabelText(wait: WebDriverWait, label: str, value: str):
45
52
  xpath = f".//div[./div/span[contains(normalize-space(text())='{label}']]/div/div/div/input[@role='combobox']"
46
- SearchInputUtils.__findSearchInputComponentsByLabelPathAndSelectValue(
47
- wait, xpath, value
48
- )
53
+ SearchInputUtils.__findSearchInputComponentsByLabelPathAndSelectValue(wait, xpath, value)
49
54
 
50
55
  @staticmethod
51
- def __selectSearchInputComponentsByLabelText(
52
- wait: WebDriverWait, label: str, value: str
53
- ):
54
- xpath = (
55
- f".//div[./div/span[text()='{label}']]/div/div/div/input[@role='combobox']"
56
- )
57
- SearchInputUtils.__findSearchInputComponentsByLabelPathAndSelectValue(
58
- wait, xpath, value
59
- )
56
+ def __selectSearchInputComponentsByLabelText(wait: WebDriverWait, label: str, value: str):
57
+ xpath = f".//div[./div/span[text()='{label}']]/div/div/div/input[@role='combobox']"
58
+ SearchInputUtils.__findSearchInputComponentsByLabelPathAndSelectValue(wait, xpath, value)
60
59
 
61
60
  @staticmethod
62
61
  def selectSearchDropdownByLabelText(wait: WebDriverWait, label: str, value: str):
63
62
  SearchInputUtils.__selectSearchInputComponentsByLabelText(wait, label, value)
64
63
 
65
64
  @staticmethod
66
- def selectSearchDropdownByPartialLabelText(
67
- wait: WebDriverWait, label: str, value: str
68
- ):
69
- SearchInputUtils.__selectSearchInputComponentsByPartialLabelText(
70
- wait, label, value
71
- )
65
+ def selectSearchDropdownByPartialLabelText(wait: WebDriverWait, label: str, value: str):
66
+ SearchInputUtils.__selectSearchInputComponentsByPartialLabelText(wait, label, value)
@@ -4,36 +4,35 @@ from selenium.webdriver.support import expected_conditions as EC
4
4
 
5
5
  class TabUtils:
6
6
  """
7
- Utility class for interacting with tab components in Appian UI.
7
+ Utility class for handling tab components in a web application using Selenium.
8
+ Example usage:
9
+ from selenium import webdriver
10
+ from selenium.webdriver.support.ui import WebDriverWait
11
+ from robo_appian.components.TabUtils import TabUtils
8
12
 
9
- Usage Example:
13
+ driver = webdriver.Chrome()
14
+ wait = WebDriverWait(driver, 10)
10
15
 
11
- # Select a tab by its label
12
- from robo_appian.components.TabUtils import TabUtils
13
- TabUtils.selectInactiveTab(wait, "Settings")
16
+ # Find a selected tab by its label
17
+ selected_tab = TabUtils.findSelectedTabByLabelText(wait, "Tab Label")
14
18
 
15
- # Find the currently selected tab by its label
16
- from robo_appian.components.TabUtils import TabUtils
17
- selected_tab = TabUtils.findSelectedTab(wait, "Settings")
19
+ # Select an inactive tab by its label
20
+ TabUtils.selectInactiveTabByLabelText(wait, "Inactive Tab Label")
21
+
22
+ driver.quit()
18
23
  """
19
24
 
20
25
  @staticmethod
21
- def findSelectedTab(wait, label):
26
+ def findSelectedTabByLabelText(wait, label):
22
27
  """
23
28
  Finds the currently selected tab by its label.
24
29
 
25
- Parameters:
26
- wait: Selenium WebDriverWait instance.
27
- label: The visible text label of the tab.
28
-
29
- Returns:
30
- The Selenium WebElement for the selected tab.
31
-
30
+ :param wait: Selenium WebDriverWait instance.
31
+ :param label: The label of the tab to find.
32
+ :return: WebElement representing the selected tab.
32
33
  Example:
33
- TabUtils.findSelectedTab(wait, "Settings")
34
+ component = TabUtils.findSelectedTabByLabelText(wait, "Tab Label")
34
35
  """
35
- # This method locates a tab that is currently selected and contains the specified label.
36
-
37
36
  xpath = f".//div[./div[./div/div/div/div/div/p/strong[normalize-space(text())='{label}']]/span[text()='Selected Tab.']]/div[@role='link']"
38
37
  try:
39
38
  component = wait.until(EC.element_to_be_clickable((By.XPATH, xpath)))
@@ -44,21 +43,17 @@ class TabUtils:
44
43
  return component
45
44
 
46
45
  @staticmethod
47
- def selectInactiveTab(wait, label):
46
+ def selectInactiveTabByLabelText(wait, label):
48
47
  """
49
- Selects a tab by its label.
50
-
51
- Parameters:
52
- wait: Selenium WebDriverWait instance.
53
- label: The visible text label of the tab to select.
48
+ Selects an inactive tab by its label.
54
49
 
50
+ :param wait: Selenium WebDriverWait instance.
51
+ :param label: The label of the tab to select.
52
+ :return: None
55
53
  Example:
56
- TabUtils.selectInactiveTab(wait, "Settings")
54
+ TabUtils.selectInactiveTabByLabelText(wait, "Tab Label")
57
55
  """
58
- # This method locates a tab that contains a label with the specified text.
59
-
60
56
  xpath = f".//div[@role='link']/div/div/div/div/div[./p/span[text()='{label}']]"
61
- # xpath=f".//div[./div[./div/div/div/div/div/p/strong[normalize-space(text())='{label}']]/span[text()='Selected Tab.']]/div[@role='link']"
62
57
  try:
63
58
  component = wait.until(EC.element_to_be_clickable((By.XPATH, xpath)))
64
59
  except TimeoutError as e:
@@ -5,98 +5,77 @@ from selenium.webdriver.support.ui import WebDriverWait
5
5
 
6
6
  class TableUtils:
7
7
  """
8
- Utility class for interacting with table components in Appian UI.
9
-
10
- Usage Example:
11
-
12
- # Find a table using a column name
8
+ Utility class for handling table operations in Selenium WebDriver.
9
+ Example usage:
10
+ from selenium import webdriver
11
+ from selenium.webdriver.support.ui import WebDriverWait
13
12
  from robo_appian.components.TableUtils import TableUtils
13
+
14
+ driver = webdriver.Chrome()
15
+ wait = WebDriverWait(driver, 10)
14
16
  table = TableUtils.findTableByColumnName(wait, "Status")
17
+ row_count = TableUtils.rowCount(table)
18
+ component = TableUtils.findComponentFromTableCell(wait, 1, "Status")
19
+ driver.quit()
15
20
 
16
21
  """
17
22
 
18
23
  @staticmethod
19
24
  def findTableByColumnName(wait: WebDriverWait, columnName: str):
20
25
  """
21
- Finds a table component that contains a column with the specified name.
22
-
23
- Parameters:
24
- wait: Selenium WebDriverWait instance.
25
- columnName: The name of the column to search for in the table.
26
-
27
- Returns:
28
- The Selenium WebElement for the table component.
26
+ Finds a table component by its column name.
29
27
 
28
+ :param wait: Selenium WebDriverWait instance.
29
+ :param columnName: The name of the column to search for.
30
+ :return: WebElement representing the table.
30
31
  Example:
31
- table = TableUtils.findTableByColumnName(wait, "Status")
32
-
32
+ component = TableUtils.findTableByColumnName(wait, "Status")
33
33
  """
34
- # This method locates a table that contains a header cell with the specified column name.
35
- # It uses XPath to find the table element that has a header cell with the specified 'columnName'.
36
- # The 'abbr' attribute is used to match the column name, which is a common practice in Appian UI tables.
37
34
 
38
- # xpath = f".//table[./thead/tr/th[@abbr='{columnName}']]"
39
35
  xpath = f'.//table[./thead/tr/th[@abbr="{columnName}"]]'
40
36
  try:
41
37
  component = wait.until(EC.element_to_be_clickable((By.XPATH, xpath)))
42
38
  except TimeoutError as e:
43
- raise TimeoutError(
44
- f"Could not find table with column name '{columnName}': {e}"
45
- )
39
+ raise TimeoutError(f"Could not find table with column name '{columnName}': {e}")
46
40
  except Exception as e:
47
- raise RuntimeError(
48
- f"Could not find table with column name '{columnName}': {e}"
49
- )
41
+ raise RuntimeError(f"Could not find table with column name '{columnName}': {e}")
50
42
  return component
51
43
 
52
44
  @staticmethod
53
45
  def rowCount(tableObject):
54
46
  """
55
- Returns the number of rows in a table, excluding empty grid messages.
56
-
57
- Parameters:
58
- tableObject: The Selenium WebElement representing the table.
59
-
60
- Returns:
61
- The number of rows in the table.
47
+ Counts the number of rows in a table.
62
48
 
49
+ :param tableObject: The Selenium WebElement representing the table.
50
+ :return: The number of rows in the table.
63
51
  Example:
64
- count = TableUtils.rowCount(table)
65
-
52
+ row_count = TableUtils.rowCount(table)
66
53
  """
67
- # This method counts the number of rows in a table by finding all the table row elements
68
- # that do not have the 'data-empty-grid-message' attribute.
69
54
 
70
55
  xpath = "./tbody/tr[./td[not (@data-empty-grid-message)]]"
71
- rows = tableObject.find_elements(By.XPATH, xpath)
56
+ try:
57
+ rows = tableObject.find_elements(By.XPATH, xpath)
58
+ except Exception as e:
59
+ raise RuntimeError(f"Could not count rows in table: {e}")
72
60
  return len(rows)
73
61
 
74
62
  @staticmethod
75
- def findColumNumberByColumnName(tableObject, columnName):
63
+ def __findColumNumberByColumnName(tableObject, columnName):
76
64
  """
77
- Finds the column number in a table based on the column name.
78
-
79
- Parameters:
80
- tableObject: The Selenium WebElement representing the table.
81
- columnName: The name of the column to find.
82
-
83
- Returns:
84
- The index of the column (0-based).
65
+ Finds the column number in a table by its column name.
85
66
 
67
+ :param tableObject: The Selenium WebElement representing the table.
68
+ :param columnName: The name of the column to search for.
69
+ :return: The index of the column (0-based).
86
70
  Example:
87
- column_number = TableUtils.findColumNumberByColumnName(table, "Status")
88
-
71
+ column_number = TableUtils.__findColumNumberByColumnName(table, "Status")
89
72
  """
90
- # This method locates the column header cell with the specified column name
91
- # and extracts the column index from its class attribute.
92
73
 
93
74
  xpath = f'./thead/tr/th[@scope="col" and @abbr="{columnName}"]'
94
75
  component = tableObject.find_element(By.XPATH, xpath)
95
76
 
96
77
  if component is None:
97
- raise ValueError(
98
- f"Could not find a column with abbr '{columnName}' in the table header."
99
- )
78
+ raise ValueError(f"Could not find a column with abbr '{columnName}' in the table header.")
100
79
 
101
80
  class_string = component.get_attribute("class")
102
81
  partial_string = "headCell_"
@@ -108,9 +87,7 @@ class TableUtils:
108
87
  selected_word = word
109
88
 
110
89
  if selected_word is None:
111
- raise ValueError(
112
- f"Could not find a class containing '{partial_string}' in the column header for '{columnName}'."
113
- )
90
+ raise ValueError(f"Could not find a class containing '{partial_string}' in the column header for '{columnName}'.")
114
91
 
115
92
  data = selected_word.split("_")
116
93
  return int(data[1])
@@ -118,26 +95,18 @@ class TableUtils:
118
95
  @staticmethod
119
96
  def findComponentFromTableCell(wait, rowNumber, columnName):
120
97
  """
121
- Finds a component within a specific table cell based on the row number and column name.
122
-
123
- Parameters:
124
- wait: Selenium WebDriverWait instance.
125
- rowNumber: The row number (0-based index) where the component is located.
126
- columnName: The name of the column where the component is located.
127
-
128
- Returns:
129
- The Selenium WebElement for the component within the specified table cell.
98
+ Finds a component within a specific cell of a table by row number and column name.
130
99
 
100
+ :param wait: Selenium WebDriverWait instance.
101
+ :param rowNumber: The row number (0-based index).
102
+ :param columnName: The name of the column to search in.
103
+ :return: WebElement representing the component in the specified cell.
131
104
  Example:
132
- component = TableUtils.findComponentFromTableCell(wait, 2, "Status")
133
-
105
+ component = TableUtils.findComponentFromTableCell(wait, 1, "Status")
134
106
  """
135
- # This method locates a specific component within a table cell based on the provided row number
136
- # and column name. It constructs an XPath that targets the table cell containing the specified column
137
- # and row, and then retrieves the component within that cell.
138
107
 
139
108
  tableObject = TableUtils.findTableByColumnName(wait, columnName)
140
- columnNumber = TableUtils.findColumNumberByColumnName(tableObject, columnName)
109
+ columnNumber = TableUtils.__findColumNumberByColumnName(tableObject, columnName)
141
110
  # xpath=f'./tbody/tr[@data-dnd-name="row {rowNumber+1}"]/td[not (@data-empty-grid-message)][{columnNumber}]'
142
111
  # component = tableObject.find_elements(By.XPATH, xpath)
143
112
  rowNumber = rowNumber + 1
@@ -146,12 +115,8 @@ class TableUtils:
146
115
  try:
147
116
  component = wait.until(EC.element_to_be_clickable((By.XPATH, xpath)))
148
117
  except TimeoutError as e:
149
- raise TimeoutError(
150
- f"Could not find component in cell at row {rowNumber}, column '{columnName}': {e}"
151
- )
118
+ raise TimeoutError(f"Could not find component in cell at row {rowNumber}, column '{columnName}': {e}")
152
119
  except Exception as e:
153
- raise RuntimeError(
154
- f"Could not find component in cell at row {rowNumber}, column '{columnName}': {e}"
155
- )
120
+ raise RuntimeError(f"Could not find component in cell at row {rowNumber}, column '{columnName}': {e}")
156
121
  # childComponent=component.find_element(By.xpath("./*"))
157
122
  return component
@@ -38,7 +38,7 @@ class ComponentDriver:
38
38
  case "Date":
39
39
  match action:
40
40
  case "Set Value":
41
- DateUtils.setDateValue(wait, label, value)
41
+ DateUtils.setValueByLabelText(wait, label, value)
42
42
  case _:
43
43
  raise ValueError(f"Unsupported action for {type}: {action}")
44
44
  case "Input Text":
@@ -56,7 +56,7 @@ class ComponentDriver:
56
56
  case "Label":
57
57
  match action:
58
58
  case "Find":
59
- LabelUtils.find(wait, label)
59
+ LabelUtils.findByLabelText(wait, label)
60
60
  case _:
61
61
  raise ValueError(f"Unsupported action for {type}: {action}")
62
62
  case "Link":
@@ -80,13 +80,13 @@ class ComponentDriver:
80
80
  case "Button":
81
81
  match action:
82
82
  case "Click":
83
- ButtonUtils.click(wait, label)
83
+ ButtonUtils.clickByLabelText(wait, label)
84
84
  case _:
85
85
  raise ValueError(f"Unsupported action for {type}: {action}")
86
86
  case "Tab":
87
87
  match action:
88
88
  case "Find":
89
- TabUtils.findSelectedTab(wait, label)
89
+ TabUtils.findSelectedTabByLabelText(wait, label)
90
90
  case _:
91
91
  raise ValueError(f"Unsupported action for {type}: {action}")
92
92
  case _:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: robo_appian
3
- Version: 0.0.11
3
+ Version: 0.0.12
4
4
  Summary: Automate your Appian code testing with Python. Boost quality, save time.
5
5
  Author: Dinil Mithra
6
6
  Author-email: dinilmithra@mailme@gmail.com
@@ -0,0 +1,22 @@
1
+ robo_appian/__init__.py,sha256=6u9n2W7P1IKSSr5IPGsg7LhVR1o1uYv424mXDjJLgb0,720
2
+ robo_appian/components/ButtonUtils.py,sha256=k6XQcMUFa0u3FuBLwNv9BsvIub6Z8RwoiLx_XsURtjg,2316
3
+ robo_appian/components/DateUtils.py,sha256=9scKYCyJavVyHzoHVfe1cdW2rEp4NAXsP5Zs_CV3fwk,3252
4
+ robo_appian/components/DropdownUtils.py,sha256=OscvU2mAC-ZhTQxB6j4amac4nByGpeu57ak7OLKdyY8,11174
5
+ robo_appian/components/InputUtils.py,sha256=6BqkAhKyUUcn9cTHbP97DuPaVU17kGAftstl310RMaE,6438
6
+ robo_appian/components/LabelUtils.py,sha256=luT_bY720GJF95sA1fWgu8FB0XiupK3fTNG9jmghQ60,1583
7
+ robo_appian/components/LinkUtils.py,sha256=AfJma3ahznMGm771ukAES3qSCBBug6lO5LxzN8PPf6w,1519
8
+ robo_appian/components/SearchDropdownUtils.py,sha256=sSe-GnbLL-Va8RvX_bTkcTSd9uPMfcmROlmRa8BEp1U,4042
9
+ robo_appian/components/SearchInputUtils.py,sha256=FcRazZ_3J-_XvXOwZhV4TVr-t65kWFG2-RjVH8rlkgo,3356
10
+ robo_appian/components/TabUtils.py,sha256=Pq-g61uPbhyfSgC8mt9PBBcdDDnmCcRziltfHGA52qw,2463
11
+ robo_appian/components/TableUtils.py,sha256=do9FvJIjV0hX2pafrIv5A9-NYxwyMZC-Z4k2Wo1yWs4,5039
12
+ robo_appian/components/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
13
+ robo_appian/controllers/ComponentDriver.py,sha256=0GzEXsncWg4oPHGmG48wKeGlrEHxkSX-Ml_NsLIcrvQ,4358
14
+ robo_appian/controllers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
15
+ robo_appian/exceptions/MyCustomError.py,sha256=DVAkytXNNQNjqyTyCjk6FFd6fr3AsBe57Y19erDSqVs,222
16
+ robo_appian/exceptions/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
17
+ robo_appian/utils/ComponentUtils.py,sha256=Oa4XMey0Gm9lLF0bumrNBB0Z3BKljjwe9Zq3BSNm4Vk,8578
18
+ robo_appian/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
19
+ robo_appian-0.0.12.dist-info/LICENSE,sha256=g-xR4dRa9_4iFkMoJmED-wE-J5hoxbk3105Knhfpjm0,1068
20
+ robo_appian-0.0.12.dist-info/METADATA,sha256=rxUu91o4Rb-_n1ceqkpPGbAdMS2vd4E3S0iLRr0wljk,4105
21
+ robo_appian-0.0.12.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
22
+ robo_appian-0.0.12.dist-info/RECORD,,
@@ -1,22 +0,0 @@
1
- robo_appian/__init__.py,sha256=6u9n2W7P1IKSSr5IPGsg7LhVR1o1uYv424mXDjJLgb0,720
2
- robo_appian/components/ButtonUtils.py,sha256=cNCQ21BCbSIqO8gaz0CxBaGx_uQf4Cbrw-YpDEpWfYo,1764
3
- robo_appian/components/DateUtils.py,sha256=yewRjKarXj6xMA0RtiXu_ZshGXEkkhAu1bmq01uug74,5117
4
- robo_appian/components/DropdownUtils.py,sha256=11XJ96n1ZcoUaH157Y1I35FaZ53ZmlJnYnPSzy7L1k0,6454
5
- robo_appian/components/InputUtils.py,sha256=GDLn3ZZ8YrO6NfNgiRH9q1qaHdsE8v1nZTSH4jc3tgw,5102
6
- robo_appian/components/LabelUtils.py,sha256=bhMM2_lTyx8839ia__8qXVqAhTvnsgPCe7AIcEFYEN0,1654
7
- robo_appian/components/LinkUtils.py,sha256=R8B4xj7V6agyz9m2GFt_jQQE8yjHPd6R5T3Pn8YRxCk,1397
8
- robo_appian/components/SearchDropdownUtils.py,sha256=6Rsw3PiJZ6UnPWimNGZeHIwYDPGiuACjlx0_2VBwVbs,4040
9
- robo_appian/components/SearchInputUtils.py,sha256=EKajPjmeuEHwY4aswHXAEhO8I4igS3icWovK_rZV6K8,3064
10
- robo_appian/components/TabUtils.py,sha256=e3zk9hPXwynyA0aEIr5DEm2wpSvT8yewqKAUyWYUjzw,2575
11
- robo_appian/components/TableUtils.py,sha256=X0iA7saWm72Qgz_oZ4dnE3wp8-44Xdj16zzUnazGUIQ,6062
12
- robo_appian/components/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
13
- robo_appian/controllers/ComponentDriver.py,sha256=QD2tEIJnl0bLwx9Vt7UQMnQVkg5Ke9287kOjQGSXY8g,4318
14
- robo_appian/controllers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
15
- robo_appian/exceptions/MyCustomError.py,sha256=DVAkytXNNQNjqyTyCjk6FFd6fr3AsBe57Y19erDSqVs,222
16
- robo_appian/exceptions/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
17
- robo_appian/utils/ComponentUtils.py,sha256=Oa4XMey0Gm9lLF0bumrNBB0Z3BKljjwe9Zq3BSNm4Vk,8578
18
- robo_appian/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,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,,