-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
First commit for zalenium demo project
- Loading branch information
Cauvery Guda
committed
Sep 28, 2020
1 parent
1330c61
commit aa0ea3d
Showing
3 changed files
with
74 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
*.html | ||
**/*.pyc | ||
assets | ||
report | ||
report/* | ||
**/.cache | ||
**/.DS_Store | ||
**/__pycache__ | ||
**/.idea | ||
__pycache__ |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
pytest | ||
pytest-ordering | ||
pytest-xdist | ||
pytest-html | ||
PyYAML | ||
selenium==3.141.0 |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
import pytest | ||
from selenium import webdriver | ||
from selenium.webdriver import DesiredCapabilities | ||
|
||
|
||
def test_search0(setup): | ||
print("test search") | ||
driver = setup | ||
|
||
driver.get("https://google.com") | ||
|
||
driver.find_element_by_name("q").send_keys("selenium") | ||
|
||
driver.find_element_by_name("btnK").submit() | ||
|
||
assert("Selenium" in driver.page_source) | ||
|
||
|
||
def test_search1(setup): | ||
print("test 1") | ||
driver = setup | ||
|
||
driver.get("https://google.com") | ||
|
||
driver.find_element_by_name("q").send_keys("Software automation") | ||
|
||
driver.find_element_by_name("btnK").submit() | ||
|
||
assert("Test automation" in driver.page_source) | ||
|
||
|
||
def test_search2(setup): | ||
print("test search2") | ||
driver = setup | ||
|
||
driver.get("http://the-internet.herokuapp.com/") | ||
|
||
assert("Welcome to the-internet" in driver.page_source) | ||
|
||
|
||
def test_search3(setup): | ||
print("test search3") | ||
|
||
|
||
def test_search4(setup): | ||
print("test search4") | ||
|
||
|
||
def test_search5(setup): | ||
print("test search5") | ||
|
||
|
||
@pytest.fixture(scope="function") | ||
def setup(): | ||
caps = DesiredCapabilities.CHROME | ||
driver = webdriver.Remote(command_executor='http://localhost:4444/wd/hub', desired_capabilities=caps) | ||
yield driver | ||
driver.quit() |