Exemple #1
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"))
    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(ExampleInputOne, self).__init__(browser, entity_container, add_btn=add_btn)

        # Controls
        self.name = TextBox(browser, Selector(select=".name"))
        self.example_checkbox = Checkbox(browser, Selector(select=entity_container.select + " .input_one_checkbox"))
        self.example_radio = Toggle(browser, Selector(select=entity_container.select + " .input_one_radio"))
        self.single_select_group_test = SingleSelect(browser, Selector(select=entity_container.select + " .singleSelectTest"))
        self.multiple_select_test = MultiSelect(browser, Selector(select=entity_container.select + " .multipleSelectTest"))
        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.object = TextBox(browser, Selector(select=".object"))
        self.object_fields = TextBox(browser, Selector(select=".object_fields"))
        self.order_by = TextBox(browser, Selector(select=".order_by"))
        self.query_start_date = TextBox(browser, Selector(select=".start_date"))
        self.limit = TextBox(browser, Selector(select=".limit"))
        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(ExampleInputTwo, self).__init__(browser,
                                              entity_container,
                                              add_btn=add_btn)

        # Controls
        self.name = TextBox(
            browser,
            Selector(select='[data-test="control-group"][data-name="name"]'))
        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.example_multiple_select = MultiSelect(
            browser,
            Selector(
                select=entity_container.select +
                ' [data-test="control-group"][data-name="input_two_multiple_select"]'
            ))
        self.example_checkbox = Checkbox(
            browser,
            Selector(
                select=entity_container.select +
                ' [data-test="control-group"][data-name="input_two_checkbox"]')
        )
        self.example_radio = Toggle(
            browser,
            Selector(
                select=entity_container.select +
                ' [data-test="control-group"][data-name="input_two_radio"]'))
        self.query_start_date = TextBox(
            browser,
            Selector(
                select=' [data-test="control-group"][data-name="start_date"]'))
        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"]'))
    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"]'))
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