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

👌 Read configuration from JSON file

This allows us to alter the configuration prior to launching the app,
which allows for additional flexibility during testing.
This commit is contained in:
2022-10-16 14:35:19 +02:00
parent 273070ef27
commit 5e3e0c087b
16 changed files with 602 additions and 102 deletions

View File

@ -1,5 +1,5 @@
//
// UI_Tests.swift
// StartupTest.swift
// UI Tests
//
// Created by Nico Verbruggen on 14/10/2022.
@ -17,14 +17,18 @@ final class StartupTest: UITestCase {
override func tearDownWithError() throws {}
func testApplicationCanLaunchWithTestConfigurationAndIdles() throws {
let app = XCUIApplication()
app.launchArguments = ["--configuration:working"]
let app = XCPMApplication()
app.withConfiguration(TestableConfigurations.working)
app.launch()
sleep(5)
}
func testApplicationCanLaunchWithTestConfigurationAndThrowsAlert() throws {
let app = XCUIApplication()
app.launchArguments = ["--configuration:broken"]
var configuration = TestableConfigurations.working
configuration.filesystem["/opt/homebrew/bin/php"] = nil // PHP binary must be missing
let app = XCPMApplication()
app.withConfiguration(configuration)
app.launch()
// Dialog 1: "PHP is not correctly installed"