xcfit 3.1.6 → 3.1.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Pre-Defined_Steps/Cucumberish_Predefined_Steps.md +15 -2
- data/XCFit_Templates/XCFit/Cucumberish UI Test Bundle Base.xctemplate/CommonStepDefinitions.swift +76 -0
- data/XCFit_Templates/XCFit/Cucumberish UI Test Bundle Base.xctemplate/HomeScreen.swift +2 -2
- data/XCFit_Templates/XCFit/Cucumberish UI Test Bundle Base.xctemplate/HomeScreenSteps.swift +1 -1
- data/XCFit_Templates/XCFit/Cucumberish UI Test Bundle Base.xctemplate/TemplateInfo.plist +0 -24
- data/homebrew/xcfit +1 -1
- data/lib/XCFit/version.rb +1 -1
- metadata +1 -4
- data/XCFit_Templates/XCFit/Cucumberish UI Test Bundle Base.xctemplate/BaseScreen.swift +0 -21
- data/XCFit_Templates/XCFit/Cucumberish UI Test Bundle Base.xctemplate/Extensions.swift +0 -57
- data/XCFit_Templates/XCFit/Cucumberish UI Test Bundle Base.xctemplate/Hooks.swift +0 -27
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8e5e922d04ad40148ca075342ac30908da1a01f2
|
4
|
+
data.tar.gz: 399aa818e47dc66faba8810a98527ac77f18cbf1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 28f36c73fecd2833ab1cc48f0b4fa73533471e84537c782e438eb4ae2b8ec937d6c276ae29691c3d851c240091417a0cb7c344e8c969ed1e4bbad18e70e93e1a
|
7
|
+
data.tar.gz: b5e4731f49f86289a9bbf825e359782231288f43f2366f1f0a5ece951c274019a02ed8a0bddc296c9355fbac4d2e2b0d0defd43750aefe314638f3dcd5263970
|
@@ -7,6 +7,19 @@ There are some predefined BDD Style Steps for the Cucumberish
|
|
7
7
|
|
8
8
|
Given the app is running
|
9
9
|
Given/When/Then/ I tap (?:the )?\"([^\\\"]*)\" (button|label|tab|view|field|textView
|
10
|
+
Given/When/Then/ I double tap (?:the )?\"([^\\\"]*)\" (button|label|tab|view|field|textView
|
10
11
|
Given/When/Then/ I tap (?:the )?\"([^\\\"]*)\" (button|label|tab|view) ([1-9]{1}) time(?:s)?$
|
11
|
-
Given/When/Then/ I write \"([^\\\"]*)\" (?:into|in) (?:the )?\"([^\\\"]*)\" (field|text view)
|
12
|
-
Given/When/Then/ I switch (on|off) the \"([^\\\"]*)\" switch
|
12
|
+
Given/When/Then/ I write \"([^\\\"]*)\" (?:into|in) (?:the )?\"([^\\\"]*)\" (field|text view)
|
13
|
+
Given/When/Then/ I switch (on|off) the \"([^\\\"]*)\" switch
|
14
|
+
Given/When/Then/ I launched an App
|
15
|
+
Given/When/Then/ I terminated an App
|
16
|
+
Given/When/Then/ I see an alert with title \"([^\\\"]*)\" and clicked \"([^\\\"]*)\" action
|
17
|
+
Given/When/Then/ I see an alert with title \"([^\\\"]*)\" and clicked \"([^\\\"]*)\" action
|
18
|
+
Given/When/Then/ I allow system alert with \"([^\\\"]*)\" description
|
19
|
+
Given/When/Then/ I slide a slider by \"([^\\\"]*)\" normalised Value
|
20
|
+
Given/When/Then/ I select an item \"([^\\\"]*)\" from picker
|
21
|
+
Given/When/Then/ I click link \"([^\\\"]*)\" from webview
|
22
|
+
Given/When/Then/ I should see menubar with \"([^\\\"]*)\" header
|
23
|
+
Given/When/Then/ I should see menu with \"([^\\\"]*)\" items
|
24
|
+
Given/When/Then/ I should see screen with \"([^\\\"]*)\" cells
|
25
|
+
Given/When/Then/ I check \"([^\\\"]*)\" checkbox
|
data/XCFit_Templates/XCFit/Cucumberish UI Test Bundle Base.xctemplate/CommonStepDefinitions.swift
CHANGED
@@ -42,6 +42,82 @@ class CommonStepDefinitions: NSObject {
|
|
42
42
|
fileprivate func setup(_ application: XCUIApplication)
|
43
43
|
{
|
44
44
|
self.application = application
|
45
|
+
|
46
|
+
MatchAll("I launched an App") { (args, userInfo) in
|
47
|
+
application.launch()
|
48
|
+
}
|
49
|
+
|
50
|
+
MatchAll("I terminated an App") { (args, userInfo) in
|
51
|
+
application.terminate()
|
52
|
+
}
|
53
|
+
|
54
|
+
MatchAll("^I see an alert with title \"([^\\\"]*)\" and clicked \"([^\\\"]*)\" action$") { (args, userInfo) in
|
55
|
+
|
56
|
+
let alert = application.alerts[(args?[0])!]
|
57
|
+
alert.buttons[(args?[0])!].tap()
|
58
|
+
|
59
|
+
}
|
60
|
+
|
61
|
+
MatchAll("^I allow system alert with \"([^\\\"]*)\" description$") { (args, userInfo) in
|
62
|
+
|
63
|
+
let alertDescription = args?[0]
|
64
|
+
|
65
|
+
XCTestCase().addUIInterruptionMonitor(withDescription: alertDescription!) { (alert) -> Bool in
|
66
|
+
alert.buttons["Allow"].tap()
|
67
|
+
return true
|
68
|
+
}
|
69
|
+
XCUIApplication().tap()
|
70
|
+
}
|
71
|
+
|
72
|
+
MatchAll("^I slide a slider by \"([^\\\"]*)\" normalised Value$") { (args, userInfo) in
|
73
|
+
|
74
|
+
let sliderPosition = args?[0]
|
75
|
+
let slidervalue :CGFloat = CGFloat((sliderPosition! as NSString).doubleValue)
|
76
|
+
|
77
|
+
application.sliders.element.adjust(toNormalizedSliderPosition: slidervalue)
|
78
|
+
|
79
|
+
}
|
80
|
+
|
81
|
+
MatchAll("^I select an item \"([^\\\"]*)\" from picker$") { (args, userInfo) in
|
82
|
+
|
83
|
+
let pickerPosition = args?[0]
|
84
|
+
application.pickerWheels.element.adjust(toPickerWheelValue: pickerPosition!)
|
85
|
+
}
|
86
|
+
|
87
|
+
MatchAll("^I click link \"([^\\\"]*)\" from webview$") { (args, userInfo) in
|
88
|
+
|
89
|
+
let linkText = args?[0]
|
90
|
+
application.links[linkText!].tap()
|
91
|
+
}
|
92
|
+
|
93
|
+
MatchAll("^I should see menubar with \"([^\\\"]*)\" header$") { (args, userInfo) in
|
94
|
+
|
95
|
+
let menubarText = args?[0]
|
96
|
+
XCTAssertTrue(application.menuBars[menubarText!].exists)
|
97
|
+
}
|
98
|
+
|
99
|
+
MatchAll("^I should see menu with \"([^\\\"]*)\" items$") { (args, userInfo) in
|
100
|
+
|
101
|
+
let menuCount = args![0]
|
102
|
+
let expectedMenuCount: UInt = UInt(menuCount)!
|
103
|
+
let appMenuCount = application.menus.count
|
104
|
+
XCTAssertEqual(expectedMenuCount, appMenuCount, "Comparing MenuCount")
|
105
|
+
}
|
106
|
+
|
107
|
+
MatchAll("^I should see screen with \"([^\\\"]*)\" cells$") { (args, userInfo) in
|
108
|
+
|
109
|
+
let cellCount = args![0]
|
110
|
+
let expectedCellCount: UInt = UInt(cellCount)!
|
111
|
+
let appCellCount = application.cells.count
|
112
|
+
XCTAssertEqual(expectedCellCount, appCellCount, "Comparing Cell Count")
|
113
|
+
}
|
114
|
+
|
115
|
+
MatchAll("^I check \"([^\\\"]*)\" checkbox$") { (args, userInfo) in
|
116
|
+
let checkBox = args?[0]
|
117
|
+
application.checkBoxes[checkBox!].tap()
|
118
|
+
}
|
119
|
+
|
120
|
+
|
45
121
|
//And/When/Then/But I tap the "Header" view
|
46
122
|
MatchAll("^I tap (?:the )?\"([^\\\"]*)\" (button|label|tab|view|field|textView)$") { (args, userInfo) -> Void in
|
47
123
|
let label = args?[0]
|
@@ -7,7 +7,7 @@
|
|
7
7
|
/*
|
8
8
|
|
9
9
|
This is sample code created by XCFit Framework and can be edited/Removed as needed.
|
10
|
-
|
10
|
+
|
11
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
12
|
*/
|
13
13
|
|
@@ -15,7 +15,7 @@ import Foundation
|
|
15
15
|
import XCTest
|
16
16
|
|
17
17
|
|
18
|
-
class HomeScreen:
|
18
|
+
class HomeScreen: XCTestCase {
|
19
19
|
|
20
20
|
// You can add locators and functions of homeScreen here
|
21
21
|
|
@@ -69,10 +69,7 @@
|
|
69
69
|
<key>Nodes</key>
|
70
70
|
<array>
|
71
71
|
<string>HomeScreen.swift</string>
|
72
|
-
<string>BaseScreen.swift</string>
|
73
72
|
<string>HomeScreenSteps.swift</string>
|
74
|
-
<string>Hooks.swift</string>
|
75
|
-
<string>Extensions.swift</string>
|
76
73
|
<string>CommonStepDefinitions.swift</string>
|
77
74
|
<string>Info.plist:PackageType</string>
|
78
75
|
<string>___PACKAGENAMEASIDENTIFIER___-Bridging-Header.h</string>
|
@@ -89,13 +86,6 @@
|
|
89
86
|
<key>Group</key>
|
90
87
|
<string>Screens</string>
|
91
88
|
</dict>
|
92
|
-
<key>BaseScreen.swift</key>
|
93
|
-
<dict>
|
94
|
-
<key>Path</key>
|
95
|
-
<string>BaseScreen.swift</string>
|
96
|
-
<key>Group</key>
|
97
|
-
<string>Screens</string>
|
98
|
-
</dict>
|
99
89
|
<key>HomeScreenSteps.swift</key>
|
100
90
|
<dict>
|
101
91
|
<key>Path</key>
|
@@ -103,20 +93,6 @@
|
|
103
93
|
<key>Group</key>
|
104
94
|
<string>Step Definitions</string>
|
105
95
|
</dict>
|
106
|
-
<key>Hooks.swift</key>
|
107
|
-
<dict>
|
108
|
-
<key>Path</key>
|
109
|
-
<string>Hooks.swift</string>
|
110
|
-
<key>Group</key>
|
111
|
-
<string>Common</string>
|
112
|
-
</dict>
|
113
|
-
<key>Extensions.swift</key>
|
114
|
-
<dict>
|
115
|
-
<key>Path</key>
|
116
|
-
<string>Extensions.swift</string>
|
117
|
-
<key>Group</key>
|
118
|
-
<string>Common</string>
|
119
|
-
</dict>
|
120
96
|
<key>CommonStepDefinitions.swift</key>
|
121
97
|
<dict>
|
122
98
|
<key>Path</key>
|
data/homebrew/xcfit
CHANGED
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: 3.1.
|
4
|
+
version: 3.1.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Shashikant86
|
@@ -111,12 +111,9 @@ files:
|
|
111
111
|
- XCFit_Templates/XCFit/Cucumber Feature.xctemplate/TemplateIcon@2x.png
|
112
112
|
- XCFit_Templates/XCFit/Cucumber Feature.xctemplate/TemplateInfo.plist
|
113
113
|
- XCFit_Templates/XCFit/Cucumber Feature.xctemplate/___FILEBASENAME___.feature
|
114
|
-
- XCFit_Templates/XCFit/Cucumberish UI Test Bundle Base.xctemplate/BaseScreen.swift
|
115
114
|
- XCFit_Templates/XCFit/Cucumberish UI Test Bundle Base.xctemplate/CommonStepDefinitions.swift
|
116
|
-
- XCFit_Templates/XCFit/Cucumberish UI Test Bundle Base.xctemplate/Extensions.swift
|
117
115
|
- XCFit_Templates/XCFit/Cucumberish UI Test Bundle Base.xctemplate/HomeScreen.swift
|
118
116
|
- XCFit_Templates/XCFit/Cucumberish UI Test Bundle Base.xctemplate/HomeScreenSteps.swift
|
119
|
-
- XCFit_Templates/XCFit/Cucumberish UI Test Bundle Base.xctemplate/Hooks.swift
|
120
117
|
- XCFit_Templates/XCFit/Cucumberish UI Test Bundle Base.xctemplate/TemplateIcon.png
|
121
118
|
- XCFit_Templates/XCFit/Cucumberish UI Test Bundle Base.xctemplate/TemplateIcon@2x.png
|
122
119
|
- XCFit_Templates/XCFit/Cucumberish UI Test Bundle Base.xctemplate/TemplateInfo.plist
|
@@ -1,21 +0,0 @@
|
|
1
|
-
//
|
2
|
-
//
|
3
|
-
// Created by XCFit Framework
|
4
|
-
// Copyright © 2016 XCFit Framework. All rights reserved.
|
5
|
-
//
|
6
|
-
|
7
|
-
/*
|
8
|
-
This is sample code created by XCFit Framework and can be edited/Removed as needed.
|
9
|
-
|
10
|
-
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.
|
11
|
-
|
12
|
-
*/
|
13
|
-
|
14
|
-
import XCTest
|
15
|
-
import Foundation
|
16
|
-
|
17
|
-
class BaseScreen: XCTestCase {
|
18
|
-
|
19
|
-
// Add your own methods to base screen class e.g
|
20
|
-
|
21
|
-
}
|
@@ -1,57 +0,0 @@
|
|
1
|
-
//
|
2
|
-
// Extensions.swift
|
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 needed.
|
10
|
-
|
11
|
-
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.
|
12
|
-
|
13
|
-
*/
|
14
|
-
|
15
|
-
import Foundation
|
16
|
-
import XCTest
|
17
|
-
|
18
|
-
extension XCUIElement {
|
19
|
-
|
20
|
-
public func tapOnceVisible(testCase: XCTestCase,
|
21
|
-
file: String = #file, line: UInt = #line) {
|
22
|
-
let existsPredicate = NSPredicate(format: "exists == true")
|
23
|
-
|
24
|
-
|
25
|
-
testCase.expectation(for: existsPredicate,
|
26
|
-
evaluatedWith: self, handler: nil)
|
27
|
-
|
28
|
-
testCase.waitForExpectations(timeout: 20) { (error) -> Void in
|
29
|
-
if (error != nil) {
|
30
|
-
let message = "Failed to find \(self) after 20 seconds."
|
31
|
-
testCase.recordFailure(withDescription: message,
|
32
|
-
inFile: file, atLine: line, expected: true)
|
33
|
-
}
|
34
|
-
}
|
35
|
-
|
36
|
-
self.tap()
|
37
|
-
}
|
38
|
-
|
39
|
-
|
40
|
-
}
|
41
|
-
|
42
|
-
extension XCTestCase {
|
43
|
-
func waitForElementToAppear(element: XCUIElement,
|
44
|
-
file: String = #file, line: UInt = #line) {
|
45
|
-
let existsPredicate = NSPredicate(format: "exists == true")
|
46
|
-
expectation(for: existsPredicate,
|
47
|
-
evaluatedWith: element, handler: nil)
|
48
|
-
|
49
|
-
waitForExpectations(timeout: 20) { (error) -> Void in
|
50
|
-
if (error != nil) {
|
51
|
-
let message = "Failed to find \(element) after 5 seconds."
|
52
|
-
self.recordFailure(withDescription: message,
|
53
|
-
inFile: file, atLine: line, expected: true)
|
54
|
-
}
|
55
|
-
}
|
56
|
-
}
|
57
|
-
}
|
@@ -1,27 +0,0 @@
|
|
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 needed.
|
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
|
-
import Cucumberish
|
17
|
-
|
18
|
-
class Hooks: NSObject {
|
19
|
-
class func CustomHooks()
|
20
|
-
{
|
21
|
-
//A closure that will be executed just before executing any of your features
|
22
|
-
beforeStart { () -> Void in
|
23
|
-
// Write your hooks here
|
24
|
-
|
25
|
-
}
|
26
|
-
}
|
27
|
-
}
|