Skip to main content

Detox Python Bridge

https://secure.travis-ci.org/kpn-digital/py-detox-bridge.svg?branch=master https://img.shields.io/codecov/c/github/kpn-digital/py-detox-bridge/master.svg https://img.shields.io/pypi/v/detox-bridge.svg https://readthedocs.org/projects/detox-bridge/badge/?version=latest

A bridge to enable python code to use the detox grey-box testing API ( https://github.com/wix/detox )

Requirements

NVM

The package requires nvm to be installed. Either the NVM environment variable needs to contain the full path of the nvm.sh script, or the NVM_DIR environment variable needs to point at the root directory of nvm containing the nvm.sh script.

NODE

The code emitted by this bridge requires node 7.6.0 or higher.

Python

3.5 or 3.6 is required to use the package.

Detox

Follow the getting started guide from detox ( https://github.com/wix/detox/blob/master/docs/Introduction.GettingStarted.md )

Usage

from detox_bridge import await, by, detox, device, element, expect, node_with_detox

app_path = "detox/examples/demo-react-native"

# Start Node server in app_path root folder that contains node_modules

with node_with_detox(app_path=app_path, default_timeout=10) as appserver:

    # Detox Config (we could also load this from package.json)

    ios_sim_release = {
        "binaryPath": "ios/build/Build/Products/Release-iphonesimulator/example.app",
        "type": "ios.simulator",
        "name": "iPhone 7 Plus"
    }

    configurations_obj = {"configurations": {"ios.sim.release": ios_sim_release}}

    # Longer timeout since the app may be installed

    appserver(await(detox.init(configurations_obj)), timeout=360)

    # Reload react native

    appserver(await(device.reloadReactNative()))

    # Expectation

    appserver(await(expect(element(by.id('welcome'))).toBeVisible()))

    # Cleanup

    appserver(await(detox.cleanup()))

Development

Requirements

Both python 3.5 and python 3.6 are required to run the suite suite.

Checkout

After checkout run:

git submodule update --init --recursive

Running tests

To run the test suite:

make test

Once the venv is there you can also run some tests via tox:

venv/bin/tox -e py35 -- -k <regex>

Metadata

Release files for detox-bridge 1.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for detox-bridge 1.0.2
File Size Uploaded Provenance
detox-bridge-1.0.2.tar.gz 14.3 kB Without provenance Details

Release files / detox-bridge-1.0.2.tar.gz

Download URL detox-bridge-1.0.2.tar.gz
Size 14.3 kB
Tags Source
SHA-256 checksum
How to use checksums
6e8741289e27298b6afb01824b6d5e440fdcc9514da571c95b8deabce08aa9aa
BLAKE2b-256 checksum
How to use checksums
527d6a218f53be4742e3a4c3e9a370d5ac088de04ae838ab7d00c6b0d5f4a56b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for detox-bridge 1.0.2

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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page