summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorAndrej Mihajlov <and@mullvad.net>2021-11-15 11:33:55 +0100
committerAndrej Mihajlov <and@mullvad.net>2021-11-15 11:33:55 +0100
commit72e308a26fdc3a5bde684d64ff60e33d45ded60a (patch)
tree4ddab574c41282aa2b05f96348e5cec3e0122266
parente0ef587b97b8ee9f198e8fef56fb0a12ad81be5b (diff)
parentd458e55336f463d55bcb8e7f0cdf6001e84c33ed (diff)
downloadmullvadvpn-72e308a26fdc3a5bde684d64ff60e33d45ded60a.tar.xz
mullvadvpn-72e308a26fdc3a5bde684d64ff60e33d45ded60a.zip
Merge branch 'update-screenshot-script'
-rw-r--r--ios/Gemfile2
-rw-r--r--ios/Gemfile.lock164
-rw-r--r--ios/MullvadVPN/AccountContentView.swift1
-rw-r--r--ios/MullvadVPNScreenshots/MullvadVPNScreenshots.swift6
-rw-r--r--ios/MullvadVPNScreenshots/SnapshotHelper.swift33
-rw-r--r--ios/Snapfile9
6 files changed, 144 insertions, 71 deletions
diff --git a/ios/Gemfile b/ios/Gemfile
index 41ae6bb247..645782de14 100644
--- a/ios/Gemfile
+++ b/ios/Gemfile
@@ -1,3 +1,3 @@
source "https://rubygems.org"
-gem "fastlane", "~> 2.158.0"
+gem "fastlane", "~> 2.197.0"
diff --git a/ios/Gemfile.lock b/ios/Gemfile.lock
index 6056b5c340..a1839e804a 100644
--- a/ios/Gemfile.lock
+++ b/ios/Gemfile.lock
@@ -1,57 +1,76 @@
GEM
remote: https://rubygems.org/
specs:
- CFPropertyList (3.0.2)
+ CFPropertyList (3.0.4)
+ rexml
addressable (2.8.0)
public_suffix (>= 2.0.2, < 5.0)
+ artifactory (3.0.15)
atomos (0.1.3)
- aws-eventstream (1.1.0)
- aws-partitions (1.365.0)
- aws-sdk-core (3.105.0)
+ aws-eventstream (1.2.0)
+ aws-partitions (1.524.0)
+ aws-sdk-core (3.121.6)
aws-eventstream (~> 1, >= 1.0.2)
- aws-partitions (~> 1, >= 1.239.0)
+ aws-partitions (~> 1, >= 1.520.1)
aws-sigv4 (~> 1.1)
jmespath (~> 1.0)
- aws-sdk-kms (1.37.0)
- aws-sdk-core (~> 3, >= 3.99.0)
+ aws-sdk-kms (1.50.0)
+ aws-sdk-core (~> 3, >= 3.121.2)
aws-sigv4 (~> 1.1)
- aws-sdk-s3 (1.79.1)
- aws-sdk-core (~> 3, >= 3.104.3)
+ aws-sdk-s3 (1.104.0)
+ aws-sdk-core (~> 3, >= 3.121.2)
aws-sdk-kms (~> 1)
- aws-sigv4 (~> 1.1)
- aws-sigv4 (1.2.2)
+ aws-sigv4 (~> 1.4)
+ aws-sigv4 (1.4.0)
aws-eventstream (~> 1, >= 1.0.2)
- babosa (1.0.3)
+ babosa (1.0.4)
claide (1.0.3)
colored (1.2)
colored2 (3.1.2)
- commander-fastlane (4.4.6)
- highline (~> 1.7.2)
+ commander (4.6.0)
+ highline (~> 2.0.0)
declarative (0.0.20)
- declarative-option (0.1.0)
- digest-crc (0.6.1)
- rake (~> 13.0)
+ digest-crc (0.6.4)
+ rake (>= 12.0.0, < 14.0.0)
domain_name (0.5.20190701)
unf (>= 0.0.5, < 1.0.0)
dotenv (2.7.6)
- emoji_regex (3.0.0)
- excon (0.76.0)
- faraday (1.0.1)
+ emoji_regex (3.2.3)
+ excon (0.88.0)
+ faraday (1.8.0)
+ faraday-em_http (~> 1.0)
+ faraday-em_synchrony (~> 1.0)
+ faraday-excon (~> 1.1)
+ faraday-httpclient (~> 1.0.1)
+ faraday-net_http (~> 1.0)
+ faraday-net_http_persistent (~> 1.1)
+ faraday-patron (~> 1.0)
+ faraday-rack (~> 1.0)
multipart-post (>= 1.2, < 3)
+ ruby2_keywords (>= 0.0.4)
faraday-cookie_jar (0.0.7)
faraday (>= 0.8.0)
http-cookie (~> 1.0.0)
- faraday_middleware (1.0.0)
+ faraday-em_http (1.0.0)
+ faraday-em_synchrony (1.0.0)
+ faraday-excon (1.1.0)
+ faraday-httpclient (1.0.1)
+ faraday-net_http (1.0.1)
+ faraday-net_http_persistent (1.2.0)
+ faraday-patron (1.0.0)
+ faraday-rack (1.0.0)
+ faraday_middleware (1.2.0)
faraday (~> 1.0)
- fastimage (2.2.0)
- fastlane (2.158.0)
+ fastimage (2.2.5)
+ fastlane (2.197.0)
CFPropertyList (>= 2.3, < 4.0.0)
- addressable (>= 2.3, < 3.0.0)
+ addressable (>= 2.8, < 3.0.0)
+ artifactory (~> 3.0)
aws-sdk-s3 (~> 1.0)
babosa (>= 1.0.3, < 2.0.0)
bundler (>= 1.12.0, < 3.0.0)
colored
- commander-fastlane (>= 4.4.6, < 5.0.0)
+ commander (~> 4.6)
dotenv (>= 2.1.1, < 3.0.0)
emoji_regex (>= 0.1, < 4.0)
excon (>= 0.71.0, < 1.0.0)
@@ -60,18 +79,20 @@ GEM
faraday_middleware (~> 1.0)
fastimage (>= 2.1.0, < 3.0.0)
gh_inspector (>= 1.1.2, < 2.0.0)
- google-api-client (>= 0.37.0, < 0.39.0)
- google-cloud-storage (>= 1.15.0, < 2.0.0)
- highline (>= 1.7.2, < 2.0.0)
+ google-apis-androidpublisher_v3 (~> 0.3)
+ google-apis-playcustomapp_v1 (~> 0.1)
+ google-cloud-storage (~> 1.31)
+ highline (~> 2.0)
json (< 3.0.0)
jwt (>= 2.1.0, < 3)
mini_magick (>= 4.9.4, < 5.0.0)
multipart-post (~> 2.0.0)
+ naturally (~> 2.2)
+ optparse (~> 0.1.1)
plist (>= 3.1.0, < 4.0.0)
rubyzip (>= 2.0.0, < 3.0.0)
security (= 0.1.3)
simctl (~> 1.6.3)
- slack-notifier (>= 2.0.0, < 3.0.0)
terminal-notifier (>= 2.0.0, < 3.0.0)
terminal-table (>= 1.4.5, < 2.0.0)
tty-screen (>= 0.6.3, < 1.0.0)
@@ -81,72 +102,85 @@ GEM
xcpretty (~> 0.3.0)
xcpretty-travis-formatter (>= 0.0.3)
gh_inspector (1.1.3)
- google-api-client (0.38.0)
+ google-apis-androidpublisher_v3 (0.13.0)
+ google-apis-core (>= 0.4, < 2.a)
+ google-apis-core (0.4.1)
addressable (~> 2.5, >= 2.5.1)
- googleauth (~> 0.9)
- httpclient (>= 2.8.1, < 3.0)
+ googleauth (>= 0.16.2, < 2.a)
+ httpclient (>= 2.8.1, < 3.a)
mini_mime (~> 1.0)
representable (~> 3.0)
- retriable (>= 2.0, < 4.0)
- signet (~> 0.12)
- google-cloud-core (1.5.0)
+ retriable (>= 2.0, < 4.a)
+ rexml
+ webrick
+ google-apis-iamcredentials_v1 (0.8.0)
+ google-apis-core (>= 0.4, < 2.a)
+ google-apis-playcustomapp_v1 (0.6.0)
+ google-apis-core (>= 0.4, < 2.a)
+ google-apis-storage_v1 (0.9.0)
+ google-apis-core (>= 0.4, < 2.a)
+ google-cloud-core (1.6.0)
google-cloud-env (~> 1.0)
google-cloud-errors (~> 1.0)
- google-cloud-env (1.3.3)
+ google-cloud-env (1.5.0)
faraday (>= 0.17.3, < 2.0)
- google-cloud-errors (1.0.1)
- google-cloud-storage (1.28.0)
+ google-cloud-errors (1.2.0)
+ google-cloud-storage (1.34.1)
addressable (~> 2.5)
digest-crc (~> 0.4)
- google-api-client (~> 0.33)
- google-cloud-core (~> 1.2)
- googleauth (~> 0.9)
+ google-apis-iamcredentials_v1 (~> 0.1)
+ google-apis-storage_v1 (~> 0.1)
+ google-cloud-core (~> 1.6)
+ googleauth (>= 0.16.2, < 2.a)
mini_mime (~> 1.0)
- googleauth (0.13.1)
+ googleauth (1.1.0)
faraday (>= 0.17.3, < 2.0)
jwt (>= 1.4, < 3.0)
memoist (~> 0.16)
multi_json (~> 1.11)
os (>= 0.9, < 2.0)
- signet (~> 0.14)
- highline (1.7.10)
- http-cookie (1.0.3)
+ signet (>= 0.16, < 2.a)
+ highline (2.0.3)
+ http-cookie (1.0.4)
domain_name (~> 0.5)
httpclient (2.8.3)
jmespath (1.4.0)
- json (2.3.1)
- jwt (2.2.2)
+ json (2.6.1)
+ jwt (2.3.0)
memoist (0.16.2)
- mini_magick (4.10.1)
- mini_mime (1.0.2)
+ mini_magick (4.11.0)
+ mini_mime (1.1.2)
multi_json (1.15.0)
multipart-post (2.0.0)
nanaimo (0.3.0)
- naturally (2.2.0)
+ naturally (2.2.1)
+ optparse (0.1.1)
os (1.1.1)
- plist (3.5.0)
+ plist (3.6.0)
public_suffix (4.0.6)
- rake (13.0.1)
- representable (3.0.4)
+ rake (13.0.6)
+ representable (3.1.1)
declarative (< 0.1.0)
- declarative-option (< 0.2.0)
+ trailblazer-option (>= 0.1.1, < 0.2.0)
uber (< 0.2.0)
retriable (3.1.2)
+ rexml (3.2.5)
rouge (2.0.7)
- rubyzip (2.3.0)
+ ruby2_keywords (0.0.5)
+ rubyzip (2.3.2)
security (0.1.3)
- signet (0.14.0)
- addressable (~> 2.3)
+ signet (0.16.0)
+ addressable (~> 2.8)
faraday (>= 0.17.3, < 2.0)
jwt (>= 1.5, < 3.0)
multi_json (~> 1.10)
simctl (1.6.8)
CFPropertyList
naturally
- slack-notifier (2.3.2)
terminal-notifier (2.0.0)
terminal-table (1.8.0)
unicode-display_width (~> 1.1, >= 1.1.1)
+ trailblazer-option (0.1.1)
tty-cursor (0.7.1)
tty-screen (0.8.1)
tty-spinner (0.9.3)
@@ -154,25 +188,27 @@ GEM
uber (0.1.0)
unf (0.1.4)
unf_ext
- unf_ext (0.0.7.7)
- unicode-display_width (1.7.0)
+ unf_ext (0.0.8)
+ unicode-display_width (1.8.0)
+ webrick (1.7.0)
word_wrap (1.0.0)
- xcodeproj (1.18.0)
+ xcodeproj (1.21.0)
CFPropertyList (>= 2.3.3, < 4.0)
atomos (~> 0.1.3)
claide (>= 1.0.2, < 2.0)
colored2 (~> 3.1)
nanaimo (~> 0.3.0)
+ rexml (~> 3.2.4)
xcpretty (0.3.0)
rouge (~> 2.0.7)
- xcpretty-travis-formatter (1.0.0)
+ xcpretty-travis-formatter (1.0.1)
xcpretty (~> 0.2, >= 0.0.7)
PLATFORMS
ruby
DEPENDENCIES
- fastlane (~> 2.158.0)
+ fastlane (~> 2.197.0)
BUNDLED WITH
- 1.16.6
+ 1.17.3
diff --git a/ios/MullvadVPN/AccountContentView.swift b/ios/MullvadVPN/AccountContentView.swift
index 127ee39b3c..93fb6d3186 100644
--- a/ios/MullvadVPN/AccountContentView.swift
+++ b/ios/MullvadVPN/AccountContentView.swift
@@ -31,6 +31,7 @@ class AccountContentView: UIView {
let logoutButton: AppButton = {
let button = AppButton(style: .danger)
button.translatesAutoresizingMaskIntoConstraints = false
+ button.accessibilityIdentifier = "LogoutButton"
button.setTitle(NSLocalizedString(
"LOGOUT_BUTTON_TITLE",
tableName: "Account",
diff --git a/ios/MullvadVPNScreenshots/MullvadVPNScreenshots.swift b/ios/MullvadVPNScreenshots/MullvadVPNScreenshots.swift
index e9e2db3ce1..6de279d85b 100644
--- a/ios/MullvadVPNScreenshots/MullvadVPNScreenshots.swift
+++ b/ios/MullvadVPNScreenshots/MullvadVPNScreenshots.swift
@@ -51,14 +51,14 @@ class MullvadVPNScreenshots: XCTestCase {
textField.typeText("\n")
}
- // Select Australia, Melbourne in Select location controller
+ // Select Sweden, Gothenburg in Select location controller
if case .phone = UIDevice.current.userInterfaceIdiom {
_ = app.buttons["SelectLocationButton"].waitForExistence(timeout: 10)
app.buttons["SelectLocationButton"].tap()
}
- let countryCell = app.cells["au"]
- let cityCell = app.cells["au-mel"]
+ let countryCell = app.cells["se"]
+ let cityCell = app.cells["se-got"]
_ = countryCell.waitForExistence(timeout: 2)
diff --git a/ios/MullvadVPNScreenshots/SnapshotHelper.swift b/ios/MullvadVPNScreenshots/SnapshotHelper.swift
index f5b393c2c5..015cfeaa55 100644
--- a/ios/MullvadVPNScreenshots/SnapshotHelper.swift
+++ b/ios/MullvadVPNScreenshots/SnapshotHelper.swift
@@ -165,6 +165,12 @@ open class Snapshot: NSObject {
}
let screenshot = XCUIScreen.main.screenshot()
+ #if os(iOS)
+ let image = XCUIDevice.shared.orientation.isLandscape ? fixLandscapeOrientation(image: screenshot.image) : screenshot.image
+ #else
+ let image = screenshot.image
+ #endif
+
guard var simulator = ProcessInfo().environment["SIMULATOR_DEVICE_NAME"], let screenshotsDir = screenshotsDirectory else { return }
do {
@@ -174,7 +180,11 @@ open class Snapshot: NSObject {
simulator = regex.stringByReplacingMatches(in: simulator, range: range, withTemplate: "")
let path = screenshotsDir.appendingPathComponent("\(simulator)-\(name).png")
- try screenshot.pngRepresentation.write(to: path)
+ #if swift(<5.0)
+ UIImagePNGRepresentation(image)?.write(to: path, options: .atomic)
+ #else
+ try image.pngData()?.write(to: path, options: .atomic)
+ #endif
} catch let error {
NSLog("Problem writing screenshot: \(name) to \(screenshotsDir)/\(simulator)-\(name).png")
NSLog(error.localizedDescription)
@@ -182,6 +192,23 @@ open class Snapshot: NSObject {
#endif
}
+ class func fixLandscapeOrientation(image: UIImage) -> UIImage {
+ #if os(watchOS)
+ return image
+ #else
+ if #available(iOS 10.0, *) {
+ let format = UIGraphicsImageRendererFormat()
+ format.scale = image.scale
+ let renderer = UIGraphicsImageRenderer(size: image.size, format: format)
+ return renderer.image { context in
+ image.draw(in: CGRect(x: 0, y: 0, width: image.size.width, height: image.size.height))
+ }
+ } else {
+ return image
+ }
+ #endif
+ }
+
class func waitForLoadingIndicatorToDisappear(within timeout: TimeInterval) {
#if os(tvOS)
return
@@ -204,7 +231,7 @@ open class Snapshot: NSObject {
#if os(OSX)
let homeDir = URL(fileURLWithPath: NSHomeDirectory())
return homeDir.appendingPathComponent(cachePath)
- #elseif arch(i386) || arch(x86_64)
+ #elseif arch(i386) || arch(x86_64) || arch(arm64)
guard let simulatorHostHome = ProcessInfo().environment["SIMULATOR_HOST_HOME"] else {
throw SnapshotError.cannotFindSimulatorHomeDirectory
}
@@ -279,4 +306,4 @@ private extension CGFloat {
// Please don't remove the lines below
// They are used to detect outdated configuration files
-// SnapshotHelperVersion [1.23]
+// SnapshotHelperVersion [1.27]
diff --git a/ios/Snapfile b/ios/Snapfile
index 9893e94341..5f046038b0 100644
--- a/ios/Snapfile
+++ b/ios/Snapfile
@@ -31,6 +31,15 @@ erase_simulator(true)
# Disable concurrent simulators to prevent too many WireGuard public keys error
concurrent_simulators(false)
+# Hide simulator window
+headless(true)
+
+# Disable xcodebuild output to console
+suppress_xcode_output(true)
+
+# Prevent opening HTML summary
+skip_open_summary(true)
+
# Clean the device statusbar
override_status_bar(true)