Bootstrap custom version of the app for UI tests

This commit is contained in:
Stefan Ceriu
2022-04-29 10:11:42 +03:00
parent cfd0b14c81
commit 0faac20b04
7 changed files with 114 additions and 22 deletions
+15 -1
View File
@@ -9,9 +9,23 @@
import XCTest
struct Application {
func launch() {
static func launch() -> XCUIApplication {
let app = XCUIApplication()
app.launchEnvironment = ["IS_RUNNING_UI_TESTS": "1"]
app.launch()
return app
}
}
extension XCUIApplication {
func goToScreenWithIdentifier(_ identifier: String) {
let button = self.buttons[identifier]
let lastLabel = staticTexts["lastItem"]
while !button.isHittable && !lastLabel.isHittable {
self.tables.firstMatch.swipeUp()
}
button.tap()
}
}