diff options
| author | Andrew Bulhak <andrew.bulhak@mullvad.net> | 2024-12-04 16:36:10 +0100 |
|---|---|---|
| committer | Andrew Bulhak <andrew.bulhak@mullvad.net> | 2024-12-04 16:36:10 +0100 |
| commit | 60b03252da0f46f6a6f603d7b9560ec58bb9986a (patch) | |
| tree | 77a523b0d8cf3fe929db7ee1ef10d906f9f75442 | |
| parent | 2aeee8d5ec57689fb10b6a8d5c4de1770bbf3817 (diff) | |
| download | mullvadvpn-add-OpenPortSelectorMenu-accessibility-id.tar.xz mullvadvpn-add-OpenPortSelectorMenu-accessibility-id.zip | |
Add the openPortSelectorMenuButton accessibility identifier to ... buttonsadd-OpenPortSelectorMenu-accessibility-id
4 files changed, 52 insertions, 2 deletions
diff --git a/ios/MullvadVPN/Classes/AccessbilityIdentifier.swift b/ios/MullvadVPN/Classes/AccessbilityIdentifier.swift index f916e7ae50..3bc31eef66 100644 --- a/ios/MullvadVPN/Classes/AccessbilityIdentifier.swift +++ b/ios/MullvadVPN/Classes/AccessbilityIdentifier.swift @@ -59,6 +59,7 @@ public enum AccessibilityIdentifier: String { case listCustomListDoneButton case selectLocationFilterButton case relayFilterChipCloseButton + case openPortSelectorMenuButton // Cells case deviceCell diff --git a/ios/MullvadVPN/View controllers/Settings/SelectableSettingsDetailsCell.swift b/ios/MullvadVPN/View controllers/Settings/SelectableSettingsDetailsCell.swift index 8f68c7d5ad..8869d7f0cf 100644 --- a/ios/MullvadVPN/View controllers/Settings/SelectableSettingsDetailsCell.swift +++ b/ios/MullvadVPN/View controllers/Settings/SelectableSettingsDetailsCell.swift @@ -22,6 +22,7 @@ class SelectableSettingsDetailsCell: SelectableSettingsCell { .withRenderingMode(.alwaysOriginal) .withTintColor(.white) actionButton.configuration = actionButtonConfiguration + actionButton.accessibilityIdentifier = .openPortSelectorMenuButton actionButton.addTarget( self, diff --git a/ios/MullvadVPNUITests/Pages/ShadowsocksObfuscationSettingsPage.swift b/ios/MullvadVPNUITests/Pages/ShadowsocksObfuscationSettingsPage.swift new file mode 100644 index 0000000000..f3ca81f414 --- /dev/null +++ b/ios/MullvadVPNUITests/Pages/ShadowsocksObfuscationSettingsPage.swift @@ -0,0 +1,21 @@ +// +// ShadowsocksObfuscationSettingsPage.swift +// MullvadVPNUITests +// +// Created by Andrew Bulhak on 2024-12-02. +// Copyright © 2024 Mullvad VPN AB. All rights reserved. +// + +import Foundation +import XCTest + +class ShadowsocksObfuscationSettingsPage: Page { + + @discardableResult override init(_ app: XCUIApplication) { + super.init(app) + + // is this right? + self.pageElement = app.otherElements[.settingsContainerView] + waitForPageToBeShown() + } +} diff --git a/ios/MullvadVPNUITests/Pages/VPNSettingsPage.swift b/ios/MullvadVPNUITests/Pages/VPNSettingsPage.swift index 11402ee684..d2432174ae 100644 --- a/ios/MullvadVPNUITests/Pages/VPNSettingsPage.swift +++ b/ios/MullvadVPNUITests/Pages/VPNSettingsPage.swift @@ -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.rawValue] - 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() @@ -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() |
