macaca icon indicating copy to clipboard operation
macaca copied to clipboard

运行官方例子报错,mocha找不到

Open CodeToSurvive1 opened this issue 9 years ago • 3 comments

  • Macaca Version:

  • Macaca Doctor Logs:


macaca doctor

  macaca-doctor version: 1.0.28


  Node.js checklist:

  node env: /usr/local/bin/node
  node version: v4.4.4

  iOS checklist:

  Xcode is installed at: `/Applications/Xcode.app/Contents/Developer`
  Xcode Command Line Tools is ready, version: 2345.1.
  iproxy[usbmuxd] is installed at: `/usr/local/bin/iproxy`
  ios_webkit_debug_proxy is installed at: `/usr/local/bin/ios_webkit_debug_proxy`

  Android checklist:

  JAVA version is `1.8.0_111`
  JAVA_HOME is set to `/Library/Java/JavaVirtualMachines/jdk1.8.0_111.jdk/Contents/Home`
  ANDROID_HOME is set to `/Users/mac/software/android-sdk-macosx`
  Platforms is set to `/Users/mac/software/android-sdk-macosx/platforms/android-24`
  Android tools is set to `/Users/mac/software/android-sdk-macosx/tools/android`
  ADB tool is set to `/Users/mac/software/android-sdk-macosx/platform-tools/adb`

  Installed driver list:

  android: 1.1.3
  chrome: 1.0.5
  electron: 1.1.4
  ios: 1.0.51

  • Operate System:

  • Programming Language:



 macaca run -d macaca-test/macaca-mobile-sample.test.js --verbose
>> index.js:17:12 [master] pid:47181 webdriver server start with config:
 { port: 3456,
  verbose: false,
  always: true,
  window: true,
  ip: '172.31.216.80',
  host: 'mac.local',
  loaded_time: '2016-12-09 14:45:23' }
>> middlewares.js:17:10 [master] pid:47181 base middlewares attached
>> router.js:129:10 [master] pid:47181 router set
>> webdriver sdk launched
/usr/local/lib/node_modules/macaca-cli/lib/run/index.js:44
      throw err;
      ^

Error: Cannot find test framework "mocha" in /Users/mac/software/github/macacajs/macaca-test-sample-nodejs/node_modules
    at Runner.startServer.Runner.initFramework.testProcess.stdout.on.testProcess.stderr.on.testProcess.on [as initFramework] (/usr/local/lib/node_modules/macaca-cli/lib/run/index.js:71:13)
    at /usr/local/lib/node_modules/macaca-cli/lib/run/index.js:41:10
    at process._tickCallback (node.js:369:9)

CodeToSurvive1 avatar Dec 09 '16 06:12 CodeToSurvive1

使用cnpm i不再报错,但是同样出现问题

 macaca run -d macaca-test/macaca-mobile-sample.test.js --verbose
>> index.js:17:12 [master] pid:47728 webdriver server start with config:
 { port: 3456,
  verbose: false,
  always: true,
  window: true,
  ip: '172.31.216.80',
  host: 'mac.local',
  loaded_time: '2016-12-09 14:59:29' }
>> middlewares.js:17:10 [master] pid:47728 base middlewares attached
>> router.js:129:10 [master] pid:47728 router set
>> webdriver sdk launched
[ '/Users/mac/software/github/macacajs/macaca-test-sample-nodejs/node_modules/mocha/bin/mocha',
  'macaca-test/macaca-mobile-sample.test.js',
  '--colors',
  '--verbose' ]
>> 

>> 

>>   macaca mobile sample

>> responseHandler.js:11:12 [master] pid:47728 Recieve HTTP Request from Client: method:
 POST url: /wd/hub/session, jsonBody: {"desiredCapabilities":{"autoAcceptAlerts":true,"platformName":"iOS","deviceName":"iPhone 5s","udid":"7286ffb19da8cb913b629211fad1f6c8b547ba15","app":"https://npmcdn.com/ios-app-bootstrap@latest/build/ios-app-bootstrap.zip"}}
>> session.js:47:10 [master] pid:47728 Creating session, sessionId: 0d27b89b-38c7-4c2f-ad8f-05e2d9c903ee.
>> helper.js:193:12 [master] pid:47728 Unzipping local app form /Users/mac/.macaca-temp/ios-app-bootstrap.zip
>> macaca-ios.js:261:12 [master] pid:47728 App "undefined" is not installed.
>> macaca-ios.js:266:14 [master] pid:47728 2016-12-09 15:00:00.764 ios-deploy[47738:432051] [ !! ] Error 0xe8008014: unknown. AMDeviceSecureInstallApplication(0, device, url, options, install_callback, 0)

>> responseHandler.js:54:12 [master] pid:47728 Send Error Respone to Client: UnknownError: Failed to install app "undefined", please install the app manually.
>> responseHandler.js:60:14 [master] pid:47728 UnknownError: Failed to install app "undefined", please install the app manually.
    at IOS.whiteList.IOS.startSafari.IOS.getSimulatorUdid.IOS.startRealDevice (/usr/local/lib/node_modules/macaca-ios/lib/macaca-ios.js:267:13)
    at throw (native)
    at onRejected (/usr/local/lib/node_modules/macaca-cli/node_modules/co/index.js:81:24)
    at process._tickCallback (node.js:369:9)
>> responseHandler.js:76:14 [master] pid:47728 Send Bad HTTP Respone to Client: {"sessionId":"0d27b89b-38c7-4c2f-ad8f-05e2d9c903ee","status":13,"value":{"message":"Failed to install app \"undefined\", please install the app manually."}}
>> 
>>     1) "before all" hook

>> responseHandler.js:11:12 [master] pid:47728 Recieve HTTP Request from Client: method: DELETE url: /wd/hub/session, jsonBody: {}
>> responseHandler.js:23:14 [master] pid:47728 Send HTTP Respone to Client: 405 Method Not Allowed
>> 
>>     2) "after all" hook


>> 

>>   0 passing (32s)

>>   2 failing

>> 

>>   1) macaca mobile sample "before all" hook:
     Error: [init({"autoAcceptAlerts":true,"platformName":"iOS","deviceName":"iPhone 5s","udid":"7286ffb19da8cb913b629211fad1f6c8b547ba15","app":"https://npmcdn.com/ios-app-bootstrap@latest/build/ios-app-bootstrap.zip"})] The environment you requested was unavailable.
      at node_modules/.1.0.11@macaca-wd/wd/lib/webdriver.js:134:15
      at Request._callback (node_modules/.1.0.11@macaca-wd/wd/lib/http-utils.js:87:7)
      at Request.self.callback (node_modules/.2.55.0@request/request.js:368:22)
      at Request.<anonymous> (node_modules/.2.55.0@request/request.js:1219:14)
      at IncomingMessage.<anonymous> (node_modules/.2.55.0@request/request.js:1167:12)
      at endReadableNT (_stream_readable.js:913:12)


>>   2) macaca mobile sample "after all" hook:
     Error: [quit()] Unexpected data in simpleCallback.
      at exports.newError (node_modules/.1.0.11@macaca-wd/wd/lib/utils.js:139:13)
      at null.<anonymous> (node_modules/.1.0.11@macaca-wd/wd/lib/callbacks.js:42:12)
      at cb (node_modules/.1.0.11@macaca-wd/wd/lib/webdriver.js:165:22)
      at node_modules/.1.0.11@macaca-wd/wd/lib/webdriver.js:179:5
      at Request._callback (node_modules/.1.0.11@macaca-wd/wd/lib/http-utils.js:87:7)
      at Request.self.callback (node_modules/.2.55.0@request/request.js:368:22)
      at Request.<anonymous> (node_modules/.2.55.0@request/request.js:1219:14)
      at IncomingMessage.<anonymous> (node_modules/.2.55.0@request/request.js:1167:12)
      at endReadableNT (_stream_readable.js:913:12)


CodeToSurvive1 avatar Dec 09 '16 07:12 CodeToSurvive1

@zenzhu 更新完最新版的macaca-ios驱动后报错的

CodeToSurvive1 avatar Dec 09 '16 07:12 CodeToSurvive1

https://github.com/alibaba/macaca/issues/424

xudafeng avatar Feb 16 '17 02:02 xudafeng