test_webPage_Login.py

 from selenium import webdriver

from webdriver_manager.chrome import ChromeDriverManager

def test_google():
driver=webdriver.Chrome(ChromeDriverManager().install())
driver.implicitly_wait(2)
driver.get('http://google.com/')
assert driver.title== "Google"
driver.quit()

def test_Facebook():
driver=webdriver.Chrome(ChromeDriverManager().install())
driver.implicitly_wait(2)
driver.get('http://Facebook.com/')
assert driver.title== "Facebook – log in or sign up"
driver.quit()

def test_Instagram():
driver=webdriver.Chrome(ChromeDriverManager().install())
driver.implicitly_wait(2)
driver.get('http://instagram.com/')
assert driver.title== "Instagram"
driver.quit()

def test_gmail():
driver=webdriver.Chrome(ChromeDriverManager().install())
driver.implicitly_wait(2)
driver.get('http://gmail.com/')
assert driver.title== "Gmail"
driver.quit()

#To run the test parallely use 'py.test -n 5(no. of thread)' from terminal line

#To run the test parallely from particular file use 'py.test <packageName>/<Filename.py> -n 5(no. of thread)' from terminal line

Comments

Popular posts from this blog

test_google_fixtures.py

test_fixtures_params.py

PyTest Basics