SkillAgentSearch skills...

XCFit

Full Stack Protocol Oriented BDD in Xcode for iOS app with Swift using XCUITest, Cucumberish and FitNesse

Install / Use

/learn @XCTEQ/XCFit
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

XCFit Project Details


Version CocoaPods CocoaPods GitHub release RubyGem Gem License Platform

XCFit Continuous Integration Status


CI Status BuddyBuild BitRise CircleCI

XCFit Author Info


Website Twitter Shashikant86 Twitter Follow

XCFit : Full Stack iOS BDD in Xcode

XCFit a.k.a (XCUI, Cucumberish and Fitnesse Integration Tests) is a full stack Xcode BDD framework for iOS apps written in Swift. XCFit allows us to write BDD Style API/Contract level, UI and Acceptance Tests with Swift in human readable language using tools like Given/When/Then, Cucumber and Fitnesse in Xcode. We can still use Apple's brand new UI Testing framework (XCUI) under the hood of XCFit and Cucumberish. XCFit provides automated Xcode templates to setup skeleton of BDD which are available on Homebrew, RubyGem. XCFit also packaged as Swift Framework to provide pre-defined BDD Steps written in Swift for Protocol Oriented BDD. XCFit Swift framework is available on CocoaPods, Carthage and Swift Package Manager.

Important Note : XCFit does not support macOS application.

XCFit

XCFit Features


  • You can now write Given When Then (Gherkin), Predefined BDD Steps and Decision Table in Xcode. In Short, you can do BDD in Xcode for your iOS app.
  • XCFit is purely in Swift so no need to use other languages like Ruby, Java, Python to write acceptance and UI tests for iOS.
  • XCFit provides automated Xcode Target Templates for Protocol Oriented BDD, Page Object Pattern, Cucumberish, Fitnesse and Page Object Pattern(XCUI) targets which reduce hectic Xcode configuration steps. It also arrange code in Xcode groups.
  • XCFit will setup Xcode Templates with skeleton code and provide BDD Style Steps with Swift Framework which is available on Cocoapods, Carthage and Swift Package Manager.

XCFIT & Other Frameworks

  • XCFit- Xcode Templates and Swift Framework for Protocol Oriented BDD and Paget Objects

XCFit provides templates for Protocol Oriented BDD using 'Protocol BDD Bundle' and Page Object Pattern for Apple's XCUI Test using 'XCUI POM Test Bundle' Templates. We can get pre-defined BDD steps by using XCFit Swift Framework from CocoaPods, Carthage and Swift Package Manager.

  • Cucumberish BDD Framework and Cucucmber Style Xcode Templates(Optional Objective-C)

XCFit setup Cucumber style BDD framework with "Cucumberish UI Test Bundle' Templates.

  • Fitnesse Acceptance Tests for iOS using OCSlim Project (Optional Objective-C)

XCFit allows us to setup Fitnesse style decision table test framework with OCSlimProject using 'Acceptance Tests Bundle' templates.

Where to get XCFit Swift Framework and XCFit Xcode Templates

XCFit Swift Framework

  • CocoaPods -- XCFit-CocoaPods : XCFit Swift Frameworks and BDD Style predefined steps for the iOS App to support Protocol Oriented BDD.
  • Carthage -- You can install XCFit Swift Framework with Carthage as well for iOS Projects
  • Swift Package Manager -- Swift Package Manager doesn't support iOS projects yet but XCFit is compatible with Swift Package manager as well.

XCFit Templates

  • Homebrew - We can tap 'shashikant86/homebrew-taps' and Install XCFit to download Xcode Templates

  • RubyGems -- xcfit-RubyGem to get automated Xcode Templates

The Rubygem method is preferred.

Tech & Software Requirements

XCFit is pure Swift but other libraries like Fitnesse and Cucumberish need some additional softwares.

Hardware

You must have Mac Operating System with OSX/MacOS Sierra or above.

Software

  • Xcode 9
    • XCFit 4 only Supports Xcode 8.3 and above however XCFit 3 can be used with Xcode 8.2
  • Swift 4
    • XCFit currenly support Swift 3.0 and Swift 3.1.
  • Ruby
    • Ruby is required to setup XCFit templates either using Homebrew or Rubygem. Use RVM for GEM management. Ideally Ruby > 2.X. You can use system Ruby with sudo.
  • Curl on Mac
    • Might be pre-installed but worth double checking.
  • Homebrew Optional
  • Fitnesse - Optional : You might need to have iOS-Sim, Java if you want to use Fitnesse.

Installation

XCFit installation has two steps.

  • Xcode Template Installation

This will install Xcode Templates with skeleton code to support BDD in iOS app. The templates are XCUI based Protocol-oriented BDD templates, Page Object Templates, Cucumberish BDD Templates and OCSlim Fitnesse Templates (optional). The templates can be installed with xcfit-RubyGem or Homebrew. You need to select only one method of installtion. The rubygem method is preferred.

  • Framework Installation

XCFit Swift Framework provides pre-defined BDD Style steps with XCUITest to support Protocol-oriented BDD and writing tests using Page Object pattern. The supporting Frameworks like Cucumberish and OCSlim which can be used to write BDD Steps. XCFit Swift Framework is available on XCFit-CocoaPods, Carthage and Swift Package manager. Cucumberish and OCSlimProject are available on Cocoapods.

Template Installation

XCFit templates can be installed using Rubygem.

XCFit RubyGem Installation

If you can't use HomeBrew for some reason then XCFit can be installed using RubyGems. This will set our Xcode with BDD templates for XCFit and Cucumberish

   $ gem install xcfit

You need to use with 'sudo' if you are using system (pre-installed) Ruby(2.0). XCFit gem will be used to set all the Xcode Templates for Xcode.

You can choose any of the above method. Rubygems method is prefered.

Setup Xcode Templates

In existing app or brand new app, we have to enable the Xcode templates for targets to speed up the

Xcode Templates for XCFit

To setup Templates for Xcode 8 for XCUI ptotocol-oriented BDD, Cucumberish target and Gherkin File Type.


$ xcfit setup_xcode_templates


  • This will add couple of templates to your Xcode for iOS apps. In your app if you go to 'File--->New--->Target'

You will see new option for iOS i.e 'XCFit'. Once Clicked on it. You will see Protocol BDD, Cucumberish UI and Fitnesse Acceptance Tests. XCUI POM, Fitnesse Acceptan

Related Skills

View on GitHub
GitHub Stars175
CategoryDevelopment
Updated2mo ago
Forks40

Languages

Swift

Security Score

100/100

Audited on Jan 21, 2026

No findings