Giter Site home page Giter Site logo

Comments (14)

xudafeng avatar xudafeng commented on July 21, 2024

@xiaolz 使用 cnpm 安装的吗?

from macaca.

xiaolz avatar xiaolz commented on July 21, 2024

使用 您给出的 方法安装的,cnpm i macaca-client -g

from macaca.

xudafeng avatar xudafeng commented on July 21, 2024

@xiaolz 好的,我们这边装虚拟机运行下

from macaca.

xudafeng avatar xudafeng commented on July 21, 2024

@xiaolz Http服务应该没有问题,请尝试使用 npm 重新安装一次,npm i macaca-client -g, 然后运行给出完整log
image

from macaca.

xiaolz avatar xiaolz commented on July 21, 2024

@xudafeng 你好,按你所述,重装后,再次执行make test-android,出现如下错误信息:

-post-jar:
build:
BUILD SUCCESSFUL
Total time: 2 seconds

uiautomator-bootstrap build success!

install macaca-android success
install macaca-android failed with Error: Cannot find module 'macaca-android'

responseHandler.js:56:12 [master] pid:11301 Send Error Respone to Client TypeError: Android is not a function
responseHandler.js:62:14 [master] pid:11301 TypeError: Android is not a function
at WebdriverServer.detectDevice (/usr/local/lib/node_modules/macaca-client/node_modules/webdriver-server/lib/server/index.js:54:14)
at WebdriverServer.start (/usr/local/lib/node_modules/macaca-client/node_modules/webdriver-server/lib/server/index.js:38:22)
at next (native)
at onFulfilled (/usr/local/lib/node_modules/macaca-client/node_modules/co/index.js:65:19)
at /usr/local/lib/node_modules/macaca-client/node_modules/co/index.js:54:5
at Object.co (/usr/local/lib/node_modules/macaca-client/node_modules/co/index.js:50:10)
at Object.toPromise (/usr/local/lib/node_modules/macaca-client/node_modules/co/index.js:118:63)
at next (/usr/local/lib/node_modules/macaca-client/node_modules/co/index.js:99:29)
at onFulfilled (/usr/local/lib/node_modules/macaca-client/node_modules/co/index.js:69:7)
at /usr/local/lib/node_modules/macaca-client/node_modules/co/index.js:54:5
responseHandler.js:81:14 [master] pid:11301 Unexcepted error TypeError

  1. "before all" hook
    responseHandler.js:24:12 [master] pid:11301 Recieve HTTP Request from Client: method: DELETE url: /wd/hub/session, jsonBody: {}
    responseHandler.js:48:14 [master] pid:11301 Send HTTP Respone to Client: {"sessionId":"","status":0}

0 passing (3m)
1 failing

  1. macaca mobile sample "before all" hook:
    [init({"autoAcceptAlerts":true,"platformName":"android","platformVersion":"9.3","deviceName":"iPhone 5s","app":"/home/zeng/tmp/macaca-test-sample/app/android-app-bootstrap.zip"})] The environment you requested was unavailable.
    Error: [init({"autoAcceptAlerts":true,"platformName":"android","platformVersion":"9.3","deviceName":"iPhone 5s","app":"app/android-app-bootstrap.zip"})] The environment you requested was unavailable.
    at endReadableNT (_stream_readable.js:905:12)

from macaca.

xudafeng avatar xudafeng commented on July 21, 2024

@xiaolz 应该是 macaca-android 包没有自动下载成功,你手动执行 npm i macaca-android 将过程中的编译log,尤其是有错误的地方贴出来

from macaca.

xiaolz avatar xiaolz commented on July 21, 2024

@xudafeng 包是存在的,
root@zeng:/home/zeng/tmp/macaca-test-sample/app# ls
android_app_bootstrap-debug.apk android-app-bootstrap.zip ios-app-bootstrap.zip

甚至我将解压出来的APK 安装到安卓手机上,手机可启动你给的demo 程序

from macaca.

xudafeng avatar xudafeng commented on July 21, 2024

@xiaolz 嗯,我说的是 npm 包,在所依赖的 node_modules 目录下有么?

from macaca.

xiaolz avatar xiaolz commented on July 21, 2024

恩,理解错了。按你的指导,执行 npm i macac-android, 出现以下错误:
uiautomator-bootstrap build success!
\

[email protected] install /home/zeng/tmp/macaca-test-sample/node_modules/macaca-android/node_modules/macaca-chromedriver
./bin/macaca-chromedriver install

chromedriver cdn url: http://chromedriver.storage.googleapis.com/2.20/chromedriver_linux64.zip
stream.js:74
throw er; // Unhandled stream error in pipe.
^

Error: connect ETIMEDOUT 74.125.203.128:80
at Object.exports._errnoException (util.js:870:11)
at exports._exceptionWithHostPort (util.js:893:20)
at TCPConnectWrap.afterConnect as oncomplete
npm ERR! Linux 3.13.0-83-generic
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "i" "macaca-android"
npm ERR! node v4.4.0
npm ERR! npm v2.14.18
npm ERR! code ELIFECYCLE

npm ERR! [email protected] install: ./bin/macaca-chromedriver install
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script './bin/macaca-chromedriver install'.
npm ERR! This is most likely a problem with the macaca-chromedriver package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! ./bin/macaca-chromedriver install
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs macaca-chromedriver
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!
npm ERR! npm owner ls macaca-chromedriver
npm ERR! There is likely additional logging output above.

from macaca.

xudafeng avatar xudafeng commented on July 21, 2024

@xiaolz 看log应该是网络环境问题

请尝试如下命令,不要省略步骤

开启Android模拟器,x86优先

$ npm i macaca-client -g
# 解决你的网络问题
$ export CHROMEDRIVER_CDNURL=http://npm.taobao.org/mirrors/chromedriver
# 等同于 make test-android
$ platform=android macaca run --server --verbose -d ./macaca-test/macaca-mobile-sample.test.js

from macaca.

xiaolz avatar xiaolz commented on July 21, 2024

非常感谢你的耐心指导,但我完全是个小白。经过你的指导,现执行 make test-android后,出现如下界面, 请问后续要如何执行才能启动脚本的执行,完成对android-app-bootstrap.zip 的自动化测试,出现你给的demo中展示的画面。

make test-android
platform=android macaca run --server --verbose -d ./macaca-test/macaca-mobile-sample.test.js

index.js:62:12 [master] pid:18491 webdriver server start with config:
{ port: 3456,
ip: '192.168.5.40',
host: 'zeng',
loaded_time: '2016-03-30 20:40:40' }
middlewares.js:31:10 [master] pid:18491 base middlewares attached
router.js:101:10 [master] pid:18491 router set
webdriver sdk launched
responseHandler.js:24:12 [master] pid:18491 Recieve HTTP Request from Client: method: GET url: /, jsonBody: {}
responseHandler.js:48:14 [master] pid:18491 Send HTTP Respone to Client: {"sessionId":"","status":0}

from macaca.

xudafeng avatar xudafeng commented on July 21, 2024

@xiaolz 启动模拟器,再运行

from macaca.

xiaolz avatar xiaolz commented on July 21, 2024

@xudafeng , 现在有以下几点疑问,还得麻烦你指导下:
1、对你说的启动模拟器,是指在系统上以adb的命令启动一个安卓模拟器;还是执行你的某个脚本启动模拟器
2、我首先执行 make test-android ,webdriver sdk launched 完成,再切换到macaca-test-sample/macaca-test目录,执行macaca run --verbose -d macaca-mobile-sample.test.js;

对于这样操作我不知道是否正确,如此执行后出现以下错误(感觉像是执行到ios的测试,本机器无IOS环境):

responseHandler.js:24:12 [master] pid:11478 Recieve HTTP Request from Client: method: POST url: /wd/hub/session, jsonBody: {"desiredCapabilities":{"autoAcceptAlerts":true,"platformName":"iOS","platformVersion":"9.3","deviceName":"iPhone 5s","app":"/home/zeng/tmp/macaca-test-sample/app/ios-app-bootstrap.zip"}}

session.js:22:10 [master] pid:11478 Creating session, sessionId: 21b7d028-3841-4cf7-9d5f-8c7586640018.
macaca-ios is installing for the first time with args: ["install","macaca-ios","--registry=https://registry.npmjs.org/"]

  • loading...
    

    install macaca-ios success
    install macaca-ios failed with Error: Cannot find module 'macaca-ios'

    responseHandler.js:56:12 [master] pid:11478 Send Error Respone to Client TypeError: IOS is not a function
    responseHandler.js:62:14 [master] pid:11478 TypeError: IOS is not a function
    at WebdriverServer.detectDevice (/usr/local/lib/node_modules/macaca-client/node_modules/webdriver-server/lib/server/index.js:50:14)
    at WebdriverServer.start (/usr/local/lib/node_modules/macaca-client/node_modules/webdriver-server/lib/server/index.js:38:22)
    at next (native)
    at onFulfilled (/usr/local/lib/node_modules/macaca-client/node_modules/co/index.js:65:19)
    at /usr/local/lib/node_modules/macaca-client/node_modules/co/index.js:54:5
    at Object.co (/usr/local/lib/node_modules/macaca-client/node_modules/co/index.js:50:10)
    at Object.toPromise (/usr/local/lib/node_modules/macaca-client/node_modules/co/index.js:118:63)
    at next (/usr/local/lib/node_modules/macaca-client/node_modules/co/index.js:99:29)
    at onFulfilled (/usr/local/lib/node_modules/macaca-client/node_modules/co/index.js:69:7)
    at /usr/local/lib/node_modules/macaca-client/node_modules/co/index.js:54:5
    responseHandler.js:81:14 [master] pid:11478 Unexcepted error TypeError

    InternalServerError: Internal Server Error
    at Object.module.exports.throw (/usr/local/lib/node_modules/macaca-client/node_modules/webdriver-server/node_modules/koa/lib/context.js:91:23)
    at Object.module.exports (/usr/local/lib/node_modules/macaca-client/node_modules/webdriver-server/lib/server/responseHandler.js:82:17)
    at throw (native)
    at onRejected (/usr/local/lib/node_modules/macaca-client/node_modules/co/index.js:81:24)
    at process._tickCallback (node.js:365:9)

responseHandler.js:24:12 [master] pid:11478 Recieve HTTP Request from Client: method: DELETE url: /wd/hub/session, jsonBody: {}
responseHandler.js:48:14 [master] pid:11478 Send HTTP Respone to Client: {"sessionId":"","status":0}

from macaca.

xiaolz avatar xiaolz commented on July 21, 2024

@xudafeng 我修改了 macaca-mobile-sample.test.js 把里面的 platform修改为 var platform = process.env.platform || 'Android'; 再次执行 macac run -d macaca-mobile-sample.test.js 出现如下错误信息:

  • loading...
    

    install macaca-android success
    install macaca-android failed with Error: Cannot find module 'macaca-android'

    InternalServerError: Internal Server Error
    at Object.module.exports.throw (/usr/local/lib/node_modules/macaca-client/node_modules/webdriver-server/node_modules/koa/lib/context.js:91:23)
    at Object.module.exports (/usr/local/lib/node_modules/macaca-client/node_modules/webdriver-server/lib/server/responseHandler.js:82:17)
    at throw (native)
    at onRejected (/usr/local/lib/node_modules/macaca-client/node_modules/co/index.js:81:24)
    at process._tickCallback (node.js:365:9)

macaca-android is installing for the first time with args: ["install","macaca-android","--registry=https://registry.npmjs.org/"]

from macaca.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.