Hello, I couldn't find any guidelines for issues so I'll just explain the problem I'm experiencing.
I have a Jetpack Compose project for which I want to try out Snapshot testing. I was following the README for the RoadToEffectiveSnapshotTesting project and created a parameterized test where the font changes.
Shot only supports API's 26+ to create a screenshot for composables. However when I tried using this TestRule on API 26, 28 and 30 the font did not change. Neither in my own project nor in the RoadToEffectiveSnapshotTesting one.
I'm not sure if this is a problem with my machine / emulators or the TestRule. I wasn't able to debug the TestRule because I only had access to the decompiled sources (maybe it would be possible to expose the source code through the library to make debugging easier?).
My current hack to change the font looks like this:
@Before
fun setUp() {
InstrumentationRegistry
.getInstrumentation()
.uiAutomation
.executeShellCommand("settings put system font_scale ${data.fontScale.value}")
.apply {
Thread.sleep(2000)
close()
}
}
@After
fun tearDown() {
InstrumentationRegistry
.getInstrumentation()
.uiAutomation
.executeShellCommand("settings put system font_scale 1.0")
.apply {
Thread.sleep(1000)
close()
}
}
But this is only an temporary solution ๐