flutter / flutter

Flutter makes it easy and fast to build beautiful apps for mobile and beyond
https://flutter.dev
BSD 3-Clause "New" or "Revised" License
166.19k stars 27.49k forks source link

FlutterDriver reports the target device #10584

Open HansMuller opened 7 years ago

HansMuller commented 7 years ago

Internal: b/124657370

Currently the flutter driver test that collections screenshots (see examples/catalog/bin/screenshot_test.dart.template) incorrectly assumes that if it's running on MacOS, it's targeting an iOS device.

It would preferable to just ask the FlutterDriver for the target device's deviceId, or OS.

I've patched the problem for now https://github.com/flutter/flutter/pull/10583

mehmetf commented 5 years ago

I was about to file an issue with title Provide an API from Flutter Driver to grab targeted device info but this might be a duplicate.

A use case emerged at Google recently. Client apps want to run a driver test that performs a different action/matcher depending on the platform of the targeted device. They tried Platform.isIOS on the driver (a natural thing to do) and they were surprised that it did not work. I also learned recently that the driver itself actually runs on the host; previously I was assuming that it was running on device in a separate process (like Espresso).

An API such as driver.getDeviceInfo() would be nice. This could return the device platform, id and other information.

zoechi commented 5 years ago

21585 is about CPU, Memory