1
0
mirror of https://github.com/nicoverbruggen/phpmon.git synced 2025-08-07 03:50:08 +02:00

Make UI test actually functional

This commit is contained in:
2022-10-15 15:14:49 +02:00
parent eaf6ef658f
commit d401fe997d
3 changed files with 19 additions and 13 deletions

View File

@ -78,6 +78,10 @@
argument = "--v"
isEnabled = "NO">
</CommandLineArgument>
<CommandLineArgument
argument = "--configuration:working"
isEnabled = "YES">
</CommandLineArgument>
</CommandLineArguments>
<EnvironmentVariables>
<EnvironmentVariable

View File

@ -89,6 +89,17 @@ class AppDelegate: NSObject, NSApplicationDelegate, UNUserNotificationCenterDele
static func initializeTestingProfile(_ profile: String) {
Log.info("The profile `\(profile)` is being requested...")
switch profile {
case "broken":
Log.info("Applying broken PHP Monitor configuration profile!")
TestableConfigurations.broken.apply()
case "working":
Log.info("Applying working PHP Monitor configuration profile!")
TestableConfigurations.working.apply()
default:
assert(true, "No profile for this name is supported.")
}
}
// MARK: - Lifecycle

View File

@ -12,24 +12,15 @@ final class UI_Tests: XCTestCase {
override func setUpWithError() throws {
continueAfterFailure = false
TestableConfigurations.broken.apply()
}
override func tearDownWithError() throws {
}
override func tearDownWithError() throws {}
func testExample() throws {
func testApplicationCanLaunchWithTestConfigurationAndIdles() throws {
// UI tests must launch the application that they test.
let app = XCUIApplication()
app.launchArguments = ["--configuration:broken"]
app.launchArguments = ["--configuration:working"]
app.launch()
sleep(10)
}
/*
func testLaunchPerformance() throws {
measure(metrics: [XCTApplicationLaunchMetric()]) {
XCUIApplication().launch()
}
}
*/
}