Skip to content

Commit a21fa64

Browse files
committed
Modify tests status
1 parent 018997a commit a21fa64

File tree

1 file changed

+24
-21
lines changed

1 file changed

+24
-21
lines changed

ios/MullvadVPNUITests/ConnectivityTests.swift

+24-21
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,6 @@ class ConnectivityTests: LoggedOutUITestCase {
1515

1616
/// Verifies that the app still functions when API has been blocked
1717
func testAPIConnectionViaBridges() throws {
18-
let skipReason = """
19-
This test is currently skipped because shadowsocks bridges cannot be reached
20-
from the staging environment
21-
"""
22-
try XCTSkipIf(true, skipReason)
2318
firewallAPIClient.removeRules()
2419
let hasTimeAccountNumber = getAccountWithTime()
2520

@@ -32,32 +27,40 @@ class ConnectivityTests: LoggedOutUITestCase {
3227
firewallAPIClient.createRule(try FirewallRule.makeBlockAPIAccessFirewallRule())
3328
try Networking.verifyCannotAccessAPI()
3429

35-
LoginPage(app)
30+
var successIconShown = false
31+
var retryCount = 0
32+
let maxRetryCount = 3
33+
34+
let loginPage = LoginPage(app)
3635
.tapAccountNumberTextField()
3736
.enterText(hasTimeAccountNumber)
38-
.tapAccountNumberSubmitButton()
3937

40-
// After creating firewall rule first login attempt might fail. One more attempt is allowed since the app is cycling between two methods.
41-
let successIconShown = LoginPage(app)
42-
.getSuccessIconShown()
43-
44-
if successIconShown {
45-
HeaderBar(app)
46-
.verifyDeviceLabelShown()
47-
} else {
48-
LoginPage(app)
49-
.verifyFailIconShown()
38+
// After creating firewall rule login attempt might fail. More attempt are allowed since the app is cycling between three methods.
39+
repeat {
40+
successIconShown = loginPage
5041
.tapAccountNumberSubmitButton()
51-
.verifySuccessIconShown()
42+
.getSuccessIconShown()
5243

53-
HeaderBar(app)
54-
.verifyDeviceLabelShown()
55-
}
44+
if successIconShown == false {
45+
// Give it some time to show up. App might be waiting for a network connection to timeout.
46+
loginPage.waitForAccountNumberSubmitButton()
47+
}
48+
49+
retryCount += 1
50+
} while successIconShown == false && retryCount < maxRetryCount
51+
52+
HeaderBar(app)
53+
.verifyDeviceLabelShown()
5654
}
5755

5856
/// 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
5957
// swiftlint:disable:next function_body_length
6058
func testAPIReachableWhenBlocked() throws {
59+
let skipReason = """
60+
URLSession doesn't work when the app is in a blocked state.
61+
Thus, we should disable this test until we have migrated over to `Rust API client`.
62+
"""
63+
try XCTSkipIf(true, skipReason)
6164
let hasTimeAccountNumber = getAccountWithTime()
6265
addTeardownBlock {
6366
// Reset any filters

0 commit comments

Comments
 (0)