Skip to content

logging

Logging(ta_name, ta_conf='', ucc_smartx_selenium_helper=None, ucc_smartx_rest_helper=None)

Bases: Entity

Parameters:

Name Type Description Default
ta_name

Name of TA

required
ta_conf

Name of conf file

''
ucc_smartx_selenium_helper

Fixture with selenium driver, urls(web, mgmt) and session key

None
ucc_smartx_rest_helper

Fixture with selenium driver, urls(mgmt)

None
Source code in pytest_splunk_addon_ui_smartx/pages/logging.py
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
def __init__(
    self,
    ta_name,
    ta_conf="",
    ucc_smartx_selenium_helper=None,
    ucc_smartx_rest_helper=None,
):
    """
    :param ta_name: Name of TA
    :param ta_conf: Name of conf file
    :param ucc_smartx_selenium_helper: Fixture with selenium driver, urls(web, mgmt) and session key
    :param ucc_smartx_rest_helper: Fixture with selenium driver, urls(mgmt)
    """
    entity_container = Selector(select='div[id="loggingTab"]')
    self.ta_name = ta_name
    self.ta_conf = ta_conf
    if self.ta_conf == "":
        self.ta_conf = "{}_settings".format(self.ta_name.lower())

    if ucc_smartx_selenium_helper:
        super().__init__(ucc_smartx_selenium_helper.browser, entity_container)
        self.splunk_web_url = ucc_smartx_selenium_helper.splunk_web_url
        self.log_level = SingleSelect(
            ucc_smartx_selenium_helper.browser,
            Selector(select='[data-test="control-group"][data-name="loglevel"]'),
        )
        self.open()
    if ucc_smartx_rest_helper:
        self.splunk_mgmt_url = ucc_smartx_rest_helper.splunk_mgmt_url
        self.backend_conf = SingleBackendConf(
            self._get_logging_url(),
            ucc_smartx_rest_helper.username,
            ucc_smartx_rest_helper.password,
        )

open()

Open the required page. Page(super) class opens the page by default.

Source code in pytest_splunk_addon_ui_smartx/pages/logging.py
64
65
66
67
68
69
70
71
72
def open(self):
    """
    Open the required page. Page(super) class opens the page by default.
    """
    self.browser.get(
        "{}/en-US/app/{}/configuration".format(self.splunk_web_url, self.ta_name)
    )
    tab = Tab(self.browser)
    tab.open_tab("logging")