behave-framework/pytests/test_basic.py

38 lines
895 B
Python
Raw Normal View History

2024-07-23 14:48:03 +00:00
import pytest
from browserdriver import BrowserDriver
2024-07-23 17:05:15 +00:00
from conftest import CWD
2024-07-23 17:05:15 +00:00
@pytest.mark.firefox
def test_firefox_browser(headless):
bd = BrowserDriver().get("firefox", headless=headless)
bd.get('https://test.io')
2024-07-23 14:48:03 +00:00
assert bd.title == "Home | Test IO"
bd.quit()
2024-07-23 17:05:15 +00:00
@pytest.mark.chrome
def test_chrome_browser(headless):
bd = BrowserDriver().get("chrome", headless=headless)
bd.get('https://test.io')
2024-07-23 14:48:03 +00:00
assert bd.title == "Home | Test IO"
bd.quit()
2020-10-10 22:27:46 +00:00
2024-07-23 14:48:03 +00:00
@pytest.mark.skip(reason="Safari is not available")
2024-07-23 14:00:35 +00:00
def test_safari_browser():
bd = BrowserDriver().get("safari", headless=False)
bd.get('https://test.io')
2024-07-23 14:48:03 +00:00
assert bd.title == "Home | Test IO"
bd.quit()
2024-07-23 17:05:15 +00:00
@pytest.mark.edge
2020-10-10 22:27:46 +00:00
def test_edge_browser(headless):
bd = BrowserDriver().get("edge", headless=headless)
bd.get('https://test.io')
2024-07-23 14:48:03 +00:00
assert bd.title == "Home | Test IO"
2020-10-10 22:27:46 +00:00
bd.quit()
2024-07-23 17:05:15 +00:00