summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorAndrej Mihajlov <and@mullvad.net>2022-12-20 12:53:47 +0100
committerAndrej Mihajlov <and@mullvad.net>2022-12-20 16:59:38 +0100
commit32d7c9188be208d83e73bfc092eed7a46b2195ce (patch)
tree4e5b850136f188d9b84ecb2b500c434897ae957c
parent788858287f68d4b1b78b2d5c2136ca515dce4a4f (diff)
downloadmullvadvpn-32d7c9188be208d83e73bfc092eed7a46b2195ce.tar.xz
mullvadvpn-32d7c9188be208d83e73bfc092eed7a46b2195ce.zip
Fix screenshot script
-rw-r--r--ios/MullvadVPN/AccountContentView.swift1
-rw-r--r--ios/MullvadVPNScreenshots/MullvadVPNScreenshots.swift26
2 files changed, 23 insertions, 4 deletions
diff --git a/ios/MullvadVPN/AccountContentView.swift b/ios/MullvadVPN/AccountContentView.swift
index 13c78226e7..604ba53ed4 100644
--- a/ios/MullvadVPN/AccountContentView.swift
+++ b/ios/MullvadVPN/AccountContentView.swift
@@ -12,6 +12,7 @@ class AccountContentView: UIView {
let purchaseButton: InAppPurchaseButton = {
let button = InAppPurchaseButton()
button.translatesAutoresizingMaskIntoConstraints = false
+ button.accessibilityIdentifier = "PurchaseButton"
return button
}()
diff --git a/ios/MullvadVPNScreenshots/MullvadVPNScreenshots.swift b/ios/MullvadVPNScreenshots/MullvadVPNScreenshots.swift
index ea72413456..6fe7ead758 100644
--- a/ios/MullvadVPNScreenshots/MullvadVPNScreenshots.swift
+++ b/ios/MullvadVPNScreenshots/MullvadVPNScreenshots.swift
@@ -89,11 +89,18 @@ class MullvadVPNScreenshots: XCTestCase {
// Open Settings
app.buttons["SettingsButton"].tap()
- // Tap on WireGuard key cell
- _ = app.tables.cells["WireGuardKeyCell"].waitForExistence(timeout: 2)
- app.tables.cells["WireGuardKeyCell"].tap()
+ // Tap on preferences cell
+ _ = app.tables.cells["PreferencesCell"].waitForExistence(timeout: 2)
+ app.tables.cells["PreferencesCell"].tap()
- snapshot("WireGuardKeys")
+ app.tables.element
+ .cells
+ .matching(NSPredicate(format: "identifier BEGINSWITH %@", "mullvadDNS"))
+ .switches
+ .matching(NSPredicate(format: "value = %@", "0"))
+ .allElementsBoundByAccessibilityElement
+ .forEach { $0.tap() }
+ snapshot("Preferences")
// Tap back button
app.navigationBars.buttons.firstMatch.tap()
@@ -102,6 +109,17 @@ class MullvadVPNScreenshots: XCTestCase {
_ = app.tables.cells["AccountCell"].waitForExistence(timeout: 2)
app.tables.cells["AccountCell"].tap()
+ // Wait for StoreKit to fetch subscriptions
+ _ = app.buttons["PurchaseButton"].waitForExistence(timeout: 2)
+
+ wait(for: [
+ expectation(
+ for: NSPredicate(format: "isEnabled = YES"),
+ evaluatedWith: app.buttons["PurchaseButton"]
+ ),
+ ], timeout: 10)
+ snapshot("Account")
+
// Hit "Log out" button
_ = app.buttons["LogoutButton"].waitForExistence(timeout: 2)
app.buttons["LogoutButton"].tap()