通往解毒greybox测试库的python桥
detox-bridge的Python项目详细描述
要求
nvm
软件包要求安装NVM。nvm环境变量需要包含nvm.sh脚本的完整路径,或者 nvm_dir环境变量需要指向包含nvm.sh脚本的nvm的根目录。
节点
此网桥发出的代码需要节点7.6.0或更高版本。
Python
3.5或3.6要求使用包装。
用法
fromdetox_bridgeimportawait,by,detox,device,element,expect,node_with_detoxapp_path="detox/examples/demo-react-native"# Start Node server in app_path root folder that contains node_moduleswithnode_with_detox(app_path=app_path,default_timeout=10)asappserver:# 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 installedappserver(await(detox.init(configurations_obj)),timeout=360)# Reload react nativeappserver(await(device.reloadReactNative()))# Expectationappserver(await(expect(element(by.id('welcome'))).toBeVisible()))# Cleanupappserver(await(detox.cleanup()))
开发
要求
运行套件套件需要Python3.5和Python3.6。
结帐
签出后运行:
git submodule update --init --recursive
运行测试
运行测试套件:
make test
一旦出现了VENV,您还可以通过TOX进行一些测试:
venv/bin/tox -e py35 -- -k <regex>