- We are here to practice UI Testing.
- We are going to use KIF and Nimble to interact with the Application UI.
- We are going to use manual Dependency Injection to replace production code with Test Doubles.
- We are going to practice pair programming.
This repository contains an iOS application written in Swift to show Super Heroes information:
This Application is based on two ViewControllers:
SuperHeroesViewControllershowing a list of super heroes with name, photo and a special badge if is part of the Avengers Team.
SuperHeroDetailViewControllershowing detailed information for a super hero like the name, photo and description.
The application architecture, dependencies and configuration is ready to just start writing tests. In this project you'll find all the classes ready to be able to replace production code with test doubles easily and KIF to be able to interact with the application user interface. The accessibility labels needed to interact with the UI using KIF are already configured.
Your task as iOS 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:
- Fork this repository.
pod repo update
- Execute the application, explore it manually and make yourself familiar with the code.
SuperHeroesViewControllerTestsand watch the only test it contains pass.
To help you get started, these are some test cases for
- Setup mocked
SuperHeroesViewControllerTeststo return a list of some Super Heroes.
- Test that TableView is listing the correct number of elements when
SuperHeroesRepositoryreturns a list of some Super Heroes.
- Test that each of this elements contains the correct Super Hero name.
- Setup mocked
- If you get stuck,
masterbranch contains already solved tests for
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
SuperHeroesViewControllerand test it.
SuperHeroDetailViewControllerto handle an error case where the name of the super hero used to start this ViewController does not exist and show a message if this happens.
- Modify the project to handle connection errors and show a message to indicate something went wrong.
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
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.