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:
@ -80,6 +80,10 @@
|
||||
</CommandLineArgument>
|
||||
<CommandLineArgument
|
||||
argument = "--configuration:working"
|
||||
isEnabled = "NO">
|
||||
</CommandLineArgument>
|
||||
<CommandLineArgument
|
||||
argument = "--configuration:broken"
|
||||
isEnabled = "YES">
|
||||
</CommandLineArgument>
|
||||
</CommandLineArguments>
|
||||
|
@ -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: [:]
|
||||
)
|
||||
|
@ -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