I got fitnesse.jar from http://fitnesse.org and put it in C:\apps\fitnesse. I got the latest fitSharp release from http://github.com/jediwhale/fitsharp and unzipped it into c:\apps\fitnesse\dotnet.
I created a Visual Studio solution in c:\projects\fitsharpsample. I added a class library project called Fixtures. I added references to fit.dll and fitsharp.dll from c:\apps\fitnesse\dotnet. I added a class called SampleDo:
using fitlibrary;In my solution folder, I created a fitnesseRoot folder. I created a file fitnesse.cmd to run FitNesse:
namespace Fixtures {
public class SampleDo: DoFixture {
public string Greeting { get { return "hi"; } }
}
}
java -jar \apps\fitnesse\fitnesse.jar -p 8080 -d "c:\projects\fitsharpsample" -r fitNesseRootI created a configuration file storytest.config.xml:
pause
<suiteConfig>In my browser, I went to http://localhost:8080 and clicked the root link and edited the root page to contain:
<Settings>
<Runner>fitnesse.fitserver.FitServer</Runner>
</Settings>
<ApplicationUnderTest>
<addNamespace>Fixtures</addNamespace>
<addAssembly>c:\projects\fitsharpsample\build\debug\Fixtures.dll</addAssembly>
</ApplicationUnderTest>
</suiteConfig>
!define TEST_RUNNER {c:\apps\fitnesse\dotnet\Runner.exe}I added a SampleTest page in FitNesse:
!define COMMAND_PATTERN {%m -c c:\projects\fitsharpsample\storytest.config.xml %p}
|sample do|I ran the test and all green!
|check|greeting|hi|
Assertions: 1 right, 0 wrong, 0 ignored, 0 exceptions (0.000 seconds)
sample do | ||
check | greeting | hi |
Hi,
ReplyDeleteI am getting the below error. Pl guide me where I am wrong. I created fitnesse.config.xml file(application configuration file) and rest part done in the same way.
Error:
Missing runner class
Usage:
Runner -r runnerClass [ -a appConfigFile ][ -c runnerConfigFile ] ...
I just leave a comment because I came across the same message.
DeleteOne thing that could be happening is that the paths which you set on the root page could include some spaces. If this is the case, you need to be surrounded each path by double quotations.
Is your root page correct?
ReplyDeleteThanks. This got me going quickly
ReplyDeleteThank you for your article.
ReplyDeleteHowever, once I had a bit trouble that raised an exception for a missing Fixture Type.
There was a trap at the following setting in my environment:
!define COMMAND_PATTERN {%m -c c:\projects\fitsharpsample\storytest.config.xml %p}
Because I had my storytest.config.xml in my Visual Studio project folder "C:\Users\Shinichi\Documents\Visual Studio 2015\Projects\TestableForms\FitSharpSample".
The folder path contained SPACE character.
So I had to rewrite that setting with double quotes:
!define COMMAND_PATTERN {%m -c "C:\Users\Shinichi\Documents\Visual Studio 2015\Projects\TestableForms\FitSharpSample\storytest.config.xml" %p}
Then, it worked! (All Green!!)
Anyway, this article is very helpful for me.
Thank you very match.