简体   繁体   English

如何在FitSharp中获取FitNesse根目录或页面文件夹

[英]How to get FitNesse root or page folder in FitSharp

Recently I encountered this problem and have searched a lot but no solution by now. 最近,我遇到了这个问题,并且进行了很多搜索,但到目前为止没有解决方案。 Does somebody know how I can get the root directory or the page folder of FitNesse in FitSharp fixture codes? 有人知道如何在FitSharp装置代码中获取FitNesse的根目录或页面文件夹吗? One of the troubles is that we have a lot of existing pages arranged in different suites and I want to add some new features to all these pages requiring an absolute path of FitNesse folder. 麻烦之一是我们有很多现有页面,这些页面安排在不同的套件中,我想为所有这些页面添加一些新功能,而这些功能需要FitNesse文件夹的绝对路径。 Using a fixture together with the environmental parameter in pages could require a lot of effort. 将固定装置与页面中的环境参数一起使用可能需要很多工作。 I was even trying to use hard configuration in app.config for example! 例如,我什至尝试在app.config中使用硬配置!

Big thanks in advance! 预先感谢! Looking forward to your kind answer. 期待您的回答。

The root path is available as a FitNesse predefined variable. 根路径可用作FitNesse预定义变量。 Pass that into a fixture that can expose it as a property. 将其传递到可以将其作为属性公开的固定装置。 This could go in a setup page. 这可以进入设置页面。

|rootpath|
|load|${FITNESSE_ROOTPATH}|

public class RootPath {
  public static string Path;
  public void Load(string value) { Path = value;}
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM