Conversation
| for (Object testClass:appTests) { | ||
| try { | ||
| Method m = testClass.getClass().getMethod(method, classArgs.toArray(new Class[0])); | ||
|
|
There was a problem hiding this comment.
So, we're searching for a method in all the Test Classes and selecting the first test method? What if two methods in 2 classes have the same name? Perhaps it's best to have 2 methods -- one where you can specify and the other where it does a lookup like this...
| return 0; | ||
| } | ||
|
|
||
| public void register(Object test, String deviceId) { |
There was a problem hiding this comment.
how does the test get a deviceId? I am assuming in Espresso code, the client will call
MoQuality.register(class, "device1")
If this is the case, then they are hardcoding the deviceId in the test, which means they would have to generate a new APK for device2. Is that right? Ideally we would want this to be dynamically assigned to the test via a command line argument or something. In Android, when running the test from command line, clients can supply key value pairs to am instrument e.g., -e deviceId device1.
https://developer.android.com/studio/test/command-line#AMOptionsSyntax
These can be fetched from within the code using the InstrumentationRegistry.getArguments()
https://developer.android.com/reference/android/support/test/InstrumentationRegistry
https://github.com/android/android-test/blob/master/runner/monitor/java/androidx/test/InstrumentationRegistry.java
Updates per feedback around multiple class handling and thread waits.