Skip to content

Commit

Permalink
Fix testVerifySettingsStillChanged to work with new UI
Browse files Browse the repository at this point in the history
  • Loading branch information
acb-mv committed Dec 19, 2024
1 parent 9512e26 commit db2bc11
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 3 deletions.
2 changes: 2 additions & 0 deletions ios/MullvadVPN/Classes/AccessbilityIdentifier.swift
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,8 @@ public enum AccessibilityIdentifier: Equatable {
case wireGuardObfuscationOff
case wireGuardObfuscationUdpOverTcp
case wireGuardObfuscationShadowsocks
case wireGuardObfuscationUdpOverTcpPort
case wireGuardObfuscationShadowsocksPort
case wireGuardPort(UInt16?)
case udpOverTcpObfuscationSettings

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ final class VPNSettingsCellFactory: CellFactoryProtocol {

// swiftlint:disable:next cyclomatic_complexity function_body_length
func configureCell(_ cell: UITableViewCell, item: VPNSettingsDataSource.Item, indexPath: IndexPath) {
(cell as? SettingsCell)?.detailTitleLabel.accessibilityIdentifier = nil
switch item {
case .dnsSettings:
guard let cell = cell as? SettingsCell else { return }
Expand Down Expand Up @@ -154,6 +155,7 @@ final class VPNSettingsCellFactory: CellFactoryProtocol {
), viewModel.obfuscationUpdOverTcpPort.description)

cell.setAccessibilityIdentifier(item.accessibilityIdentifier)
cell.detailTitleLabel.setAccessibilityIdentifier(.wireGuardObfuscationUdpOverTcpPort)
cell.applySubCellStyling()

cell.buttonAction = { [weak self] in
Expand All @@ -178,6 +180,7 @@ final class VPNSettingsCellFactory: CellFactoryProtocol {
), viewModel.obfuscationShadowsocksPort.description)

cell.setAccessibilityIdentifier(item.accessibilityIdentifier)
cell.detailTitleLabel.setAccessibilityIdentifier(.wireGuardObfuscationShadowsocksPort)
cell.applySubCellStyling()

cell.buttonAction = { [weak self] in
Expand Down
4 changes: 2 additions & 2 deletions ios/MullvadVPNUITests/Pages/VPNSettingsPage.swift
Original file line number Diff line number Diff line change
Expand Up @@ -179,8 +179,8 @@ class VPNSettingsPage: Page {
}

@discardableResult func verifyUDPOverTCPPort80Selected() -> Self {
let cell = app.cells["\(AccessibilityIdentifier.wireGuardObfuscationPort)80"]
XCTAssertTrue(cell.isSelected)
let detailLabel = app.staticTexts[AccessibilityIdentifier.wireGuardObfuscationUdpOverTcpPort]
XCTAssertTrue(detailLabel.label.hasSuffix("80"))
return self
}

Expand Down
1 change: 0 additions & 1 deletion ios/MullvadVPNUITests/SettingsMigrationTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,6 @@ class SettingsMigrationTests: BaseUITestCase {
.verifyCustomWireGuardPortSelected(portNumber: wireGuardPort)
.tapWireGuardObfuscationExpandButton()
.verifyWireGuardObfuscationOnSelected()
.tapUDPOverTCPPortExpandButton()
.verifyUDPOverTCPPort80Selected()
.tapQuantumResistantTunnelExpandButton()
.verifyQuantumResistantTunnelOnSelected()
Expand Down

0 comments on commit db2bc11

Please sign in to comment.