-
Notifications
You must be signed in to change notification settings - Fork 349
Commit
- Loading branch information
There are no files selected for viewing
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// | ||
// SafariApp.swift | ||
// MullvadVPNUITests | ||
// | ||
// Created by Niklas Berglund on 2024-05-31. | ||
// Copyright © 2024 Mullvad VPN AB. All rights reserved. | ||
// | ||
|
||
import XCTest | ||
|
||
class SafariApp { | ||
let app = XCUIApplication(bundleIdentifier: "com.apple.mobilesafari") | ||
|
||
func launch() { | ||
app.launch() | ||
} | ||
|
||
@discardableResult func tapAddressBar() -> Self { | ||
app.textFields.firstMatch.tap() | ||
return self | ||
} | ||
|
||
@discardableResult func enterText(_ text: String) -> Self { | ||
app.typeText(text) | ||
return self | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
// | ||
// LeakTests.swift | ||
// MullvadVPNUITests | ||
// | ||
// Created by Niklas Berglund on 2024-05-31. | ||
// Copyright © 2024 Mullvad VPN AB. All rights reserved. | ||
// | ||
|
||
import XCTest | ||
|
||
class LeakTests: LoggedInWithTimeUITestCase { | ||
/// For now just the skeleton of a leak test - traffic is captured and parsed, but not analyzed | ||
func testLeaks() throws { | ||
startPacketCapture() | ||
|
||
TunnelControlPage(app) | ||
.tapSecureConnectionButton() | ||
|
||
allowAddVPNConfigurationsIfAsked() | ||
|
||
TunnelControlPage(app) | ||
.waitForSecureConnectionLabel() | ||
|
||
// Trigger traffic by navigating to website in Safari | ||
let safariApp = SafariApp() | ||
safariApp.launch() | ||
safariApp.tapAddressBar() | ||
safariApp.enterText("mullvad.net\n") | ||
|
||
app.launch() | ||
TunnelControlPage(app) | ||
.tapDisconnectButton() | ||
|
||
// Keep the capture open for a while | ||
Thread.sleep(forTimeInterval: 5.0) | ||
let capturedTraffic = stopPacketCapture() | ||
Check warning on line 36 in ios/MullvadVPNUITests/LeakTests.swift GitHub Actions / End to end tests
Check warning on line 36 in ios/MullvadVPNUITests/LeakTests.swift GitHub Actions / End to end tests
Check warning on line 36 in ios/MullvadVPNUITests/LeakTests.swift GitHub Actions / End to end tests
Check warning on line 36 in ios/MullvadVPNUITests/LeakTests.swift GitHub Actions / End to end tests
Check warning on line 36 in ios/MullvadVPNUITests/LeakTests.swift GitHub Actions / End to end tests
Check warning on line 36 in ios/MullvadVPNUITests/LeakTests.swift GitHub Actions / End to end tests
Check warning on line 36 in ios/MullvadVPNUITests/LeakTests.swift GitHub Actions / End to end tests
Check warning on line 36 in ios/MullvadVPNUITests/LeakTests.swift GitHub Actions / End to end tests
Check warning on line 36 in ios/MullvadVPNUITests/LeakTests.swift GitHub Actions / End to end tests
Check warning on line 36 in ios/MullvadVPNUITests/LeakTests.swift GitHub Actions / End to end tests
Check warning on line 36 in ios/MullvadVPNUITests/LeakTests.swift GitHub Actions / End to end tests
Check warning on line 36 in ios/MullvadVPNUITests/LeakTests.swift GitHub Actions / End to end tests
Check warning on line 36 in ios/MullvadVPNUITests/LeakTests.swift GitHub Actions / End to end tests
Check warning on line 36 in ios/MullvadVPNUITests/LeakTests.swift GitHub Actions / End to end tests
Check warning on line 36 in ios/MullvadVPNUITests/LeakTests.swift GitHub Actions / End to end tests
|
||
|
||
// Analyze captured traffic | ||
} | ||
} |