README.md in xcfit-2.0.9 vs README.md in xcfit-2.1.0
- old
+ new
@@ -3,79 +3,87 @@
[![License](https://img.shields.io/cocoapods/l/XCFit.svg?style=flat)](http://cocoapods.org/pods/XCFit)
[![Platform](https://img.shields.io/cocoapods/p/XCFit.svg?style=flat)](http://cocoapods.org/pods/XCFit)
# XCFit : Full Stack BDD in Xcode
-**XCFit a.k.a ([XCUI](https://developer.apple.com/videos/play/wwdc2015/406/0), [Cucumberish](https://github.com/Ahmed-Ali/Cucumberish) and [Fitnesse](https://github.com/paulstringer/OCSlimProject) Integrations Tests) is a full stack Xcode BDD framework for [Swift](https://swift.org) iOS and macOS apps. XCFit allows us to write API level, UI and Acceptance Tests with Swift in human readable language using tools like [Cucumber](https://cucumber.io/) and [Fitnesse](http://fitnesse.org/) in Xcode. We can still use Apple's brand new UI Testing framework (XCUI) under the hood of Cucumberish. XCFit is fully automated solution for Cucumberish and Fitnesse. You can use 80(Fitnesse):20(Cucumberish) formula to automate Acceptance and UI Testing for better coverage and faster feedback. XCFit is available on [Homebrew](http://brew.sh), [RubyGem](https://rubygems.org/gems/xcfit), [CocoaPods](http://cocoadocs.org/docsets/XCFit) and Swift Package Manager.**
+**XCFit a.k.a ([XCUI](https://developer.apple.com/videos/play/wwdc2015/406/0), [Cucumberish](https://github.com/Ahmed-Ali/Cucumberish) and [Fitnesse](https://github.com/paulstringer/OCSlimProject) Integrations Tests) is a full stack Xcode BDD framework for [Swift](https://swift.org) iOS apps. XCFit allows us to write BDD Style API/Contract level, UI and Acceptance Tests with Swift in human readable language using tools like [Cucumber](https://cucumber.io/) and [Fitnesse](http://fitnesse.org/) in Xcode. We can still use Apple's brand new UI Testing framework (XCUI) under the hood of XCFit and Cucumberish. XCFit is fully automated solution for Cucumberish and Fitnesse. You can use 80(Fitnesse):20(Cucumberish) formula to automate Acceptance and UI Testing for better coverage and faster feedback. XCFit is available on [Homebrew](http://brew.sh), [RubyGem](https://rubygems.org/gems/xcfit), [CocoaPods](http://cocoadocs.org/docsets/XCFit), Carthage and Swift Package Manager.**
### XCFit
* [XCFit : Full Stack BDD in Xcode](#xcfit--full-stack-bdd-in-xcode)
* [XCFit Features](#xcfit-features)
* [Tech & Software Requirements](#tech--software-requirements)
* [Installation](#installation)
* [Setup Xcode Templates](#setup-xcode-templates)
+ * [XCFit Swift Framework](#xcfit-swift-framework--xcui-page-object-pattern--pre-defined-steps)
* [Setting Cucumberish BDD Scenarios in Xcode](#setting-cucumberish-bdd-scenarios-in-xcode)
- * [XCUI Page Object Pattern](#xcui-page-object-pattern)
* [Fitnesse for iOS: Acceptance/Contract Tests](#fitnesse-for-ios-acceptancecontract-tests)
- * [Continuous Integration Fastlane](#continuous-integration--fastlane)
+ * [Continuous Integration with Xcode Server](#continuous-integration-with-xcode-server)
* [XCFit: Swift Package Manager](#xcfit-swift-package-manager)
* [Quick Demo with Example App](#quick-demo-with-example-app)
* [Acknowledgements](#acknowledgements)
* [Author](#author)
* [TODO](#todo)
* [LICENSE](#license)
* [Contributing](#contributing)
# XCFit Features
***
- - You can now write Given When Then (Gherkin) and Decision Table in Xcode. In Short, you can do BDD in Xcode for your iOS app.
+ - 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.
- You can now write/Execute all your Acceptance Tests and UI Tests using Apple's brand new programming language "Swift" in Xcode. Goodbye Appium, Calabash, Frank, KIF and Goodbye Ruby,Java, Python. It's pure Swift !!
- - XCFit provides automated Xcode Target Templates for Cucumberish, Fitnesse and Page Object Pattern(XCUI) targets which reduce hectic Xcode configuration steps. It also arrange code in Xcode groups. All happens in one command
- - XCFit will setup test frameworks within a minute and works for Xcode 8 and Xcode 7.
+ - XCFit provides automated Xcode Target Templates for 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 Template with skeleton code and provide BDD Style Steps with Swift Framework which is available on Cocoapods, Carthage and Swift Package Manager.
- ### XCFIT allows follwing frameworks
- * **Cucumberish BDD Framework**
+ ### XCFIT Templates & Related Frameworks
+
+ * **XCFit Swift Framework with Pre-defined BDD Steps and Page Object Pattern Templates**
- XCFit setup [Cucumber](https://cucumber.io) style BDD framework with "[Cucumberish](https://github.com/Ahmed-Ali/Cucumberish) UI Test Bundle' Templates
- * **Page Object Pattern for XCUI Test framework from Apple**
+ XCFit setup [Page Object Pattern](http://martinfowler.com/bliki/PageObject.html) for Apple's [XCUI Test](https://developer.apple.com/videos/play/wwdc2015/406/) using 'XCUI POM Test Bundle' Templates. We can get pre-defined BDD steps by using XCFit Swift Framework from [CocoaPods](http://cocoadocs.org/docsets/XCFit), Carthage and Swift Package Manager.
+
+ * **Cucumberish BDD Framework and Cucucmber Style Xcode Templates**
- XCFit setup [Page Object Pattern](http://martinfowler.com/bliki/PageObject.html) for Apple's [XCUI Test](https://developer.apple.com/videos/play/wwdc2015/406/) using 'XCUI POM Test Bundle' Templates
+ XCFit setup [Cucumber](https://cucumber.io) style BDD framework with "[Cucumberish](https://github.com/Ahmed-Ali/Cucumberish) UI Test Bundle' Templates.
* **Fitnesse Acceptance Tests for iOS using OCSlim Project**
XCFit allows us to setup [Fitnesse](http://fitnesse.org/) style decision table test framework with [OCSlimProject](https://github.com/paulstringer/OCSlimProject) using 'Acceptance Tests Bundle' templates.
-### XCFit Available on
+### Where to get XCFit
-* **CocoaPods** -- [XCFit-CocoaPods](http://cocoadocs.org/docsets/XCFit) : BDD Style scenarios for iOS App
+##### XCFit Swift Framework
-* **Homebrew** - Just do `brew tap shashikant86/homebrew-taps` and `brew install xcfit`
+* **CocoaPods** -- [XCFit-CocoaPods](http://cocoadocs.org/docsets/XCFit) : XCFit Swift Frameworks and BDD Style predefined steps for the iOS App.
+* **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.
-* **RubyGems** -- [xcfit-RubyGem](https://rubygems.org/gems/xcfit) : Automated Xcode Templates
+##### XCFit Templates
-* **Swift Package Manager** : 2.0.0 : XCUI Test Framework Helpers
+* **Homebrew** - We can tap 'shashikant86/homebrew-taps' and Install XCFit to download Xcode Templates
+* **RubyGems** -- [xcfit-RubyGem](https://rubygems.org/gems/xcfit) to get automated Xcode Templates
+
+
# Tech & Software Requirements
XCFit uses a number of open source projects to work properly. You need to have following
**Hardware**
-You must have Mac Operating System with OSX/MacOS version > 10.9
+You must have Mac Operating System with OSX/MacOS Sierra.
**Software**
-* **[Ruby](https://www.ruby-lang.org/en/)**
- - Use [RVM](https://rvm.io/) for GEM management. Ideally Ruby > 2.X. You can use system Ruby with sudo
-* **[Xcode8](https://developer.apple.com/xcode/)**
+
+* **[Xcode 8.3](https://developer.apple.com/xcode/)**
- Ideally Xcode 8 but works on Xcode 7 as well.
-* **[RubyGems](https://rubygems.org/)**
- - RubyGem with [Cocoapods](https://cocoapods.org/) installed
+* **[Swift 3.1](https://swift.org/download/)**
+ - Use Swift 3.1-dev snapshot and toolchain.
+* **[Ruby](https://www.ruby-lang.org/en/)**
+ - Use [RVM](https://rvm.io/) for GEM management. Ideally Ruby > 2.X. You can use system Ruby with sudo
* **[Curl on Mac](https://developer.apple.com/legacy/library/documentation/Darwin/Reference/ManPages/man1/curl.1.html)**
- Might be pre-installed but worth double checking.
* **[Homebrew](http://brew.sh)**
* **[iOS-Sim](https://www.npmjs.com/package/ios-sim)**
- Node Package required to launch iOS app for Fitnesse Acceptance tests.
@@ -86,57 +94,46 @@
---
# Installation
-XCFit can be installed using [Homebrew](http://brew.sh) or using [RubyGems](https://rubygems.org/) but it's strongly recommended to install it using Homebrew.
+XCFit installtion has two steps.
-## Install with HomeBrew
+* **Xcode Template Installtion**
+This will install Xcode Templates with skeloton code to support BDD in iOS app. The templates are XCUI Page Object Templates, Cucumberish BDD Templated and OCSlim Fitnesse Templates. The templates can be installed with [xcfit-RubyGem](https://rubygems.org/gems/xcfit) or [Homebrew](http://brew.sh).
+
+* **Framework Installtion**
+
+XCFit Swift Framework provided pre-defined BDD Style steps with XCUI and supporting Frameworks like Cucumberish and OCSlim used to write BDD Steps. XCFit Swift Framework is available on [XCFit-CocoaPods](http://cocoadocs.org/docsets/XCFit), Carthage and Swift Package manager. Cucumberish](https://github.com/Ahmed-Ali/Cucumberish) and [OCSlimProject](https://github.com/paulstringer/OCSlimProject) are available on Cocoapods.
+
+XCFit can be installed using [Homebrew](http://brew.sh) or using [RubyGems](https://rubygems.org/).
+
+## Template Installtion
+
+XCFit templates can be installed using Homebrew or Rubygem.
+### Homebrew Installtion
Assuming you have already installed [Homebrew](http://brew.sh). Let's tap the formula
brew tap shashikant86/homebrew-taps
Now, we can install XCFit brew package using
brew install xcfit
-This is recommended method to install `XCFit` over the Rubygem mentioned below.
+This will download XCFit templates.
-## Install XCFit Gem
+### XCFit RubyGem Installtion
If you can't use HomeBrew for some reason then XCFit can be installed using [RubyGems](https://rubygems.org/). This will set our Xcode for BDD
$ 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 Templated for Xcode 8 as well Xcode 7
+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.
-# XCFit Commands
+You can choose any of the above method. Rubygems method is prefered.
-Once you installed XCFit with HomeBrew/Rubygem then you can execute 'xcfit' command from your terminal/iTerm etc etc. Example Output Looks like this :
-```
-$xcfit
-setup_xcode_templates:
- generate a Xcode 8 Templates for the Cucumberish and Fitnesse
- setup_xcode7_templates:
- generate a Xcode 7.x Templates. Please upgrade to Xcode 8
- setup_gherkin:
- generate Xcode Templates for the Gherkin Feature Files
- get_cucumberish:
- Downloads Cucumberish version
- version:
- prints the XCFit version
- help:
- prints more detailed help information.
-```
-
-
-## Install XCFit Cocoapod and Swift Package (Covered later)
-
-Later, we need to install [XCFit](http://cocoadocs.org/docsets/XCFit) from CocoaPods to enable Cucumberish and Fitnesse test. We can also get XCFit from Swift Package Manager if we need to have additional helpers for the XCUI test framework.
-Swift Packages only supports other Swift Packages.
-
---
# Setup Xcode Templates
In existing app or brand new app, we have to enable the Xcode templates for targets to speed up the things.
@@ -154,12 +151,140 @@
You will see new option for iOS i.e 'XCFit'. Once Clicked on it. You will see Cucumberish UI and Fitnesse Acceptance Tests. XCUI POM, Fitnesse Acceptance Unit Test bundles. As shown
![image](https://github.com/Shashikant86/XCFit-GIFS/blob/master/Xcode8-Templates.png)
+## Framework Installtion
+
+XCFit, Cucumberish or OCSlimProject Framework can be installed using Cocoapods. XCFit and Cuucmberish can be installed using Carthage as well but we will use Cocoapods as it's more automated than Carthage. We can create `Podfile` and add specific dependency for the target
+
+```ruby
+ target '$_YOUR__TARGET' do
+ pod 'XCFit'
+ end
+```
+Same way we can get 'Cucumberish' and 'OCSlim' for the specific target.
+
+```sh
+$ pod install
+```
+
+You need to close the existing Xcode session and Xcode Workspace .xcworkspace next time.
+
+
---
+# XCFit Swift Framework : XCUI Page Object Pattern + Pre-Defined Steps
+XCFit templates gives an option to use very polular [Page Object Pattern](http://martinfowler.com/bliki/PageObject.html) with Apple's Xcode UI Testing framework. You can install templates and start using the code straight way, no need to use framework unless you want to use pre-defined BDD style tests.
+
+
+## Setup 'XCUI POM Test bundle' Target
+
+- From Xcode, create a new app(Or use existing app) and selct File ---> New ----> Target
+
+- Now Select 'XCFit' for iOS app and Click on 'XCUI POM Test Bundle'
+
+- Once Clicked on the target e.g 'XCUI POM Test Bundle' Xcode will create UI testing target with properly structured Xcode Groups and required files. You can then make physical directories on Disk Or change the folder/group structure as per your need.
+
+- You don't have to so any setting to run those demo XCUI tests. Just CMD+U and You are good to go !
+
+![image](https://github.com/Shashikant86/xcfitgif/blob/master/XCFitPOM_Templates.gif)
+
+### What's in the XCUI POM Template ?
+
+* **YOUR_CUCUMBERISH_TARGETPageObjectTests.swift**
+
+This file is at the base of the target. It's exactly same file that Apple's XCUI Test generate at first. You may use it for recording the tests or simply delete it if not needed.
+
+* **Screens**
+
+This is groups where we can abstract logic of every screen in the app. Example file are 'HomeScreen.swift' and 'BaseScreen.swift' This assumes that your apps is made up of multiple screens. You can write individual screen class which extend BaseScreen. All the functionality related to screen can be included in this class.
+
+
+* **Tests**
+
+This group has all the test for our app. Currently demo template has two tests 'HomeScreenTest.swift' and 'ProtocolOrientedTest.swift'. This examples shows how XCUI test can be implemented in the Object Orinted way and Protocol oriented way.
+
+* **TestBase**
+
+Testbase is group where we can abstract all setup, teardown and common stuff in the base class. Every Screen then use this class as base. You can add more stuff as needed e.g Fixtures, Launch Arguments
+
+## Getting XCFit Framework for pre-defined BDD Style steps
+
+### Cocoapods
+You can get XCFit Framework eaily. Create `Podfile` and add specific dependency for the target
+
+```ruby
+ target '$_YOUR__TARGET' do
+ pod 'XCFit'
+ end
+```
+Same way we can get 'Cucumberish' and 'OCSlim' for the specific target.
+
+```sh
+$ pod install
+```
+Close existing Xcode Session and Open `.xcworkspace/`. Now in the 'testBase' class just `import XCFit` and extend the class to `XCFit` class. The predefined steps are ready to use.
+
+![image](https://github.com/Shashikant86/xcfitgif/blob/master/Pod_install_XCFit.gif)
+
+### Carthage
+
+If you are using Carthage then it's easy to install XCFit. Add following to `Cartfile`
+
+ github "Shashikant86/XCFit"
+
+Now fetch dependency and build XCFit using.
+
+ $ carthage update --platform iOS
+ This will create 'Carthage' directory with built framework. We need to manually drag and drop this to our XCUIPoMTest' target build settings. On your application targets’ “General” settings tab, in the “Linked Frameworks and Libraries” section, drag and drop each framework you want to use from the Carthage/Build folder on disk. On your application targets’ “Build Phases” settings tab, click the “+” icon and choose “New Run Script Phase”. Create a Run Script in which you specify your shell (ex: bin/sh), add the following contents to the script area below the shell:
+
+ /usr/local/bin/carthage copy-frameworks
+and add the paths to the frameworks you want to use under “Input Files”, e.g.:
+
+ $(SRCROOT)/Carthage/Build/iOS/XCFit.framework
+
+Here is Carthage looks like
+![image](https://github.com/Shashikant86/xcfitgif/blob/master/XCFit_Carthage.gif)
+
+You can choose any of the above method but Cocoapods is easy and less manual.
+
+### Import XCFit & Use Predefined Steps
+
+There are some predefined XCFit steps we can use by importing `XCFit` and extending out test base class to `XCFit`. Your test will read something like this:
+
+```
+import XCTest
+import XCFit
+
+class XCFitTests: XCFit {
+ override func setUp() {
+ super.setUp()
+ continueAfterFailure = false
+ XCUIApplication().launch()
+ }
+ override func tearDown() {
+ super.tearDown()
+ }
+
+ func testCheckAlertPresent() {
+ givenILaunchedApplication()
+ whenITap(on: HomeScreen().homeButtuon)
+ thenIShouldSeeAnAlert()
+ }
+}
+
+
+```
+
+
+You will get access to lots of predefined BDD style human redable steps. It's not mandatory to use those steps unless you wish.
+![image](https://github.com/Shashikant86/xcfitgif/blob/master/pre-defined_xcfit_steps.gif)
+
+
+---
+
# Setting Cucumberish BDD Scenarios in Xcode
## Setup 'iOS UI Cucumberish Test Bundle' Target
- From Xcode, create a new app(Or use existing app) and selct File ---> New ----> Target
@@ -167,12 +292,10 @@
- Now Select 'XCFit' for iOS app and Click on 'Cucumberish UI Test Bundle'
- Once Clicked on the target e.g 'Cucumberish UI Test Bundle' Xcode will create UI testing target with all the required files with Bridging header for Cucumberish UI Testing. It create Page Object Pattern with all required files with screens, steps definitions and Cucumberish initialiser swift file.
-![image](https://github.com/Shashikant86/XCFit-GIFS/blob/master/XCFit_CucumberishTemplates.gif)
-
### What's in the Cucumberish Template ?
* **YOUR_CUCUMBERISH_TARGET.swift**
This file is at the base of the target. This initiate Cucumberish for project. We need to register all step definitions in this file.
@@ -213,138 +336,47 @@
- Now Drag and Drop 'Features' directory to Xcode Cucumberish target
- Select only '**Create folder references**' Option. ** Do Not Select 'Create groups' Or 'Copy items if needed**'
-Here is how to do it.
-![image](https://github.com/Shashikant86/XCFit-GIFS/blob/master/AddFeaturesDirectory.gif)
-* **Cucumberish Header Files**
-
-We still don't have content of [Cucumberish](https://github.com/Ahmed-Ali/Cucumberish/tree/master/Cucumberish) to be included in our project.
-
### Getting Cucumberish CocoaPod into our Target
In order to get [Cucumberish](https://github.com/Ahmed-Ali/Cucumberish/tree/master/Cucumberish) source content. There are few ways we can do that
- **Cocoapods**
Create a 'Podfile' if you don't have already. In your Podfile, add following Pod entry and update/install pod
```ruby
target '$_YOUR_CUCUMBERISH_TARGET' do
- pod 'XCFit'
+ pod 'Cucumberish'
end
```
-
```sh
$ pod install
```
- You can do that easily.
-![image](https://github.com/Shashikant86/XCFit-GIFS/blob/master/AddPod.gif)
-Now close the existing Xcode session and Xcode Workspace next time.
+Now close the existing Xcode session and Xcode Workspace `.xcworkspace` next time.
-
-- **Manual Installtion (not recommended use CocoaPods instaed )**
-
-We can manually copy content of [Cucumberish](https://github.com/Ahmed-Ali/Cucumberish/tree/master/Cucumberish) directory and drag to target as with option "**Create groups" and "Copy items if needed**".
-
-Here is How to setup everything in a minute
-
-![image](https://github.com/Shashikant86/XCFit-GIFS/blob/master/XCFitStartUp.gif)
-
-
We now have everything we needed to run demo Cucumber demo test. Update Scheme if don't want to run unit test or other type of tests.
and press 'CMD+U'
-![image](https://github.com/Shashikant86/XCFit-GIFS/blob/master/CucumberTest.gif)
+![image](https://github.com/Shashikant86/xcfitgif/blob/master/cucumberish_template.gif)
Congratulations !! You have just ran your first Cucumber BDD Scenario in the Xcode. Now add your own :)
#### Create Separate Scheme if needed
XCFit adds 'Cucumberish' target to existing Scheme. You can remove that target and run separate scheme to keep it independent from Unit tests. Make sure you make the new scheme executable for Running.
---
-# XCUI Page Object Pattern and Pre-Defined Steps
-Now, we have seen that it's failrly easy to setup BDD Style tests with Cucumberish but some people don't want that overhead of adding extra layer of Gherkin. XCFit gives an option to use very polular [Page Object Pattern](http://martinfowler.com/bliki/PageObject.html) with Apple's Xcode UI Testing framework.
-
-## Setup 'XCUI POM Test bundle' Target
-
-- From Xcode, create a new app(Or use existing app) and selct File ---> New ----> Target
-
-- Now Select 'XCFit' for iOS app and Click on 'XCUI POM Test Bundle'
-
-- Once Clicked on the target e.g 'XCUI POM Test Bundle' Xcode will create UI testing target with properly structured Xcode Groups and required files. You can then make physical directories on Disk Or change the folder/group structure as per your need.
-
-- You don't have to so any setting to run those demo XCUI tests. Just CMD+U and You are good to go !
-
-
-![image](https://github.com/Shashikant86/XCFit-GIFS/blob/master/XCUIPOM.gif)
-
-### What's in the XCUI POM Template ?
-
-* **YOUR_CUCUMBERISH_TARGETPageObjectTests.swift**
-
-This file is at the base of the target. It's exactly same file that Apple's XCUI Test generate at first. You may use it for recording the tests or simply delete it if not needed.
-
-* **Screens**
-
-This is groups where we can abstract logic of every screen in the app. Example file are 'HomeScreen.swift' and 'BaseScreen.swift' This assumes that your apps is made up of multiple screens. You can write individual screen class which extend BaseScreen. All the functionality related to screen can be included in this class.
-
-* **Sections**
-
-This group has 'HomeElements.swift' class which stores all the locators of HomeScreen in enums. Sections are defined to store locators of the screen in the form of enums. Here are some samples we can store Images, Buttons and Static Texts of the HomeScreens. We can access those enums from anywhere from the Test methods or page objects.
-
-* **Protocols**
-
-Swift is protocol oriented language so feel to start with Protocol per screen. This group has 'HomeProtocol.swift' file where there is way to implement protocol oriented testing. Here is example of sample protocol for the homescreen. We can implement this protocol in the XCTest method as needed or we can write some extensions to support Testing.
-
-* **Tests**
-
-This group has all the test for our app. Currently demo template has two tests 'HomeScreenTest.swift' and 'ProtocolOrientedTest.swift'. This examples shows how XCUI test can be implemented in the Object Orinted way and Protocol oriented way.
-
-* **TestBase**
-
-Testbase is group where we can abstract all setup, teardown and common stuff in the base class. Every Screen then use this class as base. You can add more stuff as needed e.g Fixtures, Launch Arguments
-
-## Using Predefined XCFit BDD Style Steps
-
-There are some predefined XCFit steps we can use by importing `XCFit` and extending out test class to `XCFit`.
-
- import XCTest
- import XCFit
-
- class XCFitTests: XCFit {
- override func setUp() {
- super.setUp()
- continueAfterFailure = false
- XCUIApplication().launch()
- }
- override func tearDown() {
- super.tearDown()
- }
-
- func testExample() {
- givenILaunchedApplication()
- whenITap(on: HomeScreen().crappyButtuon)
- thenIShouldSeeAnAlert()
- }
- }
-`
-
-You will get access to lots of predefined BDD style human redable steps. It's not mandatory to use those ste it
-
-
----
-
# Fitnesse for iOS: Acceptance/Contract Tests
[Fitnesse](http://fitnesse.org/) is fully integrated standalone wiki and acceptance testing framework for BDD Style testing. As of now we have seen Cucumber and Page Object pattern test frameworks. If you really wanted to get more information about Fitnnese for iOS, please follow documentation on [OCSlim](http://paulstringer.github.io/OCSlimProject/) project. XCFit adopted the framework as dependeny to make it full stack BDD. We will cover basic setup as part of this document.
## Setup 'Acceptance Test' Target template
@@ -429,67 +461,14 @@
Now we can see that FitNesse tests are running as shown above. We can add this to main scheme to make sure we are running it after the unit tests to follow proper development workflow. We can build and run it as our normal unit tests.
-# Continuous Integration + Fastlane
+# Continuous Integration with Xcode Server
-Now that , we have seen how to run Cucumberish, XCUIPOM, FitNesse acceptance tests from Xcode but it’s a good idea to run it with Fastlane. We can also take control of version of Cocoapods and Fastlane by using Bundler. Let’s create a Gemfile at the root of the project with the following gem
+Coming Soon
-```ruby
-source "https://rubygems.org"
-gem 'cocoapods'
-gem 'fastlane' plugins_path = File.join(File.dirname(__FILE__), '.', 'Pluginfile') eval(File.read(plugins_path), binding) if File.exist?(plugins_path
-```
-
-Let’s also create directory “fastlane” and make “Fastfile” with following content
-
-```ruby
-
-fastlane_version "1.104.0"
-default_platform :ios
-platform :ios do
-before_all do
- system "rm -rf ../test_reports/"
- system "bundle install"
- system "pod install"
- system "bundle exec fastlane add_plugin trainer"
-end
-desc "Runs all the XCUI POM, Cucumberish tests"
- lane :xcfit_ui_test do
- scan(
- scheme: "XCFit2Demo",
- destination: 'platform=iOS Simulator,name=iPhone 7 Plus,OS=10.0',
- output_directory: "test_reports/",
- output_types: "html",
- fail_build: false
- )
- end
-
- desc "Runs Fitnesse Tests"
- lane :fitnesse do
- scan(
- scheme: "AcceptanceUnitTests",
- destination: 'platform=iOS Simulator,name=iPhone 7 Plus,OS=10.0',
- output_directory: "test_reports/",
- output_types: "html",
- fail_build: false
- )
- end
-end
-```
-
-After running “bundle install” we should be able to run those test from command line like this :
-
- $ bundle exec fastlane xcfit_ui_test
-
-
-![image](https://github.com/Shashikant86/XCFit-GIFS/blob/master/FastlaneXCFit.gif)
-
-Once that done. We can have clear HTML reports genearted
-
-
# XCFit: Swift Package Manager
XCFit will be having full on support for XCUI Test helpers so that we can use Apple's XCUI Test Framework painless to use. There is [sample swift package](https://github.com/Shashikant86/XCFitDemoSwiftPackage) on Github to test XCFit
Full Documetation and API implementation still in progress. You can grab it like this
@@ -497,10 +476,10 @@
import PackageDescription
let package = Package(
name: "XCFit",
dependencies: [
- .Package(url: "https://github.com/Shashikant86/XCFit.git", majorVersion: 2),
+ .Package(url: "https://github.com/Shashikant86/XCFit.git", majorVersion: 4.0.0),
]
)
```