def test_forks(): login.login(driver) project_id = nodes.create_project(driver) fork_id = forks.create_fork_dashboard(driver) assert driver.find_element_by_id("nodeTitleEditable") nodes.delete_node(driver, fork_id + 'settings/') nodes.delete_node(driver, project_id + 'settings/') driver.quit()
def test_contributors(): #print(shikha) login.login(DRIVER) project_id = nodes.create_project(driver) contributors.search_add_contributor(driver) contributors.changetoread_contributor(driver) contributors.reorder_contributor(driver) nodes.delete_node(driver, project_id + 'settings/') driver.quit()
def login(self, username, password): ''' Login function. Tries to log in with the specified credentials. :param username: str - login username :param password: str - login password :return: bool - True if login successful or already logged in; False otherwise ''' return login.login(self=self, username=username, password=password)
# Optional argument, if not specified will search path driver = webdriver.Chrome('/Applications/chromedriver') #this workbook is where we are gonna write all our data to (for now) wb = Workbook() # options = webdriver.ChromeOptions() # options.binary_location = '/Applications/Google Chrome Canary.app/Contents/MacOS/Google Chrome Canary' # options.add_argument('window-size=800x841') # options.add_argument('headless') # driver = webdriver.Chrome(chrome_options=options) driver.get('https://thenounproject.com/'+config.noun_project_username+'/activity/') login(driver) #login to the app using info from config get_icons(driver, wb) all_revenues(driver, wb) #gotta save all that hard work wb.save('test.xlsx') driver.get('https://thenounproject.com/'+config.noun_project_username+'/activity/') # the current time, we will need since datetimes are relative to the now now = datetime.now() finished_scroll = scroll(driver) #scrolls icons full page ws = wb.create_sheet("Activity", 0) ws.append(['Icon ID', 'Username', 'Action', 'DateTime'])
def test_login(): login.login(driver) time.sleep(5) assert driver.find_element_by_xpath( "//*[@id='osfHome']/div[3]/div/div/div/div/div[1]/h2") driver.quit()