Skip to content

Commit

Permalink
Merge branch 'main' into IOS-962-AccessibilityIdentifier-refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
acb-mv authored Dec 6, 2024
2 parents 1e1278f + 4baba02 commit 2c4523b
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 5 deletions.
7 changes: 5 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,15 @@ Line wrap the file at 100 chars. Th

## [Unreleased]
### Added
- Add a new access method: Encrypted DNS Proxy. Encrypted DNS proxy is a way to reach the API via
proxies. The access method is enabled by default.

#### Windows
- Add experimental support for Windows ARM64.

## [2024.9-beta1] - 2024-12-05
### Added
- Add a new access method: Encrypted DNS Proxy. Encrypted DNS proxy is a way to reach the API via
proxies. The access method is enabled by default.

#### macOS
- Detect whether full disk access is enabled in the split tunneling view.
- Add button to restart system service in split tunneling view. This can help mitigate edge-case
Expand Down
2 changes: 1 addition & 1 deletion dist-assets/desktop-product-version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2024.8
2024.9-beta1
1 change: 1 addition & 0 deletions ios/MullvadVPN/Classes/AccessbilityIdentifier.swift
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ public enum AccessibilityIdentifier: Equatable {
case listCustomListDoneButton
case selectLocationFilterButton
case relayFilterChipCloseButton
case openPortSelectorMenuButton

// Cells
case deviceCell
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ class SelectableSettingsDetailsCell: SelectableSettingsCell {
.withRenderingMode(.alwaysOriginal)
.withTintColor(.white)
actionButton.configuration = actionButtonConfiguration
actionButton.accessibilityIdentifier = .openPortSelectorMenuButton

Check failure on line 25 in ios/MullvadVPN/View controllers/Settings/SelectableSettingsDetailsCell.swift

View workflow job for this annotation

GitHub Actions / Unit tests

type 'String?' has no member 'openPortSelectorMenuButton'

actionButton.addTarget(
self,
Expand Down
31 changes: 29 additions & 2 deletions ios/MullvadVPNUITests/Pages/VPNSettingsPage.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,26 @@ class VPNSettingsPage: Page {
super.init(app)
}

private func cellExpandButton(_ cellAccessiblityIdentifier: AccessibilityIdentifier) -> XCUIElement {
private func cellSubButton(
_ cellAccessiblityIdentifier: AccessibilityIdentifier,
_ subButtonAccessibilityIdentifier: AccessibilityIdentifier
) -> XCUIElement {
let tableView = app.tables[AccessibilityIdentifier.vpnSettingsTableView]
let matchingCells = tableView.otherElements[cellAccessiblityIdentifier.asString]
let expandButton = matchingCells.buttons[AccessibilityIdentifier.expandButton]
let expandButton = matchingCells.buttons[subButtonAccessibilityIdentifier]
let lastCell = tableView.cells.allElementsBoundByIndex.last!
tableView.scrollDownToElement(element: lastCell)
return expandButton
}

private func cellExpandButton(_ cellAccessiblityIdentifier: AccessibilityIdentifier) -> XCUIElement {
return cellSubButton(cellAccessiblityIdentifier, .expandButton)
}

private func cellPortSelectorButton(_ cellAccessiblityIdentifier: AccessibilityIdentifier) -> XCUIElement {
return cellSubButton(cellAccessiblityIdentifier, .openPortSelectorMenuButton)
}

@discardableResult func tapBackButton() -> Self {
// Workaround for setting accessibility identifier on navigation bar button being non-trivial
app.buttons.matching(identifier: "Settings").allElementsBoundByIndex.last?.tap()
Expand All @@ -48,24 +59,40 @@ class VPNSettingsPage: Page {
return self
}

@discardableResult func tapUDPOverTCPPortSelectorButton() -> Self {
cellPortSelectorButton(AccessibilityIdentifier.wireGuardObfuscationUdpOverTcp).tap()

return self
}

@discardableResult func tapShadowsocksPortSelectorButton() -> Self {
cellPortSelectorButton(AccessibilityIdentifier.wireGuardObfuscationShadowsocks).tap()

return self
}

// this button no longer exists
@discardableResult func tapUDPOverTCPPortExpandButton() -> Self {
cellExpandButton(AccessibilityIdentifier.udpOverTCPPortCell).tap()

return self
}

// this button no longer exists
@discardableResult func tapUDPOverTCPPortAutomaticCell() -> Self {
app.cells["\(AccessibilityIdentifier.wireGuardObfuscationPort)Automatic"]
.tap()
return self
}

// this button no longer exists
@discardableResult func tapUDPOverTCPPort80Cell() -> Self {
app.cells["\(AccessibilityIdentifier.wireGuardObfuscationPort)80"]
.tap()
return self
}

// this button no longer exists
@discardableResult func tapUDPOverTCPPort5001Cell() -> Self {
app.cells["\(AccessibilityIdentifier.wireGuardObfuscationPort)5001"]
.tap()
Expand Down

0 comments on commit 2c4523b

Please sign in to comment.