mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-24 02:22:44 +02:00
Switch the CI to code 14 and the iOS 14 simulator, fix UI tests
This commit is contained in:
committed by
Stefan Ceriu
parent
8334fa1e69
commit
7daa4f121e
@@ -20,16 +20,33 @@ import XCTest
|
||||
extension XCUIApplication {
|
||||
func goToScreenWithIdentifier(_ identifier: String) {
|
||||
// Search for the screen identifier
|
||||
textFields["searchQueryTextField"].tap()
|
||||
typeText(identifier)
|
||||
|
||||
let textField = textFields["searchQueryTextField"]
|
||||
let button = buttons[identifier]
|
||||
let footer = staticTexts["footerText"]
|
||||
|
||||
while !button.isHittable, !footer.isHittable {
|
||||
tables.firstMatch.swipeUp()
|
||||
// Sometimes the search gets stuck without showing any results. Try to nudge it along
|
||||
for _ in 0...10 {
|
||||
textField.clearAndTypeText(identifier)
|
||||
if button.exists {
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
button.tap()
|
||||
}
|
||||
}
|
||||
|
||||
private extension XCUIElement {
|
||||
func clearAndTypeText(_ text: String) {
|
||||
guard let stringValue = value as? String else {
|
||||
XCTFail("Tried to clear and type text into a non string value")
|
||||
return
|
||||
}
|
||||
|
||||
tap()
|
||||
|
||||
let deleteString = String(repeating: XCUIKeyboardKey.delete.rawValue, count: stringValue.count)
|
||||
|
||||
typeText(deleteString)
|
||||
typeText(text)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user