Detect issues like logic failures, UI problems, and performance regressions by running tests on your app.

Posts under Testing tag

124 Posts
Sort by:
Post not yet marked as solved
1 Replies
233 Views
Almost got my first app off the ground and I just can't figure out this report. Any help is appreciated! Exception Type: EXC_CRASH (SIGABRT) Exception Codes: 0x0000000000000000, 0x0000000000000000 Exception Note: EXC_CORPSE_NOTIFY Triggered by Thread: 1 Last Exception Backtrace: 0 CoreFoundation 0x181b99d78 __exceptionPreprocess + 220 (NSException.m:200) 1 libobjc.A.dylib 0x19a7fe734 objc_exception_throw + 60 (objc-exception.mm:565) 2 Brotein 0x100efcc60 RCTFatal + 668 (RCTAssert.m:145) 3 Brotein 0x100f787c8 -[RCTExceptionsManager reportFatal:stack:exceptionId:suppressRedBox:] + 492 (RCTExceptionsManager.mm:76) 4 Brotein 0x100f790f0 -[RCTExceptionsManager reportException:] + 1532 (RCTExceptionsManager.mm:145) 5 CoreFoundation 0x181b22614 __invoking___ + 148 6 CoreFoundation 0x181b40100 -[NSInvocation invoke] + 468 (NSForwarding.m:3378) 7 CoreFoundation 0x181b7713c -[NSInvocation invokeWithTarget:] + 80 (NSForwarding.m:3475) 8 Brotein 0x100f2c580 -[RCTModuleMethod invokeWithBridge:module:arguments:] + 460 (RCTModuleMethod.mm:584) 9 Brotein 0x100f2e648 facebook::react::invokeInner(RCTBridge*, RCTModuleData*, unsigned int, folly::dynamic const&) + 244 (RCTNativeModule.mm:114) 10 Brotein 0x100f2e3b8 operator() + 44 (RCTNativeModule.mm:75) 11 Brotein 0x100f2e3b8 invocation function for block in facebook::react::RCTNativeModule::invoke(unsigned int, folly::dynamic&&, int) + 88 (RCTNativeModule.mm:67) 12 libdispatch.dylib 0x1817fee68 _dispatch_call_block_and_release + 32 (init.c:1517) 13 libdispatch.dylib 0x181800a2c _dispatch_client_callout + 20 (object.m:560) 14 libdispatch.dylib 0x181808124 _dispatch_lane_serial_drain + 668 (inline_internal.h:2622) 15 libdispatch.dylib 0x181808c80 _dispatch_lane_invoke + 392 (queue.c:3944) 16 libdispatch.dylib 0x181813500 _dispatch_workloop_worker_thread + 648 (queue.c:6732) 17 libsystem_pthread.dylib 0x1f2b1e0bc _pthread_wqthread + 288 (pthread.c:2599) 18 libsystem_pthread.dylib 0x1f2b1de5c start_wqthread + 8 Thread 0 name: Thread 0: 0 QuartzCore 0x000000018588aaf4 CA::Layer::update_for_changed_sublayers(CA::Transaction*, unsigned int) + 240 (CALayerInternal.h:0) 1 QuartzCore 0x000000018588e9c0 CA::Layer::insert_sublayer(CA::Transaction*, CALayer*, unsigned long) + 556 (CALayer.mm:6188) 2 QuartzCore 0x00000001858a6120 -[CALayer addSublayer:] + 204 (CALayer.mm:6276) 3 UIKitCore 0x00000001840f9f00 -[UIView(Internal) _addSubview:positioned:relativeTo:] + 1296 (UIView.m:16715) 4 Brotein 0x0000000100f694b8 -[UIView(React) didUpdateReactSubviews] + 188 (UIView+React.m:184) 5 Brotein 0x0000000100f60558 -[RCTView didUpdateReactSubviews] + 76 (RCTView.m:573) 6 Brotein 0x0000000100f57048 __48-[RCTUIManager _dispatchChildrenDidChangeEvents]_block_invoke + 216 (RCTUIManager.m:1265) 7 Brotein 0x0000000100f56a68 __44-[RCTUIManager flushUIBlocksWithCompletion:]_block_invoke + 184 (RCTUIManager.m:1189) 8 Brotein 0x0000000100f56b5c __44-[RCTUIManager flushUIBlocksWithCompletion:]_block_invoke.417 + 28 (RCTUIManager.m:1209) 9 libdispatch.dylib 0x00000001817fee68 _dispatch_call_block_and_release + 32 (init.c:1517) 10 libdispatch.dylib 0x0000000181800a2c _dispatch_client_callout + 20 (object.m:560) 11 libdispatch.dylib 0x000000018180ef48 _dispatch_main_queue_drain + 928 (inline_internal.h:2622) 12 libdispatch.dylib 0x000000018180eb98 _dispatch_main_queue_callback_4CF + 44 (queue.c:7770) 13 CoreFoundation 0x0000000181b522f0 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 16 (CFRunLoop.c:1795) 14 CoreFoundation 0x0000000181b0c1f4 __CFRunLoopRun + 2532 (CFRunLoop.c:3144) 15 CoreFoundation 0x0000000181b1f6b8 CFRunLoopRunSpecific + 600 (CFRunLoop.c:3268) 16 GraphicsServices 0x000000019dbb9374 GSEventRunModal + 164 (GSEvent.c:2200) 17 UIKitCore 0x0000000184484e88 -[UIApplication _run] + 1100 (UIApplication.m:3511) 18 UIKitCore 0x00000001842065ec UIApplicationMain + 364 (UIApplication.m:5064) 19 Brotein 0x0000000100e82fb8 main + 88 (main.m:7) 20 dyld 0x0000000101395ce4 start + 520 (dyldMain.cpp:879) Thread 1 name: Thread 1 Crashed: 0 libsystem_kernel.dylib 0x00000001b9508b78 __pthread_kill + 8 1 libsystem_pthread.dylib 0x00000001f2b243bc pthread_kill + 268 (pthread.c:1668) 2 libsystem_c.dylib 0x000000018cc7c51c abort + 168 (abort.c:118) 3 libc++abi.dylib 0x000000019a909b7c abort_message + 132 (abort_message.cpp:78) 4 libc++abi.dylib 0x000000019a8f99c4 demangling_terminate_handler() + 336 (cxa_default_handlers.cpp:71) 5 libobjc.A.dylib 0x000000019a804c88 _objc_terminate() + 144 (objc-exception.mm:701) 6 libc++abi.dylib 0x000000019a908f18 std::__terminate(void (*)()) + 20 (cxa_handlers.cpp:59) 7 libc++abi.dylib 0x000000019a908eb4 std::terminate() + 64 (cxa_handlers.cpp:88) 8 libdispatch.dylib 0x0000000181800a40 _dispatch_client_callout + 40 (object.m:563) 9 libdispatch.dylib 0x0000000181808124 _dispatch_lane_serial_drain + 668 (inline_internal.h:2622) 10 libdispatch.dylib 0x0000000181808c80 _dispatch_lane_invoke + 392 (queue.c:3944) 11 libdispatch.dylib 0x0000000181813500 _dispatch_workloop_worker_thread + 648 (queue.c:6732) 12 libsystem_pthread.dylib 0x00000001f2b1e0bc _pthread_wqthread + 288 (pthread.c:2599) 13 libsystem_pthread.dylib 0x00000001f2b1de5c start_wqthread + 8
Posted
by richiec54.
Last updated
.
Post not yet marked as solved
0 Replies
153 Views
Due to some of what we do with the Metal API in our iOS app, we are unable use Simulator for development / testing purposes. With the introduction of Apple Silicon, we are able to run/build to the "My Mac (Designed for iPad)" destination for our app. However, when we try running UI tests with that destination we get the message "Cannot test target <ui_test_target> on "My Mac": UI tests are not supported ..." Wondering if there's a way to run UI tests against the "My Mac (Designed for iPad)" destination?
Posted Last updated
.
Post not yet marked as solved
1 Replies
772 Views
UI Tests seem to be broken when run on an iPhone running iOS 15.4. Steps to reproduce: Create a fresh app project in Xcode 13.3 including UI tests Select an attached iPhone running iOS 15.4 Run the UI test testExample which only starts the app, nothing more. Restart the attached phone Try to run testExample again. Expectation: Test succeeds again Actual: When launching the app, XCTest is internally first trying to terminate the app and gets stuck. After 60s the tests fail. Logging (app id and home folder are removed for privacy reasons): TESTUITests-Runner[341:7025] Running tests... Test Suite 'Selected tests' started at 2022-03-17 14:53:36.855 Test Suite 'TESTUITests.xctest' started at 2022-03-17 14:53:36.855 Test Suite 'TESTUITests' started at 2022-03-17 14:53:36.856 Test Case '-[TESTUITests.TESTUITests testExample]' started. t = 0.00s Start Test at 2022-03-17 14:53:36.856 t = 0.07s Set Up t = 0.07s Open <app_id>.TEST t = 0.11s Launch <app_id>.TEST t = 0.11s Terminate <app_id>.TEST:269 <UserHome>/Workspace/TEST/TESTUITests/TESTUITests.swift:28: error: -[TESTUITests.TESTUITests testExample] : Failed to terminate <app_id>.TEST:269: Failed to terminate <app_id>.TEST:0 t = 60.29s Tear Down Test Case '-[TESTUITests.TESTUITests testExample]' failed (60.294 seconds). Test Suite 'TESTUITests' failed at 2022-03-17 14:54:37.150. Executed 1 test, with 1 failure (0 unexpected) in 60.294 (60.294) seconds Test Suite 'TESTUITests.xctest' failed at 2022-03-17 14:54:37.150. Executed 1 test, with 1 failure (0 unexpected) in 60.294 (60.295) seconds Test Suite 'Selected tests' failed at 2022-03-17 14:54:37.151. Executed 1 test, with 1 failure (0 unexpected) in 60.294 (60.296) seconds If I manually start the app once, then the UI tests will run again afterwards for a while (including restarting the app). At some point they get stuck again and we are not sure why, yet. This makes it really hard to run tests in our CI because we can't keep sending someone into the server room to manually start the app... Has anybody else encountered this and found a solution? It works fine on iOS 15.1.1.
Posted
by Infinite.
Last updated
.
Post not yet marked as solved
1 Replies
518 Views
Hi everyone, I'm having a hard time solving my issue. I have a VStack with a ForEach loop that displays (Core)data info. In that ForEach loop I have a View that has a tap gesture (to open a sheet to edit the entity) and a contextMenu (to allow users to delete the selected entity). The sheet is at the VStack (parent of ForEach) level. VStack() {         ForEach(customModels) { customModel in           VStack() {             Text(customModel.title)           }           .frame(minWidth: 0, maxWidth: .infinity)           .onTapGesture(perform: {             selectedCustomModel = customModel           })           .contextMenu {             Button {               customViewModel.deleteModel(customModel)             } label: {               Label("Delete", systemImage: "trash")             }           }         }       }       .sheet(item: $selectedCustomModel) { selectedCustomModel in         EditCustomView(customModel: selectedCustomModel)       } If I long press on one of my "child" view the contextMenu appears, if I dismiss that contextMenu by tapping on another child view, then it triggers the "onTapGesture" (which seems fair), and a warning pops in the console : Attempt to present &lt;_TtGC7SwiftUI29PresentationHostingControllerVS_7AnyView_: 0x7f90939e05b0&gt; on [...] which is already presenting &lt;_UIContextMenuActionsOnlyViewController: 0x7f9093983bd0&gt;. The problem is at that point any tap on a child view does not work, the onTapGesture is like "dead" I have to tap like 5 or 10 times to to make the edit sheet appears... Is this a bug or do you see something bad in my implementation ? Thank you Jim
Posted
by Jim_6.
Last updated
.
Post not yet marked as solved
2 Replies
1k Views
Hi Everyone. I'm trying to use Accessibility Inspector thats included with Xcode 13.3 and it fails to identify UI elements with Target mode... basically the entire iOS simulator is a green/unreadable element. Besides the fact that is hangs a lot is this tool completely broken now? If I try to run an audit it just throws the warning: Element has no description This SimulatorKit.SimDisplayRenderableView is missing useful accessibility information. Note that no matter what app I try to inspect, it always fails, it also fails when I try to inspect the springboard / home screen. It worked fine in 13.2.1 and now its completely broken.
Posted
by andyz.
Last updated
.
Post not yet marked as solved
1 Replies
138 Views
Hello We are having an issue with Xcode 13.3.1 where it's not detecting our tests. In the test navigator, it's listing the tests but they are empty and it's also showing a count of 0 next to the test target. When we run the tests, it runs fast and doesn't show the checkmarks as expected since it doesn't detect the tests. Any help would be appreciated. Thanks.
Posted
by rdrch2021.
Last updated
.
Post marked as solved
1 Replies
973 Views
I have recently started Beta Testing my SwiftUI App on my iPhone 6s, previously I was testing it on the iPhone 12 Simulator. While Testing on the Real Device I encountered issues like: CPU going past 98% Really Laggy ScrollView Tab Bar Freezes Randomly Since My app is going to go in Production State in a few days, Since this is my first iOS App as well, I am not too sure if these issues are because of SwiftUI, my Phone or what, I have asked Apple Support but, haven't received a response so far. My App Stats: Lines of Code: ~1,500 CPU Usage on Simulator: Max. 10% Bundle Size: 2MB RAM Max. on Simulator: 32.3mb
Posted Last updated
.
Post not yet marked as solved
0 Replies
170 Views
The problem On iOS 15 was changed the view for notifications on the Notification center. All tried operations with XCUITest are not working to expand it by force touch. Environment Xcode 13.3; iOS 15.4; iPhone 8 simulator; macOS Monterey 12.2.1. Details For example, we received any notification in the notification center. Manually we can expand it by force touch ( NB! Should be on: Simulator->I/O -> Touch pressures -> Use trackpad force). But there are no any ways to do this by XCUITest methods. Seem like not enough press is performed for all of them. Could this issue be fixed somehow?
Posted
by vkuhi.
Last updated
.
Post not yet marked as solved
1 Replies
187 Views
I have the following protocol that a NetworkEngine conforms to: protocol NetworkEngineProtocol { func request&amp;lt;T: Decodable&amp;gt;(from endpoint: Endpoint) async throws -&amp;gt; T } This protocol is passed as a dependency into a custom ViewModel and I want to unit test the request method of the ViewModel, that itself calls the dependency request method. class ViewModel: ViewModelProtocol { var passthrough: PassthroughSubject&amp;lt;[SomeProperty], Never&amp;gt; = PassthroughSubject&amp;lt;[SomeProperty], Never&amp;gt;() private let networkEngine: NetworkEngineProtocol init(networkEngine: NetworkEngineProtocol) { self.networkEngine = networkEngine } func request() { Task { do { let model = try await networkEngine.request(from: .messages()) as CustomModel // ... do more stuff passthrough.send(someValue) // would want to test this } catch let err as NetworkEngineErrors { // ... error handling } } } } struct CustomModel: Decodable { let message: [String] let status: String } In order to Unit Test this method, I'd have to create a Mock class, that conforms to the NetworkEngineProtocol. Something like: class MockNetworkProtocol: NetworkEngineProtocol { init() {} func request&amp;lt;T&amp;gt;(from endpoint: Endpoint) async throws -&amp;gt; T where T : Decodable { // how to mock this? } } What's the best way to do this? How can I mock the request method of the NetworkEngine? Thanks
Posted Last updated
.
Post not yet marked as solved
0 Replies
142 Views
I've never worked at a tech company. I built an app from scratch with a NodeJS API and MongoDB hosted on AWS. I will start hiring back-end developers to work with me. What is the best practice for making changes to the backend? All the .js files are store in a repository, but what's the best way to test changes to the API before shipping? The app is live on the app store. Should I put a duplicate build on TestFlight and connect it to version_2.js files and test it like that? Or is there a better way to do it? Curious about what industry folks typically do.
Posted
by mfgk123.
Last updated
.
Post not yet marked as solved
0 Replies
204 Views
Hello, We are experiencing failing UI Tests on M1 devices (Xcode 13.3.1) while they pass well on Intel devices. The most common errors are: App stucks on splashcreen resulting in xctassert timeout Scrolling is not working properly (like there is no deceleration) resulting in wrong screen position and not found elements Notes: Simulator is running without Rosetta We have to exclude arm64-simulator arch support because of third party libraries Has anyone encountered such a problem? Thanks!
Posted
by vladsh.
Last updated
.
Post not yet marked as solved
1 Replies
333 Views
I can't execute individual tests or test suits on XCode 13.1, I get this message: Executed 0 tests, with 0 failures (0 unexpected) in 0.000 (0.000) seconds I can only execute the complete set of tests, is this a bug or am I missing something ?
Posted
by axel.mr.
Last updated
.
Post not yet marked as solved
0 Replies
237 Views
Hi Apple! Since the latest iOS update, Xcode will no longer build to either of my iPhones (and they were all working great before). I have been developing for iPhones for 14 years. This is a new problem. It occurred once I updated each of my devices to the latest iOS operating system (15.4.1). Now, Xcode always shows "Failed to prepare device for development". I've restarted my Mac many times, updated to the latest Mac OS (11.6.5), restarted both phones several times, restarted Xcode. NOTHING (I've been working on iPhones for a long time and I know all the tricks) works to build to the phone. This has completely stopped my development for my two companies. Please list the steps you took to reproduce the issue: Connect iPhone to Xcode. Push run button from any iOS app. Xcode reports "Failed to prepare device for development". What did you expect to happen? App to get transferred and run on the phone. What actually happened? Development and all progress stopped with no resolution possible from us. I've submitted screenshots of two different phones, both updated to latest iOS. JUST before the iOS updates, things were working.
Posted Last updated
.
Post not yet marked as solved
0 Replies
175 Views
Given that I have a function that does not need to share and store state; should I use a static class/struct/enum to hold the function? I have read in many places that it is a bad design to use static functions to hold code, as static function do not adhere to the SOLID principles and are considered procedural code. Testability seems to be there as I can isolate the parent class with the injected static Enums by injecting mock static enums. E.g. I can encapsulate and have polymorphism by using protocols for static functions: Static Protocol Approach enum StaticEnum: TestProtocol { static func staticMethod() { print("hello") } } enum StaticEnum2: TestProtocol { static func staticMethod() { print("hello2") } } protocol TestProtocol { static func staticMethod() } class TestClass { let staticTypes: [TestProtocol.Type] init (staticTypes: [TestProtocol.Type]) { self.staticTypes = staticTypes } } class TestFactory { func makeTestClass() -> TestClass { return TestClass(staticTypes: [StaticEnum.self, StaticEnum2.self]) } } vs Object Oriented Approach class InstanceClass: TestProtocol { func staticMethod() { print("hello") } } class InstanceClass2: TestProtocol { func staticMethod() { print("hello2") } } protocol TestProtocol { func staticMethod() } class TestClass { let instances: [TestProtocol] init (instances: [TestProtocol]) { self.instances = instances } } class TestFactory { func makeTestClass() -> TestClass { return TestClass(instances: [InstanceClass(), InstanceClass2()]) } } The static version still allows for protocol polymorphism as you can have multiple enums adhere to the static protocols. Furthermore no initialisation is needed after the first dispatch call to create the static function. Is there any drawback in using the Static Protocol approach?
Posted
by Reckoned.
Last updated
.
Post marked as solved
1 Replies
179 Views
On my M1 mac, using Xcode 13.3, I created a package and displayed the code coverage bar (Editor menu –> Code Coverage). After running tests, there is no indication of code coverage at all in the source code. How do I get code coverage when testing a package?
Posted
by MegaWatt.
Last updated
.
Post not yet marked as solved
4 Replies
937 Views
Since Xcode 13 the coverage of my project is missing, from locally and Azure, I discovered that only fails on simulator, in a real device all works fine as always, any idea? This is the error from Xcode when the tests end: Failed to merge raw profiles in directory /.../Coverage.profdata: Aggregation tool '/.../Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/llvm-profdata' failed with exit code 1 Thanks a lot
Posted
by poborp.
Last updated
.
Post not yet marked as solved
1 Replies
647 Views
Starting from Xcode 12.4 (I think), failing unit tests in framework targets take about 5 seconds to complete. Successful tests complete almost instantly (as expected). For example, the following test:     func testExampleFailure() {         XCTFail()     } Takes 4.356 seconds to execute on my 2019 MacBook Pro: Test Case '-[FrameworkTests.FrameworkTests testExampleFailure]' failed (4.356 seconds). This seems to only affect unit tests in Framework targets (unit tests for App targets are unaffected). I have also tested this in fresh Framework template projects across multiple Macs, so it appears to be an Xcode bug. I'd hoped Xcode 13 would fix this issue, but it persists for me on Monterey. Perhaps someone could suggest a workaround?
Posted
by Lemontine.
Last updated
.
Post not yet marked as solved
8 Replies
4.1k Views
Hello, I'm in a big project app with unit testing and ui testing running well. Recently, one member of team, buy a MacBook Pro M1 with Big Sur 11.1 and try to execute the ui testing with the new Xcode 12.4 (available today 27/01/21 from Mac AppStore). When he selects any simulator with iOS 13.7 it's ok, but if he selects iOS 14.4 then fail. It doesn't matter if it's an iPad or an iPhone. The error talks about architectures but the settings haven't any custom config depends iOS version. Showing All Messages MYAPPUITests-Runner.app (72942) encountered an error (Failed to load the test bundle. If you believe this error represents a bug, please attach the result bundle at /Users/user/Library/Developer/Xcode/DerivedData/MYAPP-gefifpwdxlqqbidolncfjzimagfq/Logs/Test/Test-MYAPP-2021.01.27_23-13-22-+0100.xcresult. (Underlying Error: The bundle “MYAPPUITests” couldn’t be loaded because it doesn’t contain a version for the current architecture. The bundle doesn’t contain a version for the current architecture. Try installing a universal version of the bundle. dlopen_preflight(/Users/user/Library/Developer/Xcode/DerivedData/MYAPP-gefifpwdxlqqbidolncfjzimagfq/Build/Products/Debug-iphonesimulator/MYAPPUITests-Runner.app/PlugIns/MYAPPUITests.xctest/MYAPPUITests): no suitable image found.&#9;Did find: /Users/user/Library/Developer/Xcode/DerivedData/MYAPP-gefifpwdxlqqbidolncfjzimagfq/Build/Products/Debug-iphonesimulator/MYAPPUITests-Runner.app/PlugIns/MYAPPUITests.xctest/MYAPPUITests: mach-o, but wrong architecture)) Why it's ok with iOS 13.7 and why not with iOS 14.4 simulator?? Can you think something ? Regards.
Posted
by cplaza.
Last updated
.
Post not yet marked as solved
0 Replies
109 Views
Hello, I am developing a hybrid app and I am looking write UI tests. My scenario basically is - Launch the app Click Login button (which will open a Web page) Enter User details on the web page and click submit Now verify native components on app for successful login. What is the tool recommended by Apple to Automate above test?
Posted Last updated
.
Post not yet marked as solved
2 Replies
541 Views
After three days, I has not been possible to obtain this version from Apple, I can't stop or restart the process. Any tip will be very welcome. Thanks !!
Posted Last updated
.