Skip to content

Commit

Permalink
Fix UI test issue
Browse files Browse the repository at this point in the history
  • Loading branch information
Kyle-Ye committed Feb 15, 2023
1 parent 5f096a2 commit def0fef
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 11 deletions.
20 changes: 14 additions & 6 deletions MenuHelper.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
2746558F27B90E2F00DC2F91 /* CoffieView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2746558E27B90E2F00DC2F91 /* CoffieView.swift */; };
2746559127B90E8C00DC2F91 /* CoffieStoreView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2746559027B90E8C00DC2F91 /* CoffieStoreView.swift */; };
2746559327B9319600DC2F91 /* StoreKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2746559227B9319600DC2F91 /* StoreKit.framework */; };
276D4123299D465E00C47CAF /* BundleHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 276D4122299D465E00C47CAF /* BundleHelper.swift */; };
2781A6292688A0260042B453 /* MenuHelperApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2781A6282688A0260042B453 /* MenuHelperApp.swift */; };
2781A62B2688A0260042B453 /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2781A62A2688A0260042B453 /* ContentView.swift */; };
2781A62D2688A0260042B453 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 2781A62C2688A0260042B453 /* Assets.xcassets */; };
Expand All @@ -46,6 +47,7 @@
27CC3F30272038F2000A6005 /* SyncFolderItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = 27CC3F2E272038F2000A6005 /* SyncFolderItem.swift */; };
27CC3F3227203924000A6005 /* FolderItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = 27CC3F3127203924000A6005 /* FolderItem.swift */; };
27CC3F3327203924000A6005 /* FolderItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = 27CC3F3127203924000A6005 /* FolderItem.swift */; };
27EC5897299D48680013742C /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = AE45811F27B7FBD40096404C /* Localizable.strings */; };
27F15ED2271293A00042944A /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 27F15ED1271293A00042944A /* Assets.xcassets */; };
27F15ED5271298690042944A /* FolderItemStore.swift in Sources */ = {isa = PBXBuildFile; fileRef = 27F15ED3271298650042944A /* FolderItemStore.swift */; };
27F15ED62712986B0042944A /* FolderItemStore.swift in Sources */ = {isa = PBXBuildFile; fileRef = 27F15ED3271298650042944A /* FolderItemStore.swift */; };
Expand Down Expand Up @@ -118,6 +120,7 @@
2746559027B90E8C00DC2F91 /* CoffieStoreView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CoffieStoreView.swift; sourceTree = "<group>"; };
2746559227B9319600DC2F91 /* StoreKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = StoreKit.framework; path = System/Library/Frameworks/StoreKit.framework; sourceTree = SDKROOT; };
2746559727B946A900DC2F91 /* MenuHelper-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "MenuHelper-Info.plist"; sourceTree = "<group>"; };
276D4122299D465E00C47CAF /* BundleHelper.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BundleHelper.swift; sourceTree = "<group>"; };
2781A6252688A0260042B453 /* MenuHelper.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = MenuHelper.app; sourceTree = BUILT_PRODUCTS_DIR; };
2781A6282688A0260042B453 /* MenuHelperApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MenuHelperApp.swift; sourceTree = "<group>"; };
2781A62A2688A0260042B453 /* ContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -188,6 +191,7 @@
isa = PBXGroup;
children = (
2732A5B327B9558D005DB4A0 /* MenuHelperUITestsLaunchTests.swift */,
276D4122299D465E00C47CAF /* BundleHelper.swift */,
2732A5BA27B955B9005DB4A0 /* TestPlan.xctestplan */,
);
path = MenuHelperUITests;
Expand Down Expand Up @@ -474,6 +478,7 @@
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
27EC5897299D48680013742C /* Localizable.strings in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -506,6 +511,7 @@
buildActionMask = 2147483647;
files = (
2732A5B427B9558D005DB4A0 /* MenuHelperUITestsLaunchTests.swift in Sources */,
276D4123299D465E00C47CAF /* BundleHelper.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -625,7 +631,7 @@
DEAD_CODE_STRIPPING = YES;
DEVELOPMENT_TEAM = VB7MJ8R223;
GENERATE_INFOPLIST_FILE = YES;
MACOSX_DEPLOYMENT_TARGET = 12.1;
MACOSX_DEPLOYMENT_TARGET = 13.0;
MARKETING_VERSION = 1.0;
PRODUCT_BUNDLE_IDENTIFIER = top.kyleye.MenuHelperUITests;
PRODUCT_NAME = "$(TARGET_NAME)";
Expand All @@ -644,7 +650,7 @@
DEAD_CODE_STRIPPING = YES;
DEVELOPMENT_TEAM = VB7MJ8R223;
GENERATE_INFOPLIST_FILE = YES;
MACOSX_DEPLOYMENT_TARGET = 12.1;
MACOSX_DEPLOYMENT_TARGET = 13.0;
MARKETING_VERSION = 1.0;
PRODUCT_BUNDLE_IDENTIFIER = top.kyleye.MenuHelperUITests;
PRODUCT_NAME = "$(TARGET_NAME)";
Expand Down Expand Up @@ -783,7 +789,7 @@
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 12;
CURRENT_PROJECT_VERSION = 14;
DEAD_CODE_STRIPPING = YES;
DEVELOPMENT_ASSET_PATHS = "\"MenuHelper/Preview Content\"";
DEVELOPMENT_TEAM = VB7MJ8R223;
Expand Down Expand Up @@ -819,7 +825,7 @@
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 12;
CURRENT_PROJECT_VERSION = 14;
DEAD_CODE_STRIPPING = YES;
DEVELOPMENT_ASSET_PATHS = "\"MenuHelper/Preview Content\"";
DEVELOPMENT_TEAM = VB7MJ8R223;
Expand Down Expand Up @@ -852,7 +858,7 @@
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 12;
CURRENT_PROJECT_VERSION = 14;
DEAD_CODE_STRIPPING = YES;
DEVELOPMENT_TEAM = VB7MJ8R223;
ENABLE_APP_SANDBOX = YES;
Expand All @@ -861,6 +867,7 @@
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = MenuHelperExtension/Info.plist;
INFOPLIST_KEY_CFBundleDisplayName = MenuHelperExtension;
INFOPLIST_KEY_LSUIElement = YES;
INFOPLIST_KEY_NSHumanReadableCopyright = "Copyright ©️ 2022 YEXULEI. All rights reserved";
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
Expand All @@ -884,7 +891,7 @@
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 12;
CURRENT_PROJECT_VERSION = 14;
DEAD_CODE_STRIPPING = YES;
DEVELOPMENT_TEAM = VB7MJ8R223;
ENABLE_APP_SANDBOX = YES;
Expand All @@ -893,6 +900,7 @@
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = MenuHelperExtension/Info.plist;
INFOPLIST_KEY_CFBundleDisplayName = MenuHelperExtension;
INFOPLIST_KEY_LSUIElement = YES;
INFOPLIST_KEY_NSHumanReadableCopyright = "Copyright ©️ 2022 YEXULEI. All rights reserved";
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
Expand Down
2 changes: 0 additions & 2 deletions MenuHelperExtension/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>LSUIElement</key>
<true/>
<key>NSExtension</key>
<dict>
<key>NSExtensionAttributes</key>
Expand Down
8 changes: 8 additions & 0 deletions MenuHelperUITests/BundleHelper.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
//
// BundleHelper.swift
// MenuHelperUITests
//
// Created by Kyle on 2023/2/16.
//

class BundleHelper {}
3 changes: 2 additions & 1 deletion MenuHelperUITests/MenuHelperUITestsLaunchTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ class MenuHelperUITestsLaunchTests: XCTestCase {
attachment.lifetime = .keepAlways
add(attachment)
}
mainWindow.buttons[String(localized: "Open Preferences Panel...")].click()
let title = String(localized: "Open Settings Panel...", bundle: Bundle(for: BundleHelper.self), locale: .current)
mainWindow.buttons[title].click()
let settingWindow = app.windows.firstMatch
let toolbarItems = settingWindow.toolbars.buttons.allElementsBoundByIndex
for toolbarItem in toolbarItems {
Expand Down
11 changes: 9 additions & 2 deletions MenuHelperUITests/TestPlan.xctestplan
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,16 @@
"configurations" : [
{
"id" : "51181BC1-0D1D-4DC0-8EE1-9ACA0321EE4B",
"name" : "Configuration 1",
"name" : "Chinese",
"options" : {

"language" : "zh-Hans"
}
},
{
"id" : "D45827A1-BDFA-4B4D-9AC4-25452D993188",
"name" : "English",
"options" : {
"language" : "en"
}
}
],
Expand Down

0 comments on commit def0fef

Please sign in to comment.