I've found another solution that I haven't seen listed here.
If you're subclassing XCTestCase
, change your class to inherit from that again, save the file, change it back to your subclass name. No clean or build needed.
For my project I've got a sublcass of XCTestCase
, let's call it APPMyTestCase
. I often find that the record button is greyed out and sometimes the little green/red buttons next to each test method don't appear either to be able to run them individually. If I change my subclass back to XCTestCase
for a second everything works again.
Change this:
class APPLoadingPageUITests: APPMyTestCase {
// tests here
}
To this:
class APPLoadingPageUITests: XCTestCase {
// tests here
}
And then back to this:
class APPLoadingPageUITests: APPMyTestCase {
// tests here
}
This fixed it for me.