Support for automatically testing on physical devices(and the like)
petterroea opened this issue · 4 comments
Is your feature request related to a problem? Please describe.
Some docker conainers, such as docker-emulator-android, work by exposing an adb server that you can connect to. When doing this, the device appears as a connected device, not an emulator.
As far as i can see, there does not currently exist a solution where PixelsCatcher can run tests automatically on connected devices
Describe the solution you'd like
The ability to specify an adb device name to use. The PixelsCatcher should then avoid running the emulator, and simply use adb to install and launch the application. A requirement for this could be that you specify the IP that the android device should conenct to, per todays documentation, as that would vary based on your exact test platform
I can have a shot at this if you like, @rumax
Hi @petterroea , sounds good and I also planed to support physical devices. At first glance what I see is:
-
src/runner/utils/device/AndroidDevice.js
can be introduced, and it should implementDeviceInterface
-
In
src/runner/cli.js
it is possible to decide ifAndroidDevice
orAndroidEmulator
should be used, based on configuration. Andstart
method fromDeviceInterface
will only verify if the device is available or not (throw an error if not), methodstop
can be empty -
Configuration (
pixels-catcher.json
) currently has 2 sections,android
andios
, so to keep current configuration without changes, thepixels-catcher.json
configuration it can be extended with:android-device
andios-device
. In this case to run tests on android device it will be possible to run it with:
$ pixels-catcher android-device debug
or
$ pixels-catcher ios-device debug
So configuration for device will be the same as for emulator, and deviceName
will specify the device for test.
So if you want you can try, if not I'll try to find some time to implement it (meantime I'm not sure when, currently this functionality not required by main project)