Skip to content

Commit

Permalink
Change ACM Page title for IBM Cloud ROKS
Browse files Browse the repository at this point in the history
Signed-off-by: Petr Balogh <[email protected]>
  • Loading branch information
petr-balogh committed Dec 7, 2024
1 parent dc2babd commit f16a2a4
Show file tree
Hide file tree
Showing 3 changed files with 13 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 @@ -19,6 +19,7 @@
ACM_PAGE_TITLE,
ACM_2_7_MULTICLUSTER_URL,
ACM_PAGE_TITLE_2_7_ABOVE,
ACM_PAGE_TITLE_2_7_ABOVE_IBM_CLOUD_MANAGED,
)
from ocs_ci.ocs.ocp import OCP, get_ocp_url
from ocs_ci.framework import config
Expand Down Expand Up @@ -450,11 +451,18 @@ def login_to_acm():
page_nav = AcmPageNavigator()
if not compare_versions(cmp_str):
page_nav.navigate_from_ocp_to_acm_cluster_page()

ibm_cloud_managed = (
config.ENV_DATA["platform"] == constants.IBMCLOUD_PLATFORM
and config.ENV_DATA["deployment_type"] == "managed"
)
if compare_versions(cmp_str):
page_title = ACM_PAGE_TITLE_2_7_ABOVE
if ibm_cloud_managed:
page_title = ACM_PAGE_TITLE_2_7_ABOVE_IBM_CLOUD_MANAGED
else:
page_title = ACM_PAGE_TITLE_2_7_ABOVE
else:
page_title = ACM_PAGE_TITLE
log.info(f"Validating page title to be: {page_title}")
validate_page_title(title=page_title)

return driver
Expand Down
1 change: 1 addition & 0 deletions ocs_ci/ocs/acm/acm_constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@
# Misc.
ACM_PAGE_TITLE = "Red Hat Advanced Cluster Management for Kubernetes"
ACM_PAGE_TITLE_2_7_ABOVE = "Red Hat OpenShift"
ACM_PAGE_TITLE_2_7_ABOVE_IBM_CLOUD_MANAGED = "Red Hat OpenShift Container Platform"
ACM_2_7_MULTICLUSTER_URL = "/multicloud/infrastructure/clusters/managed"
2 changes: 2 additions & 0 deletions ocs_ci/ocs/ui/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -772,6 +772,8 @@
"modal_dialog_close_button": ("//button[@aria-label='Close']", By.XPATH),
"Policies": ("a[data-test-id='horizontal-link-Policies']", By.CSS_SELECTOR),
}
if ibm_cloud_managed:
acm_page_nav["Clusters_page"] = ("Cluster list", By.LINK_TEXT)

acm_configuration = {
"cluster-sets": ("//a[normalize-space()='Cluster sets']", By.XPATH),
Expand Down

0 comments on commit f16a2a4

Please sign in to comment.