@@ -14,15 +14,26 @@ class VPNSettingsPage: Page {
14
14
super. init ( app)
15
15
}
16
16
17
- private func cellExpandButton( _ cellAccessiblityIdentifier: AccessibilityIdentifier ) -> XCUIElement {
17
+ private func cellSubButton(
18
+ _ cellAccessiblityIdentifier: AccessibilityIdentifier ,
19
+ _ subButtonAccessibilityIdentifier: AccessibilityIdentifier
20
+ ) -> XCUIElement {
18
21
let tableView = app. tables [ AccessibilityIdentifier . vpnSettingsTableView]
19
22
let matchingCells = tableView. otherElements [ cellAccessiblityIdentifier. rawValue]
20
- let expandButton = matchingCells. buttons [ AccessibilityIdentifier . expandButton ]
23
+ let expandButton = matchingCells. buttons [ subButtonAccessibilityIdentifier ]
21
24
let lastCell = tableView. cells. allElementsBoundByIndex. last!
22
25
tableView. scrollDownToElement ( element: lastCell)
23
26
return expandButton
24
27
}
25
28
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
+
26
37
@discardableResult func tapBackButton( ) -> Self {
27
38
// Workaround for setting accessibility identifier on navigation bar button being non-trivial
28
39
app. buttons. matching ( identifier: " Settings " ) . allElementsBoundByIndex. last? . tap ( )
@@ -48,24 +59,40 @@ class VPNSettingsPage: Page {
48
59
return self
49
60
}
50
61
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
51
75
@discardableResult func tapUDPOverTCPPortExpandButton( ) -> Self {
52
76
cellExpandButton ( AccessibilityIdentifier . udpOverTCPPortCell) . tap ( )
53
77
54
78
return self
55
79
}
56
80
81
+ // this button no longer exists
57
82
@discardableResult func tapUDPOverTCPPortAutomaticCell( ) -> Self {
58
83
app. cells [ " \( AccessibilityIdentifier . wireGuardObfuscationPort) Automatic " ]
59
84
. tap ( )
60
85
return self
61
86
}
62
87
88
+ // this button no longer exists
63
89
@discardableResult func tapUDPOverTCPPort80Cell( ) -> Self {
64
90
app. cells [ " \( AccessibilityIdentifier . wireGuardObfuscationPort) 80 " ]
65
91
. tap ( )
66
92
return self
67
93
}
68
94
95
+ // this button no longer exists
69
96
@discardableResult func tapUDPOverTCPPort5001Cell( ) -> Self {
70
97
app. cells [ " \( AccessibilityIdentifier . wireGuardObfuscationPort) 5001 " ]
71
98
. tap ( )
0 commit comments