|
How do I make unit tests for watchOS app? From what I found for now I know that XCTest framework doesn't support watchOS and WatchKit currently. However, maybe are there any workarounds for that problem to test at least some code? I would like to test app with SwiftUI interface and lifecycle. |
|
|
|
This become possible literally yesterday – watchOS unit tests are now supported in Xcode 12.5 beta! |
|
@Malauch, @alfielefeuvre did you succeed in making WatchOs unit tests with Xcode 12.5 ? I tried to make a very simple dummy test
Then, change the active scheme to the WatchKit ExtensionTests scheme But, everytime I run the test, I have an XCode crash - Xcode quit unexpectedly Do you have the same issue? |
|
The way you configure your tests files is different from iOS. The apple documentation is very well written and detailed: https://developer.apple.com/documentation/watchkit/setting_up_tests_for_your_watchos_app You should have a look |
|
The above documentation page has moved here: https://developer.apple.com/documentation/watchos-apps/setting-up-tests-for-your-watchos-app For me, I needed to edit by test scheme and set the executeable under run. |
|
I am new in this forum. I have some questions about this forum. These questions are shown below😉😉 : https://www.hackingwithswift.com/forums/watchos/how-do-i-make-unit-tests-for-watchos-app/3728 If anyone has information about this thread. Please guide me below. I am very confused about that😥😥. |
GO FURTHER, FASTER Unleash your full potential as a Swift developer with the all-new Swift Career Accelerator: the most comprehensive, career-transforming learning resource ever created for iOS development. Whether you’re just starting out, looking to land your first job, or aiming to become a lead developer, this program offers everything you need to level up – from mastering Swift’s latest features to conquering interview questions and building robust portfolios.
Sponsor Hacking with Swift and reach the world's largest Swift community!
This topic has been closed due to inactivity, so you can't reply. Please create a new topic if you need to.
All interactions here are governed by our code of conduct.
Link copied to your pasteboard.