README.md in xcfit-4.0.7 vs README.md in xcfit-4.0.8

- old
+ new

@@ -149,16 +149,11 @@ $ xcfit setup_xcode_templates ``` -To Setup Fitnesse Templates (Optional) -``` -$ xcfit setup_fitnesse_templates -``` - - This will add couple of templates to your Xcode for iOS and macOS 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 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) @@ -220,11 +215,11 @@ Now, we can fetch and build Carthage Dependencies using following command. $ carthage update --platform iOS -This will checkout and build XCFit and Cucumberish frameworks then we can manaully drag those frameworks in the `Build Phases` of the test targets. This is explained in details in the later section. +This will checkout and build XCFit frameworks then we can manually drag those frameworks in the `Build Phases` of the test targets. This is explained in details in the later section. ### Swift Package Manager XCFit can be installed with Swift Package Manager however Swift Package Manager isn't officially supported for iOS so we can use XCFit only for the standalone Libraries. We need to create `Package.swift` file with following content. ``` @@ -244,20 +239,56 @@ We can build, test package using the commnds avavilable for the Swift Package Manager. --- -# XCFit Swift Framework : XCUI Page Object Pattern + Pre-Defined Steps +# XCFit Swift Framework : XCUI Protocol Oriented, Page Object Pattern + Pre-Defined Steps +## Protocol Oriented BDD + +XCFit template supports Protocol Oriented BDD. Swift is a protocol oriented language and wedon't want to miss the point of Protocol, Extensions and Enums. To setup template + +- From Xcode, create a new app(Or use existing app) and selct File ---> New ----> Target + +- Now Select 'XCFit' for iOS app and Click on 'Protocol Oriented BDD Bundle' + +- Once Clicked 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 may want to delete autogenerated UI test from Apple's standard template. + +- You don't have to so any setting to run those demo XCUI tests. Just CMD+U and You are good to go ! + +### What's in the Protocol Oriented BDD Template ? + +* **Feature+Protocol.swift** + +It's your feature will all the requirements which can be written as Acceptance tests + +* **Feature+Extensions.swift** + +It's extension on the Feature where you need to implement step definition in Given When Then format + +* **Feature+Enums.swift** + +All the XCUIElements for that Feature. + +* **YOUR_TARGET_Test.swift** + +This is test where you call Given When Then from Extensions. You can import `XCFit` framework and extend this class 'XCFit' and also confirms to 'Feature' protocol + + + +## Page Object Pattern + 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 +## Setup 'Page Object 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' +- Now Select 'XCFit' for iOS app and Click on 'Page Object 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 may want to delete autogenerated UI test from Apple's standard template. @@ -472,21 +503,10 @@ - **Cocoapods** Create a 'Podfile' if you don't have already. In your Podfile, add following Pod entry and update/install pod -* **Swift 3.0.2** - -Cocoapods is more automated than Carthage. We can create `Podfile` and add specific dependency for the target - -```ruby - target '$_YOUR__TARGET' do - pod 'XCFit', :git => 'https://github.com/Shashikant86/XCFit.git', :tag => '3.0.0' - end -``` -This will doownload Cocoapods supporting Swift 3.0.2 - * **Swift 3.1** You can doenload latest version 4.0.0 to work with Swift 3.1 ```ruby @@ -517,21 +537,14 @@ ### Getting Cucumberish using Carthage Once you have setup XCFit Cucumberish templates, we need to get Cucumberish framework. In order to get [Cucumberish](https://github.com/Ahmed-Ali/Cucumberish/tree/master/Cucumberish) using Carthage, we need to create `Cartfile` with following content -* **Swift 3.0.2** - -Add the following to `Cartfile` to get Swift 3.0.2 compatable source - - github "Shashikant86/XCFit" "3.0.0" - - * **Swift 3.1** -You can get lates tag t work with Swift 3.1 then `Cartfile` can have following +You can get Cucumberish - github "Shashikant86/XCFit" + github "Ahmed-Ali/Cucumberish" Now install, Carthage frameworks using commamnd $ carthage update --platform iOS