1
0
mirror of https://github.com/nicoverbruggen/phpmon.git synced 2025-08-07 20:10: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

@ -80,6 +80,10 @@
</CommandLineArgument>
<CommandLineArgument
argument = "--configuration:working"
isEnabled = "NO">
</CommandLineArgument>
<CommandLineArgument
argument = "--configuration:broken"
isEnabled = "YES">
</CommandLineArgument>
</CommandLineArguments>

View File

@ -33,6 +33,7 @@ class TestableConfigurations {
"id -un" : .instant("username"),
"php -v" : .instant(""),
"ls /opt/homebrew/opt | grep php" : .instant(""),
"valet --version" : .instant("zsh: command not found: valet")
],
commandOutput: [:]
)

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()
}
}