def test_login_hiway(self): driver = self.driver driver.get("https://qa.hiway.hashedin.com/") login = LoginPage(driver) login.login_into_hiway() dashboard = Home_Dashboard(driver) dashboard.click_to_go_into_dashboard_of_hiway() time.sleep(5) print("Login Is done, Now Going for to chack the first test case")
def test_user_login(driver, login_url, username, password): login_page = LoginPage(driver, login_url, u"百度云-登录") login_page._open(login_url, u"百度云-登录") ''' js="window.scrollTo(100, 450);" driver.execute_script(js) sleep(3) js="var q=document.getElementById(\"TANGRAM__PSP_4__userName\");q.style.border=\"1px solid red\";" driver.execute_script(js) sleep(3) ''' login_page.input_username(username) login_page.input_password(password) #get_screenshot(driver, "login_page") login_page.submit()
def test_LoginUser(self): login_page_obj = LoginPage(self.driver) time.sleep(2) login_page_obj.login_button_click() time.sleep(2) login_page_obj.login_user() time.sleep(5)
from selenium import webdriver from Login import LoginPage from Logout import LogoutPage from selenium.webdriver.common.action_chains import ActionChains from selenium.webdriver.support.wait import WebDriverWait from selenium.webdriver.support import expected_conditions as EC from selenium.webdriver.common.by import By driver = webdriver.Firefox(executable_path="/Users/Shared/WebDrivers/geckodriver") driver.get("https://opensource-demo.orangehrmlive.com/") signIn = LoginPage(driver, "Admin", "admin123") signIn.execute() ac = ActionChains(driver) adminElement = WebDriverWait(driver,10).until(EC.visibility_of_element_located((By.ID,"menu_admin_viewAdminModule"))) ac.move_to_element(adminElement) ac.perform() userMgmtElement = WebDriverWait(driver,10).until(EC.visibility_of_element_located((By.ID,"menu_admin_UserManagement"))) ac.move_to_element(userMgmtElement) ac.perform() userElement = WebDriverWait(driver,10).until(EC.visibility_of_element_located((By.ID,"menu_admin_viewSystemUsers"))) ac.move_to_element(userElement) ac.click().perform() #signOut = LogoutPage(driver) #signOut.execute()
def testusercanlogin(self): LoginPage.GoToURL() LoginPage.Login()
def test_cloudaccount_login(driver, login_url, username, password, token): login_page = LoginPage(driver, login_url, u"百度云-登录") login_page._open(login_url, u"百度云-登录") login_page.switch_to_uclogin_form() login_page.input_uclogin_username(username) login_page.input_uclogin_password(password) #get_screenshot(driver, "login_page") login_page.input_uclogin_token(token) login_page.uclogin_submit()