Menu

1 / 2

Testing a TV UI: what a unit test can see and what needs a device

DEV Community: android·Yonto Player·1 day ago
#NrQPM4Ca
#devtoandroid#devto#dev#screen#focus
Long article (1593 words) — no AI summary yet.
Reading 0:00
15s threshold

A phone app is driven by taps, and a tap says where it landed. A TV app is driven by a D-pad: up, down, left, right, OK and Back. Where a press goes depends on which element has focus, and the app decides that. So I split the checking of Yonto Player's TV app into three layers, each kept to the questions it can answer.

What a unit test can see

Most of the app is not about focus at all. Adapters, repositories, view models and settings persistence have unit tests, and the rule in the repo is that a new adapter, a repository method or a view model behaviour comes with one.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.