summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorMojgan <mojgan.jelodar@mullvad.net>2026-01-15 12:11:08 +0100
committerEmīls <emils@mullvad.net>2026-01-15 15:21:12 +0100
commitaa5830caa971dabba8a1741bade802c79bc2a4f8 (patch)
tree2be2b1b9cc3ea7ddb9da08996bc12d9b5b638452
parent4e030c5cce2c3b256902a44ad9e273b2adf61829 (diff)
downloadmullvadvpn-aa5830caa971dabba8a1741bade802c79bc2a4f8.tar.xz
mullvadvpn-aa5830caa971dabba8a1741bade802c79bc2a4f8.zip
Fix custom list test issues
-rw-r--r--ios/MullvadVPNUITests/Pages/CustomListPage.swift16
-rw-r--r--ios/MullvadVPNUITests/XCUIElement+Extensions.swift13
2 files changed, 18 insertions, 11 deletions
diff --git a/ios/MullvadVPNUITests/Pages/CustomListPage.swift b/ios/MullvadVPNUITests/Pages/CustomListPage.swift
index 002a99e976..310ba1811a 100644
--- a/ios/MullvadVPNUITests/Pages/CustomListPage.swift
+++ b/ios/MullvadVPNUITests/Pages/CustomListPage.swift
@@ -35,16 +35,8 @@ class CustomListPage: Page {
@discardableResult func renameCustomList(name: String) -> Self {
let editCustomListNameCell = app.cells[.customListEditNameFieldCell]
- // Activate the text field
- editCustomListNameCell.tap()
- // Select the entire text with a triple tap
- editCustomListNameCell.tap(withNumberOfTaps: 3, numberOfTouches: 1)
- // Tap the "delete" key on the on-screen keyboard, the case is sensitive.
- // However, on a simulator the keyboard isn't visible by default, so we
- // need to take that into consideration.
- if app.keys["delete"].isHittable {
- app.keys["delete"].tap()
- }
+ let textField = editCustomListNameCell.textFields.firstMatch
+ textField.clearText(app: app)
editCustomListNameCell.typeText(name)
return self
}
@@ -52,7 +44,9 @@ class CustomListPage: Page {
@discardableResult func deleteCustomList(named customListName: String) -> Self {
let deleteCustomListCell = app.cells[.customListEditDeleteListCell]
deleteCustomListCell.tap()
- app.buttons[.confirmDeleteCustomListButton].tap()
+
+ app.buttons[AccessibilityIdentifier.confirmDeleteCustomListButton].tapWhenHittable()
+
return self
}
diff --git a/ios/MullvadVPNUITests/XCUIElement+Extensions.swift b/ios/MullvadVPNUITests/XCUIElement+Extensions.swift
index c6f951d2c4..bcddd55042 100644
--- a/ios/MullvadVPNUITests/XCUIElement+Extensions.swift
+++ b/ios/MullvadVPNUITests/XCUIElement+Extensions.swift
@@ -220,3 +220,16 @@ extension XCUIElement {
return false
}
}
+
+extension XCUIElement {
+ func clearText(app: XCUIApplication) {
+ tap()
+ press(forDuration: 1.0)
+
+ let selectAll = app.menuItems["Select All"]
+ if selectAll.existsAfterWait() {
+ selectAll.tap()
+ typeText(XCUIKeyboardKey.delete.rawValue)
+ }
+ }
+}