Esempio n. 1
0
def step_impl(context):
    main_page = MainPage(context.driver)
    main_page.click_button_travellers()

    main_page.field_person = main_page.driver.find_element_by_xpath(
        "//*[@id='traveler-selector-hp-flight']/div/ul/li/div/div/div/div[1]/div[4]/button")
    main_page.field_person.click()

    main_page.btn_close = main_page.driver.find_element_by_xpath(
        "//*[@id='traveler-selector-hp-flight']/div/ul/li/div/footer/div/div[2]/button")
    main_page.btn_close.click()
Esempio n. 2
0
import time

from selenium import webdriver
from features.pages.login_page import LoginPage
from features.pages.main_page import MainPage
from features.pages.search_results_page import SearchResultsPage

driver = webdriver.Chrome("D:/Tools/chromedriver.exe")
driver.implicitly_wait(5)

driver.get("https://www.instagram.com/accounts/login/")

login_page = LoginPage(driver)
login_page.enter_username("pyautomation")
login_page.enter_password("Ab123456789!")
login_page.click_login()

main_page = MainPage(driver)
main_page.click_not_now_button()
main_page.type_in_search_field("#fitness")
main_page.click_result_with_text("#fitness")
time.sleep(3)
search_results_page = SearchResultsPage(driver)
# assert "Follow" in search_results_page.get_follow_button_text()
search_results_page.get_button_text("Follow")

driver.quit()
 def __init__(self, driver):
     self.launch_page = LaunchPage(driver)
     self.login_page = LoginPage(driver)
     self.main_page = MainPage(driver)
Esempio n. 4
0
def before_all(context):
    context.browser = Browser()
    context.main_page = MainPage()
    context.browser.login()
Esempio n. 5
0
def step_impl(context):
    main_page = MainPage(context.driver)
    main_page.click_not_now_button()
Esempio n. 6
0
def step_impl(context, text):
    main_page = MainPage(context.driver)
    main_page.click_result_with_text(text)
Esempio n. 7
0
def step_impl(context, query):
    main_page = MainPage(context.driver)
    main_page.type_in_search_field(query)
Esempio n. 8
0
def enter_text_in_search_field(context):
    main_page = MainPage(context.driver)
    main_page.type_in_search_field("fitness")
    main_page.click_result("#fitness")
    time.sleep(5)
Esempio n. 9
0
def step_impl(context):
    main_page = MainPage(context.driver)
    main_page.click_search_button()
Esempio n. 10
0
def step_impl(context, date):
    main_page = MainPage(context.driver)
    main_page.enter_returning_date(date)
Esempio n. 11
0
def step_impl(context, date):
    main_page = MainPage(context.driver)
    main_page.enter_departure_date(date)
Esempio n. 12
0
def step_impl(context, city, airport):
    main_page = MainPage(context.driver)
    main_page.enter_destination_place(city)
    main_page.click_result_dest()
Esempio n. 13
0
def step_impl(context, city, airport):
    main_page = MainPage(context.driver)
    time.sleep(2)
    main_page.enter_departure_place(city)
    main_page.click_result_dep()
Esempio n. 14
0
def step_impl(context):
    main_page = MainPage(context.driver)
    main_page.click_to_flights_menu()
Esempio n. 15
0
def step_impl(context):
    login_page = LoginPage(context.driver)
    login_page.enter_username(context.config.get("user", "username"))
    login_page.enter_password(context.config.get("user", "password"))
    login_page.click_login_button()
    MainPage(context.driver)  # Verify user is on main page