Skip to content

Commit

Permalink
Merge branch 'fix-nightly-ios-test-issues'
Browse files Browse the repository at this point in the history
  • Loading branch information
buggmagnet committed Apr 17, 2024
2 parents 746b930 + 3f22b8d commit f1d97bc
Show file tree
Hide file tree
Showing 7 changed files with 41 additions and 36 deletions.
2 changes: 0 additions & 2 deletions ios/Configurations/UITests.xcconfig.template
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ IOS_DEVICE_PIN_CODE =
TEST_DEVICE_IDENTIFIER_UUID =

// Mullvad accounts used by UI tests
NO_TIME_ACCOUNT_NUMBER[config=Debug] =
NO_TIME_ACCOUNT_NUMBER[config=Staging] =
HAS_TIME_ACCOUNT_NUMBER[config=Debug] =
HAS_TIME_ACCOUNT_NUMBER[config=Staging] =
FIVE_WIREGUARD_KEYS_ACCOUNT_NUMBER =
Expand Down
4 changes: 0 additions & 4 deletions ios/MullvadVPN.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -641,7 +641,6 @@
8556EB562B9B0AC500D26DD4 /* RevokedDevicePage.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8556EB552B9B0AC500D26DD4 /* RevokedDevicePage.swift */; };
855D9F5B2B63E56B00D7C64D /* ProblemReportPage.swift in Sources */ = {isa = PBXBuildFile; fileRef = 855D9F5A2B63E56B00D7C64D /* ProblemReportPage.swift */; };
8587A05D2B84D43100152938 /* ChangeLogAlert.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8587A05C2B84D43100152938 /* ChangeLogAlert.swift */; };
8590896C2B61763B003AF5F5 /* LoggedInWithoutTimeUITestCase.swift in Sources */ = {isa = PBXBuildFile; fileRef = 859089682B61763B003AF5F5 /* LoggedInWithoutTimeUITestCase.swift */; };
8590896F2B61763B003AF5F5 /* LoggedOutUITestCase.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8590896B2B61763B003AF5F5 /* LoggedOutUITestCase.swift */; };
85A42B862BB1D627007BABF7 /* XCUIElement+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 85A42B852BB1D627007BABF7 /* XCUIElement+Extensions.swift */; };
85B267612B849ADB0098E3CD /* mullvad-api.h in Headers */ = {isa = PBXBuildFile; fileRef = 85B267602B849ADB0098E3CD /* mullvad-api.h */; };
Expand Down Expand Up @@ -1903,7 +1902,6 @@
8556EB552B9B0AC500D26DD4 /* RevokedDevicePage.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RevokedDevicePage.swift; sourceTree = "<group>"; };
855D9F5A2B63E56B00D7C64D /* ProblemReportPage.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ProblemReportPage.swift; sourceTree = "<group>"; };
8587A05C2B84D43100152938 /* ChangeLogAlert.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ChangeLogAlert.swift; sourceTree = "<group>"; };
859089682B61763B003AF5F5 /* LoggedInWithoutTimeUITestCase.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LoggedInWithoutTimeUITestCase.swift; sourceTree = "<group>"; };
859089692B61763B003AF5F5 /* LoggedInWithTimeUITestCase.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LoggedInWithTimeUITestCase.swift; sourceTree = "<group>"; };
8590896A2B61763B003AF5F5 /* BaseUITestCase.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = BaseUITestCase.swift; sourceTree = "<group>"; };
8590896B2B61763B003AF5F5 /* LoggedOutUITestCase.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LoggedOutUITestCase.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -3613,7 +3611,6 @@
isa = PBXGroup;
children = (
8590896A2B61763B003AF5F5 /* BaseUITestCase.swift */,
859089682B61763B003AF5F5 /* LoggedInWithoutTimeUITestCase.swift */,
859089692B61763B003AF5F5 /* LoggedInWithTimeUITestCase.swift */,
8590896B2B61763B003AF5F5 /* LoggedOutUITestCase.swift */,
8518F6372B60157E009EB113 /* LoggedInWithoutTimeUITestCase.swift */,
Expand Down Expand Up @@ -5652,7 +5649,6 @@
852969362B4E9724007EAD4C /* AccessbilityIdentifier.swift in Sources */,
85E3BDE52B70E18C00FA71FD /* Networking.swift in Sources */,
85C7A2E92B89024B00035D5A /* SettingsTests.swift in Sources */,
8590896C2B61763B003AF5F5 /* LoggedInWithoutTimeUITestCase.swift in Sources */,
8590896F2B61763B003AF5F5 /* LoggedOutUITestCase.swift in Sources */,
85557B202B5FBBD700795FE1 /* AccountPage.swift in Sources */,
852969352B4E9270007EAD4C /* LoginPage.swift in Sources */,
Expand Down
2 changes: 1 addition & 1 deletion ios/MullvadVPNUITests/AccountTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ class AccountTests: LoggedOutUITestCase {
func testLogin() throws {
LoginPage(app)
.tapAccountNumberTextField()
.enterText(self.noTimeAccountNumber)
.enterText(hasTimeAccountNumber)
.tapAccountNumberSubmitButton()
.verifySuccessIconShown()
.verifyDeviceLabelShown()
Expand Down
10 changes: 10 additions & 0 deletions ios/MullvadVPNUITests/Pages/DNSSettingsPage.swift
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,16 @@ class DNSSettingsPage: Page {
return self
}

@discardableResult func tapBlockAdsSwitchIfOn() -> Self {
let blockAdsSwitch = app.cells[AccessibilityIdentifier.blockAdvertising]
.switches[AccessibilityIdentifier.customSwitch]

if blockAdsSwitch.value as? String == "1" {
tapBlockAdsSwitch()
}
return self
}

@discardableResult func tapBlockTrackerSwitch() -> Self {
app.cells[AccessibilityIdentifier.blockTracking]
.switches[AccessibilityIdentifier.customSwitch]
Expand Down
31 changes: 30 additions & 1 deletion ios/MullvadVPNUITests/RelayTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,22 @@ class RelayTests: LoggedInWithTimeUITestCase {
}

func testAdBlockingViaDNS() throws {
// Undo enabling block ads in teardown
addTeardownBlock {
HeaderBar(self.app)
.tapSettingsButton()

SettingsPage(self.app)
.tapVPNSettingsCell()

VPNSettingsPage(self.app)
.tapDNSSettingsCell()

DNSSettingsPage(self.app)
.tapDNSContentBlockersHeaderExpandButton()
.tapBlockAdsSwitchIfOn()
}

HeaderBar(app)
.tapSettingsButton()

Expand All @@ -57,7 +73,7 @@ class RelayTests: LoggedInWithTimeUITestCase {
TunnelControlPage(app)
.tapSecureConnectionButton()

allowAddVPNConfigurations() // Allow adding VPN configurations iOS permission
allowAddVPNConfigurationsIfAsked() // Allow adding VPN configurations iOS permission

TunnelControlPage(app)
.waitForSecureConnectionLabel()
Expand Down Expand Up @@ -90,6 +106,18 @@ class RelayTests: LoggedInWithTimeUITestCase {
}

func testWireGuardOverTCPManually() throws {
addTeardownBlock {
HeaderBar(self.app)
.tapSettingsButton()

SettingsPage(self.app)
.tapVPNSettingsCell()

VPNSettingsPage(self.app)
.tapWireGuardObfuscationExpandButton()
.tapWireGuardObfuscationOffCell()
}

HeaderBar(app)
.tapSettingsButton()

Expand Down Expand Up @@ -168,6 +196,7 @@ class RelayTests: LoggedInWithTimeUITestCase {
.enterText("4001")
.dismissKeyboard()
.swipeDownToDismissModal()
.swipeDownToDismissModal() // After editing text field the table is first responder for the first swipe so we need to swipe twice to swipe the modal

Check warning on line 199 in ios/MullvadVPNUITests/RelayTests.swift

View workflow job for this annotation

GitHub Actions / End to end tests

Line Length Violation: Line should be 120 characters or less; currently it has 160 characters (line_length)

TunnelControlPage(app)
.tapSecureConnectionButton()
Expand Down
2 changes: 0 additions & 2 deletions ios/MullvadVPNUITests/Test base classes/BaseUITestCase.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ class BaseUITestCase: XCTestCase {
// swiftlint:disable force_cast
let displayName = Bundle(for: BaseUITestCase.self)
.infoDictionary?["DisplayName"] as! String
let noTimeAccountNumber = Bundle(for: BaseUITestCase.self)
.infoDictionary?["NoTimeAccountNumber"] as! String
let hasTimeAccountNumber = Bundle(for: BaseUITestCase.self)
.infoDictionary?["HasTimeAccountNumber"] as! String
let fiveWireGuardKeysAccountNumber = Bundle(for: BaseUITestCase.self)
Expand Down

This file was deleted.

0 comments on commit f1d97bc

Please sign in to comment.