def createNew(browser, web_dict, RunID, create_log): # find element fields for to fill info for new analysis new_analysis_fields = [ web_dict['analysis_name'], web_dict['analysis_description'], web_dict['create_new_button'] ] inputField_tuple = findElement(browser, new_analysis_fields) # enter info for new analysis new_analysis_list = [ new_analysis_dict['Analysis Name'], new_analysis_dict['Analysis Description'] ] sendKey(browser, inputField_tuple, new_analysis_list) # click button 'Select Reads' select_reads1 = browser.find_element_by_css_selector( web_dict['select_reads_button']).click() select_reads2 = browser.find_element_by_css_selector( web_dict['select_reads_button']).click() # select 'Enter Sra Run ID' from dropdown menu select_menu = browser.find_element_by_xpath( web_dict['select_reads_dropdown']).click() time.sleep(2) enterSRAid(browser, web_dict, RunID) # check runid valid or not id_validate = id_check(browser, RunID, create_log) if id_validate is False: close = browser.find_element_by_css_selector('.btn-danger').click()
def enterSRAid(browser,web_dict,RunID): # find SRA Run ID field enter_sra_id_fields = [web_dict['run_id_field'],web_dict['run_id_go_button']] idField_tuple = findElement(browser, enter_sra_id_fields) # enter in SRA RUN ID & click 'Go' sra_id = [RunID] sendKey(browser,idField_tuple,sra_id) time.sleep(20)
def editAnalysis(browser,web_dict,edit_list,edit_text_list,edit_icon): editField_tuple = findElement(browser,edit_list) if edit_icon == web_dict['edit_update_css']: # confirm update sendKey(browser,editField_tuple,edit_text_list) browser.refresh() return True for i in range (0, len(editField_tuple)-1): # cancel update editField_tuple[i].send_keys(edit_text_list[i]) clickIcon(browser,edit_icon) browser.refresh() return False
def createNew(browser,web_dict): # find element fields for to fill info for new analyst new_analyst_fields = [web_dict['analysis_name'],web_dict['analysis_description'],web_dict['create_new_button']] inputField_tuple = findElement(browser,new_analyst_fields) # enter info for new analyst new_analyst_list = [new_analyst_dict['Analysis Name'],new_analyst_dict['Analysis Description']] sendKey(browser,inputField_tuple,new_analyst_list) # click button 'Select Reads' select_reads1 = browser.find_element_by_css_selector(web_dict['select_reads_button']).click() select_reads2 = browser.find_element_by_css_selector(web_dict['select_reads_button']).click() # select 'Enter Sra Run ID' from dropdown menu select_menu = browser.find_element_by_xpath(web_dict['select_reads_dropdown']).click() browser.implicitly_wait(2)