From badd7862b9d07d5624390f1d4717581b5610540c Mon Sep 17 00:00:00 2001 From: Olof Hellman Date: Tue, 30 Jul 2019 21:05:30 -0700 Subject: [PATCH] fix failing tests Disable the test that requires permissions to send keystrokes via SystemEvents.app Add PRODUCT_NAME back to the .pbxproj files to work around Xcode 11 beta 4 bug --- NetNewsWire.xcodeproj/project.pbxproj | 6 +++++- .../xcshareddata/xcschemes/NetNewsWire.xcscheme | 8 ++++---- .../ScriptingTests/ScriptingTests.swift | 10 +++++++++- 3 files changed, 18 insertions(+), 6 deletions(-) diff --git a/NetNewsWire.xcodeproj/project.pbxproj b/NetNewsWire.xcodeproj/project.pbxproj index 98ead857b..706e0bdaa 100644 --- a/NetNewsWire.xcodeproj/project.pbxproj +++ b/NetNewsWire.xcodeproj/project.pbxproj @@ -845,7 +845,7 @@ 849A97971ED9EFAA007D329B /* Node-Extensions.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "Node-Extensions.swift"; sourceTree = ""; }; 849A979E1ED9F130007D329B /* SidebarCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SidebarCell.swift; sourceTree = ""; }; 849A97A11ED9F180007D329B /* FolderTreeControllerDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FolderTreeControllerDelegate.swift; sourceTree = ""; }; - 849C64601ED37A5D003D8FC0 /* NetNewsWire.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; name = NetNewsWire.app; path = .app; sourceTree = BUILT_PRODUCTS_DIR; }; + 849C64601ED37A5D003D8FC0 /* NetNewsWire.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = NetNewsWire.app; sourceTree = BUILT_PRODUCTS_DIR; }; 849C64671ED37A5D003D8FC0 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 849C64711ED37A5D003D8FC0 /* NetNewsWireTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = NetNewsWireTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 849EE70E203919360082A1EA /* AppAssets.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppAssets.swift; sourceTree = ""; }; @@ -2801,6 +2801,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = 51121AA12265430A00BC0EC1 /* NetNewsWire_iOSapp_target.xcconfig */; buildSettings = { + PRODUCT_NAME = NetNewsWire; }; name = Debug; }; @@ -2808,6 +2809,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = 51121AA12265430A00BC0EC1 /* NetNewsWire_iOSapp_target.xcconfig */; buildSettings = { + PRODUCT_NAME = NetNewsWire; }; name = Release; }; @@ -2829,6 +2831,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = D5907CE02002F0FA005947E5 /* NetNewsWire_macapp_target.xcconfig */; buildSettings = { + PRODUCT_NAME = NetNewsWire; }; name = Debug; }; @@ -2836,6 +2839,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = D5907CE02002F0FA005947E5 /* NetNewsWire_macapp_target.xcconfig */; buildSettings = { + PRODUCT_NAME = NetNewsWire; }; name = Release; }; diff --git a/NetNewsWire.xcodeproj/xcshareddata/xcschemes/NetNewsWire.xcscheme b/NetNewsWire.xcodeproj/xcshareddata/xcschemes/NetNewsWire.xcscheme index 07e988391..230b6714a 100644 --- a/NetNewsWire.xcodeproj/xcshareddata/xcschemes/NetNewsWire.xcscheme +++ b/NetNewsWire.xcodeproj/xcshareddata/xcschemes/NetNewsWire.xcscheme @@ -15,7 +15,7 @@ @@ -31,7 +31,7 @@ @@ -69,7 +69,7 @@ @@ -86,7 +86,7 @@ diff --git a/Tests/NetNewsWireTests/ScriptingTests/ScriptingTests.swift b/Tests/NetNewsWireTests/ScriptingTests/ScriptingTests.swift index 663e9b101..e89fb2381 100644 --- a/Tests/NetNewsWireTests/ScriptingTests/ScriptingTests.swift +++ b/Tests/NetNewsWireTests/ScriptingTests/ScriptingTests.swift @@ -81,8 +81,16 @@ class ScriptingTests: AppleScriptXCTestCase { actions and the keystrokes aren't delivered to the app right away, so the ui isn't updated in time for 'current article' to be set. But, breaking them up in this way seems to work. + + July 30, 2019: There's an issue where in order for a script to send keystrokes, + The app has to be allowed to interact with the SystemEvents.app in + System Preferences -> Security & Privacy -> Privacy -> Accessibility + and this premission needs to be renewed every time the app is recompiled unless + the app is codesigned. Until we figure out how to get around this limitation, + this test is disabled. */ - func testCurrentArticleScripts() { + func disabledTestCurrentArticleScripts() { + doIndividualScriptWithExpectation(filename: "uiScriptingTestSetup") doIndividualScriptWithExpectation(filename: "establishMainWindowStartingState") doIndividualScriptWithExpectation(filename: "selectAFeed")