Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xcode Test Not Appearing in Test Navigator [closed]

Tags:

xcode

ios

xctest

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?

like image 283
Charlie Fish Avatar asked Dec 08 '22 16:12

Charlie Fish


2 Answers

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.

like image 186
Stephen Avatar answered Dec 11 '22 10:12

Stephen


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.

like image 36
Rajan Maharjan Avatar answered Dec 11 '22 09:12

Rajan Maharjan