diff --git a/kiali_qe/tests/__init__.py b/kiali_qe/tests/__init__.py index 79a1c917..a4e6bf19 100644 --- a/kiali_qe/tests/__init__.py +++ b/kiali_qe/tests/__init__.py @@ -74,7 +74,8 @@ ) from kiali_qe.utils.log import logger from kiali_qe.utils.command_exec import oc_apply, oc_delete - +from time import sleep +from selenium.webdriver.common.keys import Keys from kiali_qe.pages import ( ServicesPage, IstioConfigPage, @@ -128,6 +129,8 @@ def get_additional_filters(self, namespaces, current_filters): def open(self, name, namespace=None, force_refresh=False): # TODO added wait for unstable performance + self.browser.send_keys_to_focused_element(Keys.ESCAPE) + sleep(0.5) wait_to_spinner_disappear(self.browser) if namespace is not None: self.browser.click(self.browser.element( @@ -235,6 +238,8 @@ def apply_filters(self, filters, force_clear_all=True): self.page.filter.remove(filter_name=_filter['name'], value=_filter['value']) self.assert_applied_filters(filters) + self.browser.send_keys_to_focused_element(Keys.ESCAPE) + sleep(0.2) def apply_label_operation(self, label_operation): assert self.page.filter._label_operation.is_displayed, 'Label Operation is not displayed' @@ -2023,11 +2028,10 @@ def _prepare_load_details_page(self, name, namespace, object_type=None): # apply namespace self.apply_namespaces(namespaces=[namespace]) # apply filters - self.apply_filters(filters=[ - {'name': IstioConfigPageFilter.ISTIO_NAME.text, 'value': name}]) + _filters = [{'name': IstioConfigPageFilter.ISTIO_NAME.text, 'value': name}] if object_type: - self.apply_filters(filters=[ - {'name': IstioConfigPageFilter.ISTIO_TYPE.text, 'value': object_type}]) + _filters.append({'name': IstioConfigPageFilter.ISTIO_TYPE.text, 'value': object_type}) + self.apply_filters(filters=_filters) def load_details_page(self, name, namespace, object_type=None, force_refresh=False, load_only=False): @@ -2036,6 +2040,7 @@ def load_details_page(self, name, namespace, object_type=None, self._prepare_load_details_page(name, namespace, object_type) wait_to_spinner_disappear(self.browser) self.open(name, namespace, force_refresh) + wait_to_spinner_disappear(self.browser) self.browser.wait_for_element(locator='//button[contains(., "YAML")]', parent='//*[contains(@class, "pf-c-page__main-section")]') wait_to_spinner_disappear(self.browser) diff --git a/kiali_qe/tests/test_istio_objects_crud.py b/kiali_qe/tests/test_istio_objects_crud.py index 64d45677..83b9a4c1 100644 --- a/kiali_qe/tests/test_istio_objects_crud.py +++ b/kiali_qe/tests/test_istio_objects_crud.py @@ -755,7 +755,8 @@ def _vs_gateway_link_test(kiali_client, openshift_client, browser, config_dict, tests = IstioConfigPageTest( kiali_client=kiali_client, openshift_client=openshift_client, browser=browser) - tests.load_details_page(vs_name, namespace, kind, force_refresh=False, load_only=True) + # object_type should not be set here + tests.load_details_page(vs_name, namespace, force_refresh=False, load_only=True) tests.click_on_gateway(config_dict.metadata.name, namespace)