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 XMaster.
Last updated
.
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 Last updated
.
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 Last updated
.
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 D1rtyDuck.
Last updated
.
Post marked as solved
1 Replies
262 Views
I'm using a Mac Mini as a Jenkins agent, which we use to run our Xcode tests on physical iOS devices. It's configured for remote access with SSH & screen sharing with VNC. Every few days they start failing completely. Sometimes one of them is up a bit longer, but more usually they're both down. If I look in the GUI it says it's running. The correct ports are listening. In Console I can see that the sshd process exits with 255 the instant it's started, but I haven't been able to get anything more specific. I've found that I can get SSH & VNC access back with launchctl bootout system/<svc name> launchctl disable system/<svc name> launchctl enable system/<svc name> launchctl bootstrap system <plist file name> The problem is that I can't tell from the remote device that it's not accessible by SSH/VNC. The different interfaces say that sure, everything's fine. When I do a launchctl print there are some differences between the non-working and working versions. I don't know if these are actual indicators that it's down, or artifacts of the way I restarted them. The differences are consistent for both VNC & SSH: Not working but apparently running: path = (submitted by smd.215) submitted job. ignore execute allowed. system service = 0 Working after launchctl stop/restart: path = /System/Library/LaunchDaemons/<plist file> system service = 1 So, a few questions: Has anyone else seen this? Is there some way to get more error information about why sshd is exiting in the logs/console? Is there a way to detect that sshd is failing, even though there's no system log entry for the failure, and the various interfaces show that everything's fine? What's the cleanest way to tell the system to restart remote access every day just in case it can't be identified any other way?
Posted
by kbrock.
Last updated
.
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 Azurin.
Last updated
.
Post not yet marked as solved
0 Replies
43 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 Last updated
.
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 Nesda.
Last updated
.
Post not yet marked as solved
3 Replies
1.8k Views
Hi I have installed IOS 15 beta and have problem with safari. The problem occurred when I closed one of the browser tabs, but when I turned on safari again, this tab came back. after I closed this tab a few times, the safari stopped working and I couldn't even turn on safari. When i click on the safari icon it won't turn on, it looks like i was opening and closing applications immediately safari before it loads.
Posted Last updated
.
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 _stefan_.
Last updated
.
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 alexki07.
Last updated
.
Post not yet marked as solved
3 Replies
634 Views
On an intel mac, my XCUITest test cases which is included swipe actions works perfectly but it doesn't work on my m1 mac. I tried running simulator with Rosetta but it doesnt work out it still gives an error when I run my cases because it clicks instead of swipe. Does anyone have a solution for swiping problem on the m1?
Posted
by beyz.
Last updated
.
Post not yet marked as solved
1 Replies
631 Views
HiThe app under test is localized and internationalized. So when device language is changed, strings displayed on the app are changed.I am trying to write test cases that work independent of the current language, in order to achieve this some of the static text/button labels have to be localized for the element query to work correctly.How can we achieve this? If I try to have all the strings in an external file, the bundle created for UITesting for some reason does NOT include this strings file.Can someone please shed light on how to include non-code files into UI Testing bundle?I tried having the file named as .json, .strings. It does not work.ThanksNaveen
Posted Last updated
.
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 Last updated
.
Post not yet marked as solved
0 Replies
130 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 romy-is.
Last updated
.
Post not yet marked as solved
1 Replies
306 Views
As far as I understand the typeText Function simply copies the value from Test script to the textbox. Is there a function that actually types ( Keyboard input ) to a textbox? I have been through multiple Apple Dev forums and Stack-overflow but was not able to find an answer, could you please guide me on the same?
Posted Last updated
.
Post not yet marked as solved
1 Replies
279 Views
I am trying to write a UI test for our app's IAP using a sandbox account. However, when trying to tap this purchase button, the test is unable to find this element: I've tried targeting this element by its button name and label name with no success. During the UI recording, when tapping this button, Xcode freezes completely and I am forced to shut Xcode down. I've also tried debugging at this step and when I print out "app.debugDescription" in the console, this button nor any of the other elements in this purchase drawer is returned. Failing line of code: app.buttons["Purchase"].tap() Error message: No matches found for Elements matching predicate '"Purchase" IN identifiers' Xcode Version: 13.2.1 iOS Version tested (real iPhone device): 15.3.1
Posted
by ed2311.
Last updated
.
Post not yet marked as solved
13 Replies
3.9k Views
I try adding people as Sandbox Testers to my App, but Apple keeps saying that they already exist on the team, even though they're not. It always show "A user with this email address already exists on the team" It keeps happening with every address I try.
Posted Last updated
.
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 jastic7.
Last updated
.
Post not yet marked as solved
9 Replies
2.7k Views
Following moving to Xcode 13 from 12.5, we are seeing our test coverage reported at ~1%, with only a small number of tests being reported in line with previous xcode builds. Is this a know issue? Are there steps we can take to debug or mitigate this? Nothing of note identified within the build log. Xcode 13 Coverage: Xcode 12 Coverage:
Posted Last updated
.