Skip to content

[Bug]: test_storage_cluster_validation_ui wrong storage system link in 4.18, 4.17 External #14502

@ebondare

Description

@ebondare

Description

A clear and concise description of the issue.

_locator = (".co-resource-item__resource-name[data-test-operand-link='ocs-storagecluster-storagesystem']", 'css selector')
_timeout = 30, _enable_screenshot = True, _copy_dom = False


def _do_click(_locator, _timeout=30, _enable_screenshot=False, _copy_dom=False):
    # wait for page fully loaded only if an element was not located
    # prevents needless waiting and frequent crushes on ODF Overview page,
    # when metrics and alerts frequently updated
    if not self.get_elements(_locator):
        self.page_has_loaded()
    screenshot = (
        ocsci_config.UI_SELENIUM.get("screenshot") and enable_screenshot
    )
    if screenshot:
        self.take_screenshot()
    if _copy_dom:
        self.copy_dom()

    wait = WebDriverWait(self.driver, timeout)
    try:
        if (
            version.get_semantic_version(get_ocp_version(), True)
            <= version.VERSION_4_11
        ):
            element = wait.until(
                ec.element_to_be_clickable((locator[1], locator[0]))
            )
        else:

          element = wait.until(
                ec.visibility_of_element_located((locator[1], locator[0]))
            )

ocs_ci/ocs/ui/base_ui.py:208: 



self = <selenium.webdriver.support.wait.WebDriverWait (session="5c4c684d1539514a7194f4fd8531dfb6")>
method = <function visibility_of_element_located.._predicate at 0x7ff868b8c540>
message = ''


def until(self, method: Callable[[D], Union[Literal[False], T]], message: str = "") -> T:
    """Wait until the method returns a value that is not False.

    Calls the method provided with the driver as an argument until the
    return value does not evaluate to ``False``.

    Parameters:
    -----------
    method: callable(WebDriver)
        - A callable object that takes a WebDriver instance as an argument.

    message: str
        - Optional message for :exc:`TimeoutException`

    Return:
    -------
    object: T
        - The result of the last call to `method`

    Raises:
    -------
    TimeoutException
        - If 'method' does not return a truthy value within the WebDriverWait
        object's timeout

    Example:
    --------
    >>> from selenium.webdriver.common.by import By
    >>> from selenium.webdriver.support.ui import WebDriverWait
    >>> from selenium.webdriver.support import expected_conditions as EC

    # Wait until an element is visible on the page
    >>> wait = WebDriverWait(driver, 10)
    >>> element = wait.until(EC.visibility_of_element_located((By.ID, "exampleId")))
    >>> print(element.text)
    """
    screen = None
    stacktrace = None

    end_time = time.monotonic() + 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)
        if time.monotonic() > end_time:
            break
        time.sleep(self._poll)

  raise TimeoutException(message, screen, stacktrace)
E       selenium.common.exceptions.TimeoutException: Message:
E       Stacktrace:
E       #0 0x560816a9671a 
E       #1 0x5608165390a0 
E       #2 0x56081658a9b0 
E       #3 0x56081658aba1 
E       #4 0x5608165d8ea4 
E       #5 0x5608165b03cd 
E       #6 0x5608165d62a0 
E       #7 0x5608165b0173 
E       #8 0x56081657cd4b 
E       #9 0x56081657d9b1 
E       #10 0x560816a5b8cb 
E       #11 0x560816a5f7ca 
E       #12 0x560816a43622 
E       #13 0x560816a60354 
E       #14 0x560816a2845f 
E       #15 0x560816a844f8 
E       #16 0x560816a846d6 
E       #17 0x560816a95586 
E       #18 0x7ff684a8b2fa start_thread



venv/lib64/python3.11/site-packages/selenium/webdriver/support/wait.py:138: TimeoutException


During handling of the above exception, another exception occurred:


self = <test_validation_ui.TestUserInterfaceValidation object at 0x7ff85f6e5710>
setup_ui_class_factory = <function setup_ui_class_factory..factory at 0x7ff85f5dbec0>


@ui
@runs_on_provider
@tier1
@polarion_id("OCS-4925")
@skipif_ui_not_support("validation")
def test_storage_cluster_validation_ui(self, setup_ui_class_factory):
    """
    Validate Storage Cluster status on UI

    Args:
        setup_ui_class: login function on conftest file

    """
    setup_ui_class_factory()

    validation_ui_obj = ValidationUI()

  validation_ui_obj.validate_storage_cluster_ui()

tests/cross_functional/ui/test_validation_ui.py:52: 



ocs_ci/ocs/ui/validation_ui.py:584: in validate_storage_cluster_ui
    self.do_click(
ocs_ci/ocs/ui/base_ui.py:221: in do_click
    _do_click(locator, timeout, enable_screenshot, copy_dom)



_locator = (".co-resource-item__resource-name[data-test-operand-link='ocs-storagecluster-storagesystem']", 'css selector')
_timeout = 30, _enable_screenshot = True, _copy_dom = False


def _do_click(_locator, _timeout=30, _enable_screenshot=False, _copy_dom=False):
    # wait for page fully loaded only if an element was not located
    # prevents needless waiting and frequent crushes on ODF Overview page,
    # when metrics and alerts frequently updated
    if not self.get_elements(_locator):
        self.page_has_loaded()
    screenshot = (
        ocsci_config.UI_SELENIUM.get("screenshot") and enable_screenshot
    )
    if screenshot:
        self.take_screenshot()
    if _copy_dom:
        self.copy_dom()

    wait = WebDriverWait(self.driver, timeout)
    try:
        if (
            version.get_semantic_version(get_ocp_version(), True)
            <= version.VERSION_4_11
        ):
            element = wait.until(
                ec.element_to_be_clickable((locator[1], locator[0]))
            )
        else:
            element = wait.until(
                ec.visibility_of_element_located((locator[1], locator[0]))
            )
        element.click()
    except TimeoutException as e:
        self.take_screenshot()
        self.copy_dom()
        logger.error(e)

      raise TimeoutException(
            f"Failed to find the element ({locator[1]},{locator[0]})"
        )
E           selenium.common.exceptions.TimeoutException: Message: Failed to find the element (css selector,.co-resource-item__resource-name[data-test-operand-link='ocs-storagecluster-storagesystem'])



ocs_ci/ocs/ui/base_ui.py:216: TimeoutException

Steps to Reproduce

Actual Behavior

Expected Behavior

Impact (likelihood of reproduction, impact on the cluster and on other tests, etc.)

Screenshots (if applicable)

Environment

  • Test Suite(s):
  • Platform(s):
  • Version(s):
  • OS:

Additional Context

Metadata

Metadata

Assignees

No one assigned

    Labels

    Squad/BlackCovers UI specific test cases such as ODF Dashboard etc.bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions