Nativescript 无法在iOS模拟器上运行appium测试-错误:无法读取属性';标准杆高度';未定义的

Nativescript 无法在iOS模拟器上运行appium测试-错误:无法读取属性';标准杆高度';未定义的,nativescript,appium,appium-ios,nativescript-vue,Nativescript,Appium,Appium Ios,Nativescript Vue,我按照nativescript dev-appiuminstructions()设置了appium测试,测试在Android模拟器上运行良好 我的问题在iOS上。我无法使它们工作,之前和之后方法失败,错误为无法读取未定义的的属性“statBarHeight”。这是我的日志: ➜ npm run e2e -- --runType sim.iPhone11Pro --reuseDevice > my-project@1.0.0 e2e /Users/fleebzz/workspa

我按照
nativescript dev-appium
instructions()设置了appium测试,测试在Android模拟器上运行良好

我的问题在iOS上。我无法使它们工作,
之前
之后
方法失败,错误为
无法读取未定义的
的属性“statBarHeight”。这是我的日志:

➜ npm run e2e -- --runType sim.iPhone11Pro --reuseDevice      

> my-project@1.0.0 e2e /Users/fleebzz/workspaces/xxx/my-project
> node ./node_modules/nativescript-dev-appium/check-dev-deps.js &&  mocha --opts ./e2e/config/mocha.opts  "--runType" "sim.iPhone11Pro" "--reuseDevice"

Parsed args:   {"port":4723,"projectDir":"/Users/fleebzz/workspaces/xxx/my-project","projectBinary":"/Users/fleebzz/workspaces/xxx/my-project/node_modules/.bin","pluginRoot":"/Users/fleebzz/workspaces/xxx/my-project/node_modules/nativescript-dev-appium","pluginBinary":"/Users/fleebzz/workspaces/xxx/my-project/node_modules/nativescript-dev-appium/node_modules/.bin","wdaLocalPort":8410,"testFolder":"e2e","runType":"sim.iPhone11Pro","appiumCapsLocation":"/Users/fleebzz/workspaces/xxx/my-project/e2e/config/appium.capabilities.json","verbose":false,"cleanApp":false,"path":"/Users/fleebzz/workspaces/xxx/my-project","capabilitiesName":"appium.capabilities.json","driverConfig":{"host":"localhost","port":4723},"logImageTypes":[]}


/Users/fleebzz/workspaces/xxx/my-project/e2e/config/appium.capabilities.json
Capabilities found at: /Users/fleebzz/workspaces/xxx/my-project/e2e/config/appium.capabilities.json 
Automation name set to: XCUITest 
To change automation name, you need to set it in appium capabilities!
Application full path: /Users/fleebzz/workspaces/xxx/my-project/platforms/ios/build/Debug-iphoneos/myproject.ipa 
The started device will be killed after the session quits! 
To avoid it, set 'fullReset: false' in appium capabilities. 
Is process Simulator.app alive: true
xcrun simctl create "iPhone-11-Pro" "iPhone 11 Pro" "com.apple.CoreSimulator.SimRuntime.iOS-13-5"
Remove:  76B308BE-409C-4A0A-8679-36F670F59118
Check if simulator is booted!
Simulator is booted!
Launched simulator with name: iPhone-11-Pro; udid: 7056B721-AFCA-465F-A65B-E301E21B6DDE; status: booted
Started device:   {"token":"7056B721-AFCA-465F-A65B-E301E21B6DDE","name":"iPhone-11-Pro","status":"booted","type":"simulator","apiLevel":"13.5","platform":"ios","createDeviceOptions":{"type":"iPhone-11-Pro"},"pid":75610,"startedAt":1593415466101}
Default device:  {
  token: '7056B721-AFCA-465F-A65B-E301E21B6DDE',
  name: 'iPhone-11-Pro',
  status: 'booted',
  type: 'simulator',
  apiLevel: '13.5',
  platform: 'ios',
  createDeviceOptions: { type: 'iPhone-11-Pro' },
  pid: 75610,
  startedAt: 1593415466101
}
Trying to resolve automatically bundleId!
unzip -o /Users/fleebzz/workspaces/xxx/my-project/platforms/ios/build/Debug-iphoneos/myproject.ipa -d /Users/fleebzz/workspaces/xxx/my-project/platforms/ios/build/Debug-iphoneos/myproject
Setting capabilities sim.iPhone11Pro{ "bundleId" : "com.xxx.my-project" }!
Setting application name as my-project
Check and uninstall application from device. 
Server args:   ["-p","4723","--log-level","info"]
  sample scenario
args.appiumCaps['wdaLocalPort']: 8410
Session info:  
undefined
Appium settings:  
Current version of appium doesn't support appium settings! 
Could not resolve device density. Please provide offset in appium config
Appium driver has started successfully!
    1) "before all" hook
    2) "after all" hook

Killing simulator with udid 7056B721-AFCA-465F-A65B-E301E21B6DDE
Executing "/bin/ps aux | grep -ie '7056B721-AFCA-465F-A65B-E301E21B6DDE' | grep -v grep  | xargs kill -9"
No matching processes to kill!
Stopping server...
Shut down!!!
About to exit with code: exit
unzip -o /Users/fleebzz/workspaces/xxx/my-project/platforms/ios/build/Debug-iphoneos/myproject.ipa -d /Users/fleebzz/workspaces/xxx/my-project/platforms/ios/build/Debug-iphoneos/myproject
Appium terminated due signal: null and code: 1
unzip -o /Users/fleebzz/workspaces/xxx/my-project/platforms/ios/build/Debug-iphoneos/myproject.ipa -d /Users/fleebzz/workspaces/xxx/my-project/platforms/ios/build/Debug-iphoneos/myproject
Application from device is uninstalled. 
Application from device is uninstalled. 
Exited from appium

  0 passing (1m)
  2 failing

  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:97: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:456:21)
      at process.topLevelDomainCallback (domain.js:137:15)



npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! my-project@1.0.0 e2e: `node ./node_modules/nativescript-dev-appium/check-dev-deps.js &&  mocha --opts ./e2e/config/mocha.opts  "--runType" "sim.iPhone11Pro" "--reuseDevice"`
npm ERR! Exit status 2
npm ERR! 
npm ERR! Failed at the my-project@1.0.0 e2e script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/fleebzz/.npm/_logs/2020-06-29T07_24_52_063Z-debug.log
➜ npm运行e2e--runType sim.iPhone11Pro--reuseDevice
>我的-project@1.0.0e2e/用户/fleebzz/工作区/xxx/我的项目
>node./node_modules/nativescript dev appium/check-dev-deps.js&&mocha--opts./e2e/config/mocha.opts--runType“sim.iPhone11Pro”--reuseDevice
已解析的参数:{“端口”:4723,“项目目录”:“/Users/fleebzz/workspace/xxx/my project”,“projectBinary”:“/Users/fleebzz/workspace/xxx/my project/node_modules/.bin”,“pluginRoot”:“/Users/fleebzz/workspace/xxx/my project/node_modules/nativescript dev appium”,“pluginBinary”:“/Users/fleebzz/workspaces/xxx/my project/node_modules/nativescript dev appium/node_modules/.bin”,“wdaLocalPort”:8410,“testFolder”:“e2e”,“runType”:“sim.iPhone11Pro”,“appiumCapsLocation”:/Users/fleebzz/workspaces/xxx/my project/e2e/config/appium.capabilities.json”,“verbose”:false,“cleanApp”:false,“路径”:/Users/fleebzz/workspaces/workspaces/xxx/my project”capabilitiesName“:”appium.capabilities.json“,”driverConfig“:{”主机“:”本地主机“,”端口“:”4723}”,logImageTypes“:[]}”
/Users/fleebzz/workspace/xxx/my project/e2e/config/appium.capabilities.json
功能位于:/Users/fleebzz/workspace/xxx/my project/e2e/config/appium.Capabilities.json
自动化名称设置为:xguitest
要更改自动化名称,您需要在appium功能中设置它!
应用程序完整路径:/Users/fleebzz/workspace/xxx/my project/platforms/ios/build/Debug iphoneos/myproject.ipa
会话退出后,启动的设备将被杀死!
要避免这种情况,请在appium功能中设置“fullReset:false”。
process Simulator.app是否处于活动状态:true
xcrun simctl创建“iPhone-11-Pro”“iPhone 11-Pro”“com.apple.CoreSimulator.SimRuntime.iOS-13-5”
拆卸:76B308BE-409C-4A0A-8679-36F670F59118
检查模拟器是否启动!
模拟器启动了!
已启动模拟器,名称:iPhone-11-Pro;udid:7056B721-AFCA-465F-A65B-E301E21B6DDE;状态:已启动
已启动设备:{“令牌”:“7056B721-AFCA-465F-A65B-E301E21B6DDE”,“名称”:“iPhone-11-Pro”,“状态”:“启动”,“类型”:“模拟器”,“apiLevel”:“13.5”,“平台”:“ios”,“createDeviceOptions”:{“类型”:“iPhone-11-Pro”},“pid”:75610,“启动地址”:1593415466101}
默认设备:{
标记:“7056B721-AFCA-465F-A65B-E301E21B6DDE”,
名称:“iPhone-11-Pro”,
状态:“已启动”,
类型:“模拟器”,
apiLevel:'13.5',
平台:“ios”,
createDeviceOptions:{type:'iPhone-11-Pro'},
pid:75610,
起始地址:1593415466101
}
正在尝试自动解决此问题!
解压-o/Users/fleebzz/workspace/xxx/my project/platforms/ios/build/Debug iphoneos/myproject.ipa-d/Users/fleebzz/workspace/xxx/my project/platforms/ios/build/Debug iphoneos/myproject
设置sim.iPhone11Pro{“bundleId”:“com.xxx.my project”}!
将应用程序名称设置为我的项目
检查并从设备卸载应用程序。
服务器参数:[“-p”、“4723”、“--log level”、“info”]
示例场景
args.appiumCaps['wdaLocalPort']:8410
会话信息:
未定义
应用程序设置:
当前版本的appium不支持appium设置!
无法解析设备密度。请在appium配置中提供偏移量
Appium驱动程序已成功启动!
1) “最重要的”钩子
2) “毕竟”钩子
带udid 7056B721-AFCA-465F-A65B-E301E21B6DDE的压井模拟器
执行“/bin/ps aux|grep-ie‘7056B721-AFCA-465F-A65B-E301E21B6DDE’| grep-v grep | xargs kill-9”
没有匹配的进程可以杀死!
正在停止服务器。。。
关闭!!!
即将退出,代码为:exit
解压-o/Users/fleebzz/workspace/xxx/my project/platforms/ios/build/Debug iphoneos/myproject.ipa-d/Users/fleebzz/workspace/xxx/my project/platforms/ios/build/Debug iphoneos/myproject
由于信号为空且代码为1而终止应用程序
解压-o/Users/fleebzz/workspace/xxx/my project/platforms/ios/build/Debug iphoneos/myproject.ipa-d/Users/fleebzz/workspace/xxx/my project/platforms/ios/build/Debug iphoneos/myproject
已卸载设备中的应用程序。
已卸载设备中的应用程序。
从appium退出
0传球(1米)
2失败
1) 示例场景
“一切之前”挂钩:
TypeError:无法读取未定义的属性“statBarHeight”
at函数。(node_modules/nativescript dev-appium/lib/appium-driver.js:260:37)
在Generator.next()处
完成时(node_modules/nativescript dev-appium/lib/appium-driver.js:4:58)
在处理和拒绝时(内部/process/task_queues.js:97:5)
2) 示例场景
“毕竟”钩子:
TypeError:无法读取未定义的属性“quit”
在上下文中。(e2e/sample.e2e-spec.js:14:22)
在processImmediate(internal/timers.js:456:21)
在process.topLevelDomainCallback(domain.js:137:15)
npm错误!代码错误周期
npm错误!错误2
嗯,我的天-project@1.0.0e2e:`node./node_modules/nativescript dev appium/check-dev-deps.js&&mocha--opts./e2e/config/mocha.opts”--运行类型“sim.iPhone11Pro”--重用设备`
npm错误!退出状态2
npm错误!
npm ERR!在我的-project@1.0.0e2e脚本。
npm错误!这可能不是npm的问题。上面可能还有其他日志输出。
npm ERR!此运行的完整日志可在以下位置找到:
npm ERR!/Users/fleebzz/.npm/_logs/2020-06-29T07_24_52_063Z-debug.log
  • 我尝试切换到旧版本的iOS(12.X而不是13.X)
  • 我尝试了使用较旧版本的appium和nativescript dev appium
  • 我尝试用另一个iPhone版本(iPhoneX)代替iPhone11Pro

有没有人已经有了这个问题,或者对如何解决这个问题有任何线索?

你有没有发现这个问题?我也有同样的问题