1
0
mirror of https://github.com/nicoverbruggen/phpmon.git synced 2025-08-07 03:50:08 +02:00

Real UI test

This commit is contained in:
2022-10-15 15:36:03 +02:00
parent d401fe997d
commit cb3208c008
3 changed files with 20 additions and 0 deletions

View File

@ -21,6 +21,21 @@ final class UI_Tests: XCTestCase {
let app = XCUIApplication()
app.launchArguments = ["--configuration:working"]
app.launch()
// XCTAssert(app.dialogs["Notice"].waitForExistence(timeout: 5))
sleep(10)
}
func testApplicationCanLaunchWithTestConfigurationAndThrowsAlert() throws {
// UI tests must launch the application that they test.
let app = XCUIApplication()
app.launchArguments = ["--configuration:broken"]
app.launch()
XCTAssert(app.dialogs["Notice"].waitForExistence(timeout: 5))
app.buttons["OK"].click()
XCTAssert(app.dialogs["Notice"].waitForExistence(timeout: 5))
XCTAssert(app.buttons["Quit"].waitForExistence(timeout: 1))
// If this UI test presses the "Quit" button, the test takes forever
// because Xcode will attempt to figure out if the app closed correctly.
app.terminate()
}
}