GithubHelp home page GithubHelp logo

uikitcatalog-percy-sample's Introduction

This project demonstrates the use of percy.io on apple sample code application UIKitCatalog.

Steps for adding percy tests:

  1. add a new iOS UI Testing target (swift) Add iOS UI Testing

  2. download and add XCTestCase+percySnapshot.swift to the UI Testing target. You can get the code from: percy-ios-uitest-helpers

  3. write/record UI Test and add percyScreenshot calls (we recommend starting with smaller number of screenshots and extending later)

  4. add Gemfile and percy.rb from percy-ios Gemfile:

    source 'https://rubygems.org'
    
    gem 'percy-ios', github: 'mfazekas/percy-ios'

    percy.rb

    require 'percy/ios'
    raise 'please pass derived-data as first argument' if ARGV[0].nil?
    percy = Percy::IOS.new
    percy.derived_data_dir=ARGV[0]
    percy.upload_screenshots
  5. run bundle install (if you don't have bundler installer you need to execute gem install bundler before)

  6. register to percy.io and make note of your write only api key.

  7. run 'xcodebuild' and percy locally make sure you specify derevedDataPath to xcodebuild. You can run your tests on multiple devices.

    rm -rf ./derived-data ; xcodebuild test -scheme UIKitCatalog -onlyTesting:UIKitCatalogPercyTests -sdk iphonesimulator -destination 'platform=iOS Simulator,name=iPhone 5,OS=10.1' -destination 'platform=iOS Simulator,name=iPad Air,OS=10.1' -derivedDataPath ./derived-data
    PERCY_TOKEN=*** PERCY_PROJECT=mfazekas/UIKitCatalog-percy-sample PERCY_BRANCH=master bundle exec ruby ./percy.rb ./derived-data
  8. Add travis.yml file and configure PERCY_TOKEN and PERCY_PROJECT in travis, and make sure your shceme is set to shared and autocreate:

    language: objective-c
    os: osx
    osx_image: xcode8
    script:
      - xcodebuild test -scheme UIKitCatalog -only-testing:UIKitCatalogPercyTests -sdk iphonesimulator -destination 'platform=iOS Simulator,name=iPhone 5,OS=10.0' -destination 'platform=iOS Simulator,name=iPad Air,OS=10.0' -derivedDataPath ./derived-data
      - bundle exec ruby ./percy.rb ./derived-data

    Travis config

    XCode scheme sharing

Discailmer

The is based on UIKitCatalog sample code from Apple. See LICENSE_original and README_original for information on the sample code itself.

uikitcatalog-percy-sample's People

Contributors

mfazekas avatar

Watchers

 avatar  avatar

Forkers

digideskio

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.