Skip to content

Commit 4baba02

Browse files
committed
Merge branch 'add-OpenPortSelectorMenu-accessibility-identifier'
2 parents 1ad908b + ccaf4ed commit 4baba02

File tree

3 files changed

+31
-2
lines changed

3 files changed

+31
-2
lines changed

ios/MullvadVPN/Classes/AccessbilityIdentifier.swift

+1
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ public enum AccessibilityIdentifier: String {
5959
case listCustomListDoneButton
6060
case selectLocationFilterButton
6161
case relayFilterChipCloseButton
62+
case openPortSelectorMenuButton
6263

6364
// Cells
6465
case deviceCell

ios/MullvadVPN/View controllers/Settings/SelectableSettingsDetailsCell.swift

+1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ class SelectableSettingsDetailsCell: SelectableSettingsCell {
2222
.withRenderingMode(.alwaysOriginal)
2323
.withTintColor(.white)
2424
actionButton.configuration = actionButtonConfiguration
25+
actionButton.accessibilityIdentifier = .openPortSelectorMenuButton
2526

2627
actionButton.addTarget(
2728
self,

ios/MullvadVPNUITests/Pages/VPNSettingsPage.swift

+29-2
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,26 @@ class VPNSettingsPage: Page {
1414
super.init(app)
1515
}
1616

17-
private func cellExpandButton(_ cellAccessiblityIdentifier: AccessibilityIdentifier) -> XCUIElement {
17+
private func cellSubButton(
18+
_ cellAccessiblityIdentifier: AccessibilityIdentifier,
19+
_ subButtonAccessibilityIdentifier: AccessibilityIdentifier
20+
) -> XCUIElement {
1821
let tableView = app.tables[AccessibilityIdentifier.vpnSettingsTableView]
1922
let matchingCells = tableView.otherElements[cellAccessiblityIdentifier.rawValue]
20-
let expandButton = matchingCells.buttons[AccessibilityIdentifier.expandButton]
23+
let expandButton = matchingCells.buttons[subButtonAccessibilityIdentifier]
2124
let lastCell = tableView.cells.allElementsBoundByIndex.last!
2225
tableView.scrollDownToElement(element: lastCell)
2326
return expandButton
2427
}
2528

29+
private func cellExpandButton(_ cellAccessiblityIdentifier: AccessibilityIdentifier) -> XCUIElement {
30+
return cellSubButton(cellAccessiblityIdentifier, .expandButton)
31+
}
32+
33+
private func cellPortSelectorButton(_ cellAccessiblityIdentifier: AccessibilityIdentifier) -> XCUIElement {
34+
return cellSubButton(cellAccessiblityIdentifier, .openPortSelectorMenuButton)
35+
}
36+
2637
@discardableResult func tapBackButton() -> Self {
2738
// Workaround for setting accessibility identifier on navigation bar button being non-trivial
2839
app.buttons.matching(identifier: "Settings").allElementsBoundByIndex.last?.tap()
@@ -48,24 +59,40 @@ class VPNSettingsPage: Page {
4859
return self
4960
}
5061

62+
@discardableResult func tapUDPOverTCPPortSelectorButton() -> Self {
63+
cellPortSelectorButton(AccessibilityIdentifier.wireGuardObfuscationUdpOverTcp).tap()
64+
65+
return self
66+
}
67+
68+
@discardableResult func tapShadowsocksPortSelectorButton() -> Self {
69+
cellPortSelectorButton(AccessibilityIdentifier.wireGuardObfuscationShadowsocks).tap()
70+
71+
return self
72+
}
73+
74+
// this button no longer exists
5175
@discardableResult func tapUDPOverTCPPortExpandButton() -> Self {
5276
cellExpandButton(AccessibilityIdentifier.udpOverTCPPortCell).tap()
5377

5478
return self
5579
}
5680

81+
// this button no longer exists
5782
@discardableResult func tapUDPOverTCPPortAutomaticCell() -> Self {
5883
app.cells["\(AccessibilityIdentifier.wireGuardObfuscationPort)Automatic"]
5984
.tap()
6085
return self
6186
}
6287

88+
// this button no longer exists
6389
@discardableResult func tapUDPOverTCPPort80Cell() -> Self {
6490
app.cells["\(AccessibilityIdentifier.wireGuardObfuscationPort)80"]
6591
.tap()
6692
return self
6793
}
6894

95+
// this button no longer exists
6996
@discardableResult func tapUDPOverTCPPort5001Cell() -> Self {
7097
app.cells["\(AccessibilityIdentifier.wireGuardObfuscationPort)5001"]
7198
.tap()

0 commit comments

Comments
 (0)