-
Notifications
You must be signed in to change notification settings - Fork 355
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update UI tests for the new WG Obfuscation views
- Loading branch information
Showing
9 changed files
with
169 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
54 changes: 54 additions & 0 deletions
54
ios/MullvadVPNUITests/Pages/ShadowsocksObfuscationSettingsPage.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
// | ||
// ShadowsocksObfuscationSettingsPage.swift | ||
// MullvadVPN | ||
// | ||
// Created by Andrew Bulhak on 2024-12-18. | ||
// Copyright © 2024 Mullvad VPN AB. All rights reserved. | ||
// | ||
|
||
import Foundation | ||
import XCTest | ||
|
||
class ShadowsocksObfuscationSettingsPage: Page { | ||
@discardableResult override init(_ app: XCUIApplication) { | ||
super.init(app) | ||
} | ||
|
||
private var table: XCUIElement { | ||
app.collectionViews[AccessibilityIdentifier.wireGuardObfuscationShadowsocksTable] | ||
} | ||
|
||
private func portCell(_ index: Int) -> XCUIElement { | ||
table.cells.element(boundBy: index) | ||
} | ||
|
||
private var customCell: XCUIElement { | ||
// assumption: the last cell is the legend | ||
table.cells.allElementsBoundByIndex.dropLast().last! | ||
} | ||
|
||
private var customTextField: XCUIElement { | ||
customCell.textFields.firstMatch | ||
} | ||
|
||
@discardableResult func tapPortCell(_ index: Int) -> Self { | ||
portCell(index).tap() | ||
return self | ||
} | ||
|
||
@discardableResult func tapCustomCell() -> Self { | ||
customCell.tap() | ||
return self | ||
} | ||
|
||
@discardableResult func typeTextIntoCustomField(_ text: String) -> Self { | ||
customTextField.typeText(text) | ||
return self | ||
} | ||
|
||
@discardableResult func tapBackButton() -> Self { | ||
// Workaround for setting accessibility identifier on navigation bar button being non-trivial | ||
app.navigationBars.buttons.element(boundBy: 0).tap() | ||
return self | ||
} | ||
} |
35 changes: 35 additions & 0 deletions
35
ios/MullvadVPNUITests/Pages/UDPOverTCPObfuscationSettingsPage.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
// | ||
// UDPOverTCPObfuscationSettingsPage.swift | ||
// MullvadVPN | ||
// | ||
// Created by Andrew Bulhak on 2024-12-12. | ||
// Copyright © 2024 Mullvad VPN AB. All rights reserved. | ||
// | ||
|
||
import Foundation | ||
import XCTest | ||
|
||
class UDPOverTCPObfuscationSettingsPage: Page { | ||
@discardableResult override init(_ app: XCUIApplication) { | ||
super.init(app) | ||
} | ||
|
||
private var table: XCUIElement { | ||
app.collectionViews[AccessibilityIdentifier.wireGuardObfuscationUdpOverTcpTable] | ||
} | ||
|
||
private func portCell(_ index: Int) -> XCUIElement { | ||
table.cells.element(boundBy: index) | ||
} | ||
|
||
@discardableResult func tapPortCell(_ index: Int) -> Self { | ||
portCell(index).tap() | ||
return self | ||
} | ||
|
||
@discardableResult func tapBackButton() -> Self { | ||
// Workaround for setting accessibility identifier on navigation bar button being non-trivial | ||
app.navigationBars.buttons.element(boundBy: 0).tap() | ||
return self | ||
} | ||
} |
Oops, something went wrong.