rumax/react-native-PixelsCatcher

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

rumax commented

Hi @petterroea , sounds good and I also planed to support physical devices. At first glance what I see is:

  1. src/runner/utils/device/AndroidDevice.js can be introduced, and it should implement DeviceInterface

  2. In src/runner/cli.js it is possible to decide if AndroidDevice or AndroidEmulator should be used, based on configuration. And start method from DeviceInterface will only verify if the device is available or not (throw an error if not), method stop can be empty

  3. Configuration (pixels-catcher.json) currently has 2 sections, android and ios, so to keep current configuration without changes, the pixels-catcher.json configuration it can be extended with: android-device and ios-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)

rumax commented

Implemented in #21