diff --git a/ios/BlueWallet.xcodeproj/project.pbxproj b/ios/BlueWallet.xcodeproj/project.pbxproj index 7e484e392..e9fe1ec13 100644 --- a/ios/BlueWallet.xcodeproj/project.pbxproj +++ b/ios/BlueWallet.xcodeproj/project.pbxproj @@ -74,6 +74,7 @@ B4549F362B82B10D002E3153 /* ci_post_clone.sh in Resources */ = {isa = PBXBuildFile; fileRef = B4549F352B82B10D002E3153 /* ci_post_clone.sh */; }; B461B852299599F800E431AA /* AppDelegate.mm in Sources */ = {isa = PBXBuildFile; fileRef = B461B851299599F800E431AA /* AppDelegate.mm */; }; B47B21EC2B2128B8001F6690 /* BlueWalletUITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = B47B21EB2B2128B8001F6690 /* BlueWalletUITests.swift */; }; + B49038D92B8FBAD300A8164A /* BlueWalletUITest.swift in Sources */ = {isa = PBXBuildFile; fileRef = B49038D82B8FBAD300A8164A /* BlueWalletUITest.swift */; }; B4A29A2C2B55C990002A67DF /* EventEmitter.m in Sources */ = {isa = PBXBuildFile; fileRef = 6D32C5C52596CE3A008C077C /* EventEmitter.m */; }; B4A29A2D2B55C990002A67DF /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; }; B4A29A2E2B55C990002A67DF /* AppDelegate.mm in Sources */ = {isa = PBXBuildFile; fileRef = B461B851299599F800E431AA /* AppDelegate.mm */; }; @@ -91,7 +92,7 @@ B4AB225E2B02AD12001F4328 /* XMLParserDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = B4AB225C2B02AD12001F4328 /* XMLParserDelegate.swift */; }; B4EE583C226703320003363C /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = B40D4E35225841ED00428FCC /* Assets.xcassets */; }; C59F90CE0D04D3E4BB39BC5D /* libPods-BlueWalletUITests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 6F02C2F7CA3591E4E0B06EBA /* libPods-BlueWalletUITests.a */; }; - C978A716948AB7DEC5B6F677 /* BuildFile in Frameworks */ = {isa = PBXBuildFile; }; + C978A716948AB7DEC5B6F677 /* (null) in Frameworks */ = {isa = PBXBuildFile; }; E5D4794B26781FC0007838C1 /* fiatUnits.json in Resources */ = {isa = PBXBuildFile; fileRef = 6DD410AD266CAF1F0087DE03 /* fiatUnits.json */; }; E5D4794C26781FC1007838C1 /* fiatUnits.json in Resources */ = {isa = PBXBuildFile; fileRef = 6DD410AD266CAF1F0087DE03 /* fiatUnits.json */; }; /* End PBXBuildFile section */ @@ -139,6 +140,13 @@ remoteGlobalIDString = 13B07F861A680F5B00A75B9A; remoteInfo = BlueWallet; }; + B49038D62B8FBA2500A8164A /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 83CBB9F71A601CBA00E9B192 /* Project object */; + proxyType = 1; + remoteGlobalIDString = B4A29A212B55C990002A67DF; + remoteInfo = "BlueWallet-NoLDK"; + }; B4A29A232B55C990002A67DF /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 83CBB9F71A601CBA00E9B192 /* Project object */; @@ -232,7 +240,6 @@ /* Begin PBXFileReference section */ 008F07F21AC5B25A0029DE68 /* main.jsbundle */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = main.jsbundle; sourceTree = ""; }; 00E356F11AD99517003FC87E /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - 00E356F21AD99517003FC87E /* BlueWalletTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = BlueWalletTests.m; sourceTree = ""; }; 04466491BA2D4876A71222FC /* Foundation.ttf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = Foundation.ttf; path = "../node_modules/react-native-vector-icons/Fonts/Foundation.ttf"; sourceTree = ""; }; 0C3D27CE367C0DD11F4B8772 /* Pods-BlueWalletUITests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-BlueWalletUITests.release.xcconfig"; path = "Target Support Files/Pods-BlueWalletUITests/Pods-BlueWalletUITests.release.xcconfig"; sourceTree = ""; }; 13B07F961A680F5B00A75B9A /* BlueWallet.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = BlueWallet.app; sourceTree = BUILT_PRODUCTS_DIR; }; @@ -368,6 +375,7 @@ B461B851299599F800E431AA /* AppDelegate.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = AppDelegate.mm; path = BlueWallet/AppDelegate.mm; sourceTree = ""; }; B47B21E92B2128B8001F6690 /* BlueWalletUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = BlueWalletUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; B47B21EB2B2128B8001F6690 /* BlueWalletUITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BlueWalletUITests.swift; sourceTree = ""; }; + B49038D82B8FBAD300A8164A /* BlueWalletUITest.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BlueWalletUITest.swift; sourceTree = ""; }; B4A29A452B55C990002A67DF /* BlueWallet.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = BlueWallet.app; sourceTree = BUILT_PRODUCTS_DIR; }; B4A29A462B55C990002A67DF /* BlueWallet-NoLDK.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "BlueWallet-NoLDK.plist"; sourceTree = ""; }; B4AB21062B61D8CA0080440C /* SplashScreen.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SplashScreen.swift; sourceTree = ""; }; @@ -399,7 +407,7 @@ files = ( 782F075B5DD048449E2DECE9 /* libz.tbd in Frameworks */, 764B49B1420D4AEB8109BF62 /* libsqlite3.0.tbd in Frameworks */, - C978A716948AB7DEC5B6F677 /* BuildFile in Frameworks */, + C978A716948AB7DEC5B6F677 /* (null) in Frameworks */, 773E382FE62E836172AAB98B /* libPods-BlueWallet.a in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; @@ -461,8 +469,8 @@ 00E356EF1AD99517003FC87E /* BlueWalletTests */ = { isa = PBXGroup; children = ( - 00E356F21AD99517003FC87E /* BlueWalletTests.m */, 00E356F01AD99517003FC87E /* Supporting Files */, + B49038D82B8FBAD300A8164A /* BlueWalletUITest.swift */, ); path = BlueWalletTests; sourceTree = ""; @@ -901,7 +909,6 @@ buildConfigurationList = B47B21F32B2128B8001F6690 /* Build configuration list for PBXNativeTarget "BlueWalletUITests" */; buildPhases = ( 6A7B5D072DAE0808347B48AA /* [CP] Check Pods Manifest.lock */, - B4A54FD92B83C1DB00210890 /* ShellScript */, B47B21E52B2128B8001F6690 /* Sources */, B47B21E62B2128B8001F6690 /* Frameworks */, B47B21E72B2128B8001F6690 /* Resources */, @@ -912,6 +919,7 @@ ); dependencies = ( B47B21F02B2128B8001F6690 /* PBXTargetDependency */, + B49038D72B8FBA2500A8164A /* PBXTargetDependency */, ); name = BlueWalletUITests; productName = BlueWalletUITests; @@ -923,7 +931,6 @@ buildConfigurationList = B4A29A422B55C990002A67DF /* Build configuration list for PBXNativeTarget "BlueWallet-NoLDK" */; buildPhases = ( B4A29A2A2B55C990002A67DF /* [CP] Check Pods Manifest.lock */, - B4A29A472B55D17B002A67DF /* ShellScript */, B4A29A2B2B55C990002A67DF /* Sources */, B4A29A302B55C990002A67DF /* Frameworks */, B4A29A342B55C990002A67DF /* Resources */, @@ -987,7 +994,7 @@ }; B47B21E82B2128B8001F6690 = { CreatedOnToolsVersion = 15.0.1; - TestTargetID = 13B07F861A680F5B00A75B9A; + TestTargetID = B4A29A212B55C990002A67DF; }; }; }; @@ -1024,7 +1031,7 @@ ); mainGroup = 83CBB9F61A601CBA00E9B192; packageReferences = ( - 6DFC806E24EA0B6C007B8700 /* XCRemoteSwiftPackageReference "EFQRCode.git" */, + 6DFC806E24EA0B6C007B8700 /* XCRemoteSwiftPackageReference "EFQRCode" */, B41B76832B66B2FF002C48D5 /* XCRemoteSwiftPackageReference "bugsnag-cocoa" */, ); productRefGroup = 83CBBA001A601CBA00E9B192 /* Products */; @@ -1375,40 +1382,6 @@ shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-BlueWallet-NoLDK/Pods-BlueWallet-NoLDK-resources.sh\"\n"; showEnvVarsInLog = 0; }; - B4A29A472B55D17B002A67DF /* ShellScript */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - ); - inputPaths = ( - ); - outputFileListPaths = ( - ); - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "cp ../scripts/maccatalystpatches/lightning-ldk-wallet.ts ../class/wallets/lightning-ldk-wallet.ts\n"; - }; - B4A54FD92B83C1DB00210890 /* ShellScript */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - ); - inputPaths = ( - ); - outputFileListPaths = ( - ); - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "cp ../scripts/maccatalystpatches/lightning-ldk-wallet.ts ../class/wallets/lightning-ldk-wallet.ts\n"; - }; CF0725821442A3000F20E874 /* Upload Bugsnag dSYM */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; @@ -1506,6 +1479,7 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( + B49038D92B8FBAD300A8164A /* BlueWalletUITest.swift in Sources */, B47B21EC2B2128B8001F6690 /* BlueWalletUITests.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; @@ -1555,6 +1529,11 @@ target = 13B07F861A680F5B00A75B9A /* BlueWallet */; targetProxy = B47B21EF2B2128B8001F6690 /* PBXContainerItemProxy */; }; + B49038D72B8FBA2500A8164A /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = B4A29A212B55C990002A67DF /* BlueWallet-NoLDK */; + targetProxy = B49038D62B8FBA2500A8164A /* PBXContainerItemProxy */; + }; B4A29A222B55C990002A67DF /* PBXTargetDependency */ = { isa = PBXTargetDependency; platformFilter = ios; @@ -2261,7 +2240,7 @@ "$(inherited)", ); GENERATE_INFOPLIST_FILE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 17.0; + IPHONEOS_DEPLOYMENT_TARGET = 13.4; LIBRARY_SEARCH_PATHS = ( "$(SDKROOT)/usr/lib/swift", "$(SDKROOT)/System/iOSSupport/usr/lib/swift", @@ -2282,8 +2261,8 @@ SWIFT_EMIT_LOC_STRINGS = NO; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_VERSION = 5.0; - TARGETED_DEVICE_FAMILY = "1,2"; - TEST_TARGET_NAME = BlueWallet; + TARGETED_DEVICE_FAMILY = 2; + TEST_TARGET_NAME = "BlueWallet-NoLDK"; }; name = Debug; }; @@ -2309,7 +2288,7 @@ ENABLE_USER_SCRIPT_SANDBOXING = YES; GCC_C_LANGUAGE_STANDARD = gnu17; GENERATE_INFOPLIST_FILE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 17.0; + IPHONEOS_DEPLOYMENT_TARGET = 13.4; LIBRARY_SEARCH_PATHS = ( "$(SDKROOT)/usr/lib/swift", "$(SDKROOT)/System/iOSSupport/usr/lib/swift", @@ -2327,8 +2306,8 @@ SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO; SWIFT_EMIT_LOC_STRINGS = NO; SWIFT_VERSION = 5.0; - TARGETED_DEVICE_FAMILY = "1,2"; - TEST_TARGET_NAME = BlueWallet; + TARGETED_DEVICE_FAMILY = 2; + TEST_TARGET_NAME = "BlueWallet-NoLDK"; }; name = Release; }; @@ -2518,7 +2497,7 @@ /* End XCConfigurationList section */ /* Begin XCRemoteSwiftPackageReference section */ - 6DFC806E24EA0B6C007B8700 /* XCRemoteSwiftPackageReference "EFQRCode.git" */ = { + 6DFC806E24EA0B6C007B8700 /* XCRemoteSwiftPackageReference "EFQRCode" */ = { isa = XCRemoteSwiftPackageReference; repositoryURL = "https://github.com/EFPrefix/EFQRCode.git"; requirement = { @@ -2539,7 +2518,7 @@ /* Begin XCSwiftPackageProductDependency section */ 6DFC806F24EA0B6C007B8700 /* EFQRCode */ = { isa = XCSwiftPackageProductDependency; - package = 6DFC806E24EA0B6C007B8700 /* XCRemoteSwiftPackageReference "EFQRCode.git" */; + package = 6DFC806E24EA0B6C007B8700 /* XCRemoteSwiftPackageReference "EFQRCode" */; productName = EFQRCode; }; B41B76842B66B2FF002C48D5 /* Bugsnag */ = { diff --git a/ios/BlueWallet.xcodeproj/xcshareddata/xcschemes/BlueWallet-NoLDK.xcscheme b/ios/BlueWallet.xcodeproj/xcshareddata/xcschemes/BlueWallet-NoLDK.xcscheme index 2747d5c7a..e3d93fbf9 100644 --- a/ios/BlueWallet.xcodeproj/xcshareddata/xcschemes/BlueWallet-NoLDK.xcscheme +++ b/ios/BlueWallet.xcodeproj/xcshareddata/xcschemes/BlueWallet-NoLDK.xcscheme @@ -5,6 +5,24 @@ + + + + + + + + + + + + + + + + + + + + -#import - -#import -#import - -#define TIMEOUT_SECONDS 600 -#define TEXT_TO_LOOK_FOR @"Welcome to React Native!" - -@interface BlueWalletTests : XCTestCase - -@end - -@implementation BlueWalletTests - -- (BOOL)findSubviewInView:(UIView *)view matching:(BOOL(^)(UIView *view))test -{ - if (test(view)) { - return YES; - } - for (UIView *subview in [view subviews]) { - if ([self findSubviewInView:subview matching:test]) { - return YES; - } - } - return NO; -} - -- (void)testRendersWelcomeScreen -{ - UIViewController *vc = [[[RCTSharedApplication() delegate] window] rootViewController]; - NSDate *date = [NSDate dateWithTimeIntervalSinceNow:TIMEOUT_SECONDS]; - BOOL foundElement = NO; - - __block NSString *redboxError = nil; - RCTSetLogFunction(^(RCTLogLevel level, RCTLogSource source, NSString *fileName, NSNumber *lineNumber, NSString *message) { - if (level >= RCTLogLevelError) { - redboxError = message; - } - }); - - while ([date timeIntervalSinceNow] > 0 && !foundElement && !redboxError) { - [[NSRunLoop mainRunLoop] runMode:NSDefaultRunLoopMode beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.1]]; - [[NSRunLoop mainRunLoop] runMode:NSRunLoopCommonModes beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.1]]; - - foundElement = [self findSubviewInView:vc.view matching:^BOOL(UIView *view) { - if ([view.accessibilityLabel isEqualToString:TEXT_TO_LOOK_FOR]) { - return YES; - } - return NO; - }]; - } - - RCTSetLogFunction(RCTDefaultLogFunction); - - XCTAssertNil(redboxError, @"RedBox error: %@", redboxError); - XCTAssertTrue(foundElement, @"Couldn't find element with text '%@' in %d seconds", TEXT_TO_LOOK_FOR, TIMEOUT_SECONDS); -} - - -@end diff --git a/ios/BlueWalletTests/BlueWalletUITest.swift b/ios/BlueWalletTests/BlueWalletUITest.swift new file mode 100644 index 000000000..449bc0538 --- /dev/null +++ b/ios/BlueWalletTests/BlueWalletUITest.swift @@ -0,0 +1,37 @@ +// +// BlueWalletUITest.swift +// BlueWalletUITests +// +// Created by Marcos Rodriguez on 2/28/24. +// Copyright © 2024 BlueWallet. All rights reserved. +// + +import XCTest + +final class BlueWalletUITest: XCTestCase { + + override func setUpWithError() throws { + continueAfterFailure = false + } + + override func tearDownWithError() throws { + // Put teardown code here. This method is called after the invocation of each test method in the class. + } + + func testAppLaunchesAndShowsSettingsButton() throws { + let app = XCUIApplication() + app.launch() + + let settingsButton = app.buttons["SettingsButton"] + + // Wait for the settings button to appear to make sure the app has finished launching and is displaying its initial UI. + let exists = NSPredicate(format: "exists == true") + expectation(for: exists, evaluatedWith: settingsButton, handler: nil) + + // Wait for a maximum of 10 seconds for the settings button to appear + waitForExpectations(timeout: 10, handler: nil) + + // Assert that the settings button is not only present but also hittable (visible and interactable) + XCTAssertTrue(settingsButton.isHittable, "The settings button should be visible and interactable") + } +} diff --git a/ios/Podfile.lock b/ios/Podfile.lock index be4618a7f..3a42605eb 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -473,7 +473,7 @@ PODS: - React - rn-ldk (0.8.4): - React-Core - - RNCAsyncStorage (1.22.2): + - RNCAsyncStorage (1.22.3): - React-Core - RNCClipboard (1.13.2): - React-Core @@ -845,7 +845,7 @@ SPEC CHECKSUMS: ReactNativeCameraKit: 9d46a5d7dd544ca64aa9c03c150d2348faf437eb RealmJS: a62dc7a1f94b888fe9e8712cd650167ad97dc636 rn-ldk: 0d8749d98cc5ce67302a32831818c116b67f7643 - RNCAsyncStorage: 014a78b2cc8cc107c9e92ee428dc0c1ac3223416 + RNCAsyncStorage: 10591b9e0a91eaffee14e69b3721009759235125 RNCClipboard: 60fed4b71560d7bfe40e9d35dea9762b024da86d RNCPushNotificationIOS: 64218f3c776c03d7408284a819b2abfda1834bc8 RNDefaultPreference: 08bdb06cfa9188d5da97d4642dac745218d7fb31 diff --git a/ios/ci_scripts/ci_post_clone.sh b/ios/ci_scripts/ci_post_clone.sh index ea9afb966..8c7e56815 100755 --- a/ios/ci_scripts/ci_post_clone.sh +++ b/ios/ci_scripts/ci_post_clone.sh @@ -8,10 +8,6 @@ brew install node@21 echo "===== Installing yarn (Xcode Cloud doenst like NPM ) =====" brew install yarn -# LDK is not currently available for Catalyst, so we need to patch the wallet -echo "===== Running LDK is not currently available for Catalyst, so we need to patch the wallet =====" -cp scripts/maccatalystpatches/lightning-ldk-wallet.ts class/wallets/lightning-ldk-wallet.ts - # Install dependencies echo "===== Running yarn install =====" yarn install diff --git a/package-lock.json b/package-lock.json index 511fbe6f9..50e951ea1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -16,7 +16,7 @@ "@keystonehq/bc-ur-registry": "0.6.4", "@ngraveio/bc-ur": "1.1.6", "@noble/secp256k1": "1.6.3", - "@react-native-async-storage/async-storage": "1.22.2", + "@react-native-async-storage/async-storage": "1.22.3", "@react-native-clipboard/clipboard": "1.13.2", "@react-native-community/push-notification-ios": "1.11.0", "@react-navigation/drawer": "6.6.9", @@ -4318,9 +4318,9 @@ } }, "node_modules/@react-native-async-storage/async-storage": { - "version": "1.22.2", - "resolved": "https://registry.npmjs.org/@react-native-async-storage/async-storage/-/async-storage-1.22.2.tgz", - "integrity": "sha512-nZpzT4Wz1OkVdQaZP/awpDCTKiPzdmG0PYmRF37ZeJlfwlwOg55in0TP2YUOW0MhOCRiNMomWWLojDLv5j2OIw==", + "version": "1.22.3", + "resolved": "https://registry.npmjs.org/@react-native-async-storage/async-storage/-/async-storage-1.22.3.tgz", + "integrity": "sha512-Ov3wjuqxHd62tLYfgTjxj77YRYWra3A4Fi8uICIPcePgNO2WkS5B0ADXt9e/JLzSCNqVlXCq4Fir/gHmZTU9ww==", "dependencies": { "merge-options": "^3.0.4" }, @@ -25814,9 +25814,9 @@ "dev": true }, "@react-native-async-storage/async-storage": { - "version": "1.22.2", - "resolved": "https://registry.npmjs.org/@react-native-async-storage/async-storage/-/async-storage-1.22.2.tgz", - "integrity": "sha512-nZpzT4Wz1OkVdQaZP/awpDCTKiPzdmG0PYmRF37ZeJlfwlwOg55in0TP2YUOW0MhOCRiNMomWWLojDLv5j2OIw==", + "version": "1.22.3", + "resolved": "https://registry.npmjs.org/@react-native-async-storage/async-storage/-/async-storage-1.22.3.tgz", + "integrity": "sha512-Ov3wjuqxHd62tLYfgTjxj77YRYWra3A4Fi8uICIPcePgNO2WkS5B0ADXt9e/JLzSCNqVlXCq4Fir/gHmZTU9ww==", "requires": { "merge-options": "^3.0.4" }