Skip to content

Commit

Permalink
Make tests less ambiguous
Browse files Browse the repository at this point in the history
  • Loading branch information
acb-mv committed Jan 2, 2025
1 parent 5fa64e8 commit b52988e
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ class ShadowsocksObfuscationSettingsPage: Page {
customCell.textFields.firstMatch
}

@discardableResult func tapPortCell(_ index: Int) -> Self {
portCell(index).tap()
@discardableResult func tapAutomaticPortCell() -> Self {
portCell(0).tap()
return self
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,18 @@ class UDPOverTCPObfuscationSettingsPage: Page {
table.cells.element(boundBy: index)
}

@discardableResult func tapPortCell(_ index: Int) -> Self {
portCell(index).tap()
@discardableResult func tapAutomaticPortCell() -> Self {
portCell(0).tap()
return self
}

@discardableResult func tapPort80Cell() -> Self {
portCell(1).tap()
return self
}

@discardableResult func tapPort5001Cell() -> Self {
portCell(2).tap()
return self
}

Expand Down
2 changes: 1 addition & 1 deletion ios/MullvadVPNUITests/Pages/VPNSettingsPage.swift
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ class VPNSettingsPage: Page {

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

Expand Down
6 changes: 3 additions & 3 deletions ios/MullvadVPNUITests/SettingsMigrationTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -138,13 +138,13 @@ class SettingsMigrationTests: BaseUITestCase {
.tapUDPOverTCPPortSelectorButton()

UDPOverTCPObfuscationSettingsPage(app)
.tapPortCell(2)
.tapPortCell(1)
.tapPort5001Cell()
.tapPort80Cell()
.tapBackButton()
VPNSettingsPage(app)
.tapShadowsocksPortSelectorButton()
ShadowsocksObfuscationSettingsPage(app)
.tapPortCell(0)
.tapAutomaticPortCell()
.tapCustomCell()
.enterText("1234")
.tapBackButton()
Expand Down

0 comments on commit b52988e

Please sign in to comment.