Skip to content

message

Message(browser, container)

Bases: BaseControl

Entity-Component: Message

Parameters:

Name Type Description Default
browser

The selenium webdriver

required
container

The locator of the container where the control is located in.

required
Source code in pytest_splunk_addon_ui_smartx/components/controls/message.py
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
def __init__(self, browser, container):
    """
    :param browser: The selenium webdriver
    :param container: The locator of the container where the control is located in.
    """
    super().__init__(browser, container)
    self.elements.update(
        {
            # changes w.r.t. splunk-ui 4.30.0
            "msg_text": Selector(
                select=container.select
                + '[data-test="message"] div[data-test="content"]'
            ),
        }
    )

get_msg()

Returns the error message :return: Str error message

Source code in pytest_splunk_addon_ui_smartx/components/controls/message.py
50
51
52
53
54
55
def get_msg(self):
    """
    Returns the error message
        :return: Str error message
    """
    return self.msg_text.text.strip()

wait_loading()

Wait till the message appears and then disappears :return: Str The text message after waiting

Source code in pytest_splunk_addon_ui_smartx/components/controls/message.py
57
58
59
60
61
62
63
64
65
66
67
def wait_loading(self):
    """
    Wait till the message appears and then disappears
        :return: Str The text message after waiting
    """
    try:
        text = self.container.text
        self.wait_until("container")
        return text
    except:
        pass

wait_to_display()

Wait till the message appears :return: Str The text message after appearing

Source code in pytest_splunk_addon_ui_smartx/components/controls/message.py
69
70
71
72
73
74
def wait_to_display(self):
    """
    Wait till the message appears
        :return: Str The text message after appearing
    """
    return self.container.text.strip()