Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/apragacz/pytest-sosu
Pytest-Sosu (pronounced Sōsu, ソース) is an unofficial Pytest plugin for running tests on Sauce Labs platforms.
https://github.com/apragacz/pytest-sosu
automated-testing pytest python saucelabs selenium selenium-webdriver testing testing-tools webdriver
Last synced: 14 days ago
JSON representation
Pytest-Sosu (pronounced Sōsu, ソース) is an unofficial Pytest plugin for running tests on Sauce Labs platforms.
- Host: GitHub
- URL: https://github.com/apragacz/pytest-sosu
- Owner: apragacz
- License: mit
- Created: 2020-02-24T11:34:31.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2023-08-04T08:44:42.000Z (over 1 year ago)
- Last Synced: 2024-12-15T05:15:38.265Z (19 days ago)
- Topics: automated-testing, pytest, python, saucelabs, selenium, selenium-webdriver, testing, testing-tools, webdriver
- Language: Python
- Homepage:
- Size: 141 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# 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](https://app.saucelabs.com/user-settings)),
you can write a simple test:```python
def test_visit(sosu_selenium_webdriver):
driver = sosu_selenium_webdriver
driver.get("http://example.com/")
assert driver.title == "Example Domain"
```## Examples
```python
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
```