Post not yet marked as solved
97
Views
I want to receive the app's test result every day. In the case of Java, I think it's possible to implement it using Jenkins, so should I do the same for iOS?
Post not yet marked as solved
2k
Views
Hi
I need a way... to test my apps on the iOS simulator.
My was was generated by another way and he is my itunestoreconnect.
I can use Testflight on my iPhone to test it... but I need to test on my Mac directly
How doing this simple thing please ?
Post not yet marked as solved
334
Views
Hey there,
I am currently struggling with this problem.
When running UI tests for my iOS application I want to acquire an authentication token from an API first, in order to be directly authenticated while the tests run. For using that API I need a client secret, which, because it's a secret, needs to be kept in a secure storage. I can't have that client secret be just somewhere plain text in code or any other unsecured file (xcconfig, plist, ...). That's why I want to put that client secret into macOS' key chain. I also already found out how to access that secret from command line in a build phase script (like security find-generic-password -l ClientSecret -g).
What I also know is how to use launch arguments or environment during UI testing (like ProcessInfo().environment["clientSecret"]).
But I can't seem to find a way to make the connection between an environment variable that I set in a build phase or run pre-action script like
export CLIENTSECRET=$(security find-generic-password -l ClientSecret -w)
I tried using that environment variable like clientSecret=$(CLIENTSECRET) in scheme's launch arguments or environment variables, but that doesn't work for me.
Is it even possible to access the bash runtime env variables from within the scheme's arguments? Is there some other way?
Or is there alternatively a chance for me to access the macOS system keychain from the UI test Swift code?
Anyone having an idea? Please help!
Post not yet marked as solved
269
Views
Apple recommends testing on all target versions of iOS before distributing an app.We are able to test with iOS 8, 9, & 10 on simulators, but no longer have an iPhone with iOS 8 running on it.We have asked Apple Business Support for help finding an iPhone with iOS 8 running on it or help downgrading an iPhone to iOS 8.What is the Apple recommended way to be able to test on an iPhone with iOS 8 other than searching used iPhone marketplaces for an old iPhone running iOS 8 (i.e. never upgraded).Since testing on device is recommended, there must be a solution for helping developers do that, correct?
Post not yet marked as solved
173
Views
Let's say you are building a non-trivial macOS app. By non-trivial I mean an app consisting of several cooperating compontents (i.e. gGUI app, a command line tool, kexts or pivileged helper tools). What would be your approach to setup an automated testing framework for integration testing of such an app?
My current idea is to have a VM image running macOS, expose SSH and vnc access and try to use that as a scripting interface for test execution. What I'm concerned about is interacting with the OS UI (i.e. detecting privileged helper installation dialog and interacting with it), for which probably the way to go would be through VNC which seems like an extremely low level interface to script such an interaction through.
Post not yet marked as solved
190
Views
Hello! I've seen a year old thread on this with no solutions. I've uploaded my build to Testflight and my app is Waiting for review. This means internal users should be able to test it, however when i go to send the application to them it states there are no builds available. This is very frustrating, is there anything i've missed? Any help is greatly appreciated
Here is a screenshot - https://stackoverflow.com/questions/67109730/no-builds-available-in-testflight-for-internal-users of what it looks like when i go to send the build to my users
Thank you, Sofia
Post not yet marked as solved
155
Views
I am attempting to setup XCUI Automation for WatchOS application but it fails to launch the watch application.
Below are a couple of things i have tried out.
Created a UITesting bundle/target & attempted to add Target application as WatchOS target [but it doesn't allow selecting], so had to leave it as None.
2. Tried to pass the watchOS bundleIdentifier using
let app = XCUIApplication.init(bundleIdentifier: "com.mybundleid.mywatchapplication")
app.launch()
But i get the below error
Failed to launch com.mybundleid.mywatchapplication: The operation couldn’t be completed. Application info provider (FBSApplicationLibrary) returned nil for "com.mybundleid.mywatchapplication"
Post not yet marked as solved
2.8k
Views
We're running into an odd issue only when running our test suite on CI (Jenkins) with Xcode 12: xctest reports
xctest encountered an error (Failed to install or launch the test runner. If you believe this error represents a bug, please attach the result bundle at /Volumes/ebs_jenkins/workspace/xcode12-sandbox/derivedData/Logs/Test/Test-Xcode12Sandbox-2020.10.08_02-50-12-+0000.xcresult. (Underlying Error: Invalid device state))
Interestingly, this issue ONLY presents itself when initiated via SSH, when using Screen Sharing (VNC) and running the test suite via Xcode UI, tests pass as expected.
The tests also pass fine on the same CI machine with Xcode 11.5.
You can find a sample project that exhibits the problem here: https://github.com/opfeffer/xcode12-sandbox
Post not yet marked as solved
352
Views
I've noticed that XCTMemoryMetric & XCTCPUMetric seem to record empty or nonsensical data when running a UI test flow for an XCUIApplication.
I'm attempting to test the memory and CPU footprint for a SwiftUI iOS app using the following code:
Swift
func testBasicFlowMemory() throws{
let app = XCUIApplication()
app.launch()
var metrics:[XCTMetric] = []
metrics.append( XCTClockMetric() )
metrics.append( XCTMemoryMetric(application: app) )
metrics.append( XCTCPUMetric(application: app) )
self.measure(metrics: metrics){
/*Method which uses XCUI API to test the app instance*/
self.runBasicFlowTest(app: app)
}
}
When I run the test above, I notice runBasicFlowTest is executed 6 times (even though the metics only record 5 values.
Of the three metrics I wanted to track only XCTClockMetric returned meaningful data:
[Clock Monotonic Time, s] values: [114.728229, 114.944770, 121.813337, 116.394432, 117.491242]
XCTMemoryMetric mostly recorded 0.0 or nonsense data:
[Memory Physical, kB] values: [3596.288000, 0.000000, 0.000000, 0.000000, 0.000000]
[Memory Peak Physical, kB] values: [0.000000, 0.000000, 0.000000, 0.000000, 0.000000]
XCTCPUMetric likewise recorded 0.0 or nonsense data:
[CPU Instructions Retired, kI] values: [0.000000, 206223944.266000, 0.000000, 0.000000, 211895544.471000]
[CPU Cycles, kC] values: [0.000000, 252096240.472000, 0.000000, 0.000000, 257352232.305000],
[CPU Time, s] values: [0.000000, 86.585296, 0.000000, 0.000000, 0.000000]
I'm on Xcode Version 12.4 (12D4e), and my app is targeting iOS 14.4 on a simulated iPhone 11 Pro.
Has anyone had any luck using XCTMetrics with UI Tests?
Post not yet marked as solved
195
Views
In our project, we have Debug, Release, and Profile configurations. We use Profile configuration for testing. It inherits from the Release configuration but with debug symbols, few more features for profiling(as the name implies), and some UI tweaks.
The problem is that SKTestSession does not do anything in a non-debug configuration. If we run tests under Debug configuration, everything works as expected, but when we switch back to Profile, StoreKit testing doesn't work.
Is there any specific build setting(s) to get StoreKit testing work for non-debug configurations?
Post not yet marked as solved
273
Views
Hello,
Since Xcode 12, I can't see the test report popup when running performance tests. Therefore, I am not able to set the baseline anymore. This used to work fine in Xcode 11.
Here's an example:
swift
func testStoragePerformance() throws {
let application = XCUIApplication()
application.launch()
let storageMetric = XCTStorageMetric(application: application)
self.measure(metrics: [storageMetric]) {
self.runUIFlow(application: application)
}
}
When running the test above, Xcode shows the test as successful and that's it... Same thing happens with XCTCPUMetric and XCTMemoryMetric. It seems to only work with XCTClockMetric (baseline can be set then).
I am able to reproduce this bug on a new project created in Xcode 12.4.
I have reached out to people at Apple and also created a ticket in Feedback Assistant but I've never got any response.
Is anyone else experiencing the same issue? Is this a known bug?
Thanks
Post not yet marked as solved
1.1k
Views
All targets can see all my header files in the project if I just import them with #import "header.h", except my unit tests.
When editing the unit test the editor says file not found and marks the line in red.
However, when running the unit tests, it compiles, it runs, and it succeeds, which would be impossible if the header wasn't found. So the header is found when building the test but it isn't found when editing the test. How can I fix that?
Explicitly listing all directories with header files as User Header Search Paths solves the problem, but why do I have to do that? I don't have to do that with other targets and apparently Xcode can find the header on its own when building the unit tests.
It seems like Xcode is not using header map files when editing unit tests, only when building them. Yet it uses header map files everywhere else in the project and according to build settings it should use them for unit tests, too (settings have the same values as for all other targets).
I'm using Xcode 12 and the same issue exists in Xcode 12.2 Beta 2.
Post marked as solved
1k
Views
I'm a small-time app developer; I'm not likely to get access to the Developer Transition Kit. Despite that, I'd like to be able to test my macOS app on my existing Intel Mac, to make sure my apps will continue to work on Apple Silicon.
Is it possible to do a test my Apple Silicon compatibility today on my Intel Mac?
(I'm imagining something like running macOS Big Sur in a VM. It might perform slowly, but at least it would give me peace of mind to know that my app will work.)
Post not yet marked as solved
117
Views
Hi,
I have a Safari App Extension that I would like to create unit and UI tests for. I am not new to Swift or development, but admittedly I do not have a lot of experience writing tests. My app extension is in the Mac App Store, so I figured it's the prime candidate for learning.
Unfortunately I'm running into issues, namely that the extension doesn't have a host application (or so Xcode thinks), and so the UI tests fail to run:
language
Cannot test target “TweaksForRedditUITests” on “My Mac”: UITargetAppPath should be provided
If I go to the project browser and click on the UI test target, the target application is set to TweaksForReddit, which seems like it's correct. The other targets include TweaksForRedditExtension, TweaksForRedditUnitTests, and TweaksForRedditUITests.
I could probably "fudge" it and add a button to the main app's interface that opens the extension's popover view in a window for testing, but I'm mostly wondering if that's necessary.
Thanks!
Post not yet marked as solved
361
Views
We add new users to our list of testers, and some of them are still using iOS/iPadOS 12.5.1, probably because they have older hardware (as do I).
I was surprised today when one got the invite email, but was unable to load TestFlight because of the older iPad he is using.
I found today on my old iPad mini 2 that I could delete TestFlight and re-install (after saying OK to "using last compatible version"). But, I've read that this is likey because I have other devices that have TestFlight on them.
How can I support testing of my App on iOS 12 if my beta testers cannot get TestFlight? Is there a work-around?