首页 > 解决方案 > 使用 Appium 的 Nativescript 测试不会在 iOS 上运行

问题描述

问题 NativeScript Vue 的 E2E 测试无法在 iOS 上运行

我正在尝试在 iOS 平台上为 NativeScript Vue 运行 E2E 测试,但是我遇到了以下问题:

测试失败并显示以下消息:

  1) sample scenario
       "before all" hook:
     TypeError: Cannot read property 'statBarHeight' of undefined
      at Function.<anonymous> (node_modules/nativescript-dev-appium/lib/appium-driver.js:260:37)
      at Generator.next (<anonymous>)
      at fulfilled (node_modules/nativescript-dev-appium/lib/appium-driver.js:4:58)
      at processTicksAndRejections (internal/process/task_queues.js:93:5)

  2) sample scenario
       "after all" hook:
     TypeError: Cannot read property 'quit' of undefined
      at Context.<anonymous> (e2e/sample.e2e-spec.js:14:22)
      at processImmediate (internal/timers.js:439:21)
      at process.topLevelDomainCallback (domain.js:130:23)

使用以下命令运行脚本会产生以下错误:

命令:

npm run e2e -- --runType sim.iPhone11Pro --verbose

错误:

    [debug] [WebDriverAgent] *** Cloning YYCache

    [debug] [WebDriverAgent] Failed to check out repository into /usr/local/lib/node_modules/appium/node_modules/appium-xcuitest-driver/node_modules/appium-webdriveragent/Carthage/Checkouts/RoutingHTTPServer: Could not create working directory (Error Domain=NSCocoaErrorDomain Code=513 "You don’t have permission to save the file “RoutingHTTPServer” in the folder “Checkouts”." UserInfo={NSFilePath=/usr/local/lib/node_modules/appium/node_modules/appium-xcuitest-driver/node_modules/appium-webdriveragent/Carthage/Checkouts/RoutingHTTPServer, NSUnderlyingError=0x7faab903f5d0 {Error Domain=NSPOSIXErrorDomain Code=13 "Permission denied"}})

Session info:
undefined
Appium settings:
 > CALL settings()
 > GET /session/appium/settings
[HTTP] <-- POST /wd/hub/session 500 54845 ms - 269
[HTTP]

[HTTP] --> GET /wd/hub/session/appium/settings

[HTTP] {}

[debug] [HTTP] No route found. Setting content type to 'text/plain'

(我省略了正确的部分,只写了错误)

这有可能是我的错吗?

标签: nativescriptappiumappium-iosnativescript-vue

解决方案


推荐阅读