mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-02 21:33:26 +00:00
Bootstrap custom version of the app for UI tests
This commit is contained in:
@@ -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()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
//
|
||||
// ElementXUITests.swift
|
||||
// ElementXUITests
|
||||
//
|
||||
// Created by Stefan Ceriu on 11.02.2022.
|
||||
//
|
||||
|
||||
import XCTest
|
||||
|
||||
class ElementXUITests: XCTestCase {
|
||||
|
||||
}
|
||||
@@ -15,3 +15,15 @@
|
||||
//
|
||||
|
||||
import XCTest
|
||||
|
||||
class LoginScreenUITests: XCTestCase {
|
||||
func testInitialStateComponents() {
|
||||
let app = Application.launch()
|
||||
app.goToScreenWithIdentifier("Login screen")
|
||||
|
||||
XCTAssert(app.staticTexts["Login"].exists)
|
||||
XCTAssert(app.buttons["Login"].exists)
|
||||
XCTAssert(app.textFields["Username"].exists)
|
||||
XCTAssert(app.secureTextFields["Password"].exists)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user