Unofficial PyTest plugin for Sauce Labs
Project description
Pytest-Sosu
Pytest-Sosu (pronounced Sōsu, ソース) is an unofficial Pytest plugin for running tests on Sauce Labs platforms.
Installation
You can install pytest-sosu latest version via pip:
pip install pytest-sosu
Basic Usage
Assuming you have SAUCE_USERNAME
and SAUCE_ACCESS_KEY
environment variables set
(credentials can be obtained here),
you can write a simple test:
def test_visit(sosu_webdriver):
driver = sosu_webdriver
driver.get("http://example.com/")
assert driver.title == "Example Domain"
Examples
from pytest_sosu.webdriver import CapabilitiesMatrix, Browser
# running given test on multiple browsers
@pytest.mark.sosu(
capabilities_matrix=CapabilitiesMatrix(
browsers=[Browser("chrome"), Browser("firefox")],
),
)
def test_visit_many_browsers(driver):
driver.get("http://example.com/")
assert driver.title == "Example Domain"
# when build basename is set, tests running in given pytest session
# have a build assigned
@pytest.fixture(scope="session")
def sosu_build_basename():
return 'my-project-name'
# alias for sosu_webdriver
@pytest.fixture
def driver(sosu_webdriver):
yield sosu_webdriver
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
pytest-sosu-0.2.2.tar.gz
(12.9 kB
view hashes)
Built Distribution
Close
Hashes for pytest_sosu-0.2.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c65cf54a36cf68f20fb500a2a80186c380adc77dc482e470e71f9100a0f0a399 |
|
MD5 | 5fae7d70c3c0ecbbdb558a89d9ad84dc |
|
BLAKE2b-256 | 94a3ac79f632caa44cae401490e5f69b37b01e3534b7d32f84a1eefdfab9eed1 |