xcfit 2.0.1 → 2.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +19 -4
- data/XCFit_Templates/XCFit/Cucumberish UI Test Bundle Base.xctemplate/BaseScreen.swift +8 -0
- data/XCFit_Templates/XCFit/Cucumberish UI Test Bundle Base.xctemplate/CommonStepDefinitions.swift +8 -0
- data/XCFit_Templates/XCFit/Cucumberish UI Test Bundle Base.xctemplate/Extensions.swift +8 -0
- data/XCFit_Templates/XCFit/Cucumberish UI Test Bundle Base.xctemplate/HomeScreen.swift +7 -0
- data/XCFit_Templates/XCFit/Cucumberish UI Test Bundle Base.xctemplate/HomeScreenSteps.swift +7 -0
- data/XCFit_Templates/XCFit/Cucumberish UI Test Bundle Base.xctemplate/Hooks.swift +7 -0
- data/XCFit_Templates/XCFit/Cucumberish UI Test Bundle Base.xctemplate/___PACKAGENAMEASIDENTIFIER___-Bridging-Header.h +8 -0
- data/XCFit_Templates/XCFit/Cucumberish UI Test Bundle Base.xctemplate/___PACKAGENAMEASIDENTIFIER___.h +10 -1
- data/XCFit_Templates/XCFit/Cucumberish UI Test Bundle Base.xctemplate/___PACKAGENAMEASIDENTIFIER___.m +12 -1
- data/XCFit_Templates/XCFit/Cucumberish UI Test Bundle Base.xctemplate/___PACKAGENAMEASIDENTIFIER___.swift +10 -0
- data/XCFit_Templates/XCFit/XCUI POM Test Bundle Base.xctemplate/BaseScreen.swift +42 -0
- data/XCFit_Templates/XCFit/XCUI POM Test Bundle Base.xctemplate/Extensions.swift +60 -0
- data/XCFit_Templates/XCFit/XCUI POM Test Bundle Base.xctemplate/HomeElements.swift +31 -0
- data/XCFit_Templates/XCFit/XCUI POM Test Bundle Base.xctemplate/HomeProtocol.swift +25 -0
- data/XCFit_Templates/XCFit/XCUI POM Test Bundle Base.xctemplate/HomeScreen.swift +24 -0
- data/XCFit_Templates/XCFit/XCUI POM Test Bundle Base.xctemplate/HomeScreenTest.swift +30 -0
- data/XCFit_Templates/XCFit/XCUI POM Test Bundle Base.xctemplate/ProtocolOrientedTest.swift +45 -0
- data/XCFit_Templates/XCFit/XCUI POM Test Bundle Base.xctemplate/TemplateIcon.png +0 -0
- data/XCFit_Templates/XCFit/XCUI POM Test Bundle Base.xctemplate/TemplateIcon@2x.png +0 -0
- data/XCFit_Templates/XCFit/XCUI POM Test Bundle Base.xctemplate/TemplateInfo.plist +141 -0
- data/XCFit_Templates/XCFit/XCUI POM Test Bundle Base.xctemplate/___PACKAGENAMEASIDENTIFIER___TestBase.swift +30 -0
- data/XCFit_Templates/XCFit/iOS Acceptance Testing Bundle.xctemplate/TemplateIcon.icns b/data/XCFit_Templates/XCFit/iOS Acceptance Testing → Bundle.xctemplate/TemplateIcon-old.icns +0 -0
- data/XCFit_Templates/XCFit/iOS Acceptance Testing Bundle.xctemplate/TemplateIcon.png +0 -0
- data/XCFit_Templates/XCFit/iOS Acceptance Testing Bundle.xctemplate/TemplateIcon@2x.png +0 -0
- data/XCFit_Templates/XCFit/iOS Acceptance Tests.xctemplate/TemplateIcon.icns b/data/XCFit_Templates/XCFit/iOS Acceptance → Tests.xctemplate/TemplateIcon-old.icns +0 -0
- data/XCFit_Templates/XCFit/iOS Acceptance Tests.xctemplate/TemplateIcon.png +0 -0
- data/XCFit_Templates/XCFit/iOS Acceptance Tests.xctemplate/TemplateIcon@2x.png +0 -0
- data/XCFit_Templates/XCFit/iOS XCUI POM Test Bundle.xctemplate/TemplateInfo.plist +39 -0
- data/lib/XCFit/version.rb +1 -1
- metadata +19 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d60b0ae695217d5ffa190ae6e48f75e11f7899e4
|
4
|
+
data.tar.gz: 6a692385f84b4a03bbbefbfcd544ae849961ee69
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 131c5d9390b833970d98ed7f67e5f00ef6d7a442614289b4cf501abef2b86cf8caf5db5ba35c43ce8346a9c4b0ea3188cb39d14ee1afae94fa56e8f5f0043455
|
7
|
+
data.tar.gz: e22bbaac4c093b7da0d566224f8e3bd593a9d127567fc060ace4b640ac29a49bafbc692429ad4aca42164e671dfda1c9bed3eed4570156122c21668488965837
|
data/README.md
CHANGED
@@ -58,7 +58,7 @@ XCFit automated configuration of these two guys.
|
|
58
58
|
### Version
|
59
59
|
CocoaPods -- [XCFit-CocoaPods](http://cocoadocs.org/docsets/XCFit) : 0.1.0
|
60
60
|
|
61
|
-
RubyGems -- [xcfit-RubyGem](https://rubygems.org/gems/xcfit) : 0.
|
61
|
+
RubyGems -- [xcfit-RubyGem](https://rubygems.org/gems/xcfit) : 2.0.1
|
62
62
|
|
63
63
|
### Tech & Software Requirements
|
64
64
|
|
@@ -125,11 +125,21 @@ Once Clicked on the target e.g 'Fitnesse Acceptance Test Bundle' Xcode will crea
|
|
125
125
|
|
126
126
|
Few Steps to setup BDD Styles in Xcode8
|
127
127
|
|
128
|
-
##### Add New Target for Cucumberish
|
128
|
+
##### Add New Target for Cucumberish
|
129
129
|
|
130
130
|
- 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
|
131
131
|
|
132
|
-
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.
|
132
|
+
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.
|
133
|
+
####### Link Target Application
|
134
|
+
The most important thing is link your target to application to test. Cucumberish target 'General' setting select 'Testing -> Target To Test' and configure scheme to add Cucumeerish UI target to Test
|
135
|
+
|
136
|
+
![image](https://github.com/Shashikant86/XCFit-GIFS/blob/master/LinkTargetTestApp.png)
|
137
|
+
|
138
|
+
#### Cucumberish Page Object Pattern Directory Structure
|
139
|
+
|
140
|
+
Now that, you can observe that new target has nice directory structure following [Page Object Pattern](http://martinfowler.com/bliki/PageObject.html)
|
141
|
+
|
142
|
+
![image](https://github.com/Shashikant86/XCFit-GIFS/blob/master/DirectoryStructure.png)
|
133
143
|
|
134
144
|
##### Download Cucumberish in the target
|
135
145
|
|
@@ -174,10 +184,15 @@ Given the app is running
|
|
174
184
|
|
175
185
|
##### Add Target To Test
|
176
186
|
|
177
|
-
- Finally
|
187
|
+
- Finally, Run Your Test from Cucumberish Target by Pressing 'CMD+U'
|
178
188
|
|
179
189
|
You are done !!
|
180
190
|
|
191
|
+
Look how easy it is !
|
192
|
+
|
193
|
+
![image](https://github.com/Shashikant86/XCFit-GIFS/blob/master/POM_Cucumberish.gif)
|
194
|
+
|
195
|
+
|
181
196
|
You can add more feature/Scenarios and implement steps definitions inside your Swift File. [Ahmed-Ali](https://github.com/Ahmed-Ali) creator of Cucumberish already implemented useful pre-defined steps have a look at this [Swift file](https://github.com/Ahmed-Ali/Cucumberish/blob/master/CucumberishExample/CucumberishExampleUITests/CCIStepDefinitions.swift). You are free to try Page Object Pattern and all other crazy stuff to abstract and refactor your Swift code.
|
182
197
|
|
183
198
|
|
@@ -4,6 +4,14 @@
|
|
4
4
|
// Copyright © 2016 XCFit Framework. All rights reserved.
|
5
5
|
//
|
6
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
|
+
|
7
15
|
import XCTest
|
8
16
|
import Foundation
|
9
17
|
|
data/XCFit_Templates/XCFit/Cucumberish UI Test Bundle Base.xctemplate/CommonStepDefinitions.swift
CHANGED
@@ -5,6 +5,14 @@
|
|
5
5
|
//
|
6
6
|
//
|
7
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
|
+
|
8
16
|
import XCTest
|
9
17
|
|
10
18
|
class CommonStepDefinitions: NSObject {
|
@@ -5,6 +5,14 @@
|
|
5
5
|
//
|
6
6
|
//
|
7
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
|
+
|
8
16
|
import Foundation
|
9
17
|
import XCTest
|
10
18
|
|
@@ -4,6 +4,13 @@
|
|
4
4
|
// Copyright © 2016 XCFit Framework. All rights reserved.
|
5
5
|
//
|
6
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
|
+
|
7
14
|
import Foundation
|
8
15
|
import XCTest
|
9
16
|
|
@@ -4,6 +4,13 @@
|
|
4
4
|
// Copyright © 2016 XCFit Framework. All rights reserved.
|
5
5
|
//
|
6
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
|
+
|
7
14
|
import Foundation
|
8
15
|
import XCTest
|
9
16
|
|
@@ -4,6 +4,13 @@
|
|
4
4
|
// Copyright © 2016 XCFit Framework. All rights reserved.
|
5
5
|
//
|
6
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
|
+
|
7
14
|
import Foundation
|
8
15
|
import XCTest
|
9
16
|
class Hooks: NSObject {
|
@@ -3,5 +3,13 @@
|
|
3
3
|
// Created by XCFit Framework
|
4
4
|
// Copyright © 2016 XCFit Framework. All rights reserved.
|
5
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
|
+
*/
|
6
14
|
#import "Cucumberish.h"
|
7
15
|
#import "CCIStepsManager.h"
|
@@ -4,6 +4,15 @@
|
|
4
4
|
// Copyright © 2016 XCFit Framework. All rights reserved.
|
5
5
|
//
|
6
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
|
+
|
7
16
|
|
8
17
|
#import <Foundation/Foundation.h>
|
9
18
|
#import "___PACKAGENAMEASIDENTIFIER___-Swift.h"
|
@@ -11,4 +20,4 @@
|
|
11
20
|
|
12
21
|
@interface ___PACKAGENAMEASIDENTIFIER___ : NSObject
|
13
22
|
|
14
|
-
@end
|
23
|
+
@end
|
@@ -4,6 +4,17 @@
|
|
4
4
|
// Copyright © 2016 XCFit Framework. All rights reserved.
|
5
5
|
//
|
6
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
|
+
|
7
18
|
#import <Foundation/Foundation.h>
|
8
19
|
#import "___PACKAGENAMEASIDENTIFIER___-Swift.h"
|
9
20
|
#import <XCTest/XCTest.h>
|
@@ -14,4 +25,4 @@ void CucumberishInit()
|
|
14
25
|
{
|
15
26
|
[___PACKAGENAMEASIDENTIFIER___ CucumberishSwiftInit];
|
16
27
|
|
17
|
-
}
|
28
|
+
}
|
@@ -4,6 +4,16 @@
|
|
4
4
|
// Copyright © 2016 XCFit Framework. All rights reserved.
|
5
5
|
//
|
6
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
|
+
|
7
17
|
import Foundation
|
8
18
|
import XCTest
|
9
19
|
class ___PACKAGENAMEASIDENTIFIER___: NSObject {
|
@@ -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
|
+
self.expectation(for: exists, evaluatedWith: element, handler: nil)
|
26
|
+
self.waitForExpectations(timeout: 10, handler: nil)
|
27
|
+
|
28
|
+
element.tap()
|
29
|
+
|
30
|
+
}
|
31
|
+
|
32
|
+
|
33
|
+
func waitForExist(element: XCUIElement) {
|
34
|
+
|
35
|
+
let exists = NSPredicate(format: "exists == true")
|
36
|
+
|
37
|
+
self.expectation(for: exists, evaluatedWith: element, handler: nil)
|
38
|
+
self.waitForExpectations(timeout: 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.expectation(for: existsPredicate,
|
29
|
+
evaluatedWith: self, handler: nil)
|
30
|
+
|
31
|
+
testCase.waitForExpectations(timeout: 20) { (error) -> Void in
|
32
|
+
if (error != nil) {
|
33
|
+
let message = "Failed to find \(self) after 20 seconds."
|
34
|
+
testCase.recordFailure(withDescription: 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
|
+
expectation(for: existsPredicate,
|
50
|
+
evaluatedWith: element, handler: nil)
|
51
|
+
|
52
|
+
waitForExpectations(timeout: 20) { (error) -> Void in
|
53
|
+
if (error != nil) {
|
54
|
+
let message = "Failed to find \(element) after 5 seconds."
|
55
|
+
self.recordFailure(withDescription: 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
|
+
}
|
@@ -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
|
+
}
|
Binary file
|
@@ -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'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>@\"$(SRCROOT)\"</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><key>CFBundlePackageType</key>
|
130
|
+
<string>BNDL</string>
|
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
|
+
}
|
File without changes
|
Binary file
|
Binary file
|
File without changes
|
@@ -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/version.rb
CHANGED
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: 2.0.
|
4
|
+
version: 2.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Shashikant86
|
@@ -147,11 +147,27 @@ files:
|
|
147
147
|
- XCFit_Templates/XCFit/Mac Acceptance Tests.xctemplate/TemplateIcon.icns
|
148
148
|
- XCFit_Templates/XCFit/Mac Acceptance Tests.xctemplate/TemplateInfo.plist
|
149
149
|
- XCFit_Templates/XCFit/MacOS UI Cucumberish Testing Bundle.xctemplate/TemplateInfo.plist
|
150
|
-
- XCFit_Templates/XCFit/
|
150
|
+
- XCFit_Templates/XCFit/XCUI POM Test Bundle Base.xctemplate/BaseScreen.swift
|
151
|
+
- XCFit_Templates/XCFit/XCUI POM Test Bundle Base.xctemplate/Extensions.swift
|
152
|
+
- XCFit_Templates/XCFit/XCUI POM Test Bundle Base.xctemplate/HomeElements.swift
|
153
|
+
- XCFit_Templates/XCFit/XCUI POM Test Bundle Base.xctemplate/HomeProtocol.swift
|
154
|
+
- XCFit_Templates/XCFit/XCUI POM Test Bundle Base.xctemplate/HomeScreen.swift
|
155
|
+
- XCFit_Templates/XCFit/XCUI POM Test Bundle Base.xctemplate/HomeScreenTest.swift
|
156
|
+
- XCFit_Templates/XCFit/XCUI POM Test Bundle Base.xctemplate/ProtocolOrientedTest.swift
|
157
|
+
- XCFit_Templates/XCFit/XCUI POM Test Bundle Base.xctemplate/TemplateIcon.png
|
158
|
+
- XCFit_Templates/XCFit/XCUI POM Test Bundle Base.xctemplate/TemplateIcon@2x.png
|
159
|
+
- XCFit_Templates/XCFit/XCUI POM Test Bundle Base.xctemplate/TemplateInfo.plist
|
160
|
+
- XCFit_Templates/XCFit/XCUI POM Test Bundle Base.xctemplate/___PACKAGENAMEASIDENTIFIER___TestBase.swift
|
161
|
+
- XCFit_Templates/XCFit/iOS Acceptance Testing Bundle.xctemplate/TemplateIcon-old.icns
|
162
|
+
- XCFit_Templates/XCFit/iOS Acceptance Testing Bundle.xctemplate/TemplateIcon.png
|
163
|
+
- XCFit_Templates/XCFit/iOS Acceptance Testing Bundle.xctemplate/TemplateIcon@2x.png
|
151
164
|
- XCFit_Templates/XCFit/iOS Acceptance Testing Bundle.xctemplate/TemplateInfo.plist
|
152
|
-
- XCFit_Templates/XCFit/iOS Acceptance Tests.xctemplate/TemplateIcon.icns
|
165
|
+
- XCFit_Templates/XCFit/iOS Acceptance Tests.xctemplate/TemplateIcon-old.icns
|
166
|
+
- XCFit_Templates/XCFit/iOS Acceptance Tests.xctemplate/TemplateIcon.png
|
167
|
+
- XCFit_Templates/XCFit/iOS Acceptance Tests.xctemplate/TemplateIcon@2x.png
|
153
168
|
- XCFit_Templates/XCFit/iOS Acceptance Tests.xctemplate/TemplateInfo.plist
|
154
169
|
- XCFit_Templates/XCFit/iOS UI Cucumberish Testing Bundle.xctemplate/TemplateInfo.plist
|
170
|
+
- XCFit_Templates/XCFit/iOS XCUI POM Test Bundle.xctemplate/TemplateInfo.plist
|
155
171
|
- bin/xcfit
|
156
172
|
- lib/XCFit.rb
|
157
173
|
- lib/XCFit/main.rb
|