Skip to content

page

Page(ucc_smartx_selenium_helper, ucc_smartx_rest_helper, open_page=True)

Instance of a Page class holds all the components inside the page. To access the component, just do page.component.action_method() The page class should not have any interaction method for any visible components. It is supposed to hold all the components only.

Parameters:

Name Type Description Default
ucc_smartx_selenium_helper

The selenium webdriver

required
ucc_smartx_rest_helper

Splunk web & management url. {“web”: , “mgmt”: }

required
Source code in pytest_splunk_addon_ui_smartx/pages/page.py
24
25
26
27
28
29
30
31
32
33
34
35
36
37
def __init__(
    self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper, open_page=True
):
    """
    :param ucc_smartx_selenium_helper: The selenium webdriver
    :param ucc_smartx_rest_helper: Splunk web & management url. {"web": , "mgmt": }
    """
    if ucc_smartx_selenium_helper:
        self.browser = ucc_smartx_selenium_helper.browser
        self.splunk_web_url = ucc_smartx_selenium_helper.splunk_web_url
        if open_page:
            self.open()
    if ucc_smartx_rest_helper:
        self.splunk_mgmt_url = ucc_smartx_rest_helper.splunk_mgmt_url

open()

Abstract Method. Open the page

Source code in pytest_splunk_addon_ui_smartx/pages/page.py
39
40
41
42
43
def open(self):
    """
    Abstract Method. Open the page
    """
    self.browser.get(self.splunk_web_url)