Added create_directoy and create_text functions in collection_functions.py

This commit is contained in:
cesar991 2016-07-20 11:33:26 +02:00
parent 0db2291cdc
commit a7cab9562d
1 changed files with 25 additions and 0 deletions
tests/console/include

View File

@ -64,5 +64,30 @@ def edit_collection(driver,name,new_name=None,group=None,description=None):
driver.find_element_by_id("submit-submit").click()
def create_text_in_collection(driver,collection_name,file_name,text_file=None):
#text_file is a content of file.
search_collection(driver,collection_name)
driver.find_element_by_xpath('//*[@id="menu_tab"]/ul/li[2]/a/img').click()
driver.find_element_by_xpath('//*[@id="main"]/div[2]/a[2]/img').click()
driver.find_element_by_id("text-name_file").clear()
driver.find_element_by_id("text-name_file").send_keys(file_name)
driver.find_element_by_id("submit-create").click()
if text_file != None:
driver.find_element_by_xpath('//*[@id="main"]/form/table/tbody/tr[2]/td/textarea').clear()
driver.find_element_by_xpath('//*[@id="main"]/form/table/tbody/tr[2]/td/textarea').send_keys(text_file)
driver.find_element_by_xpath('//*[@id="main"]/form/table/tbody/tr[3]/td/input[3]').click()
def create_directory_in_collection(driver,collection_name,directory_name):
search_collection(driver,collection_name)
driver.find_element_by_xpath('//*[@id="menu_tab"]/ul/li[2]/a/img').click()
driver.find_element_by_xpath('//*[@id="main"]/div[2]/a[1]/img').click()
driver.find_element_by_id('text-dirname').clear()
driver.find_element_by_id('text-dirname').send_keys(directory_name)
driver.find_element_by_id('submit-crt').click()