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

Add UI test for PHP config editor

This commit is contained in:
2023-11-07 18:21:14 +01:00
parent 2f7223fba5
commit 641bddfce7
3 changed files with 14 additions and 4 deletions

View File

@ -128,10 +128,9 @@ extension MainMenu {
// Check if the linked version has changed between launches of phpmon
PhpGuard().compareToLastGlobalVersion()
// TODO: Move to a new dedicated module
// Scan which PHP extensions can be installed
let extensions = BrewTapFormulae.from(tap: "shivammathur/homebrew-extensions")["8.2"]!
print("The following extensions can be installed for this version of PHP: \(extensions)")
#warning("Move to a dedicated module and check if tap is installed first!")
// let extensions = BrewTapFormulae.from(tap: "shivammathur/homebrew-extensions")["8.2"]!
// print("The following extensions can be installed for this version of PHP: \(extensions)")
// We are ready!
Log.info("PHP Monitor is ready to serve!")

View File

@ -89,6 +89,7 @@ struct StatsView: View {
} label: {
Image(systemName: "gearshape.fill")
}
.accessibility(identifier: "phpConfigButton")
.focusable(false)
.frame(minWidth: 30, alignment: .center)
}

View File

@ -54,6 +54,16 @@ final class MainMenuTest: UITestCase {
app.mainMenuItem(withText: "mi_about".localized).click()
}
final func test_can_open_config_editor() throws {
let app = launch(openMenu: true)
app.buttons["phpConfigButton"].click()
Thread.sleep(forTimeInterval: 0.5)
assertExists(app.staticTexts["confman.title".localized], 1)
}
final func test_can_open_settings() throws {
let app = launch(openMenu: true)
app.mainMenuItem(withText: "mi_preferences".localized).click()