Project Name | Stars | Downloads | Repos Using This | Packages Using This | Most Recent Commit | Total Releases | Latest Release | Open Issues | License | Language |
---|---|---|---|---|---|---|---|---|---|---|
Android Boilerplate | 1,885 | 6 years ago | 8 | gpl-3.0 | Java | |||||
Android Boilerplate project using RxJava, Dagger 2, Espresso, Mockito + more! | ||||||||||
Android Kotlin Clean Architecture | 1,603 | a year ago | 3 | Kotlin | ||||||
Android Sample Clean Architecture App written in Kotlin | ||||||||||
Daggermock | 1,140 | 3 years ago | 31 | apache-2.0 | Java | |||||
A JUnit rule to easily override Dagger 2 objects | ||||||||||
Katasuperheroesandroid | 682 | 4 years ago | apache-2.0 | Java | ||||||
Super Heroes Kata for Android Developers. The main goal is to practice UI Testing. | ||||||||||
Dagger Hilt Playerground | 237 | a year ago | 3 | Kotlin | ||||||
A playground for learning dagger hilt on android | ||||||||||
Multimodulegithubclient | 214 | 4 years ago | 2 | Java | ||||||
Example multi-module Android project with unit tests, dagger 2, test coverage and others | ||||||||||
Dagger2 | 144 | 3 years ago | Kotlin | |||||||
Kotlin Dagger2 example project | ||||||||||
Space App | 139 | a year ago | 1 | apache-2.0 | Kotlin | |||||
An Android app which shows timeline of upcoming rocket launches and showcases architecture of real application. | ||||||||||
Androidespressoidlingresourceplayground | 124 | 9 years ago | mit | Java | ||||||
A little playground for Android Espresso testing framework, especially focusing on IdlingResource approach | ||||||||||
Yamvp | 96 | 7 years ago | mit | Java | ||||||
Yet another Mvp library. Super simple, but with enough functionality. |
This repository contains an Android application to show Super Heroes information:
This Application is based on two Activities:
MainActivity
showing a list of super heroes with name, photo and a special badge if is part of the Avengers Team.SuperHeroDetailActivity
showing detailed information about a super hero like his or her name, photo and description.The application architecture, dependencies and configuration is ready to just start writing tests. In this project you'll find Dagger2
configured to be able to replace production code with test doubles easily and Espresso to be able to interact with the application user interface.
Your task as Android Developer is to write all the UI tests needed to check if the Application UI is working as it should.
This repository is ready to build the application, pass the checkstyle and your tests in Travis-CI environments.
Our recommendation for this exercise is:
Before starting
kata-super-heroes
branch.MainActivityTest
and watch the only test it contains pass.To help you get started, these are some test cases for MainActivity
:
SuperHeroesRepository
in MainActivityTest
to return a list of some Super Heroes.SuperHeroesRepository
returns a list of some Super Heroes.If you get stuck, Master
branch contains already solved tests for MainActivity
and SuperHeroDetailActivity
A DaggerMockRule is an utility to let you create Dagger 2 modules dynamically. In this case we are using it to create a new MainModule
in this testing scope. Instead of returning real objects, this new MainModule
will returns the mock for SuperHeroesRepository
defined in this test.
You will find some utilities to help you test RecyclerViews and Toolbars easily in:
app/src/androidTest/java/com/karumi/katasuperheroes/matchers
and app/src/androidTest/java/com/karumi/katasuperheroes/recyclerview
.
RecyclerViewInteraction
: provides an easy way to apply an Espresso matcher to all of the RecyclerView elements
RecyclerViewInteraction.<ITEM_TYPE>onRecyclerView(withId(R.id.recycler_view))
.withItems(A_LIST_OF_ITEMS)
.check(new RecyclerViewInteraction.ItemViewAssertion<ITEM_TYPE>() {
@Override
public void check(ITEM_TYPE item, View view, NoMatchingViewException e) {
matches(A_MATCHER).check(view, e);
}
});
RecyclerViewItemsCountMatcher
: a matcher that returns true if RecyclerView contains the expected number of elements.
ToolbarMatcher
: a matcher that returns true if a Toolbar with expected title is found.
If you've covered all the application functionality using UI tests try to continue with the following tasks:
MainActivity
and test it.SuperHeroDetailActivity
to handle an error case where the name of the super hero used to start this activity does not exist and show a message if this happens.SnackBar
to indicate something went wrong.SuperHeroesRepository
test double to perform a Thread.sleep
and use the custom idling resources you'll find in this repository to get your tests working.There are some links which can be useful to finish these tasks:
Data provided by Marvel. 2016 MARVEL
Copyright 2016 Karumi
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.