chore(deps): lock file maintenance #907
GitHub Actions / test-report-9.0.6__firefox_test_splunk_ta_example_addon_proxy
failed
Oct 27, 2023 in 1s
test-report-9.0.6__firefox_test_splunk_ta_example_addon_proxy ❌
❌ test-results/junit.xml
15 tests were completed in 304s with 14 passed, 1 failed and 0 skipped.
Test suite | Passed | Failed | Skipped | Time |
---|---|---|---|---|
pytest | 14✅ | 1❌ | 304s |
❌ pytest
test_splunk_ta_example_addon_proxy.chrome_TestProxy
✅ test_proxy_fields_label_entity
❌ test_proxy_fields_placeholder_value
self = <ui.test_splunk_ta_example_addon_proxy.TestProxy object at 0x7efcc45f4d50>
✅ test_proxy_default_configs
✅ test_proxy_required_field_host
✅ test_proxy_host_valid_input
✅ test_proxy_host_field_length_validation
✅ test_proxy_required_field_port
✅ test_proxy_port_field_valid_range
✅ test_proxy_port_field_out_of_range
✅ test_proxy_list_proxy_types
✅ test_proxy_required_field_proxy_type
✅ test_proxy_username_field_length_validation
✅ test_proxy_encrypted_field_password
✅ test_proxy_frontend_validation
✅ test_proxy_backend_validation
Annotations
Check failure on line 0 in test-results/junit.xml
github-actions / test-report-9.0.6__firefox_test_splunk_ta_example_addon_proxy
pytest ► test_splunk_ta_example_addon_proxy.chrome_TestProxy ► test_proxy_fields_placeholder_value
Failed test found in:
test-results/junit.xml
Error:
self = <ui.test_splunk_ta_example_addon_proxy.TestProxy object at 0x7efcc45f4d50>
Raw output
self = <ui.test_splunk_ta_example_addon_proxy.TestProxy object at 0x7efcc45f4d50>
ucc_smartx_selenium_helper = <pytest_splunk_addon_ui_smartx.base_test.SeleniumHelper object at 0x7efcc3384510>
ucc_smartx_rest_helper = <pytest_splunk_addon_ui_smartx.base_test.RestHelper object at 0x7efcc3384ed0>
@pytest.mark.execute_enterprise_cloud_false
@pytest.mark.forwarder
@pytest.mark.proxy
def test_proxy_fields_placeholder_value(
self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper
):
"""Verifies proxy input field placeholder value"""
proxy = Proxy(
TA_NAME,
TA_PROXY_URL,
TA_CONF,
ucc_smartx_selenium_helper,
ucc_smartx_rest_helper,
)
> self.assert_util(proxy.host.get_placeholder_value, "optional")
tests/ui/test_splunk_ta_example_addon_proxy.py:68:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <ui.test_splunk_ta_example_addon_proxy.TestProxy object at 0x7efcc45f4d50>
left = <bound method TextBox.get_placeholder_value of <pytest_splunk_addon_ui_smartx.components.controls.textbox.TextBox object at 0x7efcc4655050>>
right = 'optional', operator = '==', left_args = {}, right_args = {}
msg = 'Condition Failed. \nLeft-value: \nOperator: ==\nRight-value: optional'
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: optional
E assert False
E + where False = <function UccTester.assert_util.<locals>.<lambda> at 0x7efcc4877f80>('', 'optional')
pytest_splunk_addon_ui_smartx/base_test.py:573: AssertionError
Loading