From 869c8bd47f0d6309d6e98e953cb7acd0a21e03ae Mon Sep 17 00:00:00 2001 From: Shylesh Kumar Mohan Date: Fri, 20 Oct 2023 21:57:34 +0100 Subject: [PATCH] Handle UI part of unreleased submariner info Signed-off-by: Shylesh Kumar Mohan --- .../ocsci/submariner_downstream_unreleased.yaml | 1 + ocs_ci/ocs/acm/acm.py | 17 +++++++++++++++-- ocs_ci/ocs/ui/views.py | 8 ++++++++ 3 files changed, 24 insertions(+), 2 deletions(-) diff --git a/conf/ocsci/submariner_downstream_unreleased.yaml b/conf/ocsci/submariner_downstream_unreleased.yaml index a26c53b153f3..677219eebbbb 100644 --- a/conf/ocsci/submariner_downstream_unreleased.yaml +++ b/conf/ocsci/submariner_downstream_unreleased.yaml @@ -2,3 +2,4 @@ ENV_DATA: submariner_source: "downstream" submariner_release_type: "unreleased" submariner_version: "0.16.0" + submariner_unreleased_channel: "stable-0.16" diff --git a/ocs_ci/ocs/acm/acm.py b/ocs_ci/ocs/acm/acm.py index a7f907b2a9df..69555d1e3bde 100644 --- a/ocs_ci/ocs/acm/acm.py +++ b/ocs_ci/ocs/acm/acm.py @@ -265,6 +265,8 @@ def install_submariner_ui(self, globalnet=True): ) self.do_click(self.page_nav["gateway-count-btn"]) self.do_click(self.page_nav["gateway-count-btn"]) + if config.ENV_DATA.get("submariner_release_type") == "unreleased": + self.submariner_unreleased_downstream_info() log.info("Click on Next button") self.do_click(self.page_nav["next-btn"]) log.info("Click on 'Enable NAT-T' to uncheck it [2]") @@ -274,6 +276,8 @@ def install_submariner_ui(self, globalnet=True): ) self.do_click(self.page_nav["gateway-count-btn"]) self.do_click(self.page_nav["gateway-count-btn"]) + if config.ENV_DATA.get("submariner_release_type") == "unreleased": + self.submariner_unreleased_downstream_info() log.info("Click on Next button [2]") self.do_click(self.page_nav["next-btn"]) if ocs_version >= version.VERSION_4_13 and globalnet: @@ -282,12 +286,21 @@ def install_submariner_ui(self, globalnet=True): check_globalnet == constants.GLOBALNET_STATUS ), "Globalnet was not enabled" log.info("Globalnet is enabled") - # TODO: Use custom submariner sucscription from UI in case of downstream unreleased submariner - self.take_screenshot() log.info("Click on 'Install'") self.do_click(self.page_nav["install-btn"]) + def submariner_unreleased_downstream_info(self): + self.do_click(self.page_nav["submariner-custom-subscription"]) + self.do_clear(self.page_nav["submariner-custom-source"]) + self.do_send_keys( + self.page_nav["submariner-custom-source"], "submariner-catalogsource" + ) + self.do_send_keys( + self.page_nav["submariner-custom-channel"], + config.ENV_DATA["submariner_unreleased_channel"], + ) + def submariner_validation_ui(self): """ This function validates submariner status on ACM console which connects 2 managed OCP clusters. diff --git a/ocs_ci/ocs/ui/views.py b/ocs_ci/ocs/ui/views.py index 71791c1fa778..fcd3b03e23d6 100644 --- a/ocs_ci/ocs/ui/views.py +++ b/ocs_ci/ocs/ui/views.py @@ -879,6 +879,13 @@ **acm_configuration_4_12, } +acm_configuration_4_14 = { + **acm_configuration_4_13, + "submariner-custom-subscription": ("isCustomSubscription", By.ID), + "submariner-custom-source": ("source", By.ID), + "submariner-custom-channel": ("channel", By.ID), +} + add_capacity = { "ocs_operator": ( 'a[data-test-operator-row="OpenShift Container Storage"]', @@ -1710,6 +1717,7 @@ **acm_configuration_4_11, **acm_configuration_4_12, **acm_configuration_4_13, + **acm_configuration_4_14, }, "validation": { **validation,