Integrate `edge_to_edge_test_lib`

Add edge-to-edge window-insets overlap assertions to Android Compose UI tests.

60|2|Updated Jul 14, 2024
One-click install
npx skills add https://github.com/timo-drick/compose_edge_to_edge_preview --skill integrate-edge-to-edge-test-lib
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: Integrate `edge_to_edge_test_lib`
Source: https://github.com/timo-drick/compose_edge_to_edge_preview/tree/main/ai_skills/integrate-edge-to-edge-test-lib
Command: npx skills add https://github.com/timo-drick/compose_edge_to_edge_preview --skill integrate-edge-to-edge-test-lib

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires de.drick.compose:edge-to-edge-test, and includes references (resource) components.

What problem does it solve?

This skill helps you avoid flaky or invisible UI layout issues where Compose content overlaps critical WindowInsets like system bars or display cutouts during automated testing.

Core Features & Use Cases

  • Automated inset overlap assertions: Adds overlap checks so tests fail when UI nodes intersect selected WindowInsets types.
  • Supports instrumented and Robolectric tests: Works in both androidTest and test flows to keep verification consistent.
  • Diagnostics for faster triage: Optionally captures overlap diagnostics (e.g., screenshot creation on overlaps) to debug failures quickly.

Quick Start

Integrate edge-to-edge test overlap assertions by adding the edge-to-edge-test dependency in the correct Gradle source set and updating your Compose test to include SemanticsWindowInsetsAnchor() and call assertWindowInsets(...) on the relevant nodes.

Frequently Asked Questions about Integrate `edge_to_edge_test_lib`

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I test edge-to-edge window insets overlap in Jetpack Compose?

To test edge-to-edge window insets overlap in Jetpack Compose, add the edge-to-edge-test dependency, include SemanticsWindowInsetsAnchor() in your test content, and call assertWindowInsets(...) on relevant composable nodes to verify they do not intersect system bars or display cutouts.

What WindowInsetsCompat types should I assert against to prevent UI overlap?

You should assert against meaningful WindowInsetsCompat.Type selectors such as systemBars combined with displayCutout or tappableElement to catch Compose UI content overlapping critical system bars or cutouts during automated testing.

Why does my Compose UI content overlap system bars in automated tests?

Compose UI content overlaps system bars in automated tests when inset overlap checks are missing. Adding assertWindowInsets(...) with a SemanticsWindowInsetsAnchor() causes tests to fail when nodes intersect selected WindowInsets types, making invisible layout issues visible.

Can I capture screenshots when edge-to-edge inset overlap is detected in Compose tests?

Yes, the edge-to-edge test integration optionally captures overlap diagnostics such as screenshot creation on overlaps, helping you debug failures quickly when Compose UI nodes intersect system bars or display cutouts during automated testing.