동작 UI 테스트
컬렉션을 사용해 정리하기
내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요.
동작 UI 테스트는 UI 계층 구조를 분석하여 UI 요소의 속성에 관해 어설션을 실행하는 테스트입니다.
Jetpack 프레임워크
Jetpack에는 UI 테스트 작성을 위한 API를 제공하는 다양한 프레임워크가 포함되어 있습니다.
- Espresso 테스트 프레임워크 (Android 4.0.1, API 수준 14 이상)는 단일 타겟 앱 내에서 뷰와의 사용자 상호작용을 시뮬레이션하는 UI 테스트를 작성하기 위한 API를 제공합니다. Espresso를 사용하면 테스트 작업을 테스트 중인 앱의 UI와 자동으로 동기화할 수 있다는 것이 큰 장점입니다. Espresso는 기본 스레드가 유휴 상태일 때 이를 감지하므로 적절한 시간에 테스트 명령어를 실행하여 테스트의 안정성을 개선할 수 있습니다.
- Jetpack Compose (Android 5.0, API 수준 21 이상)는 Compose 화면과 구성요소를 실행하고 상호작용하는 테스트 API 집합을 제공합니다. Compose 요소와의 상호작용은 테스트와 동기화되며 시간, 애니메이션, 재구성 등을 완전히 제어할 수 있습니다.
- UI Automator (Android 4.3, API 수준 18 이상)는 시스템과 설치된 앱 전반에 걸쳐 앱 간의 기능적 UI 테스트를 실행하기에 적합한 UI 테스트 프레임워크입니다. UI Automator API를 사용하면 테스트 기기에서 Settings 메뉴 또는 앱 런처 열기와 같은 작업을 실행할 수 있습니다.
- Robolectric (Android 4.1, API 수준 16 이상)을 사용하면 에뮬레이터나 기기가 아닌 일반 JVM의 워크스테이션이나 지속적 통합 환경에서 실행되는 로컬 테스트를 만들 수 있습니다. Espresso 또는 Compose 테스트 API를 사용하여 UI 구성요소와 상호작용할 수 있습니다.
추가 리소스
UI 테스트를 만드는 방법에 관한 자세한 내용은 다음 리소스를 참고하세요.
문서
Codelab
이 페이지에 나와 있는 콘텐츠와 코드 샘플에는 콘텐츠 라이선스에서 설명하는 라이선스가 적용됩니다. 자바 및 OpenJDK는 Oracle 및 Oracle 계열사의 상표 또는 등록 상표입니다.
최종 업데이트: 2025-07-27(UTC)
[[["이해하기 쉬움","easyToUnderstand","thumb-up"],["문제가 해결됨","solvedMyProblem","thumb-up"],["기타","otherUp","thumb-up"]],[["필요한 정보가 없음","missingTheInformationINeed","thumb-down"],["너무 복잡함/단계 수가 너무 많음","tooComplicatedTooManySteps","thumb-down"],["오래됨","outOfDate","thumb-down"],["번역 문제","translationIssue","thumb-down"],["샘플/코드 문제","samplesCodeIssue","thumb-down"],["기타","otherDown","thumb-down"]],["최종 업데이트: 2025-07-27(UTC)"],[],[],null,["# Behavior UI Tests\n\nBehavior UI tests are tests that analyze the UI hierarchy to make assertions\non the properties of the UI elements.\n\nJetpack frameworks\n------------------\n\nJetpack includes various frameworks that provide APIs for writing UI tests:\n\n- The **[Espresso testing framework](/training/testing/espresso)** (Android 4.0.1, API level 14 or higher) provides APIs for writing UI tests to simulate user interactions with *Views* within a single target app. A key benefit of using Espresso is that it provides automatic synchronization of test actions with the UI of the app you are testing. Espresso detects when the main thread is idle, so it is able to run your test commands at the appropriate time, improving the reliability of your tests.\n- **[Jetpack Compose](/jetpack/compose)** (Android 5.0, API level 21 or higher) provides a set of [*testing APIs*](/jetpack/compose/testing) to launch and interact with Compose screens and components. Interactions with Compose elements are synchronized with tests and have complete control over time, animations and recompositions.\n- **[UI Automator](/training/testing/ui-automator)** (Android 4.3, API level 18 or higher) is a UI testing framework suitable for cross-app functional UI testing across system and installed apps. The UI Automator APIs allows you to perform operations such as opening the Settings menu or the app launcher on a test device.\n- **[Robolectric](/training/testing/local-tests/robolectric)** (Android 4.1, API level 16 or higher) lets you create *local* tests that run on your workstation or continuous integration environment in a regular JVM, instead of on an emulator or device. It can use Espresso or Compose testing APIs to interact with UI components.\n\nAdditional resources\n--------------------\n\nFor more information about creating UI tests, consult the following resources.\n\n### Documentation\n\n- [Build instrumented tests](/training/testing/instrumented-tests)\n- [Espresso](/training/testing/espresso)\n- [Compose Testing](/jetpack/compose/testing)\n\n### Codelabs\n\n- [Introduction to Test Doubles and Dependency Injection](/codelabs/advanced-android-kotlin-training-testing-test-doubles)"]]