diff --git a/ios/MullvadVPN/Classes/AccessbilityIdentifier.swift b/ios/MullvadVPN/Classes/AccessbilityIdentifier.swift index 0970ed889b63..5aa1e0c86823 100644 --- a/ios/MullvadVPN/Classes/AccessbilityIdentifier.swift +++ b/ios/MullvadVPN/Classes/AccessbilityIdentifier.swift @@ -181,7 +181,7 @@ public enum AccessibilityIdentifier: Equatable { case wireGuardObfuscationOff case wireGuardObfuscationUdpOverTcp case wireGuardObfuscationShadowsocks - case wireGuardPort + case wireGuardPort(UInt16?) case udpOverTcpObfuscationSettings // Custom DNS diff --git a/ios/MullvadVPN/View controllers/SelectLocation/LocationCell.swift b/ios/MullvadVPN/View controllers/SelectLocation/LocationCell.swift index d74e61990ce8..dfeab104ff68 100644 --- a/ios/MullvadVPN/View controllers/SelectLocation/LocationCell.swift +++ b/ios/MullvadVPN/View controllers/SelectLocation/LocationCell.swift @@ -327,7 +327,6 @@ extension LocationCell { // Only custom list nodes have more than one location. Therefore checking first // location here is fine. if let location = item.node.locations.first { - // we can probably replace this with a tagged AccessibilityIdentifier and cut this case statement let accessibilityId: AccessibilityIdentifier = switch location { case .country: .countryLocationCell case .city: .cityLocationCell diff --git a/ios/MullvadVPN/View controllers/VPNSettings/VPNSettingsCellFactory.swift b/ios/MullvadVPN/View controllers/VPNSettings/VPNSettingsCellFactory.swift index 99688515f2b9..3f0b75c9e196 100644 --- a/ios/MullvadVPN/View controllers/VPNSettings/VPNSettingsCellFactory.swift +++ b/ios/MullvadVPN/View controllers/VPNSettings/VPNSettingsCellFactory.swift @@ -80,8 +80,7 @@ final class VPNSettingsCellFactory: CellFactoryProtocol { } cell.titleLabel.text = portString - // TODO: replace this with a tagged AccessibilityIdentifier - cell.accessibilityIdentifier = "\(item.accessibilityIdentifier.asString) (\(portString))" + cell.accessibilityIdentifier = "\(item.accessibilityIdentifier.asString)" cell.applySubCellStyling() case .wireGuardCustomPort: diff --git a/ios/MullvadVPN/View controllers/VPNSettings/VPNSettingsDataSource.swift b/ios/MullvadVPN/View controllers/VPNSettings/VPNSettingsDataSource.swift index 9cc056f55d33..22d8a4a8da0a 100644 --- a/ios/MullvadVPN/View controllers/VPNSettings/VPNSettingsDataSource.swift +++ b/ios/MullvadVPN/View controllers/VPNSettings/VPNSettingsDataSource.swift @@ -112,8 +112,8 @@ final class VPNSettingsDataSource: UITableViewDiffableDataSource< return .dnsSettings case .ipOverrides: return .ipOverrides - case .wireGuardPort: - return .wireGuardPort + case let .wireGuardPort(port): + return .wireGuardPort(port) case .wireGuardCustomPort: return .wireGuardCustomPort case .wireGuardObfuscationAutomatic: diff --git a/ios/MullvadVPNUITests/Base/BaseUITestCase.swift b/ios/MullvadVPNUITests/Base/BaseUITestCase.swift index 347d90cfbca4..9eea1dd7bacb 100644 --- a/ios/MullvadVPNUITests/Base/BaseUITestCase.swift +++ b/ios/MullvadVPNUITests/Base/BaseUITestCase.swift @@ -214,13 +214,13 @@ class BaseUITestCase: XCTestCase { /// Check if currently logged on to an account. Note that it is assumed that we are logged in if login view isn't currently shown. func isLoggedIn() -> Bool { return !app - .otherElements[AccessibilityIdentifier.loginView] + .otherElements[.loginView] .waitForExistence(timeout: 1.0) } func isPresentingSettings() -> Bool { return app - .otherElements[AccessibilityIdentifier.settingsContainerView] + .otherElements[.settingsContainerView] .exists } @@ -248,7 +248,7 @@ class BaseUITestCase: XCTestCase { // Ensure changelog is no longer shown _ = app - .otherElements[AccessibilityIdentifier.changeLogAlert.asString] + .otherElements[.changeLogAlert] .waitForNonExistence(timeout: Self.shortTimeout) }