From 0808504ba1ab743acdf4231876d49c26dbae6621 Mon Sep 17 00:00:00 2001 From: Pavel Vomacka Date: Tue, 25 Oct 2016 16:54:28 +0200 Subject: TESTS: Add support for sidebar with facets Part of: https://fedorahosted.org/freeipa/ticket/5426 Reviewed-By: Martin Basti Reviewed-By: Petr Vobornik --- ipatests/test_webui/ui_driver.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/ipatests/test_webui/ui_driver.py b/ipatests/test_webui/ui_driver.py index 62dcced08..23d8127a9 100644 --- a/ipatests/test_webui/ui_driver.py +++ b/ipatests/test_webui/ui_driver.py @@ -451,8 +451,18 @@ class UI_driver(object): Click on tab with given name """ facet = self.get_facet() - s = "div.facet-tabs li[name='%s'] a" % name - link = self.find(s, By.CSS_SELECTOR, facet, strict=True) + tabs = "div.facet-tabs" + sidebar = "div.sidebar-pf" + + facets_container = self.find(tabs, By.CSS_SELECTOR, facet) + + # handle sidebar instead of facet-tabs + # the webui facet can have only the facet-tabs OR sidebar, not both + if not facets_container: + facets_container = self.find(sidebar, By.CSS_SELECTOR, facet) + + s = "li[name='%s'] a" % name + link = self.find(s, By.CSS_SELECTOR, facets_container, strict=True) link.click() # double wait because of facet's paging self.wait_for_request(0.5) -- cgit