4

I set up appium tests following nativescript-dev-appium instructions (https://github.com/NativeScript/nativescript-dev-appium) and tests run fine on an Android simulator.

My problem is on iOS. I cannot make them work, before and after methods fail with the error Cannot read property 'statBarHeight' of undefined. Here are my logs :

➜ 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
  • I tried to switch to an older version of iOS (12.X instead of 13.X)
  • I tried with an older version of appium and of nativescript-dev-appium
  • I tried with another iPhone version (iPhone X) instead of iPhone 11 Pro

Does anybody already have this issue or have any clue about how to resolve this ?

0 Answers0