mirror of
https://github.com/nicoverbruggen/phpmon.git
synced 2025-12-21 03:10:06 +01:00
✅ Fix UI tests w/ new WebApi interactions
This commit is contained in:
@@ -13,6 +13,7 @@
|
||||
},
|
||||
"testTargets" : [
|
||||
{
|
||||
"enabled" : false,
|
||||
"parallelizable" : true,
|
||||
"target" : {
|
||||
"containerPath" : "container:PHP Monitor.xcodeproj",
|
||||
@@ -30,7 +31,6 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"enabled" : false,
|
||||
"target" : {
|
||||
"containerPath" : "container:PHP Monitor.xcodeproj",
|
||||
"identifier" : "C471E7BB28F9B90F0021E251",
|
||||
|
||||
@@ -138,36 +138,6 @@ class TestableConfigurations {
|
||||
: .instant(ShellStrings.shared.brewServicesAsRoot),
|
||||
"/opt/homebrew/bin/brew services info --all --json"
|
||||
: .instant(ShellStrings.shared.brewServicesAsUser),
|
||||
"curl -s --max-time 10 '\(Constants.Urls.UpdateCheckEndpoint.absoluteString)'"
|
||||
: .delayed(0.5, """
|
||||
cask 'phpmon-dev' do
|
||||
depends_on formula: 'gnu-sed'
|
||||
|
||||
version '25.08.0_1000'
|
||||
sha256 '1cb147bd1b1fbd52971d90dff577465b644aee7c878f15ede57f46e8f217067a'
|
||||
|
||||
url 'https://github.com/nicoverbruggen/phpmon/releases/download/v6.0/phpmon-dev.zip'
|
||||
name 'PHP Monitor DEV'
|
||||
homepage 'https://phpmon.app'
|
||||
|
||||
app 'PHP Monitor DEV.app', target: "PHP Monitor DEV.app"
|
||||
end
|
||||
"""),
|
||||
"curl -s --max-time 10 'https://raw.githubusercontent.com/nicoverbruggen/homebrew-cask/master/Casks/phpmon.rb''" :
|
||||
.delayed(0.5, """
|
||||
cask 'phpmon-dev' do
|
||||
depends_on formula: 'gnu-sed'
|
||||
|
||||
version '25.08.0_1000'
|
||||
sha256 '1cb147bd1b1fbd52971d90dff577465b644aee7c878f15ede57f46e8f217067a'
|
||||
|
||||
url 'https://github.com/nicoverbruggen/phpmon/releases/download/v6.0/phpmon-dev.zip'
|
||||
name 'PHP Monitor DEV'
|
||||
homepage 'https://phpmon.app'
|
||||
|
||||
app 'PHP Monitor DEV.app', target: "PHP Monitor DEV.app"
|
||||
end
|
||||
"""),
|
||||
"/opt/homebrew/bin/brew unlink php"
|
||||
: .delayed(0.2, "OK"),
|
||||
"/opt/homebrew/bin/brew unlink php@8.2"
|
||||
@@ -222,7 +192,29 @@ class TestableConfigurations {
|
||||
VersionNumber(major: 8, minor: 1, patch: 0),
|
||||
VersionNumber(major: 8, minor: 0, patch: 0),
|
||||
VersionNumber(major: 7, minor: 4, patch: 33)
|
||||
]
|
||||
],
|
||||
apiGetResponses: [
|
||||
url("\(Constants.Urls.UpdateCheckEndpoint.absoluteString)"): FakeWebApiResponse(
|
||||
statusCode: 200,
|
||||
headers: [:],
|
||||
text: """
|
||||
cask 'phpmon-dev' do
|
||||
depends_on formula: 'gnu-sed'
|
||||
|
||||
version '25.08.0_1000'
|
||||
sha256 '1cb147bd1b1fbd52971d90dff577465b644aee7c878f15ede57f46e8f217067a'
|
||||
|
||||
url 'https://github.com/nicoverbruggen/phpmon/releases/download/v6.0/phpmon-dev.zip'
|
||||
name 'PHP Monitor DEV'
|
||||
homepage 'https://phpmon.app'
|
||||
|
||||
app 'PHP Monitor DEV.app', target: "PHP Monitor DEV.app"
|
||||
end
|
||||
""",
|
||||
duration: 0.5
|
||||
)
|
||||
],
|
||||
apiPostResponses: [:]
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
@@ -31,9 +31,10 @@ final class UpdateCheckTest: UITestCase {
|
||||
configuration.preferenceOverrides[.automaticBackgroundUpdateCheck] = true
|
||||
|
||||
// Ensure an update is available
|
||||
configuration.shellOutput[
|
||||
"curl -s --max-time 10 '\(Constants.Urls.UpdateCheckEndpoint.absoluteString)'"
|
||||
] = .delayed(0.5, """
|
||||
configuration.apiGetResponses[url("\(Constants.Urls.UpdateCheckEndpoint.absoluteString)")] = FakeWebApiResponse(
|
||||
statusCode: 200,
|
||||
headers: [:],
|
||||
text: """
|
||||
cask 'phpmon-dev' do
|
||||
depends_on formula: 'gnu-sed'
|
||||
|
||||
@@ -46,7 +47,9 @@ final class UpdateCheckTest: UITestCase {
|
||||
|
||||
app 'PHP Monitor DEV.app', target: "PHP Monitor DEV.app"
|
||||
end
|
||||
""")
|
||||
""",
|
||||
duration: 0.5
|
||||
)
|
||||
|
||||
let app = launch(openMenu: false, with: configuration)
|
||||
|
||||
@@ -64,7 +67,10 @@ final class UpdateCheckTest: UITestCase {
|
||||
configuration.preferenceOverrides[.automaticBackgroundUpdateCheck] = false
|
||||
|
||||
// Ensure an update is available
|
||||
configuration.shellOutput["curl -s --max-time 10 '\(Constants.Urls.UpdateCheckEndpoint.absoluteString)'"] = .delayed(0.5, """
|
||||
configuration.apiGetResponses[url("\(Constants.Urls.UpdateCheckEndpoint.absoluteString)")] = FakeWebApiResponse(
|
||||
statusCode: 200,
|
||||
headers: [:],
|
||||
text: """
|
||||
cask 'phpmon-dev' do
|
||||
depends_on formula: 'gnu-sed'
|
||||
|
||||
@@ -77,7 +83,9 @@ final class UpdateCheckTest: UITestCase {
|
||||
|
||||
app 'PHP Monitor DEV.app', target: "PHP Monitor DEV.app"
|
||||
end
|
||||
""")
|
||||
""",
|
||||
duration: 0.5
|
||||
)
|
||||
|
||||
// Wait for the menu to open and search for updates
|
||||
let app = launch(openMenu: false, with: configuration)
|
||||
@@ -93,7 +101,10 @@ final class UpdateCheckTest: UITestCase {
|
||||
configuration.preferenceOverrides[.automaticBackgroundUpdateCheck] = false
|
||||
|
||||
// Ensure an update is available
|
||||
configuration.shellOutput["curl -s --max-time 10 '\(Constants.Urls.UpdateCheckEndpoint.absoluteString)'"] = .delayed(0.5, """
|
||||
configuration.apiGetResponses[url("\(Constants.Urls.UpdateCheckEndpoint.absoluteString)")] = FakeWebApiResponse(
|
||||
statusCode: 200,
|
||||
headers: [:],
|
||||
text: """
|
||||
cask 'phpmon-dev' do
|
||||
depends_on formula: 'gnu-sed'
|
||||
|
||||
@@ -106,7 +117,9 @@ final class UpdateCheckTest: UITestCase {
|
||||
|
||||
app 'PHP Monitor DEV.app', target: "PHP Monitor DEV.app"
|
||||
end
|
||||
""")
|
||||
""",
|
||||
duration: 0.5
|
||||
)
|
||||
|
||||
// Wait for the menu to open and search for updates
|
||||
let app = launch(openMenu: true, with: configuration)
|
||||
@@ -125,7 +138,14 @@ final class UpdateCheckTest: UITestCase {
|
||||
configuration.preferenceOverrides[.automaticBackgroundUpdateCheck] = false
|
||||
|
||||
// Ensure an update is available
|
||||
configuration.shellOutput["curl -s --max-time 10 '\(Constants.Urls.UpdateCheckEndpoint.absoluteString)'"] = .delayed(0.5, "404 PAGE NOT FOUND")
|
||||
configuration.apiGetResponses[url("\(Constants.Urls.UpdateCheckEndpoint.absoluteString)")] = FakeWebApiResponse(
|
||||
statusCode: 500,
|
||||
headers: [:],
|
||||
text: """
|
||||
OOPS, SERVER DOWN
|
||||
""",
|
||||
duration: 0.5
|
||||
)
|
||||
|
||||
// Wait for the menu to open and search for updates
|
||||
let app = launch(openMenu: true, with: configuration)
|
||||
|
||||
Reference in New Issue
Block a user