pytest plugin for OpenSTF
Plugin for simplify OpenSTF usage with pytest framework by providing simple fixture that do all primitive tasks for appium based tests.
Target is to easily scale up tests in CI environment where external stf service is used to provide android phones.
Plugin based on stf-appium-python-client
pytest arguments
openstf:
--stf_host=STF_HOST Openstf host
--stf_token=STF_TOKEN
Openstf access token
--phone_requirements=PHONE_REQUIREMENTS
Phone requirements
--stf_allocation_timeout=STF_ALLOCATION_TIMEOUT
Allocation timeout (how long time plugin waits for device)
Fixture selected_phone
is session scoped fixture that find out suitable android phone based on cli arguments,
prepare remote adb connection and starts appium server that tests could utilize eventually.
NOTE: appium need to be installed separately! (npm i appium) .
NOTE: only one phone is handled by this fixture.
Usage example
Test script: sample.py
def test_create(selected_phone):
device, adb, appium = selected_phone
# device is dictionary of device metadata
# adb: AdbServer instance, that is already connected
# appium: AppiumServer instance that provide server address for appium client
print(device)
print(f'wd_hub: {appium.get_wd_hub_uri()}')
Execution
> pytest sample/test_samples.py --stf_host localhost --stf_token $TOKEN --phone_requirements platform=Android
Metadata
Release files for pytest-stf 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pytest-stf-0.1.0.tar.gz | 5.6 kB | Without provenance | Details for pytest-stf-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pytest_stf-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for pytest_stf-0.1.0-py3-none-any.whl |
Total release size: 9.1 kB
Release files / pytest-stf-0.1.0.tar.gz
| Download URL | pytest-stf-0.1.0.tar.gz |
|---|---|
| Size | 5.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
fe9fd6a8f343855eecf0bbaef3a15a4f148e59f831b06f2f191b1df8b707d54b
|
|
BLAKE2b-256 checksum How to use checksums |
cf7b4b72f6ab14febb17ff651426501f7ebf778cf254ff3c21ce2ed97f84f74b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.9.13
|
Release files / pytest_stf-0.1.0-py3-none-any.whl
| Download URL | pytest_stf-0.1.0-py3-none-any.whl |
|---|---|
| Size | 3.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
0640d3e433dfb46a08ec629aee196bfd3ec3c999a567613ad27314eec0406a23
|
|
BLAKE2b-256 checksum How to use checksums |
f4b5ca1594dbd13696e438b25d8a020aec7221b0f8c8b81301222276bd1e5fdd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.9.13
|
Security for pytest-stf 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.