Instrumentation Test or UI Testing in Android App
Instrumentation Test in Android
Testing means check the features we develop works. Example: Clicking a button in screen and verify if the expected image appears.
UI testing means testing the components on screen that the user can interact with.
Android studio provides a powerful tool called Espresso to help developers efficiently do UI tests.
Espresso is a testing framework that includes a set of APIs that simulates and schedules user interactions to help us as developers test an app's user interface. Rather than a developer poke around poke around an app to find out what works and what doesn't Espresso provides us the tools to automate the process.
Most of the app we use have a lot of UI components. Ex. app which allows us to order icecream of various flavors. So all the touch pointes that user touch to order the icecream must be verified to make sure that the user's experience is seemless and funcitonal as anticipated. So rather than having a dedicated person touching hundreds of all those buttons for potentially hundreds of icecream flavors combinations. So espresso allows us to automate the manual process so they can be tested at scale and much more efficiently.
Analysis of UI testing
Steps to Manually UI Test.
- Open the app and find the order button
- Click the button
- Check that the order summary activity opens.
- Find the View we are interested in.
- Perform the Action on the view.
- Check if the view does what you expected.
- onView(ViewMatcher)
- perform(ViewAction)
- check(ViewAssertion)
- onData(ObjectMatcher)
- DataOptions
- perform(ViewAction)
- check(ViewAssertion)
Comments
Post a Comment