diff options
| author | Steffen Ernst <steffen.ernst@mullvad.net> | 2025-05-14 11:39:26 +0200 |
|---|---|---|
| committer | Steffen Ernst <steffen.ernst@mullvad.net> | 2025-05-20 15:46:45 +0200 |
| commit | 9050a07b1cfcd360e275dea85fd4fe8406a8a077 (patch) | |
| tree | f73b8f6c3917f1aa676bbfadf6261a5412254ee0 /ios | |
| parent | 0e4a039d00562afdc30e92f2c3e2f769929a765b (diff) | |
| download | mullvadvpn-9050a07b1cfcd360e275dea85fd4fe8406a8a077.tar.xz mullvadvpn-9050a07b1cfcd360e275dea85fd4fe8406a8a077.zip | |
Fix UI test for connection attempts
Diffstat (limited to 'ios')
| -rw-r--r-- | ios/MullvadVPNUITests/Pages/TunnelControlPage.swift | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/ios/MullvadVPNUITests/Pages/TunnelControlPage.swift b/ios/MullvadVPNUITests/Pages/TunnelControlPage.swift index 9a1039dfcc..c2996c6741 100644 --- a/ios/MullvadVPNUITests/Pages/TunnelControlPage.swift +++ b/ios/MullvadVPNUITests/Pages/TunnelControlPage.swift @@ -131,32 +131,32 @@ class TunnelControlPage: Page { /// Verify that the app attempts to connect over UDP before switching to TCP. For testing blocked UDP traffic. @discardableResult func verifyConnectingOverTCPAfterUDPAttempts() -> Self { - let connectionAttempts = waitForConnectionAttempts(4, timeout: 30) + let connectionAttempts = waitForConnectionAttempts(3, timeout: 30) // TODO: Revisit this when QUIC obfuscation is added - // Should do four connection attempts but due to UI bug sometimes only two are displayed, sometimes all four - if connectionAttempts.count == 4 { // Expected retries flow + // Should do three connection attempts but due to UI bug sometimes only two are displayed, sometimes all three + if connectionAttempts.count == 3 { // Expected retries flow for (attemptIndex, attempt) in connectionAttempts.enumerated() { - if attemptIndex < 3 { + if attemptIndex < 2 { XCTAssertEqual(attempt.protocolName, "UDP") - } else if attemptIndex == 3 { + } else if attemptIndex == 2 { XCTAssertEqual(attempt.protocolName, "TCP") } else { XCTFail("Unexpected connection attempt") } } - } else if connectionAttempts.count == 3 { // Most of the times this incorrect flow is shown + } else if connectionAttempts.count == 2 { // Most of the times this incorrect flow is shown for (attemptIndex, attempt) in connectionAttempts.enumerated() { - if attemptIndex == 0 || attemptIndex == 1 { + if attemptIndex == 0 { XCTAssertEqual(attempt.protocolName, "UDP") - } else if attemptIndex == 2 { + } else if attemptIndex == 1 { XCTAssertEqual(attempt.protocolName, "TCP") } else { XCTFail("Unexpected connection attempt") } } } else { - XCTFail("Unexpected number of connection attempts, expected 3~4, got \(connectionAttempts.count)") + XCTFail("Unexpected number of connection attempts, expected 2~3, got \(connectionAttempts.count)") } return self @@ -164,9 +164,9 @@ class TunnelControlPage: Page { /// Verify that connection attempts are made in the correct order @discardableResult func verifyConnectionAttemptsOrder() -> Self { - var connectionAttempts = waitForConnectionAttempts(4, timeout: 80) + var connectionAttempts = waitForConnectionAttempts(3, timeout: 80) var totalAttemptsOffset = 0 - XCTAssertEqual(connectionAttempts.count, 4) + XCTAssertEqual(connectionAttempts.count, 3) /// Sometimes, the UI will only show an IP address for the first connection attempt, which gets skipped by /// `waitForConnectionAttempts`, and offsets expected attempts count by 1, but still counts towards @@ -177,7 +177,7 @@ class TunnelControlPage: Page { totalAttemptsOffset = 1 } for (attemptIndex, attempt) in connectionAttempts.enumerated() { - if attemptIndex < 3 - totalAttemptsOffset { + if attemptIndex < 2 - totalAttemptsOffset { XCTAssertEqual(attempt.protocolName, "UDP") } else { XCTAssertEqual(attempt.protocolName, "TCP") |
