TESTS: Add support for sidebar with facets

Part of: https://fedorahosted.org/freeipa/ticket/5426

Reviewed-By: Martin Basti <mbasti@redhat.com>
Reviewed-By: Petr Vobornik <pvoborni@redhat.com>
This commit is contained in:
Pavel Vomacka
2016-10-25 16:54:28 +02:00
committed by Martin Basti
parent ab8c69f4c6
commit 0808504ba1

View File

@@ -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)