fix: ADDON-65405 multi level menu #882
test-report-9.1.1__firefox_test_splunk_ta_example_addon_input_common ❌
❌ test-results/test.xml
16 tests were completed in 1524s with 1 passed, 15 failed and 0 skipped.
Test suite | Passed | Failed | Skipped | Time |
---|---|---|---|---|
pytest | 1✅ | 15❌ | 1524s |
❌ pytest
tests.ui.test_splunk_ta_example_addon_input_common.firefox_TestInput
❌ test_inputs_displayed_columns
self = <ui.test_splunk_ta_example_addon_input_common.TestInput object at 0x7f4a1f68ca90>
❌ test_inputs_pagination_list
browser = None
❌ test_inputs_pagination
browser = None
❌ test_inputs_sort_functionality
self = <ui.test_splunk_ta_example_addon_input_common.TestInput object at 0x7f4a1f903730>
❌ test_inputs_filter_functionality_negative
self = <ui.test_splunk_ta_example_addon_input_common.TestInput object at 0x7f4a1f9036a0>
❌ test_inputs_filter_functionality_positive
self = <ui.test_splunk_ta_example_addon_input_common.TestInput object at 0x7f4a1f903370>
✅ test_inputs_default_rows_in_table
❌ test_inputs_create_new_input_list_values
self = <ui.test_splunk_ta_example_addon_input_common.TestInput object at 0x7f4a1f902dd0>
❌ test_inputs_input_type_list_values
browser = None
❌ test_inputs_more_info
self = <ui.test_splunk_ta_example_addon_input_common.TestInput object at 0x7f4a1f901000>
❌ test_inputs_enable_disable
self = <ui.test_splunk_ta_example_addon_input_common.TestInput object at 0x7f4a1f68df30>
❌ test_inputs_count
browser = None
❌ test_inputs_title_and_description
browser = None
❌ test_inputs_create_new_input_list_nested_values
self = <ui.test_splunk_ta_example_addon_input_common.TestInput object at 0x7f4a1f903f10>
❌ test_inputs_create_new_input_list_nested_values_back
self = <ui.test_splunk_ta_example_addon_input_common.TestInput object at 0x7f4a1f902830>
❌ test_inputs_create_new_input_from_nested_value
self = <ui.test_splunk_ta_example_addon_input_common.TestInput object at 0x7f4a1f9001c0>
Annotations
Check failure on line 0 in test-results/test.xml
github-actions / test-report-9.1.1__firefox_test_splunk_ta_example_addon_input_common
pytest ► tests.ui.test_splunk_ta_example_addon_input_common.firefox_TestInput ► test_inputs_displayed_columns
Failed test found in:
test-results/test.xml
Error:
self = <ui.test_splunk_ta_example_addon_input_common.TestInput object at 0x7f4a1f68ca90>
Raw output
self = <ui.test_splunk_ta_example_addon_input_common.TestInput object at 0x7f4a1f68ca90>
ucc_smartx_selenium_helper = <pytest_splunk_addon_ui_smartx.base_test.SeleniumHelper object at 0x7f4a1f4d3ee0>
ucc_smartx_rest_helper = <pytest_splunk_addon_ui_smartx.base_test.RestHelper object at 0x7f4a1f7b8be0>
@pytest.mark.execute_enterprise_cloud_true
@pytest.mark.forwarder
@pytest.mark.input
def test_inputs_displayed_columns(
self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper
):
"""Verifies headers of input table"""
input_page = InputPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper)
header_list = ["Name", "Account", "Interval", "Index", "Status", "Actions"]
> self.assert_util(input_page.table.get_headers, header_list)
tests/ui/test_splunk_ta_example_addon_input_common.py:134:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <ui.test_splunk_ta_example_addon_input_common.TestInput object at 0x7f4a1f68ca90>
left = <bound method Table.get_headers of <pytest_splunk_addon_ui_smartx.components.input_table.InputTable object at 0x7f4a1f4d3a30>>
right = ['Name', 'Account', 'Interval', 'Index', 'Status', 'Actions']
operator = '==', left_args = {}, right_args = {}
msg = "Condition Failed. \nLeft-value: []\nOperator: ==\nRight-value: ['Name', 'Account', 'Interval', 'Index', 'Status', 'Actions']"
def assert_util(
self, left, right, operator="==", left_args={}, right_args={}, msg=None
):
"""
Try to check the condition for {WAIT_TIMEOUT} seconds.
In UI Automation, it is not possible to expect things to work properly just milliseconds after an action.
Even in manual testing, we try things after 4-5 seconds and 2-3 times.
This utility method tries to achive the same assertion.
To perform certain action multiple time, provide callable functoins with arguments.
Params:
left (object or callable): LHS of the operator.
right (object or callable): RHS of the operator
operator: Operator. Possible values: (==, !=, <, >, <=, >=, in, not in, is, is not)
left_args: If left is callable, pass the parameters of the callable function.
right_args: If right is callable, pass the parameters of the callable function.
msg: Error message if the condition was not matched even after trying for {WAIT_TIMEOUT} seconds.
"""
args = {
"left": left,
"right": right,
"operator": operator,
"left_args": left_args,
"right_args": right_args,
"left_value": left,
"right_value": right,
}
operator_map = {
"==": lambda left, right: left == right,
"!=": lambda left, right: left != right,
"<": lambda left, right: left < right,
"<=": lambda left, right: left <= right,
">": lambda left, right: left > right,
">=": lambda left, right: left >= right,
"in": lambda left, right: left in right,
"not in": lambda left, right: left not in right,
"is": lambda left, right: left is right,
"is not": lambda left, right: left is not right,
}
def _assert(browser):
try:
if callable(args["left"]):
args["left_value"] = args["left"](**args["left_args"])
if callable(args["right"]):
args["right_value"] = args["right"](**args["right_args"])
except TimeoutException as e:
raise Exception("Timeout: {}".format(str(e)))
except ElementNotInteractableException as e:
raise Exception("Element not interactable: {}".format(str(e)))
return operator_map[args["operator"]](
args["left_value"], args["right_value"]
)
try:
self.wait.until(_assert)
condition_failed = False
except (TimeoutException, ElementNotInteractableException) as e:
logger.error("Exception raised: {}".format(str(e)))
condition_failed = True
if condition_failed:
if not msg:
msg = "Condition Failed. \nLeft-value: {}\nOperator: {}\nRight-value: {}".format(
args["left_value"], args["operator"], args["right_value"]
)
> assert operator_map[args["operator"]](
args["left_value"], args["right_value"]
), msg
E AssertionError: Condition Failed.
E Left-value: []
E Operator: ==
E Right-value: ['Name', 'Account', 'Interval', 'Index', 'Status', 'Actions']
E assert False
E + where False = <function UccTester.assert_util.<locals>.<lambda> at 0x7f4a1f728ee0>([], ['Name', 'Account', 'Interval', 'Index', 'Status', 'Actions'])
/usr/local/lib/python3.10/dist-packages/pytest_splunk_addon_ui_smartx/base_test.py:573: AssertionError
Check failure on line 0 in test-results/test.xml
github-actions / test-report-9.1.1__firefox_test_splunk_ta_example_addon_input_common
pytest ► tests.ui.test_splunk_ta_example_addon_input_common.firefox_TestInput ► test_inputs_pagination_list
Failed test found in:
test-results/test.xml
Error:
browser = None
Raw output
browser = None
def _assert(browser):
try:
if callable(args["left"]):
> args["left_value"] = args["left"](**args["left_args"])
/usr/local/lib/python3.10/dist-packages/pytest_splunk_addon_ui_smartx/base_test.py:551:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pytest_splunk_addon_ui_smartx.components.dropdown.Dropdown object at 0x7f4a1f4c5690>
def get_pagination_list(self):
"""
Returns a generator list for the pagination text available in the add input dropdown
:return: Returns Generator list of values
"""
> self.pagination_dropdown.click()
/usr/local/lib/python3.10/dist-packages/pytest_splunk_addon_ui_smartx/components/dropdown.py:173:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pytest_splunk_addon_ui_smartx.components.dropdown.Dropdown object at 0x7f4a1f4c5690>
key = 'pagination_dropdown'
def __getattr__(self, key):
"""
Makes the web-elements to be accessible directly.
- For example self.elements = {"textbox": Selector(by=..., select=...),
Access the element by doing self.textbox directly.
- It also has implicit wait while finding the element.
:param key: The key of the element mentioned in self.elements
:returns: The webelement we are accessing
"""
try:
> return self.get_element(key)
/usr/local/lib/python3.10/dist-packages/pytest_splunk_addon_ui_smartx/components/base_component.py:222:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pytest_splunk_addon_ui_smartx.components.dropdown.Dropdown object at 0x7f4a1f4c5690>
key = 'pagination_dropdown'
def get_element(self, key):
"""
Get the web-element.
Note: There is a wait in get_element.
:param key: The key of the element mentioned in self.elements
:returns: element The element we are looking for by key
"""
element = self.elements[key]
> return self._get_element(element.by, element.select)
/usr/local/lib/python3.10/dist-packages/pytest_splunk_addon_ui_smartx/components/base_component.py:82:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pytest_splunk_addon_ui_smartx.components.dropdown.Dropdown object at 0x7f4a1f4c5690>
by = 'css selector', select = 'button[data-test="select"]'
def _get_element(self, by, select):
"""
Find the element from the page.
:param by: The type of the selenium locator
:param select: The selector text of type mentioned in by.
:returns: The webelement we are accessing
"""
msg = "by={} select={} Element not found in the page".format(by, select)
> return self.wait.until(EC.presence_of_element_located((by, select)), msg)
/usr/local/lib/python3.10/dist-packages/pytest_splunk_addon_ui_smartx/components/base_component.py:243:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <selenium.webdriver.support.wait.WebDriverWait (session="83f57866f5bf4b3f9b7f72b8bd07da18")>
method = <selenium.webdriver.support.expected_conditions.presence_of_element_located object at 0x7f4a1f4c68c0>
message = 'by=css selector select=button[data-test="select"] Element not found in the page'
def until(self, method, message=''):
"""Calls the method provided with the driver as an argument until the \
return value is not False."""
screen = None
stacktrace = None
end_time = time.time() + self._timeout
while True:
try:
value = method(self._driver)
if value:
return value
except self._ignored_exceptions as exc:
screen = getattr(exc, 'screen', None)
stacktrace = getattr(exc, 'stacktrace', None)
time.sleep(self._poll)
if time.time() > end_time:
break
> raise TimeoutException(message, screen, stacktrace)
E selenium.common.exceptions.TimeoutException: Message: by=css selector select=button[data-test="select"] Element not found in the page
/usr/local/lib/python3.10/dist-packages/selenium/webdriver/support/wait.py:80: TimeoutException
During handling of the above exception, another exception occurred:
self = <ui.test_splunk_ta_example_addon_input_common.TestInput object at 0x7f4a1f68ca00>
ucc_smartx_selenium_helper = <pytest_splunk_addon_ui_smartx.base_test.SeleniumHelper object at 0x7f4a1f771000>
ucc_smartx_rest_helper = <pytest_splunk_addon_ui_smartx.base_test.RestHelper object at 0x7f4a1f7b8be0>
@pytest.mark.execute_enterprise_cloud_true
@pytest.mark.forwarder
@pytest.mark.input
def test_inputs_pagination_list(
self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper
):
"""Verifies pagination list"""
input_page = InputPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper)
> self.assert_util(
input_page.pagination.get_pagination_list,
["10 Per Page", "25 Per Page", "50 Per Page"],
)
tests/ui/test_splunk_ta_example_addon_input_common.py:144:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <ui.test_splunk_ta_example_addon_input_common.TestInput object at 0x7f4a1f68ca00>
left = <bound method Dropdown.get_pagination_list of <pytest_splunk_addon_ui_smartx.components.dropdown.Dropdown object at 0x7f4a1f4c5690>>
right = ['10 Per Page', '25 Per Page', '50 Per Page'], operator = '=='
left_args = {}, right_args = {}, msg = None
def assert_util(
self, left, right, operator="==", left_args={}, right_args={}, msg=None
):
"""
Try to check the condition for {WAIT_TIMEOUT} seconds.
In UI Automation, it is not possible to expect things to work properly just milliseconds after an action.
Even in manual testing, we try things after 4-5 seconds and 2-3 times.
This utility method tries to achive the same assertion.
To perform certain action multiple time, provide callable functoins with arguments.
Params:
left (object or callable): LHS of the operator.
right (object or callable): RHS of the operator
operator: Operator. Possible values: (==, !=, <, >, <=, >=, in, not in, is, is not)
left_args: If left is callable, pass the parameters of the callable function.
right_args: If right is callable, pass the parameters of the callable function.
msg: Error message if the condition was not matched even after trying for {WAIT_TIMEOUT} seconds.
"""
args = {
"left": left,
"right": right,
"operator": operator,
"left_args": left_args,
"right_args": right_args,
"left_value": left,
"right_value": right,
}
operator_map = {
"==": lambda left, right: left == right,
"!=": lambda left, right: left != right,
"<": lambda left, right: left < right,
"<=": lambda left, right: left <= right,
">": lambda left, right: left > right,
">=": lambda left, right: left >= right,
"in": lambda left, right: left in right,
"not in": lambda left, right: left not in right,
"is": lambda left, right: left is right,
"is not": lambda left, right: left is not right,
}
def _assert(browser):
try:
if callable(args["left"]):
args["left_value"] = args["left"](**args["left_args"])
if callable(args["right"]):
args["right_value"] = args["right"](**args["right_args"])
except TimeoutException as e:
raise Exception("Timeout: {}".format(str(e)))
except ElementNotInteractableException as e:
raise Exception("Element not interactable: {}".format(str(e)))
return operator_map[args["operator"]](
args["left_value"], args["right_value"]
)
try:
> self.wait.until(_assert)
/usr/local/lib/python3.10/dist-packages/pytest_splunk_addon_ui_smartx/base_test.py:563:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <[AttributeError("'NoneType' object has no attribute 'session_id'") raised in repr()] WebDriverWait object at 0x7f4a1f7baa70>
method = <function UccTester.assert_util.<locals>._assert at 0x7f4a1f48b7f0>
message = ''
def until(self, method, message=''):
"""Calls the method provided with the driver as an argument until the \
return value is not False."""
screen = None
stacktrace = None
end_time = time.time() + self._timeout
while True:
try:
> value = method(self._driver)
/usr/local/lib/python3.10/dist-packages/selenium/webdriver/support/wait.py:71:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
browser = None
def _assert(browser):
try:
if callable(args["left"]):
args["left_value"] = args["left"](**args["left_args"])
if callable(args["right"]):
args["right_value"] = args["right"](**args["right_args"])
except TimeoutException as e:
> raise Exception("Timeout: {}".format(str(e)))
E Exception: Timeout: Message: by=css selector select=button[data-test="select"] Element not found in the page
/usr/local/lib/python3.10/dist-packages/pytest_splunk_addon_ui_smartx/base_test.py:555: Exception
Check failure on line 0 in test-results/test.xml
github-actions / test-report-9.1.1__firefox_test_splunk_ta_example_addon_input_common
pytest ► tests.ui.test_splunk_ta_example_addon_input_common.firefox_TestInput ► test_inputs_pagination
Failed test found in:
test-results/test.xml
Error:
browser = None
Raw output
browser = None
def _assert(browser):
try:
if callable(args["left"]):
> args["left_value"] = args["left"](**args["left_args"])
/usr/local/lib/python3.10/dist-packages/pytest_splunk_addon_ui_smartx/base_test.py:551:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pytest_splunk_addon_ui_smartx.components.dropdown.Dropdown object at 0x7f4a1f52a590>
value = '50 Per Page'
def select_page_option(self, value):
"""
Selects the page option that the user specifies in value
:param value: The value in which we want to select
:return: Returns True if successful, otherwise raises an error
"""
> self.pagination_dropdown.click()
/usr/local/lib/python3.10/dist-packages/pytest_splunk_addon_ui_smartx/components/dropdown.py:59:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pytest_splunk_addon_ui_smartx.components.dropdown.Dropdown object at 0x7f4a1f52a590>
key = 'pagination_dropdown'
def __getattr__(self, key):
"""
Makes the web-elements to be accessible directly.
- For example self.elements = {"textbox": Selector(by=..., select=...),
Access the element by doing self.textbox directly.
- It also has implicit wait while finding the element.
:param key: The key of the element mentioned in self.elements
:returns: The webelement we are accessing
"""
try:
> return self.get_element(key)
/usr/local/lib/python3.10/dist-packages/pytest_splunk_addon_ui_smartx/components/base_component.py:222:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pytest_splunk_addon_ui_smartx.components.dropdown.Dropdown object at 0x7f4a1f52a590>
key = 'pagination_dropdown'
def get_element(self, key):
"""
Get the web-element.
Note: There is a wait in get_element.
:param key: The key of the element mentioned in self.elements
:returns: element The element we are looking for by key
"""
element = self.elements[key]
> return self._get_element(element.by, element.select)
/usr/local/lib/python3.10/dist-packages/pytest_splunk_addon_ui_smartx/components/base_component.py:82:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pytest_splunk_addon_ui_smartx.components.dropdown.Dropdown object at 0x7f4a1f52a590>
by = 'css selector', select = 'button[data-test="select"]'
def _get_element(self, by, select):
"""
Find the element from the page.
:param by: The type of the selenium locator
:param select: The selector text of type mentioned in by.
:returns: The webelement we are accessing
"""
msg = "by={} select={} Element not found in the page".format(by, select)
> return self.wait.until(EC.presence_of_element_located((by, select)), msg)
/usr/local/lib/python3.10/dist-packages/pytest_splunk_addon_ui_smartx/components/base_component.py:243:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <selenium.webdriver.support.wait.WebDriverWait (session="f87d6b2326ff4e33a95db5b50078d16f")>
method = <selenium.webdriver.support.expected_conditions.presence_of_element_located object at 0x7f4a1f5290f0>
message = 'by=css selector select=button[data-test="select"] Element not found in the page'
def until(self, method, message=''):
"""Calls the method provided with the driver as an argument until the \
return value is not False."""
screen = None
stacktrace = None
end_time = time.time() + self._timeout
while True:
try:
value = method(self._driver)
if value:
return value
except self._ignored_exceptions as exc:
screen = getattr(exc, 'screen', None)
stacktrace = getattr(exc, 'stacktrace', None)
time.sleep(self._poll)
if time.time() > end_time:
break
> raise TimeoutException(message, screen, stacktrace)
E selenium.common.exceptions.TimeoutException: Message: by=css selector select=button[data-test="select"] Element not found in the page
/usr/local/lib/python3.10/dist-packages/selenium/webdriver/support/wait.py:80: TimeoutException
During handling of the above exception, another exception occurred:
self = <ui.test_splunk_ta_example_addon_input_common.TestInput object at 0x7f4a1f68cd30>
ucc_smartx_selenium_helper = <pytest_splunk_addon_ui_smartx.base_test.SeleniumHelper object at 0x7f4a1f4c04c0>
ucc_smartx_rest_helper = <pytest_splunk_addon_ui_smartx.base_test.RestHelper object at 0x7f4a1f7b8be0>
add_multiple_inputs = None
@pytest.mark.execute_enterprise_cloud_true
@pytest.mark.forwarder
@pytest.mark.input
def test_inputs_pagination(
self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper, add_multiple_inputs
):
"""Verifies pagination functionality by creating 100 accounts"""
input_page = InputPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper)
input_page.open()
> self.assert_util(
input_page.pagination.select_page_option,
True,
left_args={"value": "50 Per Page"},
)
tests/ui/test_splunk_ta_example_addon_input_common.py:158:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <ui.test_splunk_ta_example_addon_input_common.TestInput object at 0x7f4a1f68cd30>
left = <bound method Dropdown.select_page_option of <pytest_splunk_addon_ui_smartx.components.dropdown.Dropdown object at 0x7f4a1f52a590>>
right = True, operator = '==', left_args = {'value': '50 Per Page'}
right_args = {}, msg = None
def assert_util(
self, left, right, operator="==", left_args={}, right_args={}, msg=None
):
"""
Try to check the condition for {WAIT_TIMEOUT} seconds.
In UI Automation, it is not possible to expect things to work properly just milliseconds after an action.
Even in manual testing, we try things after 4-5 seconds and 2-3 times.
This utility method tries to achive the same assertion.
To perform certain action multiple time, provide callable functoins with arguments.
Params:
left (object or callable): LHS of the operator.
right (object or callable): RHS of the operator
operator: Operator. Possible values: (==, !=, <, >, <=, >=, in, not in, is, is not)
left_args: If left is callable, pass the parameters of the callable function.
right_args: If right is callable, pass the parameters of the callable function.
msg: Error message if the condition was not matched even after trying for {WAIT_TIMEOUT} seconds.
"""
args = {
"left": left,
"right": right,
"operator": operator,
"left_args": left_args,
"right_args": right_args,
"left_value": left,
"right_value": right,
}
operator_map = {
"==": lambda left, right: left == right,
"!=": lambda left, right: left != right,
"<": lambda left, right: left < right,
"<=": lambda left, right: left <= right,
">": lambda left, right: left > right,
">=": lambda left, right: left >= right,
"in": lambda left, right: left in right,
"not in": lambda left, right: left not in right,
"is": lambda left, right: left is right,
"is not": lambda left, right: left is not right,
}
def _assert(browser):
try:
if callable(args["left"]):
args["left_value"] = args["left"](**args["left_args"])
if callable(args["right"]):
args["right_value"] = args["right"](**args["right_args"])
except TimeoutException as e:
raise Exception("Timeout: {}".format(str(e)))
except ElementNotInteractableException as e:
raise Exception("Element not interactable: {}".format(str(e)))
return operator_map[args["operator"]](
args["left_value"], args["right_value"]
)
try:
> self.wait.until(_assert)
/usr/local/lib/python3.10/dist-packages/pytest_splunk_addon_ui_smartx/base_test.py:563:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <[AttributeError("'NoneType' object has no attribute 'session_id'") raised in repr()] WebDriverWait object at 0x7f4a1f7baa70>
method = <function UccTester.assert_util.<locals>._assert at 0x7f4a1f478a60>
message = ''
def until(self, method, message=''):
"""Calls the method provided with the driver as an argument until the \
return value is not False."""
screen = None
stacktrace = None
end_time = time.time() + self._timeout
while True:
try:
> value = method(self._driver)
/usr/local/lib/python3.10/dist-packages/selenium/webdriver/support/wait.py:71:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
browser = None
def _assert(browser):
try:
if callable(args["left"]):
args["left_value"] = args["left"](**args["left_args"])
if callable(args["right"]):
args["right_value"] = args["right"](**args["right_args"])
except TimeoutException as e:
> raise Exception("Timeout: {}".format(str(e)))
E Exception: Timeout: Message: by=css selector select=button[data-test="select"] Element not found in the page
/usr/local/lib/python3.10/dist-packages/pytest_splunk_addon_ui_smartx/base_test.py:555: Exception
Check failure on line 0 in test-results/test.xml
github-actions / test-report-9.1.1__firefox_test_splunk_ta_example_addon_input_common
pytest ► tests.ui.test_splunk_ta_example_addon_input_common.firefox_TestInput ► test_inputs_sort_functionality
Failed test found in:
test-results/test.xml
Error:
self = <ui.test_splunk_ta_example_addon_input_common.TestInput object at 0x7f4a1f903730>
Raw output
self = <ui.test_splunk_ta_example_addon_input_common.TestInput object at 0x7f4a1f903730>
ucc_smartx_selenium_helper = <pytest_splunk_addon_ui_smartx.base_test.SeleniumHelper object at 0x7f4a1f506d10>
ucc_smartx_rest_helper = <pytest_splunk_addon_ui_smartx.base_test.RestHelper object at 0x7f4a1f7b8be0>
add_input_one = {'entry': [{'acl': {'app': 'Splunk_TA_UCCExample', 'can_change_perms': True, 'can_list': True, 'can_share_app': True, ...nf-inputs/_reload', 'create': '/servicesNS/nobody/Splunk_TA_UCCExample/configs/conf-inputs/_new'}, 'messages': [], ...}
add_input_two = {'entry': [{'acl': {'app': 'Splunk_TA_UCCExample', 'can_change_perms': True, 'can_list': True, 'can_share_app': True, ...nf-inputs/_reload', 'create': '/servicesNS/nobody/Splunk_TA_UCCExample/configs/conf-inputs/_new'}, 'messages': [], ...}
@pytest.mark.execute_enterprise_cloud_true
@pytest.mark.forwarder
@pytest.mark.input
def test_inputs_sort_functionality(
self,
ucc_smartx_selenium_helper,
ucc_smartx_rest_helper,
add_input_one,
add_input_two,
):
"""Verifies sorting functionality for name column"""
input_page = InputPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper)
> input_page.pagination.select_page_option("50 Per Page")
tests/ui/test_splunk_ta_example_addon_input_common.py:179:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pytest_splunk_addon_ui_smartx.components.dropdown.Dropdown object at 0x7f4a1f618700>
value = '50 Per Page'
def select_page_option(self, value):
"""
Selects the page option that the user specifies in value
:param value: The value in which we want to select
:return: Returns True if successful, otherwise raises an error
"""
> self.pagination_dropdown.click()
/usr/local/lib/python3.10/dist-packages/pytest_splunk_addon_ui_smartx/components/dropdown.py:59:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pytest_splunk_addon_ui_smartx.components.dropdown.Dropdown object at 0x7f4a1f618700>
key = 'pagination_dropdown'
def __getattr__(self, key):
"""
Makes the web-elements to be accessible directly.
- For example self.elements = {"textbox": Selector(by=..., select=...),
Access the element by doing self.textbox directly.
- It also has implicit wait while finding the element.
:param key: The key of the element mentioned in self.elements
:returns: The webelement we are accessing
"""
try:
> return self.get_element(key)
/usr/local/lib/python3.10/dist-packages/pytest_splunk_addon_ui_smartx/components/base_component.py:222:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pytest_splunk_addon_ui_smartx.components.dropdown.Dropdown object at 0x7f4a1f618700>
key = 'pagination_dropdown'
def get_element(self, key):
"""
Get the web-element.
Note: There is a wait in get_element.
:param key: The key of the element mentioned in self.elements
:returns: element The element we are looking for by key
"""
element = self.elements[key]
> return self._get_element(element.by, element.select)
/usr/local/lib/python3.10/dist-packages/pytest_splunk_addon_ui_smartx/components/base_component.py:82:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pytest_splunk_addon_ui_smartx.components.dropdown.Dropdown object at 0x7f4a1f618700>
by = 'css selector', select = 'button[data-test="select"]'
def _get_element(self, by, select):
"""
Find the element from the page.
:param by: The type of the selenium locator
:param select: The selector text of type mentioned in by.
:returns: The webelement we are accessing
"""
msg = "by={} select={} Element not found in the page".format(by, select)
> return self.wait.until(EC.presence_of_element_located((by, select)), msg)
/usr/local/lib/python3.10/dist-packages/pytest_splunk_addon_ui_smartx/components/base_component.py:243:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <selenium.webdriver.support.wait.WebDriverWait (session="67584fd7ccea49c2a8af9d3ff8fe088b")>
method = <selenium.webdriver.support.expected_conditions.presence_of_element_located object at 0x7f4a1f6182b0>
message = 'by=css selector select=button[data-test="select"] Element not found in the page'
def until(self, method, message=''):
"""Calls the method provided with the driver as an argument until the \
return value is not False."""
screen = None
stacktrace = None
end_time = time.time() + self._timeout
while True:
try:
value = method(self._driver)
if value:
return value
except self._ignored_exceptions as exc:
screen = getattr(exc, 'screen', None)
stacktrace = getattr(exc, 'stacktrace', None)
time.sleep(self._poll)
if time.time() > end_time:
break
> raise TimeoutException(message, screen, stacktrace)
E selenium.common.exceptions.TimeoutException: Message: by=css selector select=button[data-test="select"] Element not found in the page
/usr/local/lib/python3.10/dist-packages/selenium/webdriver/support/wait.py:80: TimeoutException
Check failure on line 0 in test-results/test.xml
github-actions / test-report-9.1.1__firefox_test_splunk_ta_example_addon_input_common
pytest ► tests.ui.test_splunk_ta_example_addon_input_common.firefox_TestInput ► test_inputs_filter_functionality_negative
Failed test found in:
test-results/test.xml
Error:
self = <ui.test_splunk_ta_example_addon_input_common.TestInput object at 0x7f4a1f9036a0>
Raw output
self = <ui.test_splunk_ta_example_addon_input_common.TestInput object at 0x7f4a1f9036a0>
ucc_smartx_selenium_helper = <pytest_splunk_addon_ui_smartx.base_test.SeleniumHelper object at 0x7f4a1f51ee60>
ucc_smartx_rest_helper = <pytest_splunk_addon_ui_smartx.base_test.RestHelper object at 0x7f4a1f7b8be0>
add_input_one = {'entry': [{'acl': {'app': 'Splunk_TA_UCCExample', 'can_change_perms': True, 'can_list': True, 'can_share_app': True, ...nf-inputs/_reload', 'create': '/servicesNS/nobody/Splunk_TA_UCCExample/configs/conf-inputs/_new'}, 'messages': [], ...}
add_input_two = {'entry': [{'acl': {'app': 'Splunk_TA_UCCExample', 'can_change_perms': True, 'can_list': True, 'can_share_app': True, ...nf-inputs/_reload', 'create': '/servicesNS/nobody/Splunk_TA_UCCExample/configs/conf-inputs/_new'}, 'messages': [], ...}
@pytest.mark.execute_enterprise_cloud_true
@pytest.mark.forwarder
@pytest.mark.input
def test_inputs_filter_functionality_negative(
self,
ucc_smartx_selenium_helper,
ucc_smartx_rest_helper,
add_input_one,
add_input_two,
):
"""Verifies the filter functionality (Negative)"""
input_page = InputPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper)
> input_page.table.set_filter("hello")
tests/ui/test_splunk_ta_example_addon_input_common.py:201:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pytest_splunk_addon_ui_smartx.components.input_table.InputTable object at 0x7f4a1f4cfb50>
filter_query = 'hello'
def set_filter(self, filter_query):
"""
Provide a string in table filter.
:param filter_query: query of the filter
:returns: resultant list of filtered row_names
"""
> with self.wait_stale():
/usr/local/lib/python3.10/dist-packages/pytest_splunk_addon_ui_smartx/components/table.py:373:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <contextlib._GeneratorContextManager object at 0x7f4a1f4870d0>
def __enter__(self):
# do not keep args and kwds alive unnecessarily
# they are only needed for recreation, which is not possible anymore
del self.args, self.kwds, self.func
try:
> return next(self.gen)
/usr/lib/python3.10/contextlib.py:135:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pytest_splunk_addon_ui_smartx.components.input_table.InputTable object at 0x7f4a1f4cfb50>
@contextmanager
def wait_stale(self):
rows = list(self._get_rows())
col = copy.deepcopy(self.elements["col"])
col = col._replace(select=col.select.format(column="name"))
> col_element = self._get_element(col.by, col.select)
/usr/local/lib/python3.10/dist-packages/pytest_splunk_addon_ui_smartx/components/table.py:384:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pytest_splunk_addon_ui_smartx.components.input_table.InputTable object at 0x7f4a1f4cfb50>
by = 'css selector'
select = ' div[role="main"] [data-test="cell"][data-column="name"]'
def _get_element(self, by, select):
"""
Find the element from the page.
:param by: The type of the selenium locator
:param select: The selector text of type mentioned in by.
:returns: The webelement we are accessing
"""
msg = "by={} select={} Element not found in the page".format(by, select)
> return self.wait.until(EC.presence_of_element_located((by, select)), msg)
/usr/local/lib/python3.10/dist-packages/pytest_splunk_addon_ui_smartx/components/base_component.py:243:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <selenium.webdriver.support.wait.WebDriverWait (session="8999c096f6c84804ba086beac8997b06")>
method = <selenium.webdriver.support.expected_conditions.presence_of_element_located object at 0x7f4a1f486fb0>
message = 'by=css selector select= div[role="main"] [data-test="cell"][data-column="name"] Element not found in the page'
def until(self, method, message=''):
"""Calls the method provided with the driver as an argument until the \
return value is not False."""
screen = None
stacktrace = None
end_time = time.time() + self._timeout
while True:
try:
value = method(self._driver)
if value:
return value
except self._ignored_exceptions as exc:
screen = getattr(exc, 'screen', None)
stacktrace = getattr(exc, 'stacktrace', None)
time.sleep(self._poll)
if time.time() > end_time:
break
> raise TimeoutException(message, screen, stacktrace)
E selenium.common.exceptions.TimeoutException: Message: by=css selector select= div[role="main"] [data-test="cell"][data-column="name"] Element not found in the page
/usr/local/lib/python3.10/dist-packages/selenium/webdriver/support/wait.py:80: TimeoutException
Check failure on line 0 in test-results/test.xml
github-actions / test-report-9.1.1__firefox_test_splunk_ta_example_addon_input_common
pytest ► tests.ui.test_splunk_ta_example_addon_input_common.firefox_TestInput ► test_inputs_filter_functionality_positive
Failed test found in:
test-results/test.xml
Error:
self = <ui.test_splunk_ta_example_addon_input_common.TestInput object at 0x7f4a1f903370>
Raw output
self = <ui.test_splunk_ta_example_addon_input_common.TestInput object at 0x7f4a1f903370>
ucc_smartx_selenium_helper = <pytest_splunk_addon_ui_smartx.base_test.SeleniumHelper object at 0x7f4a1f55de40>
ucc_smartx_rest_helper = <pytest_splunk_addon_ui_smartx.base_test.RestHelper object at 0x7f4a1f7b8be0>
add_input_one = {'entry': [{'acl': {'app': 'Splunk_TA_UCCExample', 'can_change_perms': True, 'can_list': True, 'can_share_app': True, ...nf-inputs/_reload', 'create': '/servicesNS/nobody/Splunk_TA_UCCExample/configs/conf-inputs/_new'}, 'messages': [], ...}
add_input_two = {'entry': [{'acl': {'app': 'Splunk_TA_UCCExample', 'can_change_perms': True, 'can_list': True, 'can_share_app': True, ...nf-inputs/_reload', 'create': '/servicesNS/nobody/Splunk_TA_UCCExample/configs/conf-inputs/_new'}, 'messages': [], ...}
@pytest.mark.execute_enterprise_cloud_true
@pytest.mark.forwarder
@pytest.mark.input
def test_inputs_filter_functionality_positive(
self,
ucc_smartx_selenium_helper,
ucc_smartx_rest_helper,
add_input_one,
add_input_two,
):
"""Verifies the filter functionality (Positive)"""
input_page = InputPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper)
> input_page.table.set_filter("dummy")
tests/ui/test_splunk_ta_example_addon_input_common.py:221:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pytest_splunk_addon_ui_smartx.components.input_table.InputTable object at 0x7f4a1f55cbe0>
filter_query = 'dummy'
def set_filter(self, filter_query):
"""
Provide a string in table filter.
:param filter_query: query of the filter
:returns: resultant list of filtered row_names
"""
> with self.wait_stale():
/usr/local/lib/python3.10/dist-packages/pytest_splunk_addon_ui_smartx/components/table.py:373:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <contextlib._GeneratorContextManager object at 0x7f4a1f7b9270>
def __enter__(self):
# do not keep args and kwds alive unnecessarily
# they are only needed for recreation, which is not possible anymore
del self.args, self.kwds, self.func
try:
> return next(self.gen)
/usr/lib/python3.10/contextlib.py:135:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pytest_splunk_addon_ui_smartx.components.input_table.InputTable object at 0x7f4a1f55cbe0>
@contextmanager
def wait_stale(self):
rows = list(self._get_rows())
col = copy.deepcopy(self.elements["col"])
col = col._replace(select=col.select.format(column="name"))
> col_element = self._get_element(col.by, col.select)
/usr/local/lib/python3.10/dist-packages/pytest_splunk_addon_ui_smartx/components/table.py:384:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pytest_splunk_addon_ui_smartx.components.input_table.InputTable object at 0x7f4a1f55cbe0>
by = 'css selector'
select = ' div[role="main"] [data-test="cell"][data-column="name"]'
def _get_element(self, by, select):
"""
Find the element from the page.
:param by: The type of the selenium locator
:param select: The selector text of type mentioned in by.
:returns: The webelement we are accessing
"""
msg = "by={} select={} Element not found in the page".format(by, select)
> return self.wait.until(EC.presence_of_element_located((by, select)), msg)
/usr/local/lib/python3.10/dist-packages/pytest_splunk_addon_ui_smartx/components/base_component.py:243:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <selenium.webdriver.support.wait.WebDriverWait (session="ebc338b7ef37450ebddb7732eac1b07e")>
method = <selenium.webdriver.support.expected_conditions.presence_of_element_located object at 0x7f4a1f7b9b70>
message = 'by=css selector select= div[role="main"] [data-test="cell"][data-column="name"] Element not found in the page'
def until(self, method, message=''):
"""Calls the method provided with the driver as an argument until the \
return value is not False."""
screen = None
stacktrace = None
end_time = time.time() + self._timeout
while True:
try:
value = method(self._driver)
if value:
return value
except self._ignored_exceptions as exc:
screen = getattr(exc, 'screen', None)
stacktrace = getattr(exc, 'stacktrace', None)
time.sleep(self._poll)
if time.time() > end_time:
break
> raise TimeoutException(message, screen, stacktrace)
E selenium.common.exceptions.TimeoutException: Message: by=css selector select= div[role="main"] [data-test="cell"][data-column="name"] Element not found in the page
/usr/local/lib/python3.10/dist-packages/selenium/webdriver/support/wait.py:80: TimeoutException
Check failure on line 0 in test-results/test.xml
github-actions / test-report-9.1.1__firefox_test_splunk_ta_example_addon_input_common
pytest ► tests.ui.test_splunk_ta_example_addon_input_common.firefox_TestInput ► test_inputs_create_new_input_list_values
Failed test found in:
test-results/test.xml
Error:
self = <ui.test_splunk_ta_example_addon_input_common.TestInput object at 0x7f4a1f902dd0>
Raw output
self = <ui.test_splunk_ta_example_addon_input_common.TestInput object at 0x7f4a1f902dd0>
ucc_smartx_selenium_helper = <pytest_splunk_addon_ui_smartx.base_test.SeleniumHelper object at 0x7f4a1f58dde0>
ucc_smartx_rest_helper = <pytest_splunk_addon_ui_smartx.base_test.RestHelper object at 0x7f4a1f7b8be0>
@pytest.mark.execute_enterprise_cloud_true
@pytest.mark.forwarder
@pytest.mark.input
def test_inputs_create_new_input_list_values(
self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper
):
"""Verifies input list dropdown"""
input_page = InputPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper)
create_new_input_list = ["Example Input One", "Example Input Two", "Group One"]
> self.assert_util(
input_page.create_new_input.get_inputs_list, create_new_input_list
)
tests/ui/test_splunk_ta_example_addon_input_common.py:248:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <ui.test_splunk_ta_example_addon_input_common.TestInput object at 0x7f4a1f902dd0>
left = <bound method Dropdown.get_inputs_list of <pytest_splunk_addon_ui_smartx.components.dropdown.Dropdown object at 0x7f4a1f58c2b0>>
right = ['Example Input One', 'Example Input Two', 'Group One'], operator = '=='
left_args = {}, right_args = {}, msg = None
def assert_util(
self, left, right, operator="==", left_args={}, right_args={}, msg=None
):
"""
Try to check the condition for {WAIT_TIMEOUT} seconds.
In UI Automation, it is not possible to expect things to work properly just milliseconds after an action.
Even in manual testing, we try things after 4-5 seconds and 2-3 times.
This utility method tries to achive the same assertion.
To perform certain action multiple time, provide callable functoins with arguments.
Params:
left (object or callable): LHS of the operator.
right (object or callable): RHS of the operator
operator: Operator. Possible values: (==, !=, <, >, <=, >=, in, not in, is, is not)
left_args: If left is callable, pass the parameters of the callable function.
right_args: If right is callable, pass the parameters of the callable function.
msg: Error message if the condition was not matched even after trying for {WAIT_TIMEOUT} seconds.
"""
args = {
"left": left,
"right": right,
"operator": operator,
"left_args": left_args,
"right_args": right_args,
"left_value": left,
"right_value": right,
}
operator_map = {
"==": lambda left, right: left == right,
"!=": lambda left, right: left != right,
"<": lambda left, right: left < right,
"<=": lambda left, right: left <= right,
">": lambda left, right: left > right,
">=": lambda left, right: left >= right,
"in": lambda left, right: left in right,
"not in": lambda left, right: left not in right,
"is": lambda left, right: left is right,
"is not": lambda left, right: left is not right,
}
def _assert(browser):
try:
if callable(args["left"]):
args["left_value"] = args["left"](**args["left_args"])
if callable(args["right"]):
args["right_value"] = args["right"](**args["right_args"])
except TimeoutException as e:
raise Exception("Timeout: {}".format(str(e)))
except ElementNotInteractableException as e:
raise Exception("Element not interactable: {}".format(str(e)))
return operator_map[args["operator"]](
args["left_value"], args["right_value"]
)
try:
> self.wait.until(_assert)
/usr/local/lib/python3.10/dist-packages/pytest_splunk_addon_ui_smartx/base_test.py:563:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <[AttributeError("'NoneType' object has no attribute 'session_id'") raised in repr()] WebDriverWait object at 0x7f4a1f7baa70>
method = <function UccTester.assert_util.<locals>._assert at 0x7f4a1f48a710>
message = ''
def until(self, method, message=''):
"""Calls the method provided with the driver as an argument until the \
return value is not False."""
screen = None
stacktrace = None
end_time = time.time() + self._timeout
while True:
try:
> value = method(self._driver)
/usr/local/lib/python3.10/dist-packages/selenium/webdriver/support/wait.py:71:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
browser = None
def _assert(browser):
try:
if callable(args["left"]):
> args["left_value"] = args["left"](**args["left_args"])
/usr/local/lib/python3.10/dist-packages/pytest_splunk_addon_ui_smartx/base_test.py:551:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pytest_splunk_addon_ui_smartx.components.dropdown.Dropdown object at 0x7f4a1f58c2b0>
def get_inputs_list(self):
"""
Returns a generator list for the options available in the add input dropdown
:return: Returns Generator list of values
"""
> self.add_input.click()
/usr/local/lib/python3.10/dist-packages/pytest_splunk_addon_ui_smartx/components/dropdown.py:159:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <selenium.webdriver.remote.webelement.WebElement (session="e1e25c00308b4a41bd55d4dbfdd14a2c", element="95c6a82e-f216-42b7-85d9-4b8c21f46334")>
def click(self):
"""Clicks the element."""
> self._execute(Command.CLICK_ELEMENT)
/usr/local/lib/python3.10/dist-packages/selenium/webdriver/remote/webelement.py:80:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <selenium.webdriver.remote.webelement.WebElement (session="e1e25c00308b4a41bd55d4dbfdd14a2c", element="95c6a82e-f216-42b7-85d9-4b8c21f46334")>
command = 'clickElement'
params = {'id': '95c6a82e-f216-42b7-85d9-4b8c21f46334', 'sessionId': 'e1e25c00308b4a41bd55d4dbfdd14a2c'}
def _execute(self, command, params=None):
"""Executes a command against the underlying HTML element.
Args:
command: The name of the command to _execute as a string.
params: A dictionary of named parameters to send with the command.
Returns:
The command's JSON response loaded into a dictionary object.
"""
if not params:
params = {}
params['id'] = self._id
> return self._parent.execute(command, params)
/usr/local/lib/python3.10/dist-packages/selenium/webdriver/remote/webelement.py:633:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <selenium.webdriver.remote.webdriver.WebDriver (session="e1e25c00308b4a41bd55d4dbfdd14a2c")>
driver_command = 'clickElement'
params = {'id': '95c6a82e-f216-42b7-85d9-4b8c21f46334'}
def execute(self, driver_command, params=None):
"""
Sends a command to be executed by a command.CommandExecutor.
:Args:
- driver_command: The name of the command to execute as a string.
- params: A dictionary of named parameters to send with the command.
:Returns:
The command's JSON response loaded into a dictionary object.
"""
if self.session_id is not None:
if not params:
params = {'sessionId': self.session_id}
elif 'sessionId' not in params:
params['sessionId'] = self.session_id
params = self._wrap_value(params)
response = self.command_executor.execute(driver_command, params)
if response:
> self.error_handler.check_response(response)
/usr/local/lib/python3.10/dist-packages/selenium/webdriver/remote/webdriver.py:321:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <selenium.webdriver.remote.errorhandler.ErrorHandler object at 0x7f4a1f58e890>
response = {'status': 404, 'value': '{"value":{"error":"stale element reference","message":"The element with the reference XXXXXX...sys.mjs:244:10\\nreceiveMessage@chrome://remote/content/marionette/actors/MarionetteCommandsChild.sys.mjs:72:30\\n"}}'}
def check_response(self, response):
"""
Checks that a JSON response from the WebDriver does not have an error.
:Args:
- response - The JSON response from the WebDriver server as a dictionary
object.
:Raises: If the response contains an error message.
"""
status = response.get('status', None)
if status is None or status == ErrorCode.SUCCESS:
return
value = None
message = response.get("message", "")
screen = response.get("screen", "")
stacktrace = None
if isinstance(status, int):
value_json = response.get('value', None)
if value_json and isinstance(value_json, basestring):
import json
try:
value = json.loads(value_json)
if len(value.keys()) == 1:
value = value['value']
status = value.get('error', None)
if status is None:
status = value["status"]
message = value["value"]
if not isinstance(message, basestring):
value = message
message = message.get('message')
else:
message = value.get('message', None)
except ValueError:
pass
exception_class = ErrorInResponseException
if status in ErrorCode.NO_SUCH_ELEMENT:
exception_class = NoSuchElementException
elif status in ErrorCode.NO_SUCH_FRAME:
exception_class = NoSuchFrameException
elif status in ErrorCode.NO_SUCH_WINDOW:
exception_class = NoSuchWindowException
elif status in ErrorCode.STALE_ELEMENT_REFERENCE:
exception_class = StaleElementReferenceException
elif status in ErrorCode.ELEMENT_NOT_VISIBLE:
exception_class = ElementNotVisibleException
elif status in ErrorCode.INVALID_ELEMENT_STATE:
exception_class = InvalidElementStateException
elif status in ErrorCode.INVALID_SELECTOR \
or status in ErrorCode.INVALID_XPATH_SELECTOR \
or status in ErrorCode.INVALID_XPATH_SELECTOR_RETURN_TYPER:
exception_class = InvalidSelectorException
elif status in ErrorCode.ELEMENT_IS_NOT_SELECTABLE:
exception_class = ElementNotSelectableException
elif status in ErrorCode.ELEMENT_NOT_INTERACTABLE:
exception_class = ElementNotInteractableException
elif status in ErrorCode.INVALID_COOKIE_DOMAIN:
exception_class = InvalidCookieDomainException
elif status in ErrorCode.UNABLE_TO_SET_COOKIE:
exception_class = UnableToSetCookieException
elif status in ErrorCode.TIMEOUT:
exception_class = TimeoutException
elif status in ErrorCode.SCRIPT_TIMEOUT:
exception_class = TimeoutException
elif status in ErrorCode.UNKNOWN_ERROR:
exception_class = WebDriverException
elif status in ErrorCode.UNEXPECTED_ALERT_OPEN:
exception_class = UnexpectedAlertPresentException
elif status in ErrorCode.NO_ALERT_OPEN:
exception_class = NoAlertPresentException
elif status in ErrorCode.IME_NOT_AVAILABLE:
exception_class = ImeNotAvailableException
elif status in ErrorCode.IME_ENGINE_ACTIVATION_FAILED:
exception_class = ImeActivationFailedException
elif status in ErrorCode.MOVE_TARGET_OUT_OF_BOUNDS:
exception_class = MoveTargetOutOfBoundsException
elif status in ErrorCode.JAVASCRIPT_ERROR:
exception_class = JavascriptException
elif status in ErrorCode.SESSION_NOT_CREATED:
exception_class = SessionNotCreatedException
elif status in ErrorCode.INVALID_ARGUMENT:
exception_class = InvalidArgumentException
elif status in ErrorCode.NO_SUCH_COOKIE:
exception_class = NoSuchCookieException
elif status in ErrorCode.UNABLE_TO_CAPTURE_SCREEN:
exception_class = ScreenshotException
elif status in ErrorCode.ELEMENT_CLICK_INTERCEPTED:
exception_class = ElementClickInterceptedException
elif status in ErrorCode.INSECURE_CERTIFICATE:
exception_class = InsecureCertificateException
elif status in ErrorCode.INVALID_COORDINATES:
exception_class = InvalidCoordinatesException
elif status in ErrorCode.INVALID_SESSION_ID:
exception_class = InvalidSessionIdException
elif status in ErrorCode.UNKNOWN_METHOD:
exception_class = UnknownMethodException
else:
exception_class = WebDriverException
if value == '' or value is None:
value = response['value']
if isinstance(value, basestring):
if exception_class == ErrorInResponseException:
raise exception_class(response, value)
raise exception_class(value)
if message == "" and 'message' in value:
message = value['message']
screen = None
if 'screen' in value:
screen = value['screen']
stacktrace = None
if 'stackTrace' in value and value['stackTrace']:
stacktrace = []
try:
for frame in value['stackTrace']:
line = self._value_or_default(frame, 'lineNumber', '')
file = self._value_or_default(frame, 'fileName', '<anonymous>')
if line:
file = "%s:%s" % (file, line)
meth = self._value_or_default(frame, 'methodName', '<anonymous>')
if 'className' in frame:
meth = "%s.%s" % (frame['className'], meth)
msg = " at %s (%s)"
msg = msg % (meth, file)
stacktrace.append(msg)
except TypeError:
pass
if exception_class == ErrorInResponseException:
raise exception_class(response, message)
elif exception_class == UnexpectedAlertPresentException:
alert_text = None
if 'data' in value:
alert_text = value['data'].get('text')
elif 'alert' in value:
alert_text = value['alert'].get('text')
raise exception_class(message, screen, stacktrace, alert_text)
> raise exception_class(message, screen, stacktrace)
E selenium.common.exceptions.StaleElementReferenceException: Message: The element with the reference XXXXXXXX-XXXX-XXXX-XXXX-XXXX21f46334 is stale; either its node document is not the active document, or it is no longer connected to the DOM
/usr/local/lib/python3.10/dist-packages/selenium/webdriver/remote/errorhandler.py:242: StaleElementReferenceException
Check failure on line 0 in test-results/test.xml
github-actions / test-report-9.1.1__firefox_test_splunk_ta_example_addon_input_common
pytest ► tests.ui.test_splunk_ta_example_addon_input_common.firefox_TestInput ► test_inputs_input_type_list_values
Failed test found in:
test-results/test.xml
Error:
browser = None
Raw output
browser = None
def _assert(browser):
try:
if callable(args["left"]):
> args["left_value"] = args["left"](**args["left_args"])
/usr/local/lib/python3.10/dist-packages/pytest_splunk_addon_ui_smartx/base_test.py:551:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pytest_splunk_addon_ui_smartx.components.dropdown.Dropdown object at 0x7f4a1f6189d0>
def get_input_type_list(self):
"""
Returns a generator list for the input types available in the add input dropdown
:return: Returns Generator list of values
"""
> self.type_dropdown.click()
/usr/local/lib/python3.10/dist-packages/pytest_splunk_addon_ui_smartx/components/dropdown.py:187:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pytest_splunk_addon_ui_smartx.components.dropdown.Dropdown object at 0x7f4a1f6189d0>
key = 'type_dropdown'
def __getattr__(self, key):
"""
Makes the web-elements to be accessible directly.
- For example self.elements = {"textbox": Selector(by=..., select=...),
Access the element by doing self.textbox directly.
- It also has implicit wait while finding the element.
:param key: The key of the element mentioned in self.elements
:returns: The webelement we are accessing
"""
try:
> return self.get_element(key)
/usr/local/lib/python3.10/dist-packages/pytest_splunk_addon_ui_smartx/components/base_component.py:222:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pytest_splunk_addon_ui_smartx.components.dropdown.Dropdown object at 0x7f4a1f6189d0>
key = 'type_dropdown'
def get_element(self, key):
"""
Get the web-element.
Note: There is a wait in get_element.
:param key: The key of the element mentioned in self.elements
:returns: element The element we are looking for by key
"""
element = self.elements[key]
> return self._get_element(element.by, element.select)
/usr/local/lib/python3.10/dist-packages/pytest_splunk_addon_ui_smartx/components/base_component.py:82:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pytest_splunk_addon_ui_smartx.components.dropdown.Dropdown object at 0x7f4a1f6189d0>
by = 'css selector', select = '.dropdownInput'
def _get_element(self, by, select):
"""
Find the element from the page.
:param by: The type of the selenium locator
:param select: The selector text of type mentioned in by.
:returns: The webelement we are accessing
"""
msg = "by={} select={} Element not found in the page".format(by, select)
> return self.wait.until(EC.presence_of_element_located((by, select)), msg)
/usr/local/lib/python3.10/dist-packages/pytest_splunk_addon_ui_smartx/components/base_component.py:243:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <selenium.webdriver.support.wait.WebDriverWait (session="7c2dba674d8448d3aa90034437da37e3")>
method = <selenium.webdriver.support.expected_conditions.presence_of_element_located object at 0x7f4a1f619e10>
message = 'by=css selector select=.dropdownInput Element not found in the page'
def until(self, method, message=''):
"""Calls the method provided with the driver as an argument until the \
return value is not False."""
screen = None
stacktrace = None
end_time = time.time() + self._timeout
while True:
try:
value = method(self._driver)
if value:
return value
except self._ignored_exceptions as exc:
screen = getattr(exc, 'screen', None)
stacktrace = getattr(exc, 'stacktrace', None)
time.sleep(self._poll)
if time.time() > end_time:
break
> raise TimeoutException(message, screen, stacktrace)
E selenium.common.exceptions.TimeoutException: Message: by=css selector select=.dropdownInput Element not found in the page
/usr/local/lib/python3.10/dist-packages/selenium/webdriver/support/wait.py:80: TimeoutException
During handling of the above exception, another exception occurred:
self = <ui.test_splunk_ta_example_addon_input_common.TestInput object at 0x7f4a1f902a40>
ucc_smartx_selenium_helper = <pytest_splunk_addon_ui_smartx.base_test.SeleniumHelper object at 0x7f4a1f4d29e0>
ucc_smartx_rest_helper = <pytest_splunk_addon_ui_smartx.base_test.RestHelper object at 0x7f4a1f7b8be0>
add_input_one = {'entry': [{'acl': {'app': 'Splunk_TA_UCCExample', 'can_change_perms': True, 'can_list': True, 'can_share_app': True, ...nf-inputs/_reload', 'create': '/servicesNS/nobody/Splunk_TA_UCCExample/configs/conf-inputs/_new'}, 'messages': [], ...}
add_input_two = {'entry': [{'acl': {'app': 'Splunk_TA_UCCExample', 'can_change_perms': True, 'can_list': True, 'can_share_app': True, ...nf-inputs/_reload', 'create': '/servicesNS/nobody/Splunk_TA_UCCExample/configs/conf-inputs/_new'}, 'messages': [], ...}
@pytest.mark.execute_enterprise_cloud_true
@pytest.mark.forwarder
@pytest.mark.input
def test_inputs_input_type_list_values(
self,
ucc_smartx_selenium_helper,
ucc_smartx_rest_helper,
add_input_one,
add_input_two,
):
"""Verifies input type filter list"""
input_page = InputPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper)
type_filter_list = [
"All",
"Example Input One",
"Example Input Two",
"Example Input Three",
"Example Input Four",
]
> self.assert_util(input_page.type_filter.get_input_type_list, type_filter_list)
tests/ui/test_splunk_ta_example_addon_input_common.py:271:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <ui.test_splunk_ta_example_addon_input_common.TestInput object at 0x7f4a1f902a40>
left = <bound method Dropdown.get_input_type_list of <pytest_splunk_addon_ui_smartx.components.dropdown.Dropdown object at 0x7f4a1f6189d0>>
right = ['All', 'Example Input One', 'Example Input Two', 'Example Input Three', 'Example Input Four']
operator = '==', left_args = {}, right_args = {}, msg = None
def assert_util(
self, left, right, operator="==", left_args={}, right_args={}, msg=None
):
"""
Try to check the condition for {WAIT_TIMEOUT} seconds.
In UI Automation, it is not possible to expect things to work properly just milliseconds after an action.
Even in manual testing, we try things after 4-5 seconds and 2-3 times.
This utility method tries to achive the same assertion.
To perform certain action multiple time, provide callable functoins with arguments.
Params:
left (object or callable): LHS of the operator.
right (object or callable): RHS of the operator
operator: Operator. Possible values: (==, !=, <, >, <=, >=, in, not in, is, is not)
left_args: If left is callable, pass the parameters of the callable function.
right_args: If right is callable, pass the parameters of the callable function.
msg: Error message if the condition was not matched even after trying for {WAIT_TIMEOUT} seconds.
"""
args = {
"left": left,
"right": right,
"operator": operator,
"left_args": left_args,
"right_args": right_args,
"left_value": left,
"right_value": right,
}
operator_map = {
"==": lambda left, right: left == right,
"!=": lambda left, right: left != right,
"<": lambda left, right: left < right,
"<=": lambda left, right: left <= right,
">": lambda left, right: left > right,
">=": lambda left, right: left >= right,
"in": lambda left, right: left in right,
"not in": lambda left, right: left not in right,
"is": lambda left, right: left is right,
"is not": lambda left, right: left is not right,
}
def _assert(browser):
try:
if callable(args["left"]):
args["left_value"] = args["left"](**args["left_args"])
if callable(args["right"]):
args["right_value"] = args["right"](**args["right_args"])
except TimeoutException as e:
raise Exception("Timeout: {}".format(str(e)))
except ElementNotInteractableException as e:
raise Exception("Element not interactable: {}".format(str(e)))
return operator_map[args["operator"]](
args["left_value"], args["right_value"]
)
try:
> self.wait.until(_assert)
/usr/local/lib/python3.10/dist-packages/pytest_splunk_addon_ui_smartx/base_test.py:563:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <[AttributeError("'NoneType' object has no attribute 'session_id'") raised in repr()] WebDriverWait object at 0x7f4a1f7baa70>
method = <function UccTester.assert_util.<locals>._assert at 0x7f4a1f5eda20>
message = ''
def until(self, method, message=''):
"""Calls the method provided with the driver as an argument until the \
return value is not False."""
screen = None
stacktrace = None
end_time = time.time() + self._timeout
while True:
try:
> value = method(self._driver)
/usr/local/lib/python3.10/dist-packages/selenium/webdriver/support/wait.py:71:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
browser = None
def _assert(browser):
try:
if callable(args["left"]):
args["left_value"] = args["left"](**args["left_args"])
if callable(args["right"]):
args["right_value"] = args["right"](**args["right_args"])
except TimeoutException as e:
> raise Exception("Timeout: {}".format(str(e)))
E Exception: Timeout: Message: by=css selector select=.dropdownInput Element not found in the page
/usr/local/lib/python3.10/dist-packages/pytest_splunk_addon_ui_smartx/base_test.py:555: Exception
Check failure on line 0 in test-results/test.xml
github-actions / test-report-9.1.1__firefox_test_splunk_ta_example_addon_input_common
pytest ► tests.ui.test_splunk_ta_example_addon_input_common.firefox_TestInput ► test_inputs_more_info
Failed test found in:
test-results/test.xml
Error:
self = <ui.test_splunk_ta_example_addon_input_common.TestInput object at 0x7f4a1f901000>
Raw output
self = <ui.test_splunk_ta_example_addon_input_common.TestInput object at 0x7f4a1f901000>
ucc_smartx_selenium_helper = <pytest_splunk_addon_ui_smartx.base_test.SeleniumHelper object at 0x7f4a1f4064a0>
ucc_smartx_rest_helper = <pytest_splunk_addon_ui_smartx.base_test.RestHelper object at 0x7f4a1f7b8be0>
add_input_one = {'entry': [{'acl': {'app': 'Splunk_TA_UCCExample', 'can_change_perms': True, 'can_list': True, 'can_share_app': True, ...nf-inputs/_reload', 'create': '/servicesNS/nobody/Splunk_TA_UCCExample/configs/conf-inputs/_new'}, 'messages': [], ...}
@pytest.mark.execute_enterprise_cloud_true
@pytest.mark.forwarder
@pytest.mark.input
def test_inputs_more_info(
self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper, add_input_one
):
"""Verifies the expand functionality of the inputs table"""
input_page = InputPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper)
> self.assert_util(
input_page.table.get_more_info,
{
"Name": "dummy_input_one",
"Interval": "90",
"Index": "default",
"Status": "Enabled",
"Example Account": "test_input",
"Object": "test_object",
"Object Fields": "test_field",
"Order By": "LastModifiedDate",
"Query Start Date": "2020-12-11T20:00:32.000z",
"Limit": "1000",
},
left_args={"name": "dummy_input_one"},
)
tests/ui/test_splunk_ta_example_addon_input_common.py:291:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <ui.test_splunk_ta_example_addon_input_common.TestInput object at 0x7f4a1f901000>
left = <bound method Table.get_more_info of <pytest_splunk_addon_ui_smartx.components.input_table.InputTable object at 0x7f4a1f4062c0>>
right = {'Example Account': 'test_input', 'Index': 'default', 'Interval': '90', 'Limit': '1000', ...}
operator = '==', left_args = {'name': 'dummy_input_one'}, right_args = {}
msg = None
def assert_util(
self, left, right, operator="==", left_args={}, right_args={}, msg=None
):
"""
Try to check the condition for {WAIT_TIMEOUT} seconds.
In UI Automation, it is not possible to expect things to work properly just milliseconds after an action.
Even in manual testing, we try things after 4-5 seconds and 2-3 times.
This utility method tries to achive the same assertion.
To perform certain action multiple time, provide callable functoins with arguments.
Params:
left (object or callable): LHS of the operator.
right (object or callable): RHS of the operator
operator: Operator. Possible values: (==, !=, <, >, <=, >=, in, not in, is, is not)
left_args: If left is callable, pass the parameters of the callable function.
right_args: If right is callable, pass the parameters of the callable function.
msg: Error message if the condition was not matched even after trying for {WAIT_TIMEOUT} seconds.
"""
args = {
"left": left,
"right": right,
"operator": operator,
"left_args": left_args,
"right_args": right_args,
"left_value": left,
"right_value": right,
}
operator_map = {
"==": lambda left, right: left == right,
"!=": lambda left, right: left != right,
"<": lambda left, right: left < right,
"<=": lambda left, right: left <= right,
">": lambda left, right: left > right,
">=": lambda left, right: left >= right,
"in": lambda left, right: left in right,
"not in": lambda left, right: left not in right,
"is": lambda left, right: left is right,
"is not": lambda left, right: left is not right,
}
def _assert(browser):
try:
if callable(args["left"]):
args["left_value"] = args["left"](**args["left_args"])
if callable(args["right"]):
args["right_value"] = args["right"](**args["right_args"])
except TimeoutException as e:
raise Exception("Timeout: {}".format(str(e)))
except ElementNotInteractableException as e:
raise Exception("Element not interactable: {}".format(str(e)))
return operator_map[args["operator"]](
args["left_value"], args["right_value"]
)
try:
> self.wait.until(_assert)
/usr/local/lib/python3.10/dist-packages/pytest_splunk_addon_ui_smartx/base_test.py:563:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <[AttributeError("'NoneType' object has no attribute 'session_id'") raised in repr()] WebDriverWait object at 0x7f4a1f7baa70>
method = <function UccTester.assert_util.<locals>._assert at 0x7f4a1f48ac20>
message = ''
def until(self, method, message=''):
"""Calls the method provided with the driver as an argument until the \
return value is not False."""
screen = None
stacktrace = None
end_time = time.time() + self._timeout
while True:
try:
> value = method(self._driver)
/usr/local/lib/python3.10/dist-packages/selenium/webdriver/support/wait.py:71:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
browser = None
def _assert(browser):
try:
if callable(args["left"]):
> args["left_value"] = args["left"](**args["left_args"])
/usr/local/lib/python3.10/dist-packages/pytest_splunk_addon_ui_smartx/base_test.py:551:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pytest_splunk_addon_ui_smartx.components.input_table.InputTable object at 0x7f4a1f4062c0>
name = 'dummy_input_one', cancel = True
def get_more_info(self, name, cancel=True):
"""
Returns the text from the more info field within a tables row
:param name: Str row name
:param cancel: Bool Whether or not to click cancel after getting the info
:return: Dict The information found when opening the info table on a row in the table
"""
> _row = self._get_row(name)
/usr/local/lib/python3.10/dist-packages/pytest_splunk_addon_ui_smartx/components/table.py:467:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pytest_splunk_addon_ui_smartx.components.input_table.InputTable object at 0x7f4a1f4062c0>
name = 'dummy_input_one'
def _get_row(self, name):
"""
Get the specified row.
:param name: row name
:return: element Gets the row specified within the table, or raises a warning if not found
"""
for each_row in self._get_rows():
if self._get_column_value(each_row, "name") == name:
return each_row
else:
> raise ValueError("{} row not found in table".format(name))
E ValueError: dummy_input_one row not found in table
/usr/local/lib/python3.10/dist-packages/pytest_splunk_addon_ui_smartx/components/table.py:439: ValueError
Check failure on line 0 in test-results/test.xml
github-actions / test-report-9.1.1__firefox_test_splunk_ta_example_addon_input_common
pytest ► tests.ui.test_splunk_ta_example_addon_input_common.firefox_TestInput ► test_inputs_enable_disable
Failed test found in:
test-results/test.xml
Error:
self = <ui.test_splunk_ta_example_addon_input_common.TestInput object at 0x7f4a1f68df30>
Raw output
self = <ui.test_splunk_ta_example_addon_input_common.TestInput object at 0x7f4a1f68df30>
ucc_smartx_selenium_helper = <pytest_splunk_addon_ui_smartx.base_test.SeleniumHelper object at 0x7f4a1f4c06d0>
ucc_smartx_rest_helper = <pytest_splunk_addon_ui_smartx.base_test.RestHelper object at 0x7f4a1f7b8be0>
add_input_one = {'entry': [{'acl': {'app': 'Splunk_TA_UCCExample', 'can_change_perms': True, 'can_list': True, 'can_share_app': True, ...nf-inputs/_reload', 'create': '/servicesNS/nobody/Splunk_TA_UCCExample/configs/conf-inputs/_new'}, 'messages': [], ...}
@pytest.mark.execute_enterprise_cloud_true
@pytest.mark.forwarder
@pytest.mark.input
def test_inputs_enable_disable(
self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper, add_input_one
):
"""Verifies the enable and disable functionality of the input"""
input_page = InputPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper)
> self.assert_util(
input_page.table.input_status_toggle,
True,
left_args={"name": "dummy_input_one", "enable": False},
)
tests/ui/test_splunk_ta_example_addon_input_common.py:316:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <ui.test_splunk_ta_example_addon_input_common.TestInput object at 0x7f4a1f68df30>
left = <bound method InputTable.input_status_toggle of <pytest_splunk_addon_ui_smartx.components.input_table.InputTable object at 0x7f4a1f4cecb0>>
right = True, operator = '=='
left_args = {'enable': False, 'name': 'dummy_input_one'}, right_args = {}
msg = None
def assert_util(
self, left, right, operator="==", left_args={}, right_args={}, msg=None
):
"""
Try to check the condition for {WAIT_TIMEOUT} seconds.
In UI Automation, it is not possible to expect things to work properly just milliseconds after an action.
Even in manual testing, we try things after 4-5 seconds and 2-3 times.
This utility method tries to achive the same assertion.
To perform certain action multiple time, provide callable functoins with arguments.
Params:
left (object or callable): LHS of the operator.
right (object or callable): RHS of the operator
operator: Operator. Possible values: (==, !=, <, >, <=, >=, in, not in, is, is not)
left_args: If left is callable, pass the parameters of the callable function.
right_args: If right is callable, pass the parameters of the callable function.
msg: Error message if the condition was not matched even after trying for {WAIT_TIMEOUT} seconds.
"""
args = {
"left": left,
"right": right,
"operator": operator,
"left_args": left_args,
"right_args": right_args,
"left_value": left,
"right_value": right,
}
operator_map = {
"==": lambda left, right: left == right,
"!=": lambda left, right: left != right,
"<": lambda left, right: left < right,
"<=": lambda left, right: left <= right,
">": lambda left, right: left > right,
">=": lambda left, right: left >= right,
"in": lambda left, right: left in right,
"not in": lambda left, right: left not in right,
"is": lambda left, right: left is right,
"is not": lambda left, right: left is not right,
}
def _assert(browser):
try:
if callable(args["left"]):
args["left_value"] = args["left"](**args["left_args"])
if callable(args["right"]):
args["right_value"] = args["right"](**args["right_args"])
except TimeoutException as e:
raise Exception("Timeout: {}".format(str(e)))
except ElementNotInteractableException as e:
raise Exception("Element not interactable: {}".format(str(e)))
return operator_map[args["operator"]](
args["left_value"], args["right_value"]
)
try:
> self.wait.until(_assert)
/usr/local/lib/python3.10/dist-packages/pytest_splunk_addon_ui_smartx/base_test.py:563:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <[AttributeError("'NoneType' object has no attribute 'session_id'") raised in repr()] WebDriverWait object at 0x7f4a1f7baa70>
method = <function UccTester.assert_util.<locals>._assert at 0x7f4a1f4b20e0>
message = ''
def until(self, method, message=''):
"""Calls the method provided with the driver as an argument until the \
return value is not False."""
screen = None
stacktrace = None
end_time = time.time() + self._timeout
while True:
try:
> value = method(self._driver)
/usr/local/lib/python3.10/dist-packages/selenium/webdriver/support/wait.py:71:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
browser = None
def _assert(browser):
try:
if callable(args["left"]):
> args["left_value"] = args["left"](**args["left_args"])
/usr/local/lib/python3.10/dist-packages/pytest_splunk_addon_ui_smartx/base_test.py:551:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pytest_splunk_addon_ui_smartx.components.input_table.InputTable object at 0x7f4a1f4cecb0>
name = 'dummy_input_one', enable = False
def input_status_toggle(self, name, enable):
"""
This function sets the table row status as either enabled or disabled. If it is already enabled then it reuturns an exception
:param name: Str The row that we want to enable st the status to as enabled or disabled
:param enable: Bool Whether or not we want the table field to be set to enable or disable
:return: Bool whether or not enabling or disabling the field was successful, If the field was already in the state we wanted it in, then it will return an exception
"""
> _row = self._get_row(name)
/usr/local/lib/python3.10/dist-packages/pytest_splunk_addon_ui_smartx/components/input_table.py:64:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pytest_splunk_addon_ui_smartx.components.input_table.InputTable object at 0x7f4a1f4cecb0>
name = 'dummy_input_one'
def _get_row(self, name):
"""
Get the specified row.
:param name: row name
:return: element Gets the row specified within the table, or raises a warning if not found
"""
for each_row in self._get_rows():
if self._get_column_value(each_row, "name") == name:
return each_row
else:
> raise ValueError("{} row not found in table".format(name))
E ValueError: dummy_input_one row not found in table
/usr/local/lib/python3.10/dist-packages/pytest_splunk_addon_ui_smartx/components/table.py:439: ValueError
Check failure on line 0 in test-results/test.xml
github-actions / test-report-9.1.1__firefox_test_splunk_ta_example_addon_input_common
pytest ► tests.ui.test_splunk_ta_example_addon_input_common.firefox_TestInput ► test_inputs_count
Failed test found in:
test-results/test.xml
Error:
browser = None
Raw output
browser = None
def _assert(browser):
try:
if callable(args["left"]):
> args["left_value"] = args["left"](**args["left_args"])
/usr/local/lib/python3.10/dist-packages/pytest_splunk_addon_ui_smartx/base_test.py:551:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pytest_splunk_addon_ui_smartx.components.input_table.InputTable object at 0x7f4a1f4c6020>
def get_count_title(self):
"""
Get the count mentioned in the table title
:return: Str The count of the table title
"""
> return self.get_clear_text(self.count)
/usr/local/lib/python3.10/dist-packages/pytest_splunk_addon_ui_smartx/components/table.py:113:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pytest_splunk_addon_ui_smartx.components.input_table.InputTable object at 0x7f4a1f4c6020>
key = 'count'
def __getattr__(self, key):
"""
Makes the web-elements to be accessible directly.
- For example self.elements = {"textbox": Selector(by=..., select=...),
Access the element by doing self.textbox directly.
- It also has implicit wait while finding the element.
:param key: The key of the element mentioned in self.elements
:returns: The webelement we are accessing
"""
try:
> return self.get_element(key)
/usr/local/lib/python3.10/dist-packages/pytest_splunk_addon_ui_smartx/components/base_component.py:222:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pytest_splunk_addon_ui_smartx.components.input_table.InputTable object at 0x7f4a1f4c6020>
key = 'count'
def get_element(self, key):
"""
Get the web-element.
Note: There is a wait in get_element.
:param key: The key of the element mentioned in self.elements
:returns: element The element we are looking for by key
"""
element = self.elements[key]
> return self._get_element(element.by, element.select)
/usr/local/lib/python3.10/dist-packages/pytest_splunk_addon_ui_smartx/components/base_component.py:82:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pytest_splunk_addon_ui_smartx.components.input_table.InputTable object at 0x7f4a1f4c6020>
by = 'css selector', select = ' div[role="main"] .inputNumber'
def _get_element(self, by, select):
"""
Find the element from the page.
:param by: The type of the selenium locator
:param select: The selector text of type mentioned in by.
:returns: The webelement we are accessing
"""
msg = "by={} select={} Element not found in the page".format(by, select)
> return self.wait.until(EC.presence_of_element_located((by, select)), msg)
/usr/local/lib/python3.10/dist-packages/pytest_splunk_addon_ui_smartx/components/base_component.py:243:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <selenium.webdriver.support.wait.WebDriverWait (session="fa64e3b80de746968bbb23c741948df9")>
method = <selenium.webdriver.support.expected_conditions.presence_of_element_located object at 0x7f4a1f3f94e0>
message = 'by=css selector select= div[role="main"] .inputNumber Element not found in the page'
def until(self, method, message=''):
"""Calls the method provided with the driver as an argument until the \
return value is not False."""
screen = None
stacktrace = None
end_time = time.time() + self._timeout
while True:
try:
value = method(self._driver)
if value:
return value
except self._ignored_exceptions as exc:
screen = getattr(exc, 'screen', None)
stacktrace = getattr(exc, 'stacktrace', None)
time.sleep(self._poll)
if time.time() > end_time:
break
> raise TimeoutException(message, screen, stacktrace)
E selenium.common.exceptions.TimeoutException: Message: by=css selector select= div[role="main"] .inputNumber Element not found in the page
/usr/local/lib/python3.10/dist-packages/selenium/webdriver/support/wait.py:80: TimeoutException
During handling of the above exception, another exception occurred:
self = <ui.test_splunk_ta_example_addon_input_common.TestInput object at 0x7f4a1f900370>
ucc_smartx_selenium_helper = <pytest_splunk_addon_ui_smartx.base_test.SeleniumHelper object at 0x7f4a1f55e380>
ucc_smartx_rest_helper = <pytest_splunk_addon_ui_smartx.base_test.RestHelper object at 0x7f4a1f7b8be0>
add_input_one = {'entry': [{'acl': {'app': 'Splunk_TA_UCCExample', 'can_change_perms': True, 'can_list': True, 'can_share_app': True, ...nf-inputs/_reload', 'create': '/servicesNS/nobody/Splunk_TA_UCCExample/configs/conf-inputs/_new'}, 'messages': [], ...}
add_input_two = {'entry': [{'acl': {'app': 'Splunk_TA_UCCExample', 'can_change_perms': True, 'can_list': True, 'can_share_app': True, ...nf-inputs/_reload', 'create': '/servicesNS/nobody/Splunk_TA_UCCExample/configs/conf-inputs/_new'}, 'messages': [], ...}
@pytest.mark.execute_enterprise_cloud_true
@pytest.mark.forwarder
@pytest.mark.input
def test_inputs_count(
self,
ucc_smartx_selenium_helper,
ucc_smartx_rest_helper,
add_input_one,
add_input_two,
):
"""Verifies count on table"""
input_page = InputPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper)
> self.assert_util(
input_page.table.get_count_title,
"{} Inputs".format(input_page.table.get_row_count()),
)
tests/ui/test_splunk_ta_example_addon_input_common.py:339:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <ui.test_splunk_ta_example_addon_input_common.TestInput object at 0x7f4a1f900370>
left = <bound method Table.get_count_title of <pytest_splunk_addon_ui_smartx.components.input_table.InputTable object at 0x7f4a1f4c6020>>
right = '0 Inputs', operator = '==', left_args = {}, right_args = {}, msg = None
def assert_util(
self, left, right, operator="==", left_args={}, right_args={}, msg=None
):
"""
Try to check the condition for {WAIT_TIMEOUT} seconds.
In UI Automation, it is not possible to expect things to work properly just milliseconds after an action.
Even in manual testing, we try things after 4-5 seconds and 2-3 times.
This utility method tries to achive the same assertion.
To perform certain action multiple time, provide callable functoins with arguments.
Params:
left (object or callable): LHS of the operator.
right (object or callable): RHS of the operator
operator: Operator. Possible values: (==, !=, <, >, <=, >=, in, not in, is, is not)
left_args: If left is callable, pass the parameters of the callable function.
right_args: If right is callable, pass the parameters of the callable function.
msg: Error message if the condition was not matched even after trying for {WAIT_TIMEOUT} seconds.
"""
args = {
"left": left,
"right": right,
"operator": operator,
"left_args": left_args,
"right_args": right_args,
"left_value": left,
"right_value": right,
}
operator_map = {
"==": lambda left, right: left == right,
"!=": lambda left, right: left != right,
"<": lambda left, right: left < right,
"<=": lambda left, right: left <= right,
">": lambda left, right: left > right,
">=": lambda left, right: left >= right,
"in": lambda left, right: left in right,
"not in": lambda left, right: left not in right,
"is": lambda left, right: left is right,
"is not": lambda left, right: left is not right,
}
def _assert(browser):
try:
if callable(args["left"]):
args["left_value"] = args["left"](**args["left_args"])
if callable(args["right"]):
args["right_value"] = args["right"](**args["right_args"])
except TimeoutException as e:
raise Exception("Timeout: {}".format(str(e)))
except ElementNotInteractableException as e:
raise Exception("Element not interactable: {}".format(str(e)))
return operator_map[args["operator"]](
args["left_value"], args["right_value"]
)
try:
> self.wait.until(_assert)
/usr/local/lib/python3.10/dist-packages/pytest_splunk_addon_ui_smartx/base_test.py:563:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <[AttributeError("'NoneType' object has no attribute 'session_id'") raised in repr()] WebDriverWait object at 0x7f4a1f7baa70>
method = <function UccTester.assert_util.<locals>._assert at 0x7f4a1f658700>
message = ''
def until(self, method, message=''):
"""Calls the method provided with the driver as an argument until the \
return value is not False."""
screen = None
stacktrace = None
end_time = time.time() + self._timeout
while True:
try:
> value = method(self._driver)
/usr/local/lib/python3.10/dist-packages/selenium/webdriver/support/wait.py:71:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
browser = None
def _assert(browser):
try:
if callable(args["left"]):
args["left_value"] = args["left"](**args["left_args"])
if callable(args["right"]):
args["right_value"] = args["right"](**args["right_args"])
except TimeoutException as e:
> raise Exception("Timeout: {}".format(str(e)))
E Exception: Timeout: Message: by=css selector select= div[role="main"] .inputNumber Element not found in the page
/usr/local/lib/python3.10/dist-packages/pytest_splunk_addon_ui_smartx/base_test.py:555: Exception