树洞 兼容性测试公开课_20180920

思寒_seveniruby · 2018年09月20日 · 最后由 韩小北 回复于 2018年10月10日 · 2509 次阅读

STF 安装

https://github.com/openstf/stf

#如果已经安装可以使用brew upgrade进行升级
brew install rethinkdb graphicsmagick zeromq protobuf yasm pkg-config

#了解下自己的node版本和npm的版本
npm version

#解决好***问题,搞不定就用cnpm,安装之前先卸载为佳,因为npm bug挺多,会误判一些lib
#npm uninstall -g stf
#rm  -rf /usr/local/lib/node_modules/stf/
npm install -g stf

常见的坑

  • node 版本太新,最好使用 LTS 版本
  • 依赖库安装时候出现了中断导致了各种不兼容
  • 文件权限问题,用户、组的权限设置不对

api

https://github.com/openstf/stf/blob/master/doc/API.md

key=xxxxxxx
curl -H "Authorization: Bearer $key" http://127.0.0.1:7100/api/v1/user | jq



key=368d6df9a82147d29a7a15f94b3d1495af2a6e857a654933bdda686f5e1ef5bf
device=emulator-5554
#获得设备列表:
curl -H "Authorization: Bearer $key" http://localhost:7100/api/v1/devices  | jq .devices[].serial
申请设备:
curl -X POST --header "Content-Type: application/json" --data '{"serial":"$device"}' -H "Authorization: Bearer $key"  http://127.0.0.1:7100/api/v1/user/devices
远程调试:
curl -X POST -H "Authorization: Bearer $key" http://127.0.0.1:7100/api/v1/user/devices/$device/remoteConnect
释放设备:
curl -X DELETE -H "Authorization: Bearer $key" http://127.0.0.1:7100/api/v1/user/devices/$device

adb 架构

如果觉得我的文章对您有用,请随意打赏。您的支持将鼓励我继续创作!
共收到 19 条回复 时间 点赞

言简意赅!

我搭环境倒是还好
我的问题如下:
1、如何在 a 电脑上连接手机,b 电脑(就是服务端)管理,这块搞不定
2、如何分发测试脚本,这个当时时间不够,也没搞出来
3、如何差异化执行不同测试脚本(我有这个需求)

多说一句,docker 安装爽歪歪

彩虹哥哥 回复

b 电脑装了 stf,a 电脑连接手机,说的是这个

vivo 手机不操作后 10min 会自动关闭 usb 调试,咋解?

彩虹哥哥 回复

记录:问题 1:反向代理

下节课是什么时候,还是公开课吗?

同时使用 stf+appium 同时在一个手机上会存在端口冲突吗, 类似于我的自动化运行可以通过 stf 上同步看

saviorghost 回复

非常感谢 纯干货

思寒_seveniruby 关闭了讨论 09月20日 21:41
思寒_seveniruby 重新开启了讨论 09月20日 21:42
saviorghost 回复

不会冲突

思寒您好,请问推荐到大厂学历是硬性要求么,大专学历。

Harry 回复

华为手机是有个模式可以切换的,vivo 的我没用过,需要具体分析。如果中断了可以用 api 自动重连也可以

彩虹哥哥 回复

用反向代理就可以了,nginx 有这个功能。

群主是狗 回复

下节课在下周,具体等学院通知

彩虹哥哥 回复

首先要在 a 主机上开启 adb 服务,adb 版本不一样,命令可能也不一样。。。再在 b 主机上启动 stf 服务的时候需要指定连接手机的 a 主机 ip 和开放的 adb 服务端口

麻烦问下,我在启动 stf 的时候报这个错误是什么原因引起的呢?

韩小北 回复

看起来是版本的问题,你需要重新安装对 rethinkdb 和 stf 吧

AarondeMBP:include aaron$ npm version
{ npm: '6.4.1',
ares: '1.10.1-DEV',
cldr: '32.0',
http_parser: '2.8.0',
icu: '60.1',
modules: '57',
napi: '3',
nghttp2: '1.32.0',
node: '8.12.0',
openssl: '1.0.2p',
tz: '2017c',
unicode: '10.0',
uv: '1.19.2',
v8: '6.2.414.66',
zlib: '1.2.11' }
我用的 npm 版本是在官网下载的 LTS 版本,在安装 stf 的时候出现这个提示:

utf-8-validate@1.2.2 install /usr/local/lib/node_modules/stf/node_modules/utf-8-validate
node-gyp rebuild

CXX(target) Release/obj.target/validation/src/validation.o
SOLINK_MODULE(target) Release/validation.node

zmq@2.15.3 install /usr/local/lib/node_modules/stf/node_modules/zmq
node-gyp rebuild

CXX(target) Release/obj.target/zmq/binding.o
In file included from ../binding.cc:29:
/usr/local/Cellar/zeromq/4.2.5/include/zmq_utils.h:42:32: warning: unknown warning group '-Werror', ignored
[-Wunknown-warning-option]
#pragma GCC diagnostic ignored "-Werror"
^
/usr/local/Cellar/zeromq/4.2.5/include/zmq_utils.h:45:9: warning: Warning: zmq_utils.h is deprecated. All its
functionality is provided by zmq.h. [-W#pragma-messages]
#pragma message( \
^
../binding.cc:999:15: warning: '~MessageReference' has a non-throwing exception specification but can still
throw [-Wexceptions]
throw std::runtime_error(ErrorMessage());
^
../binding.cc:997:18: note: destructor has a implicit non-throwing exception specification
inline ~MessageReference() {
^
../binding.cc:1205:11: warning: '~OutgoingMessage' has a non-throwing exception specification but can still
throw [-Wexceptions]
throw std::runtime_error(ErrorMessage());
^
../binding.cc:1203:14: note: destructor has a implicit non-throwing exception specification
inline ~OutgoingMessage() {
^
4 warnings generated.
SOLINK_MODULE(target) Release/zmq.node
ld: warning: directory not found for option '-L/opt/local/lib'

  • stf@3.4.0 added 755 packages from 681 contributors in 88.653s 跪求指导。。。。。

我重新安装了 rethinkdb 数据库和 stf,现在 rethinkdb 是最新版本的了 2.3.6,stf 我用这个命令卸载:npm uninstall -g stf 也重新安装了。
在启动的时候还是有这个问题,跪求指导

思寒_seveniruby [該主題已被刪除] 中提及了此贴 11月23日 17:00
需要 登录 後方可回應,如果你還沒有帳號按這裡 注册