xcfit 4.0.9 → 5.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +51 -39
- data/XCFit.podspec +1 -1
- data/homebrew/xcfit +1 -1
- data/lib/XCFit/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bb32345609f08fbe9c577c7e90bce6dcd0b42bbf
|
4
|
+
data.tar.gz: b7bf1e368ed69746722916a2e1ce13dd4c418844
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 07fe0c54c6a732778622c7fbf2c77c9ddcd6656ec45ab45776ab61042f79518aaaf77fe93625e0ab96a63d17bce1450019e233782c542296808f1a527aed9ee4
|
7
|
+
data.tar.gz: 9145a21ea8391f937c6fe7a75c93184f4b53dba4611712af664b79dbb173adbb0b8eea9d1efbc177c2759f21685638aa38ab3580694489f30a9e690c75cd110b
|
data/README.md
CHANGED
@@ -34,15 +34,15 @@
|
|
34
34
|
***
|
35
35
|
- 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.
|
36
36
|
- XCFit supports Swift so no need to use other languages like Ruby, Java, Python to write acceptance and UI tests for iOS.
|
37
|
-
- 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.
|
37
|
+
- 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.
|
38
38
|
- 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.
|
39
39
|
|
40
40
|
|
41
41
|
### XCFIT & Other Frameworks
|
42
42
|
|
43
|
-
* **XCFit Swift Framework with Pre-defined BDD Steps
|
43
|
+
* **XCFit Swift Framework with Pre-defined BDD Steps, Protocol & Page Object Templates**
|
44
44
|
|
45
|
-
XCFit
|
45
|
+
XCFit provides templates for Protocol Oriented BDD using 'Protocol BDD Bundle' and [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.
|
46
46
|
|
47
47
|
* **Cucumberish BDD Framework and Cucucmber Style Xcode Templates(Optional Objective-C)**
|
48
48
|
|
@@ -156,37 +156,33 @@ $ xcfit setup_xcode_templates
|
|
156
156
|
|
157
157
|
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
|
158
158
|
|
159
|
-
![image](https://github.com/Shashikant86/
|
159
|
+
![image](https://github.com/Shashikant86/XCFit5-GIF/blob/master/templates.png)
|
160
160
|
|
161
161
|
## Framework Installation
|
162
162
|
|
163
163
|
XCFit, Cucumberish or OCSlimProject Framework can be installed using Cocoapods. XCFit and Cuucmberish can be installed using Carthage as well.
|
164
164
|
|
165
165
|
### Cocoapods
|
166
|
-
Cocoapods is more automated than Carthage. We can create `Podfile` and add specific dependency for the target. We can install XCFit Cocoapods depending on Swift verson we are using
|
167
166
|
|
168
|
-
|
167
|
+
#### Use XCFit Template Podfile
|
169
168
|
|
170
|
-
Cocoapods is more automated than Carthage. We can create `Podfile` and add specific dependency for the target
|
169
|
+
Cocoapods is more automated than Carthage. We can create `Podfile` and add specific dependency for the target or we can use XCFit template `Podfile` using command.
|
171
170
|
|
172
|
-
|
173
|
-
target '$_YOUR__TARGET' do
|
174
|
-
pod 'XCFit', :git => 'https://github.com/Shashikant86/XCFit.git', :tag => '3.0.0'
|
175
|
-
end
|
176
|
-
```
|
177
|
-
This will doownload Cocoapods supporting Swift 3.0.2
|
171
|
+
$ xcfit setup_xcfit_podfile
|
178
172
|
|
179
|
-
|
173
|
+
This will create a Podfile, you need to replace your target names as required.
|
180
174
|
|
181
|
-
|
175
|
+
#### Manual Cocoapods Installtion
|
176
|
+
|
177
|
+
We can install XCFit Cocoapods depending on Swift version we are using
|
178
|
+
Latest version should support
|
182
179
|
|
183
180
|
```ruby
|
184
181
|
target '$_YOUR__TARGET' do
|
185
182
|
pod 'XCFit'
|
186
183
|
end
|
187
184
|
```
|
188
|
-
|
189
|
-
Same way we can get 'Cucumberish' and 'OCSlim' for the specific target.
|
185
|
+
Now that, we have `Podfile` setup, we can install dependencies using command
|
190
186
|
|
191
187
|
```sh
|
192
188
|
$ pod install
|
@@ -197,22 +193,10 @@ You need to close the existing Xcode session and Xcode Workspace .xcworkspace ne
|
|
197
193
|
### Carthage
|
198
194
|
|
199
195
|
XCFit and Cucumberish can be installed as Cartahge. We need to create `Cartfile` in the root of the project. Depending on which version of Swift you are using, we can use different tag
|
200
|
-
|
201
|
-
* **Swift 3.0.2**
|
202
|
-
|
203
|
-
Add the following to `Cartfile` to get Swift 3.0.2 compatable source
|
204
|
-
|
205
|
-
github "Shashikant86/XCFit" "3.0.0"
|
206
|
-
|
207
|
-
|
208
|
-
* **Swift 3.1**
|
209
|
-
|
210
|
-
You can get lates tag t work with Swift 3.1 then `Cartfile` can have following
|
196
|
+
You can get latest tag t work with Swift 3.1 then `Cartfile` can have following
|
211
197
|
|
212
198
|
github "Shashikant86/XCFit"
|
213
199
|
|
214
|
-
|
215
|
-
|
216
200
|
Now, we can fetch and build Carthage Dependencies using following command.
|
217
201
|
|
218
202
|
$ carthage update --platform iOS
|
@@ -236,7 +220,7 @@ Now we can use fetch XCFit using
|
|
236
220
|
|
237
221
|
$ swift package fetch
|
238
222
|
|
239
|
-
We can build, test package using the
|
223
|
+
We can build, test package using the Commands available for the Swift Package Manager.
|
240
224
|
|
241
225
|
|
242
226
|
|
@@ -245,9 +229,9 @@ We can build, test package using the commnds avavilable for the Swift Package Ma
|
|
245
229
|
|
246
230
|
## Protocol Oriented BDD
|
247
231
|
|
248
|
-
XCFit template supports Protocol Oriented BDD. Swift is a protocol oriented language and
|
232
|
+
XCFit template supports Protocol Oriented BDD. Swift is a protocol oriented language and we don't want to miss the point of Protocol, Extensions and Enums. To setup template
|
249
233
|
|
250
|
-
- From Xcode, create a new app(Or use existing app) and
|
234
|
+
- From Xcode, create a new app(Or use existing app) and select File ---> New ----> Target
|
251
235
|
|
252
236
|
- Now Select 'XCFit' for iOS app and Click on 'Protocol Oriented BDD Bundle'
|
253
237
|
|
@@ -321,10 +305,15 @@ Testbase is group where we can abstract all setup, teardown and common stuff in
|
|
321
305
|
|
322
306
|
### Cocoapods
|
323
307
|
You can get XCFit Framework easily. Create `Podfile` and add specific dependency for the target
|
308
|
+
Cocoapods is more automated than Carthage. We can create `Podfile` and add specific dependency for the target or we can use XCFit template `Podfile` using command.
|
309
|
+
|
310
|
+
$ xcfit setup_xcfit_podfile
|
311
|
+
|
312
|
+
This will create a Podfile, you need to replace your target names as required.
|
324
313
|
|
325
314
|
* **Swift 3.0.2**
|
326
315
|
|
327
|
-
|
316
|
+
We can create `Podfile` and add specific dependency for the target
|
328
317
|
|
329
318
|
```ruby
|
330
319
|
target '$_YOUR__TARGET' do
|
@@ -335,7 +324,7 @@ This will doownload Cocoapods supporting Swift 3.0.2
|
|
335
324
|
|
336
325
|
* **Swift 3.1**
|
337
326
|
|
338
|
-
You can doenload latest version
|
327
|
+
You can doenload latest version 5.0.0 to work with Swift 3.1
|
339
328
|
|
340
329
|
```ruby
|
341
330
|
target '$_YOUR__TARGET' do
|
@@ -367,9 +356,9 @@ Add the following to `Cartfile` to get Swift 3.0.2 compatable source
|
|
367
356
|
|
368
357
|
* **Swift 3.1**
|
369
358
|
|
370
|
-
You can get
|
359
|
+
You can get latest tag will work with Swift 3.1 then `Cartfile` can have following
|
371
360
|
|
372
|
-
github "Shashikant86/XCFit" "
|
361
|
+
github "Shashikant86/XCFit" "5.0.0"
|
373
362
|
|
374
363
|
|
375
364
|
Now fetch dependency and build XCFit using.
|
@@ -397,7 +386,15 @@ You can choose any of the above method but Cocoapods is easy and less manual.
|
|
397
386
|
|
398
387
|
## Import XCFit & Use Predefined Steps
|
399
388
|
|
400
|
-
There are some predefined XCFit steps we can use by importing `XCFit` and extending out test
|
389
|
+
There are some predefined XCFit steps we can use by importing `XCFit` and extending out test class to `XCFit`. There are plenty of Pre-Defined BDD Style Steps available [here](https://github.com/Shashikant86/XCFit/blob/master/Pre-Defined_Steps/XCFit_Predefined_Steps.md). You can use predefined steps wherever they make sense however it's fairly easy to write your own.
|
390
|
+
|
391
|
+
#### Using Steps inside Protocol Oriented BDD pattern
|
392
|
+
|
393
|
+
You can simply import `XCFit` inside the test class and extend it to XCFit. You can also use `Feature+Extensions.swift` to implement or override some steps.
|
394
|
+
|
395
|
+
#### Using Steps in Page Object Pattern
|
396
|
+
|
397
|
+
You can simply import `XCFit` inside the test class and extend it to XCFit
|
401
398
|
|
402
399
|
Your test will read something like this:
|
403
400
|
|
@@ -426,15 +423,30 @@ class XCFitTests: XCFit {
|
|
426
423
|
```
|
427
424
|
|
428
425
|
|
429
|
-
You will get access to lots of predefined BDD style human
|
426
|
+
You will get access to lots of predefined BDD style human readable steps. It's not mandatory to use those steps unless you wish.
|
430
427
|
|
431
428
|
**Don't like Pre-defined steps, you can easily override the steps, covered in the later section [here](#advise-on-using-pre-defines-bdd-style-steps)**
|
432
429
|
|
433
430
|
![image](https://github.com/Shashikant86/xcfitgif/blob/master/pre-defined_xcfit_steps.gif)
|
434
431
|
|
435
432
|
|
433
|
+
## Setting Fastlane for XCFit
|
434
|
+
|
435
|
+
[Fastlane](https://fastlane.tools/) is a awesome tool for iOS Continuous Delivery which automates most of the iOS development tasks. We can use it to run tests written using XCFit, We can setup sample `Fastfile` using XCFit command
|
436
|
+
|
437
|
+
|
438
|
+
$ xcfit setup_xcfit_fastfile
|
439
|
+
|
440
|
+
This will create template Fastfile with all the required lanes. You can replace the YOUR_SCHEME, WORKSPACE and other variables as required. We can then run
|
441
|
+
|
442
|
+
$ fastlane xcfit
|
443
|
+
|
444
|
+
This will run all our tests using Fastlane that will be easy to plug it with any CI server.
|
445
|
+
|
446
|
+
|
436
447
|
---
|
437
448
|
|
449
|
+
|
438
450
|
# Setting Cucumberish BDD Scenarios in Xcode
|
439
451
|
|
440
452
|
## Setup 'iOS UI Cucumberish Test Bundle' Target
|
data/XCFit.podspec
CHANGED
data/homebrew/xcfit
CHANGED
data/lib/XCFit/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: xcfit
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 5.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Shashikant86
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-04-
|
11
|
+
date: 2017-04-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|