Skip to content

Commit f6c8edc

Browse files
committed
Change RelayTests to recognise the tristate multihop UI
1 parent a0012e8 commit f6c8edc

File tree

3 files changed

+11
-4
lines changed

3 files changed

+11
-4
lines changed

ios/MullvadVPN/Coordinators/Settings/Multihop/SettingsMultihopView.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,12 +68,13 @@ struct SettingsMultihopView<ViewModel>: View where ViewModel: TunnelSettingsObse
6868
: Color(UIColor.Cell.titleTextColor)
6969
)
7070
Spacer().frame(width: UIMetrics.SettingsCell.selectableSettingsCellLeftViewSpacing)
71-
Text(option.label)
71+
Button(option.label, action: {tunnelViewModel.value = option.id})
7272
.foregroundStyle(
7373
(tunnelViewModel.value == option.id)
7474
? Color(UIColor.Cell.Background.selected)
7575
: Color(UIColor.Cell.titleTextColor)
7676
)
77+
.accessibilityIdentifier(option.accessibilityIdentifier.asString)
7778
Spacer()
7879
}
7980
.padding(EdgeInsets(UIMetrics.SettingsCell.defaultLayoutMargins))
@@ -112,7 +113,6 @@ struct SettingsMultihopView<ViewModel>: View where ViewModel: TunnelSettingsObse
112113
.onTapGesture {
113114
tunnelViewModel.value = option.id
114115
}
115-
.accessibilityIdentifier(option.accessibilityIdentifier.asString)
116116
}
117117
}
118118
.cornerRadius(16)

ios/MullvadVPNUITests/Pages/MultihopPage.swift

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ class MultihopPage: Page {
2727
return self
2828
}
2929

30+
// the old on/off UI; delete once we get rid of the code
3031
@discardableResult func tapEnableSwitch() -> Self {
3132
app.switches[AccessibilityIdentifier.multihopSwitch].tap()
3233
return self
@@ -40,4 +41,10 @@ class MultihopPage: Page {
4041
}
4142
return self
4243
}
44+
45+
// the new, tristate UI
46+
@discardableResult func tapMultihopAlways() -> Self {
47+
app.buttons[AccessibilityIdentifier.multihopAlways].tap()
48+
return self
49+
}
4350
}

ios/MullvadVPNUITests/RelayTests.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -533,7 +533,7 @@ class RelayTests: LoggedInWithTimeUITestCase {
533533

534534
MultihopPage(app)
535535
.verifyOnePage()
536-
.tapEnableSwitch()
536+
.tapMultihopAlways()
537537
.tapBackButton()
538538

539539
SettingsPage(app)
@@ -561,7 +561,7 @@ class RelayTests: LoggedInWithTimeUITestCase {
561561

562562
MultihopPage(app)
563563
.verifyOnePage()
564-
.tapEnableSwitch()
564+
.tapMultihopAlways()
565565
.tapBackButton()
566566

567567
SettingsPage(app)

0 commit comments

Comments
 (0)