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

Can one read the GPU performance state from code? When set via Xcode device conditions?
I have QA doing testing with Xcode performance state, but to help catch human error, I'd like to abort the test if GPU Performance state condition is not actually active, or is wrong. Is there a way I can do that, from the iOS app itself? It seems like it doesn't not set any environment variable or anything to indicate it is active.
1
0
604
Jul ’23
Testflight error message: "Could not install app."
Testflight error message: "Could not install app. Your request couldn't be completed. Try again." I have tried installing TestFlight builds 7 times with different apps, but none have been installed. I have the latest TestFlight updates, so that is not an issue. I also referred to this link too to troubleshoot this: https://developer.apple.com/forums/thread/701330 I have not had any other issues with deploying the app. Can Apple fix this so we can install the TestFlight build?
0
0
1k
Aug ’23
[xcode 15, ios 17]UseDestinationArtifacts key does not work when used in xctestrun file to execute the test with test-without-building
I am using xcode 15 beta and ios 17 beta 6 and experiencing a bug where the key UseDestinationArtifacts does not work when used in an xctestrun file to execute the test with the test-without-building flag. When I set the UseDestinationArtifacts key to true in my xctestrun file and run the tests with the test-without-building flag, Xcode throws the below error Testing failed: Application Bundle Not Found Runner encountered an error (Failed to install or launch the test runner. (Underlying Error: Application Bundle Not Found. Configure the path to a bundle to be installed on the device.)) **UseDestinationArtifacts works smoothly on ** xcode version<15 xcode 15 + ios 16 I have attached a reproduction of the bug. Steps to reproduce: Update below keys in xctestrun file remove DependentProductPaths, TestHostPath, UITargetAppPath Add UseDestinationArtifacts, TestBundleDestinationRelativePath, UITargetAppBundleIdentifier
4
4
1.1k
Aug ’23
[UI Testing] Verify Local Notifications When App Is Terminated
When my app is terminated, a warning is immediately presented to the users. I want to write a UI test for this behavior. I now have an XCUI application, I know I can terminate the app using terminate()from XCTest. After the XCUI application is terminated, a local notification should show up. Is there any way to access the notification and verify its existence and content?
1
0
438
Sep ’23
How can I effectively utilize XCUITest, , to conduct UI tests for iOS applications on the pCloudy platform?
In the context of iOS development, I've been leveraging XCUITest for UI automation. Given its native support from Apple, it's been instrumental in ensuring our app's UI consistency. Now, I'm looking to scale our testing efforts. How can I integrate XCUITest with the pCloudy platform to run these tests, and are there any specific considerations or best practices I should be aware of when doing so?
0
0
326
Aug ’23
Headless Game Center Testing
Hello, We have an API that wraps around Game Center API and we would like to have automated tests for our API. The test would need to run in a remote data center, so there is no way to perform manual test steps. Ideally, we would want to simulate sign in and sign out, test achievements and game saves without the need for any manual input. Running in the simulator should be enough for our use case, though we could also use real devices if necessary. Is there any way to accomplish that?
0
0
427
Sep ’23
The wrong BLE channel calculation of iphone13 pro
I am using iphone13 pro to connect with nxp kw45(one BLE SOC chip) demo board as master, but found the KW45 side report 0x3E error(CONNECTION TIMEOUT), I record the log with Ellysis, which shows the BLE channel calculation is not right which lead to the error. The hop increment is 8, channel map is 1-3, 6-33, 36, in Frame 45093, the channel number should be 9, not 8. connection interval is 30ms. My question is it normal, any advice? Note: This problem is sporadic, not easy to reproduce.
0
0
491
Sep ’23
Preboot simulators in parallel testing
We run our UI tests in parallel on 3 simulators, and I noticed, that the first one starts executing tests way faster then the rest (because others are still booting, I guess). Also we have our backend server running locally which is used in UI tests. And here comes the problem - I noticed that tests on first simulator are often failing because of the problems with local backend(requests take much more time than usual) exactly in period when other simulators are still booting(tests stop failing when all 3 simulators started running tests). When I tried running tests without parallel simulators problems with backend disappear. So my guess is that simulators booting they take some resources(CPU, memory) which interferes with backend. So my question is there some way to start executing tests only when all parallel simulators are booted?
0
0
364
Sep ’23
XCUIElementTypeToolbar disappears from the page source
I have a problem with test automation of my company app. We're using an external tool called Appium to automate our app, but under the hood it's using XCTest to obtain page source, and it looks like it might not work correctly, or we're doing something wrong. The problem is that since iOS 16.4 XCUIElementTypeToolbar is completely disappearing from the page source XCTest provides to Appium. What's even stranger, it's working when the app is opened for the first time after the phone restart. But when the app is simply put to background and opened again, this toolbar is no longer recognizable and instead of having XCUIElementTypeToolbar with arrows up and down and "Done" button inside it, XCTest returns only XCUIElementTypeOther there with nothing inside. And the only thing to have it found again is to restart the phone. It's happening in WebView. We are aware that since iOS 16.4 inspectable for WebViews is turned off by default (link to docs), but we have it implemented, and it did not help. It was working perfectly correct on iOS 16.3 and below, but completely stopped working on iOS 16.4 and above. Do you have any ideas if it might be anything done incorrectly on our side, or it's maybe some kind of bug in XCTest?
1
0
266
Sep ’23
Sandbox testing
In order to conduct sandbox in-app purchase testing, a testuser needs to be added to Apple Connect. This user cannot be me. It has to be someone who is NOT associated with ANY other developer account. Otherwise you'll get an error while adding test-user. So, I tried to create a new iCloud user. I confirm the email, verify phone number with an SMS, and then within 10 minutes, I'm locked out from this new account out because the "verification fails". Is Apple's logic that, in order to test an in-app purchase in sandbox, one needs to purchase a new device and create a new iCloud account under another person's name and also make a new SIM-card so the phone number would be fresh?
0
0
305
Sep ’23
How to test against non-iOS17 SDKs with Xcode15 series command line tools?
Hello. I would like to perform UnitTest using the xcodebuild command in Xcode15 series, but it does not work. Specifically, I want to run the test on an iPhone 14 with iOS 16.4 simulator environment, but for some reason it fails due to a certificate mismatch. For some reason I don't want to test on iOS17, so I specify iOS16.4. The following is a pseudo-command to run the test. Thank you! xcodebuild -workspace AppWorkspace.xcworkspace -scheme App -sdk iphonesimulator -destination "platform=iOS Simulator,name=iPhone 14,OS=16.4" -configuration TestConfiguration test
1
0
532
Oct ’23
Need to register devices of external testflight users?
Based on Apple, you can only register up to 100 devices. And you can only remove devices at the beginning of a membership renewal cycle. However in testflight, you can create up to 10,000 external testers. AFAIK, you need to register your device in order to create the provisioning profile for you to be able to install the app from testflight on your device. So question is, do external testers need to have their devices registered, to be able to install the app on their phone? Or is it not necessary to register their devices? If they need to register their devices, then what good would it do to be able to create 10,000 external testers since only 100 of them can install the app?
0
1
413
Oct ’23
Xcode test coverage for Swift APIs that don't have explicit body
Hi all, I'm looking for a way to get test coverage for the Swift APIs that don't have explicit implementations (e.g., properties, enum cases, type names, protocols, etc). Specifically, to understand whether they are used during execution or not. It looks like Xcode 14 skips all mentioned Swift constructs in the coverage report both in Xcode UI and in the .xccov file produced from .xcresult. Is there any way to get it?
0
0
292
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
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