Created
August 3, 2020 13:10
-
-
Save barancev/0588aaea0eefdbbfcb9eb238cb715b5c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pytest | |
from selenium import webdriver | |
from selenium.webdriver.support.wait import WebDriverWait | |
from selenium.webdriver.support import expected_conditions as EC | |
from time import sleep | |
@pytest.fixture | |
def driver(request): | |
options = webdriver.EdgeOptions() | |
options.use_chromium = True | |
wd = webdriver.Edge(options=options) | |
request.addfinalizer(wd.quit) | |
return wd | |
def test_example(driver): | |
# pass | |
driver.get("https://www.google.com/") | |
driver.maximize_window() | |
sleep(4) | |
driver.find_element_by_name("q").clear() | |
sleep(4) | |
driver.find_element_by_name("q").send_keys("webdriver") | |
sleep(4) | |
driver.find_element_by_name("btnK").click() | |
WebDriverWait(driver, 10).until(EC.title_is("webdriver - Google Search")) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment