Skip to content

Commit

Permalink
Update screenshots to use post quantum tunnel
Browse files Browse the repository at this point in the history
  • Loading branch information
Jon Petersson committed May 28, 2024
1 parent 2211f28 commit e6b0148
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 9 deletions.
4 changes: 4 additions & 0 deletions ios/MullvadVPN/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down
24 changes: 15 additions & 9 deletions ios/MullvadVPNScreenshots/MullvadVPNScreenshots.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -113,22 +113,28 @@ 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()

// 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: 2)
snapshot("QuantumResistantConnectionSecured")

// Open Account
app.buttons[AccessibilityIdentifier.accountButton.rawValue].tap()

Expand Down

0 comments on commit e6b0148

Please sign in to comment.