Skip to content

Commit

Permalink
fix stale element
Browse files Browse the repository at this point in the history
Signed-off-by: am-agrawa <[email protected]>
  • Loading branch information
am-agrawa committed Jul 30, 2024
1 parent 53f7624 commit e2d0945
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions ocs_ci/ocs/acm/acm.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,11 @@
from selenium.webdriver.support.wait import WebDriverWait
from selenium.webdriver.support import expected_conditions as ec
from selenium.webdriver.common.by import By
from selenium.common.exceptions import NoSuchElementException
from selenium.common.exceptions import (
NoSuchElementException,
StaleElementReferenceException,
TimeoutException,
)
from ocs_ci.helpers.helpers import create_unique_resource_name
from ocs_ci.ocs import constants
from ocs_ci.ocs.acm.acm_constants import (
Expand Down Expand Up @@ -43,6 +47,7 @@
from ocs_ci.utility import templating
from ocs_ci.ocs.resources.ocs import OCS
from ocs_ci.helpers.helpers import create_project
from ocs_ci.utility.retry import retry

log = logging.getLogger(__name__)

Expand All @@ -56,6 +61,7 @@ class AcmAddClusters(AcmPageNavigator):
def __init__(self):
super().__init__()
self.page_nav = self.acm_page_nav
self.driver = SeleniumDriver()

def import_cluster_ui(self, cluster_name, kubeconfig_location):
"""
Expand Down Expand Up @@ -234,7 +240,9 @@ def install_submariner_ui(self, globalnet=True):
log.info("Click on 'Submariner add-ons' tab")
self.do_click(self.page_nav["submariner-tab"])
log.info("Click on 'Install Submariner add-ons' button")
self.do_click(self.page_nav["install-submariner-btn"], timeout=120)
retry((StaleElementReferenceException, TimeoutException), retries=5, delay=10)(
self.do_click
)(self.page_nav["install-submariner-btn"], enable_screenshot=True)
log.info("Click on 'Target clusters'")
self.do_click(self.page_nav["target-clusters"])
log.info(f"Select 1st cluster which is {cluster_name_a}")
Expand Down

0 comments on commit e2d0945

Please sign in to comment.