Skip to content

Commit

Permalink
Fix for failing nightly iOS end to end tests
Browse files Browse the repository at this point in the history
  • Loading branch information
niklasberglund committed Apr 15, 2024
1 parent f36bd2e commit 1a82fa8
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 37 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 @@ -637,7 +637,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 @@ -1896,7 +1895,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 @@ -3603,7 +3601,6 @@
isa = PBXGroup;
children = (
8590896A2B61763B003AF5F5 /* BaseUITestCase.swift */,
859089682B61763B003AF5F5 /* LoggedInWithoutTimeUITestCase.swift */,
859089692B61763B003AF5F5 /* LoggedInWithTimeUITestCase.swift */,
8590896B2B61763B003AF5F5 /* LoggedOutUITestCase.swift */,
8518F6372B60157E009EB113 /* LoggedInWithoutTimeUITestCase.swift */,
Expand Down Expand Up @@ -5638,7 +5635,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(self.hasTimeAccountNumber)
.tapAccountNumberSubmitButton()
.verifySuccessIconShown()
.verifyDeviceLabelShown()
Expand Down
33 changes: 31 additions & 2 deletions ios/MullvadVPNUITests/RelayTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,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()
.tapBlockAdsSwitch()
}

HeaderBar(app)
.tapSettingsButton()

Expand All @@ -44,7 +60,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 @@ -77,6 +93,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 @@ -155,6 +183,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

TunnelControlPage(app)
.tapSecureConnectionButton()
Expand Down Expand Up @@ -205,7 +234,7 @@ class RelayTests: LoggedInWithTimeUITestCase {
TunnelControlPage(app)
.tapSecureConnectionButton()

allowAddVPNConfigurations()
allowAddVPNConfigurationsIfAsked()

HeaderBar(app)
.tapSettingsButton()
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 1a82fa8

Please sign in to comment.