Open kataRebuy opened 3 months ago
It's a reasonable approach. For now, we can refer to the implementation used by Now In Android for multi-device testing. In a nutshell, we can use RuntimeEnvironment.setQualifiers() as follows: RuntimeEnvironment.setQualifiers("w${width}dp-h${height}dp-${dpi}dpi").
We can integrate the multi-device feature into Roborazzi if we find a suitable API. Currently, however, I don't have one. You can utilize the roboOutputName() function to retrieve the default name of the Roborazzi image, which allows you to append the device name to it.
That is a nice solution. It would be convenient if it were part of the library.
We already have that function, but I didn't mention it in the document. So, now is the time to include it. https://github.com/search?q=repo%3Atakahirom%2Froborazzi%20roboOutputName&type=code
@kataRebuy In case it helps: did write about that (and more) here 👇 https://sergiosastre.hashnode.dev/efficient-testing-with-robolectric-roborazzi-across-many-ui-states-devices-and-configurations
Currently, if I want to test the same stuff on 3 different devices I have to write the tests 3 times. It would be nice to get a feature where you can run the same test with different device configs. Like this:
Of course then including the device config name in the screenshots file name to be able to distinguish between them.