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

Posts under Testing tag

110 Posts
Sort by:

Post

Replies

Boosts

Views

Activity

XCode Cloud ignores maximumTestExecutionTimeAllowance specified in test plan
I've created a test plan that includes the below configurations. {"configurations": [{ ... "options": { "defaultTestExecutionTimeAllowance" : 60, "maximumTestExecutionTimeAllowance" : 60, "testTimeoutsEnabled" : true }], "defaultOptions": { "defaultTestExecutionTimeAllowance" : 60, "maximumTestExecutionTimeAllowance" : 60, "testTimeoutsEnabled" : true, .... } ... } If I write a test that intentionally will take longer than 60 seconds, executing the test locally fails as expected with the error message Test exceeded execution time allowance of 1 minute let app = XCUIApplication() app.launch() let missingButton = app.buttons.firstMatch XCTAssertTrue(missingButton.waitForExistence(timeout: 120), "When a timeout is > 60 seconds, the default max setting of 60 seconds is still enforced") However, when this test is run using this test plan in XCode Cloud, it reports that it took 124 seconds to run and there is no message about exceeding execution time allowance. How can the test step be configured in XCode Cloud to ensure that the execution time allowances are respected?
1
0
2.2k
Jan ’24
"Cycle inside Runner; building could produce unreliable results." Xcode Error
Hi! I'm trying to run my Flutter code natively on my iPhone, but whenever I try to run it, I keep get the following error message: Error (Xcode): Cycle inside Runner; building could produce unreliable results. Cycle details: → Target 'Runner': ExtractAppIntentsMetadata ○ Target 'Runner' has copy command from '/Users/matthewlee/flutterflow/AppName/build/ios/Debug-iphoneos/ImageNotification.appex' to '/Users/matthewlee/flutterflow/AppName/build/ios/Debug-iphoneos/Runner.app/PlugIns/ImageNotification.appex' ○ Target 'Runner' has compile command with input '/Users/matthewlee/flutterflow/AppName/ios/Runner/Base.lproj/LaunchScreen.storyboard' ○ That command depends on command in Target 'Runner': script phase “Thin Binary” ○ Target 'Runner' has process command with output '/Users/matthewlee/flutterflow/AppName/build/ios/Debug-iphoneos/Runner.app/Info.plist' I've been trying to rearrange my Build Phases in Xcode, but nothing has seemed to work yet. How do I fix this issue preventing my app from running?
1
0
765
Dec ’23
Installing Sonoma 14.1.2 fails
I have an installer downloaded from the App Store a few weeks ago for macOS Sonoma 14.1.2 (I've made copies for testing purposes), but today I have been unable to install it on a volume - an experiment I had been conducting repeatedly last week. Is Apple blocking 14.1.2 from being installed now? (Sonoma 14.2 is the version currently available from the App Store) Have I reached some kind of limit on the number of times I can install it? Any other ideas? Here is the alert: Note: the problem I am testing is an issue with an app installed from TestFlight (that contained a network system extension) that killed networking when the OS was updated from Sonoma 14.1.2 to Sonoma 14.2. (related post)
0
0
477
Dec ’23
Creating a Dummy Apple ID for App Testing: Best Practices and Developer Strategies
Hello everyone! I have a question (issue). I need to write a test for an app, and everything is okay with my tests, but I need to test login with an Apple ID, and I don't want to use my private Apple ID because I plan to post this test on GitHub. Is there any possibility to create, for example, a dummy Apple ID account? Or how do developers typically handle this situation?
0
0
539
Dec ’23
macOS installers from Mac App Store for testing purposes
I'm starting to set up a testing environment for macOS applications, and I want to be able to rollback to different versions of the OS (all machines can be scrubbed, so I don't worry about preserving user data). I noticed that I can download the latest versions of Ventura and Sonoma from the Mac App Store, but not past versions of Ventura and Sonoma Is there a way to download earlier versions of these macOSes (or maybe even earlier ones like Monterey)? Alternatively, if I regularly start downloading macOS installers from the Mac App Store and maintain my own local copies so I can use these to rollback to these versions, do I need to download a version for each hardware? For example, I currently have an M1 Mac mini, an M2 Mac mini, and an M1 Mac Studio. Do I need to download different installers for each of these hardware platforms?
0
0
393
Dec ’23
Run UI tests on multiple devices in succession?
The new test report, with the automatic video recording and scrubber, is great. I'm setting up different configurations for different languages to improve localization testing, but I was wondering if it was possible to make the simulator device type part of the configuration. For example, I'd like to have a single test plan with an "iPhone 14" test plan, an "iPad Air" test plan, etc. Then I would just press Cmd-U, and Xcode would run through each device in sequence, leaving me with videos of each test run that I could review in the test report. Is that possible?
2
0
1.7k
Nov ’23
iOS Simulator Performance Issues
I have noticed that, as of late, the iOS simulator has been incredibly slow. Even simple (and perhaps silly) actions like changing the wallpaper take an unreasonably long time, to the point where it is no longer clear whether the process has hanged. I tried to change the wallpaper to a photo of mine, but it simply would not appear. Even booting up takes several seconds, and home screen animations are laggy. I've given up on testing my build for now. I have tried with an iPhone Xr and an iPhone 15 Pro simulator - both running iOS 17.0. Both are extremely laggy. This is on an M1 MacBook Air running the stable version of macOS Sonoma 14.0. with Xcode version 15.0.1 and Simulator version 15.0.1. I have checked the Activity Monitor for CPU and RAM. There is nothing abnormal. I would appreciate any suggestions.
1
0
583
Nov ’23
Intermittent "Operation not permitted", "Unable to start the server" error while running 'safaridriver'
I'm encountering an intermittent issue while trying to run safaridriver on macOS Sonoma. Here are the details of the problem: I ran sudo /usr/bin/safaridriver -p0 --enable in the beginning. After that when I run this multiple times /usr/bin/safaridriver -p0, I sometimes receive an "Operation not permitted" error, but not consistently. This issue seems to occur intermittently. I've checked the sudo logs, and I see the following error message: kernel: (Sandbox) Sandbox: com.apple.WebDriver.HTTPService(2049) deny(1) user-preference-write com.apple.WebDriver.HTTPService cfprefsd: (CoreFoundation) [com.apple.defaults:cfprefsd] rejecting write of key(s) MobileDeviceRemoteXPCEnabled in { com.apple.WebDriver.HTTPService, nimish, kCFPreferencesAnyHost, /Users/nimish/Library/Preferences/com.apple.WebDriver.HTTPService.plist, managed: 0 } from process 2049 (com.apple.WebDriver.HTTPService) because setting these preferences requires user-preference-write or file-write-data sandbox access cfprefsd: (CoreFoundation) [com.apple.defaults:cfprefsd] Couldn't open parent path due to [2: No such file or directory kernel: (Sandbox) Sandbox: com.apple.WebDriver.HTTPService(2049) deny(1) network-bind local:*:7055 com.apple.WebDriver.HTTPService: (WebDriver) [com.apple.WebDriver:WebService] Error starting HTTP server listening on localhost:0: Error Domain=NSPOSIXErrorDomain Code=1 "Operation not permitted" UserInfo={NSLocalizedDescription=Operation not permitted, NSLocalizedFailureReason=Error in bind() function} com.apple.WebDriver.HTTPService: (WebDriver) [com.apple.WebDriver:XPCService] Client connection invalidated for some reason I am getting this on Mac Os Sonoma Can anybody please help on this?
0
2
677
Nov ’23
Transitioning Data from Development to Production Environment in CloudKit
In order to load your data into the production environment in Apple CloudKit, follow the steps below: Deploy Your Schema: Initially, deploy your schema to the production environment using the recommended approach provided by Apple. Prepare for TestFlight: Retain all the codes and views utilized previously for uploading data to the development environment. Deploy your app to TestFlight. TestFlight Approval and Data Transition: Upon receiving approval and ensuring the functionality on TestFlight, the same codes and views that were used to upload data to the CloudKit records in the development environment will now point to the production environment. Consequently, all the data will be uploaded to the production environment, facilitating a smooth transition. Post this process, your app on TestFlight will interact with the data in the production environment of CloudKit, ensuring consistency and enabling effective testing. This method ensures a seamless transition of data from the development environment to the production environment, aligning with the operational flow of CloudKit and TestFlight.
1
0
455
Oct ’23
Cannot Run Test Plan on CI tool
Hello, I am looking for help with using TestPlans in my ci tool. My workspace consists of my main project and 2 frameworks, that are linked to my main project. I am using fastlane to run the test plan associated with my main app's scheme, which has my main project's test suite and my 2 frameworks' test suites. When using fastlane locally, it seems to build every test suite and run tests accordingly, but on my CI tool (I am using CircleCI), it just runs my main project's test suite. Can I get some help on this? I have tried to add a failing test to my CI tool and the tests still pass. Any help is much appreciated!
0
0
603
Oct ’23
Data Migration from Development to Production in CloudKit for TestFlight Testing
I've developed an app utilizing substantial data uploaded to a CloudKit record in the development environment. Having deployed the Record Type schema to production and released a TestFlight version for testing, how can I transfer the data from the development to the production environment, or upload the data directly to the production environment? This is crucial as TestFlight testers can only access data from the production environment.
0
0
384
Oct ’23
How to check no network cases in iOS simulator in UI testing automation
In my iOS app, When the API calls failed due to poor network, the app will display 'No network error screen'. I have to check if this error screen is displayed correctly or not in case of poor network, in automation testing using simulator. But I couldn't find any possibility to turn off internet manually in simulator and check whether the 'No network' screen displays. I installed 'Network Link Conditioner' in macOS and tried using it on simulator. But, in simulator settings -> developer , there is no section called "Network Link Conditioner" to handle this in simulator. So, is there any other solution to handle this network case in simulator ?
1
0
635
Oct ’23
How to create an xccovreport from an xcresult bundle.
We are having an issue when trying to view the the coveage report in our "merged result bundle" Running xccov view --report --only-targets merged.xcresult results in: 09:52:54 Error: Error Domain=XCCovErrorDomain Code=0 "Failed to load coverage archive in scheme action '(null)' in result bundle" UserInfo={NSLocalizedDescription=Failed to load coverage archive in scheme action '(null)' in result bundle, NSUnderlyingError=0x7f8ff8714f30 {Error Domain=NSCocoaErrorDomain Code=260 "The file “Metadata.plist” couldn’t be opened because there is no such file." UserInfo={NSFilePath=/tmp/action.xccovarchive/Metadata.plist, NSUnderlyingError=0x7f8ff8714930 {Error Domain=NSPOSIXErrorDomain Code=2 "No such file or directory"}}}} Checking the man page for xccov I was inspired by the idea of extracting the coverage report from the result bundle to try to understand or work around our error. The man xccov page states that If xccov is passed a result bundle directly, it will extract the report or archive implicitly, as part of the action being requested. Alternatively, the raw report/archive files can be extracted from the result bundle using xcresulttool(1) and subsequently passed to xccov. Checking man xcresulttool and trying out some stuff randomly I was not able to learn how a person might: Given an xcresult bundle use xcresulttool to create/extract an xccovreport bundle.
7
4
3.1k
Oct ’23
XCUITest "MyApp" Would Like to Access Your Photo Library
I can't work out how to deal with the dialog presented when an app first tries to access a photo library: This screenshot shows the dialog still presented after the app has quit, which suggests to me that it's a system-level rather than app-level dialog; but the handler for addUIInterruptionMonitor(withDescription:handler:) isn't called (whereas it is for both the "Allow MyApp to use your location?" and "MyApp Would Like to Send You Notifications" dialogs). But nor does it appear to be an app-level dialog under XCUIApplication. How can I handle this dialog in my UI testing? Thanks, Hamish
0
0
611
Oct ’23
Archiving failing: Multiple commands produce GoogleUtilities.framework
Hi friends, I have a problem suddenly by archiving my app in XCode 14.3 I'm getting this errors: Showing All Errors Only Prepare build note: Building targets in dependency order error: Multiple commands produce '/Users/razvanu/Library/Developer/Xcode/DerivedData/Runner-aeiwqtydtcicmbcjpyzoxtfwhzig/Build/Intermediates.noindex/ArchiveIntermediates/Runner/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/GoogleUtilities.framework' note: Target 'GoogleUtilities-00567490' (project 'Pods') has create directory command with output '/Users/razvanu/Library/Developer/Xcode/DerivedData/Runner-aeiwqtydtcicmbcjpyzoxtfwhzig/Build/Intermediates.noindex/ArchiveIntermediates/Runner/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/GoogleUtilities.framework' note: Target 'GoogleUtilities-54e75ca4' (project 'Pods') has create directory command with output '/Users/razvanu/Library/Developer/Xcode/DerivedData/Runner-aeiwqtydtcicmbcjpyzoxtfwhzig/Build/Intermediates.noindex/ArchiveIntermediates/Runner/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/GoogleUtilities.framework' Multiple commands produce '/Users/razvanu/Library/Developer/Xcode/DerivedData/Runner-aeiwqtydtcicmbcjpyzoxtfwhzig/Build/Intermediates.noindex/ArchiveIntermediates/Runner/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/GoogleUtilities.framework' I tried all the solutions that I found, nothing works for me :( please guide me how to fix this issue, thanks in advance!
2
2
1.1k
Oct ’23
Xcode 14.3.x and Xcode 15 - slather code coverage folder missing
Hi everyone Premise: it works with Xcode 14.2 I have a problem with fastlane and slather, it gives me an error that it cannot find the "code coverage folder" Here are some details Fastlane file slather( build_directory: "./DerivedData", scheme: "MyApp", workspace: "MyApp.xcworkspace", proj: "./MyApp.xcodeproj", output_directory: "./DerivedData/testResult", cobertura_xml: true, verbose: true ) Error: Exit status of command 'slather coverage --cobertura-xml --build-directory ./DerivedData --output-directory ./DerivedData/test-output/slatherOutput --ignore Pods/\* --ignore fastlane/\* --ignore build/\* --ignore DerivedData/\* --verbose --scheme ProjectName --workspace ProjectName.xcworkspace ./ProjectName.xcodeproj' was 1 instead of 0. Slathering... /usr/local/lib/ruby/gems/3.0.0/gems/slather-2.7.4/lib/slather/project.rb:239:in `profdata_coverage_dir': No coverage directory found. (StandardError) from /usr/local/lib/ruby/gems/3.0.0/gems/slather-2.7.4/lib/slather/project.rb:517:in `find_binary_files' from /usr/local/lib/ruby/gems/3.0.0/gems/slather-2.7.4/lib/slather/project.rb:336:in `configure' from /usr/local/lib/ruby/gems/3.0.0/gems/slather-2.7.4/lib/slather/command/coverage_command.rb:59:in `execute' from /usr/local/lib/ruby/gems/3.0.0/gems/clamp-1.3.2/lib/clamp/command.rb:66:in `run' from /usr/local/lib/ruby/gems/3.0.0/gems/clamp-1.3.2/lib/clamp/subcommand/execution.rb:18:in `execute' from /usr/local/lib/ruby/gems/3.0.0/gems/clamp-1.3.2/lib/clamp/command.rb:66:in `run' from /usr/local/lib/ruby/gems/3.0.0/gems/clamp-1.3.2/lib/clamp/command.rb:140:in `run' from /usr/local/lib/ruby/gems/3.0.0/gems/slather-2.7.4/bin/slather:17:in `<top (required)>' from /usr/local/lib/ruby/gems/3.0.0/bin/slather:25:in `load' from /usr/local/lib/ruby/gems/3.0.0/bin/slather:25:in `<main>' No coverage directory found. Are you sure your project is generating coverage? Make sure you enable code coverage in the Test section of your Xcode scheme. Did you specify your Xcode scheme? (--scheme or 'scheme' in .slather.yml) If you're using a workspace, did you specify it? (--workspace or 'workspace' in .slather.yml) If you use a different Xcode configuration, did you specify it? (--configuration or 'configuration' in .slather.yml) Any ideas in order to fix this issue? Thanks
3
1
1.7k
Oct ’23