xcfit 2.0.2 → 2.0.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (55) hide show
  1. checksums.yaml +4 -4
  2. data/Xcode7-Templates/XCFit/Base Acceptance Testing Bundle.xctemplate/TemplateIcon.icns +0 -0
  3. data/Xcode7-Templates/XCFit/Base Acceptance Testing Bundle.xctemplate/TemplateInfo.plist +134 -0
  4. data/Xcode7-Templates/XCFit/Base Acceptance Testing Bundle.xctemplate/___PACKAGENAMEASIDENTIFIER___.m +17 -0
  5. data/Xcode7-Templates/XCFit/Base Acceptance Testing Bundle.xctemplate/___PACKAGENAMEASIDENTIFIER___.swift +13 -0
  6. data/Xcode7-Templates/XCFit/Base Acceptance Testing Bundle.xctemplate/___POD_NAME___.m +25 -0
  7. data/Xcode7-Templates/XCFit/Base Acceptance Tests.xctemplate/AcceptanceTests-Bridging-Header.h +1 -0
  8. data/Xcode7-Templates/XCFit/Base Acceptance Tests.xctemplate/FixtureExample.swift +35 -0
  9. data/Xcode7-Templates/XCFit/Base Acceptance Tests.xctemplate/SlimTables.h +28 -0
  10. data/Xcode7-Templates/XCFit/Base Acceptance Tests.xctemplate/TemplateInfo.plist +155 -0
  11. data/Xcode7-Templates/XCFit/Base Acceptance Tests.xctemplate/___PACKAGENAMEASIDENTIFIER___-Bridging-Header.h +12 -0
  12. data/Xcode7-Templates/XCFit/Base Acceptance Tests.xctemplate/___PACKAGENAMEASIDENTIFIER___.m +33 -0
  13. data/Xcode7-Templates/XCFit/Cucumberish UI Test Bundle Base.xctemplate/BaseScreen.swift +41 -0
  14. data/Xcode7-Templates/XCFit/Cucumberish UI Test Bundle Base.xctemplate/CommonStepDefinitions.swift +92 -0
  15. data/Xcode7-Templates/XCFit/Cucumberish UI Test Bundle Base.xctemplate/Extensions.swift +58 -0
  16. data/Xcode7-Templates/XCFit/Cucumberish UI Test Bundle Base.xctemplate/HomeScreen.swift +24 -0
  17. data/Xcode7-Templates/XCFit/Cucumberish UI Test Bundle Base.xctemplate/HomeScreenSteps.swift +28 -0
  18. data/Xcode7-Templates/XCFit/Cucumberish UI Test Bundle Base.xctemplate/Hooks.swift +26 -0
  19. data/Xcode7-Templates/XCFit/Cucumberish UI Test Bundle Base.xctemplate/TemplateIcon.png +0 -0
  20. data/Xcode7-Templates/XCFit/Cucumberish UI Test Bundle Base.xctemplate/TemplateIcon@2x.png +0 -0
  21. data/Xcode7-Templates/XCFit/Cucumberish UI Test Bundle Base.xctemplate/TemplateInfo.plist +146 -0
  22. data/Xcode7-Templates/XCFit/Cucumberish UI Test Bundle Base.xctemplate/___PACKAGENAMEASIDENTIFIER___-Bridging-Header.h +15 -0
  23. data/Xcode7-Templates/XCFit/Cucumberish UI Test Bundle Base.xctemplate/___PACKAGENAMEASIDENTIFIER___.h +23 -0
  24. data/Xcode7-Templates/XCFit/Cucumberish UI Test Bundle Base.xctemplate/___PACKAGENAMEASIDENTIFIER___.m +28 -0
  25. data/Xcode7-Templates/XCFit/Cucumberish UI Test Bundle Base.xctemplate/___PACKAGENAMEASIDENTIFIER___.swift +37 -0
  26. data/Xcode7-Templates/XCFit/Mac Acceptance Testing Bundle.xctemplate/TemplateIcon.icns +0 -0
  27. data/Xcode7-Templates/XCFit/Mac Acceptance Testing Bundle.xctemplate/TemplateInfo.plist +40 -0
  28. data/Xcode7-Templates/XCFit/Mac Acceptance Tests.xctemplate/Empty.xib +12 -0
  29. data/Xcode7-Templates/XCFit/Mac Acceptance Tests.xctemplate/TemplateIcon.icns +0 -0
  30. data/Xcode7-Templates/XCFit/Mac Acceptance Tests.xctemplate/TemplateInfo.plist +61 -0
  31. data/Xcode7-Templates/XCFit/MacOS UI Cucumberish Testing Bundle.xctemplate/TemplateInfo.plist +39 -0
  32. data/Xcode7-Templates/XCFit/XCUI POM Test Bundle Base.xctemplate/BaseScreen.swift +42 -0
  33. data/Xcode7-Templates/XCFit/XCUI POM Test Bundle Base.xctemplate/Extensions.swift +60 -0
  34. data/Xcode7-Templates/XCFit/XCUI POM Test Bundle Base.xctemplate/HomeElements.swift +31 -0
  35. data/Xcode7-Templates/XCFit/XCUI POM Test Bundle Base.xctemplate/HomeProtocol.swift +25 -0
  36. data/Xcode7-Templates/XCFit/XCUI POM Test Bundle Base.xctemplate/HomeScreen.swift +24 -0
  37. data/Xcode7-Templates/XCFit/XCUI POM Test Bundle Base.xctemplate/HomeScreenTest.swift +30 -0
  38. data/Xcode7-Templates/XCFit/XCUI POM Test Bundle Base.xctemplate/ProtocolOrientedTest.swift +45 -0
  39. data/Xcode7-Templates/XCFit/XCUI POM Test Bundle Base.xctemplate/TemplateIcon.png +0 -0
  40. data/Xcode7-Templates/XCFit/XCUI POM Test Bundle Base.xctemplate/TemplateIcon@2x.png +0 -0
  41. data/Xcode7-Templates/XCFit/XCUI POM Test Bundle Base.xctemplate/TemplateInfo.plist +141 -0
  42. data/Xcode7-Templates/XCFit/XCUI POM Test Bundle Base.xctemplate/___PACKAGENAMEASIDENTIFIER___TestBase.swift +30 -0
  43. data/Xcode7-Templates/XCFit/iOS Acceptance Testing Bundle.xctemplate/TemplateIcon-old.icns +0 -0
  44. data/Xcode7-Templates/XCFit/iOS Acceptance Testing Bundle.xctemplate/TemplateIcon.png +0 -0
  45. data/Xcode7-Templates/XCFit/iOS Acceptance Testing Bundle.xctemplate/TemplateIcon@2x.png +0 -0
  46. data/Xcode7-Templates/XCFit/iOS Acceptance Testing Bundle.xctemplate/TemplateInfo.plist +40 -0
  47. data/Xcode7-Templates/XCFit/iOS Acceptance Tests.xctemplate/TemplateIcon-old.icns +0 -0
  48. data/Xcode7-Templates/XCFit/iOS Acceptance Tests.xctemplate/TemplateIcon.png +0 -0
  49. data/Xcode7-Templates/XCFit/iOS Acceptance Tests.xctemplate/TemplateIcon@2x.png +0 -0
  50. data/Xcode7-Templates/XCFit/iOS Acceptance Tests.xctemplate/TemplateInfo.plist +59 -0
  51. data/Xcode7-Templates/XCFit/iOS UI Cucumberish Testing Bundle.xctemplate/TemplateInfo.plist +28 -0
  52. data/Xcode7-Templates/XCFit/iOS XCUI POM Test Bundle.xctemplate/TemplateInfo.plist +39 -0
  53. data/lib/XCFit/main.rb +60 -43
  54. data/lib/XCFit/version.rb +1 -1
  55. metadata +64 -13
@@ -0,0 +1,24 @@
1
+ //
2
+ //
3
+ // Created by XCFit Framework
4
+ // Copyright © 2016 XCFit Framework. All rights reserved.
5
+ //
6
+
7
+ /*
8
+
9
+ This is sample code created by XCFit Framework and can be edited/Removed as per your project need. You can also re-arrange Xcode Groups and directories as per your need.
10
+
11
+ 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.
12
+ */
13
+
14
+ import Foundation
15
+ import XCTest
16
+
17
+
18
+ class HomeScreen: BaseScreen {
19
+
20
+ // You can add locators and functions of homeScreen here
21
+
22
+ let crappyButtuon = XCUIApplication().buttons["I am really useless button"]
23
+
24
+ }
@@ -0,0 +1,30 @@
1
+ //
2
+ //
3
+ // Created by XCFit Framework
4
+ // Copyright © 2016 XCFit Framework. All rights reserved.
5
+ //
6
+ //
7
+
8
+ /*
9
+
10
+ This is sample code created by XCFit Framework and can be edited/Removed as per your project need. You can also re-arrange Xcode Groups and directories as per your need.
11
+
12
+ This is sample test which demonstrate use of Page Objects and common extensions. We can access any page or section from test method
13
+
14
+ */
15
+
16
+ import Foundation
17
+ import XCTest
18
+
19
+ class HomeScreenTest: HomeScreen {
20
+
21
+ func testHomeScreen() {
22
+
23
+ //HomeScreen().crappyButtuon.tapOnceVisible(testCase: self)
24
+ XCTAssertFalse(HomeScreen().crappyButtuon.exists)
25
+
26
+ }
27
+
28
+
29
+
30
+ }
@@ -0,0 +1,45 @@
1
+ //
2
+ //
3
+ // Created by XCFit Framework
4
+ // Copyright © 2016 XCFit Framework. All rights reserved.
5
+ //
6
+ //
7
+
8
+ /*
9
+
10
+ This is sample code created by XCFit Framework and can be edited/Removed as per your project need. You can also re-arrange Xcode Groups and directories as per your need.
11
+
12
+ Here is example of the Protocol Oriented Test which implement HomeProtocol.
13
+
14
+ */
15
+
16
+
17
+ import Foundation
18
+ import XCTest
19
+
20
+ extension HomeProtocol {
21
+
22
+
23
+
24
+ }
25
+
26
+ class ProtocolOrientedTest: XCTestCase, HomeProtocol {
27
+
28
+ let app = XCUIApplication()
29
+
30
+ func testPrintsAddedToBasket() {
31
+ XCUIApplication().launch()
32
+ launchApp()
33
+ tapHomebutton()
34
+
35
+ }
36
+
37
+ func launchApp() {
38
+
39
+ }
40
+
41
+ func tapHomebutton() {
42
+
43
+ }
44
+
45
+ }
@@ -0,0 +1,141 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3
+ <plist version="1.0">
4
+ <dict>
5
+ <key>Kind</key>
6
+ <string>Xcode.Xcode3.ProjectTemplateUnitKind</string>
7
+ <key>Identifier</key>
8
+ <string>com.apple.dt.unit.xcuiPomTestBundleBase</string>
9
+ <key>Ancestors</key>
10
+ <array>
11
+ <string>com.apple.dt.unit.uiTestBundleBase</string>
12
+ </array>
13
+ <key>TargetOnly</key>
14
+ <true/>
15
+ <key>AssociatedTargetSpecification</key>
16
+ <dict>
17
+ <key>PopUpTitle</key>
18
+ <string>Target to be Tested:</string>
19
+ <key>PopUpDescription</key>
20
+ <string>The application that this new test bundle will be testing. The new UI Tests will be associated with that target&apos;s scheme.</string>
21
+ <key>AllowableProductTypes</key>
22
+ <array>
23
+ <string>com.apple.product-type.application</string>
24
+ </array>
25
+ <key>AssociatedTargetIsTargetToBeTested</key>
26
+ <true/>
27
+ </dict>
28
+ <key>Targets</key>
29
+ <array>
30
+ <dict>
31
+ <key>ProductType</key>
32
+ <string>com.apple.product-type.bundle.ui-testing</string>
33
+ <key>SharedSettings</key>
34
+ <dict>
35
+ <key>LD_RUNPATH_SEARCH_PATHS</key>
36
+ <string>$(inherited) @executable_path/Frameworks @loader_path/Frameworks</string>
37
+ </dict>
38
+ <key>Configurations</key>
39
+ <dict>
40
+ <key>Debug</key>
41
+ <dict>
42
+ <key>SRC_ROOT</key>
43
+ <string>@\&quot;$(SRCROOT)\&quot;</string>
44
+ </dict>
45
+ <key>Release</key>
46
+ <dict/>
47
+ </dict>
48
+ <key>BuildPhases</key>
49
+ <array>
50
+ <dict>
51
+ <key>Class</key>
52
+ <string>Sources</string>
53
+ </dict>
54
+ <dict>
55
+ <key>Class</key>
56
+ <string>Frameworks</string>
57
+ </dict>
58
+ <dict>
59
+ <key>Class</key>
60
+ <string>Resources</string>
61
+ </dict>
62
+ </array>
63
+ </dict>
64
+ </array>
65
+ <key>Nodes</key>
66
+ <array>
67
+ <string>HomeElements.swift</string>
68
+ <string>HomeScreenTest.swift</string>
69
+ <string>ProtocolOrientedTest.swift</string>
70
+ <string>HomeProtocol.swift</string>
71
+ <string>Extensions.swift</string>
72
+ <string>HomeScreen.swift</string>
73
+ <string>BaseScreen.swift</string>
74
+ <string>Info.plist:PackageType</string>
75
+ <string>___PACKAGENAMEASIDENTIFIER___TestBase.swift</string>
76
+ </array>
77
+ <key>Definitions</key>
78
+ <dict>
79
+ <key>HomeElements.swift</key>
80
+ <dict>
81
+ <key>Path</key>
82
+ <string>HomeElements.swift</string>
83
+ <key>Group</key>
84
+ <string>Sections</string>
85
+ </dict>
86
+ <key>HomeScreenTest.swift</key>
87
+ <dict>
88
+ <key>Path</key>
89
+ <string>HomeScreenTest.swift</string>
90
+ <key>Group</key>
91
+ <string>Tests</string>
92
+ </dict>
93
+ <key>ProtocolOrientedTest.swift</key>
94
+ <dict>
95
+ <key>Path</key>
96
+ <string>ProtocolOrientedTest.swift</string>
97
+ <key>Group</key>
98
+ <string>Tests</string>
99
+ </dict>
100
+ <key>HomeProtocol.swift</key>
101
+ <dict>
102
+ <key>Path</key>
103
+ <string>HomeProtocol.swift</string>
104
+ <key>Group</key>
105
+ <string>Protocols</string>
106
+ </dict>
107
+ <key>Extensions.swift</key>
108
+ <dict>
109
+ <key>Path</key>
110
+ <string>Extensions.swift</string>
111
+ <key>Group</key>
112
+ <string>Protocols</string>
113
+ </dict>
114
+ <key>HomeScreen.swift</key>
115
+ <dict>
116
+ <key>Path</key>
117
+ <string>HomeScreen.swift</string>
118
+ <key>Group</key>
119
+ <string>Screens</string>
120
+ </dict>
121
+ <key>BaseScreen.swift</key>
122
+ <dict>
123
+ <key>Path</key>
124
+ <string>BaseScreen.swift</string>
125
+ <key>Group</key>
126
+ <string>TestBase</string>
127
+ </dict>
128
+ <key>Info.plist:PackageType</key>
129
+ <string>&lt;key&gt;CFBundlePackageType&lt;/key&gt;
130
+ &lt;string&gt;BNDL&lt;/string&gt;
131
+ </string>
132
+ <key>___PACKAGENAMEASIDENTIFIER___TestBase.swift</key>
133
+ <dict>
134
+ <key>Path</key>
135
+ <string>___PACKAGENAMEASIDENTIFIER___TestBase.swift</string>
136
+ <key>Group</key>
137
+ <string>TestBase</string>
138
+ </dict>
139
+ </dict>
140
+ </dict>
141
+ </plist>
@@ -0,0 +1,30 @@
1
+ //
2
+ //
3
+ // Created by XCFit Framework
4
+ // Copyright © 2016 XCFit Framework. All rights reserved.
5
+ //
6
+
7
+ /*
8
+
9
+ This is sample code created by XCFit Framework and can be edited/Removed as per your project need. You can also re-arrange Xcode Groups and directories as per your need.
10
+
11
+ This class can be used to put all your test base setup e.g launch Argument, cutom Environment varibales, Mock Server, teardown etc etc
12
+
13
+ */
14
+
15
+ import Foundation
16
+ import XCTest
17
+ class ___PACKAGENAMEASIDENTIFIER___TestBase: XCTestCase {
18
+
19
+ override func setUp() {
20
+ super.setUp()
21
+ continueAfterFailure = false
22
+ XCUIApplication().launch()
23
+ }
24
+
25
+ override func tearDown() {
26
+ super.tearDown()
27
+ }
28
+
29
+
30
+ }
@@ -0,0 +1,40 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3
+ <plist version="1.0">
4
+ <dict>
5
+ <key>Macros</key>
6
+ <dict>
7
+ <key>POD_PLATFORM_IDENTIFIER</key>
8
+ <string>ios, 9.0</string>
9
+ </dict>
10
+ <key>Kind</key>
11
+ <string>Xcode.Xcode3.ProjectTemplateUnitKind</string>
12
+ <key>Identifier</key>
13
+ <string>io.cleankit.iOSAcceptanceTestsUnitTestBundle</string>
14
+ <key>Name</key>
15
+ <string>Acceptance Unit Test Bundle</string>
16
+ <key>Description</key>
17
+ <string>This target builds an iOS unit test bundle that generates results from your Acceptance Tests target using Fitnesse and then reports them within Xcode using the XCTest framework.</string>
18
+ <key>Concrete</key>
19
+ <true/>
20
+ <key>Platforms</key>
21
+ <array>
22
+ <string>com.apple.platform.iphoneos</string>
23
+ </array>
24
+ <key>Ancestors</key>
25
+ <array>
26
+ <string>com.apple.dt.unit.iosBase</string>
27
+ <string>io.cleankit.baseAcceptanceTestsUnitTestBundle</string>
28
+ </array>
29
+ <key>Targets</key>
30
+ <array>
31
+ <dict>
32
+ <key>SharedSettings</key>
33
+ <dict>
34
+ <key>LD_RUNPATH_SEARCH_PATHS</key>
35
+ <string>$(inherited) @executable_path/Frameworks @loader_path/Frameworks</string>
36
+ </dict>
37
+ </dict>
38
+ </array>
39
+ </dict>
40
+ </plist>
@@ -0,0 +1,59 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3
+ <plist version="1.0">
4
+ <dict>
5
+ <key>Macros</key>
6
+ <dict>
7
+ <key>POD_PLATFORM_IDENTIFIER</key>
8
+ <string>ios</string>
9
+ </dict>
10
+ <key>Name</key>
11
+ <string>iOS Acceptance Tests</string>
12
+ <key>Kind</key>
13
+ <string>Xcode.Xcode3.ProjectTemplateUnitKind</string>
14
+ <key>Identifier</key>
15
+ <string>io.cleankit.iosAcceptanceTests</string>
16
+ <key>Description</key>
17
+ <string>This target builds an iOS Application for Acceptance Testing your App using the Fitnesse framework. Requires a project that uses CocoaPods.</string>
18
+ <key>Ancestors</key>
19
+ <array>
20
+ <string>io.cleankit.baseAcceptanceTests</string>
21
+ <string>com.apple.dt.unit.iosBase</string>
22
+ </array>
23
+ <key>Concrete</key>
24
+ <true/>
25
+ <key>Targets</key>
26
+ <array>
27
+ <dict>
28
+ <key>SharedSettings</key>
29
+ <dict>
30
+ <key>LD_RUNPATH_SEARCH_PATHS</key>
31
+ <string>$(inherited) @executable_path/Frameworks</string>
32
+ </dict>
33
+ </dict>
34
+ </array>
35
+ <key>Nodes</key>
36
+ <array>
37
+ <string>Info.plist:iPhone</string>
38
+ <string>Info.plist:UIRequiredDeviceCapabilities:base</string>
39
+ </array>
40
+ <key>Definitions</key>
41
+ <dict>
42
+ <key>Info.plist:iPhone</key>
43
+ <string>&lt;key&gt;LSRequiresIPhoneOS&lt;/key&gt;
44
+ &lt;true/&gt;</string>
45
+ <key>Info.plist:UIRequiredDeviceCapabilities</key>
46
+ <dict>
47
+ <key>Beginning</key>
48
+ <string>&lt;key&gt;UIRequiredDeviceCapabilities&lt;/key&gt;
49
+ &lt;array&gt;</string>
50
+ <key>End</key>
51
+ <string>&lt;/array&gt;</string>
52
+ <key>Indent</key>
53
+ <integer>1</integer>
54
+ </dict>
55
+ <key>Info.plist:UIRequiredDeviceCapabilities:base</key>
56
+ <string>&lt;string&gt;armv7&lt;/string&gt;</string>
57
+ </dict>
58
+ </dict>
59
+ </plist>
@@ -0,0 +1,28 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3
+ <plist version="1.0">
4
+ <dict>
5
+ <key>Kind</key>
6
+ <string>Xcode.Xcode3.ProjectTemplateUnitKind</string>
7
+ <key>Identifier</key>
8
+ <string>com.apple.dt.unit.iosUICucumberishTestingBundle</string>
9
+ <key>Ancestors</key>
10
+ <array>
11
+ <string>com.apple.dt.unit.cucumberishUITestBundleBase</string>
12
+ <string>com.apple.dt.unit.iosBase</string>
13
+ </array>
14
+ <key>Concrete</key>
15
+ <true/>
16
+ <key>Description</key>
17
+ <string>This target builds a BDD style user interface testing bundle that uses the Cucumberish and XCTest framework.</string>
18
+ <key>SortOrder</key>
19
+ <integer>1</integer>
20
+ <key>Targets</key>
21
+ <array>
22
+ <dict>
23
+ <key>TargetIdentifier</key>
24
+ <string>com.apple.dt.cocoaUITestBundleTarget</string>
25
+ </dict>
26
+ </array>
27
+ </dict>
28
+ </plist>
@@ -0,0 +1,39 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3
+ <plist version="1.0">
4
+ <dict>
5
+ <key>Kind</key>
6
+ <string>Xcode.Xcode3.ProjectTemplateUnitKind</string>
7
+ <key>Identifier</key>
8
+ <string>com.apple.dt.unit.iosXcuiPomTestingBundle</string>
9
+ <key>Ancestors</key>
10
+ <array>
11
+ <string>com.apple.dt.unit.xcuiPomTestBundleBase</string>
12
+ <string>com.apple.dt.unit.iosBase</string>
13
+ </array>
14
+ <key>Concrete</key>
15
+ <true/>
16
+ <key>Description</key>
17
+ <string>This target builds a XCUI tests with Page Object Pattern using XCTest framework.</string>
18
+ <key>SortOrder</key>
19
+ <integer>1</integer>
20
+ <key>Targets</key>
21
+ <array>
22
+ <dict>
23
+ <key>TargetIdentifier</key>
24
+ <string>com.apple.dt.cocoaUITestBundleTarget</string>
25
+ </dict>
26
+ </array>
27
+ <key>OptionConstraints</key>
28
+ <array>
29
+ <dict>
30
+ <key>Identifier</key>
31
+ <string>productName</string>
32
+ <key>ConstraintType</key>
33
+ <string>DefaultIfAssociatedTarget</string>
34
+ <key>Value</key>
35
+ <string>___ASSOCIATEDTARGET_bundleName___POM</string>
36
+ </dict>
37
+ </array>
38
+ </dict>
39
+ </plist>
data/lib/XCFit/main.rb CHANGED
@@ -3,11 +3,13 @@ require 'fileutils'
3
3
  require 'XCFit/version'
4
4
 
5
5
  module XCFit
6
- class Main < Thor
6
+ class Main < Thor
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_template_xcode7_dir = File.join($source_dir, 'Xcode7-Templates')
11
+ $source_xcfit_dir = File.join($source_template_dir, 'XCFit')
12
+ $source_xcfit_xcode7_dir = File.join($source_template_xcode7_dir, 'XCFit')
11
13
  $source_cucumberish_template_dir = File.join($source_xcfit_dir, 'Cucumberish\ UI\ Test\ Bundle\ Base.xctemplate')
12
14
  $source_gherkin_dir = File.join($source_template_dir, 'Gherkin')
13
15
  $root_dir = File.expand_path('~')
@@ -17,100 +19,115 @@ module XCFit
17
19
  $root_template_dir = File.join($root_xcode_dir, 'Templates')
18
20
  $root_xcfit_dir = File.join($root_template_dir, 'XCfit')
19
21
  $root_gherkin_dir = File.join($root_template_dir, 'Gherkin')
20
-
22
+
21
23
 
22
24
  map %w(-v -V --version) => :version
23
-
25
+
24
26
 
25
27
  desc 'version', 'Get the current version number', :hide => true
26
28
  def version
27
29
  say XCFit::VERSION
28
30
  end
29
31
 
30
- desc 'create_xctargets', 'Generate a Xcode Templates for the Cucumberish and Fitnesse'
31
- def create_xctargets
32
+ desc 'set_xcode_templates', 'Generate All Xcode Templates for the Gherkin Feature Files & targets for Cucumberish and Fitnesse'
33
+ def set_xcode_templates
32
34
  if File.exist?($root_xcfit_dir)
33
- puts "==================XXXXXXXX==========================="
35
+ puts "==================XXXXXXXX==========================="
34
36
  puts 'There is already XCFit directory in Xcode Templates. Have you tried XCFit Before? '
35
37
  puts 'Please remove/move existing ~/Library/Developer/Xcode/Templates/XCFit directory to carry on'
36
- puts "==================XXXXXXXX==========================="
38
+ puts "==================XXXXXXXX==========================="
37
39
  exit 1
38
40
  end
39
- puts "==================XXXXXXXX==========================="
41
+ puts "==================XXXXXXXX==========================="
40
42
  puts 'Creating XCode Template for XCFit'
41
43
  puts 'This Template will allow you create Cucumberish and Fitnesse targets'
42
- puts "==================XXXXXXXX==========================="
44
+ puts "==================XXXXXXXX==========================="
43
45
  FileUtils.cp_r($source_xcfit_dir, $root_template_dir)
44
46
  puts 'Now Your Xcode will have XCFIT iOS and macOS tagets for Cucumberish and Fitnesse'
45
- puts "==================XXXXXXXX==========================="
47
+ puts "==================XXXXXXXX==========================="
48
+ puts 'File -> New -->Target-->XCFit'
49
+ puts 'You wont need to restart Xcode but do so if nesessary!'
50
+ puts " ***************** Enjoy XCFit *****************"
51
+ end
52
+
53
+ desc 'set_xcode7_templates', 'Generate a Xcode7 Templates for the Cucumberish and Fitnesse'
54
+ def set_xcode7_templates
55
+ if File.exist?($root_xcfit_dir)
56
+ puts "==================XXXXXXXX==========================="
57
+ puts 'There is already XCFit directory in Xcode Templates. Have you tried XCFit Before? '
58
+ puts 'Please remove/move existing ~/Library/Developer/Xcode/Templates/XCFit directory to carry on'
59
+ puts "==================XXXXXXXX==========================="
60
+ exit 1
61
+ end
62
+ puts "==================XXXXXXXX==========================="
63
+ puts 'Creating XCode Template for XCFit'
64
+ puts 'This Template will allow you create Cucumberish and Fitnesse targets'
65
+ puts "==================XXXXXXXX==========================="
66
+ FileUtils.cp_r($source_xcfit_xcode7_dir, $root_template_dir)
67
+ puts 'Now Your Xcode will have XCFIT iOS and macOS tagets for Cucumberish and Fitnesse'
68
+ puts "==================XXXXXXXX==========================="
46
69
  puts 'File -> New -->Target-->XCFit'
47
70
  puts 'You wont need to restart Xcode but do so if nesessary!'
48
71
  puts " ***************** Enjoy XCFit *****************"
49
- end
72
+ end
50
73
 
51
74
  desc 'create_xcgherkin', 'Generate Xcode Templates for the Gherkin Feature Files', :hide => true
52
75
  def create_xcgherkin
53
76
  if File.exist?($root_gherkin_dir)
54
- puts "==================XXXXXXXX==========================="
77
+ puts "==================XXXXXXXX==========================="
55
78
  puts 'There is already Gherkin directory in Xcode Templates. Have you tried XCFit Before? '
56
79
  puts 'Please remove/move existing ~/Library/Developer/Xcode/Templates/Gherkin directory to carry on'
57
- puts "==================XXXXXXXX==========================="
80
+ puts "==================XXXXXXXX==========================="
58
81
  exit 1
59
82
  end
60
- puts "==================XXXXXXXX==========================="
83
+ puts "==================XXXXXXXX==========================="
61
84
  puts 'Creating XCode Template for Gherkin'
62
85
  puts 'This Template will allow you create new Gherkin Feature file '
63
- puts "==================XXXXXXXX==========================="
86
+ puts "==================XXXXXXXX==========================="
64
87
  FileUtils.cp_r($source_gherkin_dir, $root_template_dir)
65
88
  puts 'Now Your Xcode will have ability to creat new Gherkin Feature File'
66
- puts "==================XXXXXXXX==========================="
89
+ puts "==================XXXXXXXX==========================="
67
90
  puts 'File -> New -->File-->Gherkin'
68
91
  puts 'You wont need to restart Xcode but do so if nesessary!'
69
92
  puts " ***************** Enjoy XCFit *****************"
70
93
  end
71
94
 
72
- desc 'set_xcode_templates', 'Generate All Xcode Templates for the Gherkin Feature Files & targets for Cucumberish and Fitnesse'
73
- def set_xcode_templates
74
- create_xctargets
75
- create_xcgherkin
76
- end
77
-
78
95
  desc 'get_cucumberish VERSION', 'Downloads Cucumberish version and Create Features directory. You must execute this from Cucumberish Xcode Target directory'
79
- def get_cucumberish(version="0.0.7")
80
- puts "==================XXXXXXXX==========================="
96
+ def get_cucumberish(version="1.0.0")
97
+ puts "==================XXXXXXXX==========================="
81
98
  puts 'Downloading Cucumberish in the current working directory'
82
99
  puts 'You Should execute this command from Cucumberish Xcode target directory'
83
- puts "==================XXXXXXXX==========================="
100
+ puts "==================XXXXXXXX==========================="
84
101
  system("curl -sL https://github.com/Ahmed-Ali/Cucumberish/archive/v#{version}.tar.gz | tar xz")
85
102
  cucumberish_dir = "Cucumberish-#{version}" + "/Cucumberish/"
86
103
  system("mv #{cucumberish_dir} .")
87
104
  system("rm -rf Cucumberish-#{version}")
88
- puts "==================XXXXXXXX==========================="
105
+ puts "==================XXXXXXXX==========================="
89
106
  puts "=======Now creating Feature Directory with Demo Feature ===="
90
- puts "==================XXXXXXXX==========================="
107
+ puts "==================XXXXXXXX==========================="
91
108
  system("mkdir -p Features")
92
109
  demo_feature_file = $source_template_dir + "/demo.feature"
93
110
  # system("cp #{demo_feature_file} Features/")
94
111
  # puts $source_cucumberish_template_dir
95
- puts "==================XXXXXXXX==========================="
112
+ puts "==================XXXXXXXX==========================="
96
113
  puts "=======Created Feature Directory. Add New Gherkin Feature ===="
97
- puts "==================XXXXXXXX==========================="
98
- end
99
-
114
+ puts "==================XXXXXXXX==========================="
115
+ end
116
+
100
117
  desc 'get_fitnesse', "Download Fitnesse JAR file from Internet. You must execute this from Xcode Fitnesse Acceptance Test Xcode Target directory"
101
- def get_fitnesse
102
- puts "==================XXXXXXXX==========================="
118
+ def get_fitnesse
119
+ puts "==================XXXXXXXX==========================="
103
120
  puts 'Downloading Fitnesse JAR file in the current working directory'
104
121
  puts 'You Should execute this command from Fitnesse Acceptance Test Xcode target directory'
105
- puts "==================XXXXXXXX==========================="
122
+ puts "==================XXXXXXXX==========================="
106
123
  system('curl -H "Accept: application/zip" http://fitnesse.org/fitnesse-standalone.jar\?responder\=releaseDownload\&release\=20160618 -o fitnesse-standalone.jar')
107
124
  if File.exist?("fitnesse-standalone.jar")
108
- puts "==================XXXXXXXX==========================="
125
+ puts "==================XXXXXXXX==========================="
109
126
  puts "=======SUccessfuly Downloaded Fitnesse JAR===="
110
- puts "==================XXXXXXXX==========================="
111
- else
112
- puts "=======Error downloading Fitnesse JAR===="
113
- end
114
- end
115
- end
116
- end
127
+ puts "==================XXXXXXXX==========================="
128
+ else
129
+ puts "=======Error downloading Fitnesse JAR===="
130
+ end
131
+ end
132
+ end
133
+ end
data/lib/XCFit/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module XCFit
2
- VERSION = "2.0.2"
2
+ VERSION = "2.0.3"
3
3
  end