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:
@ -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()
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user