diff --git a/ios/MullvadVPN/Coordinators/Settings/Multihop/SettingsMultihopView.swift b/ios/MullvadVPN/Coordinators/Settings/Multihop/SettingsMultihopView.swift index ed09016f11d4..b381738e2e90 100644 --- a/ios/MullvadVPN/Coordinators/Settings/Multihop/SettingsMultihopView.swift +++ b/ios/MullvadVPN/Coordinators/Settings/Multihop/SettingsMultihopView.swift @@ -68,12 +68,13 @@ struct SettingsMultihopView: View where ViewModel: TunnelSettingsObse : Color(UIColor.Cell.titleTextColor) ) Spacer().frame(width: UIMetrics.SettingsCell.selectableSettingsCellLeftViewSpacing) - Text(option.label) + Button(option.label, action: { tunnelViewModel.value = option.id }) .foregroundStyle( (tunnelViewModel.value == option.id) ? Color(UIColor.Cell.Background.selected) : Color(UIColor.Cell.titleTextColor) ) + .accessibilityIdentifier(option.accessibilityIdentifier.asString) Spacer() } .padding(EdgeInsets(UIMetrics.SettingsCell.defaultLayoutMargins)) @@ -112,7 +113,6 @@ struct SettingsMultihopView: View where ViewModel: TunnelSettingsObse .onTapGesture { tunnelViewModel.value = option.id } - .accessibilityIdentifier(option.accessibilityIdentifier.asString) } } .cornerRadius(16) diff --git a/ios/MullvadVPNUITests/Pages/MultihopPage.swift b/ios/MullvadVPNUITests/Pages/MultihopPage.swift index 7db398812fb2..3d2ad94e2c31 100644 --- a/ios/MullvadVPNUITests/Pages/MultihopPage.swift +++ b/ios/MullvadVPNUITests/Pages/MultihopPage.swift @@ -27,6 +27,7 @@ class MultihopPage: Page { return self } + // the old on/off UI; delete once we get rid of the code @discardableResult func tapEnableSwitch() -> Self { app.switches[AccessibilityIdentifier.multihopSwitch].tap() return self @@ -40,4 +41,10 @@ class MultihopPage: Page { } return self } + + // the new, tristate UI + @discardableResult func tapMultihopAlways() -> Self { + app.buttons[AccessibilityIdentifier.multihopAlways].tap() + return self + } } diff --git a/ios/MullvadVPNUITests/RelayTests.swift b/ios/MullvadVPNUITests/RelayTests.swift index 558e7711e5fc..62dfec4afc73 100644 --- a/ios/MullvadVPNUITests/RelayTests.swift +++ b/ios/MullvadVPNUITests/RelayTests.swift @@ -533,7 +533,7 @@ class RelayTests: LoggedInWithTimeUITestCase { MultihopPage(app) .verifyOnePage() - .tapEnableSwitch() + .tapMultihopAlways() .tapBackButton() SettingsPage(app) @@ -561,7 +561,7 @@ class RelayTests: LoggedInWithTimeUITestCase { MultihopPage(app) .verifyOnePage() - .tapEnableSwitch() + .tapMultihopAlways() .tapBackButton() SettingsPage(app)