Quick / Nimble

A Matcher Framework for Swift and Objective-C
https://quick.github.io/Nimble/documentation/nimble/
Apache License 2.0
4.81k stars 598 forks source link

Use Quick/Nimble and Xcode test plans #1041

Closed VillSkog closed 1 year ago

VillSkog commented 1 year ago

This is maybe more a question than an issue, but I have been trying to setup my project to use test plans. I am facing the issue that the spec function is not showing in the list of selectable test for a test plan. I can select the files but not the test inside, so my test plans ends up not running any test.

Has anyone been able to use test plans with Quick/Nimble ?

younata commented 1 year ago

Yes, you can successfully use test plans with Quick & Nimble.

Because of how Xcode detects test functions (they have a preprocessor that essentially does a text search for methods in XCTestCase subclasses with test at the beginning of them. Additionally, Xcode also caches test functions from the last run. This is the same reason why test methods from Quick do not show up in the test navigator/sidebar until after they've run at least once.

I just created a brand new test plan for one of my projects and it was able to populate with tests. I'm curious, do you have "automatically include new tests" enabled for your test plan (which is enabled by default)? If you have that disabled, that might be why test methods from Quick aren't being run?

VillSkog commented 1 year ago

Hi @younata, thank you for the quick response. I actually realised this morning that I had a test using fit and which wasn't part of my test plan. This is what was causing all tests in my test plan not to be run. All good now, I could setup my test plans how I wanted to :)