xcfit 2.0.2 → 2.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Xcode7-Templates/XCFit/Base Acceptance Testing Bundle.xctemplate/TemplateIcon.icns +0 -0
- data/Xcode7-Templates/XCFit/Base Acceptance Testing Bundle.xctemplate/TemplateInfo.plist +134 -0
- data/Xcode7-Templates/XCFit/Base Acceptance Testing Bundle.xctemplate/___PACKAGENAMEASIDENTIFIER___.m +17 -0
- data/Xcode7-Templates/XCFit/Base Acceptance Testing Bundle.xctemplate/___PACKAGENAMEASIDENTIFIER___.swift +13 -0
- data/Xcode7-Templates/XCFit/Base Acceptance Testing Bundle.xctemplate/___POD_NAME___.m +25 -0
- data/Xcode7-Templates/XCFit/Base Acceptance Tests.xctemplate/AcceptanceTests-Bridging-Header.h +1 -0
- data/Xcode7-Templates/XCFit/Base Acceptance Tests.xctemplate/FixtureExample.swift +35 -0
- data/Xcode7-Templates/XCFit/Base Acceptance Tests.xctemplate/SlimTables.h +28 -0
- data/Xcode7-Templates/XCFit/Base Acceptance Tests.xctemplate/TemplateInfo.plist +155 -0
- data/Xcode7-Templates/XCFit/Base Acceptance Tests.xctemplate/___PACKAGENAMEASIDENTIFIER___-Bridging-Header.h +12 -0
- data/Xcode7-Templates/XCFit/Base Acceptance Tests.xctemplate/___PACKAGENAMEASIDENTIFIER___.m +33 -0
- data/Xcode7-Templates/XCFit/Cucumberish UI Test Bundle Base.xctemplate/BaseScreen.swift +41 -0
- data/Xcode7-Templates/XCFit/Cucumberish UI Test Bundle Base.xctemplate/CommonStepDefinitions.swift +92 -0
- data/Xcode7-Templates/XCFit/Cucumberish UI Test Bundle Base.xctemplate/Extensions.swift +58 -0
- data/Xcode7-Templates/XCFit/Cucumberish UI Test Bundle Base.xctemplate/HomeScreen.swift +24 -0
- data/Xcode7-Templates/XCFit/Cucumberish UI Test Bundle Base.xctemplate/HomeScreenSteps.swift +28 -0
- data/Xcode7-Templates/XCFit/Cucumberish UI Test Bundle Base.xctemplate/Hooks.swift +26 -0
- data/Xcode7-Templates/XCFit/Cucumberish UI Test Bundle Base.xctemplate/TemplateIcon.png +0 -0
- data/Xcode7-Templates/XCFit/Cucumberish UI Test Bundle Base.xctemplate/TemplateIcon@2x.png +0 -0
- data/Xcode7-Templates/XCFit/Cucumberish UI Test Bundle Base.xctemplate/TemplateInfo.plist +146 -0
- data/Xcode7-Templates/XCFit/Cucumberish UI Test Bundle Base.xctemplate/___PACKAGENAMEASIDENTIFIER___-Bridging-Header.h +15 -0
- data/Xcode7-Templates/XCFit/Cucumberish UI Test Bundle Base.xctemplate/___PACKAGENAMEASIDENTIFIER___.h +23 -0
- data/Xcode7-Templates/XCFit/Cucumberish UI Test Bundle Base.xctemplate/___PACKAGENAMEASIDENTIFIER___.m +28 -0
- data/Xcode7-Templates/XCFit/Cucumberish UI Test Bundle Base.xctemplate/___PACKAGENAMEASIDENTIFIER___.swift +37 -0
- data/Xcode7-Templates/XCFit/Mac Acceptance Testing Bundle.xctemplate/TemplateIcon.icns +0 -0
- data/Xcode7-Templates/XCFit/Mac Acceptance Testing Bundle.xctemplate/TemplateInfo.plist +40 -0
- data/Xcode7-Templates/XCFit/Mac Acceptance Tests.xctemplate/Empty.xib +12 -0
- data/Xcode7-Templates/XCFit/Mac Acceptance Tests.xctemplate/TemplateIcon.icns +0 -0
- data/Xcode7-Templates/XCFit/Mac Acceptance Tests.xctemplate/TemplateInfo.plist +61 -0
- data/Xcode7-Templates/XCFit/MacOS UI Cucumberish Testing Bundle.xctemplate/TemplateInfo.plist +39 -0
- data/Xcode7-Templates/XCFit/XCUI POM Test Bundle Base.xctemplate/BaseScreen.swift +42 -0
- data/Xcode7-Templates/XCFit/XCUI POM Test Bundle Base.xctemplate/Extensions.swift +60 -0
- data/Xcode7-Templates/XCFit/XCUI POM Test Bundle Base.xctemplate/HomeElements.swift +31 -0
- data/Xcode7-Templates/XCFit/XCUI POM Test Bundle Base.xctemplate/HomeProtocol.swift +25 -0
- data/Xcode7-Templates/XCFit/XCUI POM Test Bundle Base.xctemplate/HomeScreen.swift +24 -0
- data/Xcode7-Templates/XCFit/XCUI POM Test Bundle Base.xctemplate/HomeScreenTest.swift +30 -0
- data/Xcode7-Templates/XCFit/XCUI POM Test Bundle Base.xctemplate/ProtocolOrientedTest.swift +45 -0
- data/Xcode7-Templates/XCFit/XCUI POM Test Bundle Base.xctemplate/TemplateIcon.png +0 -0
- data/Xcode7-Templates/XCFit/XCUI POM Test Bundle Base.xctemplate/TemplateIcon@2x.png +0 -0
- data/Xcode7-Templates/XCFit/XCUI POM Test Bundle Base.xctemplate/TemplateInfo.plist +141 -0
- data/Xcode7-Templates/XCFit/XCUI POM Test Bundle Base.xctemplate/___PACKAGENAMEASIDENTIFIER___TestBase.swift +30 -0
- data/Xcode7-Templates/XCFit/iOS Acceptance Testing Bundle.xctemplate/TemplateIcon-old.icns +0 -0
- data/Xcode7-Templates/XCFit/iOS Acceptance Testing Bundle.xctemplate/TemplateIcon.png +0 -0
- data/Xcode7-Templates/XCFit/iOS Acceptance Testing Bundle.xctemplate/TemplateIcon@2x.png +0 -0
- data/Xcode7-Templates/XCFit/iOS Acceptance Testing Bundle.xctemplate/TemplateInfo.plist +40 -0
- data/Xcode7-Templates/XCFit/iOS Acceptance Tests.xctemplate/TemplateIcon-old.icns +0 -0
- data/Xcode7-Templates/XCFit/iOS Acceptance Tests.xctemplate/TemplateIcon.png +0 -0
- data/Xcode7-Templates/XCFit/iOS Acceptance Tests.xctemplate/TemplateIcon@2x.png +0 -0
- data/Xcode7-Templates/XCFit/iOS Acceptance Tests.xctemplate/TemplateInfo.plist +59 -0
- data/Xcode7-Templates/XCFit/iOS UI Cucumberish Testing Bundle.xctemplate/TemplateInfo.plist +28 -0
- data/Xcode7-Templates/XCFit/iOS XCUI POM Test Bundle.xctemplate/TemplateInfo.plist +39 -0
- data/lib/XCFit/main.rb +60 -43
- data/lib/XCFit/version.rb +1 -1
- metadata +64 -13
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cd565c347e035731e8ad3780901cd8c1c104dbbf
|
4
|
+
data.tar.gz: 0b8b0d889b6b2df8eb7c1937d004592c73248144
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 649795e6184db5a918f721a961bb22a88a609ad23f5e2be1cd31209e24eedb58e0fab33672dd0de4e1a3317d8571742a2ec7e2c9cf5cf147a5ad86527b98e639
|
7
|
+
data.tar.gz: 58cb49e3f39e88fe50b8f4ea681117c328b782403d194ad921e82008fb05902cab20dfed0d4a5899110a0a94b9d2024ec1fb9912436d35bd3ab33734442c9da1
|
Binary file
|
@@ -0,0 +1,134 @@
|
|
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>TargetOnly</key>
|
6
|
+
<true/>
|
7
|
+
<key>Macros</key>
|
8
|
+
<dict>
|
9
|
+
<key>POD_ABBREVIATION</key>
|
10
|
+
<string>OCSP</string>
|
11
|
+
<key>POD_PLATFORM_IDENTIFIER</key>
|
12
|
+
<string>___POD_PLATFORM_IDENTIFIER___</string>
|
13
|
+
<key>POD_NAME</key>
|
14
|
+
<string>OCSlimProjectTestBundleSupport</string>
|
15
|
+
<key>PRINCIPALCLASSNAME</key>
|
16
|
+
<string>OCSPTestSuite</string>
|
17
|
+
</dict>
|
18
|
+
<key>Kind</key>
|
19
|
+
<string>Xcode.Xcode3.ProjectTemplateUnitKind</string>
|
20
|
+
<key>Identifier</key>
|
21
|
+
<string>io.cleankit.baseAcceptanceTestsUnitTestBundle</string>
|
22
|
+
<key>Ancestors</key>
|
23
|
+
<array>
|
24
|
+
<string>com.apple.dt.unit.unitTestBundleBase</string>
|
25
|
+
</array>
|
26
|
+
<key>Targets</key>
|
27
|
+
<array>
|
28
|
+
<dict>
|
29
|
+
<key>BuildPhases</key>
|
30
|
+
<array>
|
31
|
+
<dict>
|
32
|
+
<key>Name</key>
|
33
|
+
<string>[___POD_ABBREVIATION___] Generate Fitnesse Test Bundle Resource File</string>
|
34
|
+
<key>Class</key>
|
35
|
+
<string>ShellScript</string>
|
36
|
+
<key>ShellPath</key>
|
37
|
+
<string>/bin/sh</string>
|
38
|
+
<key>ShellScript</key>
|
39
|
+
<string>FITNESSE_SUITE_NAME="___VARIABLE_fitnesseSuiteName___"
|
40
|
+
TEST_REPORT_FILE_PATH="${OCSP_TEST_REPORT_FILE_PATH}"
|
41
|
+
${OCSP_SUPPORT_FILE_DIR}/ocsp-generate-fitnesse-test-report.sh $FITNESSE_SUITE_NAME $TEST_REPORT_FILE_PATH</string>
|
42
|
+
</dict>
|
43
|
+
</array>
|
44
|
+
</dict>
|
45
|
+
</array>
|
46
|
+
<key>Options</key>
|
47
|
+
<array>
|
48
|
+
<dict>
|
49
|
+
<key>Identifier</key>
|
50
|
+
<string>languageChoice</string>
|
51
|
+
<key>Units</key>
|
52
|
+
<dict>
|
53
|
+
<key>Objective-C</key>
|
54
|
+
<dict>
|
55
|
+
<key>Definitions</key>
|
56
|
+
<dict>
|
57
|
+
<key>___PACKAGENAMEASIDENTIFIER___.m</key>
|
58
|
+
<dict>
|
59
|
+
<key>Path</key>
|
60
|
+
<string>___PACKAGENAMEASIDENTIFIER___.m</string>
|
61
|
+
</dict>
|
62
|
+
</dict>
|
63
|
+
<key>Nodes</key>
|
64
|
+
<array>
|
65
|
+
<string>___PACKAGENAMEASIDENTIFIER___.m</string>
|
66
|
+
</array>
|
67
|
+
</dict>
|
68
|
+
<key>Swift</key>
|
69
|
+
<dict>
|
70
|
+
<key>Definitions</key>
|
71
|
+
<dict>
|
72
|
+
<key>___PACKAGENAMEASIDENTIFIER___.swift</key>
|
73
|
+
<dict>
|
74
|
+
<key>Path</key>
|
75
|
+
<string>___PACKAGENAMEASIDENTIFIER___.swift</string>
|
76
|
+
</dict>
|
77
|
+
</dict>
|
78
|
+
<key>Nodes</key>
|
79
|
+
<array>
|
80
|
+
<string>___PACKAGENAMEASIDENTIFIER___.swift</string>
|
81
|
+
</array>
|
82
|
+
</dict>
|
83
|
+
</dict>
|
84
|
+
</dict>
|
85
|
+
<dict>
|
86
|
+
<key>SortOrder</key>
|
87
|
+
<integer>0</integer>
|
88
|
+
<key>EmptyReplacement</key>
|
89
|
+
<string><Required></string>
|
90
|
+
<key>Required</key>
|
91
|
+
<true/>
|
92
|
+
<key>Name</key>
|
93
|
+
<string>Fitnesse Suite Page Name:</string>
|
94
|
+
<key>Identifier</key>
|
95
|
+
<string>fitnesseSuiteName</string>
|
96
|
+
<key>Description</key>
|
97
|
+
<string>Your Fitnesse test suite's page name (e.g. FrontPage)</string>
|
98
|
+
<key>Type</key>
|
99
|
+
<string>text</string>
|
100
|
+
<key>NotPersisted</key>
|
101
|
+
<true/>
|
102
|
+
</dict>
|
103
|
+
<dict>
|
104
|
+
<key>SortOrder</key>
|
105
|
+
<integer>1</integer>
|
106
|
+
<key>Identifier</key>
|
107
|
+
<string>fitnesseURL</string>
|
108
|
+
<key>Name</key>
|
109
|
+
<string>Fitnesse Suite Test URL:</string>
|
110
|
+
<key>NotPersisted</key>
|
111
|
+
<true/>
|
112
|
+
<key>Description</key>
|
113
|
+
<string>Your fitnesse test suite URL</string>
|
114
|
+
<key>Default</key>
|
115
|
+
<string>http://localhost:8080/___VARIABLE_fitnesseSuiteName___?suite</string>
|
116
|
+
<key>Type</key>
|
117
|
+
<string>static</string>
|
118
|
+
</dict>
|
119
|
+
|
120
|
+
</array>
|
121
|
+
<key>Nodes</key>
|
122
|
+
<array>
|
123
|
+
<string>___POD_NAME___.m</string>
|
124
|
+
</array>
|
125
|
+
<key>Definitions</key>
|
126
|
+
<dict>
|
127
|
+
<key>___POD_NAME___.m</key>
|
128
|
+
<dict>
|
129
|
+
<key>Path</key>
|
130
|
+
<string>___POD_NAME___.m</string>
|
131
|
+
</dict>
|
132
|
+
</dict>
|
133
|
+
</dict>
|
134
|
+
</plist>
|
@@ -0,0 +1,17 @@
|
|
1
|
+
//
|
2
|
+
// ___FILENAME___
|
3
|
+
// ___PACKAGENAME___
|
4
|
+
//
|
5
|
+
// Created by ___FULLUSERNAME___ on ___DATE___.
|
6
|
+
//___COPYRIGHT___
|
7
|
+
//
|
8
|
+
|
9
|
+
#import <XCTest/XCTest.h>
|
10
|
+
|
11
|
+
@interface ___FILEBASENAMEASIDENTIFIER___ : XCTestCase
|
12
|
+
|
13
|
+
@end
|
14
|
+
|
15
|
+
@implementation ___FILEBASENAMEASIDENTIFIER___
|
16
|
+
|
17
|
+
@end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
//
|
2
|
+
// ___FILENAME___
|
3
|
+
// ___POD_NAME___
|
4
|
+
//
|
5
|
+
// Created by OCSlimProject on ___DATE___.
|
6
|
+
// MIT License
|
7
|
+
// © 2016 Paul Stringer
|
8
|
+
//
|
9
|
+
//
|
10
|
+
|
11
|
+
#if __has_include(<___POD_NAME___/___PRINCIPALCLASSNAME___.h>)
|
12
|
+
#else
|
13
|
+
#pragma GCC error "Target requires pod '___POD_NAME___'. Add the entry \"pod '___POD_NAME___'\" to your Podfile configuration."
|
14
|
+
#endif
|
15
|
+
|
16
|
+
/* Copy and paste this entry to your projects Podfile and run 'pod install' or 'pod update' as necessary
|
17
|
+
|
18
|
+
target '___PACKAGENAMEASIDENTIFIER___' do
|
19
|
+
platform :___POD_PLATFORM_IDENTIFIER___
|
20
|
+
pod '___POD_NAME___'
|
21
|
+
end
|
22
|
+
|
23
|
+
https://cocoapods.org/?q=___POD_NAME___
|
24
|
+
|
25
|
+
*/
|
data/Xcode7-Templates/XCFit/Base Acceptance Tests.xctemplate/AcceptanceTests-Bridging-Header.h
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
#import "SlimTables.h"
|
@@ -0,0 +1,35 @@
|
|
1
|
+
import Foundation
|
2
|
+
|
3
|
+
@objc(FixtureExample)
|
4
|
+
|
5
|
+
class FixtureExample : NSObject, SlimDecisionTable {
|
6
|
+
|
7
|
+
//MARK: Inputs
|
8
|
+
|
9
|
+
var input = ""
|
10
|
+
|
11
|
+
//MARK: <SlimDecisionTable>
|
12
|
+
|
13
|
+
func execute() {
|
14
|
+
// 1. Prepare a System Under Test (SUT) using the given inputs.
|
15
|
+
// e.g. let system = MySystemUnderTestContext(input: input)
|
16
|
+
// 2. Run your SUT
|
17
|
+
// 3. Take values from the SUT and return via outputs
|
18
|
+
}
|
19
|
+
|
20
|
+
//MARK: Outputs
|
21
|
+
|
22
|
+
var output: NSString? {
|
23
|
+
get {
|
24
|
+
switch input {
|
25
|
+
case "foo":
|
26
|
+
return "bar"
|
27
|
+
case "bar":
|
28
|
+
return "baz"
|
29
|
+
default:
|
30
|
+
return nil
|
31
|
+
}
|
32
|
+
}
|
33
|
+
}
|
34
|
+
|
35
|
+
}
|
@@ -0,0 +1,28 @@
|
|
1
|
+
#import <Foundation/Foundation.h>
|
2
|
+
|
3
|
+
// Slim Decision Table
|
4
|
+
// http://www.fitnesse.org/FitNesse.UserGuide.WritingAcceptanceTests.SliM.DecisionTable
|
5
|
+
|
6
|
+
@protocol SlimDecisionTable <NSObject>
|
7
|
+
|
8
|
+
@optional
|
9
|
+
- (void)table:(NSArray*)table;
|
10
|
+
- (void)beginTable;
|
11
|
+
- (void)endTable;
|
12
|
+
- (void)reset;
|
13
|
+
@required
|
14
|
+
- (void)execute;
|
15
|
+
|
16
|
+
@end
|
17
|
+
|
18
|
+
// Slim Query Table
|
19
|
+
// http://www.fitnesse.org/FitNesse.UserGuide.WritingAcceptanceTests.SliM.QueryTable
|
20
|
+
|
21
|
+
@protocol SlimQueryTable <NSObject>
|
22
|
+
|
23
|
+
@optional
|
24
|
+
- (void)table:(NSArray*)table;
|
25
|
+
@required
|
26
|
+
- (NSArray*)query;
|
27
|
+
|
28
|
+
@end
|
@@ -0,0 +1,155 @@
|
|
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_ABBREVIATION</key>
|
8
|
+
<string>OCSP</string>
|
9
|
+
<key>POD_NAME</key>
|
10
|
+
<string>OCSlimProject</string>
|
11
|
+
<key>POD_PLATFORM_IDENTIFIER</key>
|
12
|
+
<string>___POD_PLATFORM_IDENTIFIER___</string>
|
13
|
+
</dict>
|
14
|
+
<key>Kind</key>
|
15
|
+
<string>Xcode.Xcode3.ProjectTemplateUnitKind</string>
|
16
|
+
<key>Swift</key>
|
17
|
+
<dict>
|
18
|
+
<key>Nodes</key>
|
19
|
+
<array/>
|
20
|
+
<key>Definitions</key>
|
21
|
+
<dict>
|
22
|
+
<key>___PACKAGENAMEASIDENTIFIER___.swift</key>
|
23
|
+
<dict>
|
24
|
+
<key>Path</key>
|
25
|
+
<string>___PACKAGENAMEASIDENTIFIER___.swift</string>
|
26
|
+
</dict>
|
27
|
+
</dict>
|
28
|
+
</dict>
|
29
|
+
<key>Ancestors</key>
|
30
|
+
<array>
|
31
|
+
<string>com.apple.dt.unit.applicationBase</string>
|
32
|
+
</array>
|
33
|
+
<key>Identifier</key>
|
34
|
+
<string>io.cleankit.baseAcceptanceTests</string>
|
35
|
+
<key>Concrete</key>
|
36
|
+
<false/>
|
37
|
+
<key>TargetOnly</key>
|
38
|
+
<true/>
|
39
|
+
<key>Targets</key>
|
40
|
+
<array>
|
41
|
+
<dict>
|
42
|
+
<key>ProductType</key>
|
43
|
+
<string>com.apple.product-type.application</string>
|
44
|
+
<key>SharedSettings</key>
|
45
|
+
<dict>
|
46
|
+
<key>LD_RUNPATH_SEARCH_PATHS</key>
|
47
|
+
<string>$(inherited) @executable_path/../Frameworks</string>
|
48
|
+
<key>SWIFT_OBJC_BRIDGING_HEADER</key>
|
49
|
+
<string>___PACKAGENAMEASIDENTIFIER___/___PACKAGENAMEASIDENTIFIER___-Bridging-Header.h</string>
|
50
|
+
</dict>
|
51
|
+
<key>BuildPhases</key>
|
52
|
+
<array>
|
53
|
+
<dict>
|
54
|
+
<key>Name</key>
|
55
|
+
<string>[___POD_ABBREVIATION___] Generate Fitnesse Test System Scripts</string>
|
56
|
+
<key>Class</key>
|
57
|
+
<string>ShellScript</string>
|
58
|
+
<key>ShellPath</key>
|
59
|
+
<string>/bin/sh</string>
|
60
|
+
<key>ShellScript</key>
|
61
|
+
<string>${OCSP_SUPPORT_FILE_DIR}/ocsp-generate-fitnesse-test-system-scripts.sh "${OCSP_BUNDLE_RESOURCES_DIR}"</string>
|
62
|
+
</dict>
|
63
|
+
</array>
|
64
|
+
</dict>
|
65
|
+
</array>
|
66
|
+
<key>Nodes</key>
|
67
|
+
<array>
|
68
|
+
<string>___PACKAGENAMEASIDENTIFIER___-Bridging-Header.h</string>
|
69
|
+
<string>___PACKAGENAMEASIDENTIFIER___.m</string>
|
70
|
+
<string>FixtureExample.swift</string>
|
71
|
+
<string>SlimTables.h</string>
|
72
|
+
<string>Info.plist:PackageType</string>
|
73
|
+
</array>
|
74
|
+
<key>Definitions</key>
|
75
|
+
<dict>
|
76
|
+
<key>___PACKAGENAMEASIDENTIFIER___-Bridging-Header.h</key>
|
77
|
+
<dict>
|
78
|
+
<key>Path</key>
|
79
|
+
<string>___PACKAGENAMEASIDENTIFIER___-Bridging-Header.h</string>
|
80
|
+
<key>Group</key>
|
81
|
+
<string>Supporting Files</string>
|
82
|
+
<key>SortOrder</key>
|
83
|
+
<integer>100</integer>
|
84
|
+
</dict>
|
85
|
+
<key>___PACKAGENAMEASIDENTIFIER___.m</key>
|
86
|
+
<dict>
|
87
|
+
<key>Path</key>
|
88
|
+
<string>___PACKAGENAMEASIDENTIFIER___.m</string>
|
89
|
+
<key>Group</key>
|
90
|
+
<string>Supporting Files</string>
|
91
|
+
</dict>
|
92
|
+
<key>FixtureExample.swift</key>
|
93
|
+
<dict>
|
94
|
+
<key>Path</key>
|
95
|
+
<string>FixtureExample.swift</string>
|
96
|
+
<key>Group</key>
|
97
|
+
<string>Fixtures</string>
|
98
|
+
</dict>
|
99
|
+
<key>SlimTables.h</key>
|
100
|
+
<dict>
|
101
|
+
<key>Path</key>
|
102
|
+
<string>SlimTables.h</string>
|
103
|
+
<key>Group</key>
|
104
|
+
<string>Supporting Files</string>
|
105
|
+
</dict>
|
106
|
+
<key>Info.plist:PackageType</key>
|
107
|
+
<string><key>CFBundlePackageType</key>
|
108
|
+
<string>APPL</string>
|
109
|
+
</string>
|
110
|
+
</dict>
|
111
|
+
<key>Options</key>
|
112
|
+
<array>
|
113
|
+
<dict>
|
114
|
+
<key>Identifier</key>
|
115
|
+
<string>languageChoice</string>
|
116
|
+
<key>Units</key>
|
117
|
+
<dict>
|
118
|
+
<key>Swift</key>
|
119
|
+
<dict>
|
120
|
+
<key>Project</key>
|
121
|
+
<dict>
|
122
|
+
<key>Configurations</key>
|
123
|
+
<dict>
|
124
|
+
<key>Debug</key>
|
125
|
+
<dict>
|
126
|
+
<key>SWIFT_OPTIMIZATION_LEVEL</key>
|
127
|
+
<string>-Onone</string>
|
128
|
+
<key>SWIFT_ACTIVE_COMPILATION_CONDITIONS</key>
|
129
|
+
<string>DEBUG</string>
|
130
|
+
</dict>
|
131
|
+
<key>Release</key>
|
132
|
+
<dict>
|
133
|
+
<key>SWIFT_OPTIMIZATION_LEVEL</key>
|
134
|
+
<string>-Owholemodule</string>
|
135
|
+
</dict>
|
136
|
+
</dict>
|
137
|
+
</dict>
|
138
|
+
<key>Targets</key>
|
139
|
+
<array>
|
140
|
+
<dict>
|
141
|
+
<key>Concrete</key>
|
142
|
+
<false/>
|
143
|
+
<key>SharedSettings</key>
|
144
|
+
<dict>
|
145
|
+
<key>SWIFT_VERSION</key>
|
146
|
+
<string>3.0</string>
|
147
|
+
</dict>
|
148
|
+
</dict>
|
149
|
+
</array>
|
150
|
+
</dict>
|
151
|
+
</dict>
|
152
|
+
</dict>
|
153
|
+
</array>
|
154
|
+
</dict>
|
155
|
+
</plist>
|
@@ -0,0 +1,33 @@
|
|
1
|
+
//
|
2
|
+
// ___FILENAME___
|
3
|
+
// ___POD_NAME___
|
4
|
+
//
|
5
|
+
// Created by OCSlimProject on ___DATE___.
|
6
|
+
// MIT License
|
7
|
+
// © 2016 Paul Stringer
|
8
|
+
//
|
9
|
+
|
10
|
+
|
11
|
+
#import <Foundation/Foundation.h>
|
12
|
+
|
13
|
+
#if __has_include(<___POD_NAME___/___POD_NAME___.h>)
|
14
|
+
#else
|
15
|
+
#pragma GCC error "Target requires pod '___POD_NAME___'. Add the entry \"pod '___POD_NAME___'\" to your Podfile configuration."
|
16
|
+
#endif
|
17
|
+
|
18
|
+
/* Copy and paste this entry to your projects Podfile and run 'pod install' or 'pod update' as necessary
|
19
|
+
|
20
|
+
target '___PACKAGENAMEASIDENTIFIER___' do
|
21
|
+
platform :___POD_PLATFORM_IDENTIFIER___
|
22
|
+
pod '___POD_NAME___'
|
23
|
+
end
|
24
|
+
|
25
|
+
|
26
|
+
https://cocoapods.org/?q=___POD_NAME___
|
27
|
+
|
28
|
+
*/
|
29
|
+
|
30
|
+
@interface ___PACKAGENAMEASIDENTIFIER___ : NSObject
|
31
|
+
@end
|
32
|
+
@implementation ___PACKAGENAMEASIDENTIFIER___
|
33
|
+
@end
|
@@ -0,0 +1,41 @@
|
|
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
|
+
import XCTest
|
16
|
+
import Foundation
|
17
|
+
|
18
|
+
class BaseScreen: XCTestCase {
|
19
|
+
|
20
|
+
func waitAndTap(element: XCUIElement) {
|
21
|
+
|
22
|
+
let exists = NSPredicate(format: "exists == true")
|
23
|
+
|
24
|
+
expectationForPredicate(exists, evaluatedWithObject: element, handler: nil)
|
25
|
+
waitForExpectationsWithTimeout(50, handler: nil)
|
26
|
+
|
27
|
+
element.tap()
|
28
|
+
|
29
|
+
}
|
30
|
+
|
31
|
+
|
32
|
+
func waitForExist(element: XCUIElement) {
|
33
|
+
|
34
|
+
let exists = NSPredicate(format: "exists == true")
|
35
|
+
|
36
|
+
self.expectationForPredicate(exists, evaluatedWithObject: element, handler: nil)
|
37
|
+
waitForExpectationsWithTimeout(50, handler: nil)
|
38
|
+
XCTAssert(element.exists)
|
39
|
+
|
40
|
+
}
|
41
|
+
}
|
data/Xcode7-Templates/XCFit/Cucumberish UI Test Bundle Base.xctemplate/CommonStepDefinitions.swift
ADDED
@@ -0,0 +1,92 @@
|
|
1
|
+
//
|
2
|
+
// CommonStepDefinitions.swift
|
3
|
+
// Originally Created Ahmed Ali [ Cucumberish] and re-written 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 class has some mostly used step definitions included here. You can add some more here if needed.
|
13
|
+
|
14
|
+
*/
|
15
|
+
|
16
|
+
import XCTest
|
17
|
+
|
18
|
+
class CommonStepDefinitions: NSObject {
|
19
|
+
|
20
|
+
internal var application : XCUIApplication!
|
21
|
+
|
22
|
+
internal func elementByLabel(label : String, type: String) -> XCUIElement
|
23
|
+
{
|
24
|
+
var elementQurey : XCUIElementQuery!
|
25
|
+
switch(type){
|
26
|
+
case "button":
|
27
|
+
elementQurey = application.buttons
|
28
|
+
case "label":
|
29
|
+
elementQurey = application.staticTexts
|
30
|
+
case "tab":
|
31
|
+
elementQurey = application.tabs
|
32
|
+
case "field", "text field":
|
33
|
+
elementQurey = application.textFields
|
34
|
+
case "textView", "text view":
|
35
|
+
elementQurey = application.textViews
|
36
|
+
case "view":
|
37
|
+
elementQurey = application.otherElements
|
38
|
+
default: elementQurey = application.otherElements
|
39
|
+
}
|
40
|
+
return elementQurey[label]
|
41
|
+
}
|
42
|
+
|
43
|
+
internal func setup(application: XCUIApplication)
|
44
|
+
{
|
45
|
+
self.application = application
|
46
|
+
//And/When/Then/But I tap the "Header" view
|
47
|
+
MatchAll("^I tap (?:the )?\"([^\\\"]*)\" (button|label|tab|view|field|textView)$") { (args, userInfo) -> Void in
|
48
|
+
let label = args?[0]
|
49
|
+
let type = args?[1]
|
50
|
+
self.elementByLabel(label!, type: type!).tap()
|
51
|
+
}
|
52
|
+
|
53
|
+
//And/When/Then/But I tap the "Increment" button 5 times
|
54
|
+
MatchAll("^I tap (?:the )?\"([^\\\"]*)\" (button|label|tab|view) ([1-9]{1}) time(?:s)?$") { (args, userInfo) -> Void in
|
55
|
+
let label = args?[0]
|
56
|
+
let type = args?[1]
|
57
|
+
let times = NSString(string: (args?[2])!).integerValue
|
58
|
+
let element = self.elementByLabel(label!, type: type!)
|
59
|
+
for _ in 0 ..< times{
|
60
|
+
element.tap()
|
61
|
+
}
|
62
|
+
}
|
63
|
+
// Then I write "Ahmed Ali" into the "Name" field
|
64
|
+
|
65
|
+
//When/And/But/When I write "Ahmed" in the "Name" field
|
66
|
+
MatchAll("^I write \"([^\\\"]*)\" (?:into|in) (?:the )?\"([^\\\"]*)\" (field|text view)$") { (args, userInfo) -> Void in
|
67
|
+
let type = args?[2]
|
68
|
+
let label = args?[1]
|
69
|
+
let element = self.elementByLabel(label!, type: type!)
|
70
|
+
element.tap()
|
71
|
+
element.typeText((args?[0])!)
|
72
|
+
}
|
73
|
+
|
74
|
+
|
75
|
+
MatchAll("^I switch (on|off) the \"([^\\\"]*)\" switch$") { (args, userInfo) -> Void in
|
76
|
+
let theSwitch = application.switches[(args?[1])!]
|
77
|
+
let currentValu = NSString(string: theSwitch.value as! String).integerValue
|
78
|
+
let newValue = args?[0] == "on" ? 1 : 0
|
79
|
+
if(currentValu != newValue){
|
80
|
+
theSwitch.tap()
|
81
|
+
}
|
82
|
+
|
83
|
+
}
|
84
|
+
|
85
|
+
|
86
|
+
}
|
87
|
+
|
88
|
+
class func setup(application: XCUIApplication)
|
89
|
+
{
|
90
|
+
CommonStepDefinitions().setup(application)
|
91
|
+
}
|
92
|
+
}
|
@@ -0,0 +1,58 @@
|
|
1
|
+
//
|
2
|
+
// Extensions.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
|
+
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
|
+
import Foundation
|
17
|
+
import XCTest
|
18
|
+
|
19
|
+
extension XCUIElement {
|
20
|
+
|
21
|
+
public func tapOnceVisible(testCase: XCTestCase,
|
22
|
+
file: String = #file, line: UInt = #line) {
|
23
|
+
let existsPredicate = NSPredicate(format: "exists == true")
|
24
|
+
|
25
|
+
|
26
|
+
testCase.expectationForPredicate(existsPredicate,
|
27
|
+
evaluatedWithObject: self, handler: nil)
|
28
|
+
|
29
|
+
testCase.waitForExpectationsWithTimeout(20) { (error) -> Void in
|
30
|
+
if (error != nil) {
|
31
|
+
let message = "Failed to find \(self) after 20 seconds."
|
32
|
+
testCase.recordFailureWithDescription(message,
|
33
|
+
inFile: file, atLine: line, expected: true)
|
34
|
+
}
|
35
|
+
}
|
36
|
+
|
37
|
+
self.tap()
|
38
|
+
}
|
39
|
+
|
40
|
+
|
41
|
+
}
|
42
|
+
|
43
|
+
extension XCTestCase {
|
44
|
+
func waitForElementToAppear(element: XCUIElement,
|
45
|
+
file: String = #file, line: UInt = #line) {
|
46
|
+
let existsPredicate = NSPredicate(format: "exists == true")
|
47
|
+
expectationForPredicate(existsPredicate,
|
48
|
+
evaluatedWithObject: element, handler: nil)
|
49
|
+
|
50
|
+
waitForExpectationsWithTimeout(20) { (error) -> Void in
|
51
|
+
if (error != nil) {
|
52
|
+
let message = "Failed to find \(element) after 5 seconds."
|
53
|
+
self.recordFailureWithDescription(message,
|
54
|
+
inFile: file, atLine: line, expected: true)
|
55
|
+
}
|
56
|
+
}
|
57
|
+
}
|
58
|
+
}
|