- Testing Accessibility
- Testing UI Performance
- Test Recorder
- Testing UI for Multiple Application
- Testing Intents
- Testing Asynchronous Operations
- Testing WebView
- Testing AdapterView
- View Actions
- View Assertions
- Custom View Matchers
- View Matchers
- Architecture
- Overview of JUnit
- Running Tests In Android Studio
- Setup Instructions
- Introduction
- Espresso Testing - Home
Espresso Testing Resources
Selected Reading
- Who is Who
- Computer Glossary
- HR Interview Questions
- Effective Resume Writing
- Questions and Answers
- UPSC IAS Exams Notes
Running Tests In Android Studio
在本章中,让我们看看如何使用安乐施室进行测试。
每一种甲状腺应用都有两种类型的检测:
职能/单位测试
仪器测试
Functional test does not need the actual android apppcation to be installed and launched in the device or emulator and test the functionapty. It can be launched in the console itself without invoking the actual apppcation. However, instrumentation tests need the actual apppcation to be launched to test the functionapty pke user interface and user interaction. By default, Unit tests are written in src/test/java/ folder and 仪器测试 are written in src/androidTest/java/ folder. Android studio provides Run context menu for the test classes to run the test written in the selected test classes. By default, an Android apppcation has two classes − ExampleUnitTest in src/test folder and ExampleInstrumentedTest in src/androidTest folder.
为了进行缺席单位测试,选定ExampleUnit Test,在安伯顿演播室进行右侧扫描,然后点击Run ExampleUnit Test如下:
Run Unit Test
它将进行单位测试,并显示像以下屏幕显示的青 the的结果:
Unit Test Success
进行缺省仪器测试,选定实例说明 and室试验,右侧扫描,然后点击鲁普勒入侵试验,如下所示:
Run Instrumentation Test
这将通过在任何装置或推介器上启动申请来进行单元测试,并显示像以下屏幕显示的青 the的结果:
仪器测试取得了成功。
Advertisements