From 5c1532a5b0d9299d9ae9514d47e1c542c0c39865 Mon Sep 17 00:00:00 2001 From: Hayk Hovsepyan Date: Tue, 4 May 2021 07:37:21 +0200 Subject: [PATCH] Fixed details overview page loading issues --- .../validation/wrong-host-label-sidecar.yaml | 4 ++-- kiali_qe/components/__init__.py | 9 ++++----- kiali_qe/rest/openshift_api.py | 2 +- kiali_qe/tests/__init__.py | 4 ++++ kiali_qe/tests/test_applications_page.py | 2 +- 5 files changed, 12 insertions(+), 9 deletions(-) diff --git a/data/resources/istio_objects/validation/wrong-host-label-sidecar.yaml b/data/resources/istio_objects/validation/wrong-host-label-sidecar.yaml index fd32f285..96110331 100644 --- a/data/resources/istio_objects/validation/wrong-host-label-sidecar.yaml +++ b/data/resources/istio_objects/validation/wrong-host-label-sidecar.yaml @@ -16,5 +16,5 @@ spec: - "istio-system/istio-telemetry.istio-system.svc.cluster.local" - "istio-system/istio-policy.istio-system.svc.cluster.local" - "default/*.other.svc.cluster.local" - - "bookinfo/www.google.com" - \ No newline at end of file + - "bookinfo/wrong.bookinfo.svc.cluster.local" + diff --git a/kiali_qe/components/__init__.py b/kiali_qe/components/__init__.py index df316209..a615f65f 100644 --- a/kiali_qe/components/__init__.py +++ b/kiali_qe/components/__init__.py @@ -3131,7 +3131,7 @@ def items(self): for el in self.browser.elements(locator=self.ROWS, parent=ListViewAbstract.DETAILS_ROOT): _name = el.text.replace('W', '').strip() - # TODO status + # TODO status and tooltip # create Workload instance _workload = AppWorkload( name=_name, @@ -3146,16 +3146,15 @@ class CardViewIstioConfig(CardViewAbstract): GATEWAYS = '//div[@id="gateways"]//ul[contains(@class, "details")]//li' SECTION_ROOT = (ListViewAbstract.DETAILS_ROOT + '//article[@id="IstioConfigCard"]') - ROWS = SECTION_ROOT+'//table//tbody//tr' - ROW = SECTION_ROOT+'//table'\ - '//tbody//tr//td//a[text()="{}"]/..//span[text()="{}"]/../../..' + ROWS = '//div/table/tbody/tr' + ROW = ROWS+'//td//a[text()="{}"]/..//span[text()="{}"]/../../..' SUBSETS_ROW = '//div[@id="subsets"]//table//tbody//tr' @property def items(self): _items = [] - for el in self.browser.elements(self.ROWS): + for el in self.browser.elements(self.SECTION_ROOT+self.ROWS): _columns = list(self.browser.elements(locator=self.COLUMN, parent=el)) if len(_columns) < 2: # empty row diff --git a/kiali_qe/rest/openshift_api.py b/kiali_qe/rest/openshift_api.py index d18656a2..4fb9c96e 100644 --- a/kiali_qe/rest/openshift_api.py +++ b/kiali_qe/rest/openshift_api.py @@ -514,7 +514,7 @@ def application_details(self, namespace, application_name): _application = ApplicationDetails( name=application_name, - workloads=workloads.values(), + workloads=list(set(workloads.values())), services=list(set(services)), istio_sidecar=all([w.istio_sidecar for w in workloads.values()]), health=None, diff --git a/kiali_qe/tests/__init__.py b/kiali_qe/tests/__init__.py index a4e6bf19..d0bd10d5 100644 --- a/kiali_qe/tests/__init__.py +++ b/kiali_qe/tests/__init__.py @@ -1017,6 +1017,10 @@ def assert_details(self, name, namespace, check_metrics=False, force_refresh=Fal application_details_ui.application_status.deployment_statuses, application_details_oc.application_status.deployment_statuses, application_details_ui.name)''' + assert is_equal([_w.name for _w in application_details_ui.workloads], + [_w.name for _w in application_details_rest.workloads]) + assert is_equal([_w.name for _w in application_details_oc.workloads], + [_w.name for _w in application_details_rest.workloads]) for workload_ui in application_details_ui.workloads: found = False for workload_rest in application_details_rest.workloads: diff --git a/kiali_qe/tests/test_applications_page.py b/kiali_qe/tests/test_applications_page.py index 4be9a8b0..d6b18659 100644 --- a/kiali_qe/tests/test_applications_page.py +++ b/kiali_qe/tests/test_applications_page.py @@ -106,7 +106,7 @@ def test_application_graph_overview(kiali_client, openshift_client, browser, pic def test_application_details_random(kiali_client, openshift_client, browser, pick_namespace): tests = ApplicationsPageTest( kiali_client=kiali_client, openshift_client=openshift_client, browser=browser) - namespace = pick_namespace(BOOKINFO_2) + namespace = pick_namespace(BOOKINFO) tests.assert_random_details(namespaces=[namespace])