diff options
| author | mojganii <mojgan.jelodar@codic.se> | 2025-02-03 13:45:28 +0100 |
|---|---|---|
| committer | Bug Magnet <marco.nikic@mullvad.net> | 2025-02-04 17:26:00 +0100 |
| commit | 6ce1e8c479f6d3be17f22b023ee2d2b4b7a5447e (patch) | |
| tree | 45f93afcd26ba967a6b252c9487f8e97df3d8b89 | |
| parent | 262deffffffcd7840be65cc331928633f24b9d09 (diff) | |
| download | mullvadvpn-6ce1e8c479f6d3be17f22b023ee2d2b4b7a5447e.tar.xz mullvadvpn-6ce1e8c479f6d3be17f22b023ee2d2b4b7a5447e.zip | |
Modify tests status
| -rw-r--r-- | ios/MullvadVPNUITests/ConnectivityTests.swift | 45 |
1 files changed, 24 insertions, 21 deletions
diff --git a/ios/MullvadVPNUITests/ConnectivityTests.swift b/ios/MullvadVPNUITests/ConnectivityTests.swift index 5d802af7c8..1cafff9ff3 100644 --- a/ios/MullvadVPNUITests/ConnectivityTests.swift +++ b/ios/MullvadVPNUITests/ConnectivityTests.swift @@ -15,11 +15,6 @@ class ConnectivityTests: LoggedOutUITestCase { /// Verifies that the app still functions when API has been blocked func testAPIConnectionViaBridges() throws { - let skipReason = """ - This test is currently skipped because shadowsocks bridges cannot be reached - from the staging environment - """ - try XCTSkipIf(true, skipReason) firewallAPIClient.removeRules() let hasTimeAccountNumber = getAccountWithTime() @@ -32,32 +27,40 @@ class ConnectivityTests: LoggedOutUITestCase { firewallAPIClient.createRule(try FirewallRule.makeBlockAPIAccessFirewallRule()) try Networking.verifyCannotAccessAPI() - LoginPage(app) + var successIconShown = false + var retryCount = 0 + let maxRetryCount = 3 + + let loginPage = LoginPage(app) .tapAccountNumberTextField() .enterText(hasTimeAccountNumber) - .tapAccountNumberSubmitButton() - // After creating firewall rule first login attempt might fail. One more attempt is allowed since the app is cycling between two methods. - let successIconShown = LoginPage(app) - .getSuccessIconShown() - - if successIconShown { - HeaderBar(app) - .verifyDeviceLabelShown() - } else { - LoginPage(app) - .verifyFailIconShown() + // After creating firewall rule first login attempt might fail. More attempts are allowed since the app is cycling between three methods. + repeat { + successIconShown = loginPage .tapAccountNumberSubmitButton() - .verifySuccessIconShown() + .getSuccessIconShown() - HeaderBar(app) - .verifyDeviceLabelShown() - } + if successIconShown == false { + // Give it some time to show up. App might be waiting for a network connection to timeout. + loginPage.waitForAccountNumberSubmitButton() + } + + retryCount += 1 + } while successIconShown == false && retryCount < maxRetryCount + + HeaderBar(app) + .verifyDeviceLabelShown() } /// Get the app into a blocked state by connecting to a relay then applying a filter which don't find this relay, then verify that app can still communicate by logging out and verifying that the device was successfully removed // swiftlint:disable:next function_body_length func testAPIReachableWhenBlocked() throws { + let skipReason = """ + URLSession doesn't work when the app is in a blocked state. + Thus, we should disable this test until we have migrated over to `Rust API client`. + """ + try XCTSkipIf(true, skipReason) let hasTimeAccountNumber = getAccountWithTime() addTeardownBlock { // Reset any filters |
