-
XCTSkip your tests
Get the test results that matter — and skip the ones that don't. Discover how you can implement XCTSkip to conditionally avoid tests at runtime. We'll take you through how to return this new test result and better document tests beyond pass and fail within your test bundle.
To get the most out of this session, you should be familiar with XCTest and unit/UI testing. Watch “Testing in Xcode” for a primer.
Once you've learned about XCTSkip, learn more about improvements in testing: Watch "Triage test failures with XCTIssue", "Handle interruptions and alerts in UI tests", "Get your test results faster", and "Eliminate animation hitches with XCTest".
To learn how to improve your testing suites, check out "Write tests to fail".Recursos
Videos relacionados
WWDC22
WWDC20
- Eliminate animation hitches with XCTest
- Get your test results faster
- Handle interruptions and alerts in UI tests
- Triage test failures with XCTIssue
- Write tests to fail
WWDC19
-
Buscar este video…
-
-
5:45 - Use XCTSkipUnless to bypass a test on devices other than iPad
func testExample() throws { /// Example usage: skip test if device is not an iPad try XCTSkipUnless(UIDevice.current.userInterfaceIdiom == .pad, "Pointer interaction tests are for iPad only") // test... } -
5:58 - Use guard+XCTSkip to bypass a test on an older OS version
func testExample() throws { /// Example usage: skip test if OS version is older than iOS 13.4 guard #available(iOS 13.4, *) else { throw XCTSkip("Pointer interaction tests can only run on iOS 13.4+") // test... }
-