summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorBug Magnet <marco.nikic@mullvad.net>2024-12-10 09:21:07 +0100
committerBug Magnet <marco.nikic@mullvad.net>2024-12-10 09:21:07 +0100
commit534866bbd8ff9657a8ac89ed77dcb23cbe8b6d65 (patch)
tree6210824bc9bf034040a5cc5e02ac7bbd526650f6
parent3232f1bb22e498b8f2bc83861b3b3b1dcb9285f4 (diff)
parentbdf7473860342e53092bea0414da5aa96ea1a128 (diff)
downloadmullvadvpn-534866bbd8ff9657a8ac89ed77dcb23cbe8b6d65.tar.xz
mullvadvpn-534866bbd8ff9657a8ac89ed77dcb23cbe8b6d65.zip
Merge branch 'IOS-962-AccessibilityIdentifier-refactor'
-rw-r--r--ios/MullvadVPN/Classes/AccessbilityIdentifier.swift20
-rw-r--r--ios/MullvadVPN/Containers/Root/HeaderBarView.swift8
-rw-r--r--ios/MullvadVPN/Coordinators/ApplicationCoordinator.swift2
-rw-r--r--ios/MullvadVPN/Coordinators/CustomLists/AddLocationsViewController.swift4
-rw-r--r--ios/MullvadVPN/Coordinators/CustomLists/CustomListCellConfiguration.swift6
-rw-r--r--ios/MullvadVPN/Coordinators/CustomLists/CustomListViewController.swift6
-rw-r--r--ios/MullvadVPN/Coordinators/CustomLists/ListCustomListViewController.swift6
-rw-r--r--ios/MullvadVPN/Coordinators/LocationCoordinator.swift4
-rw-r--r--ios/MullvadVPN/Coordinators/Settings/APIAccess/Cells/SwitchCellContentView.swift2
-rw-r--r--ios/MullvadVPN/Coordinators/Settings/APIAccess/Common/SocksSectionHandler.swift4
-rw-r--r--ios/MullvadVPN/Coordinators/Settings/APIAccess/Edit/EditAccessMethodViewController.swift2
-rw-r--r--ios/MullvadVPN/Coordinators/Settings/APIAccess/Edit/MethodSettings/MethodSettingsCellConfiguration.swift4
-rw-r--r--ios/MullvadVPN/Coordinators/Settings/APIAccess/Edit/MethodSettings/MethodSettingsViewController.swift4
-rw-r--r--ios/MullvadVPN/Coordinators/Settings/APIAccess/Edit/MethodSettings/MethodTestingStatusCellContentView.swift6
-rw-r--r--ios/MullvadVPN/Coordinators/Settings/APIAccess/List/ListAccessMethodViewController.swift4
-rw-r--r--ios/MullvadVPN/Coordinators/Settings/APIAccess/Pickers/AccessMethodProtocolPicker.swift2
-rw-r--r--ios/MullvadVPN/Coordinators/Settings/SettingsViewControllerFactory.swift4
-rw-r--r--ios/MullvadVPN/View controllers/Account/AccountContentView.swift10
-rw-r--r--ios/MullvadVPN/View controllers/Account/AccountDeviceRow.swift4
-rw-r--r--ios/MullvadVPN/View controllers/Account/AccountExpiryRow.swift2
-rw-r--r--ios/MullvadVPN/View controllers/Account/RestorePurchasesView.swift2
-rw-r--r--ios/MullvadVPN/View controllers/AccountDeletion/AccountDeletionContentView.swift14
-rw-r--r--ios/MullvadVPN/View controllers/Alert/AlertViewController.swift6
-rw-r--r--ios/MullvadVPN/View controllers/CreationAccount/Completed/SetupAccountCompletedContentView.swift10
-rw-r--r--ios/MullvadVPN/View controllers/CreationAccount/Welcome/WelcomeContentView.swift18
-rw-r--r--ios/MullvadVPN/View controllers/DeviceList/DeviceManagementContentView.swift4
-rw-r--r--ios/MullvadVPN/View controllers/DeviceList/DeviceRowView.swift4
-rw-r--r--ios/MullvadVPN/View controllers/Login/AccountInputGroupView.swift2
-rw-r--r--ios/MullvadVPN/View controllers/Login/LoginContentView.swift6
-rw-r--r--ios/MullvadVPN/View controllers/Login/LoginViewController.swift2
-rw-r--r--ios/MullvadVPN/View controllers/OutOfTime/OutOfTimeContentView.swift2
-rw-r--r--ios/MullvadVPN/View controllers/ProblemReport/ProblemReportReviewViewController.swift8
-rw-r--r--ios/MullvadVPN/View controllers/ProblemReport/ProblemReportSubmissionOverlayView.swift2
-rw-r--r--ios/MullvadVPN/View controllers/ProblemReport/ProblemReportViewController+ViewManagement.swift4
-rw-r--r--ios/MullvadVPN/View controllers/ProblemReport/ProblemReportViewController.swift6
-rw-r--r--ios/MullvadVPN/View controllers/RelayFilter/ChipViewCell.swift6
-rw-r--r--ios/MullvadVPN/View controllers/RelayFilter/RelayFilterCellFactory.swift8
-rw-r--r--ios/MullvadVPN/View controllers/RelayFilter/RelayFilterDataSource.swift2
-rw-r--r--ios/MullvadVPN/View controllers/RelayFilter/RelayFilterViewController.swift2
-rw-r--r--ios/MullvadVPN/View controllers/RevokedDevice/RevokedDeviceViewController.swift4
-rw-r--r--ios/MullvadVPN/View controllers/SelectLocation/LocationCell.swift22
-rw-r--r--ios/MullvadVPN/View controllers/SelectLocation/LocationSectionHeaderView.swift2
-rw-r--r--ios/MullvadVPN/View controllers/SelectLocation/LocationViewController.swift6
-rw-r--r--ios/MullvadVPN/View controllers/SelectLocation/LocationViewControllerWrapper.swift6
-rw-r--r--ios/MullvadVPN/View controllers/Settings/SelectableSettingsDetailsCell.swift2
-rw-r--r--ios/MullvadVPN/View controllers/Settings/SettingsCell.swift2
-rw-r--r--ios/MullvadVPN/View controllers/Settings/SettingsCellFactory.swift14
-rw-r--r--ios/MullvadVPN/View controllers/Settings/SettingsDNSTextCell.swift2
-rw-r--r--ios/MullvadVPN/View controllers/Settings/SettingsHeaderView.swift6
-rw-r--r--ios/MullvadVPN/View controllers/Settings/SettingsViewController.swift4
-rw-r--r--ios/MullvadVPN/View controllers/TermsOfService/TermsOfServiceContentView.swift4
-rw-r--r--ios/MullvadVPN/View controllers/Tunnel/ConnectionPanelView.swift8
-rw-r--r--ios/MullvadVPN/View controllers/Tunnel/TunnelControlView.swift16
-rw-r--r--ios/MullvadVPN/View controllers/VPNSettings/CustomDNSCellFactory.swift6
-rw-r--r--ios/MullvadVPN/View controllers/VPNSettings/CustomDNSDataSource.swift2
-rw-r--r--ios/MullvadVPN/View controllers/VPNSettings/CustomDNSViewController.swift4
-rw-r--r--ios/MullvadVPN/View controllers/VPNSettings/VPNSettingsCellFactory.swift26
-rw-r--r--ios/MullvadVPN/View controllers/VPNSettings/VPNSettingsDataSource.swift10
-rw-r--r--ios/MullvadVPN/View controllers/VPNSettings/VPNSettingsViewController.swift2
-rw-r--r--ios/MullvadVPN/Views/CustomSwitch.swift2
-rw-r--r--ios/MullvadVPN/Views/CustomToggleStyle.swift2
-rw-r--r--ios/MullvadVPN/Views/StatusImageView.swift2
-rw-r--r--ios/MullvadVPNUITests/Base/BaseUITestCase.swift6
-rw-r--r--ios/MullvadVPNUITests/ConnectivityTests.swift2
-rw-r--r--ios/MullvadVPNUITests/Pages/AccountPage.swift10
-rw-r--r--ios/MullvadVPNUITests/Pages/DeviceManagementPage.swift2
-rw-r--r--ios/MullvadVPNUITests/Pages/SelectLocationPage.swift8
-rw-r--r--ios/MullvadVPNUITests/Pages/VPNSettingsPage.swift2
-rw-r--r--ios/MullvadVPNUITests/XCUIElementQuery+Extensions.swift2
69 files changed, 198 insertions, 200 deletions
diff --git a/ios/MullvadVPN/Classes/AccessbilityIdentifier.swift b/ios/MullvadVPN/Classes/AccessbilityIdentifier.swift
index f683d92bd4..5aa1e0c868 100644
--- a/ios/MullvadVPN/Classes/AccessbilityIdentifier.swift
+++ b/ios/MullvadVPN/Classes/AccessbilityIdentifier.swift
@@ -8,7 +8,7 @@
import UIKit
-public enum AccessibilityIdentifier: String {
+public enum AccessibilityIdentifier: Equatable {
// Buttons
case addAccessMethodButton
case accessMethodAddButton
@@ -181,7 +181,7 @@ public enum AccessibilityIdentifier: String {
case wireGuardObfuscationOff
case wireGuardObfuscationUdpOverTcp
case wireGuardObfuscationShadowsocks
- case wireGuardPort
+ case wireGuardPort(UInt16?)
case udpOverTcpObfuscationSettings
// Custom DNS
@@ -214,14 +214,14 @@ public enum AccessibilityIdentifier: String {
case unknown
}
+extension AccessibilityIdentifier {
+ public var asString: String {
+ "\(self)"
+ }
+}
+
extension UIAccessibilityIdentification {
- var accessibilityIdentifier: AccessibilityIdentifier? {
- get {
- guard let accessibilityIdentifier else { return nil }
- return AccessibilityIdentifier(rawValue: accessibilityIdentifier)
- }
- set {
- accessibilityIdentifier = newValue?.rawValue
- }
+ func setAccessibilityIdentifier(_ value: AccessibilityIdentifier?) {
+ accessibilityIdentifier = value.map(\.asString)
}
}
diff --git a/ios/MullvadVPN/Containers/Root/HeaderBarView.swift b/ios/MullvadVPN/Containers/Root/HeaderBarView.swift
index 476ec47eb5..5acf94f738 100644
--- a/ios/MullvadVPN/Containers/Root/HeaderBarView.swift
+++ b/ios/MullvadVPN/Containers/Root/HeaderBarView.swift
@@ -33,7 +33,7 @@ class HeaderBarView: UIView {
label.font = UIFont.systemFont(ofSize: 14)
label.textColor = UIColor(white: 1.0, alpha: 0.8)
label.setContentHuggingPriority(.defaultHigh, for: .horizontal)
- label.accessibilityIdentifier = .headerDeviceNameLabel
+ label.setAccessibilityIdentifier(.headerDeviceNameLabel)
return label
}()
@@ -58,7 +58,7 @@ class HeaderBarView: UIView {
let accountButton: UIButton = {
let button = makeHeaderBarButton(with: UIImage(named: "IconAccount"))
- button.accessibilityIdentifier = .accountButton
+ button.setAccessibilityIdentifier(.accountButton)
button.accessibilityLabel = NSLocalizedString(
"HEADER_BAR_ACCOUNT_BUTTON_ACCESSIBILITY_LABEL",
tableName: "HeaderBar",
@@ -72,7 +72,7 @@ class HeaderBarView: UIView {
let settingsButton: UIButton = {
let button = makeHeaderBarButton(with: UIImage(named: "IconSettings"))
- button.accessibilityIdentifier = .settingsButton
+ button.setAccessibilityIdentifier(.settingsButton)
button.accessibilityLabel = NSLocalizedString(
"HEADER_BAR_SETTINGS_BUTTON_ACCESSIBILITY_LABEL",
tableName: "HeaderBar",
@@ -170,7 +170,7 @@ class HeaderBarView: UIView {
)
accessibilityContainerType = .semanticGroup
- accessibilityIdentifier = .headerBarView
+ setAccessibilityIdentifier(.headerBarView)
let brandImageSize = brandNameImage?.size ?? .zero
let brandNameAspectRatio = brandImageSize.width / max(brandImageSize.height, 1)
diff --git a/ios/MullvadVPN/Coordinators/ApplicationCoordinator.swift b/ios/MullvadVPN/Coordinators/ApplicationCoordinator.swift
index 3df50a323c..a4ff7e3cd0 100644
--- a/ios/MullvadVPN/Coordinators/ApplicationCoordinator.swift
+++ b/ios/MullvadVPN/Coordinators/ApplicationCoordinator.swift
@@ -559,7 +559,7 @@ final class ApplicationCoordinator: Coordinator, Presenting, RootContainerViewCo
)
let navigationController = CustomNavigationController()
- navigationController.view.accessibilityIdentifier = .settingsContainerView
+ navigationController.view.setAccessibilityIdentifier(.settingsContainerView)
let configurationTester = ProxyConfigurationTester(transportProvider: configuredTransportProvider)
diff --git a/ios/MullvadVPN/Coordinators/CustomLists/AddLocationsViewController.swift b/ios/MullvadVPN/Coordinators/CustomLists/AddLocationsViewController.swift
index 06245b5c90..10d8a308b6 100644
--- a/ios/MullvadVPN/Coordinators/CustomLists/AddLocationsViewController.swift
+++ b/ios/MullvadVPN/Coordinators/CustomLists/AddLocationsViewController.swift
@@ -27,7 +27,7 @@ class AddLocationsViewController: UIViewController {
tableView.separatorInset = .zero
tableView.rowHeight = 56
tableView.indicatorStyle = .white
- tableView.accessibilityIdentifier = .editCustomListEditLocationsTableView
+ tableView.setAccessibilityIdentifier(.editCustomListEditLocationsTableView)
return tableView
}()
@@ -46,7 +46,7 @@ class AddLocationsViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
- view.accessibilityIdentifier = .editCustomListEditLocationsView
+ view.setAccessibilityIdentifier(.editCustomListEditLocationsView)
tableView.backgroundColor = view.backgroundColor
view.backgroundColor = .secondaryColor
addConstraints()
diff --git a/ios/MullvadVPN/Coordinators/CustomLists/CustomListCellConfiguration.swift b/ios/MullvadVPN/Coordinators/CustomLists/CustomListCellConfiguration.swift
index 372a7b4e07..ddf7b87c11 100644
--- a/ios/MullvadVPN/Coordinators/CustomLists/CustomListCellConfiguration.swift
+++ b/ios/MullvadVPN/Coordinators/CustomLists/CustomListCellConfiguration.swift
@@ -79,7 +79,7 @@ struct CustomListCellConfiguration {
contentConfiguration.maxLength = NameInputFormatter.maxLength
contentConfiguration.editingEvents.onChange = subject.bindTextAction(to: \.name)
- cell.accessibilityIdentifier = AccessibilityIdentifier.customListEditNameFieldCell
+ cell.setAccessibilityIdentifier(.customListEditNameFieldCell)
cell.contentConfiguration = contentConfiguration
}
@@ -88,7 +88,7 @@ struct CustomListCellConfiguration {
contentConfiguration.text = itemIdentifier.text
cell.contentConfiguration = contentConfiguration
- cell.accessibilityIdentifier = AccessibilityIdentifier.customListEditAddOrEditLocationCell
+ cell.setAccessibilityIdentifier(.customListEditAddOrEditLocationCell)
if let cell = cell as? CustomCellDisclosureHandling {
cell.disclosureType = .chevron
@@ -104,7 +104,7 @@ struct CustomListCellConfiguration {
onDelete?()
}
- cell.accessibilityIdentifier = AccessibilityIdentifier.customListEditDeleteListCell
+ cell.setAccessibilityIdentifier(.customListEditDeleteListCell)
cell.contentConfiguration = contentConfiguration
}
}
diff --git a/ios/MullvadVPN/Coordinators/CustomLists/CustomListViewController.swift b/ios/MullvadVPN/Coordinators/CustomLists/CustomListViewController.swift
index 6e4fe54ac5..3213d25e62 100644
--- a/ios/MullvadVPN/Coordinators/CustomLists/CustomListViewController.swift
+++ b/ios/MullvadVPN/Coordinators/CustomLists/CustomListViewController.swift
@@ -58,7 +58,7 @@ class CustomListViewController: UIViewController {
}
)
barButtonItem.style = .done
- barButtonItem.accessibilityIdentifier = AccessibilityIdentifier.saveCreateCustomListButton
+ barButtonItem.setAccessibilityIdentifier(.saveCreateCustomListButton)
return barButtonItem
}()
@@ -87,7 +87,7 @@ class CustomListViewController: UIViewController {
navigationItem.rightBarButtonItem = saveBarButton
view.directionalLayoutMargins = UIMetrics.contentLayoutMargins
view.backgroundColor = .secondaryColor
- view.accessibilityIdentifier = .newCustomListView
+ view.setAccessibilityIdentifier(.newCustomListView)
isModalInPresentation = true
addSubviews()
@@ -104,7 +104,7 @@ class CustomListViewController: UIViewController {
tableView.delegate = dataSourceConfiguration
tableView.backgroundColor = .secondaryColor
tableView.registerReusableViews(from: CustomListItemIdentifier.CellIdentifier.self)
- tableView.accessibilityIdentifier = AccessibilityIdentifier.customListEditTableView
+ tableView.setAccessibilityIdentifier(.customListEditTableView)
}
private func configureDataSource() {
diff --git a/ios/MullvadVPN/Coordinators/CustomLists/ListCustomListViewController.swift b/ios/MullvadVPN/Coordinators/CustomLists/ListCustomListViewController.swift
index 75a64e2b3c..35064f2380 100644
--- a/ios/MullvadVPN/Coordinators/CustomLists/ListCustomListViewController.swift
+++ b/ios/MullvadVPN/Coordinators/CustomLists/ListCustomListViewController.swift
@@ -50,7 +50,7 @@ class ListCustomListViewController: UIViewController {
super.viewDidLoad()
view.backgroundColor = .secondaryColor
- view.accessibilityIdentifier = .listCustomListsView
+ view.setAccessibilityIdentifier(.listCustomListsView)
addSubviews()
configureNavigationItem()
@@ -89,7 +89,7 @@ class ListCustomListViewController: UIViewController {
tableView.separatorStyle = .singleLine
tableView.rowHeight = UIMetrics.SettingsCell.customListsCellHeight
tableView.registerReusableViews(from: CellReuseIdentifier.self)
- tableView.accessibilityIdentifier = .listCustomListsTableView
+ tableView.setAccessibilityIdentifier(.listCustomListsTableView)
}
private func configureNavigationItem() {
@@ -107,7 +107,7 @@ class ListCustomListViewController: UIViewController {
})
)
- navigationItem.rightBarButtonItem?.accessibilityIdentifier = .listCustomListDoneButton
+ navigationItem.rightBarButtonItem?.setAccessibilityIdentifier(.listCustomListDoneButton)
}
private func configureDataSource() {
diff --git a/ios/MullvadVPN/Coordinators/LocationCoordinator.swift b/ios/MullvadVPN/Coordinators/LocationCoordinator.swift
index c9e7962224..acdb359560 100644
--- a/ios/MullvadVPN/Coordinators/LocationCoordinator.swift
+++ b/ios/MullvadVPN/Coordinators/LocationCoordinator.swift
@@ -284,7 +284,7 @@ extension LocationCoordinator: LocationViewControllerWrapperDelegate {
self?.showAddCustomList(nodes: nodes)
}
)
- addCustomListAction.accessibilityIdentifier = AccessibilityIdentifier.addNewCustomListButton
+ addCustomListAction.setAccessibilityIdentifier(.addNewCustomListButton)
actionSheet.addAction(addCustomListAction)
let editAction = UIAlertAction(
@@ -297,7 +297,7 @@ extension LocationCoordinator: LocationViewControllerWrapperDelegate {
}
)
editAction.isEnabled = !customListRepository.fetchAll().isEmpty
- editAction.accessibilityIdentifier = AccessibilityIdentifier.editCustomListButton
+ editAction.setAccessibilityIdentifier(.editCustomListButton)
actionSheet.addAction(editAction)
actionSheet.addAction(UIAlertAction(
diff --git a/ios/MullvadVPN/Coordinators/Settings/APIAccess/Cells/SwitchCellContentView.swift b/ios/MullvadVPN/Coordinators/Settings/APIAccess/Cells/SwitchCellContentView.swift
index 1f2fe26428..56b8f1951c 100644
--- a/ios/MullvadVPN/Coordinators/Settings/APIAccess/Cells/SwitchCellContentView.swift
+++ b/ios/MullvadVPN/Coordinators/Settings/APIAccess/Cells/SwitchCellContentView.swift
@@ -76,7 +76,7 @@ class SwitchCellContentView: UIView, UIContentView, UITextFieldDelegate {
private func configureSwitch() {
switchContainer.control.isOn = actualConfiguration.isOn
switchContainer.transform = CGAffineTransform(scaleX: 0.85, y: 0.85)
- switchContainer.accessibilityIdentifier = actualConfiguration.accessibilityIdentifier
+ switchContainer.setAccessibilityIdentifier(actualConfiguration.accessibilityIdentifier)
}
private func addSubviews() {
diff --git a/ios/MullvadVPN/Coordinators/Settings/APIAccess/Common/SocksSectionHandler.swift b/ios/MullvadVPN/Coordinators/Settings/APIAccess/Common/SocksSectionHandler.swift
index c1bcf9ca52..b5c3acfb69 100644
--- a/ios/MullvadVPN/Coordinators/Settings/APIAccess/Common/SocksSectionHandler.swift
+++ b/ios/MullvadVPN/Coordinators/Settings/APIAccess/Common/SocksSectionHandler.swift
@@ -38,7 +38,7 @@ struct SocksSectionHandler {
contentConfiguration.inputText = subject.value.socks.server
contentConfiguration.textFieldProperties = .withSmartFeaturesDisabled()
contentConfiguration.editingEvents.onChange = subject.bindTextAction(to: \.socks.server)
- cell.accessibilityIdentifier = .socks5ServerCell
+ cell.setAccessibilityIdentifier(.socks5ServerCell)
cell.contentConfiguration = contentConfiguration
}
@@ -51,7 +51,7 @@ struct SocksSectionHandler {
contentConfiguration.editingEvents.onChange = subject.bindTextAction(to: \.socks.port)
contentConfiguration.textFieldProperties = .withSmartFeaturesDisabled()
contentConfiguration.textFieldProperties.keyboardType = .numberPad
- cell.accessibilityIdentifier = .socks5PortCell
+ cell.setAccessibilityIdentifier(.socks5PortCell)
cell.contentConfiguration = contentConfiguration
}
diff --git a/ios/MullvadVPN/Coordinators/Settings/APIAccess/Edit/EditAccessMethodViewController.swift b/ios/MullvadVPN/Coordinators/Settings/APIAccess/Edit/EditAccessMethodViewController.swift
index 676ef4b494..b524ae61cd 100644
--- a/ios/MullvadVPN/Coordinators/Settings/APIAccess/Edit/EditAccessMethodViewController.swift
+++ b/ios/MullvadVPN/Coordinators/Settings/APIAccess/Edit/EditAccessMethodViewController.swift
@@ -47,7 +47,7 @@ class EditAccessMethodViewController: UIViewController {
view.backgroundColor = .secondaryColor
- tableView.accessibilityIdentifier = .editAccessMethodView
+ tableView.setAccessibilityIdentifier(.editAccessMethodView)
tableView.backgroundColor = .secondaryColor
tableView.delegate = self
diff --git a/ios/MullvadVPN/Coordinators/Settings/APIAccess/Edit/MethodSettings/MethodSettingsCellConfiguration.swift b/ios/MullvadVPN/Coordinators/Settings/APIAccess/Edit/MethodSettings/MethodSettingsCellConfiguration.swift
index 9378efef74..5b2b48a593 100644
--- a/ios/MullvadVPN/Coordinators/Settings/APIAccess/Edit/MethodSettings/MethodSettingsCellConfiguration.swift
+++ b/ios/MullvadVPN/Coordinators/Settings/APIAccess/Edit/MethodSettings/MethodSettingsCellConfiguration.swift
@@ -113,7 +113,7 @@ class MethodSettingsCellConfiguration {
contentConfiguration.maxLength = NameInputFormatter.maxLength
contentConfiguration.editingEvents.onChange = subject.bindTextAction(to: \.name)
- cell.accessibilityIdentifier = .accessMethodNameTextField
+ cell.setAccessibilityIdentifier(.accessMethodNameTextField)
cell.setDisabled(isTesting)
cell.contentConfiguration = contentConfiguration
}
@@ -156,7 +156,7 @@ class MethodSettingsCellConfiguration {
cell.disclosureType = .chevron
}
- cell.accessibilityIdentifier = .accessMethodProtocolSelectionCell
+ cell.setAccessibilityIdentifier(.accessMethodProtocolSelectionCell)
cell.setDisabled(isTesting)
}
diff --git a/ios/MullvadVPN/Coordinators/Settings/APIAccess/Edit/MethodSettings/MethodSettingsViewController.swift b/ios/MullvadVPN/Coordinators/Settings/APIAccess/Edit/MethodSettings/MethodSettingsViewController.swift
index 44b18807ba..7828a37ba8 100644
--- a/ios/MullvadVPN/Coordinators/Settings/APIAccess/Edit/MethodSettings/MethodSettingsViewController.swift
+++ b/ios/MullvadVPN/Coordinators/Settings/APIAccess/Edit/MethodSettings/MethodSettingsViewController.swift
@@ -76,12 +76,12 @@ class MethodSettingsViewController: UITableViewController {
override func viewDidLoad() {
super.viewDidLoad()
- view.accessibilityIdentifier = .addAccessMethodTableView
+ view.setAccessibilityIdentifier(.addAccessMethodTableView)
view.directionalLayoutMargins = UIMetrics.contentLayoutMargins
view.backgroundColor = .secondaryColor
navigationItem.rightBarButtonItem = saveBarButton
- navigationItem.rightBarButtonItem?.accessibilityIdentifier = .accessMethodAddButton
+ navigationItem.rightBarButtonItem?.setAccessibilityIdentifier(.accessMethodAddButton)
navigationItem.rightBarButtonItem?.isAccessibilityElement = true
isModalInPresentation = true
diff --git a/ios/MullvadVPN/Coordinators/Settings/APIAccess/Edit/MethodSettings/MethodTestingStatusCellContentView.swift b/ios/MullvadVPN/Coordinators/Settings/APIAccess/Edit/MethodSettings/MethodTestingStatusCellContentView.swift
index 425dd0798d..90bef9cffa 100644
--- a/ios/MullvadVPN/Coordinators/Settings/APIAccess/Edit/MethodSettings/MethodTestingStatusCellContentView.swift
+++ b/ios/MullvadVPN/Coordinators/Settings/APIAccess/Edit/MethodSettings/MethodTestingStatusCellContentView.swift
@@ -139,11 +139,11 @@ class MethodTestingStatusCellContentView: UIView, UIContentView {
// Set accessibility identifier for the text label based on the status it is indicating
switch actualConfiguration.status {
case .reachable:
- textLabel.accessibilityIdentifier = .addAccessMethodTestStatusReachableLabel
+ textLabel.setAccessibilityIdentifier(.addAccessMethodTestStatusReachableLabel)
case .unreachable:
- textLabel.accessibilityIdentifier = .addAccessMethodTestStatusUnreachableLabel
+ textLabel.setAccessibilityIdentifier(.addAccessMethodTestStatusUnreachableLabel)
case .testing:
- textLabel.accessibilityIdentifier = .addAccessMethodTestStatusTestingLabel
+ textLabel.setAccessibilityIdentifier(.addAccessMethodTestStatusTestingLabel)
}
// Text label is always the last one, so only add it into the stack if it's not there yet.
diff --git a/ios/MullvadVPN/Coordinators/Settings/APIAccess/List/ListAccessMethodViewController.swift b/ios/MullvadVPN/Coordinators/Settings/APIAccess/List/ListAccessMethodViewController.swift
index 8c0facf98d..968a070be6 100644
--- a/ios/MullvadVPN/Coordinators/Settings/APIAccess/List/ListAccessMethodViewController.swift
+++ b/ios/MullvadVPN/Coordinators/Settings/APIAccess/List/ListAccessMethodViewController.swift
@@ -62,7 +62,7 @@ class ListAccessMethodViewController: UIViewController, UITableViewDelegate {
tableView.registerReusableViews(from: CellReuseIdentifier.self)
- view.accessibilityIdentifier = .apiAccessView
+ view.setAccessibilityIdentifier(.apiAccessView)
let headerView = createHeaderView()
view.addConstrainedSubviews([headerView, tableView]) {
@@ -115,7 +115,7 @@ class ListAccessMethodViewController: UIViewController, UITableViewDelegate {
button.addAction(UIAction { [weak self] _ in
self?.sendAddNew()
}, for: .touchUpInside)
- button.accessibilityIdentifier = .addAccessMethodButton
+ button.setAccessibilityIdentifier(.addAccessMethodButton)
let fontSize = button.titleLabel?.font.pointSize ?? 0
button.titleLabel?.font = UIFont.systemFont(ofSize: fontSize, weight: .regular)
diff --git a/ios/MullvadVPN/Coordinators/Settings/APIAccess/Pickers/AccessMethodProtocolPicker.swift b/ios/MullvadVPN/Coordinators/Settings/APIAccess/Pickers/AccessMethodProtocolPicker.swift
index 8a852719fe..e11246635c 100644
--- a/ios/MullvadVPN/Coordinators/Settings/APIAccess/Pickers/AccessMethodProtocolPicker.swift
+++ b/ios/MullvadVPN/Coordinators/Settings/APIAccess/Pickers/AccessMethodProtocolPicker.swift
@@ -23,7 +23,7 @@ struct AccessMethodProtocolPicker {
let dataSource = AccessMethodProtocolPickerDataSource()
let controller = ListItemPickerViewController(dataSource: dataSource, selectedItemID: currentValue)
- controller.view.accessibilityIdentifier = .accessMethodProtocolPickerView
+ controller.view.setAccessibilityIdentifier(.accessMethodProtocolPickerView)
controller.navigationItem.title = NSLocalizedString(
"SELECT_PROTOCOL_NAV_TITLE",
diff --git a/ios/MullvadVPN/Coordinators/Settings/SettingsViewControllerFactory.swift b/ios/MullvadVPN/Coordinators/Settings/SettingsViewControllerFactory.swift
index cf14003b64..f93ebba2dc 100644
--- a/ios/MullvadVPN/Coordinators/Settings/SettingsViewControllerFactory.swift
+++ b/ios/MullvadVPN/Coordinators/Settings/SettingsViewControllerFactory.swift
@@ -103,7 +103,7 @@ struct SettingsViewControllerFactory {
value: "Multihop",
comment: ""
)
- host.view.accessibilityIdentifier = AccessibilityIdentifier.multihopView.rawValue
+ host.view.setAccessibilityIdentifier(.multihopView)
return .viewController(host)
}
@@ -129,7 +129,7 @@ struct SettingsViewControllerFactory {
value: "DAITA",
comment: ""
)
- host.view.accessibilityIdentifier = AccessibilityIdentifier.daitaView.rawValue
+ host.view.setAccessibilityIdentifier(.daitaView)
return .viewController(host)
}
diff --git a/ios/MullvadVPN/View controllers/Account/AccountContentView.swift b/ios/MullvadVPN/View controllers/Account/AccountContentView.swift
index 3e1cac3e51..bb5a3ccf8e 100644
--- a/ios/MullvadVPN/View controllers/Account/AccountContentView.swift
+++ b/ios/MullvadVPN/View controllers/Account/AccountContentView.swift
@@ -11,13 +11,13 @@ import UIKit
class AccountContentView: UIView {
let purchaseButton: InAppPurchaseButton = {
let button = InAppPurchaseButton()
- button.accessibilityIdentifier = .purchaseButton
+ button.setAccessibilityIdentifier(.purchaseButton)
return button
}()
let redeemVoucherButton: AppButton = {
let button = AppButton(style: .success)
- button.accessibilityIdentifier = .redeemVoucherButton
+ button.setAccessibilityIdentifier(.redeemVoucherButton)
button.setTitle(NSLocalizedString(
"REDEEM_VOUCHER_BUTTON_TITLE",
tableName: "Account",
@@ -29,7 +29,7 @@ class AccountContentView: UIView {
let logoutButton: AppButton = {
let button = AppButton(style: .danger)
- button.accessibilityIdentifier = .logoutButton
+ button.setAccessibilityIdentifier(.logoutButton)
button.setTitle(NSLocalizedString(
"LOGOUT_BUTTON_TITLE",
tableName: "Account",
@@ -41,7 +41,7 @@ class AccountContentView: UIView {
let deleteButton: AppButton = {
let button = AppButton(style: .danger)
- button.accessibilityIdentifier = .deleteButton
+ button.setAccessibilityIdentifier(.deleteButton)
button.setTitle(NSLocalizedString(
"DELETE_BUTTON_TITLE",
tableName: "Account",
@@ -101,7 +101,7 @@ class AccountContentView: UIView {
super.init(frame: frame)
directionalLayoutMargins = UIMetrics.contentLayoutMargins
- accessibilityIdentifier = .accountView
+ setAccessibilityIdentifier(.accountView)
addConstrainedSubviews([contentStackView, buttonStackView]) {
contentStackView.pinEdgesToSuperviewMargins(.all().excluding(.bottom))
diff --git a/ios/MullvadVPN/View controllers/Account/AccountDeviceRow.swift b/ios/MullvadVPN/View controllers/Account/AccountDeviceRow.swift
index ea71f4036e..18b75f2d87 100644
--- a/ios/MullvadVPN/View controllers/Account/AccountDeviceRow.swift
+++ b/ios/MullvadVPN/View controllers/Account/AccountDeviceRow.swift
@@ -13,7 +13,7 @@ class AccountDeviceRow: UIView {
didSet {
deviceLabel.text = deviceName?.capitalized ?? ""
accessibilityValue = deviceName
- accessibilityIdentifier = .accountPageDeviceNameLabel
+ setAccessibilityIdentifier(.accountPageDeviceNameLabel)
}
}
@@ -41,7 +41,7 @@ class AccountDeviceRow: UIView {
private let infoButton: UIButton = {
let button = IncreasedHitButton(type: .system)
- button.accessibilityIdentifier = .infoButton
+ button.setAccessibilityIdentifier(.infoButton)
button.tintColor = .white
button.setImage(UIImage(named: "IconInfo"), for: .normal)
return button
diff --git a/ios/MullvadVPN/View controllers/Account/AccountExpiryRow.swift b/ios/MullvadVPN/View controllers/Account/AccountExpiryRow.swift
index 00f0ebbedf..d332bbaa07 100644
--- a/ios/MullvadVPN/View controllers/Account/AccountExpiryRow.swift
+++ b/ios/MullvadVPN/View controllers/Account/AccountExpiryRow.swift
@@ -62,7 +62,7 @@ class AccountExpiryRow: UIView {
valueLabel.translatesAutoresizingMaskIntoConstraints = false
valueLabel.font = UIFont.systemFont(ofSize: 17)
valueLabel.textColor = .white
- valueLabel.accessibilityIdentifier = .accountPagePaidUntilLabel
+ valueLabel.setAccessibilityIdentifier(.accountPagePaidUntilLabel)
return valueLabel
}()
diff --git a/ios/MullvadVPN/View controllers/Account/RestorePurchasesView.swift b/ios/MullvadVPN/View controllers/Account/RestorePurchasesView.swift
index c683772126..703c5ba26d 100644
--- a/ios/MullvadVPN/View controllers/Account/RestorePurchasesView.swift
+++ b/ios/MullvadVPN/View controllers/Account/RestorePurchasesView.swift
@@ -24,7 +24,7 @@ class RestorePurchasesView: UIView {
private lazy var restoreButton: UILabel = {
let label = UILabel()
- label.accessibilityIdentifier = .restorePurchasesButton
+ label.setAccessibilityIdentifier(.restorePurchasesButton)
label.attributedText = makeAttributedString()
label.isUserInteractionEnabled = true
label.addGestureRecognizer(UITapGestureRecognizer(target: self, action: #selector(didTapRestoreButton)))
diff --git a/ios/MullvadVPN/View controllers/AccountDeletion/AccountDeletionContentView.swift b/ios/MullvadVPN/View controllers/AccountDeletion/AccountDeletionContentView.swift
index f5f0bb2aa8..26d87a787c 100644
--- a/ios/MullvadVPN/View controllers/AccountDeletion/AccountDeletionContentView.swift
+++ b/ios/MullvadVPN/View controllers/AccountDeletion/AccountDeletionContentView.swift
@@ -81,7 +81,7 @@ class AccountDeletionContentView: UIView {
private lazy var accountTextField: AccountTextField = {
let groupingStyle = AccountTextField.GroupingStyle.lastPart
let textField = AccountTextField(groupingStyle: groupingStyle)
- textField.accessibilityIdentifier = .deleteAccountTextField
+ textField.setAccessibilityIdentifier(.deleteAccountTextField)
textField.font = .preferredFont(forTextStyle: .body, weight: .bold)
textField.placeholder = Array(repeating: "X", count: 4).joined()
textField.placeholderTextColor = .lightGray
@@ -101,7 +101,7 @@ class AccountDeletionContentView: UIView {
private let deleteButton: AppButton = {
let button = AppButton(style: .danger)
- button.accessibilityIdentifier = .deleteButton
+ button.setAccessibilityIdentifier(.deleteButton)
button.setTitle(NSLocalizedString(
"DELETE_ACCOUNT_BUTTON_TITLE",
tableName: "Account",
@@ -113,7 +113,7 @@ class AccountDeletionContentView: UIView {
private let cancelButton: AppButton = {
let button = AppButton(style: .default)
- button.accessibilityIdentifier = .cancelButton
+ button.setAccessibilityIdentifier(.cancelButton)
button.setTitle(NSLocalizedString(
"CANCEL_BUTTON_TITLE",
tableName: "Account",
@@ -347,7 +347,7 @@ class AccountDeletionContentView: UIView {
}
private func setupAppearance() {
- accessibilityIdentifier = .deleteAccountView
+ setAccessibilityIdentifier(.deleteAccountView)
translatesAutoresizingMaskIntoConstraints = false
backgroundColor = .secondaryColor
directionalLayoutMargins = UIMetrics.contentLayoutMargins
@@ -375,10 +375,10 @@ class AccountDeletionContentView: UIView {
}
@objc private func didPress(button: AppButton) {
- switch AccessibilityIdentifier(rawValue: button.accessibilityIdentifier ?? "") {
- case .deleteButton:
+ switch button.accessibilityIdentifier {
+ case AccessibilityIdentifier.deleteButton.asString:
delegate?.didTapDeleteButton(contentView: self, button: button)
- case .cancelButton:
+ case AccessibilityIdentifier.cancelButton.asString:
delegate?.didTapCancelButton(contentView: self, button: button)
default: return
}
diff --git a/ios/MullvadVPN/View controllers/Alert/AlertViewController.swift b/ios/MullvadVPN/View controllers/Alert/AlertViewController.swift
index 9a4d26ae14..e06f8ac05c 100644
--- a/ios/MullvadVPN/View controllers/Alert/AlertViewController.swift
+++ b/ios/MullvadVPN/View controllers/Alert/AlertViewController.swift
@@ -108,7 +108,7 @@ class AlertViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
- view.accessibilityIdentifier = presentation.accessibilityIdentifier ?? .alertContainerView
+ view.setAccessibilityIdentifier(presentation.accessibilityIdentifier ?? .alertContainerView)
view.backgroundColor = .black.withAlphaComponent(0.5)
setContent()
@@ -207,7 +207,7 @@ class AlertViewController: UIViewController {
label.adjustsFontForContentSizeCategory = true
label.textAlignment = .center
label.numberOfLines = 0
- label.accessibilityIdentifier = .alertTitle
+ label.setAccessibilityIdentifier(.alertTitle)
contentView.addArrangedSubview(label)
contentView.setCustomSpacing(16, after: label)
@@ -270,7 +270,7 @@ class AlertViewController: UIViewController {
let button = AppButton(style: style.buttonStyle)
button.setTitle(title, for: .normal)
- button.accessibilityIdentifier = accessibilityId
+ button.setAccessibilityIdentifier(accessibilityId)
button.addTarget(self, action: #selector(didTapButton), for: .touchUpInside)
buttonView.addArrangedSubview(button)
diff --git a/ios/MullvadVPN/View controllers/CreationAccount/Completed/SetupAccountCompletedContentView.swift b/ios/MullvadVPN/View controllers/CreationAccount/Completed/SetupAccountCompletedContentView.swift
index 20504078bb..818053e66b 100644
--- a/ios/MullvadVPN/View controllers/CreationAccount/Completed/SetupAccountCompletedContentView.swift
+++ b/ios/MullvadVPN/View controllers/CreationAccount/Completed/SetupAccountCompletedContentView.swift
@@ -56,7 +56,7 @@ class SetupAccountCompletedContentView: UIView {
private let privacyButton: AppButton = {
let button = AppButton(style: .success)
- button.accessibilityIdentifier = .learnAboutPrivacyButton
+ button.setAccessibilityIdentifier(.learnAboutPrivacyButton)
let localizedString = NSLocalizedString(
"LEARN_ABOUT_PRIVACY_BUTTON",
tableName: "CreatedAccountConfirmation",
@@ -70,7 +70,7 @@ class SetupAccountCompletedContentView: UIView {
private let startButton: AppButton = {
let button = AppButton(style: .success)
- button.accessibilityIdentifier = .startUsingTheAppButton
+ button.setAccessibilityIdentifier(.startUsingTheAppButton)
button.setTitle(NSLocalizedString(
"START_USING_THE_APP_BUTTON",
tableName: "CreatedAccountConfirmation",
@@ -141,10 +141,10 @@ class SetupAccountCompletedContentView: UIView {
}
@objc private func tapped(button: AppButton) {
- switch AccessibilityIdentifier(rawValue: button.accessibilityIdentifier ?? "") {
- case .learnAboutPrivacyButton:
+ switch button.accessibilityIdentifier {
+ case AccessibilityIdentifier.learnAboutPrivacyButton.asString:
delegate?.didTapPrivacyButton(view: self, button: button)
- case .startUsingTheAppButton:
+ case AccessibilityIdentifier.startUsingTheAppButton.asString:
delegate?.didTapStartingAppButton(view: self, button: button)
default: return
}
diff --git a/ios/MullvadVPN/View controllers/CreationAccount/Welcome/WelcomeContentView.swift b/ios/MullvadVPN/View controllers/CreationAccount/Welcome/WelcomeContentView.swift
index 4e055ad2f3..db3145ac68 100644
--- a/ios/MullvadVPN/View controllers/CreationAccount/Welcome/WelcomeContentView.swift
+++ b/ios/MullvadVPN/View controllers/CreationAccount/Welcome/WelcomeContentView.swift
@@ -54,7 +54,7 @@ final class WelcomeContentView: UIView {
private let accountNumberLabel: UILabel = {
let label = UILabel()
- label.accessibilityIdentifier = .welcomeAccountNumberLabel
+ label.setAccessibilityIdentifier(.welcomeAccountNumberLabel)
label.adjustsFontForContentSizeCategory = true
label.lineBreakMode = .byWordWrapping
label.numberOfLines = .zero
@@ -76,7 +76,7 @@ final class WelcomeContentView: UIView {
private let infoButton: UIButton = {
let button = IncreasedHitButton(type: .system)
- button.accessibilityIdentifier = .infoButton
+ button.setAccessibilityIdentifier(.infoButton)
button.tintColor = .white
button.translatesAutoresizingMaskIntoConstraints = false
button.setImage(UIImage(named: "IconInfo"), for: .normal)
@@ -108,7 +108,7 @@ final class WelcomeContentView: UIView {
private let purchaseButton: InAppPurchaseButton = {
let button = InAppPurchaseButton()
- button.accessibilityIdentifier = .purchaseButton
+ button.setAccessibilityIdentifier(.purchaseButton)
let localizedString = NSLocalizedString(
"BUY_CREDIT_BUTTON",
tableName: "Welcome",
@@ -121,7 +121,7 @@ final class WelcomeContentView: UIView {
private let redeemVoucherButton: AppButton = {
let button = AppButton(style: .success)
- button.accessibilityIdentifier = .redeemVoucherButton
+ button.setAccessibilityIdentifier(.redeemVoucherButton)
button.setTitle(NSLocalizedString(
"REDEEM_VOUCHER_BUTTON_TITLE",
tableName: "Account",
@@ -193,7 +193,7 @@ final class WelcomeContentView: UIView {
override init(frame: CGRect) {
super.init(frame: frame)
- accessibilityIdentifier = .welcomeView
+ setAccessibilityIdentifier(.welcomeView)
backgroundColor = .primaryColor
directionalLayoutMargins = UIMetrics.contentLayoutMargins
backgroundColor = .secondaryColor
@@ -250,12 +250,12 @@ final class WelcomeContentView: UIView {
}
@objc private func tapped(button: AppButton) {
- switch AccessibilityIdentifier(rawValue: button.accessibilityIdentifier ?? "") {
- case .purchaseButton:
+ switch button.accessibilityIdentifier {
+ case AccessibilityIdentifier.purchaseButton.asString:
delegate?.didTapPurchaseButton(welcomeContentView: self, button: button)
- case .redeemVoucherButton:
+ case AccessibilityIdentifier.redeemVoucherButton.asString:
delegate?.didTapRedeemVoucherButton(welcomeContentView: self, button: button)
- case .infoButton:
+ case AccessibilityIdentifier.infoButton.asString:
delegate?.didTapInfoButton(welcomeContentView: self, button: button)
default: return
}
diff --git a/ios/MullvadVPN/View controllers/DeviceList/DeviceManagementContentView.swift b/ios/MullvadVPN/View controllers/DeviceList/DeviceManagementContentView.swift
index 5effb05beb..46386165c1 100644
--- a/ios/MullvadVPN/View controllers/DeviceList/DeviceManagementContentView.swift
+++ b/ios/MullvadVPN/View controllers/DeviceList/DeviceManagementContentView.swift
@@ -69,7 +69,7 @@ class DeviceManagementContentView: UIView {
for: .normal
)
button.isEnabled = false
- button.accessibilityIdentifier = .continueWithLoginButton
+ button.setAccessibilityIdentifier(.continueWithLoginButton)
return button
}()
@@ -114,7 +114,7 @@ class DeviceManagementContentView: UIView {
constraintViews()
updateView()
- accessibilityIdentifier = .deviceManagementView
+ setAccessibilityIdentifier(.deviceManagementView)
}
private func addViews() {
diff --git a/ios/MullvadVPN/View controllers/DeviceList/DeviceRowView.swift b/ios/MullvadVPN/View controllers/DeviceList/DeviceRowView.swift
index d3da30a16e..58ad8170aa 100644
--- a/ios/MullvadVPN/View controllers/DeviceList/DeviceRowView.swift
+++ b/ios/MullvadVPN/View controllers/DeviceList/DeviceRowView.swift
@@ -70,7 +70,7 @@ class DeviceRowView: UIView {
super.init(frame: .zero)
- accessibilityIdentifier = .deviceCell
+ setAccessibilityIdentifier(.deviceCell)
backgroundColor = .primaryColor
directionalLayoutMargins = UIMetrics.TableView.rowViewLayoutMargins
@@ -91,7 +91,7 @@ class DeviceRowView: UIView {
)
removeButton.addTarget(self, action: #selector(handleButtonTap(_:)), for: .touchUpInside)
- removeButton.accessibilityIdentifier = .deviceCellRemoveButton
+ removeButton.setAccessibilityIdentifier(.deviceCellRemoveButton)
NSLayoutConstraint.activate([
textLabel.topAnchor.constraint(equalTo: layoutMarginsGuide.topAnchor),
diff --git a/ios/MullvadVPN/View controllers/Login/AccountInputGroupView.swift b/ios/MullvadVPN/View controllers/Login/AccountInputGroupView.swift
index e592e1b216..9bad60b873 100644
--- a/ios/MullvadVPN/View controllers/Login/AccountInputGroupView.swift
+++ b/ios/MullvadVPN/View controllers/Login/AccountInputGroupView.swift
@@ -24,7 +24,7 @@ final class AccountInputGroupView: UIView {
button.translatesAutoresizingMaskIntoConstraints = false
button.setImage(UIImage(named: "IconArrow"), for: .normal)
button.setContentCompressionResistancePriority(.defaultHigh, for: .horizontal)
- button.accessibilityIdentifier = .loginTextFieldButton
+ button.setAccessibilityIdentifier(.loginTextFieldButton)
button.accessibilityLabel = NSLocalizedString(
"ACCOUNT_INPUT_LOGIN_BUTTON_ACCESSIBILITY_LABEL",
tableName: "AccountInput",
diff --git a/ios/MullvadVPN/View controllers/Login/LoginContentView.swift b/ios/MullvadVPN/View controllers/Login/LoginContentView.swift
index 209b465528..9c4693f758 100644
--- a/ios/MullvadVPN/View controllers/Login/LoginContentView.swift
+++ b/ios/MullvadVPN/View controllers/Login/LoginContentView.swift
@@ -85,7 +85,7 @@ class LoginContentView: UIView {
let createAccountButton: AppButton = {
let button = AppButton(style: .default)
- button.accessibilityIdentifier = .createAccountButton
+ button.setAccessibilityIdentifier(.createAccountButton)
button.translatesAutoresizingMaskIntoConstraints = false
button.setTitle(NSLocalizedString(
"CREATE_ACCOUNT_BUTTON_LABEL",
@@ -104,9 +104,9 @@ class LoginContentView: UIView {
backgroundColor = .primaryColor
directionalLayoutMargins = UIMetrics.contentLayoutMargins
- accessibilityIdentifier = .loginView
+ setAccessibilityIdentifier(.loginView)
- accountInputGroup.textField.accessibilityIdentifier = .loginTextField
+ accountInputGroup.textField.setAccessibilityIdentifier(.loginTextField)
keyboardResponder = AutomaticKeyboardResponder(
targetView: self,
diff --git a/ios/MullvadVPN/View controllers/Login/LoginViewController.swift b/ios/MullvadVPN/View controllers/Login/LoginViewController.swift
index af9698f89c..81d00f8248 100644
--- a/ios/MullvadVPN/View controllers/Login/LoginViewController.swift
+++ b/ios/MullvadVPN/View controllers/Login/LoginViewController.swift
@@ -59,7 +59,7 @@ class LoginViewController: UIViewController, RootContainment {
target: self,
action: #selector(doLogin)
)
- barButtonItem.accessibilityIdentifier = .loginBarButton
+ barButtonItem.setAccessibilityIdentifier(.loginBarButton)
return barButtonItem
}()
diff --git a/ios/MullvadVPN/View controllers/OutOfTime/OutOfTimeContentView.swift b/ios/MullvadVPN/View controllers/OutOfTime/OutOfTimeContentView.swift
index 843fd0cda4..4955741292 100644
--- a/ios/MullvadVPN/View controllers/OutOfTime/OutOfTimeContentView.swift
+++ b/ios/MullvadVPN/View controllers/OutOfTime/OutOfTimeContentView.swift
@@ -95,7 +95,7 @@ class OutOfTimeContentView: UIView {
override init(frame: CGRect) {
super.init(frame: frame)
- accessibilityIdentifier = .outOfTimeView
+ setAccessibilityIdentifier(.outOfTimeView)
translatesAutoresizingMaskIntoConstraints = false
backgroundColor = .secondaryColor
directionalLayoutMargins = UIMetrics.contentLayoutMargins
diff --git a/ios/MullvadVPN/View controllers/ProblemReport/ProblemReportReviewViewController.swift b/ios/MullvadVPN/View controllers/ProblemReport/ProblemReportReviewViewController.swift
index d7b6f54c38..56befb66fd 100644
--- a/ios/MullvadVPN/View controllers/ProblemReport/ProblemReportReviewViewController.swift
+++ b/ios/MullvadVPN/View controllers/ProblemReport/ProblemReportReviewViewController.swift
@@ -30,7 +30,7 @@ class ProblemReportReviewViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
view.backgroundColor = .secondaryColor
- view.accessibilityIdentifier = .appLogsView
+ view.setAccessibilityIdentifier(.appLogsView)
navigationItem.title = NSLocalizedString(
"NAVIGATION_TITLE",
@@ -45,7 +45,7 @@ class ProblemReportReviewViewController: UIViewController {
self?.dismiss(animated: true)
})
)
- navigationItem.rightBarButtonItem?.accessibilityIdentifier = .appLogsDoneButton
+ navigationItem.rightBarButtonItem?.setAccessibilityIdentifier(.appLogsDoneButton)
#if DEBUG
navigationItem.leftBarButtonItem = UIBarButtonItem(
@@ -54,10 +54,10 @@ class ProblemReportReviewViewController: UIViewController {
self?.share()
})
)
- navigationItem.leftBarButtonItem?.accessibilityIdentifier = .appLogsShareButton
+ navigationItem.leftBarButtonItem?.setAccessibilityIdentifier(.appLogsShareButton)
#endif
- textView.accessibilityIdentifier = .problemReportAppLogsTextView
+ textView.setAccessibilityIdentifier(.problemReportAppLogsTextView)
textView.translatesAutoresizingMaskIntoConstraints = false
textView.isEditable = false
textView.font = UIFont.monospacedSystemFont(
diff --git a/ios/MullvadVPN/View controllers/ProblemReport/ProblemReportSubmissionOverlayView.swift b/ios/MullvadVPN/View controllers/ProblemReport/ProblemReportSubmissionOverlayView.swift
index a6af41be56..3d49ea4008 100644
--- a/ios/MullvadVPN/View controllers/ProblemReport/ProblemReportSubmissionOverlayView.swift
+++ b/ios/MullvadVPN/View controllers/ProblemReport/ProblemReportSubmissionOverlayView.swift
@@ -174,7 +174,7 @@ class ProblemReportSubmissionOverlayView: UIView {
override init(frame: CGRect) {
super.init(frame: frame)
- accessibilityIdentifier = AccessibilityIdentifier.problemReportSubmittedView
+ setAccessibilityIdentifier(.problemReportSubmittedView)
addSubviews()
transitionToState(state)
diff --git a/ios/MullvadVPN/View controllers/ProblemReport/ProblemReportViewController+ViewManagement.swift b/ios/MullvadVPN/View controllers/ProblemReport/ProblemReportViewController+ViewManagement.swift
index 6d98e9c83b..e4ab6c6841 100644
--- a/ios/MullvadVPN/View controllers/ProblemReport/ProblemReportViewController+ViewManagement.swift
+++ b/ios/MullvadVPN/View controllers/ProblemReport/ProblemReportViewController+ViewManagement.swift
@@ -88,7 +88,7 @@ extension ProblemReportViewController {
func makeViewLogsButton() -> AppButton {
let button = AppButton(style: .default)
- button.accessibilityIdentifier = .problemReportAppLogsButton
+ button.setAccessibilityIdentifier(.problemReportAppLogsButton)
button.translatesAutoresizingMaskIntoConstraints = false
button.setTitle(Self.persistentViewModel.viewLogsButtonTitle, for: .normal)
button.addTarget(self, action: #selector(handleViewLogsButtonTap), for: .touchUpInside)
@@ -97,7 +97,7 @@ extension ProblemReportViewController {
func makeSendButton() -> AppButton {
let button = AppButton(style: .success)
- button.accessibilityIdentifier = .problemReportSendButton
+ button.setAccessibilityIdentifier(.problemReportSendButton)
button.translatesAutoresizingMaskIntoConstraints = false
button.setTitle(Self.persistentViewModel.sendLogsButtonTitle, for: .normal)
button.addTarget(self, action: #selector(handleSendButtonTap), for: .touchUpInside)
diff --git a/ios/MullvadVPN/View controllers/ProblemReport/ProblemReportViewController.swift b/ios/MullvadVPN/View controllers/ProblemReport/ProblemReportViewController.swift
index 47ba3225e9..1cbba022e4 100644
--- a/ios/MullvadVPN/View controllers/ProblemReport/ProblemReportViewController.swift
+++ b/ios/MullvadVPN/View controllers/ProblemReport/ProblemReportViewController.swift
@@ -75,7 +75,7 @@ final class ProblemReportViewController: UIViewController, UITextFieldDelegate {
super.viewDidLoad()
view.backgroundColor = .secondaryColor
- view.accessibilityIdentifier = .problemReportView
+ view.setAccessibilityIdentifier(.problemReportView)
navigationItem.title = Self.persistentViewModel.navigationTitle
@@ -91,8 +91,8 @@ final class ProblemReportViewController: UIViewController, UITextFieldDelegate {
messageTextView.setContentHuggingPriority(.defaultLow, for: .vertical)
messageTextView.setContentCompressionResistancePriority(.defaultLow, for: .vertical)
- emailTextField.accessibilityIdentifier = .problemReportEmailTextField
- messageTextView.accessibilityIdentifier = .problemReportMessageTextView
+ emailTextField.setAccessibilityIdentifier(.problemReportEmailTextField)
+ messageTextView.setAccessibilityIdentifier(.problemReportMessageTextView)
addConstraints()
registerForNotifications()
diff --git a/ios/MullvadVPN/View controllers/RelayFilter/ChipViewCell.swift b/ios/MullvadVPN/View controllers/RelayFilter/ChipViewCell.swift
index 96737788a1..071d5b2ff2 100644
--- a/ios/MullvadVPN/View controllers/RelayFilter/ChipViewCell.swift
+++ b/ios/MullvadVPN/View controllers/RelayFilter/ChipViewCell.swift
@@ -25,7 +25,7 @@ class ChipViewCell: UIView, UIContentView {
private let titleLabel: UILabel = {
let label = UILabel()
- label.accessibilityIdentifier = .relayFilterChipLabel
+ label.setAccessibilityIdentifier(.relayFilterChipLabel)
label.adjustsFontForContentSizeCategory = true
label.translatesAutoresizingMaskIntoConstraints = false
label.numberOfLines = 1
@@ -39,7 +39,7 @@ class ChipViewCell: UIView, UIContentView {
var buttonConfiguration = UIButton.Configuration.plain()
buttonConfiguration.image = UIImage(resource: .iconCloseSml).withTintColor(.white.withAlphaComponent(0.6))
buttonConfiguration.contentInsets = .zero
- button.accessibilityIdentifier = .relayFilterChipCloseButton
+ button.setAccessibilityIdentifier(.relayFilterChipCloseButton)
button.configuration = buttonConfiguration
return button
}()
@@ -73,7 +73,7 @@ class ChipViewCell: UIView, UIContentView {
}
func addSubviews() {
- self.accessibilityIdentifier = .relayFilterChipView
+ self.setAccessibilityIdentifier(.relayFilterChipView)
let stackView = UIStackView(arrangedSubviews: [titleLabel, closeButton])
stackView.spacing = UIMetrics.FilterView.chipViewLabelSpacing
diff --git a/ios/MullvadVPN/View controllers/RelayFilter/RelayFilterCellFactory.swift b/ios/MullvadVPN/View controllers/RelayFilter/RelayFilterCellFactory.swift
index 25af065369..ca3e26cc75 100644
--- a/ios/MullvadVPN/View controllers/RelayFilter/RelayFilterCellFactory.swift
+++ b/ios/MullvadVPN/View controllers/RelayFilter/RelayFilterCellFactory.swift
@@ -34,13 +34,13 @@ struct RelayFilterCellFactory: CellFactoryProtocol {
switch item {
case .ownershipAny:
title = "Any"
- cell.accessibilityIdentifier = .ownershipAnyCell
+ cell.setAccessibilityIdentifier(.ownershipAnyCell)
case .ownershipOwned:
title = "Mullvad owned only"
- cell.accessibilityIdentifier = .ownershipMullvadOwnedCell
+ cell.setAccessibilityIdentifier(.ownershipMullvadOwnedCell)
case .ownershipRented:
title = "Rented only"
- cell.accessibilityIdentifier = .ownershipRentedCell
+ cell.setAccessibilityIdentifier(.ownershipRentedCell)
default:
assertionFailure("Item mismatch. Got: \(item)")
}
@@ -80,7 +80,7 @@ struct RelayFilterCellFactory: CellFactoryProtocol {
)
cell.applySubCellStyling()
- cell.accessibilityIdentifier = .relayFilterProviderCell
+ cell.setAccessibilityIdentifier(.relayFilterProviderCell)
}
private func setFontWeight(_ weight: UIFont.Weight, to label: UILabel) {
diff --git a/ios/MullvadVPN/View controllers/RelayFilter/RelayFilterDataSource.swift b/ios/MullvadVPN/View controllers/RelayFilter/RelayFilterDataSource.swift
index ad36ef12f2..d42183c157 100644
--- a/ios/MullvadVPN/View controllers/RelayFilter/RelayFilterDataSource.swift
+++ b/ios/MullvadVPN/View controllers/RelayFilter/RelayFilterDataSource.swift
@@ -254,7 +254,7 @@ extension RelayFilterDataSource: UITableViewDelegate {
title = "Providers"
}
- view.accessibilityIdentifier = accessibilityIdentifier
+ view.setAccessibilityIdentifier(accessibilityIdentifier)
view.titleLabel.text = NSLocalizedString(
"RELAY_FILTER_HEADER_LABEL",
tableName: "Relay filter header",
diff --git a/ios/MullvadVPN/View controllers/RelayFilter/RelayFilterViewController.swift b/ios/MullvadVPN/View controllers/RelayFilter/RelayFilterViewController.swift
index c14d41e291..87a0e56f84 100644
--- a/ios/MullvadVPN/View controllers/RelayFilter/RelayFilterViewController.swift
+++ b/ios/MullvadVPN/View controllers/RelayFilter/RelayFilterViewController.swift
@@ -21,7 +21,7 @@ class RelayFilterViewController: UIViewController {
private let applyButton: AppButton = {
let button = AppButton(style: .success)
- button.accessibilityIdentifier = .applyButton
+ button.setAccessibilityIdentifier(.applyButton)
button.setTitle(NSLocalizedString(
"RELAY_FILTER_BUTTON_TITLE",
tableName: "RelayFilter",
diff --git a/ios/MullvadVPN/View controllers/RevokedDevice/RevokedDeviceViewController.swift b/ios/MullvadVPN/View controllers/RevokedDevice/RevokedDeviceViewController.swift
index ea80ff14ef..ba19cfdea9 100644
--- a/ios/MullvadVPN/View controllers/RevokedDevice/RevokedDeviceViewController.swift
+++ b/ios/MullvadVPN/View controllers/RevokedDevice/RevokedDeviceViewController.swift
@@ -62,7 +62,7 @@ class RevokedDeviceViewController: UIViewController, RootContainment {
private lazy var logoutButton: AppButton = {
let button = AppButton(style: .default)
- button.accessibilityIdentifier = .revokedDeviceLoginButton
+ button.setAccessibilityIdentifier(.revokedDeviceLoginButton)
button.translatesAutoresizingMaskIntoConstraints = false
button.setTitle(
NSLocalizedString(
@@ -109,7 +109,7 @@ class RevokedDeviceViewController: UIViewController, RootContainment {
override func viewDidLoad() {
super.viewDidLoad()
- view.accessibilityIdentifier = .revokedDeviceView
+ view.setAccessibilityIdentifier(.revokedDeviceView)
view.backgroundColor = .secondaryColor
view.directionalLayoutMargins = UIMetrics.contentLayoutMargins
diff --git a/ios/MullvadVPN/View controllers/SelectLocation/LocationCell.swift b/ios/MullvadVPN/View controllers/SelectLocation/LocationCell.swift
index 69b6fcc4fd..dfeab104ff 100644
--- a/ios/MullvadVPN/View controllers/SelectLocation/LocationCell.swift
+++ b/ios/MullvadVPN/View controllers/SelectLocation/LocationCell.swift
@@ -265,7 +265,7 @@ class LocationCell: UITableViewCell {
private func updateCollapseImage() {
let image = isExpanded ? chevronUp : chevronDown
- collapseButton.accessibilityIdentifier = isExpanded ? .collapseButton : .expandButton
+ collapseButton.setAccessibilityIdentifier(isExpanded ? .collapseButton : .expandButton)
collapseButton.setImage(image, for: .normal)
}
@@ -314,7 +314,7 @@ extension LocationCell {
showsCollapseControl = !item.node.children.isEmpty
isExpanded = item.node.showsChildren
accessibilityValue = item.node.code
- checkboxButton.accessibilityIdentifier = .customListLocationCheckmarkButton
+ checkboxButton.setAccessibilityIdentifier(.customListLocationCheckmarkButton)
for view in checkboxButton.subviews where view is CheckboxView {
let checkboxView = view as? CheckboxView
@@ -322,19 +322,17 @@ extension LocationCell {
}
if item.node is CustomListLocationNode {
- accessibilityIdentifier = .customListLocationCell
+ setAccessibilityIdentifier(.customListLocationCell)
} else {
// Only custom list nodes have more than one location. Therefore checking first
// location here is fine.
- switch item.node.locations.first {
- case .country:
- accessibilityIdentifier = .countryLocationCell
- case .city:
- accessibilityIdentifier = .cityLocationCell
- case .hostname:
- accessibilityIdentifier = .relayLocationCell
- case nil:
- break
+ if let location = item.node.locations.first {
+ let accessibilityId: AccessibilityIdentifier = switch location {
+ case .country: .countryLocationCell
+ case .city: .cityLocationCell
+ case .hostname: .relayLocationCell
+ }
+ setAccessibilityIdentifier(accessibilityId)
}
}
diff --git a/ios/MullvadVPN/View controllers/SelectLocation/LocationSectionHeaderView.swift b/ios/MullvadVPN/View controllers/SelectLocation/LocationSectionHeaderView.swift
index 11889bb590..d548b09076 100644
--- a/ios/MullvadVPN/View controllers/SelectLocation/LocationSectionHeaderView.swift
+++ b/ios/MullvadVPN/View controllers/SelectLocation/LocationSectionHeaderView.swift
@@ -67,7 +67,7 @@ class LocationSectionHeaderView: UIView, UIContentView {
actionButton.isHidden = isActionHidden
actionButton.accessibilityIdentifier = nil
actualConfiguration.primaryAction.flatMap { action in
- actionButton.accessibilityIdentifier = .openCustomListsMenuButton
+ actionButton.setAccessibilityIdentifier(.openCustomListsMenuButton)
actionButton.addAction(action, for: .touchUpInside)
}
}
diff --git a/ios/MullvadVPN/View controllers/SelectLocation/LocationViewController.swift b/ios/MullvadVPN/View controllers/SelectLocation/LocationViewController.swift
index db3cc62b02..70e11012fe 100644
--- a/ios/MullvadVPN/View controllers/SelectLocation/LocationViewController.swift
+++ b/ios/MullvadVPN/View controllers/SelectLocation/LocationViewController.swift
@@ -57,7 +57,7 @@ final class LocationViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
- view.accessibilityIdentifier = .selectLocationView
+ view.setAccessibilityIdentifier(.selectLocationView)
view.backgroundColor = .secondaryColor
setUpDataSource()
@@ -162,7 +162,7 @@ final class LocationViewController: UIViewController {
tableView.sectionHeaderHeight = 56
tableView.indicatorStyle = .white
tableView.keyboardDismissMode = .onDrag
- tableView.accessibilityIdentifier = .selectLocationTableView
+ tableView.setAccessibilityIdentifier(.selectLocationTableView)
}
private func setUpTopContent() {
@@ -189,7 +189,7 @@ final class LocationViewController: UIViewController {
value: "Search for...",
comment: ""
)
- searchBar.searchTextField.accessibilityIdentifier = .selectLocationSearchTextField
+ searchBar.searchTextField.setAccessibilityIdentifier(.selectLocationSearchTextField)
UITextField.SearchTextFieldAppearance.inactive.apply(to: searchBar)
}
diff --git a/ios/MullvadVPN/View controllers/SelectLocation/LocationViewControllerWrapper.swift b/ios/MullvadVPN/View controllers/SelectLocation/LocationViewControllerWrapper.swift
index c111b77316..3aba8a46e5 100644
--- a/ios/MullvadVPN/View controllers/SelectLocation/LocationViewControllerWrapper.swift
+++ b/ios/MullvadVPN/View controllers/SelectLocation/LocationViewControllerWrapper.swift
@@ -105,7 +105,7 @@ final class LocationViewControllerWrapper: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
- view.accessibilityIdentifier = .selectLocationViewWrapper
+ view.setAccessibilityIdentifier(.selectLocationViewWrapper)
view.backgroundColor = .secondaryColor
setUpNavigation()
@@ -179,7 +179,7 @@ final class LocationViewControllerWrapper: UIViewController {
self?.delegate?.navigateToFilter()
})
)
- navigationItem.leftBarButtonItem?.accessibilityIdentifier = .selectLocationFilterButton
+ navigationItem.leftBarButtonItem?.setAccessibilityIdentifier(.selectLocationFilterButton)
navigationItem.rightBarButtonItem = UIBarButtonItem(
systemItem: .done,
@@ -187,7 +187,7 @@ final class LocationViewControllerWrapper: UIViewController {
self?.didFinish?()
})
)
- navigationItem.rightBarButtonItem?.accessibilityIdentifier = .closeSelectLocationButton
+ navigationItem.rightBarButtonItem?.setAccessibilityIdentifier(.closeSelectLocationButton)
}
private func setUpSegmentedControl() {
diff --git a/ios/MullvadVPN/View controllers/Settings/SelectableSettingsDetailsCell.swift b/ios/MullvadVPN/View controllers/Settings/SelectableSettingsDetailsCell.swift
index 8869d7f0cf..239a62c3d7 100644
--- a/ios/MullvadVPN/View controllers/Settings/SelectableSettingsDetailsCell.swift
+++ b/ios/MullvadVPN/View controllers/Settings/SelectableSettingsDetailsCell.swift
@@ -22,7 +22,7 @@ class SelectableSettingsDetailsCell: SelectableSettingsCell {
.withRenderingMode(.alwaysOriginal)
.withTintColor(.white)
actionButton.configuration = actionButtonConfiguration
- actionButton.accessibilityIdentifier = .openPortSelectorMenuButton
+ actionButton.setAccessibilityIdentifier(.openPortSelectorMenuButton)
actionButton.addTarget(
self,
diff --git a/ios/MullvadVPN/View controllers/Settings/SettingsCell.swift b/ios/MullvadVPN/View controllers/Settings/SettingsCell.swift
index 591857be9b..1fa9adb3fd 100644
--- a/ios/MullvadVPN/View controllers/Settings/SettingsCell.swift
+++ b/ios/MullvadVPN/View controllers/Settings/SettingsCell.swift
@@ -81,7 +81,7 @@ class SettingsCell: UITableViewCell, CustomCellDisclosureHandling {
private let infoButton: UIButton = {
let button = UIButton(type: .custom)
- button.accessibilityIdentifier = .infoButton
+ button.setAccessibilityIdentifier(.infoButton)
button.tintColor = .white
button.setImage(UIImage(named: "IconInfo"), for: .normal)
button.isHidden = true
diff --git a/ios/MullvadVPN/View controllers/Settings/SettingsCellFactory.swift b/ios/MullvadVPN/View controllers/Settings/SettingsCellFactory.swift
index 7a00c9336d..d9b5b42bb1 100644
--- a/ios/MullvadVPN/View controllers/Settings/SettingsCellFactory.swift
+++ b/ios/MullvadVPN/View controllers/Settings/SettingsCellFactory.swift
@@ -47,7 +47,7 @@ final class SettingsCellFactory: CellFactoryProtocol {
comment: ""
)
cell.detailTitleLabel.text = nil
- cell.accessibilityIdentifier = item.accessibilityIdentifier
+ cell.setAccessibilityIdentifier(item.accessibilityIdentifier)
cell.disclosureType = .chevron
case .version:
@@ -60,7 +60,7 @@ final class SettingsCellFactory: CellFactoryProtocol {
comment: ""
)
cell.detailTitleLabel.text = Bundle.main.productVersion
- cell.accessibilityIdentifier = item.accessibilityIdentifier
+ cell.setAccessibilityIdentifier(item.accessibilityIdentifier)
cell.disclosureType = .none
case .problemReport:
@@ -73,7 +73,7 @@ final class SettingsCellFactory: CellFactoryProtocol {
comment: ""
)
cell.detailTitleLabel.text = nil
- cell.accessibilityIdentifier = item.accessibilityIdentifier
+ cell.setAccessibilityIdentifier(item.accessibilityIdentifier)
cell.disclosureType = .chevron
case .faq:
@@ -86,7 +86,7 @@ final class SettingsCellFactory: CellFactoryProtocol {
comment: ""
)
cell.detailTitleLabel.text = nil
- cell.accessibilityIdentifier = item.accessibilityIdentifier
+ cell.setAccessibilityIdentifier(item.accessibilityIdentifier)
cell.disclosureType = .externalLink
case .apiAccess:
@@ -99,7 +99,7 @@ final class SettingsCellFactory: CellFactoryProtocol {
comment: ""
)
cell.detailTitleLabel.text = nil
- cell.accessibilityIdentifier = item.accessibilityIdentifier
+ cell.setAccessibilityIdentifier(item.accessibilityIdentifier)
cell.disclosureType = .chevron
case .daita:
@@ -119,7 +119,7 @@ final class SettingsCellFactory: CellFactoryProtocol {
comment: ""
)
- cell.accessibilityIdentifier = item.accessibilityIdentifier
+ cell.setAccessibilityIdentifier(item.accessibilityIdentifier)
cell.disclosureType = .chevron
case .multihop:
@@ -139,7 +139,7 @@ final class SettingsCellFactory: CellFactoryProtocol {
comment: ""
)
- cell.accessibilityIdentifier = item.accessibilityIdentifier
+ cell.setAccessibilityIdentifier(item.accessibilityIdentifier)
cell.disclosureType = .chevron
}
}
diff --git a/ios/MullvadVPN/View controllers/Settings/SettingsDNSTextCell.swift b/ios/MullvadVPN/View controllers/Settings/SettingsDNSTextCell.swift
index b423bcaca7..b6bd58b46c 100644
--- a/ios/MullvadVPN/View controllers/Settings/SettingsDNSTextCell.swift
+++ b/ios/MullvadVPN/View controllers/Settings/SettingsDNSTextCell.swift
@@ -34,7 +34,7 @@ class SettingsDNSTextCell: SettingsCell, UITextFieldDelegate {
value: "Enter IP",
comment: ""
)
- textField.accessibilityIdentifier = .dnsSettingsEnterIPAddressTextField
+ textField.setAccessibilityIdentifier(.dnsSettingsEnterIPAddressTextField)
textField.cornerRadius = 0
textField.keyboardType = .numbersAndPunctuation
textField.returnKeyType = .done
diff --git a/ios/MullvadVPN/View controllers/Settings/SettingsHeaderView.swift b/ios/MullvadVPN/View controllers/Settings/SettingsHeaderView.swift
index 7b51fe37ff..9369c83413 100644
--- a/ios/MullvadVPN/View controllers/Settings/SettingsHeaderView.swift
+++ b/ios/MullvadVPN/View controllers/Settings/SettingsHeaderView.swift
@@ -23,7 +23,7 @@ class SettingsHeaderView: UITableViewHeaderFooterView {
let infoButton: UIButton = {
let button = UIButton(type: .custom)
- button.accessibilityIdentifier = .infoButton
+ button.setAccessibilityIdentifier(.infoButton)
button.tintColor = .white
button.setImage(UIImage(named: "IconInfo"), for: .normal)
return button
@@ -31,7 +31,7 @@ class SettingsHeaderView: UITableViewHeaderFooterView {
let collapseButton: UIButton = {
let button = UIButton(type: .custom)
- button.accessibilityIdentifier = .expandButton
+ button.setAccessibilityIdentifier(.expandButton)
button.tintColor = .white
return button
}()
@@ -123,7 +123,7 @@ class SettingsHeaderView: UITableViewHeaderFooterView {
let image = isExpanded ? chevronUp : chevronDown
collapseButton.setImage(image, for: .normal)
- collapseButton.accessibilityIdentifier = isExpanded ? .collapseButton : .expandButton
+ collapseButton.setAccessibilityIdentifier(isExpanded ? .collapseButton : .expandButton)
}
private func updateAccessibilityCustomActions() {
diff --git a/ios/MullvadVPN/View controllers/Settings/SettingsViewController.swift b/ios/MullvadVPN/View controllers/Settings/SettingsViewController.swift
index 351713b100..a8b62ebdbc 100644
--- a/ios/MullvadVPN/View controllers/Settings/SettingsViewController.swift
+++ b/ios/MullvadVPN/View controllers/Settings/SettingsViewController.swift
@@ -58,10 +58,10 @@ class SettingsViewController: UITableViewController {
delegate?.settingsViewControllerDidFinish(self)
})
)
- doneButton.accessibilityIdentifier = .settingsDoneButton
+ doneButton.setAccessibilityIdentifier(.settingsDoneButton)
navigationItem.rightBarButtonItem = doneButton
- tableView.accessibilityIdentifier = .settingsTableView
+ tableView.setAccessibilityIdentifier(.settingsTableView)
tableView.backgroundColor = .secondaryColor
tableView.separatorColor = .secondaryColor
tableView.rowHeight = UITableView.automaticDimension
diff --git a/ios/MullvadVPN/View controllers/TermsOfService/TermsOfServiceContentView.swift b/ios/MullvadVPN/View controllers/TermsOfService/TermsOfServiceContentView.swift
index dc70124b44..40baa6a5d1 100644
--- a/ios/MullvadVPN/View controllers/TermsOfService/TermsOfServiceContentView.swift
+++ b/ios/MullvadVPN/View controllers/TermsOfService/TermsOfServiceContentView.swift
@@ -69,7 +69,7 @@ class TermsOfServiceContentView: UIView {
let agreeButton: AppButton = {
let button = AppButton(style: .default)
button.translatesAutoresizingMaskIntoConstraints = false
- button.accessibilityIdentifier = .agreeButton
+ button.setAccessibilityIdentifier(.agreeButton)
button.setTitle(NSLocalizedString(
"CONTINUE_BUTTON_TITLE",
tableName: "TermsOfService",
@@ -103,7 +103,7 @@ class TermsOfServiceContentView: UIView {
override init(frame: CGRect) {
super.init(frame: frame)
- self.accessibilityIdentifier = .termsOfServiceView
+ self.setAccessibilityIdentifier(.termsOfServiceView)
addSubviews()
}
diff --git a/ios/MullvadVPN/View controllers/Tunnel/ConnectionPanelView.swift b/ios/MullvadVPN/View controllers/Tunnel/ConnectionPanelView.swift
index 93b688d8a4..ab61264800 100644
--- a/ios/MullvadVPN/View controllers/Tunnel/ConnectionPanelView.swift
+++ b/ios/MullvadVPN/View controllers/Tunnel/ConnectionPanelView.swift
@@ -29,7 +29,7 @@ class ConnectionPanelView: UIView {
var connectedRelayName = "" {
didSet {
- collapseView.accessibilityIdentifier = .relayStatusCollapseButton
+ collapseView.setAccessibilityIdentifier(.relayStatusCollapseButton)
collapseView.title.text = connectedRelayName
collapseView.accessibilityLabel = NSLocalizedString(
"RELAY_ACCESSIBILITY_LABEL",
@@ -80,8 +80,8 @@ class ConnectionPanelView: UIView {
inAddressRow.translatesAutoresizingMaskIntoConstraints = false
outAddressRow.translatesAutoresizingMaskIntoConstraints = false
- inAddressRow.accessibilityIdentifier = .connectionPanelInAddressRow
- outAddressRow.accessibilityIdentifier = .connectionPanelOutAddressRow
+ inAddressRow.setAccessibilityIdentifier(.connectionPanelInAddressRow)
+ outAddressRow.setAccessibilityIdentifier(.connectionPanelOutAddressRow)
inAddressRow.title = NSLocalizedString(
"IN_ADDRESS_LABEL",
@@ -205,7 +205,7 @@ class ConnectionPanelAddressRow: UIView {
private let detailTextLabel: UILabel = {
let detailTextLabel = UILabel()
- detailTextLabel.accessibilityIdentifier = .connectionPanelDetailLabel
+ detailTextLabel.setAccessibilityIdentifier(.connectionPanelDetailLabel)
detailTextLabel.font = .systemFont(ofSize: 17)
detailTextLabel.textColor = .white
detailTextLabel.translatesAutoresizingMaskIntoConstraints = false
diff --git a/ios/MullvadVPN/View controllers/Tunnel/TunnelControlView.swift b/ios/MullvadVPN/View controllers/Tunnel/TunnelControlView.swift
index b95376590f..5c9d6970f5 100644
--- a/ios/MullvadVPN/View controllers/Tunnel/TunnelControlView.swift
+++ b/ios/MullvadVPN/View controllers/Tunnel/TunnelControlView.swift
@@ -67,21 +67,21 @@ final class TunnelControlView: UIView {
private let connectButton: AppButton = {
let button = AppButton(style: .success)
- button.accessibilityIdentifier = .secureConnectionButton
+ button.setAccessibilityIdentifier(.secureConnectionButton)
button.translatesAutoresizingMaskIntoConstraints = false
return button
}()
private let cancelButton: AppButton = {
let button = AppButton(style: .translucentDanger)
- button.accessibilityIdentifier = .cancelButton
+ button.setAccessibilityIdentifier(.cancelButton)
button.translatesAutoresizingMaskIntoConstraints = false
return button
}()
private let selectLocationButton: AppButton = {
let button = AppButton(style: .translucentNeutral)
- button.accessibilityIdentifier = .selectLocationButton
+ button.setAccessibilityIdentifier(.selectLocationButton)
button.translatesAutoresizingMaskIntoConstraints = false
return button
}()
@@ -92,7 +92,7 @@ final class TunnelControlView: UIView {
private let splitDisconnectButton: DisconnectSplitButton = {
let button = DisconnectSplitButton()
- button.primaryButton.accessibilityIdentifier = .disconnectButton
+ button.primaryButton.setAccessibilityIdentifier(.disconnectButton)
button.translatesAutoresizingMaskIntoConstraints = false
return button
}()
@@ -122,7 +122,7 @@ final class TunnelControlView: UIView {
backgroundColor = .clear
directionalLayoutMargins = UIMetrics.contentLayoutMargins
accessibilityContainerType = .semanticGroup
- accessibilityIdentifier = .tunnelControlView
+ setAccessibilityIdentifier(.tunnelControlView)
addSubviews()
addButtonHandlers()
@@ -172,11 +172,11 @@ final class TunnelControlView: UIView {
switch tunnelState {
case .connected:
- secureLabel.accessibilityIdentifier = .connectionStatusConnectedLabel
+ secureLabel.setAccessibilityIdentifier(.connectionStatusConnectedLabel)
case .connecting:
- secureLabel.accessibilityIdentifier = .connectionStatusConnectingLabel
+ secureLabel.setAccessibilityIdentifier(.connectionStatusConnectingLabel)
default:
- secureLabel.accessibilityIdentifier = .connectionStatusNotConnectedLabel
+ secureLabel.setAccessibilityIdentifier(.connectionStatusNotConnectedLabel)
}
}
diff --git a/ios/MullvadVPN/View controllers/VPNSettings/CustomDNSCellFactory.swift b/ios/MullvadVPN/View controllers/VPNSettings/CustomDNSCellFactory.swift
index b8c0c7c098..6566211edd 100644
--- a/ios/MullvadVPN/View controllers/VPNSettings/CustomDNSCellFactory.swift
+++ b/ios/MullvadVPN/View controllers/VPNSettings/CustomDNSCellFactory.swift
@@ -44,7 +44,7 @@ final class CustomDNSCellFactory: CellFactoryProtocol {
guard let cell = cell as? SettingsSwitchCell else { return }
cell.titleLabel.text = title
- cell.accessibilityIdentifier = preference.accessibilityIdentifier
+ cell.setAccessibilityIdentifier(preference.accessibilityIdentifier)
cell.applySubCellStyling()
cell.setOn(toggleSetting, animated: true)
cell.action = { [weak self] isOn in
@@ -176,7 +176,7 @@ final class CustomDNSCellFactory: CellFactoryProtocol {
cell.setOn(viewModel.effectiveEnableCustomDNS, animated: false)
cell.accessibilityHint = viewModel.customDNSPrecondition
.localizedDescription(isEditing: isEditing)
- cell.accessibilityIdentifier = .dnsSettingsUseCustomDNSCell
+ cell.setAccessibilityIdentifier(.dnsSettingsUseCustomDNSCell)
cell.action = { [weak self] isOn in
self?.delegate?.didChangeState(for: .useCustomDNS, isOn: isOn)
}
@@ -190,7 +190,7 @@ final class CustomDNSCellFactory: CellFactoryProtocol {
value: "Add a server",
comment: ""
)
- cell.accessibilityIdentifier = .dnsSettingsAddServerCell
+ cell.setAccessibilityIdentifier(.dnsSettingsAddServerCell)
cell.tapAction = { [weak self] in
self?.delegate?.addDNSEntry()
}
diff --git a/ios/MullvadVPN/View controllers/VPNSettings/CustomDNSDataSource.swift b/ios/MullvadVPN/View controllers/VPNSettings/CustomDNSDataSource.swift
index d6ea9cbc60..42d3ac8f45 100644
--- a/ios/MullvadVPN/View controllers/VPNSettings/CustomDNSDataSource.swift
+++ b/ios/MullvadVPN/View controllers/VPNSettings/CustomDNSDataSource.swift
@@ -605,7 +605,7 @@ final class CustomDNSDataSource: UITableViewDiffableDataSource<
header.accessibilityCustomActionName = title
header.accessibilityValue = "\(enabledBlockersCount)"
- header.accessibilityIdentifier = .dnsContentBlockersHeaderView
+ header.setAccessibilityIdentifier(.dnsContentBlockersHeaderView)
header.infoButtonHandler = { [weak self] in
self?.delegate?.showInfo(for: .contentBlockers)
diff --git a/ios/MullvadVPN/View controllers/VPNSettings/CustomDNSViewController.swift b/ios/MullvadVPN/View controllers/VPNSettings/CustomDNSViewController.swift
index 5280cd00a5..efae49ad8c 100644
--- a/ios/MullvadVPN/View controllers/VPNSettings/CustomDNSViewController.swift
+++ b/ios/MullvadVPN/View controllers/VPNSettings/CustomDNSViewController.swift
@@ -32,7 +32,7 @@ class CustomDNSViewController: UITableViewController {
override func viewDidLoad() {
super.viewDidLoad()
- tableView.accessibilityIdentifier = .dnsSettingsTableView
+ tableView.setAccessibilityIdentifier(.dnsSettingsTableView)
tableView.backgroundColor = .secondaryColor
tableView.separatorColor = .secondaryColor
tableView.rowHeight = UITableView.automaticDimension
@@ -50,7 +50,7 @@ class CustomDNSViewController: UITableViewController {
)
navigationItem.rightBarButtonItem = editButtonItem
- navigationItem.rightBarButtonItem?.accessibilityIdentifier = .dnsSettingsEditButton
+ navigationItem.rightBarButtonItem?.setAccessibilityIdentifier(.dnsSettingsEditButton)
interactor.tunnelSettingsDidChange = { [weak self] newSettings in
self?.dataSource?.update(from: newSettings)
diff --git a/ios/MullvadVPN/View controllers/VPNSettings/VPNSettingsCellFactory.swift b/ios/MullvadVPN/View controllers/VPNSettings/VPNSettingsCellFactory.swift
index 15219b50fd..3f0b75c9e1 100644
--- a/ios/MullvadVPN/View controllers/VPNSettings/VPNSettingsCellFactory.swift
+++ b/ios/MullvadVPN/View controllers/VPNSettings/VPNSettingsCellFactory.swift
@@ -51,7 +51,7 @@ final class VPNSettingsCellFactory: CellFactoryProtocol {
)
cell.disclosureType = .chevron
- cell.accessibilityIdentifier = item.accessibilityIdentifier
+ cell.setAccessibilityIdentifier(item.accessibilityIdentifier)
case .ipOverrides:
guard let cell = cell as? SettingsCell else { return }
@@ -64,7 +64,7 @@ final class VPNSettingsCellFactory: CellFactoryProtocol {
)
cell.disclosureType = .chevron
- cell.accessibilityIdentifier = item.accessibilityIdentifier
+ cell.setAccessibilityIdentifier(item.accessibilityIdentifier)
case let .wireGuardPort(port):
guard let cell = cell as? SelectableSettingsCell else { return }
@@ -80,7 +80,7 @@ final class VPNSettingsCellFactory: CellFactoryProtocol {
}
cell.titleLabel.text = portString
- cell.accessibilityIdentifier = "\(item.accessibilityIdentifier.rawValue) (\(portString))"
+ cell.accessibilityIdentifier = "\(item.accessibilityIdentifier.asString)"
cell.applySubCellStyling()
case .wireGuardCustomPort:
@@ -99,8 +99,8 @@ final class VPNSettingsCellFactory: CellFactoryProtocol {
comment: ""
)
- cell.textField.accessibilityIdentifier = .customWireGuardPortTextField
- cell.accessibilityIdentifier = item.accessibilityIdentifier
+ cell.textField.setAccessibilityIdentifier(.customWireGuardPortTextField)
+ cell.setAccessibilityIdentifier(item.accessibilityIdentifier)
cell.applySubCellStyling()
cell.inputDidChange = { [weak self] text in
@@ -133,7 +133,7 @@ final class VPNSettingsCellFactory: CellFactoryProtocol {
value: "Automatic",
comment: ""
)
- cell.accessibilityIdentifier = item.accessibilityIdentifier
+ cell.setAccessibilityIdentifier(item.accessibilityIdentifier)
cell.applySubCellStyling()
case .wireGuardObfuscationUdpOverTcp:
@@ -153,7 +153,7 @@ final class VPNSettingsCellFactory: CellFactoryProtocol {
comment: ""
), viewModel.obfuscationUpdOverTcpPort.description)
- cell.accessibilityIdentifier = item.accessibilityIdentifier
+ cell.setAccessibilityIdentifier(item.accessibilityIdentifier)
cell.applySubCellStyling()
cell.buttonAction = { [weak self] in
@@ -177,7 +177,7 @@ final class VPNSettingsCellFactory: CellFactoryProtocol {
comment: ""
), viewModel.obfuscationShadowsocksPort.description)
- cell.accessibilityIdentifier = item.accessibilityIdentifier
+ cell.setAccessibilityIdentifier(item.accessibilityIdentifier)
cell.applySubCellStyling()
cell.buttonAction = { [weak self] in
@@ -193,7 +193,7 @@ final class VPNSettingsCellFactory: CellFactoryProtocol {
value: "Off",
comment: ""
)
- cell.accessibilityIdentifier = item.accessibilityIdentifier
+ cell.setAccessibilityIdentifier(item.accessibilityIdentifier)
cell.applySubCellStyling()
case let .wireGuardObfuscationPort(port):
@@ -206,7 +206,7 @@ final class VPNSettingsCellFactory: CellFactoryProtocol {
value: portString,
comment: ""
)
- cell.accessibilityIdentifier = "\(item.accessibilityIdentifier.rawValue)\(portString)"
+ cell.accessibilityIdentifier = "\(item.accessibilityIdentifier)\(portString)"
cell.applySubCellStyling()
case .quantumResistanceAutomatic:
@@ -218,7 +218,7 @@ final class VPNSettingsCellFactory: CellFactoryProtocol {
value: "Automatic",
comment: ""
)
- cell.accessibilityIdentifier = item.accessibilityIdentifier
+ cell.setAccessibilityIdentifier(item.accessibilityIdentifier)
cell.applySubCellStyling()
case .quantumResistanceOn:
@@ -230,7 +230,7 @@ final class VPNSettingsCellFactory: CellFactoryProtocol {
value: "On",
comment: ""
)
- cell.accessibilityIdentifier = item.accessibilityIdentifier
+ cell.setAccessibilityIdentifier(item.accessibilityIdentifier)
cell.applySubCellStyling()
case .quantumResistanceOff:
@@ -242,7 +242,7 @@ final class VPNSettingsCellFactory: CellFactoryProtocol {
value: "Off",
comment: ""
)
- cell.accessibilityIdentifier = item.accessibilityIdentifier
+ cell.setAccessibilityIdentifier(item.accessibilityIdentifier)
cell.applySubCellStyling()
}
}
diff --git a/ios/MullvadVPN/View controllers/VPNSettings/VPNSettingsDataSource.swift b/ios/MullvadVPN/View controllers/VPNSettings/VPNSettingsDataSource.swift
index afa780e4eb..22d8a4a8da 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:
@@ -475,7 +475,7 @@ final class VPNSettingsDataSource: UITableViewDiffableDataSource<
comment: ""
)
- header.accessibilityIdentifier = .wireGuardPortsCell
+ header.setAccessibilityIdentifier(.wireGuardPortsCell)
header.titleLabel.text = title
header.accessibilityCustomActionName = title
header.isExpanded = isExpanded(.wireGuardPorts)
@@ -519,7 +519,7 @@ final class VPNSettingsDataSource: UITableViewDiffableDataSource<
comment: ""
)
- header.accessibilityIdentifier = .wireGuardObfuscationCell
+ header.setAccessibilityIdentifier(.wireGuardObfuscationCell)
header.titleLabel.text = title
header.accessibilityCustomActionName = title
header.isExpanded = isExpanded(.wireGuardObfuscation)
@@ -549,7 +549,7 @@ final class VPNSettingsDataSource: UITableViewDiffableDataSource<
comment: ""
)
- header.accessibilityIdentifier = .quantumResistantTunnelCell
+ header.setAccessibilityIdentifier(.quantumResistantTunnelCell)
header.titleLabel.text = title
header.accessibilityCustomActionName = title
header.isExpanded = isExpanded(.quantumResistance)
diff --git a/ios/MullvadVPN/View controllers/VPNSettings/VPNSettingsViewController.swift b/ios/MullvadVPN/View controllers/VPNSettings/VPNSettingsViewController.swift
index 23d64b8487..a9756aecf7 100644
--- a/ios/MullvadVPN/View controllers/VPNSettings/VPNSettingsViewController.swift
+++ b/ios/MullvadVPN/View controllers/VPNSettings/VPNSettingsViewController.swift
@@ -39,7 +39,7 @@ class VPNSettingsViewController: UITableViewController {
override func viewDidLoad() {
super.viewDidLoad()
- tableView.accessibilityIdentifier = .vpnSettingsTableView
+ tableView.setAccessibilityIdentifier(.vpnSettingsTableView)
tableView.backgroundColor = .secondaryColor
tableView.rowHeight = UITableView.automaticDimension
tableView.estimatedRowHeight = 60
diff --git a/ios/MullvadVPN/Views/CustomSwitch.swift b/ios/MullvadVPN/Views/CustomSwitch.swift
index a696d52142..1f141d00c2 100644
--- a/ios/MullvadVPN/Views/CustomSwitch.swift
+++ b/ios/MullvadVPN/Views/CustomSwitch.swift
@@ -31,7 +31,7 @@ class CustomSwitch: UISwitch {
onTintColor = .clear
overrideUserInterfaceStyle = .light
- accessibilityIdentifier = .customSwitch
+ setAccessibilityIdentifier(.customSwitch)
updateThumbColor(isOn: isOn, animated: false)
diff --git a/ios/MullvadVPN/Views/CustomToggleStyle.swift b/ios/MullvadVPN/Views/CustomToggleStyle.swift
index e114d17adc..b11449b9fc 100644
--- a/ios/MullvadVPN/Views/CustomToggleStyle.swift
+++ b/ios/MullvadVPN/Views/CustomToggleStyle.swift
@@ -56,7 +56,7 @@ struct CustomToggleStyle: ToggleStyle {
)
.opacity(disabled ? 0.4 : 1)
}
- .accessibilityIdentifier(accessibilityId?.rawValue ?? "")
+ .accessibilityIdentifier(accessibilityId?.asString ?? "")
.onTapGesture {
toggle(configuration)
}
diff --git a/ios/MullvadVPN/Views/StatusImageView.swift b/ios/MullvadVPN/Views/StatusImageView.swift
index 51f603c382..22c1d55eaa 100644
--- a/ios/MullvadVPN/Views/StatusImageView.swift
+++ b/ios/MullvadVPN/Views/StatusImageView.swift
@@ -58,7 +58,7 @@ class StatusImageView: UIImageView {
self.style = style
super.init(image: style.image)
image = style.image
- accessibilityIdentifier = .statusImageView
+ setAccessibilityIdentifier(.statusImageView)
}
required init?(coder: NSCoder) {
diff --git a/ios/MullvadVPNUITests/Base/BaseUITestCase.swift b/ios/MullvadVPNUITests/Base/BaseUITestCase.swift
index e7ef66f0fd..9eea1dd7ba 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.rawValue]
+ .otherElements[.changeLogAlert]
.waitForNonExistence(timeout: Self.shortTimeout)
}
diff --git a/ios/MullvadVPNUITests/ConnectivityTests.swift b/ios/MullvadVPNUITests/ConnectivityTests.swift
index 6b66a2d514..909cdce159 100644
--- a/ios/MullvadVPNUITests/ConnectivityTests.swift
+++ b/ios/MullvadVPNUITests/ConnectivityTests.swift
@@ -67,7 +67,7 @@ class ConnectivityTests: LoggedOutUITestCase {
.tapSelectLocationButton()
let filterCloseButtons = self.app.buttons
- .matching(identifier: AccessibilityIdentifier.relayFilterChipCloseButton.rawValue)
+ .matching(identifier: AccessibilityIdentifier.relayFilterChipCloseButton.asString)
.allElementsBoundByIndex
for filterCloseButton in filterCloseButtons where filterCloseButton.isHittable {
diff --git a/ios/MullvadVPNUITests/Pages/AccountPage.swift b/ios/MullvadVPNUITests/Pages/AccountPage.swift
index fd3d5d448e..86622b672f 100644
--- a/ios/MullvadVPNUITests/Pages/AccountPage.swift
+++ b/ios/MullvadVPNUITests/Pages/AccountPage.swift
@@ -18,27 +18,27 @@ class AccountPage: Page {
}
@discardableResult func tapRedeemVoucherButton() -> Self {
- app.buttons[AccessibilityIdentifier.redeemVoucherButton.rawValue].tap()
+ app.buttons[AccessibilityIdentifier.redeemVoucherButton.asString].tap()
return self
}
@discardableResult func tapAdd30DaysTimeButton() -> Self {
- app.buttons[AccessibilityIdentifier.purchaseButton.rawValue].tap()
+ app.buttons[AccessibilityIdentifier.purchaseButton.asString].tap()
return self
}
@discardableResult func tapRestorePurchasesButton() -> Self {
- app.buttons[AccessibilityIdentifier.restorePurchasesButton.rawValue].tap()
+ app.buttons[AccessibilityIdentifier.restorePurchasesButton.asString].tap()
return self
}
@discardableResult func tapLogOutButton() -> Self {
- app.buttons[AccessibilityIdentifier.logoutButton.rawValue].tap()
+ app.buttons[AccessibilityIdentifier.logoutButton.asString].tap()
return self
}
@discardableResult func tapDeleteAccountButton() -> Self {
- app.buttons[AccessibilityIdentifier.deleteButton.rawValue].tap()
+ app.buttons[AccessibilityIdentifier.deleteButton.asString].tap()
return self
}
diff --git a/ios/MullvadVPNUITests/Pages/DeviceManagementPage.swift b/ios/MullvadVPNUITests/Pages/DeviceManagementPage.swift
index 68340a260f..881d402b63 100644
--- a/ios/MullvadVPNUITests/Pages/DeviceManagementPage.swift
+++ b/ios/MullvadVPNUITests/Pages/DeviceManagementPage.swift
@@ -19,7 +19,7 @@ class DeviceManagementPage: Page {
@discardableResult func tapRemoveDeviceButton(cellIndex: Int) -> Self {
app
- .otherElements.matching(identifier: AccessibilityIdentifier.deviceCell.rawValue).element(boundBy: cellIndex)
+ .otherElements.matching(identifier: AccessibilityIdentifier.deviceCell.asString).element(boundBy: cellIndex)
.buttons[AccessibilityIdentifier.deviceCellRemoveButton]
.tap()
diff --git a/ios/MullvadVPNUITests/Pages/SelectLocationPage.swift b/ios/MullvadVPNUITests/Pages/SelectLocationPage.swift
index db401a0305..25a82588ea 100644
--- a/ios/MullvadVPNUITests/Pages/SelectLocationPage.swift
+++ b/ios/MullvadVPNUITests/Pages/SelectLocationPage.swift
@@ -30,7 +30,7 @@ class SelectLocationPage: Page {
}
@discardableResult func tapCountryLocationCellExpandButton(withIndex: Int) -> Self {
- let cell = app.cells.containing(.any, identifier: AccessibilityIdentifier.countryLocationCell.rawValue)
+ let cell = app.cells.containing(.any, identifier: AccessibilityIdentifier.countryLocationCell.asString)
.element(boundBy: withIndex)
let expandButton = cell.buttons[AccessibilityIdentifier.expandButton]
expandButton.tap()
@@ -38,7 +38,7 @@ class SelectLocationPage: Page {
}
@discardableResult func tapCityLocationCellExpandButton(withIndex: Int) -> Self {
- let cell = app.cells.containing(.any, identifier: AccessibilityIdentifier.cityLocationCell.rawValue)
+ let cell = app.cells.containing(.any, identifier: AccessibilityIdentifier.cityLocationCell.asString)
.element(boundBy: withIndex)
let expandButton = cell.buttons[AccessibilityIdentifier.expandButton]
expandButton.tap()
@@ -46,7 +46,7 @@ class SelectLocationPage: Page {
}
@discardableResult func tapRelayLocationCell(withIndex: Int) -> Self {
- let cell = app.cells.containing(.any, identifier: AccessibilityIdentifier.relayLocationCell.rawValue)
+ let cell = app.cells.containing(.any, identifier: AccessibilityIdentifier.relayLocationCell.asString)
.element(boundBy: withIndex)
cell.tap()
return self
@@ -79,7 +79,7 @@ class SelectLocationPage: Page {
_ = app.buttons[.openCustomListsMenuButton].waitForExistence(timeout: BaseUITestCase.shortTimeout)
let customListEllipsisButtons = app.buttons
- .matching(identifier: AccessibilityIdentifier.openCustomListsMenuButton.rawValue).allElementsBoundByIndex
+ .matching(identifier: AccessibilityIdentifier.openCustomListsMenuButton.asString).allElementsBoundByIndex
// This is a workaround for an issue we have with the ellipsis showing up multiple times in the accessibility hieararchy even though in the view hierarchy there is only one
// Only the actually visual one is hittable, so only the visible button will be tapped
diff --git a/ios/MullvadVPNUITests/Pages/VPNSettingsPage.swift b/ios/MullvadVPNUITests/Pages/VPNSettingsPage.swift
index c47897c41b..33a8023ca6 100644
--- a/ios/MullvadVPNUITests/Pages/VPNSettingsPage.swift
+++ b/ios/MullvadVPNUITests/Pages/VPNSettingsPage.swift
@@ -19,7 +19,7 @@ class VPNSettingsPage: Page {
_ subButtonAccessibilityIdentifier: AccessibilityIdentifier
) -> XCUIElement {
let tableView = app.tables[AccessibilityIdentifier.vpnSettingsTableView]
- let matchingCells = tableView.otherElements[cellAccessiblityIdentifier.rawValue]
+ let matchingCells = tableView.otherElements[cellAccessiblityIdentifier.asString]
let expandButton = matchingCells.buttons[subButtonAccessibilityIdentifier]
let lastCell = tableView.cells.allElementsBoundByIndex.last!
tableView.scrollDownToElement(element: lastCell)
diff --git a/ios/MullvadVPNUITests/XCUIElementQuery+Extensions.swift b/ios/MullvadVPNUITests/XCUIElementQuery+Extensions.swift
index 509ec7d0da..e4363bf20e 100644
--- a/ios/MullvadVPNUITests/XCUIElementQuery+Extensions.swift
+++ b/ios/MullvadVPNUITests/XCUIElementQuery+Extensions.swift
@@ -15,6 +15,6 @@ extension XCUIElementQuery {
}
subscript(key: AccessibilityIdentifier) -> XCUIElement {
- self[key.rawValue]
+ self[key.asString]
}
}