-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
[Android] Enable usage of custom instrumentation test runners #675
[Android] Enable usage of custom instrumentation test runners #675
Conversation
wiyarmir
commented
Apr 18, 2018
- Spawn adb shell and ask package manager for all runners
- Regex the one for the package under test and use it
closing and reopening to trigger another build |
detox/src/devices/AndroidDriver.js
Outdated
@@ -72,6 +79,8 @@ class AndroidDriver extends DeviceDriverBase { | |||
return this.instrumentationProcess.pid; | |||
} | |||
|
|||
const testRunner = await this.adb.getInstrumentationRunner(deviceId, bundleId) |
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.
;
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.
; missing
@@ -0,0 +1,37 @@ | |||
describe("AndroidDriver", () => { |
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.
Drivers are not unit tested on purpose. The mostly touch command line tools and are just wrappers. Unit tests don't give much value. They are being tested in the e2e suite.
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.
This function is doing some regex voodoo so that's why I thought about adding one at least, but I'm ok with removing it.
@@ -55,5 +55,10 @@ xdescribe('ADB', () => { | |||
await adb.unlockScreen('deviceId'); | |||
expect(exec).toHaveBeenCalledTimes(1); | |||
}); | |||
|
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.
I guess we should consider dropping unit tests on ADB as well, but for now, don't delete this test
Took the freedom of fixing ADB tests a bit. Probably |
c8fcd6d
to
86bfd02
Compare
* query pm and regex through results * PR comments * mock android SDK path * More modularity and better test readability (cherry picked from commit a9bc3b8)