SHARE
TWEET

Untitled

monil20 Jun 12th, 2019 39 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2.     def test_provider_populates(self, nightlysplunk, hadoop_vix):
  3.         """
  4.        Sets up a provider, creates a vix and attaches the provider to the vix. Then verifies that the provider gets populated in the dropdown.
  5.        """
  6.         login_to_nightlysplunk(self.browser, CONFIG.splunkweburl)
  7.         self.hunk_page.open()
  8.         self.hunk_page.hunk.wait_to_be_displayed()
  9.         self._conn_init(nightlysplunk)
  10.  
  11.         self.create_provider()
  12.         self.create_vix()
  13.  
  14.         explore_data_page = self.explore_data_page
  15.         explore_data_page.open()
  16.         explore_data_page.select_provider_button.click()
  17.         dd_provider_name = explore_data_page.check_provider_name_in_dropdown(
  18.             VIX_CONFIG["provider"])
  19.  
  20.         restconn = nightlysplunk.create_logged_in_connector(contype=Connector.REST, username='admin',
  21.                                                             password='changeme')
  22.         response, content = restconn.make_request(
  23.             'GET', '/services/data/vix-providers', {'output_mode': 'json'})
  24.         providers_backend = []
  25.         for i in range(len(json.loads(content)['entry'])):
  26.             providers_backend.append(json.loads(content)['entry'][i]['name'])
  27.         _, providers_ui = explore_data_page.get_dropdown_items()
  28.  
  29.         assert response['status'] == '200' or response['status'] == '201'
  30.         assert cmp(providers_ui, providers_backend) == 0
  31.  
  32.     def test_vix_populates(self, nightlysplunk, hadoop_vix):
  33.         login_to_nightlysplunk(self.browser, CONFIG.splunkweburl)
  34.         self.hunk_page.open()
  35.         self.hunk_page.hunk.wait_to_be_displayed()
  36.         self._conn_init(nightlysplunk)
  37.  
  38.         self.create_provider()
  39.         self.create_vix()
  40.  
  41.         explore_data_page = self.explore_data_page
  42.         explore_data_page.open()
  43.         explore_data_page.select_provider_button.click()
  44.         dd_provider_name = explore_data_page.check_provider_name_in_dropdown(
  45.             VIX_CONFIG["provider"])
  46.  
  47.         restconn = nightlysplunk.create_logged_in_connector(contype=Connector.REST, username='admin',
  48.                                                             password='changeme')
  49.         response, content = restconn.make_request(
  50.             'GET', '/services/data/vix-providers', {'output_mode': 'json'})
  51.         providers_backend = []
  52.         for i in range(len(json.loads(content)['entry'])):
  53.             providers_backend.append(json.loads(content)['entry'][i]['name'])
  54.         _, providers_ui = explore_data_page.get_dropdown_items()
  55.  
  56.         assert response['status'] == '200' or response['status'] == '201'
  57.         assert cmp(providers_ui, providers_backend) == 0
  58.  
  59.         dd_provider_name.click()
  60.         explore_data_page.select_vix_button.click()
  61.         dd_vix_name = explore_data_page.check_vix_name_in_dropdown(
  62.             VIX_CONFIG["name"])
  63.         restconn = nightlysplunk.create_logged_in_connector(contype=Connector.REST, username='admin',
  64.                                                             password='changeme')
  65.         response, content = restconn.make_request(
  66.             'GET', '/services/data/vix-indexes', {'output_mode': 'json'})
  67.         indexes_backend = []
  68.         for i in range(len(json.loads(content)['entry'])):
  69.             indexes_backend.append(json.loads(content)['entry'][i]['name'])
  70.         _, indexes_ui = explore_data_page.get_dropdown_items()
  71.  
  72.         assert response['status'] == '200' or response['status'] == '201'
  73.         assert VIX_CONFIG["name"] in indexes_backend and VIX_CONFIG["name"] in indexes_ui
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top