def create_edit_config_blob(self): config = config_blob.create_blob #creating config blob with defined parameters. config_name = config_utils.create_config_blob(config) #Verifying whether config blob is created and added in configuration collection. db.search_config_in_configuration_collection(config_name) #Editing a config blob with specified parameter. edit_config_blob = config_blob.edit_blob edit_config_blob["config_name"] = config_name config_utils.edit_config_blob(config_name, edit_config_blob) #After editing retrieving a config blob from configuration collection. config_blob_db = db.search_config_in_configuration_collection(config_name) #Verifying whether config blob is edited successfully. print("Verifying config blob %s is edited successfully" % config_name) flag = 0 for each in edit_config_blob['wif_config']: for i in range(0, 2): if i == 0: each["radio_id"] = "2.4G" if each not in config_blob_db['wif_config']: flag = 1 elif i == 1: each["radio_id"] = "5G" if each not in config_blob_db['wif_config']: flag = 1 if edit_config_blob['system_config'] == config_blob_db['system_config'] and flag == 0: print("Config blob %s is edited successfully" % config_name) else: raise AssertionError("Config blob %s is not edited successfully" % config_name)
def create_config(self): columns = utils.get_var_details() driver = self.driver driver.get(self.base_url + "/home/login") driver.find_element_by_id("email").clear() driver.find_element_by_id("email").send_keys(columns['email'][0]) driver.find_element_by_id("password").clear() driver.find_element_by_id("password").send_keys(columns['password'][0]) driver.find_element_by_id("btnLogin").click() time.sleep(10) print "Clicking VAR filter dropdown" dropdown = driver.find_element_by_id("varFilter") for option in dropdown.find_elements_by_tag_name("option"): if option.text == columns['var_business_name'][0]: option.click() time.sleep(5) print "Clickin Customers dropdown" dropdown = driver.find_element_by_id("customerFilter") for option in dropdown.find_elements_by_tag_name("option"): if option.text == columns['var_business_name'][1]: option.click() time.sleep(5) driver.find_element_by_id("menuConfigurations").click() driver.find_element_by_id("btnAddTemplate").click() time.sleep(5) driver.find_element_by_id("config_name").clear() driver.find_element_by_id("config_name").send_keys(columns['var_business_name'][2]) driver.find_element_by_id("network_header").click() driver.find_element_by_id("ssid_0").clear() driver.find_element_by_id("ssid_0").send_keys(columns['var_business_name'][2]) time.sleep(5) print "Clicking passphrase type dropdwon" passphrase_dropdown = driver.find_element_by_id("security_0") for option in passphrase_dropdown.find_elements_by_tag_name("option"): if option.get_attribute('value') == "wpa-psk": option.click() time.sleep(5) driver.find_element_by_id("passphrase_0").clear() driver.find_element_by_id("passphrase_0").send_keys("accelera") driver.find_element_by_id("submitButton").click() time.sleep(3) db.search_config_in_configuration_collection(columns['var_business_name'][2])