def test_07_Delete_Flight(self,test_setup): driver.get('http://*****:*****@gmail.com') time.sleep(1) login.enterPassword('1234') time.sleep(1) login.signInClick() time.sleep(1) manager=ManagerHomePage(driver) manager.deleteFlight() time.sleep(1) Deleteflight=DeleteFlightPage(driver) Deleteflight.selectFlightNo('1212D') time.sleep(1) Deleteflight.enterDate('12282019') time.sleep(1) Deleteflight.deleteFlight() time.sleep(2)
def test_sending_email(self): home_page = HomePage(self.driver) login_page = LoginGmailPage(self.driver) login_page.login_to_gmail_account(**gmail_credentials) home_page.send_email(**emails_data) assert home_page.check_fist_sent_email()
def test_02_Book_Flight(self,test_setup): driver.get('http://*****:*****@gmail.com') time.sleep(1) login.enterPassword('12345') time.sleep(1) login.signInClick() time.sleep(1) customer = CustomerProfilePage(driver) time.sleep(1) customer.enterDeparture('Vegas') time.sleep(1) customer.enterArrival('Bankok') time.sleep(1) customer.enterDate('12282019') time.sleep(1) customer.enterClass('Business') time.sleep(1) customer.enterAdultSeats(1) time.sleep(1) customer.enterChildrenSeats(2) time.sleep(1) customer.checkAvailabilty() time.sleep(2)
def test_login_logout_automation(self): driver = self.driver driver.get('http://3.131.49.106/') login = LoginPage(driver) login.enter_username("*****@*****.**") login.enter_password('qpzm123456\n') homepage = HomePage(driver) homepage.click_logout()
def test_addToCartByProductCard(self): self.driver.get('http://automationpractice.com/') time.sleep(3) driver = self.driver Hp = HomePage(driver) Hp.homePage() time.sleep(4) Pp = ProductPage(driver) Pp.addToCart()
def test_01_login_valid(self,test_setup): driver.get('http://*****:*****@gmail.com') time.sleep(1) login.enterPassword('12345') time.sleep(1) login.signInClick() time.sleep(1)
def test_03_Add_Flight(self,test_setup): driver.get('http://*****:*****@gmail.com') time.sleep(1) login.enterPassword('1234') time.sleep(1) login.signInClick() time.sleep(1) manager=ManagerHomePage(driver) manager.addFlight() time.sleep(1) addflght=AddFlightPage(driver) addflght.enterFlightNo('1212D') time.sleep(1) addflght.enterDeparture('Bankok') time.sleep(1) addflght.enterArrival('Vegas') time.sleep(1) addflght.enterDate('12282019') time.sleep(1) addflght.enterTime('1227AM') time.sleep(1) addflght.enterEconomySeat(30) time.sleep(1) addflght.enterEconomyPrice(200) time.sleep(1) addflght.enterBusinessSeat(30) time.sleep(1) addflght.enterBusinessPrice(400) time.sleep(1) addflght.enterFirstSeat(20) time.sleep(1) addflght.enterFirstPrice(500) time.sleep(1) addflght.addFlight() time.sleep(2)
def test_func(value_A, value_B): global driver driver = webdriver.Chrome('F:\dev\chromedriver.exe') driver.get('http://localhost:9090/WebSE/') home = HomePage(driver) home.clickSignIn() page1 = driver.current_url login = LoginPage(driver) time.sleep(1) login.selectUserType('Customer') time.sleep(1) login.enterEmail(value_A) time.sleep(1) login.enterPassword(value_B) time.sleep(1) login.signInClick() time.sleep(1) customer = CustomerProfilePage(driver) customer.logout()
def test_addToCartByHover(self): driver = self.driver time.sleep(3) Hp = HomePage(driver) Hp.hoverFirstElement() Hp.addToCartAfterHover() ProductPrice = driver.find_element_by_xpath('//span[contains (@id, "layer_cart_product_price")]').text Hp.checkoutAfterHover() time.sleep(3) PriceInCart= driver.find_element_by_xpath('//span[contains (@class, "price")]/span').text assert ProductPrice in PriceInCart
def test_08_Accept_Request(self,test_setup): driver.get('http://*****:*****@gmail.com') time.sleep(1) login.enterPassword('1234') time.sleep(1) login.signInClick() time.sleep(1) admin=AdminPage(driver) admin.selectApprove() time.sleep(1) admin.logout() time.sleep(1)
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_login_valid(self): driver = self.driver driver.get('https://lesemester.no/logg-inn/') driver.set_window_size(1024, 600) driver.maximize_window() driver.implicitly_wait(5) time.sleep(3) login = LoginPage(driver) login.enter_username("baerum-teacher19") login.enter_password("TestLesemester2020") login.click_login_page_login() time.sleep(2) homepage = HomePage(driver) time.sleep(4) homepage.click_welcome() time.sleep(3) homepage.click_logout() time.sleep(3)
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)
def login(self, username, password): self.doLogin(username, password) return HomePage(self.driver)
class TestPaintCalculatorHomePage(unittest.TestCase): def setUp(self): self.homePage = HomePage(webdriver.Chrome()) self.homePage.go_to_home_page() def tearDown(self): self.homePage.driver.close() def test_title_matches(self): assert self.homePage.title_matches() def test_header_matches(self): assert self.homePage.is_header_matches() def test_footer_matches(self): assert self.homePage.footer_matches() def test_form_label_matches(self): assert self.homePage.form_label_matches() def test_invalid_room_input_submit_button_fails(self): self.homePage.enter_amount_of_rooms("-1") self.homePage.click_submit_button() assert self.homePage.redirect_did_not_occur() def test_no_room_input_submit_button_fails(self): self.homePage.click_submit_button() assert self.homePage.redirect_did_not_occur() def test_submitButton_redirectsTo_dimensionsPage(self): rooms = "1" self.homePage.enter_amount_of_rooms(rooms) self.homePage.click_submit_button() assert self.homePage.redirected_to_dimensions_page(rooms)
def setUp(self): self.homePage = HomePage(webdriver.Chrome()) self.homePage.go_to_home_page()
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_15(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("956-42-84") homepage.select_business_segment("Health Care") homepage.click_update() time.sleep(10) homepage.open_profile_menu() homepage.click_logout()
from selenium import webdriver from homePage import HomePage from loginPage import LoginPage import locators driver_path = '..\driver\chromedriver.exe' driver = webdriver.Chrome(executable_path=driver_path) def set_up(): driver.maximize_window() driver.get(locators.home_page_url) set_up() home_page = HomePage(driver) login_page = LoginPage(driver) home_page.close_alert_box() home_page.click_login_link() login_page.login() home_page.mouse_hover() home_page.add_product_to_cart() driver.quit()