# Compose UI Tests for Larger Font Sizes: Scrolling and Text Truncation

DevFeed: [Compose UI Tests for Larger Font Sizes: Scrolling and Text Truncation](<https://devfeed.tech/articles/compose-ui-tests-for-larger-font-sizes-scrolling-and-text-truncation-38513.md>)

Original publisher: [Read original article](<https://eevis.codes/blog/2025-10-31/compose-ui-tests-for-larger-font-sizes-scrolling-and-text-truncation/>)

Author: Eevis Panula

Published: 2025-10-31T05:06:57.487000Z

Content type: tutorial

Language: en

Sources: [Eevis Blog](<https://devfeed.tech/sources/eevis-blog.md>)

Topics: [Compose](<https://devfeed.tech/topics/compose.md>), [Accessibility](<https://devfeed.tech/topics/accessibility.md>), [Testing](<https://devfeed.tech/topics/testing.md>), [Android](<https://devfeed.tech/topics/android.md>), [ui](<https://devfeed.tech/topics/ui.md>)

Tags: [accessibility](<https://devfeed.tech/tags/accessibility.md>), [android](<https://devfeed.tech/tags/android.md>), [compose](<https://devfeed.tech/tags/compose.md>), [tests](<https://devfeed.tech/tags/tests.md>), [ui](<https://devfeed.tech/tags/ui.md>)

## AI overview

A tutorial on writing Android Compose UI tests for accessibility issues caused by larger font sizes. It demonstrates testing whether content scrolls when needed and whether truncated text can be expanded, using a 200% font scale in the test setup.

## Source excerpt

While testing Android apps for accessibility, one of the biggest problems I've encountered are with larger font sizes. They're usually not properly supported: content overlaps when font sizes increase, scrolling isn't enabled to accommodate growing text, or text is truncated without a way for the user to expand it. I'm often asked tips on writing accessibility tests for Android, and I decided to write this post to demonstrate how to test some of those larger font size issues with UI tests. In this blog post, we're looking into writing tests to verify that scrolling is enabled when needed and that truncated text can be expanded. Let's first discuss the screen I wrote to test these issues. The Screen We're Testing I created an example screen with Compose to demonstrate tests in this blog post. It's a Scaffold that wraps a LGBTQ+ Glossary of different gender identities and sexual and romantic orientations. If this were an actual app, there would be a separate screen for each of these categories, listing all the data. On this screen, only the first four are displayed, except for romantic orientation, which shows only the first two. This is what the screen looks like with 100% font size (so, the default one): Note that with the default font size, all content fits the screen, and no scrolling is needed. However, when the font size increases and text takes up more space, the content should be scrollable to accommodate that. The content of the screen, explaining Non-binary, agender, genderqueer, transgender, asexual, bisexual, queer, lesbian, aromantic, and biromantic terms, is copied from the LGBTQIA+ Wiki ⚧. If you're interested in learning more, you'll find much more information on the link. Testing Setup Before we can start writing the tests, we need to do a bit of setup. As the default UI tests are run against the default font size (100%), we need a way to specify the font size as 200% for the tests. There are several ways to do it. In this blog post, we're going