Giter Site home page Giter Site logo

palttuk / katasuperheroesios Goto Github PK

View Code? Open in Web Editor NEW

This project forked from karumi/katasuperheroesios

0.0 2.0 0.0 5.45 MB

Super heroes kata for iOS Developers. The main goal is to practice UI Testing.

License: Apache License 2.0

Swift 99.11% Ruby 0.89%

katasuperheroesios's Introduction

Karumi logo KataSuperHeroes for iOS. Build Status

  • 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.

Getting started

This repository contains an iOS application written in Swift to show Super Heroes information:

ApplicationScreencast

This Application is based on two ViewControllers:

  • SuperHeroesViewController showing a list of super heroes with name, photo and a special badge if is part of the Avengers Team.

SuperHeroesViewControllerScreenshot

  • SuperHeroDetailViewController showing detailed information for a super hero like the name, photo and description.

SuperHeroDetailViewControllerScreenshot

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.

Tasks

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:

  • Before starting

    1. Fork this repository.
    2. Checkout kata-super-heroes branch.
    3. Run pod repo update
    4. Run pod install
    5. Open KataSuperHeroes.xcworkspace
    6. Execute the application, explore it manually and make yourself familiar with the code.
    7. Execute SuperHeroesViewControllerTests and watch the only test it contains pass.
  • To help you get started, these are some test cases for SuperHeroesViewControllerTests:

    1. Setup mocked SuperHeroesRepository in SuperHeroesViewControllerTests to return a list of some Super Heroes.
    2. Test that TableView 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 SuperHeroesViewControllerTests and SuperHeroViewControllerTests

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 SuperHeroesViewController and test it.
  • Modify SuperHeroDetailViewController to 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.

Documentation

There are some links which can be useful to finish these tasks:

Data provided by Marvel. © 2016 MARVEL

#License

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.

katasuperheroesios's People

Contributors

addrev avatar dagio avatar pedrovgs avatar serchinastico avatar untalfranfernandez avatar

Watchers

 avatar  avatar

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.