Skip to content

Commit

Permalink
Fixed the bug with config tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
hhovsepy committed Apr 30, 2021
1 parent 45050d0 commit 2120266
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
15 changes: 10 additions & 5 deletions kiali_qe/tests/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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(
Expand Down Expand Up @@ -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'
Expand Down Expand Up @@ -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):
Expand All @@ -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)
Expand Down
3 changes: 2 additions & 1 deletion kiali_qe/tests/test_istio_objects_crud.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit 2120266

Please sign in to comment.