def test_search_in_python_org(self): """ Tests the ability to login to Dexcom Home page from https://clarity.dexcom.com """ print("Title: ", self.driver.title) # Define the main page and login page from Dexcom.com. main_page = page.MainPage(self.driver) login_page = page.LoginPage(self.driver) time.sleep(1) # Checks if the word "Dexcom" is in title assert main_page.is_title_matches(), "Dexcom title doesn't match." # Choos the button to login to Home page main_page.click_home_button() time.sleep(1) # Enter the provided Username and Password login_page.enter_username(config_username) login_page.enter_password(config_password) login_page.click_submit() time.sleep(1) #Verifies that the results page is not empty search_results_page = page.SearchResultsPage(self.driver) assert search_results_page.is_results_found(), "No results found."
def test_empty(self): # assert that empty credentials will not work login_page = page.LoginPage(self.driver) login_page.go_to() login_page.submit_login() self.assertIn("Log In", driver.title)
def test_wrong_email(self): # assert that wrong email will not work login_page = page.LoginPage(self.driver) login_page.go_to() login_page.log_in_as("sadjkl", "beepbop") self.assertNotIn("Home", driver.title)
def setUp(self): self.driver = webdriver.Chrome() self.driver.get("https://play.kkbox.com") login_page = page.LoginPage(self.driver) login_page.id_text_element = "*****@*****.**" login_page.password_text_element = "xxxxxxxx" login_page.click_go_button()
def main(driver): driver.get('https://www.aliexpress.com/') page.AnyPage(driver).do_escape() page.AnyPage(driver).go_to_globalsite() time.sleep(2) page.MainPage(driver).click_login() time.sleep(2) login_page = page.LoginPage(driver) login_page.goto_login_iframe() login_page.enter_credits_and_login(env('ALI_USER'), env('ALI_PASS')) time.sleep(3) page.AnyPage(driver).do_escape() mainpage = page.MainPage(driver) mainpage.click_change_ship_curency() mainpage.search('Boys Bicycle') time.sleep(3) search_results = page.SearchResults(driver) search_results.click_first() search_results.switch_tab(1) time.sleep(1) driver.save_screenshot('test.png') time.sleep(10) driver.quit()
def test_1_1_register(self): welcome_page = page.WelcomePage(self.driver) welcome_page.click_x_button() login_page = page.LoginPage(self.driver) login_page.swipe_to_botton() login_page.click_regist_button() register_page = page.RegisterPage(self.driver) #account test case : 234/ [email protected] / [email protected] register_page.send_account('234') assert register_page.check_error_message(u'信箱格式錯誤'),'error message error.' register_page.send_account('*****@*****.**') assert register_page.check_error_message(u'該信箱已註冊, 輸入密碼直接登入'),'message error.' register_page.send_account('*****@*****.**') assert register_page.check_error_message(u'該信箱尚未啟用, 輸入密碼直接註冊'),'message error.' #password test case: 234/ 12345678910123456 register_page.send_password('234') assert register_page.check_error_message(u'密碼長度 < 8'),'error message error.' register_page.send_password('12345678910123456') assert register_page.check_error_message(u'密碼長度 > 15'),'error message error.' #passwordconfirm : 1234567891012345(123) register_page.send_password('123456789101234') register_page.send_password_confirm('123') assert register_page.check_error_message(u'密碼與確認密碼不同'),'error message error.'
def test_1_live_view(self): login_page = page.LoginPage(self.driver) login_page.send_account_info('*****@*****.**', '12345678') camera_page = page.CameraPage(self.driver) assert camera_page.check_my_camera_logo_appear(), 'login fail' camera_page.click_live_view() if camera_page.check_image_page(): True else: camera_page.click_live_view() if camera_page.check_internet_status(): camera_page.click_back_button() if camera_page.check_my_camera_logo_appear(): camera_page.click_live_view() if camera_page.check_image_page(): True else: camera_page.click_live_view() if camera_page.check_internet_status(): result = False else: result = True else: result = True assert result, 'connect fail' assert camera_page.check_bps_appear(), 'wait too long for video' camera_page.click_tital_for_detail() assert camera_page.bps_fps_error(), 'Can’t access bps & fps'
def test_3_scene(self): welcome_page = page.WelcomePage(self.driver) welcome_page.click_x_button() login_page = page.LoginPage(self.driver) login_page.send_account_info('*****@*****.**', '12345678') security_page = page.SecurityPage(self.driver) assert security_page.check_security_logo_appear(),'security not appear.' bottom_banner = page.BottomBanner(self.driver) bottom_banner.click_bottom_button('情境') scene_page = page.ScenePage(self.driver) scene_page.add_new_scene("AutoTest") bottom_banner.click_bottom_button('設定') bottom_banner.click_bottom_button('情境') assert scene_page.check_out_scene('AutoTest'), "Add scene fail." scene_page.edit_scene("AutoTest",'AutoTest01') bottom_banner.click_bottom_button('設定') bottom_banner.click_bottom_button('情境') assert scene_page.check_out_scene('AutoTest01'), "Edit scene fail." scene_page.delete_scene('AutoTest01') #delete region test theResult = False if scene_page.check_out_scene('AutoTest01') == False: theResult = True assert theResult,"delete region fail."
def test_4_repeat_binding(self): welcome_page = page.WelcomePage(self.driver) welcome_page.click_x_button() login_page = page.LoginPage(self.driver) login_page.send_account_info('*****@*****.**', '12345678') security_page = page.SecurityPage(self.driver) security_page = page.SecurityPage(self.driver) binding_page = page.BindingPage(self.driver) bottom_banner = page.BottomBanner(self.driver) setting_page = page.SettingPage(self.driver) security_page = page.SecurityPage(self.driver) if security_page.check_security_logo_appear() == False: binding_page.send_binding_info('a79f','72067944','f835ddf7a79f') binding_page.click_send_button() assert security_page.check_security_logo_appear(),'security logo not appear.' testTimes = 3 # repeat times is here while testTimes > 0: bottom_banner.click_bottom_button('設定') setting_page.unbinding_device() login_page.click_send_button() binding_page.send_binding_info('a79f','72067944','f835ddf7a79f') binding_page.click_send_button() assert security_page.check_security_logo_appear(),'security logo not appear.' testTimes = testTimes-1
def test_2_region(self): welcome_page = page.WelcomePage(self.driver) welcome_page.click_x_button() login_page = page.LoginPage(self.driver) login_page.send_account_info('*****@*****.**', '12345678') security_page = page.SecurityPage(self.driver) assert security_page.check_security_logo_appear(),'security logo not appear.' #add new region test bottom_banner = page.BottomBanner(self.driver) bottom_banner.click_bottom_button('區域') region_page = page.RegionPage(self.driver) region_page.add_new_region('AutoTest') assert region_page.check_out_region('AutoTest'), "Add region fail." #edit region test region_page.edit_region('AutoTest','AutoTest01') assert region_page.check_out_region('AutoTest01'), "Edit region fail." #delete region test region_page.delete_region('AutoTest01') theResult = False if region_page.check_out_region('AutoTest01') == False: theResult = True assert theResult,"delete region fail."
def test_login_correct_credentials(self): # happy path -- correct page title login_page = page.LoginPage(self.driver) login_page.go_to() login_page.log_in_as(self.test_email, self.test_password) time.sleep(2) self.assertIn("Home", self.driver.title) self.assertEqual(self.driver.current_url, "https://www.hudl.com/home")
def test_correct_user_homepage(self): # happy path -- correct coach name login_page = page.LoginPage(self.driver) login_page.go_to() login_page.log_in_as(self.test_email, self.test_password) home_page = page.HomePage(self.driver) coachname_txt = home_page.find_coach_name() self.assertEqual("Coach K", coachname_txt)
def test_wrong_password(self): # assert that wrong password will not work login_page = page.LoginPage(self.driver) login_page.go_to() login_page.log_in_as(self.test_email, "beepbop") time.sleep(2) self.assertIn("Log In", driver.title)
def login(self): login_page = page.LoginPage(self.driver) login_page.enter_login_and_press_enter(GMAIL_USERNAME) password_page = page.PasswordPage(self.driver) password_page.enter_password_and_press_enter(GMAIL_PASSWORD) time.sleep(5) # for two-factor authentication
def test_login_error_righttime(self): # assert that login error doesn't exist when you haven't entered anything yet login_page = page.LoginPage(self.driver) login_page.go_to() login_page.log_in_as(self.test_email, "beepbop") #self.assertIsNotNone(login_error_div) time.sleep(2) login_error_text = login_page.find_login_error()
def test_login_wrong_password(self): self.driver.get("http://*****:*****@h5.com' loginPage.password_input = '321' loginPage.click_submit_button() assert loginPage.is_logged_in()
def test_login_in(self): main_page = page.MainPage(self.driver) assert main_page.is_url_matches(), "UTM tag in url doesn't match." main_page.click_go_button() login_page = page.LoginPage(self.driver) login_page.login_free_user() assert login_page.login_free_user(), "Not logged in."
def setUp(self): PATH = "C:\Program Files\EdgeDriver\msedgedriver.exe" self.driver = webdriver.Edge(PATH) self.driver.get("http://*****:*****@mail.com' loginPage.password_input = '123' loginPage.click_submit_button() assert loginPage.is_logged_in()
def test_login(self): login_page = page.LoginPage(self.driver) login_page.email_input = '*****@*****.**' login_page.password_input = 'Have A Nice Day' login_page.login() actions = ActionChains(self.driver) actions.pause(3) actions.perform() assert login_page.agency_list_present(), "No Redirect Occured"
def test_valid_user(self): loginPage = page.LoginPage(self.driver) loginPage.open_login() loginPage.user_name = "root" loginPage.user_pass = "******" loginPage.go_login() self.driver.implicitly_wait(10) cond = "Login" not in self.driver.title test_result(cond, 3, "existing user Login") assert cond
def test_invalid_user(self): loginPage = page.LoginPage(self.driver) loginPage.open_login() loginPage.user_name = "invalidusername" loginPage.user_pass = "******" loginPage.go_login() self.driver.implicitly_wait(10) cond = "Login" in self.driver.title test_result(cond, 4, "Invalid user Login") assert cond
def setUp(self): options = Options() options.add_argument("--disable-notifications") self.driver = webdriver.Chrome("chromedriver.exe", options=options) self.driver.get("https://www.facebook.com") login_page = page.LoginPage(self.driver) if login_page.is_displayed(): login_page.login("*****@*****.**", "!noamassaf1") home_page = page.HomePage(self.driver) assert home_page.is_logged_in()
def test_Sites1(self): login_page = page.LoginPage(self.driver) # Do checks assert login_page.is_title_matches(), 'TITLE NOT MATCHED' # setattr(login_page,'username','admin') login_page.send_username() login_page.send_password() login_page.click_signIn() explore_page = page.ExplorePage(self.driver) assert explore_page.is_Site_Available(), 'SITES NOT MATCHED'
def test_login_staff_member(self): self.driver.get("http://*****:*****@mail.com' loginPage.password_input = '123' loginPage.click_submit_button() assert loginPage.is_logged_in() staffPage = page.StaffMemberPage(self.driver) assert staffPage.checkPages()
def get_full_form(self): self.driver.get( "http://automationpractice.com/index.php?controller=authentication&back=my-account" ) # Go to the full form like a user would login_page = page.LoginPage(self.driver) login_page.email_create_text_element = "*****@*****.**" login_page.click_create_account() errors = login_page.get_errors() assert len(errors) == 0
def log_in_experticava(self): """ login experticava25. Ingresa a la plataforma con las credenciales especificas """ # Log in login_page = page.LoginPage(self.driver) login_page.click_posgrado_button() login_page.username_element = 'exper-tic' login_page.password_element = 'exper-tic' login_page.click_login_button()
def setUp(self): options = Options() options.add_argument("--disable-notifications") self.driver = webdriver.Chrome("chromedriver.exe", options=options) self.driver.get("https//facebook.com") login_page = page.LoginPage(self.driver) if login_page.is_displayed(): login_page.login(TestData.FACEBOOK_USER, TestData.FACEBOOK_PASSWORD) home_page = page.HomePage(self.driver) assert home_page.is_logged_in()
def __init__(self, url, driver_type): try: self.driver = DRIVERS[driver_type]() #self.driver.maximize_window() self.url = url #open the browser self.driver.get(self.url) #page initialization self.login_page = page.LoginPage(self.driver) except Exception, e: print "Operator initialization exception!", str(e)
def test_1_2_login(self): welcome_page = page.WelcomePage(self.driver) welcome_page.click_x_button() login_page = page.LoginPage(self.driver) login_page.send_account_info('*****@*****.**', '12345678') bottom_banner = page.BottomBanner(self.driver) bottom_banner.click_bottom_button('設定') setting_page = page.SettingPage(self.driver) assert setting_page.check_login_name(u'*****@*****.**'), 'login fail'
def setUp(self): self.driver = webdriver.Chrome(executable_path=r'C:\chromedriver.exe') self.driver.maximize_window() self.driver.get(credentials.WEBSITE) welcome_page = page.WelcomePage(self.driver) assert welcome_page.welcomePageCheck( ), "Welcome page text did not match" welcome_page.clickGoToApp() login_page = page.LoginPage(self.driver) assert login_page.loginPageCheck(), "Login page text did not match" login_page.email_text_element = credentials.USER login_page.pass_text_element = credentials.PASS login_page.clickLogin()