def test_login_valid(self): driver = self.driver driver.get('http://www.demo.guru99.com/V4/') path = "C://FireFoxProfile/login1.xlsx" rows = spreadsheet.getRowCount(path, 'Sheet1') login = LoginPage(driver) for r in range(2, rows + 1): username = spreadsheet.readData(path, "Sheet1", r, 1) password = spreadsheet.readData(path, "Sheet1", r, 2) login.enter_username(username) login.enter_password(password) login.click_login() if driver.title == "Guru99 Bank Manager HomePage": print("test is passed") spreadsheet.writeData(path, "Sheet1", r, 3, "test passed") driver.get('http://www.demo.guru99.com/V4/') else: print("test failed") spreadsheet.writeData(path, "Sheet1", r, 3, "test failed") # return to homepage and insert password/username for next row in spreadsheet this line does not work WebDriverWait(driver, 300).until(EC.alert_is_present).accept time.sleep(5)
def test_TC_01(self): driver = self.driver driver.get("https://area.mtg-bi.com") login = LoginPage(driver) login.sign_in() login.enter_username("*****@*****.**") login.enter_password("123456") login.click_login()
def test_TC_07(self): driver = self.driver driver.get("https://area.mtg-bi.com") login = LoginPage(driver) login.sign_in() login.enter_username("*****@*****.**") login.enter_password("123455") login.click_login() openElement = driver.find_element_by_xpath("//form/div/div") elementText = openElement.text Text = "Login or password is incorrect!" assert Text == elementText
def test_TC_03(self): driver = self.driver driver.get("https://area.mtg-bi.com") login = LoginPage(driver) login.sign_in() login.enter_username("*****@*****.**") login.enter_password("12345") login.click_login() openElement = driver.find_element_by_xpath("//form/div[2]/div") elementText = openElement.text Text = "The entered password must be not less than 6 symbols." assert Text == elementText
def test_02_login_invalid(self): driver = self.driver driver.get("https://opensource-demo.orangehrmlive.com/") login = LoginPage(driver) login.enter_username('Admin1') login.enter_password('admin123') login.click_login() message = login.check_invalid() self.assertEqual(message, "Invalid credentials") time.sleep(2)
def test_TC_01(self): driver = self.driver driver.get("https://area.mtg-bi.com") #Сценарий логина - Начало login = LoginPage(driver) login.sign_in() login.enter_username("*****@*****.**") login.enter_password("123456") login.click_login() homepage = HomePage(driver) homepage.open_profile_menu() homepage.click_logout() time.sleep(3)
def test_TC_02(self): driver = self.driver driver.get("https://area.mtg-bi.com") login = LoginPage(driver) login.sign_in() login.enter_username("") login.enter_password("") login.click_login() openElement = driver.find_element_by_css_selector( "div.invalid-feedback") elementText = openElement.text Text = "Login is not given." assert Text == elementText openElement2 = driver.find_element_by_xpath("//form/div[2]/div") elementText2 = openElement2.text Text2 = "Password is not given." assert Text2 == elementText2
def test_TC_10(self): driver = self.driver driver.get("https://area.mtg-bi.com") login = LoginPage(driver) login.sign_in() login.enter_username("*****@*****.**") login.enter_password("123456") login.click_login() homepage = HomePage(driver) homepage.open_profile_menu() homepage.open_profile() homepage.select_country("Russia") homepage.enter_phone("9181234567") homepage.select_business_segment("Finance") homepage.click_update() homepage.open_profile_menu() homepage.click_logout()
def test_TC_14(self): driver = self.driver driver.get("https://area.mtg-bi.com") login = LoginPage(driver) login.sign_in() login.enter_username("*****@*****.**") login.enter_password("123456") login.click_login() homepage = HomePage(driver) homepage.open_profile_menu() homepage.open_profile() homepage.select_country("United States") homepage.enter_phone_code("+1") homepage.enter_phone("202 679 45 01") homepage.select_business_segment("Health Care") homepage.click_update() homepage.open_profile_menu() homepage.click_logout()
def test_automation(self): driver = self.driver driver.maximize_window() driver.get(self.page) homepage = HomePage(driver) homepage.click_sign_in() time.sleep(3) login = LoginPage(driver) login.enter_username(self.user) login.enter_password(self.password) login.click_login() time.sleep(3) home = driver.find_element_by_xpath("//*[@id='header_logo']/a/img") home.click() homepage.buy_cheapest() checkout = CheckoutPage(driver) checkout.perform_checkout() payment = PayPage(driver) payment.pay_by_bank()
def test_01_login_valid(self): driver = self.driver driver.get("https://opensource-demo.orangehrmlive.com/") login = LoginPage(driver) login.enter_username('Admin') login.enter_password('admin123') login.click_login() homepage = HomePage(driver) homepage.click_welcome() homepage.click_logout() # self.driver.find_element_by_id('txtUsername').send_keys("Admin") # self.driver.find_element_by_id('txtPassword').send_keys('admin123') # self.driver.find_element_by_id('btnLogin').click() # self.driver.find_element_by_id('welcome').click() # self.driver.find_element_by_link_text("Logout").click() time.sleep(2)