FitNesse configuration files

泄露秘密 提交于 2019-12-05 08:33:05

Sure, easy to do. I'm assuming you're using the dotnet or dotnet2 test runner. I'm using the dotnet2 test runner, and here's how I've got it set up:

First, when you !define your COMMAND_PATTERN, include -c suite.config. For instance, I have the following in root:

!define COMMAND_PATTERN {%m -c suite.config %p}
!define TEST_RUNNER {..\..\bin\Debug\FitServer.exe}

suite.config goes in the same dir as fitnesse.jar:

<suiteConfig>
    <fit.Settings>
        <appConfigFile>..\..\MyProjectFolder\fitnesse\MyProjectName.config</appConfigFile>
    </fit.Settings>
    <fit.Assemblies>
    </fit.Assemblies>
    <fit.FileExclusions>
        <add>^\.svn$</add>
    </fit.FileExclusions>
    <fit.Namespaces>
    </fit.Namespaces>
    <fit.CellHandlers>
    </fit.CellHandlers>
    <fitlibrary.CellHandlers>
    </fitlibrary.CellHandlers>
</suiteConfig>

MyProjectName.config looks like this:

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
    <appSettings>
        <add key="keyname" value="something" />
    </appSettings>

</configuration>

You can make things easier for yourself if you use an absolute path for the appConfigFile. I started off with an absolute path, got things working, then switched to a relative path by trial and error.

Note that I'm running my test runner from a non-standard location, which will affect the relative path in suite.config. The path is relative to your TEST_RUNNER location, NOT to suite.config or fitnesse.jar.

yes it is possible but an awful load of work. you need to define a test-project where you have your tests in it and a "wrapper"-project where you have the functionality of providing the tests with data and configuration settings.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!