Skip to content

Commit dedf40e

Browse files
Metadata updates
1 parent 105b7fd commit dedf40e

File tree

6 files changed

+88
-72
lines changed

6 files changed

+88
-72
lines changed

ChatSecureUITests/ChatSecureUITests.swift

+35-36
Original file line numberDiff line numberDiff line change
@@ -74,10 +74,18 @@ class ChatSecureUITests: XCTestCase {
7474
app.launch()
7575
skipEnablePush(app)
7676
skipDonatePrompt(app)
77-
XCTAssertTrue(app.buttons[localizedString("Skip")].exists, "Skip button exists")
78-
XCTAssertTrue(app.buttons[localizedString("Create New Account")].exists, "Create new Account button exists")
79-
XCTAssertTrue(app.buttons[localizedString("Add Existing Account")].exists, "Add existing account button exists")
8077

78+
if app.buttons[localizedString("Skip")].exists {
79+
XCTAssertTrue(app.buttons[localizedString("Skip")].exists, "Skip button exists")
80+
XCTAssertTrue(app.buttons[localizedString("Create New Account")].exists, "Create new Account button exists")
81+
XCTAssertTrue(app.buttons[localizedString("Add Existing Account")].exists, "Add existing account button exists")
82+
} else {
83+
let chatsNavigationBar = app.navigationBars[localizedString("Chats")]
84+
chatsNavigationBar.buttons[localizedString("Chats")].tap()
85+
chatsNavigationBar.children(matching: .button).element(boundBy: 1).tap()
86+
app.tables["settingsTableView"].staticTexts[localizedString("New Account")].tap()
87+
app.buttons[localizedString("Create New Account")].tap()
88+
}
8189
app.buttons[localizedString("Create New Account")].tap()
8290

8391
let tablesQuery = app.tables
@@ -88,42 +96,33 @@ class ChatSecureUITests: XCTestCase {
8896

8997
tablesQuery.switches[localizedString("Show Advanced Options")].tap()
9098

91-
9299
tablesQuery.switches[localizedString("Enable Tor")].tap()
93100

94101
snapshot("01CreateAccountScreen")
95102
}
96103

97-
// func testConversationList() {
98-
// let app = XCUIApplication()
99-
// app.launchEnvironment["OTRLaunchMode"] = "ChatSecureUITestsDemoData"
100-
// app.launch()
101-
// skipEnablePush(app)
102-
//
103-
// switch UIDevice.current.userInterfaceIdiom {
104-
// case .phone:
105-
// snapshot("02ConversationListScreen")
106-
// break
107-
// case .pad:
108-
// break
109-
// default:
110-
// break
111-
// }
112-
// sleep(2)
113-
// skipEnablePush(app)
114-
// XCUIApplication().tables["conversationTableView"].children(matching: .any).element(boundBy: 0).tap()
115-
// snapshot("03ChatScreen")
116-
// XCUIApplication().buttons["profileButton"].tap()
117-
// snapshot("04ProfileScreen")
118-
//
119-
//// app.navigationBars["Profile"].buttons["Done"].tap()
120-
////
121-
//// let chatsNavigationBar = app.navigationBars["Chats"]
122-
//// chatsNavigationBar.buttons["Chats"].tap()
123-
//// chatsNavigationBar.childrenMatchingType(.Button).elementBoundByIndex(1).tap()
124-
//// app.tables["settingsTableView"].staticTexts["New Account"].tap()
125-
//// app.buttons["Create New Account"].tap()
126-
//
127-
// }
128-
//
104+
func testConversationList() {
105+
let app = XCUIApplication()
106+
app.launchEnvironment["OTRLaunchMode"] = "ChatSecureUITestsDemoData"
107+
app.launch()
108+
skipEnablePush(app)
109+
skipDonatePrompt(app)
110+
111+
switch UIDevice.current.userInterfaceIdiom {
112+
case .phone:
113+
snapshot("02ConversationListScreen")
114+
break
115+
case .pad:
116+
break
117+
default:
118+
break
119+
}
120+
sleep(2)
121+
skipEnablePush(app)
122+
XCUIApplication().tables["conversationTableView"].children(matching: .any).element(boundBy: 0).tap()
123+
snapshot("03ChatScreen")
124+
XCUIApplication().buttons["profileButton"].tap()
125+
snapshot("04ProfileScreen")
126+
}
127+
129128
}

Gemfile.lock

+6-6
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ GEM
3535
activesupport (>= 4.0.2, < 6)
3636
fuzzy_match (~> 2.0.4)
3737
nap (~> 1.0)
38-
cocoapods-deintegrate (1.0.3)
38+
cocoapods-deintegrate (1.0.4)
3939
cocoapods-downloader (1.2.2)
4040
cocoapods-plugins (1.0.0)
4141
nap
@@ -58,7 +58,7 @@ GEM
5858
dotenv (2.7.2)
5959
emoji_regex (1.0.1)
6060
escape (0.0.4)
61-
excon (0.62.0)
61+
excon (0.64.0)
6262
faraday (0.15.4)
6363
multipart-post (>= 1.2, < 3)
6464
faraday-cookie_jar (0.0.6)
@@ -67,7 +67,7 @@ GEM
6767
faraday_middleware (0.13.1)
6868
faraday (>= 0.7.4, < 1.0)
6969
fastimage (2.1.5)
70-
fastlane (2.119.0)
70+
fastlane (2.120.0)
7171
CFPropertyList (>= 2.3, < 4.0.0)
7272
addressable (>= 2.3, < 3.0.0)
7373
babosa (>= 1.0.2, < 2.0.0)
@@ -142,7 +142,7 @@ GEM
142142
memoist (0.16.0)
143143
mime-types (3.2.2)
144144
mime-types-data (~> 3.2015)
145-
mime-types-data (3.2018.0812)
145+
mime-types-data (3.2019.0331)
146146
mini_magick (4.5.1)
147147
minitest (5.11.3)
148148
molinillo (0.6.6)
@@ -187,10 +187,10 @@ GEM
187187
uber (0.1.0)
188188
unf (0.1.4)
189189
unf_ext
190-
unf_ext (0.0.7.5)
190+
unf_ext (0.0.7.6)
191191
unicode-display_width (1.5.0)
192192
word_wrap (1.0.0)
193-
xcodeproj (1.8.1)
193+
xcodeproj (1.8.2)
194194
CFPropertyList (>= 2.3.3, < 4.0)
195195
atomos (~> 0.1.3)
196196
claide (>= 1.0.2, < 2.0)

fastlane/Deliverfile

+7-10
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
# beta_ipa "./app.ipa"
1818

1919
# The version of your app - remove this if you provide an ipa file
20-
app_version "4.3.6"
20+
app_version "4.3.7"
2121
submit_for_review false
2222
skip_binary_upload true
2323
# overwrite_screenshots true
@@ -28,15 +28,12 @@ metadata_path "./Submodules/ChatSecure-Metadata/metadata"
2828
screenshots_path "./Submodules/ChatSecure-Metadata/screenshots"
2929

3030
release_notes({
31-
'default' => "v4.3.6:
32-
* Fix security issue in certificate pinning alert dialog, where any valid certificate would show as valid
33-
* Fix crash when rapidly scrolling through chat history
34-
* Fix issue where chat history is temporarily blank after sending a message
35-
* Swift 4.2 / Xcode 10.1
36-
* Updated 3rd party dependencies
37-
* Other minor bug fixes
38-
39-
Changelog: https://github.com/chatsecure/chatsecure-ios/compare/v4.3.5...v4.3.6
31+
'default' => "v4.3.7:
32+
* Swift 5.0 / Xcode 10.2
33+
* Updated translations
34+
* Minor bug fixes
35+
36+
Changelog: https://github.com/chatsecure/chatsecure-ios/compare/v4.3.6...v4.3.7
4037
",
4138
})
4239

fastlane/Snapfile

+6-4
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,17 @@
44
devices([
55
# "iPhone 8",
66
# "iPhone 8 Plus",
7-
"iPhone SE",
7+
# "iPhone SE",
8+
"iPhone Xs Max",
89
# "iPhone X",
910
# "iPad Pro (12.9-inch)",
1011
# "iPad Pro (9.7-inch)",
12+
"iPad Pro (12.9-inch) (3rd generation)",
1113
])
1214

13-
languages([
14-
"it", #{}"nl-NL", "pt-BR", "pt-PT", "tr",
15-
])
15+
# languages([
16+
# "it", #{}"nl-NL", "pt-BR", "pt-PT", "tr",
17+
# ])
1618

1719
# languages([
1820
# "da", "el", "es-ES", "it", "nl-NL", "pt-BR", "pt-PT", "tr",

fastlane/SnapshotHelper.swift

+33-15
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ import XCTest
1818
var deviceLanguage = ""
1919
var locale = ""
2020

21-
func setupSnapshot(_ app: XCUIApplication) {
22-
Snapshot.setupSnapshot(app)
21+
func setupSnapshot(_ app: XCUIApplication, waitForAnimations: Bool = true) {
22+
Snapshot.setupSnapshot(app, waitForAnimations: waitForAnimations)
2323
}
2424

2525
func snapshot(_ name: String, waitForLoadingIndicator: Bool) {
@@ -63,14 +63,16 @@ enum SnapshotError: Error, CustomDebugStringConvertible {
6363
@objcMembers
6464
open class Snapshot: NSObject {
6565
static var app: XCUIApplication?
66+
static var waitForAnimations = true
6667
static var cacheDirectory: URL?
6768
static var screenshotsDirectory: URL? {
6869
return cacheDirectory?.appendingPathComponent("screenshots", isDirectory: true)
6970
}
7071

71-
open class func setupSnapshot(_ app: XCUIApplication) {
72+
open class func setupSnapshot(_ app: XCUIApplication, waitForAnimations: Bool = true) {
7273

7374
Snapshot.app = app
75+
Snapshot.waitForAnimations = waitForAnimations
7476

7577
do {
7678
let cacheDir = try pathPrefix()
@@ -114,10 +116,14 @@ open class Snapshot: NSObject {
114116
} catch {
115117
print("Couldn't detect/set locale...")
116118
}
117-
if locale.isEmpty {
119+
120+
if locale.isEmpty && !deviceLanguage.isEmpty {
118121
locale = Locale(identifier: deviceLanguage).identifier
119122
}
120-
app.launchArguments += ["-AppleLocale", "\"\(locale)\""]
123+
124+
if !locale.isEmpty {
125+
app.launchArguments += ["-AppleLocale", "\"\(locale)\""]
126+
}
121127
}
122128

123129
class func setLaunchArguments(_ app: XCUIApplication) {
@@ -149,22 +155,25 @@ open class Snapshot: NSObject {
149155

150156
print("snapshot: \(name)") // more information about this, check out https://docs.fastlane.tools/actions/snapshot/#how-does-it-work
151157

152-
sleep(1) // Waiting for the animation to be finished (kind of)
158+
if Snapshot.waitForAnimations {
159+
sleep(1) // Waiting for the animation to be finished (kind of)
160+
}
153161

154162
#if os(OSX)
155-
XCUIApplication().typeKey(XCUIKeyboardKeySecondaryFn, modifierFlags: [])
156-
#else
157-
158163
guard let app = self.app else {
159164
print("XCUIApplication is not set. Please call setupSnapshot(app) before snapshot().")
160165
return
161166
}
167+
168+
app.typeKey(XCUIKeyboardKeySecondaryFn, modifierFlags: [])
169+
#else
162170

163-
guard let window = app.windows.allElementsBoundByIndex.first(where: { $0.frame.isEmpty == false }) else {
164-
print("Couldn't find an element window in XCUIApplication with a non-empty frame.")
171+
guard let app = self.app else {
172+
print("XCUIApplication is not set. Please call setupSnapshot(app) before snapshot().")
165173
return
166174
}
167-
175+
176+
let window = app.windows.firstMatch
168177
let screenshot = window.screenshot()
169178
guard let simulator = ProcessInfo().environment["SIMULATOR_DEVICE_NAME"], let screenshotsDir = screenshotsDirectory else { return }
170179
let path = screenshotsDir.appendingPathComponent("\(simulator)-\(name).png")
@@ -182,7 +191,12 @@ open class Snapshot: NSObject {
182191
return
183192
#endif
184193

185-
let networkLoadingIndicator = XCUIApplication().otherElements.deviceStatusBars.networkLoadingIndicators.element
194+
guard let app = self.app else {
195+
print("XCUIApplication is not set. Please call setupSnapshot(app) before snapshot().")
196+
return
197+
}
198+
199+
let networkLoadingIndicator = app.otherElements.deviceStatusBars.networkLoadingIndicators.element
186200
let networkLoadingIndicatorDisappeared = XCTNSPredicateExpectation(predicate: NSPredicate(format: "exists == false"), object: networkLoadingIndicator)
187201
_ = XCTWaiter.wait(for: [networkLoadingIndicatorDisappeared], timeout: timeout)
188202
}
@@ -257,7 +271,11 @@ private extension XCUIElementQuery {
257271
}
258272

259273
var deviceStatusBars: XCUIElementQuery {
260-
let deviceWidth = XCUIApplication().frame.width
274+
guard let app = Snapshot.app else {
275+
fatalError("XCUIApplication is not set. Please call setupSnapshot(app) before snapshot().")
276+
}
277+
278+
let deviceWidth = app.windows.firstMatch.frame.width
261279

262280
let isStatusBar = NSPredicate { (evaluatedObject, _) in
263281
guard let element = evaluatedObject as? XCUIElementAttributes else { return false }
@@ -277,4 +295,4 @@ private extension CGFloat {
277295

278296
// Please don't remove the lines below
279297
// They are used to detect outdated configuration files
280-
// SnapshotHelperVersion [1.10]
298+
// SnapshotHelperVersion [1.15]

0 commit comments

Comments
 (0)