-
Notifications
You must be signed in to change notification settings - Fork 0
James/threadcoderevert #2
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
base: master
Are you sure you want to change the base?
Conversation
for (Object testClass:appTests) { | ||
try { | ||
Method m = testClass.getClass().getMethod(method, classArgs.toArray(new Class[0])); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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...
|
||
public int log(String message) { | ||
Log.i(TAG, message); | ||
return 0; | ||
} | ||
|
||
public void register(Object test, String deviceId) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.