from pages.drivers import Drivers from pages.select_menu_page import SelectMenuPage browser = Drivers('--start-maximized').chrome() smp = SelectMenuPage(driver=browser) # test start smp.go() # SELECT OPTIONS # hover smp.select_value.click() smp.g1_option2.move_to() smp.g1_option2.move_to() smp.g2_option1.move_to() smp.g2_option2.move_to() smp.r_option.move_to() smp.a_r_option.move_to() # select smp.a_r_option.click() smp.select_value.click() smp.r_option.click() smp.select_value.click() smp.g2_option2.click() smp.select_value.click() smp.g2_option1.click() smp.select_value.click()
import sys sys.path.insert(1, '') from pages.drivers import Drivers from pages.amazon_page import AmazonPage # Test case ID: log_am_02 browser = Drivers().chrome() ap = AmazonPage(driver=browser) # test data invalid_gmail = '*****@*****.**' # test start ap.go() ap.account_list_button.click() ap.email_input.input_text(invalid_gmail) ap.continue_button.click() alert = ap.alert_invalid_email_pw.text assert alert == 'There was a problem' print('log_am_02 passed') browser.quit()
from pages.drivers import Drivers from pages.alza_page import AlzaPage from pages import info browser = Drivers('--start-maximized').chrome() ap = AlzaPage(driver=browser) # test start ap.go() browser.execute_script("window.scrollTo(0,document.body.scrollHeight)") ap.careers.click() ap.it.click() ap.qa.click() browser.refresh() ap.name.input_text(info.nm) ap.email.input_text(info.em) ap.phone.input_text(info.ph) ap.link.input_text(info.lk) ap.cover_letter.input_text(info.cov_letter) ap.upload_cv.upload(info.path) ap.send.click() print('test passed')
# test descriptions # share image from instagram to facebook with validation # test setup ig_img_name = 'Test Test' # facebook login user_gmail = '*****@*****.**' pw_gmail = 'testpw_02' # instagram login user_ig = 'radek.spacek.165' pw_ig = 'testpw_02' # INSTAGRAM browser1 = Drivers('--start-maximized').chrome() ip = InstagramPage(driver=browser1) # test start ip.go() # login to ig ip.ig_user_input.input_text(user_ig) ip.ig_pw_input.input_text(pw_ig) ip.ig_login_button.click() ip.ig_notnow_button.click() # share img to fb ip.profile_link.click() ip.image.click() ip.menu_button.click()
from pages.drivers import Drivers from pages.herokuapp_page import HerokuappPage import time browser = Drivers('--start-').chrome() hp = HerokuappPage(driver=browser) content = 'My automation test content' # test start hp.go() hp.frames.click() hp.iframe_link.click() iframe = browser.find_element_by_tag_name('iframe') browser.switch_to_frame(iframe) itext = hp.iframe_text.text hp.iframe_text.input_text(content) hp.align_right.click() # browser.switch_to.default_content() print(itext)
from pages.drivers import Drivers from pages.herokuapp_page import HerokuappPage import time browser = Drivers('--start-').chrome() hp = HerokuappPage(driver=browser) # test start window_before = browser.window_handles[0] window_after = browser.window_handles[1] hp.go() hp.muliple_windows.click() hp.click_here.click() browser.switch_to_window(window_after) tx_new = hp.text_new_window.text print(tx_new)
from pages.drivers import Drivers from pages.ecomerce_page import EcomecrePage browser = Drivers('--start-maximized').chrome() ep = EcomecrePage(driver=browser) # Test setup mail = '*****@*****.**' passw = 'password' # Test: product purchase procedure. ep.go() ep.sign_in.click() ep.reg_email.input_text(mail) ep.reg_pw.input_text(passw) ep.log_in.click() ep.women_but.move_to() ep.sub_tshirt.click() ep.product1.move_to() ep.more.click() ep.q_up.click() ep.size.move_to() ep.size.select_drop('3') ep.color_bl.click() ep.add_card.click() ep.proceed_1.click() ep.proceed_2.click() ep.proceed_3.click() # terms and conditions checkbox browser.find_element_by_css_selector('input[id="cgv"]').click()
from pages.buttons_page import ButtonsPage from pages.drivers import Drivers browser = Drivers('--start-maximized').chrome() bp = ButtonsPage(driver=browser) # test start bp.go() bp.buttons_button.click() bp.double_click_button.double_click() assert bp.double_click_msg.text == 'You have done a double click' bp.right_click_button.right_click() assert bp.right_click_msg.text == 'You have done a right click' click_me_button = browser.find_element_by_xpath('//button[text()="Click Me"]') click_me_button.click() assert bp.click_me_msg.text == 'You have done a dynamic click' browser.quit() print('test passed')