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_selenium_webdriver):
driver = sosu_selenium_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_selenium_webdriver
@pytest.fixture
def driver(sosu_selenium_webdriver):
yield sosu_selenium_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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pytest-sosu-0.3.1.tar.gz.
File metadata
- Download URL: pytest-sosu-0.3.1.tar.gz
- Upload date:
- Size: 14.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.8.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
23b1a1d21fefdc6466f0159467470a2ff55e343358ac47d8bc4fc6b4daedd86d
|
|
| MD5 |
42a24131f37256f6a3acf739fdf3bae1
|
|
| BLAKE2b-256 |
dfdb48b2bc68857d0971d1ed80ce26b4f04c4592f205bbb39feff70ba513bf17
|
File details
Details for the file pytest_sosu-0.3.1-py3-none-any.whl.
File metadata
- Download URL: pytest_sosu-0.3.1-py3-none-any.whl
- Upload date:
- Size: 16.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.8.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a39cf6169266e65a65fa4d87f89b68cd22596e8df43b0a21cedee254b0638eb7
|
|
| MD5 |
7b81bc1d594cd5ba3e42bea02c6c9a5d
|
|
| BLAKE2b-256 |
c1cea09bd4e4623c443d2786b649dd06f0d436efe93dc22969ad119a4ef6d2a9
|