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.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, 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(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 + ' 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"]'))