Skip to content

tabs

Tab(browser, container=Selector(select='[data-test="tab-bar"]'))

Bases: BaseComponent

Component: Tab To change the tab in configuration page

Parameters:

Name Type Description Default
browser

The selenium webdriver

required
container

Container in which the table is located. Of type dictionary: {“by”:…, “select”:…}

Selector(select='[data-test="tab-bar"]')
Source code in pytest_splunk_addon_ui_smartx/components/tabs.py
30
31
32
33
34
35
36
37
38
39
40
41
def __init__(self, browser, container=Selector(select='[data-test="tab-bar"]')):
    """
    :param browser: The selenium webdriver
    :param container: Container in which the table is located. Of type dictionary: {"by":..., "select":...}
    """
    super().__init__(browser, container)
    self.elements.update(
        {
            "tab": Selector(select='[data-test="tab"][data-test-tab-id="{tab}"]'),
            "container": Selector(select='[data-test="tab-bar"]'),
        }
    )

open_tab(tab)

Open a specified tab :param tab: id of the tab

Source code in pytest_splunk_addon_ui_smartx/components/tabs.py
43
44
45
46
47
48
49
50
51
52
def open_tab(self, tab):
    """
    Open a specified tab
        :param tab: id of the tab
    """
    self.wait_for("container")
    tab_to_open = self._get_element(
        self.elements["tab"].by, self.elements["tab"].select.format(tab=tab).strip()
    )
    tab_to_open.click()