I just wrote a new test in my XCTestCase
class. The original two default tests run perfectly. But for some reason Xcode isn't detecting the new test I just wrote.
It doesn't appear in the left side Test Navigator and doesn't appear in the Scheme test section.
How can I get Xcode to detect this new test so I can run it?
Apple Documentation: A test method is an instance method on an XCTestCase subclass, with no parameters, no return value, and a name that begins with the lowercase word test. Test methods are automatically detected by the XCTest framework in Xcode.
Make sure your method has test
at the start of the name.
This happened to me as well. The problem was my "ABCScreenTest" file was not added to target membership to particular Test Suite. After adding them, the diamond appeared and file was testable. I am using Xcode 9.4.1. Thanks.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With