Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Action never completes with Cordova app running on Android #61

Closed
blefebvre opened this issue May 17, 2016 · 5 comments
Closed

Action never completes with Cordova app running on Android #61

blefebvre opened this issue May 17, 2016 · 5 comments

Comments

@blefebvre
Copy link

blefebvre commented May 17, 2016

When running a browser-perf test via the Node API targeting Android hardware, my test action never appears to be fired and the action eventually times out.

Environment:

browser-perf 1.4.5
chromedriver 2.21.371459
adb 1.0.32
PhoneGap CLI 6.2.1
Nexus 5 running Android 5.0.1

To reproduce:

  • clone my test repo: https://github.com/blefebvre/pg-app-perf
  • build the app once, installing it on a connected Android device: phonegap run android --device
  • start chromedriver: ./chromedriver --verbose
  • with the app running on device, kick off the Android scroll test: node tests/android/1-slow-scroll.js

Result:

  • The app will navigate to the 'Scroll Example - slow' page; so the preScript appears to work fine
  • It will then wait at this screen for a few minutes before shutting down the app with the following output in the chromedriver terminal window:
[146.617][INFO]: COMMAND Quit {

}
[146.617][DEBUG]: Sending adb command: host:transport:03f3cc21437ccb7d|shell:am force-stop com.brucelefebvre.PGAppPerf
[147.316][DEBUG]: Received adb response:
[147.316][INFO]: RESPONSE Quit
[147.316][DEBUG]: Log type 'driver' lost 0 entries on destruction
[147.316][DEBUG]: Log type 'performance' lost 0 entries on destruction
[147.316][DEBUG]: Log type 'browser' lost 0 entries on destruction
  • browser-perf calls back with an array for the err object, but it's contents are undefined ([ undefined ]).
@axemclion
Copy link
Owner

@blefebvre Looks like this is related to #14. Due to a bug, looks like the code is trying to get adb logcat even for Android, which it should not.

axemclion added a commit that referenced this issue May 24, 2016
AndroidTracingProbe looks for adb logs that are triggered only for Chrome-Android.
All other Chrome WebView apps, including Cordova apps cannot use that.

In AndroidTracingProbe, the capabilities were picked up from the browser session rather than than what was passed in.
As a result, the lines (that were deleted in this commit) simply passed, causing this to be called even for Cordova apps.

As a result, the logs never show up, waitForLogCat timeout and browser-perf failed.

The check in this commit basically says that ALL Chrome-Android browser have an activity, and that should be the only time when AndroidTracingProbe should be triggered.

See #61
@axemclion
Copy link
Owner

axemclion commented May 24, 2016

@blefebvre Btw, nice talk at PGDay EU. Sorry, I could not fix this in time for PGday.

@axemclion
Copy link
Owner

You don't even need to wait for taps and clicks, you could technically navigate to the slow page (or the fast page) and run the tests.

@axemclion
Copy link
Owner

I ran the tests now and they run. Closing the issue now.

@blefebvre
Copy link
Author

Verified that version 1.4.7 works perfectly. Thanks @axemclion, will update my PGDay repo to reference this version and include test suites that target Android. No worries at all about the timing, I should have raised the issue sooner. Cheers!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants