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,28 @@
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
+ Here is Step implementation for the HomeScreen where we can use buttons from HomeScreen. We have to implement all the steps in the func HomeScreenSteps Or create another func if needed but we have register it in the intitialiser class.
12
+ */
13
+
14
+ import Foundation
15
+ import XCTest
16
+
17
+ class HomeScreenSteps: BaseScreen {
18
+
19
+ func HomeScreenSteps() {
20
+
21
+ MatchAll("I tap on crappy button") { (args, userInfo) -> Void in
22
+
23
+ //self.waitAndTap(HomeScreen().crappyButton)
24
+
25
+ }
26
+
27
+ }
28
+ }
@@ -0,0 +1,26 @@
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 are preconditions or post conditions to be executed before or after each scenario
12
+ */
13
+
14
+ import Foundation
15
+ import XCTest
16
+ class Hooks: NSObject {
17
+ class func CustomHooks()
18
+ {
19
+ var application : XCUIApplication!
20
+ //A closure that will be executed just before executing any of your features
21
+ beforeStart { () -> Void in
22
+ application = XCUIApplication()
23
+
24
+ }
25
+ }
26
+ }
@@ -0,0 +1,146 @@
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.cucumberishUITestBundleBase</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>Targets</key>
16
+ <array>
17
+ <dict>
18
+ <key>ProductType</key>
19
+ <string>com.apple.product-type.bundle.ui-testing</string>
20
+ <key>SharedSettings</key>
21
+ <dict>
22
+ <key>GCC_PREPROCESSOR_DEFINITIONS</key>
23
+ <string>DEBUG=1 $(inherited) SRC_ROOT=@\&quot;$(SRCROOT)\&quot;</string>
24
+ <key>LD_RUNPATH_SEARCH_PATHS</key>
25
+ <string>$(inherited) @executable_path/Frameworks @loader_path/Frameworks</string>
26
+ <key>SWIFT_OBJC_BRIDGING_HEADER</key>
27
+ <string>___PACKAGENAMEASIDENTIFIER___/___PACKAGENAMEASIDENTIFIER___-Bridging-Header.h</string>
28
+ </dict>
29
+ <key>Configurations</key>
30
+ <dict>
31
+ <key>Debug</key>
32
+ <dict>
33
+ <key>SRC_ROOT</key>
34
+ <string>@\&quot;$(SRCROOT)\&quot;</string>
35
+ </dict>
36
+ <key>Release</key>
37
+ <dict/>
38
+ </dict>
39
+ <key>BuildPhases</key>
40
+ <array>
41
+ <dict>
42
+ <key>Class</key>
43
+ <string>Sources</string>
44
+ </dict>
45
+ <dict>
46
+ <key>Class</key>
47
+ <string>Frameworks</string>
48
+ </dict>
49
+ <dict>
50
+ <key>Class</key>
51
+ <string>Resources</string>
52
+ </dict>
53
+ </array>
54
+ </dict>
55
+ </array>
56
+ <key>Nodes</key>
57
+ <array>
58
+ <string>HomeScreen.swift</string>
59
+ <string>BaseScreen.swift</string>
60
+ <string>HomeScreenSteps.swift</string>
61
+ <string>Hooks.swift</string>
62
+ <string>Extensions.swift</string>
63
+ <string>CommonStepDefinitions.swift</string>
64
+ <string>Info.plist:PackageType</string>
65
+ <string>___PACKAGENAMEASIDENTIFIER___-Bridging-Header.h</string>
66
+ <string>___PACKAGENAMEASIDENTIFIER___.h</string>
67
+ <string>___PACKAGENAMEASIDENTIFIER___.m</string>
68
+ <string>___PACKAGENAMEASIDENTIFIER___.swift</string>
69
+ </array>
70
+ <key>Definitions</key>
71
+ <dict>
72
+ <key>HomeScreen.swift</key>
73
+ <dict>
74
+ <key>Path</key>
75
+ <string>HomeScreen.swift</string>
76
+ <key>Group</key>
77
+ <string>Screens</string>
78
+ </dict>
79
+ <key>BaseScreen.swift</key>
80
+ <dict>
81
+ <key>Path</key>
82
+ <string>BaseScreen.swift</string>
83
+ <key>Group</key>
84
+ <string>Screens</string>
85
+ </dict>
86
+ <key>HomeScreenSteps.swift</key>
87
+ <dict>
88
+ <key>Path</key>
89
+ <string>HomeScreenSteps.swift</string>
90
+ <key>Group</key>
91
+ <string>Step Definitions</string>
92
+ </dict>
93
+ <key>Hooks.swift</key>
94
+ <dict>
95
+ <key>Path</key>
96
+ <string>Hooks.swift</string>
97
+ <key>Group</key>
98
+ <string>Common</string>
99
+ </dict>
100
+ <key>Extensions.swift</key>
101
+ <dict>
102
+ <key>Path</key>
103
+ <string>Extensions.swift</string>
104
+ <key>Group</key>
105
+ <string>Common</string>
106
+ </dict>
107
+ <key>CommonStepDefinitions.swift</key>
108
+ <dict>
109
+ <key>Path</key>
110
+ <string>CommonStepDefinitions.swift</string>
111
+ <key>Group</key>
112
+ <string>Common</string>
113
+ </dict>
114
+ <key>Info.plist:PackageType</key>
115
+ <string>&lt;key&gt;CFBundlePackageType&lt;/key&gt;
116
+ &lt;string&gt;BNDL&lt;/string&gt;
117
+ </string>
118
+ <key>___PACKAGENAMEASIDENTIFIER___-Bridging-Header.h</key>
119
+ <dict>
120
+ <key>Path</key>
121
+ <string>___PACKAGENAMEASIDENTIFIER___-Bridging-Header.h</string>
122
+ <key>Group</key>
123
+ <string>Supporting Files</string>
124
+ </dict>
125
+ <key>___PACKAGENAMEASIDENTIFIER___.swift</key>
126
+ <dict>
127
+ <key>Path</key>
128
+ <string>___PACKAGENAMEASIDENTIFIER___.swift</string>
129
+ </dict>
130
+ <key>___PACKAGENAMEASIDENTIFIER___.m</key>
131
+ <dict>
132
+ <key>Path</key>
133
+ <string>___PACKAGENAMEASIDENTIFIER___.m</string>
134
+ <key>Group</key>
135
+ <string>Supporting Files</string>
136
+ </dict>
137
+ <key>___PACKAGENAMEASIDENTIFIER___.h</key>
138
+ <dict>
139
+ <key>Path</key>
140
+ <string>___PACKAGENAMEASIDENTIFIER___.h</string>
141
+ <key>Group</key>
142
+ <string>Supporting Files</string>
143
+ </dict>
144
+ </dict>
145
+ </dict>
146
+ </plist>
@@ -0,0 +1,15 @@
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 is bridging header to manage objective-C dependencies in the Swift code. We are using Cucumberish steps. You probably don't need to touch this file.
12
+
13
+ */
14
+ #import "Cucumberish.h"
15
+ #import "CCIStepsManager.h"
@@ -0,0 +1,23 @@
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 is header file to manage objective-C dependencies in the Swift code. We are using Cucumberish steps. You probably don't need to touch this file.
12
+
13
+ */
14
+
15
+
16
+
17
+ #import <Foundation/Foundation.h>
18
+ #import "___PACKAGENAMEASIDENTIFIER___-Swift.h"
19
+
20
+
21
+ @interface ___PACKAGENAMEASIDENTIFIER___ : NSObject
22
+
23
+ @end
@@ -0,0 +1,28 @@
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 is objective-C contructor to initialise Cucumberish in our project.
12
+
13
+ */
14
+
15
+
16
+
17
+
18
+ #import <Foundation/Foundation.h>
19
+ #import "___PACKAGENAMEASIDENTIFIER___-Swift.h"
20
+ #import <XCTest/XCTest.h>
21
+
22
+
23
+ __attribute__((constructor))
24
+ void CucumberishInit()
25
+ {
26
+ [___PACKAGENAMEASIDENTIFIER___ CucumberishSwiftInit];
27
+
28
+ }
@@ -0,0 +1,37 @@
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 very important file as we will be using it as initialiser of all out test suite. We have to resgister all our Step Definitions in this class. e.g we have registed CommonStepDefinitions and HomeScreenSteps here
13
+
14
+ */
15
+
16
+
17
+ import Foundation
18
+ import XCTest
19
+ class ___PACKAGENAMEASIDENTIFIER___: NSObject {
20
+ class func CucumberishSwiftInit()
21
+ {
22
+ var application : XCUIApplication!
23
+ //A closure that will be executed just before executing any of your features
24
+ beforeStart { () -> Void in
25
+ application = XCUIApplication()
26
+ CommonStepDefinitions.setup(application);
27
+ HomeScreenSteps().HomeScreenSteps()
28
+ }
29
+ //A Given step definition
30
+ Given("the app is running") { (args, userInfo) -> Void in
31
+ application.launch()
32
+
33
+ }
34
+ //Tell Cucumberish the name of your features folder and let it execute them for you...
35
+ Cucumberish.executeFeaturesInDirectory("Features", includeTags: nil, excludeTags: nil)
36
+ }
37
+ }
@@ -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>osx, 10.8</string>
9
+ </dict>
10
+ <key>Kind</key>
11
+ <string>Xcode.Xcode3.ProjectTemplateUnitKind</string>
12
+ <key>Identifier</key>
13
+ <string>io.cleankit.macAcceptanceTestsUnitTestBundle</string>
14
+ <key>Name</key>
15
+ <string>Acceptance Unit Test Bundle</string>
16
+ <key>Description</key>
17
+ <string>This target builds an OS X 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.macosx</string>
23
+ </array>
24
+ <key>Ancestors</key>
25
+ <array>
26
+ <string>com.apple.dt.unit.osxBase</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,12 @@
1
+ <?xml version="1.0" encoding="UTF-8" standalone="no"?>
2
+ <document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="9531" systemVersion="15C50" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
3
+ <dependencies>
4
+ <deployment identifier="macosx"/>
5
+ <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="9531"/>
6
+ </dependencies>
7
+ <objects>
8
+ <customObject id="-2" userLabel="File's Owner" customClass="NSApplication"/>
9
+ <customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
10
+ <customObject id="-3" userLabel="Application" customClass="NSObject"/>
11
+ </objects>
12
+ </document>
@@ -0,0 +1,61 @@
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>osx</string>
9
+ </dict>
10
+ <key>Name</key>
11
+ <string>Acceptance Tests</string>
12
+ <key>Kind</key>
13
+ <string>Xcode.Xcode3.ProjectTemplateUnitKind</string>
14
+ <key>Identifier</key>
15
+ <string>io.cleankit.macAcceptanceTests</string>
16
+ <key>Description</key>
17
+ <string>This target builds an OS X 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.osxBase</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:MainNib</string>
38
+ <string>Info.plist:PrincipalClass</string>
39
+ <string>Empty.xib</string>
40
+ </array>
41
+ <key>Definitions</key>
42
+ <dict>
43
+ <key>Info.plist:MainNib</key>
44
+ <string>&lt;key&gt;NSMainNibFile&lt;/key&gt;
45
+ &lt;string&gt;Empty&lt;/string&gt;
46
+ </string>
47
+ <key>Info.plist:PrincipalClass</key>
48
+ <string>&lt;key&gt;NSPrincipalClass&lt;/key&gt;
49
+ &lt;string&gt;OCSlimNSApplicationRunner&lt;/string&gt;</string>
50
+ <key>Empty.xib</key>
51
+ <dict>
52
+ <key>Group</key>
53
+ <string>Supporting Files</string>
54
+ <key>Path</key>
55
+ <string>Empty.xib</string>
56
+ <key>SortOrder</key>
57
+ <integer>101</integer>
58
+ </dict>
59
+ </dict>
60
+ </dict>
61
+ </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.macOSUICucumberishTestingBundle</string>
9
+ <key>Ancestors</key>
10
+ <array>
11
+ <string>com.apple.dt.unit.cucumberishUITestBundleBase</string>
12
+ <string>com.apple.dt.unit.osxBase</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
+ <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___UITests</string>
36
+ </dict>
37
+ </array>
38
+ </dict>
39
+ </plist>
@@ -0,0 +1,42 @@
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. All the common varibales, functions, related to screens can be put here. This class will be perent class of your individual screen.
12
+
13
+ */
14
+
15
+
16
+ import XCTest
17
+ import Foundation
18
+
19
+ class BaseScreen: ___PACKAGENAMEASIDENTIFIER___TestBase {
20
+
21
+ func waitAndTap(element: XCUIElement) {
22
+
23
+ let exists = NSPredicate(format: "exists == true")
24
+
25
+ expectationForPredicate(exists, evaluatedWithObject: element, handler: nil)
26
+ waitForExpectationsWithTimeout(10, handler: nil)
27
+
28
+
29
+ element.tap()
30
+
31
+ }
32
+
33
+
34
+ func waitForExist(element: XCUIElement) {
35
+
36
+ let exists = NSPredicate(format: "exists == true")
37
+ expectationForPredicate(exists, evaluatedWithObject: element, handler: nil)
38
+ waitForExpectationsWithTimeout(10, handler: nil)
39
+ XCTAssert(element.exists)
40
+
41
+ }
42
+ }
@@ -0,0 +1,60 @@
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 file can take all the Swift extensions build around XCUI Test Frameworks which can be directly used in the tests, page objects. Here are sample extensions on XCUIElement and XCTestCase.
13
+
14
+ */
15
+
16
+
17
+
18
+ import Foundation
19
+ import XCTest
20
+
21
+ extension XCUIElement {
22
+
23
+ public func tapOnceVisible(testCase: XCTestCase,
24
+ file: String = #file, line: UInt = #line) {
25
+ let existsPredicate = NSPredicate(format: "exists == true")
26
+
27
+
28
+ testCase.expectationForPredicate(existsPredicate,
29
+ evaluatedWithObject: self, handler: nil)
30
+
31
+ testCase.waitForExpectationsWithTimeout(20) { (error) -> Void in
32
+ if (error != nil) {
33
+ let message = "Failed to find \(self) after 20 seconds."
34
+ testCase.recordFailureWithDescription(message,
35
+ inFile: file, atLine: line, expected: true)
36
+ }
37
+ }
38
+
39
+ self.tap()
40
+ }
41
+
42
+
43
+ }
44
+
45
+ extension XCTestCase {
46
+ func waitForElementToAppear(element: XCUIElement,
47
+ file: String = #file, line: UInt = #line) {
48
+ let existsPredicate = NSPredicate(format: "exists == true")
49
+ expectationForPredicate(existsPredicate,
50
+ evaluatedWithObject: element, handler: nil)
51
+
52
+ waitForExpectationsWithTimeout(20) { (error) -> Void in
53
+ if (error != nil) {
54
+ let message = "Failed to find \(element) after 5 seconds."
55
+ self.recordFailureWithDescription(message,
56
+ inFile: file, atLine: line, expected: true)
57
+ }
58
+ }
59
+ }
60
+ }
@@ -0,0 +1,31 @@
1
+ //
2
+ //
3
+ // Created by XCFit Framework
4
+ // Copyright © 2016 XCFit Framework. All rights reserved.
5
+ //
6
+ //
7
+
8
+
9
+ /*
10
+
11
+ 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.
12
+
13
+ Sectons 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.
14
+
15
+ */
16
+
17
+ import Foundation
18
+ import XCTest
19
+
20
+ public enum Images: String {
21
+ case bannerImage = "Banner"
22
+ }
23
+
24
+ public enum Buttons: String {
25
+ case homeButton = "Home"
26
+ }
27
+
28
+
29
+ public enum StaticTextx: String {
30
+ case homeLink = "homelink"
31
+ }
@@ -0,0 +1,25 @@
1
+ //
2
+ // HomeProtocol.swift
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
+ Swift is protocol oriented language so feel to start with Protocol per scren. 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.
13
+
14
+ */
15
+
16
+ import Foundation
17
+ import XCTest
18
+
19
+ protocol HomeProtocol {
20
+
21
+ func launchApp()
22
+ func tapHomebutton()
23
+
24
+
25
+ }