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:
@ -80,6 +80,10 @@
|
|||||||
</CommandLineArgument>
|
</CommandLineArgument>
|
||||||
<CommandLineArgument
|
<CommandLineArgument
|
||||||
argument = "--configuration:working"
|
argument = "--configuration:working"
|
||||||
|
isEnabled = "NO">
|
||||||
|
</CommandLineArgument>
|
||||||
|
<CommandLineArgument
|
||||||
|
argument = "--configuration:broken"
|
||||||
isEnabled = "YES">
|
isEnabled = "YES">
|
||||||
</CommandLineArgument>
|
</CommandLineArgument>
|
||||||
</CommandLineArguments>
|
</CommandLineArguments>
|
||||||
|
@ -33,6 +33,7 @@ class TestableConfigurations {
|
|||||||
"id -un" : .instant("username"),
|
"id -un" : .instant("username"),
|
||||||
"php -v" : .instant(""),
|
"php -v" : .instant(""),
|
||||||
"ls /opt/homebrew/opt | grep php" : .instant(""),
|
"ls /opt/homebrew/opt | grep php" : .instant(""),
|
||||||
|
"valet --version" : .instant("zsh: command not found: valet")
|
||||||
],
|
],
|
||||||
commandOutput: [:]
|
commandOutput: [:]
|
||||||
)
|
)
|
||||||
|
@ -21,6 +21,21 @@ final class UI_Tests: XCTestCase {
|
|||||||
let app = XCUIApplication()
|
let app = XCUIApplication()
|
||||||
app.launchArguments = ["--configuration:working"]
|
app.launchArguments = ["--configuration:working"]
|
||||||
app.launch()
|
app.launch()
|
||||||
|
// XCTAssert(app.dialogs["Notice"].waitForExistence(timeout: 5))
|
||||||
sleep(10)
|
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