fitnessefitsharp

In FitNesse how can I run suite setup code for one suite only?


I want to run some suite setup code at the start of a particular suite. As I understand it a suite will run a SuiteSetUp page that is its sibling (ie next to it, in the same folder). However, that would mean the same SuiteSetUp page would also be run by other suites in the same folder.

How can I make a SuiteSetUp page that is run only by a single suite, say SuiteA, and ignored by other suites in the same folder as SuiteA?

If a SuiteSetUp page is not the best way to do this, what is? I only want to run the code once at the start of the suite, not at the start of each test, so I don't want to add the code to a test SetUp page.

I assume I can't just add the setup code to the first test page in the suite. From what I've read it seems the execution order of tests within a suite is not guaranteed, so the first test page in the suite may not always be executed before the other tests.


Solution

  • Place the SuiteSetup inside Suite A. It will be run before the first test of Suite A.