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
0 Replies
47 Views
My iOS app consists of one app target and several local SPM packages. Previously, I had a test plan which only included the app target’s tests, while the packages’ tests were launched separately using the packages’ scheme names. Now, I’m trying to switch to test plans entirely. I included the test targets defined in the packages in the test plan. However, doing so resulted in the following error message, attributed to @testable import statements: Testing failed: Module '<***>' was not compiled for testing Command CompileSwiftSources failed with a nonzero exit code Testing cancelled because the build failed. If I understand it correctly, the error occurs because the Enable Testability (ENABLE_TESTABILITY) build setting defaults to NO, preventing the packages’ internal symbols from being exposed with @testable imports. Since Swift packages do not use Xcode project files, I’m confused about where I should define this setting. Besides that, testability is expected to be enabled only for test and not release builds, while Swift packages don’t support build configurations. Am I missing something? Is there a way to make Swift packages and test plans play nice together?
Posted
by
Post not yet marked as solved
0 Replies
51 Views
Recently we get more and more problems due to non bootstraping or starting simulator clones on parallel testing. Unit & UI-Tests were all successful but the status is failed, because of this errors 'The test runner encountered an error (Failed to prepare device 'Clone 1 of iPhone 12' for impending launch.' The test runner encountered an error (Failed to prepare device 'Clone 4 of iPhone 12' for impending launch. CI environments are MacMinis based on intel and apple silicons, with Xcode 13.3.1.
Posted
by
Post not yet marked as solved
0 Replies
45 Views
Hi When I run my tests using the Xcode IDE (i.e. test plans) with parallel execution, I can see that my tests are evenly distributed to multiple iOS simulators but the same is not achieved by using the xcodebuild tool using terminal xcodebuild test-without-building -parallel-testing-enabled YES -parallel-testing-worker-count 3 -maximum-parallel-testing-workers 3 -destination "platform=iOS Simulator,name=iPhone 13,OS=15.2" -xctestrun "/var/folders/x5/ps80s0290qv1j5hn53mvxsf00000gq/T/tmp.QB6StvRC/XCTest-Gherkin-Example_TestPlan1_iphonesimulator15.5-x86_64.xctestrun" -resultBundlePath "/var/folders/x5/ps80s0290qv1j5hn53mvxsf00000gq/T/tmp.QB6StvRC/GherkinLocal.xcresult"
Posted
by
Post not yet marked as solved
0 Replies
44 Views
hi, i want to install this app that isn't from the app store by using profiles, i install it and it works perfectly, next day i see a white screen when i enter the app, i tried re installing it and still white screen, soo i tried to install other profiles and i still see the white screen, pls help.
Posted
by
Post not yet marked as solved
2 Replies
105 Views
Whenever I click a View element in the Canvas, it just highlights the simulator bezels in blue and says "Multiple Selection" I've scoured the internet but can't seem to find anything about this. In the newer sub-view files I've created, clicking elements individually works as normal. I've checked just about every setting and there's no difference between those and my main ContentView where I'm experiencing the problem Editor > Canvas > Show Selection IS enabled I was trying to ignore it for a while but it's hard trying to tweak alignment of elements without being able to see their frames visually Xcode version: 13.4.1
Posted
by
Post not yet marked as solved
0 Replies
77 Views
Hi I am not sure if this issue needs to be posted here or somewhere else, I am working on Xamarin App, My App is working perfectly in debug mode. But when I am deploying it in release mode after launching the app is just freezing on the splash screen. I am not receiving any errors. I have tried different provisioning profiles as well, deploying the app with Ad hoc provisioning, ios developer, and ios distribution. Has somebody faced a similar kind of issue? How I can debug this issue or resolve this?
Posted
by
Post not yet marked as solved
0 Replies
107 Views
Getting error in XCUIApplication.launch() after deleting app between tests using Springboard. I created about 20 UI tests in a few different files. Every time a test ends I delete the app from the device using Springboard in the tear down func. When I execute one test at the time everything works fine and without any problems. But when I execute the whole testplan or all tests from one file I always get an error after the first time as soon as I try to launch the second test.  This is the error I receive every time: Failed to create directory on device 'iPhone' (device identifier) to hold runtime profiles for application with bundle ID ‚bundle ID': No matching application with bundle identifier ‚bundle ID' Domain: IDEFoundationErrorDomain Code: 17 User Info: {     DVTErrorCreationDateKey = "2022-06-30 11:42:41 +0000";     IDERunOperationFailingWorker = IDELaunchiPhoneLauncher; } My Springboard class looks like this  Setup looks like this  Tear down looks like this  The error always occurs in the setUpWithError func on line app.launch(). Does anyone know how to solve this problem?  Thanks in advance for any help or answers. best regards Stefan
Posted
by
Post not yet marked as solved
0 Replies
115 Views
Hello, We have multiple iOS real devices attached to a Mac mini which serve as a server in a CI pipeline. From iOS 15 after a few hours, the phone requires the pin code, even if the UI automation is enabled and the pin was set at the first run. A few mentions: We need to have a pin set because the app under test needs a pin for security reasons We set the display to never sleep because we cannot unlock the phone through the automation script For automation, we're using Appium (https://github.com/appium/appium) My question is, how can we handle the case without unlocking manual the phone considering that we're using the devices in a CI pipeline?
Posted
by
Post not yet marked as solved
1 Replies
144 Views
I installed iOS 16 on one of my devices to test my app on there. However in XCode it is shown as unsupported iOS version. And if I try to install the app through internal testing on TestFlight I get the massage that I have to activate the developer-mode. So how can I get the app on my iOS 16 device to test it there?
Posted
by
Post not yet marked as solved
1 Replies
247 Views
Hi, I'm currently researching if we are able to migrate to Xcode Cloud in our project. I encountered one issue. I run unit tests on Xcode Cloud and I see that they finish in ~150 seconds, but the whole step takes ~530s and there is no information in logs why. I even run the same command on my local computer and it doesn't take that long. Any ideas? Any way to optimize it? Also one more thing: it looks like Xcode Cloud is not running on M1 machines. Do you know guys if there are plans for Xcode Cloud to take advantage of M1/M2?
Posted
by
Post not yet marked as solved
0 Replies
131 Views
Are there commands for testing watch complications in XCUITest? So far I see that we can press the home button and rotate the Digital Crown in test As of Xcode Version 14.0 beta (14A5228q) the XCUITest record function doesn't work. Can't find anything in debugDescription to helpout either with reaching complications https://developer.apple.com/documentation/xctest/xcuidevice/button
Posted
by
Post not yet marked as solved
0 Replies
155 Views
I want to test app launch performance in my project. Therefore I tried to use performance test with measure func and XCTApplicationLaunchMetric. But after test completion there is no any result with average time. Here is a test example: func testLaunchPerformance() throws {         if #available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 7.0, *) {             // This measures how long it takes to launch your application.             measure(metrics: [XCTApplicationLaunchMetric()]) {                 XCUIApplication().launch()             }         }     } But when I create a new empty project and add the same performance test – it works and shows app launch results. 1st image is a real project test – there is no test result. and the 2nd image is a demo empty project test – it has performance result diagram. I am running test on MacBook with M1 Pro chip. However, when my colleague is running the same performance test on our real project with Intel based MacBook Pro – all is fine, it shows app launch results correctly as my demo project. I have no idea how it can be fixed, because it seems that it depends on M1 chip 🤷🏻‍♂️. May be somebody have a solution?
Posted
by
Post not yet marked as solved
1 Replies
232 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
Post not yet marked as solved
0 Replies
152 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
by
Post not yet marked as solved
1 Replies
137 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
Post not yet marked as solved
0 Replies
169 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
Post not yet marked as solved
0 Replies
141 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
Post not yet marked as solved
1 Replies
186 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
by
Post not yet marked as solved
0 Replies
203 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
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