diff --git a/ios/MullvadVPN/AppDelegate.swift b/ios/MullvadVPN/AppDelegate.swift index b31acdcaab3d..54b0d8343abe 100644 --- a/ios/MullvadVPN/AppDelegate.swift +++ b/ios/MullvadVPN/AppDelegate.swift @@ -407,6 +407,10 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD } private func setupNotifications() { + // We can't close banners in the screenshot tests due to how the NotificationController view + // is overridden, so we need this horrible workaround to make sure that no banners are visible. + guard launchArguments.target != .screenshots else { return } + NotificationManager.shared.notificationProviders = [ TunnelStatusNotificationProvider(tunnelManager: tunnelManager), AccountExpirySystemNotificationProvider(tunnelManager: tunnelManager), diff --git a/ios/MullvadVPNScreenshots/MullvadVPNScreenshots.swift b/ios/MullvadVPNScreenshots/MullvadVPNScreenshots.swift index 55debaa9b3a1..764dbc2632af 100644 --- a/ios/MullvadVPNScreenshots/MullvadVPNScreenshots.swift +++ b/ios/MullvadVPNScreenshots/MullvadVPNScreenshots.swift @@ -88,7 +88,7 @@ class MullvadVPNScreenshots: XCTestCase { // Wait for Disconnect button to appear _ = app.buttons[AccessibilityIdentifier.disconnectButton.rawValue].waitForExistence(timeout: 2) - snapshot("MainSecured") + snapshot("ConnectionSecured") // Re-open Select location controller (iPhone only) if case .phone = UIDevice.current.userInterfaceIdiom { @@ -113,15 +113,14 @@ class MullvadVPNScreenshots: XCTestCase { // Tap on VPN settings cell _ = app.tables.cells[AccessibilityIdentifier.vpnSettingsCell.rawValue].waitForExistence(timeout: 2) app.tables.cells[AccessibilityIdentifier.vpnSettingsCell.rawValue].tap() + snapshot("VPNSettings") - app.tables.element - .cells - .matching(NSPredicate(format: "identifier BEGINSWITH %@", "mullvadDNS")) - .switches - .matching(NSPredicate(format: "value = %@", "0")) - .allElementsBoundByAccessibilityElement - .forEach { $0.tap() } - snapshot("VPN Settings") + let quantumCell = app.tables.otherElements.containing( + .any, + identifier: AccessibilityIdentifier.quantumResistantTunnelCell.rawValue + ) + quantumCell.buttons[AccessibilityIdentifier.expandButton.rawValue].tap() + app.cells[AccessibilityIdentifier.quantumResistanceOn.rawValue].tap() // Tap back button app.navigationBars.buttons.firstMatch.tap() @@ -129,6 +128,13 @@ class MullvadVPNScreenshots: XCTestCase { // Tap dismiss button app.navigationBars.buttons.firstMatch.tap() + // Acquire a quantum resistant connection + app.buttons[AccessibilityIdentifier.disconnectButton.rawValue].tap() + app.buttons[AccessibilityIdentifier.secureConnectionButton.rawValue].tap() + _ = app.staticTexts[AccessibilityIdentifier.connectionStatusConnectedLabel.rawValue] + .waitForExistence(timeout: 5) + snapshot("QuantumResistantConnectionSecured") + // Open Account app.buttons[AccessibilityIdentifier.accountButton.rawValue].tap()