def __init__(self,
                 ucc_smartx_selenium_helper=None,
                 ucc_smartx_rest_helper=None,
                 open_page=True):
        """
            :param ucc_smartx_selenium_helper: smartx configuration fixture
        """
        super(AccountPage, self).__init__(ucc_smartx_selenium_helper,
                                          ucc_smartx_rest_helper, open_page)
        account_container = Selector(select='div[id="accountTab"]')

        if ucc_smartx_selenium_helper:
            self.title = Message(
                ucc_smartx_selenium_helper.browser,
                Selector(select='[data-test="column"] .pageTitle'))
            self.description = Message(
                ucc_smartx_selenium_helper.browser,
                Selector(select='[data-test="column"] .pageSubtitle'))
            self.table = ConfigurationTable(ucc_smartx_selenium_helper.browser,
                                            account_container)
            self.entity = AccountEntity(ucc_smartx_selenium_helper.browser,
                                        account_container)

        if ucc_smartx_rest_helper:
            self.backend_conf = ListBackendConf(
                self._get_account_endpoint(), ucc_smartx_rest_helper.username,
                ucc_smartx_rest_helper.password)
def setup_alert(ucc_smartx_selenium_helper):
    """
    Skip the popups in Splunk before executing the tests
    """
    try:
        # Splunk 8.x
        if not setup_alert.first_execution:
            return
        AlertPage(ucc_smartx_selenium_helper, None, open_page=False)
        intro_popup = Button(ucc_smartx_selenium_helper.browser,
                             Selector(select=".modal-footer .btn-save"))
        intro_popup.wait_to_be_clickable()
        intro_popup.click()
        setup_alert.first_execution = False

        # Splunk 8.0.x
        important_changes_coming = Button(
            ucc_smartx_selenium_helper.browser,
            Selector(
                select=
                'div[data-test-name="python3-notification-modal"] button[data-test="button"][data-appearance="secondary"]'
            ))
        important_changes_coming.wait_to_be_clickable()
        important_changes_coming.click()
    except:
        pass
    def __init__(self, browser):
        """
            :param browser: The selenium webdriver
            :param container: The container in which the entity is located in
        """
        
        super(TestAction, self).__init__(browser)

        # Controls
        self.name = AlertTextBox(browser, Selector(select="#test_alert_name"), use_child_input=True)
        self.all_incident = AlertCheckbox(browser, Selector(select="#test_alert_all_incidents"))
        self.table_list = AlertSingleSelect(browser, Selector(select="#test_alert_table_list"))
        self.action = AlertToggle(browser, Selector(select='input[name="action.test_alert.param.action"]'))
        self.account = AlertAccountSelect(browser, Selector(select='#test_alert_account'))
Exemplo n.º 4
0
 def __init__(self, ucc_smartx_selenium_helper=None, ucc_smartx_rest_helper=None, open_page=True):
     """
         :param ucc_smartx_selenium_helper: smartx configuration fixture
     """
     super(AccountPage, self).__init__(ucc_smartx_selenium_helper, ucc_smartx_rest_helper, open_page)
     account_container = Selector(select="div#account-tab")
     
     if ucc_smartx_selenium_helper:
         self.title = Message(ucc_smartx_selenium_helper.browser, Selector(by=By.CLASS_NAME, select="tool-title"))
         self.description = Message(ucc_smartx_selenium_helper.browser, Selector(by=By.CLASS_NAME, select="tool-description"))
         self.table = ConfigurationTable(ucc_smartx_selenium_helper.browser, account_container)
         self.entity = AccountEntity(ucc_smartx_selenium_helper.browser, account_container)
     
     if ucc_smartx_rest_helper:
         self.backend_conf = ListBackendConf(self._get_account_endpoint(), ucc_smartx_rest_helper.username, ucc_smartx_rest_helper.password)
    def __init__(self,
                 ucc_smartx_selenium_helper=None,
                 ucc_smartx_rest_helper=None,
                 open_page=True):
        """
            :param browser: The selenium webdriver
            :param urls: Splunk web & management url. {"web": , "mgmt": }
            :param session_key: session key to access the rest endpoints
        """
        super(InputPage, self).__init__(ucc_smartx_selenium_helper,
                                        ucc_smartx_rest_helper, open_page)

        input_container = Selector(select=' div[role="main"]')
        if ucc_smartx_selenium_helper:
            self.title = Message(
                ucc_smartx_selenium_helper.browser,
                Selector(select=' [data-test="column"] .pageTitle'))
            self.description = Message(
                ucc_smartx_selenium_helper.browser,
                Selector(select=' [data-test="column"] .pageSubtitle'))
            self.create_new_input = Dropdown(
                ucc_smartx_selenium_helper.browser,
                Selector(select='[id="addInputBtn"]'))
            self.table = InputTable(ucc_smartx_selenium_helper.browser,
                                    input_container,
                                    mapping={
                                        "status": "disabled",
                                        "input_type": 3
                                    })
            self.entity1 = ExampleInputOne(ucc_smartx_selenium_helper.browser,
                                           input_container)
            self.entity2 = ExampleInputTwo(ucc_smartx_selenium_helper.browser,
                                           input_container)
            self.pagination = Dropdown(ucc_smartx_selenium_helper.browser,
                                       Selector(select='.dropdownPage'))
            self.type_filter = Dropdown(ucc_smartx_selenium_helper.browser,
                                        Selector(select='.dropdownInput'))

        if ucc_smartx_rest_helper:
            self.backend_conf = ListBackendConf(
                self._get_input_endpoint(), ucc_smartx_rest_helper.username,
                ucc_smartx_rest_helper.password)
    def __init__(self, ucc_smartx_selenium_helper=None, ucc_smartx_rest_helper=None, open_page=True):
        """
            :param browser: The selenium webdriver
            :param urls: Splunk web & management url. {"web": , "mgmt": }
            :param session_key: session key to access the rest endpoints
        """
        super(InputPage, self).__init__(ucc_smartx_selenium_helper, ucc_smartx_rest_helper, open_page)

        input_container = Selector(select="div.inputsContainer")
        if ucc_smartx_selenium_helper:
            self.title = Message(ucc_smartx_selenium_helper.browser, Selector(by=By.CLASS_NAME, select="tool-title"))
            self.description = Message(ucc_smartx_selenium_helper.browser, Selector(by=By.CLASS_NAME, select="tool-description"))
            self.create_new_input = Dropdown(ucc_smartx_selenium_helper.browser, Selector(select=".add-button"))
            self.table = InputTable(ucc_smartx_selenium_helper.browser, input_container, mapping={"status": "disabled", "input_type":3})
            self.entity1 = ExampleInputOne(ucc_smartx_selenium_helper.browser, input_container)
            self.entity2 = ExampleInputTwo(ucc_smartx_selenium_helper.browser, input_container)
            self.pagination = Dropdown(ucc_smartx_selenium_helper.browser, Selector(select="control btn-group shared-controls-syntheticselectcontrol control-default"))
            self.type_filter = Dropdown(ucc_smartx_selenium_helper.browser, Selector(select=" .type-filter"))
        
        if ucc_smartx_rest_helper:
            self.backend_conf = ListBackendConf(self._get_input_endpoint(), ucc_smartx_rest_helper.username, ucc_smartx_rest_helper.password)
    def __init__(self, browser, container):
        """
            :param browser: The selenium webdriver
            :param container: The container in which the entity is located in
        """
        add_btn = Button(
            browser,
            Selector(select=container.select +
                     ' button[data-test="button"][label="Add"]'))
        entity_container = Selector(select='[data-test="modal"]')

        super(AccountEntity, self).__init__(browser,
                                            entity_container,
                                            add_btn=add_btn)

        # Controls
        self.name = TextBox(
            browser,
            Selector(select='[data-test="control-group"][data-name="name"]'))
        self.environment = SingleSelect(
            browser,
            Selector(
                select=
                '[data-test="control-group"][data-name="custom_endpoint"]'),
            False)
        self.account_radio = Toggle(
            browser,
            Selector(
                select='[data-test="control-group"][data-name="account_radio"]'
            ))
        self.example_checkbox = Checkbox(
            browser,
            Selector(
                select=
                '[data-test="control-group"][data-name="account_checkbox"]'))
        self.multiple_select = MultiSelect(
            browser,
            Selector(
                select=
                '[data-test="control-group"][data-name="account_multiple_select"]'
            ))
        self.auth_key = OAuthSelect(
            browser,
            Selector(
                select='[data-test="control-group"][data-name="auth_type"]'))
        self.username = TextBox(
            browser,
            Selector(
                select='[data-test="control-group"][data-name="username"]'))
        self.password = TextBox(
            browser,
            Selector(
                select='[data-test="control-group"][data-name="password"]'))
        self.security_token = TextBox(
            browser,
            Selector(select='[data-test="control-group"][data-name="token"]'))
        self.client_id = TextBox(
            browser,
            Selector(
                select='[data-test="control-group"][data-name="client_id"]'))
        self.client_secret = TextBox(
            browser,
            Selector(
                select='[data-test="control-group"][data-name="client_secret"]'
            ))
        self.redirect_url = TextBox(
            browser,
            Selector(
                select='[data-test="control-group"][data-name="redirect_url"]')
        )
        self.search_query = TextBox(
            browser, Selector(select='[data-test="textbox"][role="textbox"]'))
        self.help_link = LearnMore(
            browser,
            Selector(
                select=entity_container.select +
                ' [data-test="control-group"][data-name="example_help_link"]'))
        self.title = BaseComponent(browser,
                                   Selector(select='[data-test="title"]'))
Exemplo n.º 8
0
    def __init__(self, browser, container):
        """
            :param browser: The selenium webdriver
            :param container: The container in which the entity is located in
        """
        add_btn = Button(browser, Selector(select=container.select + " button.add-button" ))
        entity_container = Selector(select=".modal-content")
        
        super(AccountEntity, self).__init__(browser, entity_container, add_btn=add_btn)

        # Controls
        self.name = TextBox(browser, Selector(select=".name"))
        self.environment = SingleSelect(browser, Selector(select=".custom_endpoint"), False)
        self.account_radio = Toggle(browser, Selector(select=".account_radio"))
        self.example_checkbox = Checkbox(browser, Selector(select=".account_checkbox"))
        self.multiple_select = MultiSelect(browser, Selector(select=".account_multiple_select"))
        self.auth_key = OAuthSelect(browser, Selector(select=".auth_type"))
        self.username = TextBox(browser, Selector(select=".form-horizontal .username"))
        self.password = TextBox(browser, Selector(select=".form-horizontal .password"))
        self.security_token = TextBox(browser, Selector(select=".form-horizontal .token"))
        self.client_id = TextBox(browser, Selector(select=".form-horizontal .client_id"))
        self.client_secret = TextBox(browser, Selector(select=".form-horizontal .client_secret"))
        self.redirect_url = TextBox(browser, Selector(select=".form-horizontal .redirect_url"))
        self.search_query  = TextBox(browser, Selector(select=" .search-query"))
        self.help_link = LearnMore(browser, Selector(select=entity_container.select + " .example_help_link a"))
        self.title = BaseComponent(browser, Selector(select= "h4.modal-title"))
Exemplo n.º 9
0
    def __init__(self, ucc_smartx_selenium_helper=None, ucc_smartx_rest_helper=None, open_page=True):
        """
            :param ucc_smartx_selenium_helper: fixture contains browser, urls and session key
        """
        entity_container = Selector(select="#customized-tab-tab")

        # Components
        if ucc_smartx_selenium_helper:
            super(Custom, self).__init__(ucc_smartx_selenium_helper.browser, entity_container)
            self.splunk_web_url = ucc_smartx_selenium_helper.splunk_web_url
            self.open()    
            self.test_string = TextBox(ucc_smartx_selenium_helper.browser, Selector(select=".test_string"))
            self.test_number = TextBox(ucc_smartx_selenium_helper.browser, Selector(select=".test_number"))
            self.test_regex = TextBox(ucc_smartx_selenium_helper.browser, Selector(select=".test_regex"))
            self.test_email = TextBox(ucc_smartx_selenium_helper.browser, Selector(select=".test_email"))
            self.test_ipv4 = TextBox(ucc_smartx_selenium_helper.browser, Selector(select=".test_ipv4"))
            self.test_date = TextBox(ucc_smartx_selenium_helper.browser, Selector(select=".test_date"))
            self.test_url = TextBox(ucc_smartx_selenium_helper.browser, Selector(select=".test_url"))
            self.test_radio = Toggle(ucc_smartx_selenium_helper.browser, Selector(select=".test_radio"))
            self.test_multiselect = MultiSelect(ucc_smartx_selenium_helper.browser, Selector(select=".test_multiselect"))
            self.test_help_link = LearnMore(ucc_smartx_selenium_helper.browser, Selector(select=".test_help_link a"))

        if ucc_smartx_rest_helper:
            self.splunk_mgmt_url = ucc_smartx_rest_helper.splunk_mgmt_url   
            self.backend_conf = SingleBackendConf(self._get_custom_url(), ucc_smartx_rest_helper.username, ucc_smartx_rest_helper.password)
    def __init__(self, browser, container):
        """
            :param browser: The selenium webdriver
            :param container: The container in which the entity is located in
        """
        add_btn = Button(browser, Selector(select=container.select + " .add-button"))
        entity_container = Selector(select=".modal-content")
        
        super(ExampleInputTwo, self).__init__(browser, entity_container, add_btn=add_btn)

        # Controls
        self.name = TextBox(browser, Selector(select=".name"))
        self.interval = TextBox(browser, Selector(select=".interval"))
        self.index = SingleSelect(browser, Selector(select=entity_container.select + " .index"))
        self.example_account = SingleSelect(browser, Selector(select=entity_container.select + " .account"))
        self.example_multiple_select = MultiSelect(browser, Selector(select=entity_container.select + " .input_two_multiple_select"))
        self.example_checkbox = Checkbox(browser, Selector(select=entity_container.select + " .input_two_checkbox"))
        self.example_radio = Toggle(browser, Selector(select=entity_container.select + " .input_two_radio"))
        self.query_start_date = TextBox(browser, Selector(select=".start_date"))
        self.help_link = LearnMore(browser, Selector(select=entity_container.select + " .example_help_link a"))
        self.title = BaseComponent(browser, Selector(select= "h4.modal-title"))
    def __init__(self, browser, container):
        """
            :param browser: The selenium webdriver
            :param container: The container in which the entity is located in
        """
        add_btn = Button(
            browser, Selector(select=container.select + '[id="addInputBtn"]'))
        entity_container = Selector(select='[data-test="modal"]')

        super(ExampleInputOne, self).__init__(browser,
                                              entity_container,
                                              add_btn=add_btn)

        # Controls
        self.name = TextBox(
            browser,
            Selector(select=' [data-test="control-group"][data-name="name"]'))
        self.example_checkbox = Checkbox(
            browser,
            Selector(
                select=entity_container.select +
                ' [data-test="control-group"][data-name="input_one_checkbox"]')
        )
        self.example_radio = Toggle(
            browser,
            Selector(
                select=entity_container.select +
                ' [data-test="control-group"][data-name="input_one_radio"]'))
        self.single_select_group_test = SingleSelect(
            browser,
            Selector(
                select=entity_container.select +
                ' [data-test="control-group"][data-name="singleSelectTest"]'),
            allow_new_values=True)
        self.multiple_select_test = MultiSelect(
            browser,
            Selector(
                select=entity_container.select +
                ' [data-test="control-group"][data-name="multipleSelectTest"]')
        )
        self.interval = TextBox(
            browser,
            Selector(
                select=' [data-test="control-group"][data-name="interval"]'))
        self.index = SingleSelect(
            browser,
            Selector(select=entity_container.select +
                     ' [data-test="control-group"][data-name="index"]'),
            allow_new_values=True)
        self.example_account = SingleSelect(
            browser,
            Selector(select=entity_container.select +
                     ' [data-test="control-group"][data-name="account"]'))
        self.object = TextBox(
            browser,
            Selector(
                select=' [data-test="control-group"][data-name="object"]'))
        self.object_fields = TextBox(
            browser,
            Selector(
                select=' [data-test="control-group"][data-name="object_fields"]'
            ))
        self.order_by = TextBox(
            browser,
            Selector(
                select=' [data-test="control-group"][data-name="order_by"]'))
        self.query_start_date = TextBox(
            browser,
            Selector(
                select=' [data-test="control-group"][data-name="start_date"]'))
        self.limit = TextBox(
            browser,
            Selector(select=' [data-test="control-group"][data-name="limit"]'))
        self.help_link = LearnMore(
            browser,
            Selector(
                select=entity_container.select +
                ' [data-test="control-group"][data-name="example_help_link"]'))
        self.title = BaseComponent(browser,
                                   Selector(select=' [data-test="title"]'))