xcfit 0.5.0 → 0.6.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 46f3bcfb576a110ac041d8bbdfc7b03224c42382
4
- data.tar.gz: 36bc5f3522849f1755f16e71335ba8780f1676ad
3
+ metadata.gz: f30881977abf77c8e9e21524b7393f6c7b1c11cf
4
+ data.tar.gz: e60b3177ba224728eced945a391691344374f5b3
5
5
  SHA512:
6
- metadata.gz: fed39fbbd59405b9a2dd4878d8970e0d1e045f618e9e92bee41d832a4272d6b09540d83ffabba53054bb997bf323b4286e7785a375eb34d1c585929901e1cdd9
7
- data.tar.gz: e695a460c85fecdd696e72b96dbbbee2311e1b1d782de803819f86137b2c80193c538bc985c7a85b8af1bbd3be206f3a4bf9c8832098d75f2963de8bd97c0521
6
+ metadata.gz: ca7b5c854a71371314d801790712060cb56d2b611c5b14add3572f8537b238f4bc08b62f5cc980a15da0deca423c2d9696ad97d9067d7bdc1b9cabac7c92e4ac
7
+ data.tar.gz: f4849e540b286537c3fe426790b6ab79057b3325492dc853576243f83253c13338cf9b741b3c33cbcd678183e1b6a5a7fe5d8c2c7d6882f7a21822cba46ffc73
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- xcfit (0.4.0)
4
+ xcfit (0.5.0)
5
5
  thor (~> 0.17.0)
6
6
 
7
7
  GEM
data/README.md CHANGED
@@ -1,32 +1,203 @@
1
- # XCFit
2
-
3
- Full Docs Coming Soon ....
4
-
5
1
  [![CI Status](http://img.shields.io/travis/Shashikant86/XCFit.svg?style=flat)](https://travis-ci.org/Shashikant86/XCFit)
6
2
  [![Version](https://img.shields.io/cocoapods/v/XCFit.svg?style=flat)](http://cocoapods.org/pods/XCFit)
7
3
  [![License](https://img.shields.io/cocoapods/l/XCFit.svg?style=flat)](http://cocoapods.org/pods/XCFit)
8
4
  [![Platform](https://img.shields.io/cocoapods/p/XCFit.svg?style=flat)](http://cocoapods.org/pods/XCFit)
9
5
 
10
- ## Example
11
- Coming Soon !
12
- To run the example project, clone the repo, and run `pod install` from the Example directory first.
6
+ # XCFit
7
+
8
+ ######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, UI and Acceptance Tests in human readable language using tools like [Cucumber](https://cucumber.io/) and [Fitnesse](http://fitnesse.org/) in Xcode. XCFit is fully automated solution for Cucumberish and Fitness. XCFit is available on [RubyGem](https://rubygems.org/gems/xcfit) and [CocoaPods](http://cocoadocs.org/docsets/XCFit).
9
+
10
+ ### XCFit Features
11
+ There are few reason you should go for XCFit
12
+ ***
13
+ - You can now write Given When Then and Decision Table in Xcode !! YAY.. Thanks to Cucumberish and OCSlimProject ! And XCFit automated them !!
14
+
15
+ - XCfit provides Xcode Templates to create new Cucumberish and Fitnesse targets which reduce hectic Xcode configuration steps. It's all automated in XCfit
16
+ - One command to set all fully automated Xcode template for Cucumberish and Fitnesse targets
17
+ - New Template to create Gherkin Feature file in Xcode
18
+ - Automated almost all [Cucumberish](https://github.com/Ahmed-Ali/Cucumberish) Setup in one command
19
+ - Enhanced OCSlimProject (https://github.com/paulstringer/OCSlimProject) templates and automated Fitnesse download process.
20
+ - XCFit target templates are independent of native Xcode Test targets.
21
+ - Its native Xcode implementation, No Appium, Calabash etc etc
22
+ - Setup Cucumberish and Fitnesse in Xcode within few minutes !!
23
+
24
+ ***
25
+
26
+ Big Thanks to
27
+ - [Cucumberish](https://github.com/Ahmed-Ali/Cucumberish) : Provide native [Gherkin](https://github.com/cucumber/cucumber/wiki/Gherkin) parser for iOS Apps to enable BDD in Xcode using Given When Then. Yay!
28
+ - [OCSlimProject](https://github.com/paulstringer/OCSlimProject) : Provide Xcode Templates to enable BDD with Decision Tables using Fitnesse
29
+
30
+ XCFit automated configuration of these two guys.
31
+
32
+ ### Version
33
+ CocoaPods -- [XCFit-CocoaPods](http://cocoadocs.org/docsets/XCFit) : TBD
13
34
 
14
- ## Requirements
35
+ RubyGems -- [xcfit-RubyGem](https://rubygems.org/gems/xcfit) : TBD
15
36
 
16
- ## Installation
37
+ ### Tech & Software Requirements
17
38
 
18
- Comming Soon !
39
+ XCFit uses a number of open source projects to work properly. You need to have following
40
+
41
+ Hardware : You must have Mac Operating System with OSX/MacOS version > 10.9
42
+
43
+ Software:
44
+ * [Ruby](https://www.ruby-lang.org/en/) - Use [RVM](https://rvm.io/) for GEM management. Ideally Ruby > 2.X
45
+ * [Xcode](https://developer.apple.com/xcode/) - Ideally Xcode 7.X
46
+ * [RubyGems](https://rubygems.org/) - RubyGem with [Cocoapods](https://cocoapods.org/) installed
47
+ * [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.
48
+
49
+
50
+ ### Installation
51
+
52
+ XCFit requires [RubyGems](https://rubygems.org/) to run.
53
+
54
+ You need Gulp installed globally:
55
+
56
+
57
+ $ gem install xcfit
58
+
59
+ Now you are good to get started with XCFit for now. Later we also need to install XCFit Pod.
60
+
61
+ # Usage
62
+ Now that you can execute 'xcfit' command from your terminal/iTerm etc etc. Example Output Looks like this :
63
+
64
+ ```
65
+ $ xcfit
66
+ Tasks:
67
+ xcfit get_cucumberish VERSION # Downloads Cucumberish version and Create Features directory. You must execute this from Cucumberish Xcode Target directory
68
+ xcfit get_fitnesse # Download Fitnesse JAR file from Internet. You must execute this from Xcode Fitnesse Acceptance Test Xcode Target directory
69
+ xcfit help [TASK] # Describe available tasks or one specific task
70
+ xcfit set_xcode_templates # Generate All Xcode Templates for the Gherkin Feature Files & targets for Cucumberish and Fitnesse
71
+ xcfit version # Get the current version number
72
+
73
+ ```
74
+
75
+ ## Setup Xcode Templates
76
+
77
+ In existing app or brand new app, we have to enable the Xcode templates for files and targets to speed up the things. Run following command from your termonal
78
+
79
+
80
+ ```sh
81
+ $ xcfit set_xcode_templates
82
+
83
+ ```
84
+
85
+ - This will add couple of templates to your Xcode for iOS and macOS apps. In your app if you go to 'File--->New--->Target'
86
+
87
+ You will see new option for iOS and OSX i.e 'XCFit'. Once Clicked on it. You will see Cucumberish API, Cucumberish UI and Fitnesse Acceptance Tests targets. As shown
88
+
89
+
90
+
91
+ - Once Clicked on the target e.g 'Cucumberish UI Test Bundle' Xcode will create UI testing target with all the required files with Bridging hrader for Cucumberish UI Testing.
92
+ Once Clicked on the target e.g 'Fitnesse Acceptance Test Bundle' Xcode will create UI tAcceptance test with all the required files with Bridging headers for the Fitnesse Acceptance Test. We will see that in details soon.
93
+
94
+ - This script also set new file type in Xcode to create new Gherking feature file
95
+
96
+ ## Setting up Cucumberish UI Target
97
+
98
+ 3 Steps to setup Cucumberish. You don't need to use Cocoapods to setup this target.
99
+
100
+
101
+ - Add new target iOS/macOS project and Select "File -> New -> Target -> XCFit -> Cucumberish UI Test Bundle". Give it a name you like e.g CucumberishUITests
102
+
103
+ Now that Xcode has created brand new target with all required Swift and Objective-C files to run Cucumberish. All Xcode setting has been done by the Xcode Template. Don't worry about configuting anything.
104
+
105
+
106
+ - Now that you have to CD into the Cucumberish target directory .eg CucumberishUITests
107
+
108
+ ```sh
109
+ $ cd $CUCUMBERISH_TARGET_DIR
110
+ $ xcfit get_cucumberish 0.0.7
111
+ ```
112
+ This will download Cucumberish directory from version 0.0.7 and also creats 'Features' directory with demo feature. You can then reference those directory in Xcode. For "Cucumberish" directory select 'Copy if needed and Create Group' and for the "Features" directory select don't create group or Copy if needed. Just " create folder reference"
113
+
114
+ - Finally from the Cucumberish target 'General' setting select 'Testing -> Target To Test' and configure scheme to add Cucumeerish UI target to Test
115
+
116
+ You are done !!
117
+
118
+ ## Setting up Fitnesse Acceptance Target
119
+
120
+ You can also setup Fitnesse Acceptance Tests but you need to use Cocoapod for this target.
121
+
122
+ Basically Steps are pretty much same mentioned in the [OCSlimProject](http://paulstringer.github.io/OCSlimProject/) but most of them are automated for simplicity. Here is simple way to set Fitnesse Acceptance tests for iOS/MacOS Apps
123
+
124
+
125
+
126
+ - Create new target, "File --> New --> Target --> XCFit --> Fitnesse Acceptance Test". Give it a suitable name e.g 'AcceptanceTests'
127
+
128
+ - Create/Update Podfile with
19
129
 
20
- XCFit is available through [CocoaPods](http://cocoapods.org) and RubyGems. To install
21
- it, simply add the following line to your Podfile:
22
130
 
23
131
  ```ruby
24
- pod "XCFit"
132
+
133
+ use_frameworks!
134
+
135
+ target 'AcceptanceTests' do
136
+ pod 'XCFit'
137
+ end
138
+ ```
139
+
140
+ Run 'Pod install' and build newly created Acceptance target from Xcode. You should see 'LaunchFitnesse' Script geerated and Your app should be talking to fitnesse now.
141
+
142
+ - Now CD into FITNESSE_TARGET directory and Get Fitnesse JAR file by running
143
+
144
+ ```sh
145
+ $ cd $FITNESSE_TARGET
146
+ $ xcfit get_fitnesse
147
+ ```
148
+
149
+ You should have fitnesse-standalone file downloaded in the target directory. You can now execute 'LaunchFitnesse'
150
+
151
+ ```sh
152
+ $ ./LaunchFitnesse
153
+ ```
154
+
155
+ Now you should have Fitnesse up and runnig. Follow Paul's article for the details on how to write acceptance tests [here](http://stringerstheory.net/acceptance-testing-with-ios/)
156
+
157
+ ## Continous Integration & Test Reporting
158
+
159
+ As of now, you might be running tests within Xcode, but there are some awsome tools which allows us to run our tests from command line. The 'xcodebuild' is being used to build and test Xcode Schemes. [Fastlane](https://github.com/fastlane/fastlane) seems much easier option to automate everything but it's upto you. These are long commands but you k ow better how to Script it Or Fastlane it, right ? :)
160
+
161
+ ### Cucumberish
162
+
163
+ You can execute Cucumberish tests with like this for XCFitDemo App.
164
+
165
+ [XCPretty](https://github.com/supermarin/xcpretty) can be used to generate JUnit Or HTML report as below
166
+
167
+
168
+ ```sh
169
+ xcodebuild -workspace CuPod.xcworkspace -scheme CuPodUITests -sdk iphonesimulator -destination 'platform=iOS Simulator,name=iPhone 6,OS=9.3' test | xcpretty --test --color
170
+ ```
171
+
172
+ You can now analyse the reports generated in the 'build/reports' directory.
173
+
174
+ ### Fitnesse
175
+
176
+ You can first build the Acceptance target
177
+
178
+ ```sh
179
+ $ xcodebuild -workspace XCFitDemo.xcworkspace -scheme XCFitAcceptanceTests -sdk iphonesimulator -destination 'platform=iOS Simulator,name=iPhone 6' clean build | xcpretty
25
180
  ```
26
181
 
182
+ Now run the Fitnesse tests using
183
+
184
+ ```sh
185
+
186
+ $ java -jar fitnesse-standalone.jar -v -o -c "FrontPage?suite"
187
+ ```
188
+ You can also set reports directory and generate Junit style reports inside the "XCFitDemo/FitNesseRoot/files/testResults/" directory.
189
+
190
+
191
+ # Video Demo
192
+
193
+ Coming Soon !
194
+
195
+
196
+
197
+
27
198
  ## Author
28
199
 
29
- Shashikant86, shashikant.jagtap@aicloud.com
200
+ Shashikant86, shashikant.jagtap@icloud.com
30
201
 
31
202
  ## License
32
203
 
@@ -0,0 +1,10 @@
1
+ Feature: Demo Feature / Replace Me
2
+
3
+ In order to ...
4
+ As a ...
5
+ I want ....
6
+
7
+ Scenario : Demo Scenario
8
+
9
+ Given the app is running
10
+
@@ -7,7 +7,7 @@ module XCFit
7
7
  include Thor::Actions
8
8
  $source_dir = File.expand_path '../../..', __FILE__
9
9
  $source_template_dir = File.join($source_dir, 'XCFit_Templates')
10
- $source_xcfit_dir = File.join($source_template_dir, 'XCFit')
10
+ $source_xcfit_dir = File.join($source_template_dir, 'XCFit')
11
11
  $source_cucumberish_template_dir = File.join($source_xcfit_dir, 'Cucumberish\ UI\ Test\ Bundle\ Base.xctemplate')
12
12
  $source_gherkin_dir = File.join($source_template_dir, 'Gherkin')
13
13
  $root_dir = File.expand_path('~')
@@ -22,7 +22,7 @@ module XCFit
22
22
  map %w(-v -V --version) => :version
23
23
 
24
24
 
25
- desc 'version', 'Get the current version number'
25
+ desc 'version', 'Get the current version number', :hide => true
26
26
  def version
27
27
  say XCFit::VERSION
28
28
  end
@@ -48,7 +48,7 @@ module XCFit
48
48
  puts " ***************** Enjoy XCFit *****************"
49
49
  end
50
50
 
51
- desc 'create_xcgherkin', 'Generate Xcode Templates for the Gherkin Feature Files'
51
+ desc 'create_xcgherkin', 'Generate Xcode Templates for the Gherkin Feature Files', :hide => true
52
52
  def create_xcgherkin
53
53
  if File.exist?($root_gherkin_dir)
54
54
  puts "==================XXXXXXXX==========================="
@@ -89,7 +89,7 @@ module XCFit
89
89
  puts "=======Now creating Feature Directory with Demo Feature ===="
90
90
  puts "==================XXXXXXXX==========================="
91
91
  system("mkdir -p Features")
92
- demo_feature_file = $source_cucumberish_template_dir + "/demo.feature"
92
+ demo_feature_file = $source_template_dir + "/demo.feature"
93
93
  system("cp #{demo_feature_file} Features/")
94
94
  puts $source_cucumberish_template_dir
95
95
  puts "==================XXXXXXXX==========================="
@@ -1,3 +1,3 @@
1
1
  module XCFit
2
- VERSION = "0.5.0"
2
+ VERSION = "0.6.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: xcfit
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shashikant86
@@ -1671,6 +1671,7 @@ files:
1671
1671
  - XCFit_Templates/XCFit/iOS API Cucumberish Testing Bundle.xctemplate/TemplateInfo.plist
1672
1672
  - XCFit_Templates/XCFit/iOS Acceptance Tests.xctemplate/TemplateInfo.plist
1673
1673
  - XCFit_Templates/XCFit/iOS UI Cucumberish Testing Bundle.xctemplate/TemplateInfo.plist
1674
+ - XCFit_Templates/demo.feature
1674
1675
  - bin/xcfit
1675
1676
  - lib/XCFit.rb
1676
1677
  - lib/XCFit/main.rb