Giter Club home page Giter Club logo

android-navigationdrawer's Introduction

Android Navigation Drawer Sample UI Testing

The following basic functionality is covered by the automated tests:

  • displaying the default planet on app start and validating the available planets (BasicFunctionalityTests);
  • selecting a planet from the menu and validating that through the correct title and the image displayed (PlanetSelectionFeatureParametrizedTests);
  • initiating quick search for a currently opened planet and validating intents sent (QuickSearchFeatureTests).

Tests Design Approach

The PageObject design pattern is used for designing the framework, encapsulating the logic of UI interaction and separation it from the business logic in tests.

All classes with functional tests extend the BaseTestModel parent class which contains initialization logic before each test (navigating to the NavigationDrawerActivity) and screenshot taking logic after each test. The BaseTestModel class in turn extends the TestHelper class which holds extra methods that make tester's life easier (handling the arisen QuickSearch, getting current activity).

As Espresso doesn't have a matcher for asserting image from resources on a view out-of-the-box, the DrawableMatcher has been created. It serves the purpose of validating that a correct drawable is displayed on an ImageView, using its name as a search criteria (makes sence for the sample app). As there might be many custom matchers in future, there is the CustomMatchers wrapper class that aligns the DrawableMatcher usage with the Esspresso-like style.

Running Tests

Spoon framework is configured for running tests on multiple connected devices, taking screenshots after each test and generating a final report. In order to run tests, navigate to the project's root folder, run the gradlew spoon command, wait for the tests to be executed on all connected devices and find a final report in the \Application\build\spoon-output folder.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.