diff --git a/PHP Monitor.xcodeproj/xcshareddata/xcschemes/PHP Monitor DEV.xcscheme b/PHP Monitor.xcodeproj/xcshareddata/xcschemes/PHP Monitor DEV.xcscheme index 83de33d..1418749 100644 --- a/PHP Monitor.xcodeproj/xcshareddata/xcschemes/PHP Monitor DEV.xcscheme +++ b/PHP Monitor.xcodeproj/xcshareddata/xcschemes/PHP Monitor DEV.xcscheme @@ -80,6 +80,10 @@ + + diff --git a/phpmon/Common/Testables/TestableConfigurations.swift b/phpmon/Common/Testables/TestableConfigurations.swift index 40444f6..e36e447 100644 --- a/phpmon/Common/Testables/TestableConfigurations.swift +++ b/phpmon/Common/Testables/TestableConfigurations.swift @@ -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: [:] ) diff --git a/tests/ui/UI_Tests.swift b/tests/ui/UI_Tests.swift index 1224f2e..f929869 100644 --- a/tests/ui/UI_Tests.swift +++ b/tests/ui/UI_Tests.swift @@ -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() + } }