Top AI Repos — open-source AI, indexed and scored
Top AI Repos tracks AI repositories on GitHub and answers two different questions about each one: is it moving right now, and would you bet a product on it.
Top AI Repos tracks AI repositories on GitHub and answers two different questions about each one: is it moving right now, and would you bet a product on it.
Super Heroes Kata for Android Developers. The main goal is to practice UI Testing.
| Date | Stars |
|---|---|
| 2026-07-30 | 682 |
| 2026-09-19 | 681 |
| 2026-11-04 | 681 |
Today
— stars today
This week
— stars this week
This month
— stars this month
Momentum
0.0
growth rate 0.00%/day
![Karumi logo][karumilogo] KataSuperHeroes for Android
============================
- We are here to practice UI Testing.
- We are going to use [Espresso][espresso] to interact with the Application UI.
- We are going to use [Dagger2][dagger2] to replace production code with [Test Doubles][testDoubles].
- We are going to practice pair programming.
---
## Getting started
This repository contains an Android application to show Super Heroes information:
![ApplicationScreencast][applicationScreencast]
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.
![MainActivityScreenhot][mainActivityScreenshot]
* ``SuperHeroDetailActivity`` showing detailed information about a super hero like his or her name, photo and description.
![SuperHeroDetailActivityScreenshot][superHeroDetailActivityScreenshot]
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.
## Tasks
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
1. Fork this repository.
2. Checkout `kata-super-heroes` branch.
3. Execute the application, explore it manually and make yourself familiar with the code.
4. Execute `MainActivityTest` and watch the only test it contains pass.
* To help you get started, these are some test cases for `MainActivity`:
1. Setup mocked `SuperHeroesRepository` in `MainActivityTest` to return a list of some Super Heroes.
2. Test that RecyclerView is listing the correct number of elements when `SuperHeroesRepository` returns a list of some Super Heroes.
3. Test that each of this elements contains the correct Super Hero name.
## Considerations
* If you get stuck, `Master` branch contains already solved tests for `MainActivity` and `SuperHeroDetailActivity`
* A [DaggerMockRule][daggermock] is an utility to let you create [Dagger 2][dagger2] 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
```java
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.
## Extra Tasks
If you've covered all the application functionality using UI tests try to continue with the following tasks:
* Add a pull to refresh mechanism to ``MainActivity`` and test it.
* Modify ``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.
* Modify the project to handle connection errors and show a ``SnackBar`` to indicate something wExcerpt of 6,540 characters
Read on GitHub90
9
Olmo Gallegos · Domestika
8
7
Sergio Gutiérrez · Antropia Studio · Spain
3
3
1
1
Would you bet a product on this? Bounded 0–100 and slow moving.
matched fp:42250282675b1342, topic:training
matched fp:42250282675b1342, topic:testing