chore(deps): update all dependencies #524
test-report-9.0.6__chrome_test_splunk_ta_example_addon_input_common ❌
❌ test-results/test.xml
13 tests were completed in 1092s with 1 passed, 12 failed and 0 skipped.
Test suite | Passed | Failed | Skipped | Time |
---|---|---|---|---|
pytest | 1✅ | 12❌ | 1092s |
❌ pytest
tests.ui.test_splunk_ta_example_addon_input_common.chrome_TestInput
❌ test_inputs_displayed_columns
self = <ui.test_splunk_ta_example_addon_input_common.TestInput object at 0x7f5c5bd294e0>
❌ 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 0x7f5c5bd28c40>
❌ test_inputs_filter_functionality_negative
self = <ui.test_splunk_ta_example_addon_input_common.TestInput object at 0x7f5c5bd2ae90>
❌ test_inputs_filter_functionality_positive
self = <ui.test_splunk_ta_example_addon_input_common.TestInput object at 0x7f5c5bd29720>
✅ test_inputs_default_rows_in_table
❌ test_inputs_create_new_input_list_values
browser = None
❌ test_inputs_input_type_list_values
browser = None
❌ test_inputs_more_info
self = <ui.test_splunk_ta_example_addon_input_common.TestInput object at 0x7f5c5bd29ea0>
❌ test_inputs_enable_disable
self = <ui.test_splunk_ta_example_addon_input_common.TestInput object at 0x7f5c5bd292a0>
❌ test_inputs_count
browser = None
❌ test_inputs_title_and_description
browser = None
Annotations
Check failure on line 0 in test-results/test.xml
github-actions / test-report-9.0.6__chrome_test_splunk_ta_example_addon_input_common
pytest ► tests.ui.test_splunk_ta_example_addon_input_common.chrome_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 0x7f5c5bd294e0>
Raw output
self = <ui.test_splunk_ta_example_addon_input_common.TestInput object at 0x7f5c5bd294e0>
ucc_smartx_selenium_helper = <pytest_splunk_addon_ui_smartx.base_test.SeleniumHelper object at 0x7f5c59fb7c10>
ucc_smartx_rest_helper = <pytest_splunk_addon_ui_smartx.base_test.RestHelper object at 0x7f5c5a445690>
@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 0x7f5c5bd294e0>
left = <bound method Table.get_headers of <pytest_splunk_addon_ui_smartx.components.input_table.InputTable object at 0x7f5c59fb7e50>>
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 0x7f5c5a0652d0>([], ['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.0.6__chrome_test_splunk_ta_example_addon_input_common
pytest ► tests.ui.test_splunk_ta_example_addon_input_common.chrome_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 0x7f5c59e1d0f0>
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:145:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pytest_splunk_addon_ui_smartx.components.dropdown.Dropdown object at 0x7f5c59e1d0f0>
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 0x7f5c59e1d0f0>
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 0x7f5c59e1d0f0>
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="89669c1b459043d19ae23edca2122ee5")>
method = <selenium.webdriver.support.expected_conditions.presence_of_element_located object at 0x7f5c59e1cbb0>
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 0x7f5c5bd2a260>
ucc_smartx_selenium_helper = <pytest_splunk_addon_ui_smartx.base_test.SeleniumHelper object at 0x7f5c59e1f3a0>
ucc_smartx_rest_helper = <pytest_splunk_addon_ui_smartx.base_test.RestHelper object at 0x7f5c5a445690>
@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 0x7f5c5bd2a260>
left = <bound method Dropdown.get_pagination_list of <pytest_splunk_addon_ui_smartx.components.dropdown.Dropdown object at 0x7f5c59e1d0f0>>
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 0x7f5c5a444910>
method = <function UccTester.assert_util.<locals>._assert at 0x7f5c5a046d40>
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.0.6__chrome_test_splunk_ta_example_addon_input_common
pytest ► tests.ui.test_splunk_ta_example_addon_input_common.chrome_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 0x7f5c5a3a2a70>
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 0x7f5c5a3a2a70>
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 0x7f5c5a3a2a70>
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 0x7f5c5a3a2a70>
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="48d9d6cc675740ddb98a83ef265ef3e8")>
method = <selenium.webdriver.support.expected_conditions.presence_of_element_located object at 0x7f5c5a3a0bb0>
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 0x7f5c5bd2b0a0>
ucc_smartx_selenium_helper = <pytest_splunk_addon_ui_smartx.base_test.SeleniumHelper object at 0x7f5c59db4430>
ucc_smartx_rest_helper = <pytest_splunk_addon_ui_smartx.base_test.RestHelper object at 0x7f5c5a445690>
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 0x7f5c5bd2b0a0>
left = <bound method Dropdown.select_page_option of <pytest_splunk_addon_ui_smartx.components.dropdown.Dropdown object at 0x7f5c5a3a2a70>>
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 0x7f5c5a444910>
method = <function UccTester.assert_util.<locals>._assert at 0x7f5c5a03bc70>
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.0.6__chrome_test_splunk_ta_example_addon_input_common
pytest ► tests.ui.test_splunk_ta_example_addon_input_common.chrome_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 0x7f5c5bd28c40>
Raw output
self = <ui.test_splunk_ta_example_addon_input_common.TestInput object at 0x7f5c5bd28c40>
ucc_smartx_selenium_helper = <pytest_splunk_addon_ui_smartx.base_test.SeleniumHelper object at 0x7f5c59fc7730>
ucc_smartx_rest_helper = <pytest_splunk_addon_ui_smartx.base_test.RestHelper object at 0x7f5c5a445690>
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 0x7f5c59e73a00>
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 0x7f5c59e73a00>
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 0x7f5c59e73a00>
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 0x7f5c59e73a00>
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="4b34c4c1b34c482593590ce204069058")>
method = <selenium.webdriver.support.expected_conditions.presence_of_element_located object at 0x7f5c59e73c10>
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.0.6__chrome_test_splunk_ta_example_addon_input_common
pytest ► tests.ui.test_splunk_ta_example_addon_input_common.chrome_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 0x7f5c5bd2ae90>
Raw output
self = <ui.test_splunk_ta_example_addon_input_common.TestInput object at 0x7f5c5bd2ae90>
ucc_smartx_selenium_helper = <pytest_splunk_addon_ui_smartx.base_test.SeleniumHelper object at 0x7f5c59fb6440>
ucc_smartx_rest_helper = <pytest_splunk_addon_ui_smartx.base_test.RestHelper object at 0x7f5c5a445690>
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 0x7f5c59f23f10>
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 0x7f5c59f22170>
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 0x7f5c59f23f10>
@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 0x7f5c59f23f10>
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="ee1ee8d3d9f04bbd807f21460505c930")>
method = <selenium.webdriver.support.expected_conditions.presence_of_element_located object at 0x7f5c59f22830>
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.0.6__chrome_test_splunk_ta_example_addon_input_common
pytest ► tests.ui.test_splunk_ta_example_addon_input_common.chrome_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 0x7f5c5bd29720>
Raw output
self = <ui.test_splunk_ta_example_addon_input_common.TestInput object at 0x7f5c5bd29720>
ucc_smartx_selenium_helper = <pytest_splunk_addon_ui_smartx.base_test.SeleniumHelper object at 0x7f5c59e0fbb0>
ucc_smartx_rest_helper = <pytest_splunk_addon_ui_smartx.base_test.RestHelper object at 0x7f5c5a445690>
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 0x7f5c59e0fd90>
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 0x7f5c59e0f130>
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 0x7f5c59e0fd90>
@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 0x7f5c59e0fd90>
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="e2202fb6c72a4876a147ccaa9ad58372")>
method = <selenium.webdriver.support.expected_conditions.presence_of_element_located object at 0x7f5c59e0ef50>
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.0.6__chrome_test_splunk_ta_example_addon_input_common
pytest ► tests.ui.test_splunk_ta_example_addon_input_common.chrome_TestInput ► test_inputs_create_new_input_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 0x7f5c5a3a1de0>
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:131:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pytest_splunk_addon_ui_smartx.components.dropdown.Dropdown object at 0x7f5c5a3a1de0>
key = 'add_input'
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 0x7f5c5a3a1de0>
key = 'add_input'
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 0x7f5c5a3a1de0>
by = 'id', select = 'addInputBtn'
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="5317349707224479946f91b9c85b2e89")>
method = <selenium.webdriver.support.expected_conditions.presence_of_element_located object at 0x7f5c59fb6f20>
message = 'by=id select=addInputBtn 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=id select=addInputBtn 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 0x7f5c5bd2b8b0>
ucc_smartx_selenium_helper = <pytest_splunk_addon_ui_smartx.base_test.SeleniumHelper object at 0x7f5c5a3a0880>
ucc_smartx_rest_helper = <pytest_splunk_addon_ui_smartx.base_test.RestHelper object at 0x7f5c5a445690>
@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"]
> 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 0x7f5c5bd2b8b0>
left = <bound method Dropdown.get_inputs_list of <pytest_splunk_addon_ui_smartx.components.dropdown.Dropdown object at 0x7f5c5a3a1de0>>
right = ['Example Input One', 'Example Input Two'], 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 0x7f5c5a444910>
method = <function UccTester.assert_util.<locals>._assert at 0x7f5c5a0469e0>
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=id select=addInputBtn 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.0.6__chrome_test_splunk_ta_example_addon_input_common
pytest ► tests.ui.test_splunk_ta_example_addon_input_common.chrome_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 0x7f5c59ede3b0>
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:159:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pytest_splunk_addon_ui_smartx.components.dropdown.Dropdown object at 0x7f5c59ede3b0>
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 0x7f5c59ede3b0>
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 0x7f5c59ede3b0>
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="6c4664fab6ea43f6a5e1929d88160802")>
method = <selenium.webdriver.support.expected_conditions.presence_of_element_located object at 0x7f5c59ede170>
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 0x7f5c5bd2bf70>
ucc_smartx_selenium_helper = <pytest_splunk_addon_ui_smartx.base_test.SeleniumHelper object at 0x7f5c59fbefe0>
ucc_smartx_rest_helper = <pytest_splunk_addon_ui_smartx.base_test.RestHelper object at 0x7f5c5a445690>
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"]
> self.assert_util(input_page.type_filter.get_input_type_list, type_filter_list)
tests/ui/test_splunk_ta_example_addon_input_common.py:265:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <ui.test_splunk_ta_example_addon_input_common.TestInput object at 0x7f5c5bd2bf70>
left = <bound method Dropdown.get_input_type_list of <pytest_splunk_addon_ui_smartx.components.dropdown.Dropdown object at 0x7f5c59ede3b0>>
right = ['All', 'Example Input One', 'Example Input Two'], 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 0x7f5c5a444910>
method = <function UccTester.assert_util.<locals>._assert at 0x7f5c59f1df30>
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.0.6__chrome_test_splunk_ta_example_addon_input_common
pytest ► tests.ui.test_splunk_ta_example_addon_input_common.chrome_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 0x7f5c5bd29ea0>
Raw output
self = <ui.test_splunk_ta_example_addon_input_common.TestInput object at 0x7f5c5bd29ea0>
ucc_smartx_selenium_helper = <pytest_splunk_addon_ui_smartx.base_test.SeleniumHelper object at 0x7f5c59de4a30>
ucc_smartx_rest_helper = <pytest_splunk_addon_ui_smartx.base_test.RestHelper object at 0x7f5c5a445690>
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:281:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <ui.test_splunk_ta_example_addon_input_common.TestInput object at 0x7f5c5bd29ea0>
left = <bound method Table.get_more_info of <pytest_splunk_addon_ui_smartx.components.input_table.InputTable object at 0x7f5c59e1ad10>>
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 0x7f5c5a444910>
method = <function UccTester.assert_util.<locals>._assert at 0x7f5c59e7ab00>
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 0x7f5c59e1ad10>
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 0x7f5c59e1ad10>
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.0.6__chrome_test_splunk_ta_example_addon_input_common
pytest ► tests.ui.test_splunk_ta_example_addon_input_common.chrome_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 0x7f5c5bd292a0>
Raw output
self = <ui.test_splunk_ta_example_addon_input_common.TestInput object at 0x7f5c5bd292a0>
ucc_smartx_selenium_helper = <pytest_splunk_addon_ui_smartx.base_test.SeleniumHelper object at 0x7f5c59efaa40>
ucc_smartx_rest_helper = <pytest_splunk_addon_ui_smartx.base_test.RestHelper object at 0x7f5c5a445690>
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:306:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <ui.test_splunk_ta_example_addon_input_common.TestInput object at 0x7f5c5bd292a0>
left = <bound method InputTable.input_status_toggle of <pytest_splunk_addon_ui_smartx.components.input_table.InputTable object at 0x7f5c59ef99c0>>
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 0x7f5c5a444910>
method = <function UccTester.assert_util.<locals>._assert at 0x7f5c5a0640d0>
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 0x7f5c59ef99c0>
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 0x7f5c59ef99c0>
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.0.6__chrome_test_splunk_ta_example_addon_input_common
pytest ► tests.ui.test_splunk_ta_example_addon_input_common.chrome_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 0x7f5c59e1c070>
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 0x7f5c59e1c070>
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 0x7f5c59e1c070>
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 0x7f5c59e1c070>
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="2cf78a473c3b49d684b294e4ef382b7a")>
method = <selenium.webdriver.support.expected_conditions.presence_of_element_located object at 0x7f5c59e1e3b0>
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 0x7f5c5bd2ba90>
ucc_smartx_selenium_helper = <pytest_splunk_addon_ui_smartx.base_test.SeleniumHelper object at 0x7f5c5a3a3970>
ucc_smartx_rest_helper = <pytest_splunk_addon_ui_smartx.base_test.RestHelper object at 0x7f5c5a445690>
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:329:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <ui.test_splunk_ta_example_addon_input_common.TestInput object at 0x7f5c5bd2ba90>
left = <bound method Table.get_count_title of <pytest_splunk_addon_ui_smartx.components.input_table.InputTable object at 0x7f5c59e1c070>>
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 0x7f5c5a444910>
method = <function UccTester.assert_util.<locals>._assert at 0x7f5c59dc3640>
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